incubator-wookie-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scot...@apache.org
Subject svn commit: r827972 - in /incubator/wookie/branches/standalone: ./ .settings/ WebContent/ WebContent/WEB-INF/ ant/ ant/lib/ etc/ scripts/ src/org/apache/wookie/server/
Date Wed, 21 Oct 2009 12:03:47 GMT
Author: scottbw
Date: Wed Oct 21 12:03:47 2009
New Revision: 827972

URL: http://svn.apache.org/viewvc?rev=827972&view=rev
Log:
Changeset for standalone build

Added:
    incubator/wookie/branches/standalone/ant/
    incubator/wookie/branches/standalone/ant/build.xml
    incubator/wookie/branches/standalone/ant/ivy-common.xml
    incubator/wookie/branches/standalone/ant/ivy-java-common.xml
    incubator/wookie/branches/standalone/ant/ivy-webapp-common.xml
    incubator/wookie/branches/standalone/ant/ivysettings.xml
    incubator/wookie/branches/standalone/ant/lib/
    incubator/wookie/branches/standalone/ant/lib/htmlcleaner-2.1.0.jar   (with props)
    incubator/wookie/branches/standalone/ant/lib/shindig-common-1.1-SNAPSHOT.jar   (with props)
    incubator/wookie/branches/standalone/build.xml
    incubator/wookie/branches/standalone/etc/
    incubator/wookie/branches/standalone/etc/jetty-realm.properties
    incubator/wookie/branches/standalone/ivy.xml
    incubator/wookie/branches/standalone/scripts/widgetdb_derby.sql
    incubator/wookie/branches/standalone/src/org/apache/wookie/server/Start.java
    incubator/wookie/branches/standalone/src/org/apache/wookie/server/Stop.java
Modified:
    incubator/wookie/branches/standalone/.classpath
    incubator/wookie/branches/standalone/.settings/org.eclipse.jdt.core.prefs
    incubator/wookie/branches/standalone/.settings/org.eclipse.wst.common.project.facet.core.xml
    incubator/wookie/branches/standalone/WebContent/WEB-INF/web.xml
    incubator/wookie/branches/standalone/WebContent/index.htm
    incubator/wookie/branches/standalone/readme.txt

Modified: incubator/wookie/branches/standalone/.classpath
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/.classpath?rev=827972&r1=827971&r2=827972&view=diff
==============================================================================
--- incubator/wookie/branches/standalone/.classpath (original)
+++ incubator/wookie/branches/standalone/.classpath Wed Oct 21 12:03:47 2009
@@ -3,7 +3,8 @@
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="src-tests"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>
-	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+	<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&amp;confs=*&amp;ivySettingsPath=file%3A%2FUsers%2Frgardler%2FDocuments%2Fworkspace%2Fwookie%2Fant%2Fivysettings.xml&amp;loadSettingsOnDemand=false&amp;propertyFiles="/>
+	<classpathentry kind="lib" path="ant/lib/htmlcleaner-2.1.0.jar"/>
+	<classpathentry kind="lib" path="ant/lib/shindig-common-1.1-SNAPSHOT.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: incubator/wookie/branches/standalone/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/.settings/org.eclipse.jdt.core.prefs?rev=827972&r1=827971&r2=827972&view=diff
==============================================================================
--- incubator/wookie/branches/standalone/.settings/org.eclipse.jdt.core.prefs (original)
+++ incubator/wookie/branches/standalone/.settings/org.eclipse.jdt.core.prefs Wed Oct 21 12:03:47 2009
@@ -1,7 +1,12 @@
-#Mon Sep 10 15:46:25 BST 2007
+#Sat Aug 29 02:50:28 BST 2009
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
 org.eclipse.jdt.core.compiler.source=1.5

Modified: incubator/wookie/branches/standalone/.settings/org.eclipse.wst.common.project.facet.core.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/.settings/org.eclipse.wst.common.project.facet.core.xml?rev=827972&r1=827971&r2=827972&view=diff
==============================================================================
--- incubator/wookie/branches/standalone/.settings/org.eclipse.wst.common.project.facet.core.xml (original)
+++ incubator/wookie/branches/standalone/.settings/org.eclipse.wst.common.project.facet.core.xml Wed Oct 21 12:03:47 2009
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <faceted-project>
-  <runtime name="Apache Tomcat v5.5"/>
   <fixed facet="jst.web"/>
   <fixed facet="jst.java"/>
   <installed facet="jst.java" version="5.0"/>

Modified: incubator/wookie/branches/standalone/WebContent/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/WebContent/WEB-INF/web.xml?rev=827972&r1=827971&r2=827972&view=diff
==============================================================================
--- incubator/wookie/branches/standalone/WebContent/WEB-INF/web.xml (original)
+++ incubator/wookie/branches/standalone/WebContent/WEB-INF/web.xml Wed Oct 21 12:03:47 2009
@@ -38,7 +38,7 @@
 			org.apache.wookie.server.MainFilter
 		</filter-class>
 	</filter>
-		
+	
 	<filter-mapping>
 		<filter-name>MainFilter</filter-name>
 		<url-pattern>/*</url-pattern>

Modified: incubator/wookie/branches/standalone/WebContent/index.htm
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/WebContent/index.htm?rev=827972&r1=827971&r2=827972&view=diff
==============================================================================
--- incubator/wookie/branches/standalone/WebContent/index.htm (original)
+++ incubator/wookie/branches/standalone/WebContent/index.htm Wed Oct 21 12:03:47 2009
@@ -1,3 +1,3 @@
 <script>
 window.location.href="/wookie/webmenu/WidgetWebMenuServlet?operation=INDEX";						
-</script>
\ No newline at end of file
+</script>

Added: incubator/wookie/branches/standalone/ant/build.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ant/build.xml?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/ant/build.xml (added)
+++ incubator/wookie/branches/standalone/ant/build.xml Wed Oct 21 12:03:47 2009
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="wookie" basedir="." default="run">
+	<description>
+			  	Widget Server Build File
+			 	-------------------------		  				  
+	</description>
+		
+	<property name="webcontent" value="../WebContent"/>
+	<property name="lib" value="${webcontent}/WEB-INF/lib"/>
+	<property name="dist" value="${webcontent}/WEB-INF/lib"/>
+	<property name="shindig" value="../shindig"/>
+	<property name="src" value="../src"/>
+	<property name="test.src.dir" value="../src-tests"/>
+	<property name="tests" value="../src-tests"/>
+	<property name="meta-inf" value="${webcontent}/META-INF"/>		
+	<property name="work" value="${basedir}/build"/>
+	<property name="war.file" value="${war.file}"/>
+	<property name="classes.dir" value="${work}/wookie/WEB-INF/classes"/>
+	
+	<property name="dev.lib.dir" value="../dev_lib"/>
+	
+	<!-- FIXME: These properties are dependent on a specific file setup and therefore not appropriate -->
+	<property name="ccrt.home" value="../../ccrt" />
+	<property name="jboss.home" value="${ccrt.home}/jboss-4.0.4.GA" />		
+	<property name="deploy.folder" value="${jboss.home}/server/default/deploy" />	
+	<property name="deploy.conf" value="${jboss.home}/server/default/conf" />
+	
+	<!-- External jar dependencies -->
+	<property name="jta.lib" value="${lib}/jta-1_1-classes.jar"/>
+	<property name="c3p0.lib" value="${lib}/c3p0-0.9.1.2.jar"/>
+	<property name="hibernate.lib" value="${lib}/hibernate3.jar"/>	
+	<property name="mysql.lib" value="${lib}/mysql-connector-java-5.0.5-bin.jar"/>
+	<!-- end external jar dependencies -->
+
+	<tstamp prefix="header">
+			<format property="DSTAMP" pattern="EEEE d MMMM yyyy" locale="en"/>
+			<format property="TSTAMP" pattern="HH:mm" locale="en"/>
+	</tstamp>
+		
+	<target name="failIfMissingRequiredProperties" unless="extpropset.okay">
+	    <fail message="You need to set required properties for external dependencies"/>
+	</target>
+	<target name="failIfMissingRequiredFiles" unless="extpropavail.okay">
+	    <fail message="Required external dependencies are missing - there are a number of incompatibly licenced libraries required, please ensure you have downloaded as in structed in http://cwiki.apache.org/confluence/display/WOOKIE/Sources "/>
+	</target>
+	
+	<target name="init">
+		<echo message="${line.separator}Project : ${ant.project.name}"/>
+		<echo message="------------------------------------------------------------------"/>
+		<echo message="Build File : ${ant.file}"/>
+		<echo message="Ant Version: ${ant.version}"/>
+		<echo message="JVM Version: ${ant.java.version}"/>
+		<echo message="OS Version : ${os.name} ${os.version} (${os.arch})"/>
+		<echo message="Time Stamp : ${header.DSTAMP} at ${header.TSTAMP}"/>
+		<echo message="------------------------------------------------------------------"/>
+		<echo message=""/>
+		
+		<mkdir dir="${work}/"/>
+		
+		<path id="class.path">
+			<fileset dir="${lib}" includes="*.jar"/>
+		</path>
+
+		<path id="dev.class.path">
+	        <path refid="class.path"/>
+			<fileset dir="${dev.lib.dir}" includes="*.jar"/>
+		    <pathelement path="${classes.dir}"/>
+		</path>
+			
+		<condition property="extpropset.okay">
+	    	 <and>
+	    	   	<isset property="jta.lib"/>
+	    	   	<isset property="c3p0.lib"/>
+		    	<isset property="hibernate.lib"/>
+		    	<isset property="mysql.lib"/>
+	    	 </and>
+	    </condition>
+	    <condition property="extpropavail.okay">
+	    	<and>
+				<available file="${jta.lib}"/>
+				<available file="${c3p0.lib}"/>
+				<available file="${hibernate.lib}"/>
+				<available file="${mysql.lib}"/>
+	    	</and>
+		</condition>
+	    <antcall target="failIfMissingRequiredProperties"/>
+	    <antcall target="failIfMissingRequiredFiles"/>
+	</target>
+		
+	<target name="build_src" depends="init">		
+		<mkdir dir="${classes.dir}"/>
+		<javac source="1.5" target="1.5" optimize="true" debug="true"
+			deprecation="true" srcdir="${src}" destdir="${classes.dir}">
+			<classpath refid="class.path"/>
+		</javac>
+		<!-- Copy necessary files -->
+		<copy todir="${classes.dir}">
+			<fileset dir="${src}">
+			    <exclude name="**/*.java"/>
+			</fileset>
+		</copy>
+		<copy todir="${work}/wookie">
+			<fileset dir="${webcontent}">			    
+				<exclude name="META-INF"/>
+				<exclude name="META-INF"/>
+			</fileset>
+		</copy>									
+	</target>
+	
+	<target name="compile_test" depends="build_src">
+		<javac source="1.5" target="1.5" optimize="true" debug="true"
+			deprecation="true" srcdir="${test.src.dir}" destdir="${classes.dir}">
+			<classpath refid="dev.class.path"/>
+		</javac>								
+	</target>
+	
+	<target name="build_war" depends="build_src">		
+		<war destfile="wookie_temp.war" webxml="${work}/wookie/WEB-INF/web.xml">		  
+			<!--<metainf dir="${meta-inf}" includes="context.xml"/>-->
+		  	<lib dir="${webcontent}/WEB-INF/lib">
+		  		<exclude name="mysql-connector-java-5.0.5-bin.jar"/>
+		  	</lib>
+		  	<classes dir="${classes.dir}"/>
+			<fileset dir="${webcontent}">
+				 <include name="*.htm"/>
+				 <include name="admin/**.*"/>
+				 <include name="upload/**/*.*"/>
+				 <include name="shared/js/**/*.*"/>
+				 <include name="shared/images/**/*.*"/>
+				 <include name="wservices/**/*.*"/>
+				 <include name="WEB-INF/dwr.xml"/>
+				<include name="WEB-INF/jboss-web.xml"/>
+			</fileset>  
+		</war>
+	</target>
+	
+	<target name="clean" description="Cleans everything" depends="init">
+		<delete includeemptydirs="true">			
+			<fileset dir="${work}/" includes="**/*"/>
+			<fileset dir="${basedir}/" includes="wookie_temp.war"/>	
+			<fileset dir="${classes.dir}" includes="**/*"/>
+		</delete>			
+	</target>
+
+	<target name="build" depends="build_src,build_war" description="Builds the deployment">
+		<echo message="Done."/>
+	</target>
+	
+	<target name="rebuild" depends="build" description="Rebuilds all">
+		<echo message="Done."/>
+	</target>
+
+	<target name="dist" depends="rebuild,deploy,clean" description="Create distribution">
+		<echo message="Done."/>
+	</target>
+
+	<target name="deploy">
+		<!-- to do copy over wars to deploy folder -->
+		<copy todir="${deploy.folder}">
+	    	<fileset dir=".">
+	        	<include name="wookie_temp.war"/>	
+	      	</fileset>
+		</copy>  
+		<mkdir dir="${deploy.folder}/wookie.war"/>
+		<unzip src="${deploy.folder}/wookie_temp.war" dest="${deploy.folder}/wookie.war"/>
+		<delete file="${deploy.folder}/wookie_temp.war"/>
+		<copy file="${c3p0.lib}" tofile="${tomcat.lib}/c3p0-0.9.1.2.jar" overwrite="yes"/>
+		<delete file="${tomcat.lib}/commons-httpclient.jar"/>
+		<copy file="${lib}/commons-httpclient-3.0.1.jar" tofile="${tomcat.lib}/commons-httpclient-3.0.1.jar" overwrite="yes"/>
+		<copy file="../scripts/log4j.xml" tofile="${deploy.conf}/log4j.xml" overwrite="yes"/>
+	</target>
+	
+	<target name="build_wookie_standalone" depends="build_src, make_libs">
+		<copy file="${src}/hibernate.cfg.xml" tofile="${classes.dir}/hibernate.cfg.xml" overwrite="yes"/>
+			
+		<war destfile="${war.file}" webxml="${work}/wookie/WEB-INF/web.xml">		  
+					<metainf dir="${meta-inf}" includes="context.xml"/>
+				  	<lib dir="${work}/wookie/WEB-INF/lib"/>				  
+				  	<classes dir="${classes.dir}"/>
+					<fileset dir="${webcontent}">
+						 <include name="*.htm"/>
+						 <include name="*.css"/>
+						 <include name="error/**.*"/>
+						 <include name="admin/**.*"/>
+						 <include name="webmenu/**.*"/>
+						 <include name="upload/**/*.*"/>
+						 <include name="shared/js/**/*.*"/>
+						 <include name="shared/images/**/*.*"/>
+						 <include name="wservices/**/*.*"/>
+						 <include name="WEB-INF/dwr.xml"/>
+						<include name="WEB-INF/jboss-web.xml"/>
+					</fileset>  
+				</war>
+		<delete includeemptydirs="true">			
+				<fileset dir="${work}/" excludes="wookie_tomcat.war" includes="**/*"/>								
+		</delete>
+		<mkdir dir="${work}/wookie"/>
+		<unzip src="${war.file}" dest="${work}/wookie"/>	
+		<delete file="${war.file}"/>
+		
+		<copy todir="${work}/licenses">
+		    <fileset dir="../licenses"/>
+		  </copy>
+		<copy todir="${work}/docs">
+		    <fileset dir="../docs"/>
+		</copy>
+
+		<copy file="../readme_tomcat.txt" tofile="${work}/readme.txt" overwrite="yes"/>
+		<copy file="../scripts/widgetdb_mysql.sql" tofile="${work}/widgetdb_mysql.sql" overwrite="yes"/>
+		<zip destfile="${work}/wookie_for_tomcat.zip" basedir="${work}" excludes="${work}/CVS"/>		
+		<delete includeemptydirs="true">			
+				<fileset dir="${work}/" excludes="wookie_for_tomcat.zip,CVS" includes="**/*"/>								
+		</delete>
+	</target>
+	
+	<target name="build_with_shindig" depends="clean, build_src, copy_shindig_files, build_wookie_standalone"
+		description="Builds with Shindig OpenSocial container">
+		<echo message="Done."/>
+	</target>
+	
+	<target name="make_libs">
+		<mkdir dir="${work}/wookie/WEB-INF/lib"/>
+		<copy todir="${work}/wookie/WEB-INF/lib" overwrite="yes">
+			<fileset dir="${webcontent}/WEB-INF/lib"/>
+		</copy>
+		<copy file="${jta.lib}" toFile="${work}/wookie/WEB-INF/lib/jta.jar" overwrite="yes"/>
+		<copy file="${c3p0.lib}" toFile="${work}/wookie/WEB-INF/lib/c3p0.jar" overwrite="yes"/>
+		<copy file="${hibernate.lib}" toFile="${work}/wookie/WEB-INF/lib/hibernate.jar" overwrite="yes"/>
+		<copy file="${mysql.lib}" toFile="${work}/wookie/WEB-INF/lib/mysql-connector.jar" overwrite="yes"/>
+	</target>
+	
+	<target name="copy_shindig_files">
+		<!-- copy libraries -->
+		<mkdir dir="${work}/wookie/WEB-INF/lib"/>
+		<copy todir="${work}/wookie/WEB-INF/lib" overwrite="yes">
+			<fileset dir="${shindig}/WEB-INF/lib"/>
+		</copy>
+		<!-- copy config files -->
+		<copy todir="${work}/wookie/WEB-INF" overwrite="yes">
+			<fileset dir="${shindig}/WEB-INF"/>
+		</copy>	
+		<!-- copy combined web.xml -->
+		<copy file="${shindig}/WEB-INF/web.xml" tofile="${work}/wookie/WEB-INF/web.xml" overwrite="yes"/>
+	</target>
+	
+	<target name="cold_deploy" description="Build, destroy, deploy">
+		<!--clear db-->
+		   <sql 
+		   	classpath="${mysql.lib}"
+		   	driver="com.mysql.jdbc.Driver" 
+		   	url="jdbc:mysql://localhost:3306/?autoReconnect=true" 
+		   	userid="root" password="" >
+		      <transaction src="../scripts/widgetdb_mysql.sql"/>
+		    </sql>
+		
+		<!--delete old app-->
+		<echo message="Deleting app"/>
+		<delete includeemptydirs="true">			
+				<fileset dir="/usr/local/tomcat-5.5.27/webapps/wookie" includes="/**/*.*"/>								
+		</delete>
+		
+		<!--unzip to tomcat-->
+		<unzip src="${work}/wookie_for_tomcat.zip" dest="/usr/local/tomcat-5.5.27/webapps/"/>		
+		
+		<!--restart server-->
+		<exec dir="/usr/local/tomcat-5.5.27/bin" executable="sh">
+				<arg line="restart.sh"/>
+			</exec>
+		<echo message="Done."/>
+	</target>
+	
+	<target name="build and deploy" description="Build, destroy, deploy" depends="build_with_shindig, cold_deploy">
+		<echo message="Done."/>	
+	</target>
+	
+	<!-- ======================================================================================= -->
+	<!-- Run in Jetty, useful for testing and development, nt useful for deployment              -->
+	<!-- ======================================================================================= -->
+	<target name="run"
+      depends="build_src, compile_test, copy_shindig_files"
+      description="* Run Jetty (instant live webapp)">
+	    <java classname="org.apache.wookie.WookieDevServer"
+	    	  dir=".."
+	          fork="yes"
+	          failonerror="yes">
+			<classpath refid="dev.class.path"/>
+	    </java>
+	</target>
+	
+</project>

Added: incubator/wookie/branches/standalone/ant/ivy-common.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ant/ivy-common.xml?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/ant/ivy-common.xml (added)
+++ incubator/wookie/branches/standalone/ant/ivy-common.xml Wed Oct 21 12:03:47 2009
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns:ivy="antlib:org.apache.ivy.ant" >
+	<ivy:settings id="ivy.instance" file="${ivy.repository.dir}/ivysettings.xml" />
+	
+	<property name="ivy.install.version" value="2.1.0-rc2" />
+    <condition property="ivy.home" value="${env.IVY_HOME}">
+      <isset property="env.IVY_HOME" />
+    </condition>
+    <property name="ivy.home" value="${user.home}/.ant" />
+    <property name="ivy.jar.dir" value="${ivy.home}/lib" />
+    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
+    
+	<property file="${ivy.repository.dir}/build.properties"/>
+	
+	<property file="${basedir}/local.build.properties" />
+	
+	<property name="project.build.dir" location="build"/>
+
+    <target name="download-ivy" unless="offline">
+
+        <mkdir dir="${ivy.jar.dir}"/>
+        <!-- download Ivy from web site so that it can be used even without any special installation -->
+        <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" 
+             dest="${ivy.jar.file}" usetimestamp="true"/>
+    </target>
+
+    <target name="init-ivy" depends="download-ivy">
+      <!-- try to load ivy here from ivy home, in case the user has not already dropped
+              it into ant's lib dir (note that the latter copy will always take precedence).
+              We will not fail as long as local lib dir exists (it may be empty) and
+              ivy is in at least one of ant's lib dir or the local lib dir. -->
+        <path id="ivy.lib.path">
+            <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
+
+        </path>
+        <taskdef resource="org/apache/ivy/ant/antlib.xml"
+                 uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
+    </target>
+	
+    <target name="configure" depends="init-ivy">
+    </target>
+	
+    <target name="resolve" depends="configure, clean-lib" description="--> retrieve dependencies with ivy">
+        <ivy:resolve />
+    </target>
+    
+    <target name="report" depends="resolve" description="--> generates a report of dependencies">
+        <ivy:report todir="${build.dir}"/>
+    </target>
+	
+    <target name="new-version">
+        <propertyfile file="${basedir}/version.properties">
+	        <entry  key="version" type="int" operation="+" default="0" />
+		</propertyfile>
+    </target>
+
+    <target name="check-version">
+    	<!-- test existence of version file -->
+    	<available file="${basedir}/version.properties" property="version.exists"/>
+    </target>
+
+    <target name="init-version" depends="check-version" unless="version.exists">
+    	<!-- init version file if it doesn't exist -->
+		<echo message="version=1" file="${basedir}/version.properties" />
+    </target>
+
+	<target name="version" depends="init-version">
+    	<!-- copy version file in classpath for later inclusion in jar -->
+        <mkdir dir="${project.build.classes.dir}"/>
+		<copy file="${basedir}/version.properties" tofile="${project.build.classes.dir}/${ant.project.name}.properties" overwrite="true" />
+        <property file="${project.build.classes.dir}/${ant.project.name}.properties" />
+    </target>
+
+    <target name="local-version">
+		<tstamp>
+			<format property="now" pattern="yyyyMMddHHmmss"/>
+		</tstamp>
+        <property name="revision" value="${now}"/>
+    	<!-- used only to create a local version and put the corresponding file in the jar so that it will be displayed by the module -->
+        <mkdir dir="${project.build.classes.dir}"/>
+		<echo message="version=${revision}" file="${project.build.classes.dir}/${ant.project.name}.properties" append="false" />
+
+        <property file="${project.build.classes.dir}/${ant.project.name}.properties" />
+    </target>
+
+	<target name="clean-local" depends="configure" description="cleans the local repository for the current module">
+	   <delete dir="${ivy.local.default.root}/${ant.project.name}"/>
+	</target>
+
+    <target name="clean-lib" description="--> clean the project libraries directory (dependencies)">
+        <delete includeemptydirs="true" dir="${project.lib.dir}"/>
+    </target>
+
+    <target name="clean-build" description="--> clean the project built files">
+        <delete includeemptydirs="true" dir="${project.build.dir}"/>
+    </target>
+
+    <target name="clean-dist" description="--> clean the project distribution files">
+        <delete includeemptydirs="true" dir="${dist.dir}"/>
+    </target>
+
+    <target name="clean" depends="clean-build, clean-lib" description="--> clean the project and reset version number">
+      <delete file="${basedir}/version.properties"/>
+      <ivy:cleancache />
+    </target>
+</project>

Added: incubator/wookie/branches/standalone/ant/ivy-java-common.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ant/ivy-java-common.xml?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/ant/ivy-java-common.xml (added)
+++ incubator/wookie/branches/standalone/ant/ivy-java-common.xml Wed Oct 21 12:03:47 2009
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+
+    <import file="ivy-common.xml"/>
+	
+	<property name="project.lib.dir" location="${project.webapp.dir}/WEB-INF/lib" />
+
+	<property name="project.core.src.dir" location="src" />
+	<property name="project.test.src.dir" location="src-tests" />
+
+	<property name="project.build.classes.dir" location="${project.build.dir}/classes" />
+
+	<property name="compile.debug" value="on" />
+	<property name="wookie.jvmargs" value="" />
+	
+	<property name="dist.dir" location="dist"/>
+	
+    <property name="jar.file" location="${dist.dir}/${ant.project.name}.jar"/>
+	
+	<property name="java.source.version" value="1.5"/>
+	<property name="java.target.version" value="1.5"/>
+	
+	<target name="init">
+    	<available file="${project.core.src.dir}" property="project.core.src.dir.exists"/>
+    	<available file="${project.test.src.dir}" property="project.test.src.dir.exists"/>
+		<ivy:cachepath pathid="project.core.class.path" conf="default" />
+		<ivy:cachepath pathid="project.test.class.path" conf="test" />
+		
+	    <path id="run.path.id">
+	        <path refid="project.core.class.path" />
+	        <path location="${project.build.classes.dir}" />
+	    </path>
+	</target>
+    
+    <target name="compile-test" 
+    	depends="compile-core" description="--> compile the project tests"
+    	if="project.test.src.dir.exists">
+    	<echo>Compiling test files in ${project.test.src.dir}</echo>
+        <mkdir dir="${project.build.classes.dir}" />
+		<javac source="${java.source.version}" 
+			target="${java.target.version}" 
+		    destdir="${project.build.classes.dir}" 
+			debug="${compile.debug}" 
+			classpathref="project.test.class.path">
+			<src path="${project.test.src.dir}" />
+		</javac>
+		
+		<echo>Copying resources from test source directory</echo>
+		<copy todir="${project.build.classes.dir}">
+			<fileset dir="${project.test.src.dir}">
+				<exclude name="**.java" />
+			</fileset>
+		</copy>
+		
+    	<antcall target="post-compile-test"/>
+    </target>
+    
+    <target name="post-compile-test" description="Run after compile-test. Intended to be overridden if your project needs any post compile processing"/>
+    
+    <target name="compile-core" 
+    	depends="resolve, init" description="--> compile the project"
+    	if="project.core.src.dir.exists">
+    	<echo>Compiling files in ${project.core.src.dir}</echo>
+        <mkdir dir="${project.build.classes.dir}" />
+		<javac 
+			source="${java.source.version}" 
+			target="${java.target.version}" 
+		    destdir="${project.build.classes.dir}" 
+			debug="${compile.debug}" 
+			classpathref="project.core.class.path">
+			<src path="${project.core.src.dir}" />
+		</javac>
+		
+		<echo>Copying resources from source directory</echo>
+		<copy todir="${project.build.classes.dir}">
+			<fileset dir="${project.core.src.dir}">
+				<exclude name="**.java" />
+			</fileset>
+		</copy>
+		
+    	<antcall target="post-compile-core"/>
+    </target>
+    
+    <target name="post-compile-core" description="Run after compile-core. Intended to be overridden if your project needs any post compile processing"/>
+    	
+    <target name="run" depends="version, compile-core" description="--> compile and run the project">
+        <java classname="${main.class.name}"
+        	classpathref="run.path.id"
+            fork="true"
+            failonerror="true">
+            <jvmarg line="${wookie.jvmargs}"/>
+        </java>    	
+    </target>
+    
+    <target name="jar" depends="clean-dist, version, compile-core" description="--> make a jar file for this project">
+    	<mkdir dir="${dist.dir}"/>
+        <jar destfile="${jar.file}">
+            <fileset dir="${project.build.classes.dir}"/>
+        </jar>
+    </target>
+	
+    <target name="publish" depends="clean-build, new-version, jar" description="--> publish this project in the ivy repository">
+        <property name="revision" value="${version}"/>
+    	<ivy:publish
+    	   artifactspattern="[artifact].[ext]"
+           resolver="shared"
+           pubrevision="${revision}" 
+    	/>
+        <echo message="project ${ant.project.name} released with version ${revision}" />
+    </target>
+
+    <target name="publish-local" depends="clean-dist, local-version, jar" description="--> publish this project in the local ivy repository">
+		<delete file="${build.dir}/ivy.xml"/> <!-- delete last produced ivy file to be sure a new one will be generated -->
+    	<ivy:publish resolver="local"
+    		artifactspattern="${dist.dir}/[artifact].[ext]"
+    		pubrevision="${revision}"
+    		forcedeliver="true"
+			pubdate="${now}"
+    	/>
+        <echo message="project ${ant.project.name} published locally with version ${revision}" />
+    </target>
+
+</project>

Added: incubator/wookie/branches/standalone/ant/ivy-webapp-common.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ant/ivy-webapp-common.xml?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/ant/ivy-webapp-common.xml (added)
+++ incubator/wookie/branches/standalone/ant/ivy-webapp-common.xml Wed Oct 21 12:03:47 2009
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+
+	<property name="project.webapp.dir" location="src/webapp" />
+	<property name="project.lib.dir" location="lib" />
+
+	<property name="serveltEngine.webapp.dir" location="C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps" />
+
+	<import file="ivy-java-common.xml" />
+	
+	<target name="stopserver">
+		<parallel>
+			<java classname="org.apache.wookie.server.Stop" classpathref="run.path.id" />
+		</parallel>
+	</target>
+
+	<target name="deploy-webapp" depends="compile-core">
+		<copy todir="${serveltEngine.webapp.dir}/${ant.project.name}/WEB-INF/classes">
+			<fileset dir="${project.build.classes.dir}" />
+		</copy>
+
+		<copy todir="${serveltEngine.webapp.dir}/${ant.project.name}">
+			<fileset dir="${project.webapp.dir}" />
+		</copy>
+
+		<ivy:retrieve />
+		<copy todir="${serveltEngine.webapp.dir}/${ant.project.name}/WEB-INF/lib">
+			<fileset dir="${project.lib.dir}" />
+		</copy>
+
+		<antcall target="post-deploy-webapp" />
+	</target>
+
+	<target name="post-deploy-webapp" />
+
+	<target name="undeploy-webapp">
+		<delete dir="${serveltEngine.webapp.dir}/${ant.project.name}" />
+	</target>
+
+</project>

Added: incubator/wookie/branches/standalone/ant/ivysettings.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ant/ivysettings.xml?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/ant/ivysettings.xml (added)
+++ incubator/wookie/branches/standalone/ant/ivysettings.xml Wed Oct 21 12:03:47 2009
@@ -0,0 +1,11 @@
+<ivysettings>
+  <settings defaultResolver="wookie-chain" />
+  <resolvers>
+    <chain name="wookie-chain">
+      <filesystem name="main">
+        <artifact pattern="${basedir}/${ivy.repository.dir}/lib/[artifact]-[revision].[type]" />
+      </filesystem>>
+      <ibiblio name="public" m2compatible="true"/>
+    </chain>
+  </resolvers>
+</ivysettings>

Added: incubator/wookie/branches/standalone/ant/lib/htmlcleaner-2.1.0.jar
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ant/lib/htmlcleaner-2.1.0.jar?rev=827972&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/wookie/branches/standalone/ant/lib/htmlcleaner-2.1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/wookie/branches/standalone/ant/lib/shindig-common-1.1-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ant/lib/shindig-common-1.1-SNAPSHOT.jar?rev=827972&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/wookie/branches/standalone/ant/lib/shindig-common-1.1-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/wookie/branches/standalone/build.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/build.xml?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/build.xml (added)
+++ incubator/wookie/branches/standalone/build.xml Wed Oct 21 12:03:47 2009
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<project default="compile-core" basedir="." name="Wookie Build File">
+  <description>
+    Ivy based build system for Apache Forrest.
+  </description>
+  
+  <property file="build.properties"/>
+  <property name="db.name" value="widgetDB" />
+	
+  <import file="ant/ivy-webapp-common.xml"/>
+	
+  <target name="post-compile-core">
+  </target>
+	
+  <target name="clean-db" description="delete the Wookie database, it will be recreated next time the application is run">
+  	<delete dir="${db.name}"/>
+  </target>
+</project>
\ No newline at end of file

Added: incubator/wookie/branches/standalone/etc/jetty-realm.properties
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/etc/jetty-realm.properties?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/etc/jetty-realm.properties (added)
+++ incubator/wookie/branches/standalone/etc/jetty-realm.properties Wed Oct 21 12:03:47 2009
@@ -0,0 +1 @@
+java: java, widgetadmin
\ No newline at end of file

Added: incubator/wookie/branches/standalone/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/ivy.xml?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/ivy.xml (added)
+++ incubator/wookie/branches/standalone/ivy.xml Wed Oct 21 12:03:47 2009
@@ -0,0 +1,85 @@
+<ivy-module version="2.0">
+    <info organisation="org.apache.incubator" module="wookie-server"/>
+    
+    <configurations>
+	  <conf name="default"/>
+	  <conf name="test" extends="default"/>
+	</configurations>
+    
+    <dependencies>
+        <dependency org="antlr" name="antlr" rev="2.7.7">
+        </dependency>
+        <dependency org="cglib" name="cglib" rev="2.2">
+        </dependency>
+        <dependency org="commons-codec" name="commons-codec" rev="1.3">
+        </dependency>
+        <dependency org="commons-collections" name="commons-collections" rev="3.2">
+        </dependency>
+        <dependency org="commons-configuration" name="commons-configuration" rev="1.4">
+          <exclude module="jms"/>
+          <exclude module="jmxtools"/>
+          <exclude module="jmxri"/>
+        </dependency>
+        <dependency org="commons-fileupload" name="commons-fileupload" rev="1.2.1">
+        </dependency>
+        <dependency org="commons-httpclient" name="commons-httpclient" rev="3.0.1">
+          <exclude module="jms"/>
+          <exclude module="jmxtools"/>
+          <exclude module="jmxri"/>
+        </dependency>
+        <dependency org="commons-lang" name="commons-lang" rev="2.4">
+        </dependency>
+        <dependency org="commons-logging" name="commons-logging" rev="1.1.1">
+          <exclude />
+        </dependency>
+        <dependency org="dom4j" name="dom4j" rev="1.6.1">
+        </dependency>
+        <dependency org="htmlcleaner" name="htmlcleaner" rev="2.1.0">
+        </dependency>
+        <dependency org="org.directwebremoting" name="dwr" rev="2.0.3">
+          <exclude module="jacc"/>
+          <exclude module="jms"/>
+          <exclude module="jmxri"/>
+          <exclude module="jmxtools"/>
+		</dependency>
+        <dependency org="com.google.collections" name="google-collections" rev="0.9">
+        </dependency>
+        <dependency org="org.slf4j" name="log4j-over-slf4j" rev="1.5.6">
+        </dependency> 
+        <dependency org="org.apache.incubator" name="shindig-common" rev="1.1-SNAPSHOT">
+        </dependency>
+        <dependency org="org.jdom" name="jdom" rev="1.1">
+        </dependency>
+        <dependency org="org.json" name="json" rev="20080701">
+        </dependency>
+        
+        <!-- Libraries used in a development/test environment but not in deployment -->
+        <dependency org="org.mortbay.jetty" name="jetty" rev="6.1.3">
+        </dependency>
+        <dependency org="org.mortbay.jetty" name="jetty-util" rev="6.1.3">
+        </dependency>
+        <dependency org="org.mortbay.jetty" name="jsp-2.1" rev="6.1.3">
+        </dependency>
+        <dependency org="org.mortbay.jetty" name="jsp-api-2.1" rev="6.1.3">
+        </dependency>
+        <dependency org="org.mortbay.jetty" name="servlet-api-2.5" rev="6.1.3">
+        </dependency>
+        <dependency org="org.apache.derby" name="derby" rev="10.4.2.0">
+		</dependency>
+		
+		<!-- Libraries used in testing -->
+        <dependency org="junit" name="junit" rev="4.7">
+        </dependency>
+        
+        
+        <!-- Libraries with incompatible open source licences -->
+        <dependency org="c3p0" name="c3p0" rev="0.9.1.2">
+        </dependency>
+        <dependency org="org.hibernate" name="hibernate-core" rev="3.3.1.GA">
+          <exclude module="jaas"/>
+          <exclude module="jacc"/>
+        </dependency>
+        <dependency org="mysql" name="mysql-connector-java" rev="5.1.6">
+        </dependency>
+    </dependencies>
+</ivy-module>

Modified: incubator/wookie/branches/standalone/readme.txt
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/readme.txt?rev=827972&r1=827971&r2=827972&view=diff
==============================================================================
--- incubator/wookie/branches/standalone/readme.txt (original)
+++ incubator/wookie/branches/standalone/readme.txt Wed Oct 21 12:03:47 2009
@@ -5,17 +5,51 @@
 
 For more information see http://incubator.apache.org/projects/wookie.html
 
-The code uses an Apache 2.0 license; third party licenses can be found in the folder /licenses.
+======================
+IMPORTANT LEGAL NOTICE
+======================
 
-Wookie depends on several libraries with incompatible licenses. These must be downloaded and installed to build and run Wookie:
+Apache Wookie (Incubating) depends on several libraries that are licenced under open source licences that are incompatible with
+the Apache License. When you first build the project these will be downloaded automatically by the build system.
 
-- hibernate 3
-- jta
-- mysql-connector
-- c3p0
 
-For instructions on setting up Wookie under Tomcat, see readme_tomcat.txt. 
+Building
+========
 
-For instructions on setting up Wookie with CopperCore, see readme_coppercore.txt
+You will need to download and install Apache Ant in order to build from source. See http://ant.apace.org
+
+Once installed run the following commands:
+
+cd PROJECT_HOME_DIRECTORY
+ant
+
+The first time you run this command all dependencies will be downloaded so you must be online and it will take some time. 
+Subsequent builds will be much faster.
+
+Running
+=======
+
+The following will compile any changed java files and run the webserver in demo mode, complete with an embedded database. 
+The database will be automatically updated at construction - do not use this approach in production.
+
+cd PROJECT_HOME_DIRECTORY
+ant run
+http://localhost:8080/wookie
+
+To access the administration menu (http://localhost:8080/wookie/admin) use the username 'java' and password 'java'.
+
+If you want to start with a completely clean build then use:
+
+ant clean-build run
+
+If you want to clean the database use:
+
+ant clean-db
+
+Debugging
+=========
+
+To run the server in debug mode on a specific port use the wookie.jvmargs property, as follows:
+
+ant -Dwookie.jvmargs="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" run
 
-Problems - email P.Sharples@bolton.ac.uk

Added: incubator/wookie/branches/standalone/scripts/widgetdb_derby.sql
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/scripts/widgetdb_derby.sql?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/scripts/widgetdb_derby.sql (added)
+++ incubator/wookie/branches/standalone/scripts/widgetdb_derby.sql Wed Oct 21 12:03:47 2009
@@ -0,0 +1,7 @@
+INSERT INTO Widget VALUES (1,'Unsupported widget widget','This widget is a placeholder for when no corresponding widget is found for a given type','Paul Sharples','/wookie/shared/images/defaultwidget.png','/wookie/wservices/www.tencompetence.org/widgets/default/notsupported/index.htm','http://www.tencompetence.org/widgets/default/notsupported',350,500,'f','v1.0'),(2,'Default chat widget','This widget provides a simple chat or Instant messaging facility','Paul Sharples','/wookie/shared/images/chat.png','/wookie/wservices/www.tencompetence.org/widgets/default/chat/index.htm','http://www.tencompetence.org/widgets/default/chat',358,500,'f','v1.0'),(3,'Default discussion/forum widget','This widget provides a threaded discussion forum facility','Paul Sharples','/wookie/shared/images/forum.png','/wookie/wservices/www.tencompetence.org/widgets/default/forum/index.htm','http://www.tencompetence.org/widgets/default/forum',350,520,'t','v1.0'),(4,'Default vote widget','This widget provi
 des a voting facility','Paul Sharples','/wookie/shared/images/vote.png','/wookie/wservices/www.tencompetence.org/widgets/default/vote/index.htm','http://www.tencompetence.org/widgets/default/vote',350,500,'f','v1.0'),(5,'Natter','A simple chat widget','Scott Wilson','/wookie/wservices/www.getwookie.org/widgets/natter/icon.png','/wookie/wservices/www.getwookie.org/widgets/natter/index.htm','http://www.getwookie.org/widgets/natter',383,255,'F','v1.0'),(6,'Weather','A simple weather widget','Scott Wilson','/wookie/wservices/www.getwookie.org/widgets/weather/icon.png','/wookie/wservices/www.getwookie.org/widgets/weather/index.htm','http://www.getwookie.org/widgets/weather',125,125,'F','v1.0');
+INSERT INTO WidgetDefault VALUES ('unsupported',1),('chat',2),('discussion',3),('forum',3),('vote',4),('natter',5),('weather',6);
+INSERT INTO WidgetService VALUES (1,'unsupported'),(2,'chat'),(3,'discussion'),(4,'forum'),(5,'vote'),(6,'natter'),(7,'weather');
+INSERT INTO WidgetType VALUES (1,1,'unsupported'),(2,2,'chat'),(3,3,'forum'),(4,3,'discussion'),(5,4,'vote'),(6,5,'natter'),(7,6,'weather');
+INSERT INTO Whitelist VALUES (1,'http://127.0.0.1'),(2,'http://localhost'),(3,'http://feeds.bbc.co.uk/weather/feeds/rss');
+INSERT INTO ServerFeature VALUES (1,'http://wave.google.com','org.tencompetence.widgetservice.feature.wave.WaveAPIImpl'),(2,'http://www.getwookie.org/usefeature/polling','org.tencompetence.widgetservice.feature.polling.impl.WookiePollingImpl');
+INSERT INTO ApiKey VALUES (1,'TEST','test@127.0.0.1');
\ No newline at end of file

Added: incubator/wookie/branches/standalone/src/org/apache/wookie/server/Start.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/src/org/apache/wookie/server/Start.java?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/src/org/apache/wookie/server/Start.java (added)
+++ incubator/wookie/branches/standalone/src/org/apache/wookie/server/Start.java Wed Oct 21 12:03:47 2009
@@ -0,0 +1,94 @@
+/*
+ *  Licensed 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.
+ */
+
+package org.apache.wookie.server;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URL;
+import java.util.StringTokenizer;
+
+import org.apache.log4j.Logger;
+import org.apache.wookie.util.hibernate.DBManagerFactory;
+import org.apache.wookie.util.hibernate.IDBManager;
+import org.hibernate.SQLQuery;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.security.HashUserRealm;
+import org.mortbay.jetty.security.UserRealm;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+public class Start {
+	static final private Logger logger = Logger.getLogger(Start.class);
+
+	private static Server server;
+
+	public static void main(String[] args) throws Exception {
+		configureDatabase();
+		configureServer();
+		startServer();
+	}
+
+	/**
+	 * Create the database by reading in the file widgetdb_derby.sql and executing all SQL found within.
+	 * 
+	 * @throws IOException  if the file is not found or is unreadable
+	 */
+	private static void configureDatabase() throws IOException {
+		logger.debug("Configuring Derby Database");
+		URL sqlFile = Start.class.getClassLoader().getResource("widgetdb_derby.sql");
+		StringBuilder fileData = new StringBuilder(1000);
+		FileReader in = new FileReader(sqlFile.getFile());
+		BufferedReader br = new BufferedReader(in);
+		char[] buf = new char[1024];
+        int numRead=0;
+        while((numRead=br.read(buf)) != -1){
+        	fileData.append(buf, 0, numRead);
+
+        }
+        br.close();
+        String sqlScript = fileData.toString();
+		
+        final IDBManager dbManager = DBManagerFactory.getDBManager();
+		StringTokenizer st = new StringTokenizer(sqlScript, ";");
+		while (st.hasMoreTokens()) {
+			String sql = st.nextToken();
+			logger.debug("Running SQL snippet: " + sql);
+	        dbManager.beginTransaction();
+			SQLQuery query = dbManager.createSQLQuery(sql);
+			query.executeUpdate();
+			dbManager.commitTransaction();
+		}
+	}
+
+	private static void startServer() throws Exception, InterruptedException {
+		logger.info("Starting Wookie Server");
+		server.start();  
+		server.join();  
+		logger.info("point your browser at http://localhost:8080/wookie");
+	}
+
+	private static void configureServer() throws Exception {
+		logger.info("Configuring Jetty server");
+		server = new Server(8080);
+		WebAppContext context = new WebAppContext();
+		context.setServer(server);
+		context.setContextPath("/wookie");
+		context.setWar("WebContent");
+		server.addHandler(context);
+		
+		HashUserRealm authedRealm = new HashUserRealm("Authentication Required","etc/jetty-realm.properties");
+		server.setUserRealms(new UserRealm[]{authedRealm});
+	}
+}

Added: incubator/wookie/branches/standalone/src/org/apache/wookie/server/Stop.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/standalone/src/org/apache/wookie/server/Stop.java?rev=827972&view=auto
==============================================================================
--- incubator/wookie/branches/standalone/src/org/apache/wookie/server/Stop.java (added)
+++ incubator/wookie/branches/standalone/src/org/apache/wookie/server/Stop.java Wed Oct 21 12:03:47 2009
@@ -0,0 +1,31 @@
+/*
+ *  Licensed 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.
+ */
+
+package org.apache.wookie.server;
+
+import java.io.OutputStream;
+import java.net.InetAddress;
+import java.net.Socket;
+
+public class Stop {
+
+	public static void main(String[] args) throws Exception {
+		Socket s = new Socket(InetAddress.getByName("127.0.0.1"), 8079);
+		OutputStream out = s.getOutputStream();
+		System.out.println("*** sending jetty stop request");
+		out.write(("\r\n").getBytes());
+		out.flush();
+		s.close();
+	}
+}
\ No newline at end of file



Mime
View raw message