From: Vance K. <va...@us...> - 2007-06-19 15:33:51
|
User: vancek Date: 07/06/19 08:33:43 Modified: andromda-seam/src/site changes.xml site.xml Added: andromda-seam/src/site/axdoc startup.xml Log: improve docs & add getting started procedures Revision Changes Path 1.3 +3 -0 cartridges/andromda-seam/src/site/changes.xml Index: changes.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-seam/src/site/changes.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- changes.xml 20 May 2007 07:06:55 -0000 1.2 +++ changes.xml 19 Jun 2007 15:33:42 -0000 1.3 @@ -15,6 +15,9 @@ when you have SFSB seam components. (Stateful session bean component should have a method marked @Remove @Destroy) </action> + <action dev="vancek" due-to="" type="add"> + Added startup.xml xdoc thanks to hermida. + </action> </release> </body> </document> \ No newline at end of file 1.2 +8 -0 cartridges/andromda-seam/src/site/site.xml Index: site.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-seam/src/site/site.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- site.xml 12 Apr 2007 15:29:31 -0000 1.1 +++ site.xml 19 Jun 2007 15:33:42 -0000 1.2 @@ -15,6 +15,14 @@ <item name="Cartridges" href="http://galaxy.andromda.org/docs/andromda-cartridges/index.html"/> <item name="AndroMDA" href="http://www.andromda.org"/> </links> + <menu name="Overview"> + <item name="Seam Cartridge" href="index.html"/> + <item name="Getting Started Guide" href="startup.html"/> + </menu> + <menu name="Model"> + <item name="Profile" href="profile.html"/> + <item name="Namespace" href="namespace.html"/> + </menu> ${reports} </body> </project> 1.1 cartridges/andromda-seam/src/site/axdoc/startup.xml Index: startup.xml =================================================================== <?xml version="1.0" encoding="iso-8859-1" ?> <document> <properties> <author email="lea...@fm...">Leandro Hermida</author> <title>AndroMDA + EJB3 + Seam Step-by-Step Getting Started Guide</title> </properties> <body> <section name="AndroMDA + EJB3 + Seam Step-by-Step Getting Started Guide"> <p> This guide gives you a step-by-step guide to setting up AndroMDA with the EJB3 and Seam cartridges and to start you on your first project. The commands I show are for installing everything from your home directory on a Unix/Linux system using Bash as your shell. I imagine that the steps would be similar on Windows. </p> <a name="Java JDK 5.0"/> <subsection name="Java JDK 5.0"> <p> Open a terminal and type: </p> <source><![CDATA[ [user@server ~]$ mkdir ~/java [user@server ~]$ cd java [user@server java]$ firefox http://java.sun.com/javase/downloads/index_jdk5.jsp ]]></source> <p> Scroll down the web page and click the button to download just <b>JDK 5.0 Update xx</b> (presently xx = 12). Select the correct self-extracting file for your hardware and OS (e.g. jdk-1_5_0_12-linux-i586.bin) and save this file into the <b>~/java</b> folder. Back in the terminal: </p> <source><![CDATA[ [user@server java]$ chmod 744 jdk-1_5_0_12-linux-i586.bin [user@server java]$ ./jdk-1_5_0_12-linux-i586.bin ]]></source> <p> The installer will unpack everything to the directory jdk1.5.0_12. After it finishes type: </p> <source><![CDATA[ [user@server java]$ ln -s jdk1.5.0_12 current ]]></source> <p> Now in your favorite editor edit <b>~/.bash_profile</b> and add: </p> <source><![CDATA[ JAVA_HOME=$HOME/java/current export JAVA_HOME ]]></source> <p> Also append <code>$JAVA_HOME/bin</code> to the front of the already existing <code>PATH</code> definition. It should look something like: </p> <source><![CDATA[ PATH=$JAVA_HOME/bin:$PATH:$HOME/bin export PATH ]]></source> <p> Source your updated <b>~/.bash_profile</b>: </p> <source><![CDATA[ [user@server ~]$ . ~/.bash_profile ]]></source> </subsection> <a name="JBoss AS 4.0.5 with EJB3 Profile via JEMS Installer"/> <subsection name="JBoss AS 4.0.5 with EJB3 Profile via JEMS Installer"> <p> In your terminal type: </p> <source><![CDATA[ [user@server ~]$ mkdir ~/jboss [user@server ~]$ cd jboss [user@server jboss]$ firefox http://labs.jboss.com/jemsinstaller/ ]]></source> <p> Scroll down the web page and click the link to download <b>jems-installer-1.2.0.GA.jar</b> Save this file into the <b>~/jboss</b> folder. Back in the terminal: </p> <source><![CDATA[ [user@server jboss]$ java -jar jems-installer-1.2.0.GA.jar ]]></source> <p> A graphical installer will start. When prompted for the installation path, adjust the default value to <b>/path/to/your/home/jboss/jboss-4.0.5.GA</b>. When prompted for the installation profile make sure to select <b>ejb3</b> or <b>ejb3-clustered</b>. Proceed with the rest of the graphical installation. When it completes go back to the terminal and type: </p> <source><![CDATA[ [user@server jboss]$ ln -s jboss-4.0.5.GA current ]]></source> <p> Edit <b>~/.bash_profile</b> again and add: </p> <source><![CDATA[ JBOSS_HOME=$HOME/jboss/current export JBOSS_HOME ]]></source> <p> Source your updated <b>~/.bash_profile</b>: </p> <source><![CDATA[ [user@server ~]$ . ~/.bash_profile ]]></source> </subsection> <a name="JBoss Seam"/> <subsection name="JBoss Seam"> <p> In your terminal type: </p> <source><![CDATA[ [user@server ~]$ mkdir ~/jboss/seam [user@server ~]$ cd jboss/seam [user@server seam]$ firefox http://labs.jboss.com/jbossseam/download/ ]]></source> <p> Click on the link to download JBoss Seam 1.2.1 GA and save the file in <b>~/jboss/seam</b>. Back in the terminal type: </p> <source><![CDATA[ [user@server seam]$ unzip jboss-seam-1.2.1.GA.zip [user@server seam]$ ln -s jboss-seam-1.2.1.GA current [user@server seam]$ cd jboss-seam-1.2.1.GA ]]></source> <p> Edit the <b>build.properties</b> file to read: </p> <source><![CDATA[ #tomcat.home = C:\\Tomcat-5.5 jboss.home = /path/to/your/home/jboss/current ]]></source> </subsection> <a name="Maven2"/> <subsection name="Maven2"> <p> In your terminal type: </p> <source><![CDATA[ [user@server ~]$ mkdir ~/maven [user@server ~]$ cd maven [user@server maven]$ firefox http://archive.apache.org/dist/maven/binaries/ ]]></source> <p> Scroll down and click to download the file <b>maven-2.0.5-bin.zip</b>. The latest maven 2.0.6 does not work when trying to build AndroMDA later. Back in your terminal type: </p> <source><![CDATA[ [user@server maven]$ unzip maven-2.0.5-bin.zip [user@server maven]$ ln -s maven-2.0.5 current ]]></source> <p> Edit <b>~/.bash_profile</b> and add: </p> <source><![CDATA[ M2_HOME=$HOME/maven/current export M2_HOME M2_REPO=$HOME/.m2/repository export M2_REPO MAVEN_OPTS="-Xmx512m -Xms256m -XX:PermSize=128m -XX:MaxPermSize=256m" export MAVEN_OPTS ]]></source> <p> Also append <code>$M2_HOME/bin</code> to the front your<code>PATH</code> definition. It should look something like: </p> <source><![CDATA[ PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH:$HOME/bin export PATH ]]></source> <p> Source your updated <b>~/.bash_profile</b>: </p> <source><![CDATA[ [user@server ~]$ . ~/.bash_profile ]]></source> <p> Now we need to create the Maven repository. We do this automatically by creating a dummy project. In the terminal type: </p> <source><![CDATA[ [user@server ~]$ mvn archetype:create -DgroupId=testproj -DartifactId=testproj ]]></source> <p> At the end of the process you should see <b>BUILD SUCCESSFUL</b>. Then remove the dummy project: </p> <source><![CDATA[ [user@server ~]$ rm -rf testproj ]]></source> </subsection> <a name="AndroMDA"/> <subsection name="AndroMDA"> <p> From your home directory CVS checkout the latest 3.x-SNAPSHOT of AndroMDA: </p> <source><![CDATA[ [user@server ~]$ cvs -d:pserver:ano...@an...:/cvsroot/andromda login When prompted for password hit <ENTER> [user@server ~]$ cvs -z3 -d:pserver:ano...@an...:/cvsroot/andromda co -P -r V3_x_HEAD andromda-all ]]></source> <p> It will take a while to download everything. The directory <b>~/andromda-all</b> will be created. When it finishes type: </p> <source><![CDATA[ [user@server ~]$ cd andromda-all [user@server andromda-all]$ mvn -N antrun:run ]]></source> <p> At the end of the process you should see <b>BUILD SUCCESSFUL</b>. Then type: </p> <source><![CDATA[ [user@server andromda-all]$ mvn install ]]></source> <p> This will take a long time. At the end of the process you should see <b>BUILD SUCCESSFUL</b> again. </p> </subsection> <a name="AndroMDA EJB3 and Seam Cartridges"/> <subsection name="AndroMDA EJB3 and Seam Cartridges"> <p> From your home directory CVS checkout the latest AndroMDA plugins: </p> <source><![CDATA[ [user@server ~]$ cvs -d:pserver:ano...@an...:/cvsroot/andromdaplugins login When prompted for password hit <ENTER> [user@server ~]$ cvs -z3 -d:pserver:ano...@an...:/cvsroot/andromdaplugins co -P andromda-plugins ]]></source> <p> The directory <b>~/andromda-plugins</b> will be created. Next type: </p> <source><![CDATA[ [user@server ~]$ cd andromda-plugins/cartridges/andromda-ejb3 [user@server andromda-ejb3]$ mvn install ]]></source> <p> At the end you should see <b>BUILD SUCCESSFUL</b>. Next: </p> <source><![CDATA[ [user@server ~]$ cd ~/andromda-plugins/cartridges/andromda-seam ]]></source> <p> Edit <b>pom.xml</b>. At the bottom of the file change <b>andromda3.root</b> to the correct path: </p> <source><![CDATA[ <andromda3.root>/path/to/your/home/andromda-all</andromda3.root> ]]></source> <p> Back in the terminal type: </p> <source><![CDATA[ [user@server andromda-seam]$ mvn install ]]></source> <p> At the end you should see <b>BUILD SUCCESSFUL</b>. </p> </subsection> <a name="AndroMDA Seam Profile"/> <subsection name="AndroMDA Seam Profile"> <p> From your home directory, go to the AndroMDA Seam profile directory for the UML version you are using (uml-2.0 or uml-1.4) and build the profile project. For example: </p> <source><![CDATA[ [user@server ~]$ cd andromda-plugins/profiles/uml-2.0/seam [user@server seam]$ mvn install ]]></source> <p> At the end you should see <b>BUILD SUCCESSFUL</b>. The profile will be placed in your Maven repository, i.e. <code>$M2_REPO/org/andromda/profiles/uml2/andromda-profile-seam/1.1-SNAPSHOT/andromda-profile-seam-1.1-SNAPSHOT.xml.zip</code> </p> </subsection> <a name="Creating Your Project"/> <subsection name="Creating Your Project"> <p> Now you want to build your project scaffold using AndroMDApp. Below I show an example. Your particular setup will be different but what is important is that you do a <b>j2ee</b> project, <b>ejb3</b> persistence, <b>yes</b> to web user interface and <b>jsf</b> for the interface technology. This will then bring up the Seam option. From the terminal, type: </p> <source><![CDATA[ [user@server ~]$ mvn org.andromda.maven.plugins:andromdapp-maven-plugin:generate [INFO] Scanning for projects... [INFO] ---------------------------------------------------------------------------- [INFO] Building Maven Default Project [INFO] task-segment: [org.andromda.maven.plugins:andromdapp-maven-plugin:generate] (aggregator-style) [INFO] ---------------------------------------------------------------------------- [INFO] [andromdapp:generate] log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester). log4j:WARN Please initialize the log4j system properly. INFO [AndroMDA] discovered andromdapp type --> 'richclient' INFO [AndroMDA] discovered andromdapp type --> 'j2ee' Please choose the type of application to generate [richclient, j2ee] j2ee Please enter the location in which your new application will be created (i.e. f:/java/development): /path/to/my/projects Please enter your first and last name (i.e. Chad Brandon): John Doe Which kind of modeling tool will you use? [uml1.4, uml2, emf-uml2]: uml2 Please enter the name of your J2EE project (i.e. Animal Quiz): MyProject Please enter an id for your J2EE project (i.e. animalquiz): myproject Please enter a version for your project (i.e. 1.0-SNAPSHOT): 0.1 Please enter the root package name for your J2EE project (i.e. org.andromda.samples.animalquiz): com.company.myproject Would you like an EAR or standalone WAR? [ear, war]: ear Please enter the type of transactional/persistence cartridge to use [hibernate, ejb, ejb3, spring, none]: ejb3 Please enter the database backend for the persistence layer [hypersonic, mysql, oracle, db2, informix, mssql, pointbase, postgres, sybase, sabdb, progress, derby]: mysql Will your project need workflow engine capabilities? (it uses jBPM and Hibernate3)? [yes, no]: yes Will your project have a web user interface? [yes, no]: yes Would you like your web user interface to use JSF or Struts? [jsf, struts]: jsf Would you like to use Facelets or JSP as your view type for JSF? [facelets, jsp]: facelets Would you like to use the JBoss Seam application framework? [yes, no]: yes Would you like to be able to expose your services as web services? [yes, no]: yes Would you like to use the JSR181 (webservice defined by annotations) EJB3 cartridge specific implementation? [yes, no]: yes ]]></source> <p> At the end you should see <b>BUILD SUCCESSFUL</b>. </p> </subsection> <a name="Starting Your Modeling"/> <subsection name="Starting Your Modeling"> <p> The project scaffold created above will have a starter XMI file for your modeling. This is located in <b>/path/to/my/projects/myproject/mda/src/main/uml/myproject.xml</b>. Launch your UML modeling application (e.g. MagicDraw), go to File -> Open Project..., and browse to this file. When the program initially loads this file it will ask you to specify the path to your <b>maven2.repository</b>. Specify the full <b>$M2_REPO path</b>, i.e. <b>/path/to/your/home/.m2/repository</b>. It will then load your project and all of the requisite andromda core profiles. </p> <p> Next you need to use the andromda-seam-profile built before. Go to File -> Use Module..., first add a new module path: <b>/path/to/your/home/.m2/repository/org/andromda/profiles/uml2/andromda-profile-seam/1.1-SNAPSHOT/</b>, then select this path and pick the andromda-profile-seam-1.1-SNAPSHOT.xml.zip profile. It will load this and you now have all of the necessary seam stereotypes and tagged values. </p> <p> You project is now ready to start. Have fun! </p> </subsection> </section> </body> </document> |