You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by bu...@apache.org on 2012/07/30 02:51:06 UTC

svn commit: r827360 - in /websites/staging/shindig/trunk/content: ./ documentation_building_java.html documentation_java.html

Author: buildbot
Date: Mon Jul 30 00:51:06 2012
New Revision: 827360

Log:
Staging update by buildbot for shindig

Added:
    websites/staging/shindig/trunk/content/documentation_building_java.html
Removed:
    websites/staging/shindig/trunk/content/documentation_java.html
Modified:
    websites/staging/shindig/trunk/content/   (props changed)

Propchange: websites/staging/shindig/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jul 30 00:51:06 2012
@@ -1 +1 @@
-1366558
+1366971

Added: websites/staging/shindig/trunk/content/documentation_building_java.html
==============================================================================
--- websites/staging/shindig/trunk/content/documentation_building_java.html (added)
+++ websites/staging/shindig/trunk/content/documentation_building_java.html Mon Jul 30 00:51:06 2012
@@ -0,0 +1,348 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!DOCTYPE html>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <title>Shindig - Building and Running Apache Shindig for Java</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le styles -->
+    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
+    <style type="text/css">
+      body {
+        padding-top: 60px;
+        padding-bottom: 40px;
+      }
+    </style>
+    <link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+    <!--[if lt IE 9]>
+      <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="images/favicon.ico">
+    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+  </head>
+
+  <body>
+
+    <div class="navbar navbar-fixed-top">
+      <div class="navbar-inner">
+        <div class="container">
+          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </a>
+          <a class="brand" href="index.html">Apache Shindig</a>
+          <!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<div class="nav-collapse">
+            <ul class="nav">
+              <li class="dropdown">
+    		    <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
+      			  Get Shindig
+      			  <b class="caret"></b>
+    			</a>
+    			<ul class="dropdown-menu">
+      			  <li><a href="download.html">Download</a></li>
+      			  <li><a href="license.html">License</a></li>
+    			</ul>
+  			  </li>
+              <li class="dropdown">
+                <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
+                  About Shindig
+                  <b class="caret"></b>
+                </a>
+                <ul class="dropdown-menu">
+                  <li><a href="about_shindig_overview.html">Overview</a></li>
+                  <li><a href="about_shindig_getting_started.html">Getting Started</a></li>
+                  <li><a href="faq.html">FAQ</a></li>
+                  <li><a href="resources.html">Resources</a></li>
+                  <li><a href="powered-by.html">Powered By</a></li>
+                </ul>
+              </li>
+              <li class="dropdown">
+                <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
+                  Documentation
+                  <b class="caret"></b>
+                </a>
+                <ul class="dropdown-menu">
+                  <li><a href="documentation_centre.html">Center</a></li>
+                  <li><a href="#">Java</a></li>
+                  <li><a href="#">PHP</a></li>
+                  <li><a href="#">Features</a></li>
+                </ul>
+              </li>
+              <li class="dropdown">
+                <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
+                  Community
+                  <b class="caret"></b>
+                </a>
+                <ul class="dropdown-menu">
+                  <li><a href="community_overview.html">Overview</a></li>
+                  <li><a href="getting-help.html">Getting Help</a></li>
+                  <li><a href="issue-tracking.html">Issue Tracking</a></li>
+                  <li><a href="source-repository.html">Source Repository</a></li>
+                  <li><a href="https://cwiki.apache.org/confluence/display/SHINDIG/Index">Wiki</a></li>
+                  <li><a href="#">The Shindig Team</a></li>
+                </ul>
+              </li>
+              <li class="dropdown">
+                <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
+                  Misc
+                  <b class="caret"></b>
+                </a>
+                <ul class="dropdown-menu">
+                  <li><a href="http://www.apache.org/">Apache</a></li>
+                  <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+                  <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+                </ul>
+              </li>
+              <li class="dropdown">
+                <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
+                  Project Doc
+                  <b class="caret"></b>
+                </a>
+                <ul class="dropdown-menu">
+                  <li><a href="#">Project Information</a></li>
+                </ul>
+              </li>       
+            </ul>
+          </div><!--/.nav-collapse -->
+
+        </div>
+      </div>
+    </div>
+
+    <div class="container">
+	  <h1 id="building-and-running-apache-shindig-for-java">Building and Running Apache Shindig for Java</h1>
+<p>This is the Java steps on how to build and run Apache Shindig.</p>
+<ul>
+<li>Prequisites</li>
+<li>Get the code</li>
+<li>Build and run the code (with Maven)</li>
+<li>Setting up an Eclipse project</li>
+<li>Generating Code Coverage in Eclipse</li>
+<li>Running inside Eclipse</li>
+<li>Running with Caja</li>
+</ul>
+<h2 id="prequisites-before-building-apache-shindig">Prequisites before building Apache Shindig</h2>
+<p>In order to build Apache Shindig, you must have the following:</p>
+<ul>
+<li>Java (JDK/JRE) 1.5 or later installed on your system and the JAVA_HOME environment variable set.<ul>
+<li>See: <a href="http://java.sun.com/">http://java.sun.com/</a> for installation instructions.</li>
+</ul>
+</li>
+<li>A Subversion client installed in order to checkout the code.<ul>
+<li>Instructions for downloading and installing Subversion can be found here: <a href="http://subversion.tigris.org/">http://subversion.tigris.org/</a></li>
+</ul>
+</li>
+<li>Apache Maven installed to perform the build.<ul>
+<li>Instructions for downloading and installing Maven can be found here: <a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a></li>
+</ul>
+</li>
+</ul>
+<h2 id="getting-the-code">Getting the code</h2>
+<p>Create a subdirectory and checkout the Apache Shindig code from its Subversion repository</p>
+<ol>
+<li>mkdir ~/src/shindig (or wherever you'd like to put it)</li>
+<li>cd ~/src/shindig</li>
+<li>svn co http://svn.apache.org/repos/asf/shindig/trunk/</li>
+</ol>
+<h2 id="building-and-running-the-code-with-maven">Building and running the code with Maven</h2>
+<p>To build a Web Archive (WAR) file for the Gadget server and run tests, perform the following:</p>
+<ol>
+<li>Make sure you have the prerequisites installed first.</li>
+<li>cd ~/src/shindig/</li>
+<li>mvn</li>
+<li>Once the build successfully completes, you can install the built WAR files located in the /target subdirectory onto your JEE server.</li>
+</ol>
+<p>To run the code and start a Jetty server that will run on at localhost:8080:</p>
+<ul>
+<li>mvn -Prun</li>
+<li>Open in you browser http://localhost:8080/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml</li>
+</ul>
+<p>To run the Jetty server on a different port, use:</p>
+<ul>
+<li>cd java/server</li>
+<li>mvn clean install jetty:run -DrunType=<full|gadgets|social> -Djetty.port=<port></li>
+</ul>
+<p>Once you've either installed the WAR file on your JEE server, or are running locally using the Jetty server, you can test the Gadget server using:</p>
+<ul>
+<li>http://localhost:<port>/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml</li>
+</ul>
+<div class="row-fluid">
+  <div class="span6">
+    <ul class="thumbnails">
+      <li class="span4">
+        <div class="thumbnail">
+          <img src="images/task.png" alt="">
+        </div>
+      </li>
+    </ul>
+  </div>
+</div>
+
+<h2 id="setting-up-an-eclipse-development-environment">Setting up an Eclipse development environment</h2>
+<ol>
+<li>Download and unzip the Eclipse IDE for Java EE Developers from the <a href="http://eclipse.org/downloads/">Eclipse downloads page</a>.  At the time that this tutorial was written Eclipse Indigo is the current release.<br />
+</li>
+<li>Download and unzip Apache Maven from the <a href="http://maven.apache.org/download.html">Maven downloads page</a>.  At the time that this tutorial was written Maven 3.0.3 is the current release.</li>
+<li>Download and unzip Apache Tomcat from the <a href="http://tomcat.apache.org/download-70.cgi">Tomcat downloads page</a>.  At the time that this tutorial was written Tomcat 7.0.23 is the current release.</li>
+<li>Download and unzip the Eclipse Subversive update site from the <a href="http://www.eclipse.org/subversive/downloads.php">Eclipse Subversive downloads page</a>.  The version you download depends on the version of Eclipse you have installed.  Make sure you download the correct version.</li>
+<li>Start Eclipse.</li>
+<li>Select a workspace you would like to use for your development.</li>
+<li>Once Eclipse has started close the Welcome page.</li>
+<li>Go to Help -&gt; Install New Software</li>
+<li>In the Install dialogs "Work With" field select "All Available Sites" from the drop down.  It may take a bit to get all the update sites.</li>
+<li>In the filter field type Maven.</li>
+<li>Select m2e - Maven Integration For Eclipse.  There may be more than one entry for this plugin, just select one and click Next.</li>
+<li>Select Next on the Install Details dialog.</li>
+<li>Accept the license agreements and click Finish.</li>
+<li>After the installation finishes, you will be prompted to restart Eclipse, select Not Now.</li>
+<li>Go to Help -&gt; Install New Software again.</li>
+<li>Select Add to add a new update site.</li>
+<li>Select Local on the Add Repository dialog.</li>
+<li>Navigate to the Eclipse subversive update site you downloaded and unzipped earlier in step 4 and select Open.</li>
+<li>Give the update site and name, such as Subversive, and select OK to the Add Repository dialog.</li>
+<li>Select all the categories in the update site and click Finish.  At the time that this tutorial was written there was 3 categories Subversive Integration Plug-ins, Subversive Sources, Subversive SVN Team Provider Plugin.</li>
+<li>Select Finish on the Install Details dialog.</li>
+<li>After the install finishes you will be prompted to Restart Eclipse, select Restart Now.</li>
+<li>After Eclipse restarts you will be prompted to install and SVN Connector.  Select the latest SVN Kit Connector and select Finish on the install dialog.  At the time that this tutorial was written the latest connector was SVN Kit 1.3.5.</li>
+<li>At the Install dialog make sure all the plugins are selected and select Next.</li>
+<li>Select Next to the Install Details dialog.</li>
+<li>Accept the licenses, and click Finish.</li>
+<li>If you get any security warnings, click OK.</li>
+<li>Once the installation finishes you will be prompted to restart Eclipse, click Restart Now.</li>
+<li>Once Eclipse restarts close the Welcome view.</li>
+<li>Open Eclipse Preferences (On Mac Eclipse -&gt; Preferences, on Windows Help -&gt; Preferences)</li>
+<li>Go to Maven -&gt; Installations and select Add.</li>
+<li>Browse to the Apache Maven installation you unzipped in step 2 and select Open.</li>
+<li>This should add an external Maven installation, make sure it is selected and press Apply.</li>
+<li>In the preferences dialog navigate to Maven -&gt; Discovery and select Open Catalog.</li>
+<li>In the m2e Marketplace dialog's Find field type "Subversive", and select m2e - subversive SCM Handler and click Finish.</li>
+<li>On the Install dialog make sure Maven SCM Handler for Subversive is selected and click Next.</li>
+<li>On the Install Details dialog select Next.</li>
+<li>Accept the license agreements and select Finish.</li>
+<li>If you get any security warnings, click OK.</li>
+<li>The installation will probably happen in the background, but after it is done a restart dialog will pop up, select Yes to restart Eclipse.</li>
+<li>Once Eclipse restarts go to Window -&gt; Open Perspective -&gt; Other... -&gt; SVN Repository Exploring and select OK.</li>
+<li>In the SVN Repositories View select the New Repository Location icon.</li>
+<li>In the New Repository Location dialog enter the URL to the Shindig SVN repository.  You can find the URL <a href="source-repository.html">here</a>.  At the time that this tutorial was written the URL is <a href="http://svn.apache.org/repos/asf/shindig">http://svn.apache.org/repos/asf/shindig</a>. (Use https if you are a Shindig committer.)</li>
+<li>Once the repository is added you should see it listen in the SVN Repositories view.  Expand the Shindig SVN Repository and right click on trunk.  Select Checkout as Maven Project.</li>
+<li>In the Checkout as Maven project from SCM dialog select Finish.</li>
+<li>Trunk will be checked out in the background.  While that is happening go to Window -&gt; Open Perspective -&gt; Java.</li>
+<li>After trunk is checked out an Import Maven Projects dialog should popup.  Make sure all the projects are selected and select Next</li>
+<li>On the Setup Maven plugin connectors dialog select Finish.  (There may be some errors on this dialog, like yuicompressor, this is OK)</li>
+<li>An Install dialog will popup to install more m2e Connectors, select all the plugins in the dialog and select Next.</li>
+<li>On the Install Details dialog select Next.</li>
+<li>Accept the licenses and select Finish</li>
+<li>If you get a Security Warning dialog, select OK.</li>
+<li>After the installation finishes you will be prompted to restart Eclipse, click Yes.</li>
+<li>After the clean finishes right click on shindig-project and select Run As -&gt; Maven Build...</li>
+<li>On the resulting screen type "clean install" into the Goals field and "all,samples,reporting" into the Profiles field. This will mimic the builds that happen via Jenkins on builds.apache.org. For more information on building with Maven, please see the <a href="http://maven.apache.org/guides/">Maven documentation</a>.</li>
+<li>After the build finishes there will be a web app in <workspace dir>/shindig-project/java/server/target/shindig-server-<version>-SNAPSHOT</li>
+<li>In Eclipse go to Window -&gt; Show View -&gt; Other... -&gt; Server -&gt; Servers.</li>
+<li>Right click in the Servers view and select New -&gt; Server.</li>
+<li>Expand Apache and select Tomcat v7.0 Server.  Select Next.</li>
+<li>Click Browser and navigate to the directory you extracted the Apache Tomcat zip to in step 3 and select Open.  Click Finish.</li>
+<li>Double click on the Tomcat server in the servers view and select the Modules tab.</li>
+<li>Click the Add External Web Module... button.</li>
+<li>In the Add Web Module dialog select Browse and navigate to the web app generated from the build in, <workspace dir>/shindig-project/java/server/target/shindig-server-<version>-SNAPSHOT and select Open.</li>
+<li>Click OK to the Add Web Module dialog and save the Web Module changes.</li>
+<li>Click the Tomcat server in the server view and select the Debug icon.</li>
+<li>Open a browser and navigate to <a href="http://localhost:8080/samplecontainer/examples/commoncontainer/index.html">http://localhost:8080/samplecontainer/examples/commoncontainer/index.html</a> and render some gadgets!</li>
+</ol>
+<h2 id="generating-code-coverage-in-eclipse">Generating Code Coverage in Eclipse</h2>
+<p>To generate code coverage statistics inside of Eclipse, install the <a href="https://cwiki.apache.org/WICKET/maven-jetty-plugin.html">EclEmma plugin</a>. Then</p>
+<ul>
+<li>"Using eclipse external tools"</li>
+<li>"Attaching to the server running in debug mode, using eclipse"</li>
+</ul>
+<p><b>Note:</b> You must have set up Eclipse to build the code or do mvn package yourself after making changes, but you won't need to restart Jetty to see your changes.</p>
+<h2 id="running-with-caja">Running with Caja</h2>
+<p>Caja is an important part of OpenSocial that greatly enhances JavaScript security. Caja is managed in a separate open 
+source project hosted by Google code projects. For more information on Caja, see: 
+<a href="http://code.google.com/p/google-caja/wiki/CajaEasyIntro">http://code.google.com/p/google-caja/wiki/CajaEasyIntro</a></p>
+<ol>
+<li>Load this page: <a href="http://localhost:8080/samplecontainer/examples/commoncontainer/index.html">http://localhost:8080/samplecontainer/examples/commoncontainer/index.html</a></li>
+<li>Point it to this gadget: <a href="http://localhost:8080/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml">http://localhost:8080/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml</a></li>
+</ol>
+<p>To see the cajoled code (Firefox only), right-click inside the iframe and do "This Frame -&gt; View Frame Source"</p>
+<h2 id="additional-reading">Additional reading</h2>
+<p>Read <a href="http://svn.apache.org/repos/asf/shindig/trunk/java/README">java/README</a> for original instructions on how to start up any of the java shindig servers.</p>
+<p>Read <a href="http://svn.apache.org/repos/asf/shindig/trunk/features/README">javascript/README</a> for instructions for using the Apache Shindig Gadget Container JavaScript to enable your page to render Gadgets using gmodules.com or a server started up as described above.</p>
+      <hr>
+
+      <footer>
+        <p>Copyright &copy; 2007-2012 <a href="http://www.apache.org">The Apache Software Foundation</a>. All Rights Reserved.</p>
+      </footer>
+
+    </div> <!-- /container -->
+
+    <!-- Le javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <script src="jquery/js/jquery-1.7.1.min.js"></script>
+    <script src="bootstrap/js/bootstrap.min.js"></script>
+
+  </body>
+</html>