Seam SVN: r9214 - trunk/examples/icefaces/view.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2008-10-07 05:29:21 -0400 (Tue, 07 Oct 2008)
New Revision: 9214
Modified:
trunk/examples/icefaces/view/conversations.xhtml
trunk/examples/icefaces/view/edit.xhtml
trunk/examples/icefaces/view/main.xhtml
trunk/examples/icefaces/view/password.xhtml
trunk/examples/icefaces/view/register.xhtml
Log:
JBSEAM-3431 Added ids for icefaces example.
Modified: trunk/examples/icefaces/view/conversations.xhtml
===================================================================
--- trunk/examples/icefaces/view/conversations.xhtml 2008-10-07 08:38:34 UTC (rev 9213)
+++ trunk/examples/icefaces/view/conversations.xhtml 2008-10-07 09:29:21 UTC (rev 9214)
@@ -12,19 +12,19 @@
</div>
<div class="section">
- <h:form>
- <h:dataTable value="#{conversationList}" var="entry">
- <h:column>
- <h:commandLink action="#{entry.select}" value="#{entry.description}"/>
+ <h:form id="ConversationListForm">
+ <h:dataTable id="ConversationListDataTable" value="#{conversationList}" var="entry">
+ <h:column id="column1">
+ <h:commandLink id="EntryDescriptionLink" action="#{entry.select}" value="#{entry.description}"/>
 
- <h:outputText value="[current]" rendered="#{entry.current}"/>
+ <h:outputText id="CurrentEntry" value="[current]" rendered="#{entry.current}"/>
</h:column>
- <h:column>
- <h:outputText value="#{entry.startDatetime}">
+ <h:column id="column2">
+ <h:outputText id="EntryStartDateTime" value="#{entry.startDatetime}">
<s:convertDateTime type="time" pattern="hh:mm"/>
</h:outputText>
-
- <h:outputText value="#{entry.lastDatetime}">
+ <h:outputText id="EntryLastDateTime" value="#{entry.lastDatetime}">
<s:convertDateTime type="time" pattern="hh:mm"/>
</h:outputText>
</h:column>
Modified: trunk/examples/icefaces/view/edit.xhtml
===================================================================
--- trunk/examples/icefaces/view/edit.xhtml 2008-10-07 08:38:34 UTC (rev 9213)
+++ trunk/examples/icefaces/view/edit.xhtml 2008-10-07 09:29:21 UTC (rev 9214)
@@ -14,7 +14,7 @@
<ui:insert/>
</s:validateAll>
</span>
- <s:message styleClass="error errors"/>
+ <s:message id="message" styleClass="error errors"/>
</div>
</ui:composition>
\ No newline at end of file
Modified: trunk/examples/icefaces/view/main.xhtml
===================================================================
--- trunk/examples/icefaces/view/main.xhtml 2008-10-07 08:38:34 UTC (rev 9213)
+++ trunk/examples/icefaces/view/main.xhtml 2008-10-07 09:29:21 UTC (rev 9214)
@@ -13,7 +13,7 @@
<div class="section">
<span class="errors">
- <h:messages globalOnly="true"/>
+ <h:messages id="messages" globalOnly="true"/>
</span>
<h1>Search Hotels</h1>
@@ -26,7 +26,7 @@
 
<ice:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" />
 
- <ice:outputConnectionStatus activeLabel="requesting..." styleClass="connectionStatus"/>
+ <ice:outputConnectionStatus id="Spinner" activeLabel="requesting..." styleClass="connectionStatus"/>
<br/>
<h:outputLabel for="pageSize">Maximum results:</h:outputLabel> 
@@ -42,34 +42,34 @@
</h:form>
</div>
-<ice:form>
+<ice:form id="searchResults">
<ice:panelGroup id="searchResults">
<div class="section" style="overflow:auto">
- <h:outputText value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
+ <h:outputText id="NoHotelsFoundMessage" value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
<ice:outputText value="Search Results"/>
<ice:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
<h:column>
<f:facet name="header">Name</f:facet>
- <ice:outputText value="#{hot.name}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="name" value="#{hot.name}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Address</f:facet>
- <ice:outputText value="#{hot.address}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="address" value="#{hot.address}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">City, State</f:facet>
- <ice:outputText value="#{hot.city}, #{hot.state}, #{hot.country}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="city" value="#{hot.city}, #{hot.state}, #{hot.country}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Zip</f:facet>
- <ice:outputText value="#{hot.zip}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="zip" value="#{hot.zip}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
</h:column>
</ice:dataTable>
- <s:link value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
+ <s:link id="moreResults" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
</div>
</ice:panelGroup>
</ice:form>
@@ -82,27 +82,27 @@
<ice:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
<h:column>
<f:facet name="header">Name</f:facet>
- <ice:outputText value="#{book.hotel.name}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="name" value="#{book.hotel.name}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Address</f:facet>
- <ice:outputText value="#{book.hotel.address}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="address" value="#{book.hotel.address}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">City, State</f:facet>
- <ice:outputText value="#{book.hotel.city}, #{book.hotel.state}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="city" value="#{book.hotel.city}, #{book.hotel.state}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Check in date</f:facet>
- <h:outputText value="#{book.checkinDate}" onmouseovereffect="#{highlight}"/>
+ <h:outputText id="checkIn" value="#{book.checkinDate}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Check out date</f:facet>
- <h:outputText value="#{book.checkoutDate}" onmouseovereffect="#{highlight}"/>
+ <h:outputText id="checkOut" value="#{book.checkoutDate}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Confirmation number</f:facet>
- <ice:outputText value="#{book.id}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText id="confirmation" value="#{book.id}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
Modified: trunk/examples/icefaces/view/password.xhtml
===================================================================
--- trunk/examples/icefaces/view/password.xhtml 2008-10-07 08:38:34 UTC (rev 9213)
+++ trunk/examples/icefaces/view/password.xhtml 2008-10-07 09:29:21 UTC (rev 9214)
@@ -23,7 +23,7 @@
<div class="entry errors">
- <h:messages globalOnly="true"/>
+ <h:messages id="messages" globalOnly="true"/>
</div>
<h:form id="setpassword">
@@ -34,7 +34,7 @@
- <s:decorate template="edit.xhtml">
+ <s:decorate id="PasswordDecorate" template="edit.xhtml">
<ui:define name="label">Password:</ui:define>
@@ -44,7 +44,7 @@
- <s:decorate template="edit.xhtml">
+ <s:decorate id="VerifyDecorate" template="edit.xhtml">
<ui:define name="label">Verify:</ui:define>
<ice:inputSecret id="verify" value="#{changePassword.verify}"
redisplay="true" required="true"/>
Modified: trunk/examples/icefaces/view/register.xhtml
===================================================================
--- trunk/examples/icefaces/view/register.xhtml 2008-10-07 08:38:34 UTC (rev 9213)
+++ trunk/examples/icefaces/view/register.xhtml 2008-10-07 09:29:21 UTC (rev 9214)
@@ -48,7 +48,7 @@
<div class="section" style="overflow:auto">
<div class="entry errors">
- <h:messages globalOnly="true"/>
+ <h:messages id="messages" globalOnly="true"/>
</div>
<h:form id="registration">
16 years, 2 months
Seam SVN: r9213 - trunk/src/main/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-07 04:38:34 -0400 (Tue, 07 Oct 2008)
New Revision: 9213
Modified:
trunk/src/main/org/jboss/seam/persistence/Filter.java
Log:
JBSEAM-3523
Modified: trunk/src/main/org/jboss/seam/persistence/Filter.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/Filter.java 2008-10-07 01:35:50 UTC (rev 9212)
+++ trunk/src/main/org/jboss/seam/persistence/Filter.java 2008-10-07 08:38:34 UTC (rev 9213)
@@ -1,5 +1,6 @@
package org.jboss.seam.persistence;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@@ -21,7 +22,7 @@
*/
@BypassInterceptors
@Scope(ScopeType.APPLICATION)
-public class Filter
+public class Filter implements Serializable
{
private String name;
// default to no parameters
16 years, 2 months
Seam SVN: r9212 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-06 21:35:50 -0400 (Mon, 06 Oct 2008)
New Revision: 9212
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Configuration.xml
Log:
JBSEAM-3461
Modified: trunk/doc/Seam_Reference_Guide/en-US/Configuration.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Configuration.xml 2008-10-06 18:57:08 UTC (rev 9211)
+++ trunk/doc/Seam_Reference_Guide/en-US/Configuration.xml 2008-10-07 01:35:50 UTC (rev 9212)
@@ -48,24 +48,24 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>]]></programlisting>
-
- <para>
- There is a minor gray area in the JSF specification regarding the mutability of view state values. Since
- Seam uses the JSF view state to back its PAGE scope this can become an issue in some cases. If you're
- using server side state saving with the JSF-RI and you want a PAGE scoped bean to keep its exact value
- for a given view of a page you will need to specify the following context-param. Otherwise if a user
- uses the "back" button a PAGE scoped component will have the latest value if it has changed not the
- value of the "back" page. (see
- <ulink url="https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=295">
- Spec Issue
- </ulink>
- ). This setting is not enabled by default because of the performance hit of serializing the JSF view
- with every request.
- </para>
-
- <programlisting role="XML"><![CDATA[<context-param>
- <param-name>com.sun.faces.serializeServerState</param-name>
- <param-value>true</param-value>
+
+ <para>
+ There is a minor gray area in the JSF specification regarding the mutability of view state values. Since
+ Seam uses the JSF view state to back its PAGE scope this can become an issue in some cases. If you're
+ using server side state saving with the JSF-RI and you want a PAGE scoped bean to keep its exact value
+ for a given view of a page you will need to specify the following context-param. Otherwise if a user
+ uses the "back" button a PAGE scoped component will have the latest value if it has changed not the
+ value of the "back" page. (see
+ <ulink url="https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=295">
+ Spec Issue
+ </ulink>
+ ). This setting is not enabled by default because of the performance hit of serializing the JSF view
+ with every request.
+ </para>
+
+ <programlisting role="XML"><![CDATA[<context-param>
+ <param-name>com.sun.faces.serializeServerState</param-name>
+ <param-value>true</param-value>
</context-param>]]></programlisting>
</sect2>
@@ -844,18 +844,45 @@
<listitem>
- <para> Add the Embedded JBoss listener to <literal>conf/server.xml</literal>. It should appear after
- all other listeners in the file.</para>
+ <para> Add the Embedded JBoss listener <literal>EmbeddedJBossBootstrapListener</literal> to
+ <literal>conf/server.xml</literal>. It must appear after all other listeners in the file:</para>
- <programlisting role="XML"><![CDATA[<Listener className="org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<Server port="8005" shutdown="SHUTDOWN">
+
+ <!-- Comment these entries out to disable JMX MBeans support used for the
+ administration web application -->
+ <Listener className="org.apache.catalina.core.AprLifecycleListener" />
+ <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
+ <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+ <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<!-- Add this listener -->
+ <Listener className="org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener"/>]]></programlisting>
</listitem>
<listitem>
- <para>WAR file scanning should be enabled by adding a listener to
- <literal>conf/context.xml</literal>. </para>
+ <para>WAR file scanning should be enabled by adding the <literal>WebinfScanner</literal> listener to
+ <literal>conf/context.xml</literal>: </para>
- <programlisting role="XML"><![CDATA[<Listener className="org.jboss.embedded.tomcat.WebinfScanner"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<Context>
+ <!-- Default set of monitored resources -->
+ <WatchedResource>WEB-INF/web.xml</WatchedResource>
+
+ <!-- Uncomment this to disable session persistence across Tomcat restarts -->
+ <!--
+ <Manager pathname="" />
+ -->]]></programlisting>
+ <programlisting role="XML"><![CDATA[<!-- Add this listener -->
+ <Listener className="org.jboss.embedded.tomcat.WebinfScanner"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[</Context>]]></programlisting>
</listitem>
+
+ <listitem>
+ <para>If you are using JDK 6, you must set the Java option <literal>sun.lang.ClassLoader.allowArraySyntax</literal> to
+ <literal>true</literal> in Tomcat's startup script (either catalina.bat or catalina.sh):
+ </para>
+
+ <programlisting><![CDATA[set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -Dsun.lang.ClassLoader.allowArraySyntax=true]]></programlisting>
+ </listitem>
</itemizedlist>
<para>For more configuration options, please see the Embedded JBoss Tomcat integration
16 years, 2 months
Seam SVN: r9211 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-06 14:57:08 -0400 (Mon, 06 Oct 2008)
New Revision: 9211
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
Log:
Edits
Modified: trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 18:08:39 UTC (rev 9210)
+++ trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 18:57:08 UTC (rev 9211)
@@ -1,92 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="glassfish">
- <title>Seam on Glassfish application server</title>
+ <title>Seam on GlassFish application server</title>
<para>
- Glassfish is an open source application server which fully implements Java
+ GlassFish is an open source application server which fully implements Java
EE 5. The latest stable release is v2 UR2.
</para>
<para>
- First we will go over some basic information about the Glassfish
- environment that we used for these examples. We will go over the details
- of those steps with the jee5 example. We will also deploy the JPA example
- application. Finally we show customizing of seam-gen's generated
- application.
+ First, we'll discuss the GlassFish environment. Then we will go over the
+ how you deploy the jee5 example. Next, we will deploy the JPA example
+ application. Finally we show how to get a seam-gen's generated
+ application running on GlassFish.
</para>
<section>
- <title>Glassfish environment and deployment information</title>
+ <title>GlassFish environment and deployment information</title>
- <para>
- Glassfish is a open source project and its installation is very easy.
- This section will detail the exact server versions used and
- installation tips.
- </para>
-
<section>
- <title>Installation version and tips</title>
+ <title>Installation</title>
<para>
All of the examples and information in this chapter are based on the
- the latest version of Glassfish at the time of this writing.
+ the latest version of GlassFish at the time of this writing.
<itemizedlist>
<listitem>
<para>
<ulink
url="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">
- Glassfish v2 UR2 - download page</ulink>
+ GlassFish v2 UR2 - download page</ulink>
</para>
</listitem>
</itemizedlist>
</para>
<para>
- After downloading suitable jar file with Glassfish, install it by
- writing on command line in case of linux version:
+ After downloading GlassFish, install it:
</para>
<programlisting>$ java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar</programlisting>
<para>
- After installing, setup glassfish, the following command creates
- Glassfish server domain:
+ After installing, setup GlassFish:
</para>
<programlisting>$ cd glassfish; ant -f setup.xml</programlisting>
<para>
- The created domain name is domain1.
+ The created domain's name is <literal>domain1</literal>.
</para>
<para>
- Start the embedded JavaDB server:
+ Next, we start the embedded JavaDB server:
</para>
<programlisting>$ bin/asadmin start-database</programlisting>
- <para>
- This is default embedded database server in Glassfish.
- </para>
+ <note>
+ <para>
+ JavaDB is an embedded database that is included with GlassFish,
+ just as HSQLDB is included in JBoss AS.
+ </para>
+ </note>
<para>
- Start the Glassfish server domain1:
+ Now, start the GlassFish server:
</para>
<programlisting>$ bin/asadmin start-domain domain1</programlisting>
<para>
- The deployment and configuration is available at the Web
- Administration console at http://localhost:4848/. Access the web
- admin console with default username/password: admin/adminadmin. You
- can also copy EAR/WAR file to
- <literal>glassfish/domains/domain1/autodeploy</literal>
- for quick automatic deployment.
+ The web adminstration console is available at <literal>http://localhost:4848/</literal>.
+ You can access the web admin console with the default username
+ (<literal>admin</literal>) and password (<literal>adminadmin</literal>).
+ Alternatively, you could copy EAR/WAR file to
+ <literal>glassfish/domains/domain1/autodeploy</literal> to deploy
+ it.
</para>
<para>
- Stopping the server and database can be done by the following
- command:
+ You can stop the server and database using:
</para>
<programlisting>$ bin/asadmin stop-domain domain1; bin/asadmin stop-database</programlisting>
@@ -99,24 +92,23 @@
<para>
The <literal>jee5/booking</literal> example is based on the Hotel
Booking example (which runs on JBoss AS). Out of the box it is also
- designed to run on Glassfish. It is located in the
- <literal>$SEAM_DIST/examples/jee5/booking</literal> directory.
+ designed to run on GlassFish. It is located in
+ <literal>$SEAM_DIST/examples/jee5/booking</literal>.
</para>
<section id="jee5-glassfish-deploy">
- <title>Deploying the application to Glassfish</title>
+ <title>Deploying the application to GlassFish</title>
<para>
- We will deploy the application on Glassfish with using of
- Glassfish's administration console.
+ We will deploy the application on GlassFish using the GlassFish
+ admin console.
</para>
<orderedlist>
<listitem>
<para>
- Log in to the administration console:
+ Log in to the admin console at <literal>http://localhost:4848</literal>
</para>
- <programlisting>http://localhost:4848</programlisting>
</listitem>
<listitem>
<para>
@@ -128,8 +120,8 @@
<listitem>
<para>
At the top of the <literal>Enterprise Application</literal>
- table select <literal>Deploy</literal>. Below are installation
- wizard pages and what needs to done on each:
+ table select <literal>Deploy</literal>. Follow through the
+ wizard, using these hints:
</para>
<itemizedlist>
<listitem>
@@ -139,8 +131,7 @@
<itemizedlist>
<listitem>
<para>
- Browse to the <literal>examples/jee5/booking/dist/jboss-seam-jee5.ear</literal>
- file using the file upload widget.
+ Browse to <literal>examples/jee5/booking/dist/jboss-seam-jee5.ear</literal>.
</para>
</listitem>
<listitem>
@@ -173,25 +164,21 @@
<para>
The example already has a break-out of configurations and build scripts
- for many of the common containers including Glassfish.
+ for many of the common containers including GlassFish.
</para>
- <para>
- First thing we are going to do is build and deploy that example.
- </para>
-
<section>
<title>Building the <literal>jpa</literal> example</title>
<para>
- Building it only requires running the correct ant command:
+ To build the example, use the <literal>glassfish</literal> target:
</para>
<programlisting>$ ant glassfish</programlisting>
<para>
- This will create container specific distribution and exploded
- archive directories with the <literal>glassfish</literal> suffix.
+ This will create the container specific <literal>dist-glassfish</literal>
+ and <literal>exploded-archives-glasfish</literal> directories.
</para>
</section>
@@ -226,8 +213,7 @@
<itemizedlist>
<listitem>
<para>
- Browse to the <literal>examples/jpa/dist-glassfish/jboss-seam-jpa.war</literal>
- file using the file upload widget.
+ Browse to <literal>examples/jpa/dist-glassfish/jboss-seam-jpa.war</literal>.
</para>
</listitem>
<listitem>
@@ -250,26 +236,18 @@
<note>
<title>Using Derby instead of Hypersonic SQL DB</title>
- In order for the app to work out of the box with Glassfish, we have
- used the Derby (i.e., Java DB) database in Glassfish. However, we
- strongly recommend you to use a non-Derby data source (e.g., HSQL is
- a much better embeded DB) if possible. The
- <literal>examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class</literal>
- is a special hack to get around a Derby bug in Glassfish server. You
- must use it as your Hibernate dialect if you use Derby with
- Glassfish.
+ In order for the app to work out of the box with GlassFish, we have
+ used the Derby (aka JavaDB) database in GlassFish. However, we
+ strongly recommend that you use another database (e.g. HSQL).
+ <literal>examples/jpa/resources-glassfish/WEB-INF/classes/GlassFishDerbyDialect.class</literal>
+ is a hack to get around a Derby bug in GlassFish server. You must
+ use it as your Hibernate dialect if you use Derby with GlassFish.
</note>
</section>
<section>
- <title>What's different for Glassfish v2 UR2</title>
+ <title>What's different for GlassFish v2 UR2</title>
- <para>
- The differences between the JPA examples that deploys to JBoss 4.2
- and Glassfish v2 UR2. Expected differences are in persistence
- related configurations.
- </para>
-
<itemizedlist>
<listitem>
<para>
@@ -279,17 +257,17 @@
<listitem>
<para>
<literal>META-INF/persistence.xml</literal> — the main
- changes here are for the datasource JNDI path, switching
- to the Glassfish transaction manager look up class, and
+ changes needed are the datasource JNDI, switching to the
+ GlassFish transaction manager lookup class, and
changing the hibernate dialect to be
- <literal>GlassfishDerbyDialect</literal>.
+ <literal>GlassFishDerbyDialect</literal>.
</para>
</listitem>
<listitem>
<para>
- <literal>WEB-INF/classes/GlassfishDerbyDialect.class</literal>
+ <literal>WEB-INF/classes/GlassFishDerbyDialect.class</literal>
— this class is needed for the Hibernate dialect change
- to <literal>GlassfishDerbyDialect</literal>
+ to <literal>GlassFishDerbyDialect</literal>
</para>
</listitem>
<listitem>
@@ -306,16 +284,16 @@
</section>
<section>
- <title>Deploying an application generated by <literal>seam-gen</literal> on Glassfish v2 UR2</title>
+ <title>Deploying an application generated by <literal>seam-gen</literal> on GlassFish v2 UR2</title>
<para>
<literal>seam-gen</literal> is a very useful tool for developers to
quickly get an application up and running, and provides a foundation to
add your own functionality. Out of box <literal>seam-gen</literal> will
produce applications configured to run on JBoss AS. These instructions
- will show the steps needed to get it to run on Glassfish. As stated
- above in <xref linkend="jee5-glassfish-section" /> there is easy to
- deploy on glassfish either EJB3 or Seam POJOs based application.
+ will show the steps needed to get it to run on GlassFish. As stated
+ above in <xref linkend="jee5-glassfish-section" /> it's easy to deploy
+ either an EJB3 or a Seam POJOs application on Glassfish.
</para>
<section>
@@ -328,91 +306,94 @@
once the project is created.
</para>
- <programlisting>$ ./seam setup Buildfile: build.xml
+ <programlisting><![CDATA[$ ./seam setup
+Buildfile: build.xml
- init:
+init:
- setup: [echo] Welcome to seam-gen :-) [input] Enter your Java
- project workspace (the directory that contains your Seam projects)
- [C:/Projects] [C:/Projects] /home/mnovotny/projects [input] Enter
- your JBoss home directory [C:/Program Files/jboss-4.2.3.GA]
- [C:/Program Files/jboss-4.2.3.GA]
+setup:
+[echo] Welcome to seam-gen :-)
+[input] Enter your Java project workspace (the directory that contains your
+Seam projects) [C:/Projects] [C:/Projects]
+/projects
+[input] Enter your JBoss home directory [C:/Program Files/jboss-4.2.3.GA]
+[C:/Program Files/jboss-4.2.3.GA]
- [input] Enter the project name [myproject] [myproject]
- seamgen_example [echo] Accepted project name as: seamgen_example
- [input] Do you want to use ICEfaces instead of RichFaces [n] (y,
- [n])
+[input] Enter the project name [myproject] [myproject]
+seamgen_example
+[echo] Accepted project name as: seamgen_example
+[input] Do you want to use ICEfaces instead of RichFaces [n] (y, [n])
- [input] skipping input as property icefaces.home.new has already
- been set. [input] Select a RichFaces skin [blueSky] ([blueSky],
- classic, ruby, wine, deepMarine, emeraldTown, japanCherry, DEFAULT)
+[input] skipping input as property icefaces.home.new has already
+been set.
+[input] Select a RichFaces skin [blueSky] ([blueSky], classic, ruby, wine,
+deepMarine, emeraldTown, japanCherry, DEFAULT)
- [input] Is this project deployed as an EAR (with EJB components) or
- a WAR (with no EJB support) [ear] ([ear], war)
+[input] Is this project deployed as an EAR (with EJB components) or a WAR
+(with no EJB support) [ear] ([ear], war)
- [input] Enter the Java package name for your session beans
- [com.mydomain.seamgen_example] [com.mydomain.seamgen_example]
- org.jboss.seam.tutorial.glassfish.action [input] Enter the Java
- package name for your entity beans
- [org.jboss.seam.tutorial.glassfish.action]
- [org.jboss.seam.tutorial.glassfish.action]
- org.jboss.seam.tutorial.glassfish.model [input] Enter the Java
- package name for your test cases
- [org.jboss.seam.tutorial.glassfish.action.test]
- [org.jboss.seam.tutorial.glassfish.action.test]
- org.jboss.seam.tutorial.glassfish.test [input] What kind of database
- are you using? [hsql] ([hsql], mysql, oracle, postgres, mssql, db2,
- sybase, enterprisedb, h2)
+[input] Enter the Java package name for your session beans
+[com.mydomain.seamgen_example] [com.mydomain.seamgen_example]
+org.jboss.seam.tutorial.glassfish.action
+[input] Enter the Java package name for your entity beans
+[org.jboss.seam.tutorial.glassfish.action]
+[org.jboss.seam.tutorial.glassfish.action]
+org.jboss.seam.tutorial.glassfish.model
+[input] Enter the Java package name for your test cases
+[org.jboss.seam.tutorial.glassfish.action.test]
+[org.jboss.seam.tutorial.glassfish.action.test]
+org.jboss.seam.tutorial.glassfish.test
+[input] What kind of database are you using? [hsql] ([hsql], mysql, oracle,
+postgres, mssql, db2, sybase, enterprisedb, h2)
- [input] Enter the Hibernate dialect for your database
- [org.hibernate.dialect.HSQLDialect]
- [org.hibernate.dialect.HSQLDialect]
+[input] Enter the Hibernate dialect for your database
+[org.hibernate.dialect.HSQLDialect]
+[org.hibernate.dialect.HSQLDialect]
- [input] Enter the filesystem path to the JDBC driver jar
- [../lib/hsqldb.jar] [../lib/hsqldb.jar]
+[input] Enter the filesystem path to the JDBC driver jar
+[../lib/hsqldb.jar] [../lib/hsqldb.jar]
- [input] Enter JDBC driver class for your database
- [org.hsqldb.jdbcDriver] [org.hsqldb.jdbcDriver]
+[input] Enter JDBC driver class for your database [org.hsqldb.jdbcDriver]
+[org.hsqldb.jdbcDriver]
- [input] Enter the JDBC URL for your database [jdbc:hsqldb:.]
- [jdbc:hsqldb:.]
+[input] Enter the JDBC URL for your database [jdbc:hsqldb:.]
+[jdbc:hsqldb:.]
- [input] Enter database username [sa] [sa]
+[input] Enter database username [sa] [sa]
- [input] Enter database password [] []
+[input] Enter database password [] []
- [input] Enter the database schema name (it is OK to leave this
- blank) [] []
+[input] Enter the database schema name (it is OK to leave this blank) [] []
- [input] Enter the database catalog name (it is OK to leave this
- blank) [] []
+[input] Enter the database catalog name (it is OK to leave this
+blank) [] []
- [input] Are you working with tables that already exist in the
- database? [n] (y, [n])
+[input] Are you working with tables that already exist in the database? [n]
+(y, [n])
- [input] Do you want to drop and recreate the database tables and
- data in import.sql each time you deploy? [n] (y, [n])
+[input] Do you want to drop and recreate the database tables and data in
+import.sql each time you deploy? [n] (y, [n])
- [propertyfile] Creating new property file:
- /home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/build.properties
- [echo] Installing JDBC driver jar to JBoss server [copy] Copying 1
- file to
- /home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/C:/Program
- Files/jboss-4.2.3.GA/server/default/lib [echo] Type 'seam
- create-project' to create the new project
+[propertyfile] Creating new property file:
+/home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/build.properties
+[echo] Installing JDBC driver jar to JBoss server
+[copy] Copying 1 file to
+/home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/C:/Program
+Files/jboss-4.2.3.GA/server/default/lib
+[echo] Type 'seam create-project' to create the new project
- BUILD SUCCESSFUL Total time: 4 minutes 5 seconds
- </programlisting>
+BUILD SUCCESSFUL
+Total time: 4 minutes 5 seconds]]></programlisting>
<para>
Type <literal>$ ./seam new-project</literal> to create your project
- and <literal>cd /home/mnovotny/projects/seamgen_example</literal> to
+ and then <literal>cd /projects/seamgen_example</literal> to
the newly created structure.
</para>
</section>
<section>
- <title>Changes needed for deployment to Glassfish</title>
+ <title>Changes needed for deployment to GlassFish</title>
<para>
We now need to make some changes to the generated project.
@@ -433,7 +414,7 @@
<para>
Alter the <literal>jta-data-source</literal> to be
<literal>jdbc/__default</literal>. We are going to
- be using the integrated Glassfish Derby DB.
+ be using the integrated GlassFish Derby DB.
</para>
</listitem>
<listitem>
@@ -442,7 +423,7 @@
described in detail at
<xref linkend="jee5-glassfish-section" />:
</para>
- <programlisting role="XML"><![CDATA[<property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
+ <programlisting role="XML"><![CDATA[<property name="hibernate.dialect" value="GlassFishDerbyDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
@@ -453,7 +434,7 @@
<para>
You'll need to alter
<literal>persistence-prod.xml</literal> as well if
- you want to deploy to Glassfish using the prod
+ you want to deploy to GlassFish using the prod
profile.
</para>
</listitem>
@@ -462,7 +443,7 @@
</varlistentry>
<varlistentry>
<term>
- <literal>resources/GlassfishDerbyDialect.class</literal>
+ <literal>resources/GlassFishDerbyDialect.class</literal>
</term>
<listitem>
<para>
@@ -472,7 +453,7 @@
<literal>seamgen_example/resources</literal> directory.
</para>
<programlisting>$ cp \
-$SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class \
+$SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassFishDerbyDialect.class \
./resources
</programlisting>
</listitem>
@@ -497,7 +478,7 @@
<para>
You can delete these file as we aren't deploying to
JBoss AS (these files define data sources in JBoss AS,
- we are using Glassfish's default data source)
+ we are using GlassFish's default data source)
</para>
</listitem>
</varlistentry>
@@ -533,7 +514,7 @@
As with the <literal>jee5/booking</literal> example we
need to add EJB references to the web.xml. These
references require the empty
- <literal>local-home</literal> to flag them for Glassfish
+ <literal>local-home</literal> to flag them for GlassFish
to perform the proper binding.
</para>
<programlisting role="XML"><![CDATA[<ejb-local-ref>
@@ -607,7 +588,7 @@
<listitem>
<para>
We've already added its reference to the <literal>web.xml</literal>
- file so are good to go.
+ file so we are good to go.
</para>
</listitem>
</orderedlist>
@@ -628,7 +609,7 @@
<listitem>
<para>
Change the default target to <literal>archive</literal> (we
- aren't going to cover automatic deployment to Glassfish).
+ aren't going to cover automatic deployment to GlassFish).
</para>
<programlisting role="XML"><![CDATA[<project name="seamgen_example" default="archive" basedir=".">]]></programlisting>
@@ -654,7 +635,7 @@
<listitem>
<para>
- We need to get the <literal>GlassfishDerbyDialect.class</literal>
+ We need to get the <literal>GlassFishDerbyDialect.class</literal>
into our application jar. To do that find the <literal>jar</literal>
task and modify the top of it so that it looks like this:
</para>
@@ -664,7 +645,7 @@
<fileset dir="${basedir}/resources">
<include name="seam.properties" />
<include name="*.drl" />
- <include name="GlassfishDerbyDialect.class" />
+ <include name="GlassFishDerbyDialect.class" />
</fileset>
</copy>
...]]></programlisting>
@@ -674,7 +655,7 @@
<para>
Next we need to get the <literal>jboss-seam.jar</literal>
into the base of the <literal>EAR</literal> file. For
- deployment Glassfish requires this jar to be in both the
+ deployment GlassFish requires this jar to be in both the
<literal>/lib</literal> directory and at the base of the
<literal>EAR</literal>. You must add the following to the
<literal>archive</literal> task:
@@ -825,7 +806,7 @@
</section>
<section>
- <title>Building and deploying the seam-gen'd application to Glassfish</title>
+ <title>Building and deploying the seam-gen'd application to GlassFish</title>
<itemizedlist>
<listitem>
16 years, 2 months
Seam SVN: r9210 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-06 14:08:39 -0400 (Mon, 06 Oct 2008)
New Revision: 9210
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
Log:
And fix the formating
Modified: trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 17:12:04 UTC (rev 9209)
+++ trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 18:08:39 UTC (rev 9210)
@@ -35,8 +35,7 @@
<para>
<ulink
url="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">
- Glassfish v2 UR2 - download page
- </ulink>
+ Glassfish v2 UR2 - download page</ulink>
</para>
</listitem>
</itemizedlist>
@@ -45,28 +44,36 @@
<para>
After downloading suitable jar file with Glassfish, install it by
writing on command line in case of linux version:
- <programlisting>
- java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar
- </programlisting>
</para>
+
+ <programlisting>$ java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar</programlisting>
<para>
After installing, setup glassfish, the following command creates
Glassfish server domain:
- <programlisting>cd glassfish; ant -f setup.xml</programlisting>
+ </para>
+
+ <programlisting>$ cd glassfish; ant -f setup.xml</programlisting>
+
+ <para>
The created domain name is domain1.
</para>
<para>
Start the embedded JavaDB server:
- <programlisting>bin/asadmin start-database</programlisting>
+ </para>
+
+ <programlisting>$ bin/asadmin start-database</programlisting>
+
+ <para>
This is default embedded database server in Glassfish.
</para>
<para>
Start the Glassfish server domain1:
- <programlisting>bin/asadmin start-domain domain1</programlisting>
</para>
+
+ <programlisting>$ bin/asadmin start-domain domain1</programlisting>
<para>
The deployment and configuration is available at the Web
@@ -80,28 +87,20 @@
<para>
Stopping the server and database can be done by the following
command:
- <programlisting>
- bin/asadmin stop-domain domain1; bin/asadmin stop-database
- </programlisting>
</para>
+
+ <programlisting>$ bin/asadmin stop-domain domain1; bin/asadmin stop-database</programlisting>
</section>
</section>
<section id="jee5-glassfish-section">
- <title>
- The
- <literal>jee5/booking</literal>
- example
- </title>
+ <title>The <literal>jee5/booking</literal> example</title>
<para>
- The
- <literal>jee5/booking</literal>
- example is based on the Hotel Booking example (which runs on JBoss AS).
- Out of the box it is also designed to run on Glassfish. It is located
- in the
- <literal>$SEAM_DIST/examples/jee5/booking</literal>
- directory.
+ The <literal>jee5/booking</literal> example is based on the Hotel
+ Booking example (which runs on JBoss AS). Out of the box it is also
+ designed to run on Glassfish. It is located in the
+ <literal>$SEAM_DIST/examples/jee5/booking</literal> directory.
</para>
<section id="jee5-glassfish-deploy">
@@ -111,84 +110,60 @@
We will deploy the application on Glassfish with using of
Glassfish's administration console.
</para>
-
- <para>
- The steps below are for the Glassfish version stated above.
- <orderedlist>
- <listitem>
- <para>
- Log in to the administration console
- <programlisting>http://localhost:4848</programlisting>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Access the
- <literal>Enterprise Applications</literal>
- in the menu option under the
- <literal>Applications</literal>
- left side menu.
- </para>
- </listitem>
-
- <listitem>
- <para>
- At the top of the
- <literal>Enterprise Application</literal>
- table select
- <literal>Deploy</literal>
- . Below are installation wizard pages and what needs to
- done on each:
+
+ <orderedlist>
+ <listitem>
+ <para>
+ Log in to the administration console:
+ </para>
+ <programlisting>http://localhost:4848</programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Access the <literal>Enterprise Applications</literal> in the
+ menu option under the <literal>Applications</literal> left
+ side menu.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ At the top of the <literal>Enterprise Application</literal>
+ table select <literal>Deploy</literal>. Below are installation
+ wizard pages and what needs to done on each:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>Preparing for the application installation</literal>
+ </para>
<itemizedlist>
<listitem>
<para>
- <literal>
- Preparing for the application installation
- </literal>
- <itemizedlist>
- <listitem>
- <para>
- Browse to the
- <literal>
- examples/jee5/booking/dist/jboss-seam-jee5.ear
- </literal>
- file using the file upload widget.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Select the
- <literal>OK</literal>
- button.
- </para>
- </listitem>
- </itemizedlist>
+ Browse to the <literal>examples/jee5/booking/dist/jboss-seam-jee5.ear</literal>
+ file using the file upload widget.
</para>
</listitem>
+ <listitem>
+ <para>
+ Select the <literal>OK</literal> button.
+ </para>
+ </listitem>
</itemizedlist>
- </para>
- </listitem>
-
- <listitem>
- <para>
- You can now access the application at
- <literal>http://localhost:8081/seam-jee5/</literal>
- .
- </para>
- </listitem>
- </orderedlist>
- </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ You can now access the application at
+ <literal>http://localhost:8081/seam-jee5/</literal>.
+ </para>
+ </listitem>
+ </orderedlist>
</section>
</section>
<section id="jpa-glassfish-section">
- <title>
- The
- <literal>jpa</literal>
- booking example
- </title>
+ <title>The <literal>jpa</literal> booking example</title>
<para>
This is the Hotel Booking example implemented in Seam POJOs and using
@@ -206,91 +181,69 @@
</para>
<section>
- <title>
- Building the
- <literal>jpa</literal>
- example
- </title>
+ <title>Building the <literal>jpa</literal> example</title>
<para>
Building it only requires running the correct ant command:
- <programlisting>ant glassfish</programlisting>
+ </para>
+
+ <programlisting>$ ant glassfish</programlisting>
+
+ <para>
This will create container specific distribution and exploded
- archive directories with the
- <literal>glassfish</literal>
- suffix.
+ archive directories with the <literal>glassfish</literal> suffix.
</para>
</section>
<section>
- <title>
- Deploying the
- <literal>jpa</literal>
- example
- </title>
+ <title>Deploying the <literal>jpa</literal> example</title>
<para>
- This is very similar to the
- <literal>jee5</literal>
- example at
- <xref linkend="jee5-glassfish-deploy" />
- .
+ This is very similar to the <literal>jee5</literal> example at
+ <xref linkend="jee5-glassfish-deploy" />.
</para>
<itemizedlist>
<listitem>
<para>
- Log in to the administration console
- <programlisting>http://localhost:4848</programlisting>
+ Log in to the administration console:
</para>
+ <programlisting>http://localhost:4848</programlisting>
</listitem>
-
<listitem>
<para>
- Access the
- <literal>Web Applications</literal>
- in the menu option under the
- <literal>Applications</literal>
- left side menu.
- <itemizedlist>
- <listitem>
- <para>
- <literal>
- Preparing for the application installation
- </literal>
- <itemizedlist>
- <listitem>
- <para>
- Browse to the
- <literal>
- examples/jpa/dist-glassfish/jboss-seam-jpa.war
- </literal>
- file using the file upload widget.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Select the
- <literal>OK</literal>
- button.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
-
- <listitem>
- <para>
- You can now access the application at
- <literal>
- http://localhost:8081/jboss-seam-jpa/
- </literal>
- .
- </para>
- </listitem>
- </itemizedlist>
+ Access the <literal>Web Applications</literal> in the menu
+ option under the <literal>Applications</literal> left side
+ menu.
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>
+ Preparing for the application installation
+ </literal>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Browse to the <literal>examples/jpa/dist-glassfish/jboss-seam-jpa.war</literal>
+ file using the file upload widget.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the <literal>OK</literal> button.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ You can now access the application at
+ <literal>http://localhost:8081/jboss-seam-jpa/</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
</itemizedlist>
@@ -300,8 +253,8 @@
In order for the app to work out of the box with Glassfish, we have
used the Derby (i.e., Java DB) database in Glassfish. However, we
strongly recommend you to use a non-Derby data source (e.g., HSQL is
- a much better embeded DB) if possible. The
- examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
+ a much better embeded DB) if possible. The
+ <literal>examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class</literal>
is a special hack to get around a Derby bug in Glassfish server. You
must use it as your Hibernate dialect if you use Derby with
Glassfish.
@@ -321,84 +274,61 @@
<listitem>
<para>
Configuration file changes
- <itemizedlist>
- <listitem>
- <para>
- <literal>META-INF/persistence.xml</literal>
- — the main changes here are for the datasource JNDI
- path, switching to the Glassfish transaction manager
- look up class, and changing the hibernate dialect to
- be
- <literal>GlassfishDerbyDialect</literal>
- .
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>
- WEB-INF/classes/GlassfishDerbyDialect.class
- </literal>
- — this class is needed for the hibernate dialect
- change to
- <literal>GlassfishDerbyDialect</literal>
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>import.sql</literal>
- — either for the dialect or Derby DB the
- <literal>ID</literal>
- column can not be populated by this file and was
- removed.
- </para>
- </listitem>
- </itemizedlist>
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>META-INF/persistence.xml</literal> — the main
+ changes here are for the datasource JNDI path, switching
+ to the Glassfish transaction manager look up class, and
+ changing the hibernate dialect to be
+ <literal>GlassfishDerbyDialect</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>WEB-INF/classes/GlassfishDerbyDialect.class</literal>
+ — this class is needed for the Hibernate dialect change
+ to <literal>GlassfishDerbyDialect</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>import.sql</literal> — either for the dialect
+ or Derby DB the <literal>ID</literal> column can not be
+ populated by this file and was removed.
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
</itemizedlist>
</section>
</section>
<section>
- <title>
- Deploying an application generated by
- <literal>seam-gen</literal>
- on Glassfish v2 UR2
- </title>
+ <title>Deploying an application generated by <literal>seam-gen</literal> on Glassfish v2 UR2</title>
<para>
- <literal>seam-gen</literal>
- is a very useful tool for developers to quickly get an application up
- and running, and provides a foundation to add your own functionality.
- Out of box
- <literal>seam-gen</literal>
- will produce applications configured to run on JBoss AS. These
- instructions will show the steps needed to get it to run on Glassfish.
- As stated above in
- <xref linkend="jee5-glassfish-section" />
- there is easy to deploy on glassfish either EJB3 or Seam POJOs based
- application
+ <literal>seam-gen</literal> is a very useful tool for developers to
+ quickly get an application up and running, and provides a foundation to
+ add your own functionality. Out of box <literal>seam-gen</literal> will
+ produce applications configured to run on JBoss AS. These instructions
+ will show the steps needed to get it to run on Glassfish. As stated
+ above in <xref linkend="jee5-glassfish-section" /> there is easy to
+ deploy on glassfish either EJB3 or Seam POJOs based application.
</para>
<section>
- <title>
- Running
- <literal>seam-gen</literal>
- Setup
- </title>
+ <title>Running <literal>seam-gen</literal> Setup</title>
<para>
- The first step is setting up
- <literal>seam-gen</literal>
- to construct the base project. There are several choices made below,
+ The first step is setting up <literal>seam-gen</literal> to
+ construct the base project. There are several choices made below,
specifically the datasource and hibernate values that we will adjust
once the project is created.
</para>
- <programlisting>
- ./seam setup Buildfile: build.xml
+ <programlisting>$ ./seam setup Buildfile: build.xml
init:
@@ -475,18 +405,18 @@
</programlisting>
<para>
- Type
- <literal>./seam new-project</literal>
- to create your project and
- <literal>cd /home/mnovotny/projects/seamgen_example</literal>
- to the newly created structure.
+ Type <literal>$ ./seam new-project</literal> to create your project
+ and <literal>cd /home/mnovotny/projects/seamgen_example</literal> to
+ the newly created structure.
</para>
</section>
<section>
<title>Changes needed for deployment to Glassfish</title>
- <para>We now need to make some changes to the generated project.</para>
+ <para>
+ We now need to make some changes to the generated project.
+ </para>
<section>
<title>Configuration file changes</title>
@@ -501,92 +431,68 @@
<itemizedlist>
<listitem>
<para>
- Alter the
- <literal>jta-data-source</literal>
- to be
- <literal>jdbc/__default</literal>
- . We are going to be using the integrated
- Glassfish Derby DB.
+ Alter the <literal>jta-data-source</literal> to be
+ <literal>jdbc/__default</literal>. We are going to
+ be using the integrated Glassfish Derby DB.
</para>
</listitem>
-
<listitem>
<para>
Add or change the properties below. These are
- described in detail at
- <xref linkend="jee5-glassfish-section" />
- :
+ described in detail at
+ <xref linkend="jee5-glassfish-section" />:
</para>
-
- <programlisting role="XML">
- <property name="hibernate.dialect"
- value="GlassfishDerbyDialect"/> <property
- name="hibernate.hbm2ddl.auto" value="update"/>
- <property name="hibernate.show_sql"
- value="true"/> <property
- name="hibernate.format_sql" value="true"/>
- <property name="hibernate.cache.provider_class"
- value="org.hibernate.cache.HashtableCacheProvider"/>
- <property
- name="hibernate.transaction.manager_lookup_class"
- value="org.hibernate.transaction.SunONETransactionManagerLookup"/>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
+<property name="hibernate.hbm2ddl.auto" value="update"/>
+<property name="hibernate.show_sql" value="true"/>
+<property name="hibernate.format_sql" value="true"/>
+<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup"/>]]></programlisting>
</listitem>
-
<listitem>
<para>
- You'll need to alter
- <literal>persistence-prod.xml</literal>
- as well if you want to deploy to Glassfish using
- the prod profile.
+ You'll need to alter
+ <literal>persistence-prod.xml</literal> as well if
+ you want to deploy to Glassfish using the prod
+ profile.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/GlassfishDerbyDialect.class</literal>
</term>
-
<listitem>
<para>
As with other examples we need to include this class for
- DB support. It can be copied from the
- <literal>jpa</literal>
- example into the
- <literal>seamgen_example/resources</literal>
- directory.
- <programlisting>
- cp
- $SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
- ./resources
- </programlisting>
+ DB support. It can be copied from the
+ <literal>jpa</literal> example into the
+ <literal>seamgen_example/resources</literal> directory.
</para>
+ <programlisting>$ cp \
+$SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class \
+./resources
+ </programlisting>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/META-INF/jboss-app.xml</literal>
</term>
-
<listitem>
<para>
You can delete this file as we aren't deploying to JBoss
- AS (
- <literal>jboss-app.xml</literal>
- is used to enable classloading isolation in JBoss AS)
+ AS (<literal>jboss-app.xml</literal> is used to enable
+ classloading isolation in JBoss AS)
</para>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/*-ds.xml</literal>
</term>
-
<listitem>
<para>
You can delete these file as we aren't deploying to
@@ -595,39 +501,26 @@
</para>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/WEB-INF/components.xml</literal>
</term>
-
<listitem>
<itemizedlist>
<listitem>
<para>
Enable container managed transaction integration -
- add the
- <literal>
- <transaction:ejb-transaction />
- </literal>
- component, and it's namespace declaration
- <literal>
- xmlns:transaction="http://jboss.com/products/seam/transaction"
- </literal>
+ add the <literal><![CDATA[<transaction:ejb-transaction />]]></literal>
+ component, and it's namespace declaration
+ <literal>xmlns:transaction="http://jboss.com/products/seam/transaction"</literal>
</para>
</listitem>
-
<listitem>
<para>
- Alter the
- <literal>jndi-pattern</literal>
- to
- <literal>
- java:comp/env/seamgen_example/#{ejbName}/local
- </literal>
+ Alter the <literal>jndi-pattern</literal> to
+ <literal>java:comp/env/seamgen_example/#{ejbName}/local</literal>
</para>
</listitem>
-
</itemizedlist>
</listitem>
</varlistentry>
@@ -637,18 +530,13 @@
</term>
<listitem>
<para>
- As with the
- <literal>jee5/booking</literal>
- example we need to add EJB references to the web.xml.
- These references require the empty
- <literal>local-home</literal>
- to flag them for Glassfish to perform the proper
- binding.
+ As with the <literal>jee5/booking</literal> example we
+ need to add EJB references to the web.xml. These
+ references require the empty
+ <literal>local-home</literal> to flag them for Glassfish
+ to perform the proper binding.
</para>
-
-
- <programlisting role="XML"><![CDATA[
- <ejb-local-ref>
+ <programlisting role="XML"><![CDATA[<ejb-local-ref>
<ejb-ref-name>seamgen_example/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
@@ -667,15 +555,10 @@
</section>
<section>
- <title>
- Creating the
- <literal>AuthenticatorAction</literal>
- EJB
- </title>
+ <title>Creating the <literal>AuthenticatorAction</literal> EJB</title>
<para>
- We want to take the existing
- <literal>Authenticator</literal>
+ We want to take the existing <literal>Authenticator</literal>
Seam POJO component and create an EJB3 out of it.
</para>
@@ -684,54 +567,46 @@
<itemizedlist>
<listitem>
<para>
- Rename the class to
+ Rename the class to
<literal>AuthenticatorAction</literal>
</para>
</listitem>
<listitem>
<para>
- Add the
- <literal>@Stateless</literal>
- annotation to the new
- <literal>AuthenticatorAction</literal>
- class.
+ Add the <literal>@Stateless</literal> annotation to
+ the new <literal>AuthenticatorAction</literal> class.
</para>
</listitem>
<listitem>
<para>
- Create an interface called
- <literal>Authenticator</literal>
- which
+ Create an interface called
+ <literal>Authenticator</literal> which
<literal>AuthenticatorAction</literal>
implements (EJB3 requires session beans to have a
local interface). Annotate the interface with
- <literal>@Local</literal>
- , and add a single method with same signature as the
- <literal>authenticate</literal>
- in
- <literal>AuthenticatorAction</literal>
- .
+ <literal>@Local</literal>, and add a single method
+ with same signature as the <literal>authenticate</literal>
+ in <literal>AuthenticatorAction</literal>.
</para>
</listitem>
</itemizedlist>
- <programlisting role="JAVA">
- @Name("authenticator") @Stateless public class
- AuthenticatorAction implements Authenticator {
- </programlisting>
+ <programlisting role="JAVA"><![CDATA[@Name("authenticator")
+@Stateless
+public class AuthenticatorAction implements Authenticator {]]></programlisting>
- <programlisting role="JAVA">
- @Local public interface Authenticator { public boolean
- authenticate(); }
- </programlisting>
+ <programlisting role="JAVA"><![CDATA[@Local
+public interface Authenticator {
+
+ public boolean authenticate();
+}]]></programlisting>
</listitem>
<listitem>
<para>
- We've already added its reference to the
- <literal>web.xml</literal>
+ We've already added its reference to the <literal>web.xml</literal>
file so are good to go.
</para>
</listitem>
@@ -740,280 +615,240 @@
<section>
<title>
- Extra jar dependencies and other changes to the
+ Extra jar dependencies and other changes to the
<literal>build.xml</literal>
</title>
<para>
This application has similar requirements as the
- <literal>jee5/booking</literal>
- example.
+ <literal>jee5/booking</literal> example.
</para>
<itemizedlist>
<listitem>
<para>
- Change the default target to
- <literal>archive</literal>
- (we aren't going to cover automatic deployment to
- Websphere).
+ Change the default target to <literal>archive</literal> (we
+ aren't going to cover automatic deployment to Glassfish).
</para>
- <programlisting role="XML">
- <project name="seamgen_example" default="archive"
- basedir=".">
- </programlisting>
+ <programlisting role="XML"><![CDATA[<project name="seamgen_example" default="archive" basedir=".">]]></programlisting>
</listitem>
<listitem>
<para>
- Websphere looks for the drools
- <literal>/security.drl</literal>
- file in the root of the
- <literal>war</literal>
- file instead of the root of the
- <literal>seamgen_example.jar</literal>
- so we need to have the
- <literal>build.xml</literal>
- move it to the correct location at build time. The
- following must be added at the top of the
- <literal>
- <target name="war" depends="compile"
- description="Build the distribution .war file">
- </literal>
+ Websphere looks for the drools <literal>/security.drl</literal>
+ file in the root of the <literal>war</literal> file instead of the root of the
+ <literal>seamgen_example.jar</literal> so we need to have
+ the <literal>build.xml</literal> move it to the correct
+ location at build time. The following must be added at the
+ top of the <literal><![CDATA[<target name="war" depends="compile" description="Build the distribution .war file">]]></literal>
target.
</para>
- <programlisting role="XML">
- <copy todir="${war.dir}"> <fileset
- dir="${basedir}/resources" > <include name="*.drl"
- /> </fileset> </copy>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<copy todir="${war.dir}">
+ <fileset dir="${basedir}/resources">
+ <include name="*.drl" />
+ </fileset>
+</copy>]]></programlisting>
</listitem>
<listitem>
<para>
- We need to get the
- <literal>GlassfishDerbyDialect.class</literal>
- into our application jar. To do that find the
- <literal>jar</literal>
+ We need to get the <literal>GlassfishDerbyDialect.class</literal>
+ into our application jar. To do that find the <literal>jar</literal>
task and modify the top of it so that it looks like this:
</para>
- <programlisting role="XML">
- <target name="jar" depends="compile,copyclasses"
- description="Build the distribution .jar file"> <copy
- todir="${jar.dir}"> <fileset
- dir="${basedir}/resources"> <include
- name="seam.properties" /> <include name="*.drl" />
- <include name="GlassfishDerbyDialect.class" />
- </fileset> </copy> ...
- </programlisting>
+ <programlisting role="XML"><![CDATA[<target name="jar" depends="compile,copyclasses" description="Build the distribution .jar file">
+ <copy todir="${jar.dir}">
+ <fileset dir="${basedir}/resources">
+ <include name="seam.properties" />
+ <include name="*.drl" />
+ <include name="GlassfishDerbyDialect.class" />
+ </fileset>
+ </copy>
+ ...]]></programlisting>
</listitem>
<listitem>
<para>
- Next we need to get the
- <literal>jboss-seam.jar</literal>
- into the base of the
- <literal>EAR</literal>
- file. For deployment Glassfish requires this jar to be in
- both the
- <literal>/lib</literal>
- directory and at the base of the
- <literal>EAR</literal>
- . You must add the following to the
- <literal>archive</literal>
- task:
+ Next we need to get the <literal>jboss-seam.jar</literal>
+ into the base of the <literal>EAR</literal> file. For
+ deployment Glassfish requires this jar to be in both the
+ <literal>/lib</literal> directory and at the base of the
+ <literal>EAR</literal>. You must add the following to the
+ <literal>archive</literal> task:
</para>
- <programlisting role="XML">
- <fileset dir="${lib.dir}"> <include
- name="jboss-seam.jar" /> </fileset>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<fileset dir="${lib.dir}">
+ <include name="jboss-seam.jar" >
+</fileset>]]></programlisting>
<para>
- So that the whole
- <literal>archive</literal>
- task looks like:
+ So that the whole <literal>archive</literal> task looks
+ like:
</para>
- <programlisting role="XML">
- <target name="archive" depends="jar,war,ear"
- description="Package the archives"> <jar
- jarfile="${dist.dir}/${project.name}.jar"
- basedir="${jar.dir}"/> <jar
- jarfile="${dist.dir}/${project.name}.war"
- basedir="${war.dir}"/> <jar
- jarfile="${dist.dir}/${project.name}.ear"> <fileset
- dir="${ear.dir}"/> <fileset dir="${dist.dir}">
- <include name="${project.name}.jar"/> <include
- name="${project.name}.war"/> </fileset>
- <fileset dir="${lib.dir}"> <include
- name="jboss-seam.jar" /> </fileset> </jar>
- </target>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<target name="archive" depends="jar,war,ear" description="Package the archives">
+ <jar jarfile="${dist.dir}/${project.name}.jar" basedir="${jar.dir}"/>
+ <jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
+ <jar jarfile="${dist.dir}/${project.name}.ear">
+ <fileset dir="${ear.dir}"/>
+ <fileset dir="${dist.dir}">
+ <include name="${project.name}.jar"/>
+ <include name="${project.name}.war"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="jboss-seam.jar" />
+ </fileset>
+ </jar>
+</target>]]></programlisting>
</listitem>
<listitem>
<para>
- Now we need to get extra jars into the
- <literal>build.xml</literal>
- . Look for the
- <literal><fileset dir="${basedir}"></literal>
+ Now we need to get extra jars into the <literal>build.xml</literal>.
+ Look for the <literal><![CDATA[<fileset dir="${basedir}">]]></literal>
section of the task below. Add the new includes at the
bottom of the fileset.
</para>
- <programlisting role="XML">
- <target name="ear" description="Build the EAR">
- <copy todir="${ear.dir}"> <fileset
- dir="${basedir}/resources"> <include name="*jpdl.xml"
- /> <include name="*hibernate.cfg.xml" />
- <include name="jbpm.cfg.xml" /> </fileset>
- <fileset dir="${lib.dir}"> <include
- name="jboss-seam.jar" /> </fileset> <fileset
- dir="${basedir}"> <include name="lib/jbpm*.jar" />
- <include name="lib/jboss-el.jar" /> <include
- name="lib/drools-*.jar"/> <include
- name="lib/core.jar"/> <include
- name="lib/janino*.jar"/> <include
- name="lib/antlr-*.jar"/> <include
- name="lib/mvel*.jar"/> <include
- name="lib/richfaces-api*.jar" /> </fileset>
- </copy> <copy todir="${ear.dir}/META-INF">
- <fileset dir="${basedir}/resources/META-INF">
- <include name="application.xml" /> <include
- name="jboss-app.xml" /> </fileset> </copy>
- </target>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<target name="ear" description="Build the EAR">
+ <copy todir="${ear.dir}">
+ <fileset dir="${basedir}/resources">
+ <include name="*jpdl.xml" />
+ <include name="*hibernate.cfg.xml" />
+ <include name="jbpm.cfg.xml" />
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="jboss-seam.jar" />
+ </fileset>
+ <fileset dir="${basedir}">
+ <include name="lib/jbpm*.jar" />
+ <include name="lib/jboss-el.jar" />
+ <include name="lib/drools-*.jar"/>
+ <include name="lib/core.jar"/>
+ <include name="lib/janino*.jar"/>
+ <include name="lib/antlr-*.jar"/>
+ <include name="lib/mvel*.jar"/>
+ <include name="lib/richfaces-api*.jar" />
+ </fileset>
+ </copy>
+ <copy todir="${ear.dir}/META-INF">
+ <fileset dir="${basedir}/resources/META-INF">
+ <include name="application.xml" />
+ <include name="jboss-app.xml" />
+ </fileset>
+ </copy>
+</target>]]></programlisting>
<itemizedlist>
<listitem>
<para>Add Hibernate dependencies</para>
- <programlisting role="XML">
- <!-- Hibernate and deps --> <include
- name="lib/hibernate.jar"/> <include
- name="lib/hibernate-commons-annotations.jar"/>
- <include name="lib/hibernate-annotations.jar"/>
- <include
- name="lib/hibernate-entitymanager.jar"/>
- <include name="lib/hibernate-validator.jar"/>
- <include name="lib/jboss-common-core.jar" />
- </programlisting>
+ <programlisting role="XML"><![CDATA[<!-- Hibernate and deps -->
+<include name="lib/hibernate.jar"/>
+<include name="lib/hibernate-commons-annotations.jar"/>
+<include name="lib/hibernate-annotations.jar"/>
+<include name="lib/hibernate-entitymanager.jar"/>
+<include name="lib/hibernate-validator.jar"/>
+<include name="lib/jboss-common-core.jar"/>]]></programlisting>
</listitem>
<listitem>
<para>
Add JSF dependencies. You will need to copy the
- <literal>el-ri.jar</literal>
- from the
- <literal>$SEAM_DIST/lib</literal>
- directory.
+ <literal>el-ri.jar</literal> from the
+ <literal>$SEAM_DIST/lib</literal> directory.
</para>
- <programlisting role="XML">
- <!-- jsf libs --> <include
- name="lib/jsf-api.jar" /> <include
- name="lib/jsf-impl.jar" /> <include
- name="lib/el-api.jar" /> <include
- name="lib/el-ri.jar"/>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<!-- jsf libs -->
+<include name="lib/jsf-api.jar" />
+<include name="lib/jsf-impl.jar" />
+<include name="lib/el-api.jar" />
+<include name="lib/el-ri.jar"/>]]></programlisting>
</listitem>
<listitem>
<para>Add third party dependencies.</para>
- <programlisting role="XML">
- <!-- 3rd party and supporting jars -->
- <include name="lib/javassist.jar"/> <include
- name="lib/dom4j.jar" /> <include
- name="lib/concurrent.jar" /> <include
- name="lib/cglib.jar"/> <include
- name="lib/asm.jar"/> <include
- name="lib/antlr.jar" /> <include
- name="lib/commons-logging.jar" /> <include
- name="lib/commons-collections.jar" />
- </programlisting>
+ <programlisting role="XML"><![CDATA[<!-- 3rd party and supporting jars -->
+<include name="lib/javassist.jar"/>
+<include name="lib/dom4j.jar"/>
+<include name="lib/concurrent.jar" />
+<include name="lib/cglib.jar"/>
+<include name="lib/asm.jar"/>
+<include name="lib/antlr.jar" />
+<include name="lib/commons-logging.jar" />
+<include name="lib/commons-collections.jar" />]]></programlisting>
</listitem>
</itemizedlist>
<para>You should end up with something like:</para>
- <programlisting role="XML">
- <fileset dir="${basedir}">
+ <programlisting role="XML"><![CDATA[<fileset dir="${basedir}">
+ <include name="lib/jbpm*.jar" />
+ <include name="lib/jboss-el.jar" />
+ <include name="lib/drools-*.jar"/>
+ <include name="lib/core.jar"/>
+ <include name="lib/janino*.jar"/>
+ <include name="lib/antlr-*.jar"/>
+ <include name="lib/mvel*.jar"/>
+ <include name="lib/richfaces-api*.jar" />
- <include name="lib/jbpm*.jar" /> <include
- name="lib/jboss-el.jar" /> <include
- name="lib/drools-*.jar"/> <include
- name="lib/core.jar"/> <include
- name="lib/janino*.jar"/> <include
- name="lib/antlr-*.jar"/> <include
- name="lib/mvel*.jar"/> <include
- name="lib/richfaces-api*.jar" />
+ <!-- Hibernate and deps -->
+ <include name="lib/hibernate.jar"/>
+ <include name="lib/hibernate-commons-annotations.jar"/>
+ <include name="lib/hibernate-annotations.jar"/>
+ <include name="lib/hibernate-entitymanager.jar"/>
+ <include name="lib/hibernate-validator.jar"/>
+ <include name="lib/jboss-common-core.jar" />
- <!-- Hibernate and deps --> <include
- name="lib/hibernate.jar"/> <include
- name="lib/hibernate-commons-annotations.jar"/>
- <include name="lib/hibernate-annotations.jar"/>
- <include name="lib/hibernate-entitymanager.jar"/>
- <include name="lib/hibernate-validator.jar"/>
- <include name="lib/jboss-common-core.jar" />
+ <!-- jsf libs -->
+ <include name="lib/jsf-api.jar" />
+ <include name="lib/jsf-impl.jar" />
+ <include name="lib/el-api.jar" />
+ <include name="lib/el-ri.jar"/>
- <!-- jsf libs --> <include name="lib/jsf-api.jar"
- /> <include name="lib/jsf-impl.jar" /> <include
- name="lib/el-api.jar" /> <include
- name="lib/el-ri.jar"/>
+ <!-- 3rd party and supporting jars -->
+ <include name="lib/javassist.jar" />
+ <include name="lib/dom4j.jar" />
+ <include name="lib/concurrent.jar" />
+ <include name="lib/cglib.jar" />
+ <include name="lib/asm.jar" />
+ <include name="lib/antlr.jar" />
+ <include name="lib/commons-logging.jar" />
+ <include name="lib/commons-collections.jar" />
- <!-- 3rd party and supporting jars --> <include
- name="lib/javassist.jar"/> <include
- name="lib/dom4j.jar" /> <include
- name="lib/concurrent.jar" /> <include
- name="lib/cglib.jar"/> <include
- name="lib/asm.jar"/> <include name="lib/antlr.jar"
- /> <include name="lib/commons-logging.jar" />
- <include name="lib/commons-collections.jar" />
-
- </fileset>
- </programlisting>
+</fileset>]]></programlisting>
</listitem>
</itemizedlist>
</section>
<section>
- <title>
- Building and deploying the seam-gen'd application to Glassfish
- </title>
+ <title>Building and deploying the seam-gen'd application to Glassfish</title>
<itemizedlist>
<listitem>
<para>
- Build your application by calling
- <literal>ant</literal>
- in the base directory of your project (ex.
- <literal>/projects/seamgen-example</literal>
- ). The target of the build will be
- <literal>dist/seamgen-example.ear</literal>
- .
+ Build your application by calling <literal>ant</literal> in
+ the base directory of your project (for example
+ <literal>/projects/seamgen-example</literal>). The target
+ of the build will be <literal>dist/seamgen-example.ear</literal>.
</para>
</listitem>
<listitem>
<para>
- To deploy the application follow the instructions here :
- <xref linkend="jee5-glassfish-deploy" />
- but use references to this project
- <literal>seamgen-example</literal>
- instead of
- <literal>jboss-seam-jee5</literal>
- .
+ To deploy the application follow the instructions here
+ <xref linkend="jee5-glassfish-deploy" /> but use references
+ to this project <literal>seamgen-example</literal> instead
+ of <literal>jboss-seam-jee5</literal>.
</para>
</listitem>
<listitem>
<para>
- Checkout the app at:
- <literal>http://localhost:8081/seamgen_example/</literal>
+ Checkout the app at <literal>http://localhost:8081/seamgen_example/</literal>
</para>
</listitem>
</itemizedlist>
16 years, 2 months
Seam SVN: r9209 - in trunk/doc/Seam_Reference_Guide/en-US: images and 1 other directory.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-10-06 13:12:04 -0400 (Mon, 06 Oct 2008)
New Revision: 9209
Removed:
trunk/doc/Seam_Reference_Guide/en-US/images/register.png
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Tutorial.xml
trunk/doc/Seam_Reference_Guide/en-US/images/numberguess-pageflow.png
Log:
JBSEAM-3026
Modified: trunk/doc/Seam_Reference_Guide/en-US/Tutorial.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Tutorial.xml 2008-10-06 16:49:19 UTC (rev 9208)
+++ trunk/doc/Seam_Reference_Guide/en-US/Tutorial.xml 2008-10-06 17:12:04 UTC (rev 9209)
@@ -123,19 +123,9 @@
<title>Understanding the code</title>
<para> The example is implemented with two Facelets templates, one entity bean and one
- stateless session bean. </para>
+ stateless session bean. Let's take a look at the code, starting from the "bottom".
+ </para>
- <mediaobject>
- <imageobject role="fo">
- <imagedata fileref="images/register.png" align="center" />
- </imageobject>
- <imageobject role="html">
- <imagedata fileref="images/register.png" align="center"/>
- </imageobject>
- </mediaobject>
-
- <para> Let's take a look at the code, starting from the "bottom". </para>
-
<section>
<title>The entity bean: <literal>User.java</literal></title>
Modified: trunk/doc/Seam_Reference_Guide/en-US/images/numberguess-pageflow.png
===================================================================
(Binary files differ)
Deleted: trunk/doc/Seam_Reference_Guide/en-US/images/register.png
===================================================================
(Binary files differ)
16 years, 2 months
Seam SVN: r9208 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-06 12:49:19 -0400 (Mon, 06 Oct 2008)
New Revision: 9208
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
Log:
Fix the indentation
Modified: trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 15:19:48 UTC (rev 9207)
+++ trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 16:49:19 UTC (rev 9208)
@@ -1,616 +1,653 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="glassfish">
- <title>Seam on Glassfish application server</title>
+ <title>Seam on Glassfish application server</title>
- <para>Glassfish is an open source application server which
- fully implements
- Java EE 5. The latest stable release is v2 UR2.</para>
+ <para>
+ Glassfish is an open source application server which fully implements Java
+ EE 5. The latest stable release is v2 UR2.
+ </para>
- <para>First we will go over some basic information about the
- Glassfish environment that we used for these examples. We will go over
- the details of those steps with the jee5 example. We will also deploy
- the JPA example application. Finally we show customizing of seam-gen's
- generated application.</para>
+ <para>
+ First we will go over some basic information about the Glassfish
+ environment that we used for these examples. We will go over the details
+ of those steps with the jee5 example. We will also deploy the JPA example
+ application. Finally we show customizing of seam-gen's generated
+ application.
+ </para>
- <section>
- <title>Glassfish environment and deployment information
- </title>
+ <section>
+ <title>Glassfish environment and deployment information</title>
- <para>Glassfish is a open source project and its installation
- is very
- easy. This section will detail the exact server versions used and
- installation tips.</para>
+ <para>
+ Glassfish is a open source project and its installation is very easy.
+ This section will detail the exact server versions used and
+ installation tips.
+ </para>
- <section>
- <title>Installation version and tips</title>
+ <section>
+ <title>Installation version and tips</title>
- <para>
- All of the examples and information in this chapter are based on
- the the latest version of Glassfish at the time of this writing.
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">
- Glassfish v2 UR2 - download page</ulink>
- </para>
- </listitem>
- </itemizedlist>
- </para>
+ <para>
+ All of the examples and information in this chapter are based on the
+ the latest version of Glassfish at the time of this writing.
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink
+ url="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">
+ Glassfish v2 UR2 - download page
+ </ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
- <para>
- After downloading suitable jar file with Glassfish, install it by
- writing on command line in case of linux version:
- <programlisting>java -Xmx256m -jar
- glassfish-installer-v2ur2-b04-linux.jar</programlisting>
- </para>
+ <para>
+ After downloading suitable jar file with Glassfish, install it by
+ writing on command line in case of linux version:
+ <programlisting>
+ java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar
+ </programlisting>
+ </para>
- <para>
- After installing, setup glassfish, the following command creates
- Glassfish server domain:
- <programlisting>cd glassfish; ant -f setup.xml</programlisting>
- The created domain name is domain1.
- </para>
+ <para>
+ After installing, setup glassfish, the following command creates
+ Glassfish server domain:
+ <programlisting>cd glassfish; ant -f setup.xml</programlisting>
+ The created domain name is domain1.
+ </para>
- <para>
- Start the embedded JavaDB server:
- <programlisting>bin/asadmin start-database
- </programlisting>
- This is default embedded database server in Glassfish.
- </para>
+ <para>
+ Start the embedded JavaDB server:
+ <programlisting>bin/asadmin start-database</programlisting>
+ This is default embedded database server in Glassfish.
+ </para>
- <para>
- Start the Glassfish server domain1:
- <programlisting>bin/asadmin start-domain domain1
- </programlisting>
- </para>
+ <para>
+ Start the Glassfish server domain1:
+ <programlisting>bin/asadmin start-domain domain1</programlisting>
+ </para>
- <para>
- The deployment and configuration is available at the Web
- Administration console at http://localhost:4848/. Access the web
- admin
- console with default username/password: admin/adminadmin. You can also
- copy EAR/WAR file to
- <literal>glassfish/domains/domain1/autodeploy
- </literal>
- for quick
- automatic deployment.
- </para>
+ <para>
+ The deployment and configuration is available at the Web
+ Administration console at http://localhost:4848/. Access the web
+ admin console with default username/password: admin/adminadmin. You
+ can also copy EAR/WAR file to
+ <literal>glassfish/domains/domain1/autodeploy</literal>
+ for quick automatic deployment.
+ </para>
- <para>
- Stopping the server and database can be done by the following
- command:
- <programlisting>bin/asadmin stop-domain domain1;
- bin/asadmin stop-database</programlisting>
- </para>
- </section>
- </section>
+ <para>
+ Stopping the server and database can be done by the following
+ command:
+ <programlisting>
+ bin/asadmin stop-domain domain1; bin/asadmin stop-database
+ </programlisting>
+ </para>
+ </section>
+ </section>
- <section id="jee5-glassfish-section">
- <title>
- The
- <literal>jee5/booking</literal>
- example
- </title>
+ <section id="jee5-glassfish-section">
+ <title>
+ The
+ <literal>jee5/booking</literal>
+ example
+ </title>
- <para>
- The
- <literal>jee5/booking</literal>
- example is based on the Hotel
- Booking example (which runs on JBoss AS). Out of the box it is also
- designed to run on Glassfish. It is located in the
- <literal>$SEAM_DIST/examples/jee5/booking
- </literal>
- directory.
- </para>
+ <para>
+ The
+ <literal>jee5/booking</literal>
+ example is based on the Hotel Booking example (which runs on JBoss AS).
+ Out of the box it is also designed to run on Glassfish. It is located
+ in the
+ <literal>$SEAM_DIST/examples/jee5/booking</literal>
+ directory.
+ </para>
- <section id="jee5-glassfish-deploy">
- <title>Deploying the application to Glassfish</title>
+ <section id="jee5-glassfish-deploy">
+ <title>Deploying the application to Glassfish</title>
- <para>We will deploy the application on Glassfish with using of
- Glassfish's administration console.</para>
+ <para>
+ We will deploy the application on Glassfish with using of
+ Glassfish's administration console.
+ </para>
- <para>
- The steps below are for the Glassfish version stated above.
- <orderedlist>
- <listitem>
- <para>
- Log in to the administration console
- <programlisting>http://localhost:4848
- </programlisting>
- </para>
- </listitem>
+ <para>
+ The steps below are for the Glassfish version stated above.
+ <orderedlist>
+ <listitem>
+ <para>
+ Log in to the administration console
+ <programlisting>http://localhost:4848</programlisting>
+ </para>
+ </listitem>
- <listitem>
- <para>
- Access the
- <literal>Enterprise Applications</literal>
- in the
- menu option under the
- <literal>Applications</literal>
- left side
- menu.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ Access the
+ <literal>Enterprise Applications</literal>
+ in the menu option under the
+ <literal>Applications</literal>
+ left side menu.
+ </para>
+ </listitem>
- <listitem>
- <para>
- At the top of the
- <literal>Enterprise Application</literal>
- table select
- <literal>Deploy</literal>
- . Below are installation
- wizard pages and what needs to done on each:
- <itemizedlist>
- <listitem>
- <para>
- <literal>Preparing for the application
- installation</literal>
- <itemizedlist>
- <listitem>
- <para>
- Browse to the
- <literal>examples/jee5/booking/dist/jboss-seam-jee5.ear
- </literal>
- file using the file upload widget.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ At the top of the
+ <literal>Enterprise Application</literal>
+ table select
+ <literal>Deploy</literal>
+ . Below are installation wizard pages and what needs to
+ done on each:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>
+ Preparing for the application installation
+ </literal>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Browse to the
+ <literal>
+ examples/jee5/booking/dist/jboss-seam-jee5.ear
+ </literal>
+ file using the file upload widget.
+ </para>
+ </listitem>
- <listitem>
- <para>
- Select the
- <literal>OK</literal>
- button.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
+ <listitem>
+ <para>
+ Select the
+ <literal>OK</literal>
+ button.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
- <listitem>
- <para>
- You can now access the application at
- <literal>http://localhost:8081/seam-jee5/
- </literal>
- .
- </para>
- </listitem>
- </orderedlist>
- </para>
- </section>
- </section>
+ <listitem>
+ <para>
+ You can now access the application at
+ <literal>http://localhost:8081/seam-jee5/</literal>
+ .
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
- <section id="jpa-glassfish-section">
- <title>
- The
- <literal>jpa</literal>
- booking example
- </title>
+ <section id="jpa-glassfish-section">
+ <title>
+ The
+ <literal>jpa</literal>
+ booking example
+ </title>
- <para>This is the Hotel Booking example implemented in Seam POJOs
- and
- using Hibernate JPA with JPA transactions. It does not require EJB3
- support to run on application server.</para>
+ <para>
+ This is the Hotel Booking example implemented in Seam POJOs and using
+ Hibernate JPA with JPA transactions. It does not require EJB3 support
+ to run on application server.
+ </para>
- <para>The example already has a break-out of configurations and
- build
- scripts for many of the common containers including Glassfish.</para>
+ <para>
+ The example already has a break-out of configurations and build scripts
+ for many of the common containers including Glassfish.
+ </para>
- <para>First thing we are going to do is build and deploy that
- example.</para>
+ <para>
+ First thing we are going to do is build and deploy that example.
+ </para>
- <section>
- <title>
- Building the
- <literal>jpa</literal>
- example
- </title>
+ <section>
+ <title>
+ Building the
+ <literal>jpa</literal>
+ example
+ </title>
- <para>
- Building it only requires running the correct ant command:
- <programlisting>ant glassfish</programlisting>
- This will create
- container specific distribution and exploded archive directories with
- the
- <literal>glassfish</literal>
- suffix.
- </para>
- </section>
+ <para>
+ Building it only requires running the correct ant command:
+ <programlisting>ant glassfish</programlisting>
+ This will create container specific distribution and exploded
+ archive directories with the
+ <literal>glassfish</literal>
+ suffix.
+ </para>
+ </section>
- <section>
- <title>
- Deploying the
- <literal>jpa</literal>
- example
- </title>
+ <section>
+ <title>
+ Deploying the
+ <literal>jpa</literal>
+ example
+ </title>
- <para>
- This is very similar to the
- <literal>jee5</literal>
- example at
- <xref linkend="jee5-glassfish-deploy" />
- .
- </para>
+ <para>
+ This is very similar to the
+ <literal>jee5</literal>
+ example at
+ <xref linkend="jee5-glassfish-deploy" />
+ .
+ </para>
- <itemizedlist>
- <listitem>
- <para>
- Log in to the administration console
- <programlisting>http://localhost:4848
- </programlisting>
- </para>
- </listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Log in to the administration console
+ <programlisting>http://localhost:4848</programlisting>
+ </para>
+ </listitem>
- <listitem>
- <para>
- Access the
- <literal>Web Applications</literal>
- in the menu
- option under the
- <literal>Applications</literal>
- left side menu.
- <itemizedlist>
- <listitem>
- <para>
- <literal>Preparing for the application
- installation</literal>
- <itemizedlist>
- <listitem>
- <para>
- Browse to the
- <literal>examples/jpa/dist-glassfish/jboss-seam-jpa.war
- </literal>
- file using the file upload widget.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ Access the
+ <literal>Web Applications</literal>
+ in the menu option under the
+ <literal>Applications</literal>
+ left side menu.
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>
+ Preparing for the application installation
+ </literal>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Browse to the
+ <literal>
+ examples/jpa/dist-glassfish/jboss-seam-jpa.war
+ </literal>
+ file using the file upload widget.
+ </para>
+ </listitem>
- <listitem>
- <para>
- Select the
- <literal>OK</literal>
- button.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
+ <listitem>
+ <para>
+ Select the
+ <literal>OK</literal>
+ button.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
- <listitem>
- <para>
- You can now access the application at
- <literal>http://localhost:8081/jboss-seam-jpa/
- </literal>
- .
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
+ <listitem>
+ <para>
+ You can now access the application at
+ <literal>
+ http://localhost:8081/jboss-seam-jpa/
+ </literal>
+ .
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
- <note>
- <title>Using Derby instead of Hypersonic SQL DB</title>
+ <note>
+ <title>Using Derby instead of Hypersonic SQL DB</title>
- In order for the app to work out of the box with Glassfish, we have
- used the Derby (i.e., Java DB) database in Glassfish. However, we
- strongly recommend you to use a non-Derby data source (e.g., HSQL is
- a much better embeded DB) if possible. The
- examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
- is a special hack to get around a Derby bug in Glassfish server. You
- must use it as your Hibernate dialect if you use Derby with
- Glassfish.
- </note>
- </section>
+ In order for the app to work out of the box with Glassfish, we have
+ used the Derby (i.e., Java DB) database in Glassfish. However, we
+ strongly recommend you to use a non-Derby data source (e.g., HSQL is
+ a much better embeded DB) if possible. The
+ examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
+ is a special hack to get around a Derby bug in Glassfish server. You
+ must use it as your Hibernate dialect if you use Derby with
+ Glassfish.
+ </note>
+ </section>
- <section>
- <title>What's different for Glassfish v2 UR2</title>
+ <section>
+ <title>What's different for Glassfish v2 UR2</title>
- <para>The differences between the JPA examples that deploys to
- JBoss 4.2
- and Glassfish v2 UR2. Expected differences are in persistence related
- configurations.</para>
+ <para>
+ The differences between the JPA examples that deploys to JBoss 4.2
+ and Glassfish v2 UR2. Expected differences are in persistence
+ related configurations.
+ </para>
- <itemizedlist>
- <listitem>
- <para>
- Configuration file changes
- <itemizedlist>
- <listitem>
- <para>
- <literal>META-INF/persistence.xml
- </literal>
- — the main
- changes here are for the datasource JNDI path, switching to
- the Glassfish transaction manager look up class, and changing
- the hibernate dialect to be
- <literal>GlassfishDerbyDialect</literal>
- .
- </para>
- </listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Configuration file changes
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>META-INF/persistence.xml</literal>
+ — the main changes here are for the datasource JNDI
+ path, switching to the Glassfish transaction manager
+ look up class, and changing the hibernate dialect to
+ be
+ <literal>GlassfishDerbyDialect</literal>
+ .
+ </para>
+ </listitem>
- <listitem>
- <para>
- <literal>WEB-INF/classes/GlassfishDerbyDialect.class
- </literal>
- — this class is needed for the hibernate dialect
- change to
- <literal>GlassfishDerbyDialect</literal>
- </para>
- </listitem>
+ <listitem>
+ <para>
+ <literal>
+ WEB-INF/classes/GlassfishDerbyDialect.class
+ </literal>
+ — this class is needed for the hibernate dialect
+ change to
+ <literal>GlassfishDerbyDialect</literal>
+ </para>
+ </listitem>
- <listitem>
- <para>
- <literal>import.sql</literal>
- — either for the dialect
- or Derby DB the
- <literal>ID</literal>
- column can not be
- populated by this file and was removed.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
+ <listitem>
+ <para>
+ <literal>import.sql</literal>
+ — either for the dialect or Derby DB the
+ <literal>ID</literal>
+ column can not be populated by this file and was
+ removed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
- <section>
- <title>
- Deploying an application generated by
- <literal>seam-gen</literal>
- on Glassfish v2 UR2
- </title>
+ <section>
+ <title>
+ Deploying an application generated by
+ <literal>seam-gen</literal>
+ on Glassfish v2 UR2
+ </title>
- <para>
- <literal>seam-gen</literal>
- is a very useful tool for developers to
- quickly get an application up and running, and provides a foundation to
- add your own functionality. Out of box
- <literal>seam-gen</literal>
- will
- produce applications configured to run on JBoss AS. These instructions
- will show the steps needed to get it to run on Glassfish. As stated above
- in
- <xref linkend="jee5-glassfish-section" />
- there is easy to deploy on
- glassfish either EJB3 or Seam POJOs based application
- </para>
+ <para>
+ <literal>seam-gen</literal>
+ is a very useful tool for developers to quickly get an application up
+ and running, and provides a foundation to add your own functionality.
+ Out of box
+ <literal>seam-gen</literal>
+ will produce applications configured to run on JBoss AS. These
+ instructions will show the steps needed to get it to run on Glassfish.
+ As stated above in
+ <xref linkend="jee5-glassfish-section" />
+ there is easy to deploy on glassfish either EJB3 or Seam POJOs based
+ application
+ </para>
- <section>
- <title>
- Running
- <literal>seam-gen</literal>
- Setup
- </title>
+ <section>
+ <title>
+ Running
+ <literal>seam-gen</literal>
+ Setup
+ </title>
- <para>
- The first step is setting up
- <literal>seam-gen</literal>
- to
- construct the base project. There are several choices made below,
- specifically the datasource and hibernate values that we will adjust
- once the project is created.
- </para>
+ <para>
+ The first step is setting up
+ <literal>seam-gen</literal>
+ to construct the base project. There are several choices made below,
+ specifically the datasource and hibernate values that we will adjust
+ once the project is created.
+ </para>
- <programlisting>
- ./seam setup
- Buildfile: build.xml
+ <programlisting>
+ ./seam setup Buildfile: build.xml
- init:
+ init:
- setup:
- [echo] Welcome to seam-gen :-)
- [input] Enter your Java project workspace (the directory that contains your
- Seam projects) [C:/Projects] [C:/Projects]
- /home/mnovotny/projects
- [input] Enter your JBoss home directory [C:/Program Files/jboss-4.2.3.GA]
- [C:/Program Files/jboss-4.2.3.GA]
+ setup: [echo] Welcome to seam-gen :-) [input] Enter your Java
+ project workspace (the directory that contains your Seam projects)
+ [C:/Projects] [C:/Projects] /home/mnovotny/projects [input] Enter
+ your JBoss home directory [C:/Program Files/jboss-4.2.3.GA]
+ [C:/Program Files/jboss-4.2.3.GA]
- [input] Enter the project name [myproject] [myproject]
- seamgen_example
- [echo] Accepted project name as: seamgen_example
- [input] Do you want to use ICEfaces instead of RichFaces [n] (y, [n])
+ [input] Enter the project name [myproject] [myproject]
+ seamgen_example [echo] Accepted project name as: seamgen_example
+ [input] Do you want to use ICEfaces instead of RichFaces [n] (y,
+ [n])
- [input] skipping input as property icefaces.home.new has already
- been set.
- [input] Select a RichFaces skin [blueSky] ([blueSky], classic, ruby, wine,
- deepMarine, emeraldTown, japanCherry, DEFAULT)
+ [input] skipping input as property icefaces.home.new has already
+ been set. [input] Select a RichFaces skin [blueSky] ([blueSky],
+ classic, ruby, wine, deepMarine, emeraldTown, japanCherry, DEFAULT)
- [input] Is this project deployed as an EAR (with EJB components) or a WAR
- (with no EJB support) [ear] ([ear], war)
+ [input] Is this project deployed as an EAR (with EJB components) or
+ a WAR (with no EJB support) [ear] ([ear], war)
- [input] Enter the Java package name for your session beans
- [com.mydomain.seamgen_example] [com.mydomain.seamgen_example]
- org.jboss.seam.tutorial.glassfish.action
- [input] Enter the Java package name for your entity beans
- [org.jboss.seam.tutorial.glassfish.action]
- [org.jboss.seam.tutorial.glassfish.action]
- org.jboss.seam.tutorial.glassfish.model
- [input] Enter the Java package name for your test cases
- [org.jboss.seam.tutorial.glassfish.action.test]
- [org.jboss.seam.tutorial.glassfish.action.test]
- org.jboss.seam.tutorial.glassfish.test
- [input] What kind of database are you using? [hsql] ([hsql], mysql, oracle,
- postgres, mssql, db2, sybase, enterprisedb, h2)
+ [input] Enter the Java package name for your session beans
+ [com.mydomain.seamgen_example] [com.mydomain.seamgen_example]
+ org.jboss.seam.tutorial.glassfish.action [input] Enter the Java
+ package name for your entity beans
+ [org.jboss.seam.tutorial.glassfish.action]
+ [org.jboss.seam.tutorial.glassfish.action]
+ org.jboss.seam.tutorial.glassfish.model [input] Enter the Java
+ package name for your test cases
+ [org.jboss.seam.tutorial.glassfish.action.test]
+ [org.jboss.seam.tutorial.glassfish.action.test]
+ org.jboss.seam.tutorial.glassfish.test [input] What kind of database
+ are you using? [hsql] ([hsql], mysql, oracle, postgres, mssql, db2,
+ sybase, enterprisedb, h2)
- [input] Enter the Hibernate dialect for your database
- [org.hibernate.dialect.HSQLDialect]
- [org.hibernate.dialect.HSQLDialect]
+ [input] Enter the Hibernate dialect for your database
+ [org.hibernate.dialect.HSQLDialect]
+ [org.hibernate.dialect.HSQLDialect]
- [input] Enter the filesystem path to the JDBC driver jar
- [../lib/hsqldb.jar] [../lib/hsqldb.jar]
+ [input] Enter the filesystem path to the JDBC driver jar
+ [../lib/hsqldb.jar] [../lib/hsqldb.jar]
- [input] Enter JDBC driver class for your database [org.hsqldb.jdbcDriver]
- [org.hsqldb.jdbcDriver]
+ [input] Enter JDBC driver class for your database
+ [org.hsqldb.jdbcDriver] [org.hsqldb.jdbcDriver]
- [input] Enter the JDBC URL for your database [jdbc:hsqldb:.]
- [jdbc:hsqldb:.]
+ [input] Enter the JDBC URL for your database [jdbc:hsqldb:.]
+ [jdbc:hsqldb:.]
- [input] Enter database username [sa] [sa]
+ [input] Enter database username [sa] [sa]
- [input] Enter database password [] []
+ [input] Enter database password [] []
- [input] Enter the database schema name (it is OK to leave this blank) [] []
+ [input] Enter the database schema name (it is OK to leave this
+ blank) [] []
- [input] Enter the database catalog name (it is OK to leave this
- blank) [] []
+ [input] Enter the database catalog name (it is OK to leave this
+ blank) [] []
- [input] Are you working with tables that already exist in the database? [n]
- (y, [n])
+ [input] Are you working with tables that already exist in the
+ database? [n] (y, [n])
- [input] Do you want to drop and recreate the database tables and data in
- import.sql each time you deploy? [n] (y, [n])
+ [input] Do you want to drop and recreate the database tables and
+ data in import.sql each time you deploy? [n] (y, [n])
- [propertyfile] Creating new property file:
- /home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/build.properties
- [echo] Installing JDBC driver jar to JBoss server
- [copy] Copying 1 file to
- /home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/C:/Program
- Files/jboss-4.2.3.GA/server/default/lib
- [echo] Type 'seam create-project' to create the new project
+ [propertyfile] Creating new property file:
+ /home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/build.properties
+ [echo] Installing JDBC driver jar to JBoss server [copy] Copying 1
+ file to
+ /home/mnovotny/workspaces/jboss/jboss-seam/seam-gen/C:/Program
+ Files/jboss-4.2.3.GA/server/default/lib [echo] Type 'seam
+ create-project' to create the new project
- BUILD SUCCESSFUL
- Total time: 4 minutes 5 seconds
-</programlisting>
+ BUILD SUCCESSFUL Total time: 4 minutes 5 seconds
+ </programlisting>
- <para>
- Type
- <literal>./seam new-project</literal>
- to create your project
- and
- <literal>cd /home/mnovotny/projects/seamgen_example</literal>
- to
- the newly created structure.
- </para>
- </section>
+ <para>
+ Type
+ <literal>./seam new-project</literal>
+ to create your project and
+ <literal>cd /home/mnovotny/projects/seamgen_example</literal>
+ to the newly created structure.
+ </para>
+ </section>
- <section>
- <title>Changes needed for deployment to Glassfish</title>
+ <section>
+ <title>Changes needed for deployment to Glassfish</title>
- <para>We now need to make some changes to the generated project.
- </para>
+ <para>We now need to make some changes to the generated project.</para>
- <section>
- <title>Configuration file changes</title>
+ <section>
+ <title>Configuration file changes</title>
- <variablelist>
- <varlistentry>
- <term>
- <literal>resources/META-INF/persistence-dev.xml
- </literal>
- </term>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <literal>resources/META-INF/persistence-dev.xml</literal>
+ </term>
- <listitem>
- <itemizedlist>
- <listitem>
- <para>
- Alter the
- <literal>jta-data-source</literal>
- to be
- <literal>jdbc/__default</literal>
- . We are going to be
- using the integrated Glassfish Derby DB.
- </para>
- </listitem>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Alter the
+ <literal>jta-data-source</literal>
+ to be
+ <literal>jdbc/__default</literal>
+ . We are going to be using the integrated
+ Glassfish Derby DB.
+ </para>
+ </listitem>
- <listitem>
- <para>
- Add or change the properties below. These are
- described in detail at
- <xref linkend="jee5-glassfish-section" />
- :
- </para>
+ <listitem>
+ <para>
+ Add or change the properties below. These are
+ described in detail at
+ <xref linkend="jee5-glassfish-section" />
+ :
+ </para>
- <programlisting role="XML">
-<property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
-<property name="hibernate.hbm2ddl.auto" value="update"/>
-<property name="hibernate.show_sql" value="true"/>
-<property name="hibernate.format_sql" value="true"/>
-<property name="hibernate.cache.provider_class"
- value="org.hibernate.cache.HashtableCacheProvider"/>
-<property name="hibernate.transaction.manager_lookup_class"
- value="org.hibernate.transaction.SunONETransactionManagerLookup"/></programlisting>
- </listitem>
+ <programlisting role="XML">
+ <property name="hibernate.dialect"
+ value="GlassfishDerbyDialect"/> <property
+ name="hibernate.hbm2ddl.auto" value="update"/>
+ <property name="hibernate.show_sql"
+ value="true"/> <property
+ name="hibernate.format_sql" value="true"/>
+ <property name="hibernate.cache.provider_class"
+ value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property
+ name="hibernate.transaction.manager_lookup_class"
+ value="org.hibernate.transaction.SunONETransactionManagerLookup"/>
+ </programlisting>
+ </listitem>
- <listitem>
- <para>You'll need to alter
- <literal>persistence-prod.xml</literal> as well if you want
- to deploy to Glassfish using the prod profile.</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
+ <listitem>
+ <para>
+ You'll need to alter
+ <literal>persistence-prod.xml</literal>
+ as well if you want to deploy to Glassfish using
+ the prod profile.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
- <varlistentry>
- <term><literal>resources/GlassfishDerbyDialect.class</literal></term>
+ <varlistentry>
+ <term>
+ <literal>resources/GlassfishDerbyDialect.class</literal>
+ </term>
- <listitem>
- <para>As with other examples we need to include this class for
- DB support. It can be copied from the <literal>jpa</literal>
- example into the <literal>seamgen_example/resources</literal>
- directory. <programlisting>
-cp $SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
- ./resources</programlisting></para>
- </listitem>
- </varlistentry>
+ <listitem>
+ <para>
+ As with other examples we need to include this class for
+ DB support. It can be copied from the
+ <literal>jpa</literal>
+ example into the
+ <literal>seamgen_example/resources</literal>
+ directory.
+ <programlisting>
+ cp
+ $SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
+ ./resources
+ </programlisting>
+ </para>
+ </listitem>
+ </varlistentry>
- <varlistentry>
- <term><literal>resources/META-INF/jboss-app.xml</literal></term>
+ <varlistentry>
+ <term>
+ <literal>resources/META-INF/jboss-app.xml</literal>
+ </term>
- <listitem>
- <para>You can delete this file as we aren't deploying to JBoss
- AS ( <literal>jboss-app.xml</literal> is used to enable
- classloading isolation in JBoss AS)</para>
- </listitem>
- </varlistentry>
+ <listitem>
+ <para>
+ You can delete this file as we aren't deploying to JBoss
+ AS (
+ <literal>jboss-app.xml</literal>
+ is used to enable classloading isolation in JBoss AS)
+ </para>
+ </listitem>
+ </varlistentry>
- <varlistentry>
- <term><literal>resources/*-ds.xml</literal></term>
+ <varlistentry>
+ <term>
+ <literal>resources/*-ds.xml</literal>
+ </term>
- <listitem>
- <para>You can delete these file as we aren't deploying to JBoss
- AS (these files define data sources in JBoss AS, we are using
- Glassfish's default data source)</para>
- </listitem>
- </varlistentry>
+ <listitem>
+ <para>
+ You can delete these file as we aren't deploying to
+ JBoss AS (these files define data sources in JBoss AS,
+ we are using Glassfish's default data source)
+ </para>
+ </listitem>
+ </varlistentry>
- <varlistentry>
- <term><literal>resources/WEB-INF/components.xml</literal></term>
+ <varlistentry>
+ <term>
+ <literal>resources/WEB-INF/components.xml</literal>
+ </term>
- <listitem>
- <itemizedlist>
- <listitem>
- <para>Enable container managed transaction integration - add
- the <literal> <transaction:ejb-transaction />
- </literal> component, and it's namespace declaration
- <literal>
- xmlns:transaction="http://jboss.com/products/seam/transaction"
- </literal></para>
- </listitem>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Enable container managed transaction integration -
+ add the
+ <literal>
+ <transaction:ejb-transaction />
+ </literal>
+ component, and it's namespace declaration
+ <literal>
+ xmlns:transaction="http://jboss.com/products/seam/transaction"
+ </literal>
+ </para>
+ </listitem>
- <listitem>
- <para>Alter the <literal>jndi-pattern</literal> to <literal>
- java:comp/env/seamgen_example/#{ejbName}/local </literal></para>
- </listitem>
+ <listitem>
+ <para>
+ Alter the
+ <literal>jndi-pattern</literal>
+ to
+ <literal>
+ java:comp/env/seamgen_example/#{ejbName}/local
+ </literal>
+ </para>
+ </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term> <literal>resources/WEB-INF/web.xml</literal>
- </term>
- <listitem>
- <para>As with the <literal>jee5/booking</literal>
- example we need to add EJB references to the web.xml. These
- references require the empty
- <literal>local-home</literal> to flag them for
- Glassfish to perform the proper binding.</para>
-
-
- <programlisting role="XML"><![CDATA[
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>resources/WEB-INF/web.xml</literal>
+ </term>
+ <listitem>
+ <para>
+ As with the
+ <literal>jee5/booking</literal>
+ example we need to add EJB references to the web.xml.
+ These references require the empty
+ <literal>local-home</literal>
+ to flag them for Glassfish to perform the proper
+ binding.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<ejb-local-ref>
<ejb-ref-name>seamgen_example/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
@@ -624,294 +661,363 @@
<local-home></local-home>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
</ejb-local-ref>]]></programlisting>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
- <section>
- <title>Creating the <literal>AuthenticatorAction</literal> EJB</title>
+ <section>
+ <title>
+ Creating the
+ <literal>AuthenticatorAction</literal>
+ EJB
+ </title>
- <para>We want to take the existing <literal>Authenticator</literal>
- Seam POJO component and create an EJB3 out of it.</para>
+ <para>
+ We want to take the existing
+ <literal>Authenticator</literal>
+ Seam POJO component and create an EJB3 out of it.
+ </para>
- <orderedlist>
- <listitem>
- <itemizedlist>
- <listitem>
- <para>Rename the class to
- <literal>AuthenticatorAction</literal></para>
- </listitem>
+ <orderedlist>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Rename the class to
+ <literal>AuthenticatorAction</literal>
+ </para>
+ </listitem>
- <listitem>
- <para>Add the <literal>@Stateless</literal> annotation to the
- new <literal>AuthenticatorAction</literal> class.</para>
- </listitem>
+ <listitem>
+ <para>
+ Add the
+ <literal>@Stateless</literal>
+ annotation to the new
+ <literal>AuthenticatorAction</literal>
+ class.
+ </para>
+ </listitem>
- <listitem>
- <para>Create an interface called
- <literal>Authenticator</literal> which
- <literal>AuthenticatorAction</literal> implements (EJB3
- requires session beans to have a local interface). Annotate
- the interface with <literal>@Local</literal> , and add a
- single method with same signature as the
- <literal>authenticate</literal> in
- <literal>AuthenticatorAction</literal> .</para>
- </listitem>
- </itemizedlist>
+ <listitem>
+ <para>
+ Create an interface called
+ <literal>Authenticator</literal>
+ which
+ <literal>AuthenticatorAction</literal>
+ implements (EJB3 requires session beans to have a
+ local interface). Annotate the interface with
+ <literal>@Local</literal>
+ , and add a single method with same signature as the
+ <literal>authenticate</literal>
+ in
+ <literal>AuthenticatorAction</literal>
+ .
+ </para>
+ </listitem>
+ </itemizedlist>
- <programlisting role="JAVA">
-@Name("authenticator") @Stateless
-public class AuthenticatorAction implements Authenticator {</programlisting>
+ <programlisting role="JAVA">
+ @Name("authenticator") @Stateless public class
+ AuthenticatorAction implements Authenticator {
+ </programlisting>
- <programlisting role="JAVA">
-@Local
-public interface Authenticator {
- public boolean authenticate();
-}</programlisting>
- </listitem>
+ <programlisting role="JAVA">
+ @Local public interface Authenticator { public boolean
+ authenticate(); }
+ </programlisting>
+ </listitem>
- <listitem>
- <para>We've already added its reference to the
- <literal>web.xml</literal> file so are good to go.</para>
- </listitem>
- </orderedlist>
- </section>
+ <listitem>
+ <para>
+ We've already added its reference to the
+ <literal>web.xml</literal>
+ file so are good to go.
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
- <section>
- <title>Extra jar dependencies and other changes to the
- <literal>build.xml</literal></title>
+ <section>
+ <title>
+ Extra jar dependencies and other changes to the
+ <literal>build.xml</literal>
+ </title>
- <para>This application has similar requirements as the
- <literal>jee5/booking</literal> example.</para>
+ <para>
+ This application has similar requirements as the
+ <literal>jee5/booking</literal>
+ example.
+ </para>
- <itemizedlist>
- <listitem>
- <para>Change the default target to <literal>archive</literal> (we
- aren't going to cover automatic deployment to Websphere).</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Change the default target to
+ <literal>archive</literal>
+ (we aren't going to cover automatic deployment to
+ Websphere).
+ </para>
- <programlisting role="XML">
-<project name="seamgen_example" default="archive" basedir="."></programlisting>
- </listitem>
+ <programlisting role="XML">
+ <project name="seamgen_example" default="archive"
+ basedir=".">
+ </programlisting>
+ </listitem>
- <listitem>
- <para>Websphere looks for the drools
- <literal>/security.drl</literal> file in the root of the
- <literal>war</literal> file instead of the root of the
- <literal>seamgen_example.jar</literal> so we need to have the
- <literal>build.xml</literal> move it to the correct location at
- build time. The following must be added at the top of the
- <literal> <target name="war" depends="compile"
- description="Build the distribution .war file"> </literal>
- target.</para>
+ <listitem>
+ <para>
+ Websphere looks for the drools
+ <literal>/security.drl</literal>
+ file in the root of the
+ <literal>war</literal>
+ file instead of the root of the
+ <literal>seamgen_example.jar</literal>
+ so we need to have the
+ <literal>build.xml</literal>
+ move it to the correct location at build time. The
+ following must be added at the top of the
+ <literal>
+ <target name="war" depends="compile"
+ description="Build the distribution .war file">
+ </literal>
+ target.
+ </para>
- <programlisting role="XML">
-<copy todir="${war.dir}">
- <fileset dir="${basedir}/resources" >
- <include name="*.drl" />
- </fileset>
-</copy></programlisting>
- </listitem>
+ <programlisting role="XML">
+ <copy todir="${war.dir}"> <fileset
+ dir="${basedir}/resources" > <include name="*.drl"
+ /> </fileset> </copy>
+ </programlisting>
+ </listitem>
- <listitem>
- <para>We need to get the
- <literal>GlassfishDerbyDialect.class</literal> into our
- application jar. To do that find the <literal>jar</literal> task
- and modify the top of it so that it looks like this:</para>
+ <listitem>
+ <para>
+ We need to get the
+ <literal>GlassfishDerbyDialect.class</literal>
+ into our application jar. To do that find the
+ <literal>jar</literal>
+ task and modify the top of it so that it looks like this:
+ </para>
- <programlisting role="XML">
-<target name="jar" depends="compile,copyclasses"
- description="Build the distribution .jar file">
- <copy todir="${jar.dir}">
- <fileset dir="${basedir}/resources">
- <include name="seam.properties" />
- <include name="*.drl" />
- <include name="GlassfishDerbyDialect.class" />
- </fileset>
- </copy>
-...</programlisting>
- </listitem>
+ <programlisting role="XML">
+ <target name="jar" depends="compile,copyclasses"
+ description="Build the distribution .jar file"> <copy
+ todir="${jar.dir}"> <fileset
+ dir="${basedir}/resources"> <include
+ name="seam.properties" /> <include name="*.drl" />
+ <include name="GlassfishDerbyDialect.class" />
+ </fileset> </copy> ...
+ </programlisting>
+ </listitem>
- <listitem>
- <para>Next we need to get the <literal>jboss-seam.jar</literal>
- into the base of the <literal>EAR</literal> file. For deployment
- Glassfish requires this jar to be in both the
- <literal>/lib</literal> directory and at the base of the
- <literal>EAR</literal>. You must add the following to the
- <literal>archive</literal> task:</para>
+ <listitem>
+ <para>
+ Next we need to get the
+ <literal>jboss-seam.jar</literal>
+ into the base of the
+ <literal>EAR</literal>
+ file. For deployment Glassfish requires this jar to be in
+ both the
+ <literal>/lib</literal>
+ directory and at the base of the
+ <literal>EAR</literal>
+ . You must add the following to the
+ <literal>archive</literal>
+ task:
+ </para>
- <programlisting role="XML">
-<fileset dir="${lib.dir}">
- <include name="jboss-seam.jar" />
-</fileset></programlisting>
+ <programlisting role="XML">
+ <fileset dir="${lib.dir}"> <include
+ name="jboss-seam.jar" /> </fileset>
+ </programlisting>
- <para>So that the whole <literal>archive</literal> task looks
- like:</para>
+ <para>
+ So that the whole
+ <literal>archive</literal>
+ task looks like:
+ </para>
- <programlisting role="XML">
-<target name="archive" depends="jar,war,ear"
- description="Package the archives">
- <jar jarfile="${dist.dir}/${project.name}.jar" basedir="${jar.dir}"/>
- <jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
- <jar jarfile="${dist.dir}/${project.name}.ear">
- <fileset dir="${ear.dir}"/>
- <fileset dir="${dist.dir}">
- <include name="${project.name}.jar"/>
- <include name="${project.name}.war"/>
- </fileset>
- <fileset dir="${lib.dir}">
- <include name="jboss-seam.jar" />
- </fileset>
- </jar>
-</target></programlisting>
- </listitem>
- <listitem>
- <para>Now we need to get extra jars into the
- <literal>build.xml</literal>. Look for the <literal><fileset
- dir="${basedir}"></literal> section of the task below. Add the
- new includes at the bottom of the fileset.</para>
+ <programlisting role="XML">
+ <target name="archive" depends="jar,war,ear"
+ description="Package the archives"> <jar
+ jarfile="${dist.dir}/${project.name}.jar"
+ basedir="${jar.dir}"/> <jar
+ jarfile="${dist.dir}/${project.name}.war"
+ basedir="${war.dir}"/> <jar
+ jarfile="${dist.dir}/${project.name}.ear"> <fileset
+ dir="${ear.dir}"/> <fileset dir="${dist.dir}">
+ <include name="${project.name}.jar"/> <include
+ name="${project.name}.war"/> </fileset>
+ <fileset dir="${lib.dir}"> <include
+ name="jboss-seam.jar" /> </fileset> </jar>
+ </target>
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Now we need to get extra jars into the
+ <literal>build.xml</literal>
+ . Look for the
+ <literal><fileset dir="${basedir}"></literal>
+ section of the task below. Add the new includes at the
+ bottom of the fileset.
+ </para>
- <programlisting role="XML">
-<target name="ear" description="Build the EAR">
- <copy todir="${ear.dir}">
- <fileset dir="${basedir}/resources">
- <include name="*jpdl.xml" />
- <include name="*hibernate.cfg.xml" />
- <include name="jbpm.cfg.xml" />
- </fileset>
- <fileset dir="${lib.dir}">
- <include name="jboss-seam.jar" />
- </fileset>
- <fileset dir="${basedir}">
- <include name="lib/jbpm*.jar" />
- <include name="lib/jboss-el.jar" />
- <include name="lib/drools-*.jar"/>
- <include name="lib/core.jar"/>
- <include name="lib/janino*.jar"/>
- <include name="lib/antlr-*.jar"/>
- <include name="lib/mvel*.jar"/>
- <include name="lib/richfaces-api*.jar" />
- </fileset>
- </copy>
- <copy todir="${ear.dir}/META-INF">
- <fileset dir="${basedir}/resources/META-INF">
- <include name="application.xml" />
- <include name="jboss-app.xml" />
- </fileset>
- </copy>
-</target></programlisting>
+ <programlisting role="XML">
+ <target name="ear" description="Build the EAR">
+ <copy todir="${ear.dir}"> <fileset
+ dir="${basedir}/resources"> <include name="*jpdl.xml"
+ /> <include name="*hibernate.cfg.xml" />
+ <include name="jbpm.cfg.xml" /> </fileset>
+ <fileset dir="${lib.dir}"> <include
+ name="jboss-seam.jar" /> </fileset> <fileset
+ dir="${basedir}"> <include name="lib/jbpm*.jar" />
+ <include name="lib/jboss-el.jar" /> <include
+ name="lib/drools-*.jar"/> <include
+ name="lib/core.jar"/> <include
+ name="lib/janino*.jar"/> <include
+ name="lib/antlr-*.jar"/> <include
+ name="lib/mvel*.jar"/> <include
+ name="lib/richfaces-api*.jar" /> </fileset>
+ </copy> <copy todir="${ear.dir}/META-INF">
+ <fileset dir="${basedir}/resources/META-INF">
+ <include name="application.xml" /> <include
+ name="jboss-app.xml" /> </fileset> </copy>
+ </target>
+ </programlisting>
- <itemizedlist>
- <listitem>
- <para>Add Hibernate dependencies</para>
+ <itemizedlist>
+ <listitem>
+ <para>Add Hibernate dependencies</para>
- <programlisting role="XML">
- <!-- Hibernate and deps -->
- <include name="lib/hibernate.jar"/>
- <include name="lib/hibernate-commons-annotations.jar"/>
- <include name="lib/hibernate-annotations.jar"/>
- <include name="lib/hibernate-entitymanager.jar"/>
- <include name="lib/hibernate-validator.jar"/>
- <include name="lib/jboss-common-core.jar" /></programlisting>
- </listitem>
+ <programlisting role="XML">
+ <!-- Hibernate and deps --> <include
+ name="lib/hibernate.jar"/> <include
+ name="lib/hibernate-commons-annotations.jar"/>
+ <include name="lib/hibernate-annotations.jar"/>
+ <include
+ name="lib/hibernate-entitymanager.jar"/>
+ <include name="lib/hibernate-validator.jar"/>
+ <include name="lib/jboss-common-core.jar" />
+ </programlisting>
+ </listitem>
- <listitem>
- <para>Add JSF dependencies. You will need to copy the
- <literal>el-ri.jar</literal> from the
- <literal>$SEAM_DIST/lib</literal> directory.</para>
+ <listitem>
+ <para>
+ Add JSF dependencies. You will need to copy the
+ <literal>el-ri.jar</literal>
+ from the
+ <literal>$SEAM_DIST/lib</literal>
+ directory.
+ </para>
- <programlisting role="XML">
- <!-- jsf libs -->
- <include name="lib/jsf-api.jar" />
- <include name="lib/jsf-impl.jar" />
- <include name="lib/el-api.jar" />
- <include name="lib/el-ri.jar"/></programlisting>
- </listitem>
+ <programlisting role="XML">
+ <!-- jsf libs --> <include
+ name="lib/jsf-api.jar" /> <include
+ name="lib/jsf-impl.jar" /> <include
+ name="lib/el-api.jar" /> <include
+ name="lib/el-ri.jar"/>
+ </programlisting>
+ </listitem>
- <listitem>
- <para>Add third party dependencies.</para>
+ <listitem>
+ <para>Add third party dependencies.</para>
- <programlisting role="XML">
- <!-- 3rd party and supporting jars -->
- <include name="lib/javassist.jar"/>
- <include name="lib/dom4j.jar" />
- <include name="lib/concurrent.jar" />
- <include name="lib/cglib.jar"/>
- <include name="lib/asm.jar"/>
- <include name="lib/antlr.jar" />
- <include name="lib/commons-logging.jar" />
- <include name="lib/commons-collections.jar" /></programlisting>
- </listitem>
- </itemizedlist>
+ <programlisting role="XML">
+ <!-- 3rd party and supporting jars -->
+ <include name="lib/javassist.jar"/> <include
+ name="lib/dom4j.jar" /> <include
+ name="lib/concurrent.jar" /> <include
+ name="lib/cglib.jar"/> <include
+ name="lib/asm.jar"/> <include
+ name="lib/antlr.jar" /> <include
+ name="lib/commons-logging.jar" /> <include
+ name="lib/commons-collections.jar" />
+ </programlisting>
+ </listitem>
+ </itemizedlist>
- <para>You should end up with something like:</para>
+ <para>You should end up with something like:</para>
- <programlisting role="XML">
-<fileset dir="${basedir}">
+ <programlisting role="XML">
+ <fileset dir="${basedir}">
- <include name="lib/jbpm*.jar" />
- <include name="lib/jboss-el.jar" />
- <include name="lib/drools-*.jar"/>
- <include name="lib/core.jar"/>
- <include name="lib/janino*.jar"/>
- <include name="lib/antlr-*.jar"/>
- <include name="lib/mvel*.jar"/>
- <include name="lib/richfaces-api*.jar" />
-
- <!-- Hibernate and deps -->
- <include name="lib/hibernate.jar"/>
- <include name="lib/hibernate-commons-annotations.jar"/>
- <include name="lib/hibernate-annotations.jar"/>
- <include name="lib/hibernate-entitymanager.jar"/>
- <include name="lib/hibernate-validator.jar"/>
- <include name="lib/jboss-common-core.jar" />
-
- <!-- jsf libs -->
- <include name="lib/jsf-api.jar" />
- <include name="lib/jsf-impl.jar" />
- <include name="lib/el-api.jar" />
- <include name="lib/el-ri.jar"/>
-
- <!-- 3rd party and supporting jars -->
- <include name="lib/javassist.jar"/>
- <include name="lib/dom4j.jar" />
- <include name="lib/concurrent.jar" />
- <include name="lib/cglib.jar"/>
- <include name="lib/asm.jar"/>
- <include name="lib/antlr.jar" />
- <include name="lib/commons-logging.jar" />
- <include name="lib/commons-collections.jar" />
-
-</fileset></programlisting>
- </listitem>
- </itemizedlist>
- </section>
+ <include name="lib/jbpm*.jar" /> <include
+ name="lib/jboss-el.jar" /> <include
+ name="lib/drools-*.jar"/> <include
+ name="lib/core.jar"/> <include
+ name="lib/janino*.jar"/> <include
+ name="lib/antlr-*.jar"/> <include
+ name="lib/mvel*.jar"/> <include
+ name="lib/richfaces-api*.jar" />
- <section>
- <title>Building and deploying the seam-gen'd application to
- Glassfish</title>
+ <!-- Hibernate and deps --> <include
+ name="lib/hibernate.jar"/> <include
+ name="lib/hibernate-commons-annotations.jar"/>
+ <include name="lib/hibernate-annotations.jar"/>
+ <include name="lib/hibernate-entitymanager.jar"/>
+ <include name="lib/hibernate-validator.jar"/>
+ <include name="lib/jboss-common-core.jar" />
- <itemizedlist>
- <listitem>
- <para>Build your application by calling <literal>ant</literal> in
- the base directory of your project (ex.
- <literal>/projects/seamgen-example</literal> ). The target of the
- build will be <literal>dist/seamgen-example.ear</literal> .</para>
- </listitem>
+ <!-- jsf libs --> <include name="lib/jsf-api.jar"
+ /> <include name="lib/jsf-impl.jar" /> <include
+ name="lib/el-api.jar" /> <include
+ name="lib/el-ri.jar"/>
- <listitem>
- <para>To deploy the application follow the instructions here :
- <xref linkend="jee5-glassfish-deploy" /> but use references to
- this project <literal>seamgen-example</literal> instead of
- <literal>jboss-seam-jee5</literal>.</para>
- </listitem>
+ <!-- 3rd party and supporting jars --> <include
+ name="lib/javassist.jar"/> <include
+ name="lib/dom4j.jar" /> <include
+ name="lib/concurrent.jar" /> <include
+ name="lib/cglib.jar"/> <include
+ name="lib/asm.jar"/> <include name="lib/antlr.jar"
+ /> <include name="lib/commons-logging.jar" />
+ <include name="lib/commons-collections.jar" />
- <listitem>
- <para>Checkout the app at:
- <literal>http://localhost:8081/seamgen_example/</literal></para>
- </listitem>
- </itemizedlist>
+ </fileset>
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>
+ Building and deploying the seam-gen'd application to Glassfish
+ </title>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Build your application by calling
+ <literal>ant</literal>
+ in the base directory of your project (ex.
+ <literal>/projects/seamgen-example</literal>
+ ). The target of the build will be
+ <literal>dist/seamgen-example.ear</literal>
+ .
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To deploy the application follow the instructions here :
+ <xref linkend="jee5-glassfish-deploy" />
+ but use references to this project
+ <literal>seamgen-example</literal>
+ instead of
+ <literal>jboss-seam-jee5</literal>
+ .
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Checkout the app at:
+ <literal>http://localhost:8081/seamgen_example/</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
- </section>
- </section>
+ </section>
</chapter>
\ No newline at end of file
16 years, 2 months
Seam SVN: r9207 - trunk/examples/wicket/src/web/org/jboss/seam/example/wicket.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2008-10-06 11:19:48 -0400 (Mon, 06 Oct 2008)
New Revision: 9207
Modified:
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Home.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Password.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Register.html
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Template.html
Log:
JBSEAM-3431 Added ids for wicket example.
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -29,13 +29,13 @@
</div>
<div wicket:id="bedsBorder">
- <select wicket:id="beds">
+ <select id="beds" wicket:id="beds">
<option>One king-size bed</option>
</select>
</div>
<div wicket:id="smokingBorder">
- <span wicket:id="smoking">
+ <span id="smoking" wicket:id="smoking">
<input type="radio" value="Smoking" />
<input type="radio" value="Non Smoking" />
</span>
@@ -59,9 +59,9 @@
</div>
<div class="buttonBox">
- <input type="submit" value="Proceed" />
+ <input id="proceed" type="submit" value="Proceed" />
 
- <input type="button" wicket:id="cancel" value="Cancel" />
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel" />
</div>
</fieldset>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -32,11 +32,11 @@
</div>
<div class="buttonBox">
- <input type="button" wicket:id="confirm" value="Confirm" />
+ <input id="confirm" type="button" wicket:id="confirm" value="Confirm" />
 
- <input type="button" wicket:id="revise" value="Revise" />
+ <input id="revise" type="button" wicket:id="revise" value="Revise" />
 
- <input type="button" wicket:id="cancel" value="Cancel" />
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel" />
</div>
</div>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -10,7 +10,7 @@
<span class="input #{invalid?'errors':''}">
<wicket:body />
</span>
- <span wicket:id="message" class="error errors"/>
+ <span id="message" name="message" wicket:id="message" class="error errors"/>
</div>
</wicket:border>
</body>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Home.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Home.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Home.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -18,15 +18,15 @@
<fieldset>
<div>
<label for="username">Login Name</label>
- <input wicket:id="username" style="width: 175px;"/>
+ <input id="username" wicket:id="username" style="width: 175px;"/>
</div>
<div>
<label for="password">Password</label>
- <input wicket:id="password" type="password" style="width: 175px;"/>
+ <input id="password" wicket:id="password" type="password" style="width: 175px;"/>
</div>
<div class="errors" wicket:id="messages" />
- <div class="buttonBox"><input type="submit" value="Account Login"/></div>
- <div class="notes"><a wicket:id="register">Register New User</a></div>
+ <div class="buttonBox"><input id="login" type="submit" value="Account Login"/></div>
+ <div class="notes"><a id="register" wicket:id="register">Register New User</a></div>
</fieldset>
</form>
</div>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -12,9 +12,9 @@
<div class="buttonBox">
- <input type="button" wicket:id="bookHotel" value="Book Hotel"/>
+ <input id="bookHotel" type="button" wicket:id="bookHotel" value="Book Hotel"/>
 
- <input type="button" wicket:id="cancel" value="Back to Search"/>
+ <input id="cancel" type="button" wicket:id="cancel" value="Back to Search"/>
</div>
</div>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -17,7 +17,7 @@
<fieldset>
- <input wicket:id="searchString" style="width: 165px;" />
+ <input id="searchString" wicket:id="searchString" style="width: 165px;" />
 
<input type="submit" wicket:id="submit" value="Find Hotels" />
 
@@ -35,7 +35,7 @@
</wicket:enclosure>
<div wicket:id="hotels">
<wicket:enclosure child="hotel">
- <table>
+ <table id="hotels">
<thead>
<tr>
<th>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Password.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Password.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Password.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -16,7 +16,7 @@
<form wicket:id="setpassword">
- <div class="entry errors" wicket:id="messages" />
+ <div class="entry errors" id="messages" wicket:id="messages" />
<fieldset>
@@ -29,9 +29,9 @@
</span>
<div class="buttonBox">
- <input type="submit" value="Change" />
+ <input id="change" type="submit" value="Change" />
 
- <input type="button" wicket:id="cancel" value="Cancel" />
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel" />
</div>
</fieldset>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Register.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Register.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Register.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -55,9 +55,9 @@
</span>
<div class="buttonBox">
- <input type="submit" value="Register"/>
+ <input id="register" type="submit" value="Register"/>
 
- <input type="button" wicket:id="cancel" value="Cancel"/>
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel"/>
</div>
</fieldset>
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Template.html
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Template.html 2008-10-06 14:57:25 UTC (rev 9206)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Template.html 2008-10-06 15:19:48 UTC (rev 9207)
@@ -21,9 +21,9 @@
<div id="title"><wicket:link><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></wicket:link></div>
<div id="status">
Welcome <span wicket:id="userName" />
- | <a wicket:id="search">Search</a>
- | <a wicket:id="settings">Settings</a>
- | <a wicket:id="logout">Logout</a>
+ | <a id="search" wicket:id="search">Search</a>
+ | <a id="settings" wicket:id="settings">Settings</a>
+ | <a id="logout" wicket:id="logout">Logout</a>
</div>
</div>
<div id="container">
16 years, 2 months
Seam SVN: r9206 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-06 10:57:25 -0400 (Mon, 06 Oct 2008)
New Revision: 9206
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Mail.xml
Log:
JBSEAM-3112
Modified: trunk/doc/Seam_Reference_Guide/en-US/Mail.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Mail.xml 2008-10-06 05:15:52 UTC (rev 9205)
+++ trunk/doc/Seam_Reference_Guide/en-US/Mail.xml 2008-10-06 14:57:25 UTC (rev 9206)
@@ -468,7 +468,7 @@
<title>Meldware</title>
<para>
- Seam's mail examples use Meldware (from <ulink url="http://buni.org">buni.org</ulink>)
+ Seam's mail examples use Meldware (from <ulink url="http://buni.org">buni.org</ulink>)
as a mail server. Meldware is a groupware package that provides
<literal>SMTP</literal>, <literal>POP3</literal>, <literal>IMAP</literal>,
webmail, a shared calendar and an graphical admin tool; it's written as a
@@ -478,43 +478,13 @@
<caution>
<para>
- The version of Meldware distributed with Seam (in the <literal>mail/buni-meldware</literal>
- folder) is specially tailored for development - mailboxes, users and
+ The version of Meldware distributed with Seam (downloaded on demand)
+ is specially tailored for development - mailboxes, users and
aliases (email addresses) are created every time the application
deploys. If you want to use Meldware in production you should install
the latest release from <ulink url="http://buni.org">buni.org</ulink>.
</para>
</caution>
- <para>
- To create mailboxes, users and aliases, you can use the
- <literal>meldware</literal> component:
- </para>
-
- <programlisting role="XHTML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
- xmlns:core="http://jboss.com/products/seam/core"
- xmlns:mail="http://jboss.com/products/seam/mail">
-
- <mail:mail-session host="smtp.example.com"/>
-
- <mail:meldware>
- <mail:users>
- <value>#{duke}</value>
- <value>#{root}</value>
- </mail:users>
- </mail:meldware>
-
- <mail:meldware-user name="duke" username="duke" password="duke">
- <mail:aliases>
- <value>duke(a)jboss.org</value>
- <value>duke(a)jboss.com</value>
- </mail:aliases>
- <mail:meldware-user name="root" username="root" password="root" administrator="true" />
-</components>]]></programlisting>
-
- <para>
- Here we've created two users, <literal>duke</literal>, who has two email
- addresses and an administrator with the username <literal>root</literal>.
- </para>
</section>
16 years, 2 months
Seam SVN: r9205 - in trunk/src/main/org/jboss/seam: security/management and 3 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-06 01:15:52 -0400 (Mon, 06 Oct 2008)
New Revision: 9205
Modified:
trunk/src/main/org/jboss/seam/security/JpaTokenStore.java
trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
trunk/src/main/org/jboss/seam/security/management/action/UserAction.java
trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java
Log:
JBSEAM-3511
Modified: trunk/src/main/org/jboss/seam/security/JpaTokenStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/JpaTokenStore.java 2008-10-06 05:13:26 UTC (rev 9204)
+++ trunk/src/main/org/jboss/seam/security/JpaTokenStore.java 2008-10-06 05:15:52 UTC (rev 9205)
@@ -47,16 +47,16 @@
entityManager = Expressions.instance().createValueExpression("#{entityManager}", EntityManager.class);
}
- tokenUsernameProperty = AnnotatedBeanProperty.scanForProperty(tokenClass, TokenUsername.class);
- tokenValueProperty = AnnotatedBeanProperty.scanForProperty(tokenClass, TokenValue.class);
+ tokenUsernameProperty = new AnnotatedBeanProperty<TokenUsername>(tokenClass, TokenUsername.class);
+ tokenValueProperty = new AnnotatedBeanProperty<TokenValue>(tokenClass, TokenValue.class);
- if (tokenUsernameProperty == null)
+ if (!tokenUsernameProperty.isSet())
{
throw new IllegalStateException("Invalid tokenClass " + tokenClass.getName() +
" - required annotation @TokenUsername not found on any Field or Method.");
}
- if (tokenValueProperty == null)
+ if (!tokenValueProperty.isSet())
{
throw new IllegalStateException("Invalid tokenClass " + tokenClass.getName() +
" - required annotation @TokenValue not found on any Field or Method.");
Modified: trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-10-06 05:13:26 UTC (rev 9204)
+++ trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-10-06 05:15:52 UTC (rev 9205)
@@ -113,33 +113,33 @@
private void initProperties()
{
- userPrincipalProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserPrincipal.class);
- userPasswordProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserPassword.class);
- userRolesProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserRoles.class);
- userEnabledProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserEnabled.class);
- userFirstNameProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserFirstName.class);
- userLastNameProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserLastName.class);
+ userPrincipalProperty = new AnnotatedBeanProperty(userClass, UserPrincipal.class);
+ userPasswordProperty = new AnnotatedBeanProperty(userClass, UserPassword.class);
+ userRolesProperty = new AnnotatedBeanProperty(userClass, UserRoles.class);
+ userEnabledProperty = new AnnotatedBeanProperty(userClass, UserEnabled.class);
+ userFirstNameProperty = new AnnotatedBeanProperty(userClass, UserFirstName.class);
+ userLastNameProperty = new AnnotatedBeanProperty(userClass, UserLastName.class);
if (roleClass != null)
{
- roleNameProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleName.class);
- roleGroupsProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleGroups.class);
- roleConditionalProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleConditional.class);
+ roleNameProperty = new AnnotatedBeanProperty(roleClass, RoleName.class);
+ roleGroupsProperty = new AnnotatedBeanProperty(roleClass, RoleGroups.class);
+ roleConditionalProperty = new AnnotatedBeanProperty(roleClass, RoleConditional.class);
}
- if (userPrincipalProperty == null)
+ if (!userPrincipalProperty.isSet())
{
throw new IdentityManagementException("Invalid userClass " + userClass.getName() +
" - required annotation @UserPrincipal not found on any Field or Method.");
}
- if (userRolesProperty == null)
+ if (!userRolesProperty.isSet())
{
throw new IdentityManagementException("Invalid userClass " + userClass.getName() +
" - required annotation @UserRoles not found on any Field or Method.");
}
- if (roleClass != null && roleNameProperty == null)
+ if (roleClass != null && !roleNameProperty.isSet())
{
throw new IdentityManagementException("Invalid roleClass " + roleClass.getName() +
" - required annotation @RoleName not found on any Field or Method.");
@@ -164,17 +164,17 @@
userPrincipalProperty.setValue(user, username);
- if (userFirstNameProperty != null) userFirstNameProperty.setValue(user, firstname);
- if (userLastNameProperty != null) userLastNameProperty.setValue(user, lastname);
+ if (userFirstNameProperty.isSet()) userFirstNameProperty.setValue(user, firstname);
+ if (userLastNameProperty.isSet()) userLastNameProperty.setValue(user, lastname);
if (password == null)
{
- if (userEnabledProperty != null) userEnabledProperty.setValue(user, false);
+ if (userEnabledProperty.isSet()) userEnabledProperty.setValue(user, false);
}
else
{
userPasswordProperty.setValue(user, generatePasswordHash(password, getUserAccountSalt(user)));
- if (userEnabledProperty != null) userEnabledProperty.setValue(user, true);
+ if (userEnabledProperty.isSet()) userEnabledProperty.setValue(user, true);
}
if (Events.exists()) Events.instance().raiseEvent(EVENT_PRE_PERSIST_USER, user);
@@ -228,7 +228,7 @@
Object user = lookupUser(username);
if (user == null)
{
- if (userPasswordProperty != null)
+ if (userPasswordProperty.isSet())
{
// If no userPasswordProperty is set, it means that authentication is being performed
// by another identity store and this one is just managing roles
@@ -303,7 +303,7 @@
public boolean addRoleToGroup(String role, String group)
{
- if (roleGroupsProperty == null) return false;
+ if (!roleGroupsProperty.isSet()) return false;
Object targetRole = lookupRole(role);
if (targetRole == null)
@@ -346,7 +346,7 @@
public boolean removeRoleFromGroup(String role, String group)
{
- if (roleGroupsProperty == null) return false;
+ if (!roleGroupsProperty.isSet()) return false;
Object roleToRemove = lookupRole(role);
if (role == null)
@@ -413,7 +413,7 @@
public boolean enableUser(String name)
{
- if (userEnabledProperty == null)
+ if (!userEnabledProperty.isSet())
{
log.debug("Can not enable user, no @UserEnabled property configured in userClass " + userClass.getName());
return false;
@@ -438,7 +438,7 @@
public boolean disableUser(String name)
{
- if (userEnabledProperty == null)
+ if (!userEnabledProperty.isSet())
{
log.debug("Can not disable user, no @UserEnabled property configured in userClass " + userClass.getName());
return false;
@@ -488,7 +488,7 @@
public boolean isUserEnabled(String name)
{
Object user = lookupUser(name);
- return user != null && (userEnabledProperty == null || (((Boolean) userEnabledProperty.getValue(user))) == true);
+ return user != null && (!userEnabledProperty.isSet() || (((Boolean) userEnabledProperty.getValue(user))) == true);
}
public List<String> getGrantedRoles(String name)
@@ -564,7 +564,7 @@
{
Object instance = lookupRole(role);
- if (roleGroupsProperty != null)
+ if (roleGroupsProperty.isSet())
{
Collection groups = (Collection) roleGroupsProperty.getValue(instance);
@@ -614,7 +614,7 @@
public boolean authenticate(String username, String password)
{
Object user = lookupUser(username);
- if (user == null || (userEnabledProperty != null && ((Boolean) userEnabledProperty.getValue(user) == false)))
+ if (user == null || (userEnabledProperty.isSet() && ((Boolean) userEnabledProperty.getValue(user) == false)))
{
return false;
}
@@ -675,8 +675,8 @@
public boolean isRoleConditional(String role)
{
- return roleConditionalProperty == null ? false : (Boolean) roleConditionalProperty.getValue(
- lookupRole(role));
+ return roleConditionalProperty.isSet() ? (Boolean) roleConditionalProperty.getValue(
+ lookupRole(role)) : false;
}
public Object lookupRole(String role)
@@ -730,7 +730,7 @@
roleQuery.append(roleClass.getName());
roleQuery.append(" r");
- if (roleConditionalProperty != null)
+ if (roleConditionalProperty.isSet())
{
roleQuery.append(" where r.");
roleQuery.append(roleConditionalProperty.getName());
Modified: trunk/src/main/org/jboss/seam/security/management/action/UserAction.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/action/UserAction.java 2008-10-06 05:13:26 UTC (rev 9204)
+++ trunk/src/main/org/jboss/seam/security/management/action/UserAction.java 2008-10-06 05:15:52 UTC (rev 9205)
@@ -68,7 +68,7 @@
private String saveNewUser()
{
- if (!password.equals(confirm))
+ if (password == null || !password.equals(confirm))
{
StatusMessages.instance().addToControl("password", "Passwords do not match");
return "failure";
Modified: trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-10-06 05:13:26 UTC (rev 9204)
+++ trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-10-06 05:15:52 UTC (rev 9205)
@@ -99,32 +99,32 @@
protected void initProperties()
{
- userProperty = AnnotatedBeanProperty.scanForProperty(userPermissionClass, PermissionUser.class);
- targetProperty = AnnotatedBeanProperty.scanForProperty(userPermissionClass, PermissionTarget.class);
- actionProperty = AnnotatedBeanProperty.scanForProperty(userPermissionClass, PermissionAction.class);
+ userProperty = new AnnotatedBeanProperty<PermissionUser>(userPermissionClass, PermissionUser.class);
+ targetProperty = new AnnotatedBeanProperty<PermissionTarget>(userPermissionClass, PermissionTarget.class);
+ actionProperty = new AnnotatedBeanProperty<PermissionAction>(userPermissionClass, PermissionAction.class);
if (rolePermissionClass != null)
{
- roleProperty = AnnotatedBeanProperty.scanForProperty(rolePermissionClass, PermissionRole.class);
- if (roleProperty != null)
+ roleProperty = new AnnotatedBeanProperty<PermissionRole>(rolePermissionClass, PermissionRole.class);
+ if (roleProperty.isSet())
{
- roleTargetProperty = AnnotatedBeanProperty.scanForProperty(rolePermissionClass,
+ roleTargetProperty = new AnnotatedBeanProperty<PermissionTarget>(rolePermissionClass,
PermissionTarget.class);
- roleActionProperty = AnnotatedBeanProperty.scanForProperty(rolePermissionClass,
+ roleActionProperty = new AnnotatedBeanProperty<PermissionAction>(rolePermissionClass,
PermissionAction.class);
}
}
else
{
- roleProperty = AnnotatedBeanProperty.scanForProperty(userPermissionClass, PermissionRole.class);
- if (roleProperty != null)
+ roleProperty = new AnnotatedBeanProperty<PermissionRole>(userPermissionClass, PermissionRole.class);
+ if (roleProperty.isSet())
{
- discriminatorProperty = AnnotatedBeanProperty.scanForProperty(userPermissionClass,
+ discriminatorProperty = new AnnotatedBeanProperty<PermissionDiscriminator>(userPermissionClass,
PermissionDiscriminator.class);
}
}
- if (userProperty == null)
+ if (!userProperty.isSet())
{
throw new RuntimeException("Invalid userPermissionClass " + userPermissionClass.getName() +
" - required annotation @PermissionUser not found on any Field or Method.");
@@ -132,25 +132,25 @@
if (rolePermissionClass != null)
{
- if (roleProperty == null)
+ if (!roleProperty.isSet())
{
throw new RuntimeException("Invalid rolePermissionClass " + rolePermissionClass.getName() +
" - required annotation @PermissionRole not found on any Field or Method.");
}
- if (roleTargetProperty == null)
+ if (!roleTargetProperty.isSet())
{
throw new RuntimeException("Invalid rolePermissionClass " + rolePermissionClass.getName() +
" - required annotation @PermissionTarget not found on any Field or Method.");
}
- if (roleActionProperty == null)
+ if (!roleActionProperty.isSet())
{
throw new RuntimeException("Invalid rolePermissionClass " + rolePermissionClass.getName() +
" - required annotation @PermissionAction not found on any Field or Method.");
}
}
- else if (discriminatorProperty == null)
+ else if (!discriminatorProperty.isSet())
{
throw new RuntimeException("Invalid userPermissionClass " + rolePermissionClass.getName() +
" - no rolePermissionClass set and @PermissionDiscriminator annotation not found on " +
@@ -342,7 +342,7 @@
return true;
}
- if (discriminatorProperty == null)
+ if (!discriminatorProperty.isSet())
{
throw new RuntimeException("Could not grant permission, rolePermissionClass not set");
}
@@ -371,7 +371,7 @@
actionProperty.setValue(instance, actionSet.toString());
userProperty.setValue(instance, resolvePrincipalEntity(recipient));
- if (discriminatorProperty != null)
+ if (discriminatorProperty.isSet())
{
PermissionDiscriminator discriminator = discriminatorProperty.getAnnotation();
discriminatorProperty.setValue(instance, recipientIsRole ? discriminator.roleValue() :
@@ -529,7 +529,7 @@
if (identityStore != null)
{
- if (recipientIsRole && roleProperty != null && roleProperty.getPropertyClass().equals(identityStore.getRoleClass()))
+ if (recipientIsRole && roleProperty.isSet() && roleProperty.getPropertyClass().equals(identityStore.getRoleClass()))
{
return identityStore.lookupRole(recipient.getName());
}
@@ -609,7 +609,7 @@
Map<String,Principal> principalCache = new HashMap<String,Principal>();
- boolean useDiscriminator = rolePermissionClass == null && discriminatorProperty != null;
+ boolean useDiscriminator = rolePermissionClass == null && discriminatorProperty.isSet();
Map<String,Object> identifierCache = null;
Modified: trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java 2008-10-06 05:13:26 UTC (rev 9204)
+++ trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java 2008-10-06 05:15:52 UTC (rev 9205)
@@ -1,5 +1,6 @@
package org.jboss.seam.util;
+import java.beans.Introspector;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -15,90 +16,90 @@
private Field propertyField;
private Method propertyGetter;
private Method propertySetter;
- private T annotation;
private String name;
private Class propertyClass;
+ private T annotation;
private boolean isFieldProperty;
+ private boolean set = false;
- private AnnotatedBeanProperty(Field propertyField, T annotation)
- {
- this.propertyField = propertyField;
- isFieldProperty = true;
- this.annotation = annotation;
- this.name = propertyField.getName();
- this.propertyClass = propertyField.getDeclaringClass();
- }
-
- private AnnotatedBeanProperty(Method propertyMethod, T annotation)
- {
- if (!(propertyMethod.getName().startsWith("get") || (propertyMethod.getName().startsWith("is"))))
+ public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass)
+ {
+ // First check declared fields
+ for (Field f : cls.getDeclaredFields())
{
- throw new IllegalArgumentException("Bean property method name " + propertyMethod.getClass().getName() +
- "." + propertyMethod.getName() + "() must start with \"get\" or \"is\".");
- }
+ if (f.isAnnotationPresent(annotationClass))
+ {
+ setupFieldProperty(f);
+ this.annotation = f.getAnnotation(annotationClass);
+ set = true;
+ return;
+ }
+ }
- if (propertyMethod.getReturnType().equals(void.class) || propertyMethod.getParameterTypes().length > 0)
+ // Then check public fields, in case it's inherited
+ for (Field f : cls.getFields())
{
- throw new IllegalArgumentException("Bean property method " + propertyMethod.getClass().getName() +
- "." + propertyMethod.getName() + "() must return a value and take no parameters");
+ if (f.isAnnotationPresent(annotationClass))
+ {
+ this.annotation = f.getAnnotation(annotationClass);
+ setupFieldProperty(f);
+ set = true;
+ return;
+ }
}
- this.propertyGetter = propertyMethod;
- this.propertyClass = propertyMethod.getReturnType();
-
- String methodName = propertyMethod.getName();
-
- this.name = methodName.startsWith("get") ?
- (methodName.substring(3,4).toLowerCase() + methodName.substring(4)) :
- (methodName.substring(2,3).toLowerCase() + methodName.substring(3));
-
- String setterName = propertyMethod.getName().startsWith("get") ?
- ("set" + methodName.substring(3)) : ("set" + methodName.substring(2));
-
- try
+ // Then check public methods (we ignore private methods)
+ for (Method m : cls.getMethods())
{
- propertySetter = propertyMethod.getDeclaringClass().getMethod(setterName, new Class[] {propertyMethod.getReturnType()});
- }
- catch (NoSuchMethodException ex)
- {
- throw new IllegalArgumentException("Bean property method " + propertyMethod.getClass().getName() +
- "." + propertyMethod.getName() + "() must have a corresponding setter method.");
- }
-
- isFieldProperty = false;
- this.annotation = annotation;
+ if (m.isAnnotationPresent(annotationClass))
+ {
+ this.annotation = m.getAnnotation(annotationClass);
+ String methodName = m.getName();
+
+ if ( m.getName().startsWith("get") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(3) );
+ }
+ else if ( methodName.startsWith("is") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(2) );
+ }
+
+ if (this.name != null)
+ {
+ this.propertyGetter = Reflections.getGetterMethod(cls, this.name);
+ this.propertySetter = Reflections.getSetterMethod(cls, this.name);
+ this.propertyClass = this.propertyGetter.getReturnType();
+ isFieldProperty = false;
+ set = true;
+ }
+ else
+ {
+ throw new IllegalStateException("Invalid accessor method, must start with 'get' or 'is'. " +
+ "Method: " + m + " in class: " + cls);
+ }
+ }
+ }
}
-
+
+ private void setupFieldProperty(Field propertyField)
+ {
+ this.propertyField = propertyField;
+ isFieldProperty = true;
+ this.name = propertyField.getName();
+ this.propertyClass = propertyField.getDeclaringClass();
+ }
+
public void setValue(Object bean, Object value)
{
if (isFieldProperty)
{
- boolean accessible = propertyField.isAccessible();
- try
- {
- propertyField.setAccessible(true);
- propertyField.set(bean, value);
- }
- catch (IllegalAccessException ex)
- {
- throw new RuntimeException("Exception setting bean property", ex);
- }
- finally
- {
- propertyField.setAccessible(accessible);
- }
+ Reflections.setAndWrap(propertyField, bean, value);
}
else
{
- try
- {
- propertySetter.invoke(bean, value);
- }
- catch (Exception ex)
- {
- throw new RuntimeException("Exception setting bean property", ex);
- }
+ Reflections.invokeAndWrap(propertySetter, bean, value);
}
}
@@ -106,42 +107,22 @@
{
if (isFieldProperty)
{
- boolean accessible = propertyField.isAccessible();
- try
- {
- propertyField.setAccessible(true);
- return propertyField.get(bean);
- }
- catch (IllegalAccessException ex)
- {
- throw new RuntimeException("Exception getting bean property", ex);
- }
- finally
- {
- propertyField.setAccessible(accessible);
- }
+ return Reflections.getAndWrap(propertyField, bean);
}
else
{
- try
- {
- return propertyGetter.invoke(bean);
- }
- catch (Exception ex)
- {
- throw new RuntimeException("Exception getting bean property", ex);
- }
+ return Reflections.invokeAndWrap(propertyGetter, bean);
}
}
- public T getAnnotation()
+ public String getName()
{
- return annotation;
+ return name;
}
- public String getName()
+ public T getAnnotation()
{
- return name;
+ return annotation;
}
public Class getPropertyClass()
@@ -149,25 +130,8 @@
return propertyClass;
}
-
- public static AnnotatedBeanProperty scanForProperty(Class cls, Class<? extends Annotation> annotation)
+ public boolean isSet()
{
- for (Field f : cls.getFields())
- {
- if (f.isAnnotationPresent(annotation))
- {
- return new AnnotatedBeanProperty(f, f.getAnnotation(annotation));
- }
- }
-
- for (Method m : cls.getMethods())
- {
- if (m.isAnnotationPresent(annotation))
- {
- return new AnnotatedBeanProperty(m, m.getAnnotation(annotation));
- }
- }
-
- return null;
- }
+ return set;
+ }
}
\ No newline at end of file
16 years, 2 months