[jboss-cvs] JBossAS SVN: r104571 - in projects/snowdrop/examples/trunk/sportsclub: database and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 7 15:16:38 EDT 2010


Author: marius.bogoevici
Date: 2010-05-07 15:16:37 -0400 (Fri, 07 May 2010)
New Revision: 104571

Added:
   projects/snowdrop/examples/trunk/sportsclub/database/startdb.bat
Modified:
   projects/snowdrop/examples/trunk/sportsclub/database/db-setup.sql
   projects/snowdrop/examples/trunk/sportsclub/jbossconf/pom.xml
   projects/snowdrop/examples/trunk/sportsclub/pom.xml
   projects/snowdrop/examples/trunk/sportsclub/readme.txt
Log:
updated db setup, added windows startup script, updated readme file.

Modified: projects/snowdrop/examples/trunk/sportsclub/database/db-setup.sql
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/database/db-setup.sql	2010-05-07 18:47:12 UTC (rev 104570)
+++ projects/snowdrop/examples/trunk/sportsclub/database/db-setup.sql	2010-05-07 19:16:37 UTC (rev 104571)
@@ -20,18 +20,18 @@
 ALTER TABLE PERSON ALTER COLUMN ID RESTART WITH 13;
 ALTER TABLE RESERVATION ALTER COLUMN ID RESTART WITH 7;
 ALTER TABLE INVOICE ALTER COLUMN ID RESTART WITH 2;
-INSERT INTO PERSON VALUES(1,'Ankh Morpork','Discworld','A0A0A0','Ankh Morpork','1 King','Carrot','Ironfoundersson',NULL);
-INSERT INTO PERSON VALUES(2,'Ankh Morpork','Discworld','A0A0A0','Ankh Morpork','1 Bloor','Havelock','Vetinari',NULL);
-INSERT INTO PERSON VALUES(3,'Lancre','Discworld','H0H0H0','Ramtops','1 King','Magrat','Garlick',NULL);
-INSERT INTO PERSON VALUES(4,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 Dufferin','Nobby','Nobbs',NULL);
-INSERT INTO PERSON VALUES(5,'Lancre','Ramtops','H0H0H0','Ramtops','1 King','Gytha','Ogg',NULL);
-INSERT INTO PERSON VALUES(6,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 Yonge','Samuel','Vimes',NULL);
-INSERT INTO PERSON VALUES(7,'Lancre','Ramtops','H0H0H0','Ramtops','1 King','Esmerelda','Weatherwax',NULL);
-INSERT INTO PERSON VALUES(8,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','2 Yonge','Sibyl','Vimes','');
+INSERT INTO PERSON VALUES(1,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 King','Carrot','Ironfoundersson',NULL);
+INSERT INTO PERSON VALUES(2,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 Central St.','Havelock','Vetinari',NULL);
+INSERT INTO PERSON VALUES(3,'Lancre','Ramtops','B0B0B0','Ramtops','1 King','Magrat','Garlick',NULL);
+INSERT INTO PERSON VALUES(4,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 Shades St.','Nobby','Nobbs',NULL);
+INSERT INTO PERSON VALUES(5,'Lancre','Ramtops','B0B0B0','Ramtops','1 Witch St.','Gytha','Ogg',NULL);
+INSERT INTO PERSON VALUES(6,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 Pseudopolis','Samuel','Vimes',NULL);
+INSERT INTO PERSON VALUES(7,'Lancre','Ramtops','B0B0B0','Ramtops','2 Witch St.','Esmerelda','Weatherwax',NULL);
+INSERT INTO PERSON VALUES(8,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','2 Central St.','Sibyl','Vimes','');
 INSERT INTO PERSON VALUES(9,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 University','Mustrum','Ridcully',NULL);
-INSERT INTO PERSON VALUES(10,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 King','Angua','von Uberwald',NULL);
-INSERT INTO PERSON VALUES(11,'Lancre','Ramtops','H0H0H0','Ramtops','1 King','Bill','Door',NULL);
-INSERT INTO PERSON VALUES(12,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 King','Claude','Dibbler',NULL);
+INSERT INTO PERSON VALUES(10,'Uberwald','Ramtops','A0A0A0','Ramtops','1 Wolf St.','Angua','von Uberwald',NULL);
+INSERT INTO PERSON VALUES(11,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 University','Rincewind','N/A',NULL);
+INSERT INTO PERSON VALUES(12,'Ankh Morpork','Ankh Morpork','A0A0A0','Ankh Morpork','1 Treacle Mine Road','Claude','Dibbler',NULL);
 INSERT INTO EQUIPMENT VALUES(1,'MTN 740 by NordicTrack',1,'MTN');
 INSERT INTO EQUIPMENT VALUES(2,'by Cyberwalk',0,'Omnidirectional');
 INSERT INTO EQUIPMENT VALUES(3,'95T Inclusive by LifeFitness',0,'Inclusive');

Copied: projects/snowdrop/examples/trunk/sportsclub/database/startdb.bat (from rev 104378, projects/snowdrop/examples/trunk/sportsclub/database/startdb.sh)
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/database/startdb.bat	                        (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/database/startdb.bat	2010-05-07 19:16:37 UTC (rev 104571)
@@ -0,0 +1,9 @@
+if "x%HSQLDB_JAR_LOCATION%" == "x" (
+   if "x%HSQLDB_HOME%" == "x" (
+     HSQLDB_JAR_LOCATION=%USERPROFILE%/.m2/repository/hsqldb/hsqldb/1.8.0.10/hsqldb-1.8.0.10.jar
+   )
+   else (
+     HSQLDB_JAR_LOCATION=%HSQLDB_HOME%/lib/hsqldb.jar
+   )
+)
+java -cp %HSQLDB_JAR_LOCATION% org.hsqldb.Server -database.0 file:data/sportsclubdb -dbname.0 sportsclubdb
\ No newline at end of file

Modified: projects/snowdrop/examples/trunk/sportsclub/jbossconf/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/jbossconf/pom.xml	2010-05-07 18:47:12 UTC (rev 104570)
+++ projects/snowdrop/examples/trunk/sportsclub/jbossconf/pom.xml	2010-05-07 19:16:37 UTC (rev 104571)
@@ -11,10 +11,6 @@
 
     <packaging>pom</packaging>
 
-    <properties>
-        <snowdrop.version>1.0.1-SNAPSHOT</snowdrop.version>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>hsqldb</groupId>
@@ -44,7 +40,6 @@
                                 </goals>
                                 <configuration>
                                     <tasks>
-                                        <property file="${basedir}/local.jbossas.properties"/>
                                         <property file="${basedir}/jbossas.properties"/>                                      <property name="jboss.home" value="${env.JBOSS_HOME}"/>
                                         <property name="jboss.deploy.destination"
                                                   value="${jboss.home}/server/${jboss.server.name}/deploy"/>

Modified: projects/snowdrop/examples/trunk/sportsclub/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/pom.xml	2010-05-07 18:47:12 UTC (rev 104570)
+++ projects/snowdrop/examples/trunk/sportsclub/pom.xml	2010-05-07 19:16:37 UTC (rev 104571)
@@ -56,6 +56,7 @@
                 <artifactId>snowdrop-vfs</artifactId>
                 <version>${snowdrop.version}</version>
             </dependency>
+            
             <dependency>
                 <groupId>org.jboss.javaee</groupId>
                 <artifactId>jboss-ejb-api</artifactId>
@@ -256,99 +257,6 @@
         </plugins>
     </build>
 
-
-    <repositories>
-
-        <repository>
-            <id>repository.jboss.org</id>
-            <url>http://repository.jboss.org/maven2</url>
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-
-        <repository>
-            <id>repository.jboss.org/nexus</id>
-            <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
-            <releases><enabled>true</enabled></releases>
-            <snapshots><enabled>false</enabled></snapshots>
-        </repository>
-
-        <repository>
-            <id>snapshots.jboss.org</id>
-            <url>http://snapshots.jboss.org/maven2</url>
-
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </repository>
-
-        <repository>
-            <id>repo1.maven.org</id>
-            <url>http://repo1.maven.org/maven2/</url>
-
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-
-
-        <repository>
-            <id>ibiblio</id>
-            <url>http://www.ibiblio.org/maven/mule/dependencies/maven2</url>
-
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-
-
-    </repositories>
-
-    <pluginRepositories>
-
-        <pluginRepository>
-            <id>repository.jboss.org</id>
-            <url>http://repository.jboss.org/maven2</url>
-
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </pluginRepository>
-
-        <pluginRepository>
-            <id>snapshots.jboss.org</id>
-            <url>http://snapshots.jboss.org/maven2</url>
-
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </pluginRepository>
-    </pluginRepositories>
-
     <profiles>
         <profile>
             <id>spring-2.5</id>

Modified: projects/snowdrop/examples/trunk/sportsclub/readme.txt
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/readme.txt	2010-05-07 18:47:12 UTC (rev 104570)
+++ projects/snowdrop/examples/trunk/sportsclub/readme.txt	2010-05-07 19:16:37 UTC (rev 104571)
@@ -1,20 +1,99 @@
 Sportsclub Spring JBoss Integration example
+===========================================
 
+Prerequisites:
+
+A. Maven Repository setup
+
+The Maven project setup does not make any assumptions where the artifacts used
+in the project are coming from (which repository), as users may have different
+settings for their Maven repositories (direct access to community repositories,
+proxies, enterprise repository with approved artifacts). Therefore, the setup
+of the repositories is left to the user of the application.
+
+In the most simple case, this example can be built out of the box if the
+settings.xml file for the local Maven installation enables the repositories from
+Maven Central and JBoss Releases. Instructions for setting up the latter can be
+found at: http://community.jboss.org/wiki/MavenGettingStarted-Users.
+
+The pom.xml can be modified to include references to other repositories, or
+equivalent artifact versions (if the build environment uses an enterprise-wide
+repository in which the artifacts have different version numbers).
+
+B. Spring Deployer installed in JBoss AS
+
+For running the application, the Spring Deployer must be installed in JBoss AS.
+Please refer to the appropriate documentation for details.
+
 For building & running the application:
 
 1. Execute a Maven build from the root folder of the example
 
 mvn clean package
 
-2. Setup the JBoss data source:
+Note: the application can use two different profiles, one for Spring 2.5 and
+one for Spring 3. The default profile is Spring 2.5. For building the Spring 3
+version of the application, use:
 
-cp database/sportsclub-ds.xml <JBOSS_HOME>/server/default/deploy
+mvn clean package -Pspring-3
 
-3. Start the database
+2. Setup the data source and JMS destination:
 
-database/startdb.sh
+  a) enter the jbossconf directory
+     cd jbossconf
 
-4. Reset the database (with the database started)
+  b) modify the jbossconf/jbossas.properties file to indicate the correct location
+  of the JBoss AS installation
 
-database/resetdb.sh
+  c) execute the maven build:
 
+    mvn -Pinstall
+
+3. Initialize the database
+
+   a) enter the database directory
+
+      cd database
+
+   b) execute the maven build
+
+      mvn -Pdb-setup
+
+4. Start the database
+
+   a) execute the database startup script from the database directory (instructions):
+
+      on Linux and other *nix-like systems: ./startdb.sh
+      on Windows: ./startdb.bat
+
+5. Deploy the application
+
+   Copy one of the two ears produced by the build to the deloy folder of JBoss AS.
+
+   The deployment folder is: JBOSS_HOME/server/default/deploy
+
+   The two (alternative) build files are:
+
+   sportsclub-ear/target/sportsclub.ear (Hibernate-based implementation)
+
+   sportsclub-jpa-ear/target/sportsclub.ear (JPA-based implementation, using Hibernate as the underlying provider)
+
+6. Start JBoss AS
+
+7. Point the browser at one of:
+
+   http://localhost:8080/sportsclub/invoicing
+   http://localhost:8080/sportsclub/reservations
+   http://localhost:8080/sportsclub/subscriptions
+
+
+Steps 1,2,3 need to be executed only once for setting up the runtime environment.
+
+Step 3 can be repeated any time in order to reset the database (with the application stopped).
+
+Steps 5,6 do not need to be executed in a particular order, but the database must be started
+before the application is deployed.
+
+
+
+      




More information about the jboss-cvs-commits mailing list