1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
22 <title>Shindig - an Apache incubator project for OpenSocial and gadgets
</title>
23 <style type=
"text/css">
25 font-family: arial
, sans-serif
;
28 border: 1px solid lightgray
;
32 border-top: 5px solid lightgray
;
39 background-color: #3366EE;
46 background-color: lightgray
;
65 <script type=
"text/javascript">
66 var APPLICATION_TABS
= ['home', 'download', 'building', 'contribute', 'support'];
67 var tabAnchorPrefix
= "#tab-";
69 function changeActiveTab(activeTab
, updateAnchor
) {
70 if (activeTab
=== undefined)
73 location
.href
= tabAnchorPrefix
+ activeTab
.id
;
74 for (var idx
in APPLICATION_TABS
) {
75 var tab
= APPLICATION_TABS
[idx
];
76 if (tab
== activeTab
.id
) {
77 document
.getElementById(tab
).className
= 'tab selectedTab';
78 document
.getElementById(tab
+ 'Div').style
.display
= 'block';
80 document
.getElementById(tab
).className
= 'tab';
81 document
.getElementById(tab
+ 'Div').style
.display
= 'none';
86 function activeTabFromAnchor() {
87 // first check for match to tab name
88 var tabAnchorRE
= new RegExp(tabAnchorPrefix
+ "(.*)$", "g");
89 var tabAnchor
= tabAnchorRE
.exec(location
.href
);
90 if (tabAnchor
&& tabAnchor
.length
== 2) {
91 var tabAnchorObj
= document
.getElementById(tabAnchor
[1]);
92 if (tabAnchorObj
!== undefined) {
93 changeActiveTab(tabAnchorObj
, false);
97 // anchor might be inside hidden tab, if so then activate tab
98 var anchorIdx
= location
.href
.indexOf("#");
101 var urlAnchor
= location
.href
.substr(anchorIdx
+ 1);
102 var anchors
= document
.getElementsByTagName("a");
103 for (var idx
in anchors
) {
104 var anchor
= anchors
[idx
];
105 if (anchor
.name
== urlAnchor
) {
106 // found anchor, now find parent tab
109 parent
= parent
.parentNode
;
110 } while (parent
&& ! /.*Div$/.test(parent
.id
));
113 var divMatch
= /^(.*)Div$/g.exec(parent
.id
);
114 if (! divMatch
|| divMatch
.length
!= 2)
116 var tabAnchorObj
= document
.getElementById(divMatch
[1]);
117 if (tabAnchorObj
=== undefined)
119 changeActiveTab(tabAnchorObj
, false); //SUCCESS!
120 // need to set location again as browser can't navigate
121 // to anchor in hidden tab
122 location
.href
= location
.href
;
129 <body onload=
"activeTabFromAnchor();">
130 <table border=
"0" cellspacing=
"0" width=
"100%">
133 <!-- SITE BANNER AND PROJECT IMAGE -->
134 <td align=
"left" valign=
"top"><a href=
"http://www.apache.org/"><img
135 src=
"http://incubator.apache.org/images/asf_logo_wide.gif" alt=
"The Apache Software Foundation" border=
"0"></a></td>
136 <td align=
"right"><a href=
"http://incubator.apache.org/"><img
137 src=
"http://incubator.apache.org/images/apache-incubator-logo.png" alt=
"Apache Incubator" border=
"0"></a></td>
145 <div class=
"header">Shindig -
<span class=
"smaller"> an Apache incubator project for OpenSocial and gadgets
</span></div>
146 <div class=
"tab selectedTab" onclick=
"changeActiveTab(this, true);" style=
"cursor: pointer;" id=
"home">Home
</div>
148 <div class=
"tab" onclick=
"changeActiveTab(this, true);" style=
"cursor: pointer;" id=
"download">Download
</div>
149 <div class=
"tab" onclick=
"changeActiveTab(this, true);" style=
"cursor: pointer;" id=
"building">Building Shindig
</div>
150 <div class=
"tab" onclick=
"changeActiveTab(this, true);" style=
"cursor: pointer;" id=
"contribute">Contribute
</div>
151 <div class=
"tab" onclick=
"changeActiveTab(this, true);" style=
"cursor: pointer;" id=
"support">Support
</div>
152 <div class=
"tabbar"></div>
154 <div class=
"content" id=
"homeDiv" style=
"display: block;">
155 <h3>What is Shindig?
</h3>
156 <p>Shindig is a new project in the Apache Software Foundation incubator and is an open source implementation of the
157 <a href=
"http://code.google.com/apis/opensocial/docs/spec.html">OpenSocial specification
</a> and
<a
158 href=
"http://code.google.com/apis/gadgets/docs/spec.html">gadgets specification
</a>.
</p>
160 <p>The architectural components of Shindig can be broken down as follows:
</p>
162 <li><b>Gadget Container JavaScript
</b>-- core JavaScript foundation for general gadget functionality. This
163 JavaScript manages security, communication, UI layout, and feature extensions, such as the OpenSocial API.
</li>
165 <li><b>Gadget Server
</b> -- used to render the gadget
166 XML into JavaScript and HTML for the container to expose via the container JavaScript.
</li>
167 <li><b>OpenSocial Container JavaScript
</b> -- JavaScript environment that sits on top of the Gadget Container
168 JavaScript and provides OpenSocial specific functionality (profiles, friends, activities, datastore).
</li>
170 <li><b>OpenSocial Data Server
</b> -- an implementation of the server interface to container-specific information,
171 including the OpenSocial REST APIs, with clear extension points so others can connect it to their own backends.
</li>
176 <div class=
"content" id=
"downloadDiv" style=
"display: none;">
177 <h3>Downloading periodic builds of Shindig
</h3>
178 <p>We currently do not have an automated builds infrastructure set up to offer periodic builds yet, but hope to have
179 it available soon. Check back here in the near future for downloadable builds of Shindig.
</p>
180 <p>In the meantime, please visit the Building Shindig tab for instructions on using the code in the repository.
</p>
183 <div class=
"content" id=
"buildingDiv" style=
"display: none;">
184 <h3>Building and running Shindig
</h3>
185 <p>There are both Java and PHP versions available, the following steps provide useful information on how to build and run Shindig.
</p>
188 <li><a href=
"#java">Building and running Shindig (Java)
</a></li>
189 <li><a href=
"#preReqs">Prequisites
</a></li>
190 <li><a href=
"#getTheCode">Get the code
</a></li>
191 <li><a href=
"#buildTheCode">Build and run the code (with Maven)
</a></li>
192 <li><a href=
"#eclipseProject">Setting up an Eclipse project
</a></li>
193 <li><a href=
"#caja">Running with Caja
</a></li>
198 <li><a href=
"#php">Building and running Shindig (PHP)
</a></li>
199 <li><a href=
"#phppreReqs">Prequisites
</a></li>
200 <li><a href=
"#phpgetTheCode">Get the code
</a></li>
201 <li><a href=
"#phpbuildTheCode">Running Shindig
</a></li>
202 <li><a href=
"#phpAdditonal_reading">Additonal reading
</a></li>
205 <h3><a name=
"java">Building and running Shindig (Java)
</a></h3>
206 <h4><a name=
"preReqs">Prequisites before building Shindig
</a></h4>
207 <p>In order to build Shindig, you must have the following:
</p>
209 <li>Java (JDK/JRE)
1.5 or later installed on your system and the JAVA_HOME environment variable set.
211 <li>See:
<a href=
"http://java.sun.com/">http://java.sun.com/
</a> for installation instructions.
</li>
215 <li>A Subversion client installed in order to checkout the code.
217 <li>Instructions for downloading and installing Subversion can be found here:
<a
218 href=
"http://subversion.tigris.org/">http://subversion.tigris.org/
</a></li>
221 <li>Apache Maven installed to perform the build.
223 <li>Instructions for downloading and installing Maven can be found here:
<a
224 href=
"http://maven.apache.org/download.html">http://maven.apache.org/download.html
</a></li>
229 <h4><a name=
"getTheCode">Getting the code
</a></h4>
230 <p>Create a subdirectory and checkout the Shindig code from its Subversion repository
</p>
232 <li><code>mkdir ~/src/shindig
</code> (or wherever you'd like to put it)
</li>
233 <li><code>cd ~/src/shindig
</code></li>
235 <li><code>svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ .
</code></li>
238 <h4><a name=
"buildTheCode">Building and running the code
<span class=
"smaller">(with Maven)
</span></a></h4>
239 <p>To build a Web Archive (WAR) file for the Gadget server and run tests, perform the following:
</p>
241 <li>Make sure you have the
<a href=
"#preReqs">prerequisites
</a> installed first.
</li>
242 <li><code>cd ~/src/shindig/
</code></li>
243 <li><code>mvn
</code></li>
245 <li>Once the build successfully completes, you can install the built WAR files located in the /target
246 subdirectory onto your JEE server.
</li>
249 <p>To run the code and start a Jetty server that will run on at localhost:
8080:
</p>
251 <li><code>mvn -Prun
</code></li>
254 <p>To run the Jetty server on a different port, use:
</p>
256 <li><code>cd java/server
</code></li>
257 <li><code>mvn clean install jetty:run -DrunType=
<full|gadgets|social
> -Djetty.port=
<port
></code></li>
260 <p>Once you've either installed the WAR file on your JEE server, or are running locally using the Jetty server, you
261 can test the Gadget server using:
</p>
263 <li>http://localhost:
<port
>/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
</li>
266 <h4><a name=
"eclipseProject">Setting up an Eclipse project to build Shindig
</a></h4>
267 <p>These steps, after completing the previous section, will allow you to build from within Eclipse using the Maven2
268 plugin. You should first install the Maven plugin, then create the new Java project.
</p>
270 <li>Create
<code>~/.m2/settings.xml
</code> consisting solely of
</li>
272 <pre><settings
><br></settings
><br></pre>
274 <li>Install the Maven2 plugin
276 <li>Help -
> Software Updates -
> Find and Install
</li>
277 <li>Search for new features to install
</li>
278 <li>Create a new remote update site for the Maven
2 plugin
280 <li>Name: Maven2 - Sonatype
</li>
281 <li>URL:
<code>http://m2eclipse.sonatype.org/update/
</code></li>
284 <li>Select the site and click
"Finish"</li>
285 <li>There are optional dependencies on mylyn and subclipse. If you don't have these plugins, you can get them
<a
286 href=
"http://m2eclipse.sonatype.org/update/" title=
"Maven Integration for Eclipse updates">here
</a>. Otherwise,
287 select only the Maven Integration plug-in.
</li>
288 <li>Complete the installation
</li>
293 <li>Setup new workspace and project
<br>
294 Creating a new workspace eliminates the performance cost from existing projects and makes it easier to manage the
297 <li>File -
> Switch Workspace -
> Other...
</li>
298 <li>Select directory to store workspace
300 <li>Do not select a parent directory of the shindig source (e.g. ~/src/shindig) as Eclipse won't allow you to
301 create the Java project.
</li>
302 <li>Something like
<code>~/eclipse/workspaces/shindig
</code> would work fine
</li>
306 <li>File -
> New -
> Java Project
308 <li>Name the project. The instructions below will assume
"SHINDIG".
</li>
309 <li>Select 'Create project from existing source' and navigate to
<code>.../src/shindig/java
</code>
310 <li>Click Finish
</li>
311 <li>If you see a dialog for
"Open Associated Perspective", click Ok. Don't worry about the errors after
312 loading as they will be fixed in the next step.
</li>
316 <li>Right-click the project, select
<code>Maven : Enable Dependency Management
</code></li>
317 <li>Right-click the project, select
<code>Maven : Enable Nested Modules
</code></li>
318 <li>Right-click the project, select
<code>Maven : Update Source Folders
</code></li>
319 <li>Optionally, if you would like to be able to browse or step into the code of your dependent jars when
320 debugging, you need the source jars. Right-click the project, select
<code>Maven : Download Sources
</code> and
321 Eclipse will automatically know about these sources when debugging. You can browse them under
<code>Maven
322 Dependencies
</code> in your project.
</li>
323 <li>If you'll be using AllTests to run tests or generate code coverage stats, adjust the project's output folders.
325 <li>Project -
> Properties -
> Java Build Path -
> Source
</li>
326 <li>Locate and open
<code>SHINDIG/gadgets/src/test/java
</code></li>
327 <li>Select
<code>Output Folder: (Default Output Folder)
</code> and click Edit...
</li>
328 <li>Select
<code>Specific Output Folder
</code></li>
329 <li>Enter
<code>target/test-classes
</code> and click OK.
</li>
330 <li>Repeat for
<code>SHINDIG/social-api/src/test/java
</code></li>
336 <h4><font size=
"3"><a name=
"Code_coverage_in_Eclipse"> Generating Code Coverage in Eclipse
</a></font></h4>
337 <p>To generate code coverage statistics inside of Eclipse, install the
<a href=
"http://www.eclemma.org">EclEmma
</a> plugin. Then
</p>
339 <li>Open
<code>org.apache.shindig.common.AllTests
</code></li>
340 <li>Right-click in the class, and select
<code>Coverage as -
> JUnit Test
</code></li>
343 <h4><font size=
"3"><a name=
"Running_inside_Eclipse"> Running inside Eclipse
</a></font></h4>
344 <p>To debug the server in Eclipse, follow the last two steps
<a
345 href=
"http://cwiki.apache.org/WICKET/maven-jetty-plugin.html" target=
"_top">here
</a> (takes a few minutes to set up):
</p>
348 <li>"Using eclipse external tools"</li>
349 <li>"Attaching to the server running in debug mode, using eclipse"</li>
352 <p><b>Note:
</b> You must have set up Eclipse to build the code or do
<code>mvn package
</code> yourself after making
353 changes, but you won't need to restart Jetty to see your changes.
</p>
355 <h3><a name=
"caja">Running with Caja
</a></h3>
356 <p>Caja is an important part of OpenSocial that greatly enhances JavaScript security. Caja is managed in a separate
357 open source project hosted by Google code projects. For more information on Caja, see:
<a
358 href=
"http://code.google.com/p/google-caja/wiki/CajaEasyIntro">http://code.google.com/p/google-caja/wiki/CajaEasyIntro
</a>
361 <li>Load this page:
<a href=
"http://localhost:8080/gadgets/files/samplecontainer/samplecontainer.html"
362 target=
"_top">http://localhost:
8080/gadgets/files/samplecontainer/samplecontainer.html
</a></li>
363 <li>Point it to this gadget:
<a
364 href=
"http://localhost:8080/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml" target=
"_top">http://localhost:
8080/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml
</a>
368 <p>To see the cajoled code (Firefox only), right-click inside the iframe and do
"This Frame -> View Frame Source"</p>
370 <h3><a name=
"Additonal_reading"> Additional reading
</a></h3>
371 Read
<a href=
"http://svn.apache.org/repos/asf/incubator/shindig/trunk/java/README">java/README
</a> for original
372 instructions on how to start up any of the java shindig servers.
373 <p>Read
<a href=
"http://svn.apache.org/repos/asf/incubator/shindig/trunk/javascript/README">javascript/README
</a>
374 for instructions for using the Shindig Gadget Container JavaScript to enable your page to render Gadgets.
</p>
376 <h3><a name=
"php">Building and running Shindig PHP server
</a></h3>
378 <h4><a name=
"phppreReqs">Prequisites before building Shindig for PHP
</a></h4>
379 <p> In order to build and run Shindig for PHP, you must have the following:
</p>
381 <li>A Subversion client installed in order to checkout the code.
</li>
382 <ul><li>Instructions for downloading and installing Subversion can be found here:
<a href=
"http://subversion.tigris.org/"></a>http://subversion.tigris.org/
</li></ul>
384 <li>Apache with mod_rewrite enabled.
</li>
385 <li>PHP
5.2.x with the
<a href=
"http://www.php.net/json">json
</a>,
<a href=
"http://www.php.net/simplexml">simplexml
</a>,
<a href=
"http://www.php.net/mcrypt">mcrypt
</a> and
<a href=
"http://www.php.net/curl">curl
</a> extentions enabled.
</li>
388 <h4><a name=
"phpgetTheCode">Getting the code
</a></h4>
389 <p> Create a subdirectory in your web document root, e.g. /var/www/html
390 and checkout the Shindig code from its Subversion repository
</p>
393 <li> <code>mkdir /var/www/html/shindig
</code> </li>
394 <li> <code>cd /var/www/html/shindig
</code></li>
395 <li> <code>svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ .
</code> </li>
398 <h4><a name=
"phpbuildTheCode">Running Shindig
</a></h4>
399 <p>With PHP There is no need to build anything - the source code is already built.
</p>
401 <p>To run the code, you have several options:
</p>
403 <h5>a. Create a new virtual host
</h5>
405 <p>Point your apache to the php dir with a virtual host like:
</p>
408 <VirtualHost your_ip:your_port
>
411 DocumentRoot /var/www/html/shindig/php
412 ... other normal settings in vhosts...
416 <p>Restart apache, and point your browser to:
</p>
417 <p>http://your.host/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
</p>
419 <p>you should see something like
420 <a href='http://shindig.chabotc.com/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml'
>this
</a>.
423 <h5>b. Run with an existing host
</h5>
425 <p>If you cannot/don't want to create a virtual host, you can edit the file php/config.php and change the web_prefix setting to '/shindig/php'.
427 <p>Then you can run the gadget by pointing your browser to:
428 <p>http://your.host/shindig/php/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
</p>
430 <h3><a name=
"phpAdditonal_reading"> Additional reading
</a></h3>
431 <p>Read
<a href=
"http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/README">php/README
</a>
432 for original instructions on how to start up the php shindig server.
433 <p>Read
<a href=
"http://svn.apache.org/repos/asf/incubator/shindig/trunk/javascript/README">javascript/README
</a>
434 for instructions for using the Shindig Gadget Container JavaScript to enable your page to render Gadgets.
</p>
437 <div class=
"content" id=
"contributeDiv" style=
"display: none;">
438 <h3>How to contribute to Shindig
</h3>
439 <p>Shindig is strengthened by accepting quality contributions from a wide variety of sources. These steps serve as
440 an in-progress guide to contributing code into the
<a href=
"http://svn.apache.org/repos/asf/incubator/shindig/trunk/">source
441 code repository for Shindig
</a>.
</p>
443 <li><a href=
"#codeSubmissions">Code submissions
</a>
445 <li><a href=
"#creatingPatches">Creating patches
</a></li>
446 <li><a href=
"#submittingPatches">Submitting Patches
</a></li>
452 <h3><a name=
"codeSubmissions"> Code Submissions
</a></h3>
453 <h4><a name=
"creatingPatches"> Creating Patches
</a></h4>
454 <p>For new people to the project, creating patches is the way to get started and build your reputation.
</p>
456 <li>Start editing the code, since Subversion is being used no checkout is needed
</li>
457 <li>Move to top level folder, e.g.
<code>cd ~/src/shindig
</code></li>
458 <li>Generate diffs using
<code>svn di
> fix-xxx-bug.patch
</code></li>
459 <li>If needed, remove from the patch file any changes you do not want to submit until later
</li>
460 <li>If you're new, create an account on
<a
461 href=
"http://www.google.com/url?sa=D&q=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FSHINDIG" target=
"_top">https://issues.apache.org/jira/browse/SHINDIG
</a></li>
462 <li>Create a new issue with the patch:
464 <li>Follow the
"New" link:
<a
465 href=
"http://www.google.com/url?sa=D&q=https%3A%2F%2Fissues.apache.org%2Fjira%2Fsecure%2FCreateIssue%21default.jspa"
466 target=
"_top">https://issues.apache.org/jira/secure/CreateIssue!default.jspa
</a></li>
467 <li>For the
"Issue Type", select
"Bug",
"Improvement" or
"New Feature"</li>
468 <li>Click
"Next>>"</li>
469 <li>Enter summary / description and select the component
<br>
471 <li>Click
"Create"</li>
472 <li>Click
"Attach file" and select the
<code>mychanges.patch
</code> file
</li>
473 <li>Check the
"Grant license to ASF for inclusion in ASF works" option
</li>
474 <li>Click on
"Watching" and then click on
"Start" watching to get updates
</li>
479 <p>The newly created issue will automatically be sent to
<a href=
"mailto:shindig-dev@incubator.apache.org">shindig-dev@incubator.apache.org
</a>.
480 You should also subscribe using
<a href=
"mailto:shindig-dev-subscribe@incubator.apache.org">shindig-dev-subscribe@incubator.apache.org
</a>
481 to see all the feedback, in which case you'll get the updates on the issue without needing to
"Watch" them individually.
</p>
483 <h4><a name=
"submittingPatches"> Submitting Patches
</a></h4>
484 <p>If you have commit permission, then you can submit directly from subversion and should also look at patches
485 provided by others.
</p>
487 <li>Move to top level folder, e.g.
<code>cd ~/src/shindig
</code> (you might find it helpful to create a separate
488 tree from your working tree)
</li>
489 <li>Apply patch:
<code>patch p0
< mychanges.patch
</code></li>
490 <li><code>svn commit
</code></li>
491 <li>For the log message put
<code>Applied patch for JIRA issue SHINDIG-XXX
</code>, where XXX is the JIRA issue
492 number you are applying the patch for. This will automatically update the JIRA issue with a link to the subversion
493 commit. You don't need additional comments as the JIRA issue should contain enough information already.
</li>
496 <h4><a name=
"Example"> Example
</a></h4>
498 <li>JIRA Issue with patch:
<a href=
"http://issues.apache.org/jira/browse/SHINDIG-13" target=
"_top">http://issues.apache.org/jira/browse/SHINDIG-
13</a>
500 <li>Code Change:
<a href=
"http://svn.apache.org/viewvc?view=rev&revision=612299" target=
"_top">http://svn.apache.org/viewvc?view=rev
&revision=
612299</a>
505 <div class=
"content" id=
"supportDiv" style=
"display: none;">
506 <h3><a name=
"mailingList">Mailing List
</a></h3>
508 <li>To subscribe to the Shindig mailing list, send a blank email to
<a
509 href=
"mailto:shindig-dev-subscribe@incubator.apache.org">shindig-dev-subscribe@incubator.apache.org
</a></li>
510 <li>The email archives are located at:
512 <li><a href=
"http://mail-archives.apache.org/mod_mbox/incubator-shindig-dev/">http://mail-archives.apache.org/mod_mbox/incubator-shindig-dev/
</a></li>
513 <li><a href=
"http://shindig-dev.markmail.org/">http://shindig-dev.markmail.org/
</a></li>
517 <h3><a name=
"bugs">Issue Tracker (using JIRA)
</a></h3>
518 <p>To file bugs or feature requests, please use
<a
519 href=
"https://issues.apache.org/jira/secure/BrowseProject.jspa?id=12310741">Shindig's issue tracker (JIRA)
</a>:
</p>
521 <li>Login to the issue tracker (top right corner) or follow the instructions to make a new account (anyone can
522 make an account).
</li>
524 <li>Once logged in you should be able to see all of Shindig's open issues.
</li>
525 <li>If the issue has not been filed, use the
"Create a new issue" link (this will not be shown if you are not
529 <!-- disabled until we have a faq
530 <h3><a name="FAQ">FAQ </a></h3>
533 <li>Why don't you have any questions in your FAQ?</li>
534 <ul><li>That's a great question!</li></ul>