Seam SVN: r8419 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-06-25 20:48:02 -0400 (Wed, 25 Jun 2008)
New Revision: 8419
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Security.xml
Log:
more proofreading, documented typesafe security annotations
Modified: trunk/doc/Seam_Reference_Guide/en-US/Security.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-06-25 19:47:15 UTC (rev 8418)
+++ trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-06-26 00:48:02 UTC (rev 8419)
@@ -2339,7 +2339,7 @@
<title>Authorization</title>
<para>
- There are a number of authorization features provided by the Seam Security API for securing access to
+ There are a number of authorization mechanisms provided by the Seam Security API for securing access to
components, component methods, and pages. This section describes each of these. An important thing to
note is that if you wish to use any of the advanced features (such as rule-based permissions) then
your <literal>components.xml</literal> may need to be configured to support this - see the Configuration section
@@ -2400,8 +2400,8 @@
</mediaobject>
<para>
- Within this documentation, permissions are represented in the form <literal>name:action</literal> (generally
- omitting the recipient, although in reality one is always required).
+ Within this documentation, permissions are generally represented in the form <literal>target:action</literal>
+ (omitting the recipient, although in reality one is always required).
</para>
</sect3>
@@ -2453,7 +2453,7 @@
<para>
In this example, the implied permission required to call the <literal>delete()</literal> method is
<literal>account:delete</literal>. The equivalent of this would be to write
- <literal>@Restrict("#{s:hasPermission('account','delete',null)}")</literal>. Now let's look at
+ <literal>@Restrict("#{s:hasPermission('account','delete')}")</literal>. Now let's look at
another example:
</para>
@@ -2492,7 +2492,7 @@
<programlisting role="JAVA"><![CDATA[@Name("account")
public class AccountAction {
@In Account selectedAccount;
- @Restrict("#{s:hasPermission('account','modify',selectedAccount)}")
+ @Restrict("#{s:hasPermission(selectedAccount,'modify')}")
public void modify() {
selectedAccount.modify();
}
@@ -2516,7 +2516,7 @@
</para>
<programlisting role="JAVA"><![CDATA[public void deleteCustomer() {
- Identity.instance().checkRestriction("#{s:hasPermission('customer','delete',selectedCustomer)}");
+ Identity.instance().checkRestriction("#{s:hasPermission(selectedCustomer,'delete')}");
}]]></programlisting>
<para>
@@ -2546,7 +2546,7 @@
<programlisting role="JAVA"><![CDATA[if (!Identity.instance().hasRole("admin"))
throw new AuthorizationException("Must be admin to perform this action");
-if (!Identity.instance().hasPermission("customer", "create", null))
+if (!Identity.instance().hasPermission("customer", "create"))
throw new AuthorizationException("You may not create new customers");]]></programlisting>
</sect3>
@@ -2607,9 +2607,9 @@
<h:column>
<f:facet name="header">Action</f:facet>
<s:link value="Modify Client" action="#{clientAction.modify}"
- rendered="#{s:hasPermission('client','modify',cl)"/>
+ rendered="#{s:hasPermission(cl,'modify')"/>
<s:link value="Delete Client" action="#{clientAction.delete}"
- rendered="#{s:hasPermission('client','delete',cl)"/>
+ rendered="#{s:hasPermission(cl,'delete')"/>
</h:column>
</h:dataTable>]]></programlisting>
@@ -2755,9 +2755,9 @@
no-loop
activation-group "permissions"
when
- check: PermissionCheck(name == "memberBlog", action == "insert", granted == false)
- Principal(principalName : name)
- MemberBlog(member : member -> (member.getUsername().equals(principalName)))
+ principal: Principal()
+ memberBlog: MemberBlog(member : member -> (member.getUsername().equals(principal.getName())))
+ check: PermissionCheck(target == memberBlog, action == "insert", granted == false)
then
check.grant();
end;]]></programlisting>
@@ -2765,11 +2765,11 @@
<para>
This rule will grant the permission <literal>memberBlog:insert</literal> if the currently authenticated
user (indicated by the <literal>Principal</literal> fact) has the same name as the member for which the
- blog entry is being created. The "<literal>principalName : name</literal>" structure that can be seen in the
- <literal>Principal</literal> fact (and other places) is a variable binding - it binds the <literal>name</literal>
- property of the <literal>Principal</literal> to a variable called <literal>principalName</literal>. Variable bindings
- allow the value to be referred to in other places, such as the following line which compares the member's username
- to the <literal>Principal</literal> name. For more details, please refer to the JBoss Rules documentation.
+ blog entry is being created. The "<literal>principal: Principal()</literal>" structure that can be seen in the
+ example code is a variable binding - it binds the instance of the <literal>Principal</literal> object from the
+ working memory (placed there during authentication) and assigns it to a variable called <literal>principal</literal>.
+ Variable bindings allow the value to be referred to in other places, such as the following line which compares the
+ member's username to the <literal>Principal</literal> name. For more details, please refer to the JBoss Rules documentation.
</para>
<para>
@@ -2825,8 +2825,74 @@
that <literal>@Restrict</literal> does.
</para>
+ <para>
+ Out of the box, Seam comes with annotations for standard CRUD-based permissions, however it is a simple matter to
+ add your own. The following annotations are provided in the <literal>org.jboss.seam.annotations.security</literal> package:
+ </para>
-
+ <itemizedlist>
+ <listitem>
+ <para>@Insert</para>
+ </listitem>
+ <listitem>
+ <para>@Read</para>
+ </listitem>
+ <listitem>
+ <para>@Update</para>
+ </listitem>
+ <listitem>
+ <para>@Delete</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ To use these annotations, simply place them on the method or parameter for which you wish to perform a security check.
+ If placed on a method, then they should specify a target class for which the permission will be checked. Take the
+ following example:
+ </para>
+
+ <programlisting><![CDATA[ @Insert(Customer.class)
+ public void createCustomer() {
+ ...
+ }]]></programlisting>
+
+ <para>
+ In this example, a permission check will be performed for the user to ensure that they have the rights to create
+ new <literal>Customer</literal> objects. The target of the permission check will be <literal>Customer.class</literal>
+ (the actual <literal>java.lang.Class</literal> instance itself), and the action is the lower case representation of the
+ annotation name, which in this example is <literal>insert</literal>.
+ </para>
+
+ <para>
+ It is also possible to annotate the parameters of a component method in the same way. If this is done, then it is
+ not required to specify a permission target (as the parameter value itself will be the target of the permission check):
+ </para>
+
+ <programlisting><![CDATA[ public void updateCustomer(@Update Customer customer) {
+ ...
+ }]]></programlisting>
+
+ <para>
+ To create your own security annotation, you simply need to annotate it with <literal>@PermissionCheck</literal>, for example:
+ </para>
+
+ <programlisting><![CDATA[@Target({METHOD, PARAMETER})
+@Documented
+@Retention(RUNTIME)
+@Inherited
+@PermissionCheck
+public @interface Promote {
+ Class value() default void.class;
+}]]></programlisting>
+
+ <para>
+ If you wish to override the default permisison action name (which is the lower case version of the annotation name) with
+ another value, you can specify it within the <literal>@PermissionCheck</literal> annotation:
+ </para>
+
+ <programlisting><![CDATA[@PermissionCheck("upgrade")]]></programlisting>
+
+
</sect2>
<sect2>
16 years, 6 months
Seam SVN: r8418 - in trunk: examples and 1 other directories.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-06-25 15:47:15 -0400 (Wed, 25 Jun 2008)
New Revision: 8418
Modified:
trunk/build/mail.pom.xml
trunk/build/pdf.pom.xml
trunk/build/root.pom.xml
trunk/examples/build.xml
trunk/src/pdf/org/jboss/seam/pdf/ui/UIList.java
Log:
JBSEAM-3069
Modified: trunk/build/mail.pom.xml
===================================================================
--- trunk/build/mail.pom.xml 2008-06-25 15:55:04 UTC (rev 8417)
+++ trunk/build/mail.pom.xml 2008-06-25 19:47:15 UTC (rev 8418)
@@ -35,6 +35,10 @@
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext-rtf</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -76,4 +80,4 @@
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/build/pdf.pom.xml
===================================================================
--- trunk/build/pdf.pom.xml 2008-06-25 15:55:04 UTC (rev 8417)
+++ trunk/build/pdf.pom.xml 2008-06-25 19:47:15 UTC (rev 8418)
@@ -19,6 +19,10 @@
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext-rtf</artifactId>
+ </dependency>
<dependency>
<groupId>jfree</groupId>
@@ -62,4 +66,4 @@
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-06-25 15:55:04 UTC (rev 8417)
+++ trunk/build/root.pom.xml 2008-06-25 19:47:15 UTC (rev 8418)
@@ -806,7 +806,7 @@
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
- <version>2.0.7</version>
+ <version>2.1.2</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
@@ -825,6 +825,27 @@
</dependency>
<dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext-rtf</artifactId>
+ <version>2.1.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcmail-jdk14</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk14</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.8a</version>
Modified: trunk/examples/build.xml
===================================================================
--- trunk/examples/build.xml 2008-06-25 15:55:04 UTC (rev 8417)
+++ trunk/examples/build.xml 2008-06-25 19:47:15 UTC (rev 8418)
@@ -150,6 +150,7 @@
<fileset id="seam.pdf.jar" dir="${lib.dir}">
<include name="jboss-seam-pdf.jar" if="seam.pdf.lib" />
<include name="itext.jar" if="seam.pdf.lib" />
+ <include name="itext-rtf.jar" if="seam.pdf.lib" />
<include name="jfreechart.jar" if="seam.pdf.lib" />
<include name="jcommon.jar" if="seam.pdf.lib" />
</fileset>
Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UIList.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UIList.java 2008-06-25 15:55:04 UTC (rev 8417)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UIList.java 2008-06-25 19:47:15 UTC (rev 8418)
@@ -72,13 +72,15 @@
if (style.equalsIgnoreCase(STYLE_ROMAN)) {
list = new RomanList((int) indent); // int? bug in text?
if (lowerCase != null) {
- ((RomanList) list).setRomanLower(lowerCase);
+ list.setLowercase(lowerCase);
+ //((RomanList) list).setRomanLower(lowerCase);
}
} else if (style.equalsIgnoreCase(STYLE_GREEK)) {
list = new GreekList((int)indent); // int? bug in itext?
if (lowerCase != null) {
- ((GreekList) list).setGreekLower(lowerCase);
+ list.setLowercase(lowerCase);
+ //((GreekList) list).setGreekLower(lowerCase);
}
} else if (style.equalsIgnoreCase(STYLE_DINGBATS)) {
charNumber = (Integer) valueBinding(context, "charNumber", charNumber);
16 years, 6 months
Seam SVN: r8417 - trunk/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-06-25 11:55:04 -0400 (Wed, 25 Jun 2008)
New Revision: 8417
Modified:
trunk/src/main/org/jboss/seam/Component.java
Log:
JBSEAM-3096
Modified: trunk/src/main/org/jboss/seam/Component.java
===================================================================
--- trunk/src/main/org/jboss/seam/Component.java 2008-06-25 15:42:51 UTC (rev 8416)
+++ trunk/src/main/org/jboss/seam/Component.java 2008-06-25 15:55:04 UTC (rev 8417)
@@ -960,10 +960,12 @@
}
private boolean isInterceptorEnabled(Interceptor interceptor) {
- Class interceptorClass = interceptor.getUserInterceptorClass();
- if (interceptorClass != null) {
- if (Init.instance().getDisabledInterceptors().contains(interceptorClass.getName())) {
- return false;
+ if (Contexts.isApplicationContextActive()) {
+ Class interceptorClass = interceptor.getUserInterceptorClass();
+ if (interceptorClass != null) {
+ if (Init.instance().getDisabledInterceptors().contains(interceptorClass.getName())) {
+ return false;
+ }
}
}
16 years, 6 months
Seam SVN: r8416 - branches/Seam_2_0/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-06-25 11:42:51 -0400 (Wed, 25 Jun 2008)
New Revision: 8416
Modified:
branches/Seam_2_0/src/main/org/jboss/seam/Component.java
Log:
JBSEAM-3096
Modified: branches/Seam_2_0/src/main/org/jboss/seam/Component.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/Component.java 2008-06-25 06:23:27 UTC (rev 8415)
+++ branches/Seam_2_0/src/main/org/jboss/seam/Component.java 2008-06-25 15:42:51 UTC (rev 8416)
@@ -943,13 +943,15 @@
}
private boolean isInterceptorEnabled(Interceptor interceptor) {
- Class interceptorClass = interceptor.getUserInterceptorClass();
- if (interceptorClass != null) {
- if (Init.instance().getDisabledInterceptors().contains(interceptorClass.getName())) {
- return false;
+ if (Contexts.isApplicationContextActive()) {
+ Class interceptorClass = interceptor.getUserInterceptorClass();
+ if (interceptorClass != null) {
+ if (Init.instance().getDisabledInterceptors().contains(interceptorClass.getName())) {
+ return false;
+ }
}
}
-
+
return true;
}
16 years, 6 months
Seam SVN: r8415 - tags.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-06-25 02:23:27 -0400 (Wed, 25 Jun 2008)
New Revision: 8415
Added:
tags/Seam_EAP_4_3_CP04_2/
Log:
tag for EAP 4.2 CP04 and 4.3 CP02 + update of changelog.txt
Copied: tags/Seam_EAP_4_3_CP04_2 (from rev 8414, branches/Seam_1_2_1_AP)
16 years, 6 months
Seam SVN: r8414 - branches/Seam_1_2_1_AP.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-06-25 02:21:35 -0400 (Wed, 25 Jun 2008)
New Revision: 8414
Modified:
branches/Seam_1_2_1_AP/changelog.txt
Log:
updated lists of issues
Modified: branches/Seam_1_2_1_AP/changelog.txt
===================================================================
--- branches/Seam_1_2_1_AP/changelog.txt 2008-06-25 04:20:21 UTC (rev 8413)
+++ branches/Seam_1_2_1_AP/changelog.txt 2008-06-25 06:21:35 UTC (rev 8414)
@@ -5,6 +5,18 @@
Release Notes - JBoss Seam - Version 1.2.1.GA
** Bug
+ * [JBPAPP-738] - itext examples produce xml in Firefox instead of html to redirect
+ * [JBPAPP-759] - Spring files missing between packaged seam jars a built seam jars
+ * [JBPAPP-769] - Seam Spring example throws NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException during deployment
+ * [JBPAPP-770] - Seam Spring example can not change password
+ * [JBPAPP-774] - endless recursion in public class
+ * [JBPAPP-800] - seam hibernate example is missing the el-ri.jar from the war archive
+ * [JBPAPP-801] - seam icefaces throws "Could not instantiate feature[compiler.ExpressionFactory]: org.jboss.seam.ui.facelet.SeamExpressionFactory" when accessed
+ * [JBPAPP-802] - Seam mail deployment exceptions - app still seems to run
+ * [JBPAPP-807] - dvdstore example does not handle invalid orders correctly
+ * [JBPAPP-913] - org.jboss.seam.mock.MockFacesContext should do the cleanup in the release() Method
+ * [JBPAPP-659] - clearing authenticated session
+ * [JBPAPP-638] - adding a page security element in seam-gen
* [JBSEAM-781] - Identity.login is reporting a login failure with a SEVERITY_INFO
* [JBSEAM-822] - XSDs should not have jndi-name for components which are not session beans
* [JBSEAM-835] - After Upload the Conversation id seems to be lost when use a button to move forward from the "upload" screen.
@@ -94,6 +106,13 @@
* [JBSEAM-1071] - Documentation corrections effecting configuration 21.1.5. Don't forget!
** Task
+ * [JBPAPP-755] - Seam source readme.txt need url, and other updates
+ * [JBPAPP-678] - upgrade to JSF RI 1.2
+ * [JBPAPP-676] - duplicated commons-* libraries in examples
+ * [JBPAPP-637] - facelets is upgrade to 1.1.13 GA from snapshot
+ * [JBPAPP-631] - EL integration was rewritten
+ * [JBPAPP-636] - upgrade richfaces and ajax4jsf to GA versions from snapshots
+ * [JBPAPP-634] - upgrade JFreeChart to EAP version
* [JBSEAM-915] - Split remoting stuff into jboss-seam-remoting.jar
* [JBSEAM-924] - Upgrade to MyFaces 1.1.5 and test on Tomcat
* [JBSEAM-973] - Remove dependency on org.jboss.util.NotImplementedException
16 years, 6 months
Seam SVN: r8413 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-06-25 00:20:21 -0400 (Wed, 25 Jun 2008)
New Revision: 8413
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Security.xml
Log:
more restructuring
Modified: trunk/doc/Seam_Reference_Guide/en-US/Security.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-06-24 19:13:55 UTC (rev 8412)
+++ trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-06-25 04:20:21 UTC (rev 8413)
@@ -506,6 +506,21 @@
enabling and disabling user accounts, authenticating users and listing users and roles.
</para>
+ <para>
+ Before it may be used, the <literal>identityManager</literal> must first be configured with one or more
+ <literal>IdentityStore</literal>s. These components do the actual work of interacting with the backend
+ security provider, whether it be a database, LDAP server, or something else.
+ </para>
+
+ <mediaobject>
+ <imageobject role="fo">
+ <imagedata fileref="images/security-identitymanager.png" align="center"/>
+ </imageobject>
+ <imageobject role="html">
+ <imagedata fileref="images/security-identitymanager.png" align="center"/>
+ </imageobject>
+ </mediaobject>
+
<sect2>
<title>Configuring IdentityManager</title>
@@ -1449,7 +1464,7 @@
<para>
Writing your own identity store implementation allows you to authenticate and perform identity management
- operations against sources that aren't supported out of the box by Seam. Only a single class is
+ operations against security providers that aren't supported out of the box by Seam. Only a single class is
required to achieve this, and it must implement the
<literal>org.jboss.seam.security.management.IdentityStore</literal> interface.
</para>
@@ -1473,6 +1488,766 @@
configuration required.
</para>
</sect2>
+
+ <sect2>
+ <title>Using IdentityManager</title>
+
+ <para>
+ The <literal>IdentityManager</literal> can be accessed either by injecting it into your Seam
+ component as follows:
+ </para>
+
+ <programlisting><![CDATA[ @In IdentityManager identityManager;]]></programlisting>
+
+ <para>
+ or by accessing it through its static <literal>instance()</literal> method:
+ </para>
+
+ <programlisting><![CDATA[ IdentityManager identityManager = IdentityManager.instance();]]></programlisting>
+
+ <para>
+ The following table describes <literal>IdentityManager</literal>'s API methods:
+ </para>
+
+ <table>
+ <title>Identity Management API</title>
+
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+
+ <thead>
+ <row>
+ <entry align="center">
+ <para>Method</para>
+ </entry>
+ <entry align="center">
+ <para>Returns</para>
+ </entry>
+ <entry align="center">
+ <para>Description</para>
+ </entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>
+ <para>
+ <literal>createUser(String name, String password)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Creates a new user account, with the specified name and password. Returns <literal>true</literal>
+ if successful, or <literal>false</literal> if not.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>deleteUser(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Deletes the user account with the specified name. Returns <literal>true</literal>
+ if successful, or <literal>false</literal> if not.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>createRole(String role)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Creates a new role, with the specified name. Returns <literal>true</literal>
+ if successful, or <literal>false</literal> if not.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>deleteRole(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Deletes the role with the specified name. Returns <literal>true</literal>
+ if successful, or <literal>false</literal> if not.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>enableUser(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Enables the user account with the specified name. Accounts that are not enabled are
+ not able to authenticate. Returns <literal>true</literal> if successful, or
+ <literal>false</literal> if not.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>disableUser(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Disables the user account with the specified name. Returns <literal>true</literal> if
+ successful, or <literal>false</literal> if not.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>changePassword(String name, String password)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Changes the password for the user account with the specified name. Returns
+ <literal>true</literal> if successful, or <literal>false</literal> if not.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>isUserEnabled(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Returns <literal>true</literal> if the specified user account is enabled, or
+ <literal>false</literal> if it isn't.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>grantRole(String name, String role)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Grants the specified role to the specified user or role. The role must already exist for it to
+ be granted. Returns <literal>true</literal> if the role is successfully granted, or
+ <literal>false</literal> if it is already granted to the user.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>revokeRole(String name, String role)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Revokes the specified role from the specified user or role. Returns <literal>true</literal>
+ if the specified user is a member of the role and it is successfully revoked, or
+ <literal>false</literal> if the user is not a member of the role.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>userExists(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Returns <literal>true</literal> if the specified user exists, or <literal>false</literal>
+ if it doesn't.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>listUsers()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>List</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Returns a list of all user names, sorted in alpha-numeric order.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>listUsers(String filter)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>List</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Returns a list of all user names filtered by the specified filter parameter, sorted in alpha-numeric order.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>listRoles()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>List</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Returns a list of all role names.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>getGrantedRoles(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>List</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Returns a list of the names of all the roles explicitly granted to the specified user name.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>getImpliedRoles(String name)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>List</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Returns a list of the names of all the roles implicitly granted to the specified user name.
+ Implicitly granted roles include those that are not directly granted to a user, rather they are
+ granted to the roles that the user is a member of. For example, is the <literal>admin</literal>
+ role is a member of the <literal>user</literal> role, and a user is a member of the <literal>admin</literal>
+ role, then the implied roles for the user are both the <literal>admin</literal>, and <literal>user</literal>
+ roles.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>authenticate(String name, String password)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Authenticates the specified username and password using the configured Identity Store. Returns
+ <literal>true</literal> if successful or <literal>false</literal> if authentication failed.
+ Successful authentication implies nothing beyond the return value of the method. It does not
+ change the state of the <literal>Identity</literal> component - to perform a proper Seam login the
+ <literal>Identity.login()</literal> must be used instead.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>addRoleToGroup(String role, String group)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Adds the specified role as a member of the specified group. Returns true if the operation is successful.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>removeRoleFromGroup(String role, String group)</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>boolean</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Removes the specified role from the specified group. Returns true if the operation is successful.
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>listRoles()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>List</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Lists the names of all roles.
+ </para>
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ Using the Identity Management API requires that the calling user has the appropriate authorization to invoke
+ its methods. The following table describes the permission requirements for each of the methods in
+ <literal>IdentityManager</literal>. The permission targets listed below are literal String values.
+ </para>
+
+ <table>
+ <title>Identity Management Security Permissions</title>
+
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+
+ <thead>
+ <row>
+ <entry align="center">
+ <para>Method</para>
+ </entry>
+ <entry align="center">
+ <para>Permission Target</para>
+ </entry>
+ <entry align="center">
+ <para>Permission Action</para>
+ </entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>
+ <para>
+ <literal>createUser()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>create</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>deleteUser()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>delete</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>createRole()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.role</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>create</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>deleteRole()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.role</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>delete</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>enableUser()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>update</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>disableUser()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>update</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>changePassword()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>update</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>isUserEnabled()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>read</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>grantRole()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>update</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>revokeRole()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>update</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>userExists()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>read</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>listUsers()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.user</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>read</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>listRoles()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.role</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>read</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>addRoleToGroup()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.role</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>update</literal>
+ </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <literal>removeRoleFromGroup()</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>seam.role</literal>
+ </para>
+ </entry>
+ <entry>
+ <para>
+ <literal>update</literal>
+ </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The following code listing provides an example set of security rules that grants access to all
+ Identity Management-related methods to members of the <literal>admin</literal> role:
+ </para>
+
+ <programlisting><![CDATA[rule ManageUsers
+ no-loop
+ activation-group "permissions"
+when
+ check: PermissionCheck(name == "seam.user", granted == false)
+ Role(name == "admin")
+then
+ check.grant();
+end
+
+rule ManageRoles
+ no-loop
+ activation-group "permissions"
+when
+ check: PermissionCheck(name == "seam.role", granted == false)
+ Role(name == "admin")
+then
+ check.grant();
+end
+]]></programlisting>
+
+ </sect2>
+
</sect1>
<sect1>
@@ -2049,6 +2824,8 @@
the added advantage of providing compile-time safety as they don't support arbitrary EL expressions in the same way
that <literal>@Restrict</literal> does.
</para>
+
+
</sect2>
@@ -2684,883 +3461,9 @@
</sect1>
- <sect1>
- <title>Identity Management</title>
- <para>
- Seam Security provides an optional identity management API, which offers the following features:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- User management - the ability to create, delete and modify user accounts and their role memberships.
- </para>
- </listitem>
- <listitem>
- <para>
- Authentication of users without the need for writing an Authenticator component.
- </para>
- </listitem>
- <listitem>
- <para>
- A hierarchical role/group membership structure, allowing roles to be members of other roles.
- </para>
- </listitem>
- <listitem>
- <para>
- Pluggable identity store, allowing the developer to choose their security provider, whether it be
- JPA, LDAP, Kerberos, etc.
- </para>
- </listitem>
- </itemizedlist>
-
- <para>
- The core of the identity management API is the <literal>IdentityManager</literal> component. Before it can be
- used however, it must be configured with an <literal>IdentityStore</literal> implementation. The
- <literal>IdentityStore</literal> does the actual work of interacting with the underlying security provider,
- whatever it may be.
- </para>
-
- <mediaobject>
- <imageobject role="fo">
- <imagedata fileref="images/security-identitymanager.png" align="center"/>
- </imageobject>
- <imageobject role="html">
- <imagedata fileref="images/security-identitymanager.png" align="center"/>
- </imageobject>
- </mediaobject>
-
- <sect2>
- <title>Configuration</title>
-
- <para>
- Configuration of the <literal>IdentityManager</literal> is extremely simple, requiring only an
- <literal>IdentityStore</literal> to be configured in <literal>components.xml</literal>.
- The identity management namespace is <literal>http://jboss.com/products/seam/security/management</literal>
- and its schema location is <literal>http://jboss.com/products/seam/identity-management-2.1.xsd</literal>.
- Here's a simple example showing the configuration of a <literal>JPAIdentityStore</literal> - for the
- <literal>IdentityManager</literal> to use it, it must be named <literal>identityStore</literal>:
- </para>
-
- <programlisting><![CDATA[
- <identity-management:jpa-identity-store name="identityStore" account-class="com.acme.UserAccount"/>
- ]]></programlisting>
- </sect2>
-
- <sect2>
- <title>JPAIdentityStore</title>
-
- <para>
- <literal>JPAIdentityStore</literal> is an <literal>IdentityStore</literal> implementation that uses
- JPA as its underlying security provider. User accounts and their role memberships are stored in a
- self-referencing database table, for which the corresponding entity bean must extend
- <literal>org.jboss.seam.security.management.UserAccount</literal> to provide the following properties:
- </para>
-
- <mediaobject>
- <imageobject role="fo">
- <imagedata fileref="images/security-useraccount.png" align="center"/>
- </imageobject>
- <imageobject role="html">
- <imagedata fileref="images/security-useraccount.png" align="center"/>
- </imageobject>
- </mediaobject>
-
- <para>
- To provide a complete example, here's what the actual database tables may look like:
- </para>
-
- <mediaobject>
- <imageobject role="fo">
- <imagedata fileref="images/security-useraccountschema.png" align="center"/>
- </imageobject>
- <imageobject role="html">
- <imagedata fileref="images/security-useraccountschema.png" align="center"/>
- </imageobject>
- </mediaobject>
-
- <para>
- And an example of the corresponding entity bean:
- </para>
-
- <programlisting><![CDATA[@Entity @Table(name = "USER_ACCOUNT")
-public class UserAccount extends org.jboss.seam.security.management.UserAccount
- implements Serializable
-{
- private Integer accountId;
- private String username;
- private String passwordHash;
- private boolean enabled;
- private AccountType accountType;
- private Set<UserAccount> memberships;
-
- @Id @GeneratedValue public Integer getAccountId() { return accountId; }
- public void setAccountId(Integer accountId) { this.accountId = accountId; }
-
- @NotNull @Override public String getUsername() { return username; }
- @Override public void setUsername(String username) { this.username = username; }
-
- @Override public String getPasswordHash() { return passwordHash; }
- @Override public void setPasswordHash(String passwordHash) { this.passwordHash = passwordHash; }
-
- @Override public AccountType getAccountType() { return accountType; }
- @Override public void setAccountType(AccountType accountType) { this.accountType = accountType; }
-
- @Override public boolean isEnabled() { return enabled; }
- @Override public void setEnabled(boolean enabled) { this.enabled = enabled; }
-
- @ManyToMany(targetEntity = MemberAccount.class) @JoinTable(name = "ACCOUNT_MEMBERSHIP",
- joinColumns = @JoinColumn(name = "ACCOUNT_ID"),
- inverseJoinColumns = @JoinColumn(name = "MEMBER_OF"))
- @Override public Set<UserAccount> getMemberships() { return memberships; }
- @Override public void setMemberships(Set<UserAccount> memberships) { this.memberships = memberships; }}]]></programlisting>
-
- <para>
- In the above example, the implementation of <literal>UserAccount</literal> is self-referencing
- in that it has a many-to-many relationship with itself via its <literal>memberships</literal>
- property. To keep the model simple, both user accounts and roles are persisted as
- <literal>UserAccount</literal>s, with the <literal>accountType</literal> property acting as the
- discriminator between the two. With this model, roles can be members of other roles, making it
- possible to define complex role membership hierarchies.
- </para>
-
- <para>
- Once the <literal>UserAccount</literal> implementation has been created, the <literal>JPAIdentityStore</literal>
- must be configured to use that implementation any time it performs an identity management operation.
- This is done by specifying the <literal>account-class</literal> property in <literal>components.xml</literal>.
- In the following example, it is configured as <literal>com.acme.UserAccount</literal>:
- </para>
-
- <programlisting><![CDATA[
- <identity-management:jpa-identity-store name="identityStore" account-class="com.acme.UserAccount"/>]]></programlisting>
-
- <para>
- Please note that this is a required parameter, and must always be specified when using the
- <literal>JPAIdentityStore</literal>.
- </para>
-
- <sect3>
- <title>Password hashing</title>
-
- <para>
- The <literal>JPAIdentityStore</literal> stores a salted hash of the user's password, using the username
- as the source material for salt generation. This guarantees that two users with the same password will
- still have different password hashes. The method for generating a password hash is listed here for
- convenience - it may be useful for generating password hashes for inclusion in DML scripts, etc:
- </para>
-
- <programlisting><![CDATA[
- public String hashPassword(String password, String saltPhrase)
- {
- try {
- MessageDigest md = MessageDigest.getInstance("MD5");
-
- md.update(saltPhrase.getBytes());
- byte[] salt = md.digest();
-
- md.reset();
- md.update(password.getBytes("UTF-8"));
- md.update(salt);
-
- byte[] raw = md.digest();
-
- return new String(Hex.encodeHex(raw));
- }
- catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- ]]></programlisting>
- </sect3>
-
- </sect2>
-
- <sect2>
- <title>Authentication with the Identity Management API</title>
-
- <para>
- To authenticate using the Identity Management API, it is as simple as not specifying the
- <literal>authenticate-method</literal> property for the <literal>Identity</literal> component.
- If no <literal>authenticate-method</literal> is specified, then by default the authentication
- process (controlled by <literal>SeamLoginModule</literal>) will attempt to authenticate using
- <literal>IdentityManager</literal>'s <literal>authenticate()</literal> method, and no
- Authenticator component is necessary.
- </para>
- </sect2>
-
- <sect2>
- <title>Using the IdentityManager API</title>
-
- <para>
- The <literal>IdentityManager</literal> can be accessed either by injecting it into your Seam
- component as follows:
- </para>
-
- <programlisting><![CDATA[ @In IdentityManager identityManager;]]></programlisting>
-
- <para>
- or by accessing it through its static <literal>instance()</literal> method:
- </para>
-
- <programlisting><![CDATA[ IdentityManager identityManager = IdentityManager.instance();]]></programlisting>
-
- <para>
- The following table describes each of the methods that <literal>IdentityManager</literal> provides:
- </para>
-
- <table>
- <title>Identity Management API</title>
-
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*" />
- <colspec colnum="2" colwidth="3*" />
-
- <thead>
- <row>
- <entry align="center">
- <para>Method</para>
- </entry>
- <entry align="center">
- <para>Returns</para>
- </entry>
- <entry align="center">
- <para>Description</para>
- </entry>
- </row>
- </thead>
-
- <tbody>
-
- <row>
- <entry>
- <para>
- <literal>createUser(String name, String password)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Creates a new user account, with the specified name and password. Returns <literal>true</literal>
- if successful, or <literal>false</literal> if not.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>deleteUser(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Deletes the user account with the specified name. Returns <literal>true</literal>
- if successful, or <literal>false</literal> if not.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>createRole(String role)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Creates a new role, with the specified name. Returns <literal>true</literal>
- if successful, or <literal>false</literal> if not.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>deleteRole(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Deletes the role with the specified name. Returns <literal>true</literal>
- if successful, or <literal>false</literal> if not.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>enableUser(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Enables the user account with the specified name. Accounts that are not enabled are
- not able to authenticate. Returns <literal>true</literal> if successful, or
- <literal>false</literal> if not.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>disableUser(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Disables the user account with the specified name. Returns <literal>true</literal> if
- successful, or <literal>false</literal> if not.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>changePassword(String name, String password)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Changes the password for the user account with the specified name. Returns
- <literal>true</literal> if successful, or <literal>false</literal> if not.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>isUserEnabled(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Returns <literal>true</literal> if the specified user account is enabled, or
- <literal>false</literal> if it isn't.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>grantRole(String name, String role)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Grants the specified role to the specified user or role. The role must already exist for it to
- be granted. Returns <literal>true</literal> if the role is successfully granted, or
- <literal>false</literal> if it is already granted to the user.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>revokeRole(String name, String role)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Revokes the specified role from the specified user or role. Returns <literal>true</literal>
- if the specified user is a member of the role and it is successfully revoked, or
- <literal>false</literal> if the user is not a member of the role.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>userExists(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Returns <literal>true</literal> if the specified user exists, or <literal>false</literal>
- if it doesn't.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>listUsers()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>List</literal>
- </para>
- </entry>
- <entry>
- <para>
- Returns a list of all user names, sorted in alpha-numeric order.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>listUsers(String filter)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>List</literal>
- </para>
- </entry>
- <entry>
- <para>
- Returns a list of all user names filtered by the specified filter parameter, sorted in alpha-numeric order.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>listRoles()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>List</literal>
- </para>
- </entry>
- <entry>
- <para>
- Returns a list of all role names.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>getGrantedRoles(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>List</literal>
- </para>
- </entry>
- <entry>
- <para>
- Returns a list of the names of all the roles explicitly granted to the specified user name.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>getImpliedRoles(String name)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>List</literal>
- </para>
- </entry>
- <entry>
- <para>
- Returns a list of the names of all the roles implicitly granted to the specified user name.
- Implicitly granted roles include those that are not directly granted to a user, rather they are
- granted to the roles that the user is a member of. For example, is the <literal>admin</literal>
- role is a member of the <literal>user</literal> role, and a user is a member of the <literal>admin</literal>
- role, then the implied roles for the user are both the <literal>admin</literal>, and <literal>user</literal>
- roles.
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>authenticate(String name, String password)</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>boolean</literal>
- </para>
- </entry>
- <entry>
- <para>
- Authenticates the specified username and password using the configured Identity Store. Returns
- <literal>true</literal> if successful or <literal>false</literal> if authentication failed.
- Successful authentication implies nothing beyond the return value of the method. It does not
- change the state of the <literal>Identity</literal> component - to perform a proper Seam login the
- <literal>Identity.login()</literal> must be used instead.
- </para>
- </entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- Using the Identity Management API requires that the calling user has the appropriate authorization to invoke
- its methods. The following table describes the permission requirements for each of the methods in
- <literal>IdentityManager</literal>.
- </para>
-
- <table>
- <title>Identity Management Security Permissions</title>
-
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*" />
- <colspec colnum="2" colwidth="3*" />
-
- <thead>
- <row>
- <entry align="center">
- <para>Method</para>
- </entry>
- <entry align="center">
- <para>Permission Name</para>
- </entry>
- <entry align="center">
- <para>Permission Action</para>
- </entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>
- <para>
- <literal>createUser()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>create</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>deleteUser()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>delete</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>createRole()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>create</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>deleteRole()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>delete</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>enableUser()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>update</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>disableUser()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>update</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>changePassword()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>update</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>isUserEnabled()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>read</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>grantRole()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>update</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>revokeRole()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>update</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>userExists()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>read</literal>
- </para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>listUsers()</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>seam.account</literal>
- </para>
- </entry>
- <entry>
- <para>
- <literal>read</literal>
- </para>
- </entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- The following code listing provides an example set of security rules that grants access to all
- Identity Management-related methods to members of the <literal>admin</literal> role:
- </para>
-
- <programlisting><![CDATA[rule CreateAccount
- no-loop
- activation-group "permissions"
-when
- check: PermissionCheck(name == "seam.account", action == "create", granted == false)
- Role(name == "admin")
-then
- check.grant();
-end
-
-rule ReadAccount
- no-loop
- activation-group "permissions"
-when
- check: PermissionCheck(name == "seam.account", action == "read", granted == false)
- Role(name == "admin")
-then
- check.grant();
-end
-
-rule UpdateAccount
- no-loop
- activation-group "permissions"
-when
- check: PermissionCheck(name == "seam.account", action == "update", granted == false)
- Role(name == "admin")
-then
- check.grant();
-end
-
-rule DeleteAccount
- no-loop
- activation-group "permissions"
-when
- check: PermissionCheck(name == "seam.account", action == "delete", granted == false)
- Role(name == "admin")
-then
- check.grant();
-end]]></programlisting>
-
- </sect2>
-
- <sect2>
+
+ <sect1>
<title>Seam-gen and Identity Management</title>
<para>
@@ -3594,8 +3497,6 @@
</mediaobject>
- </sect2>
+ </sect1>
- </sect1>
-
</chapter>
16 years, 6 months
Seam SVN: r8412 - tags.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-06-24 15:13:55 -0400 (Tue, 24 Jun 2008)
New Revision: 8412
Added:
tags/Seam_EAP_4_3_CP04_1/
Log:
tag for EAP 4.2 CP04 and 4.3 CP02
Copied: tags/Seam_EAP_4_3_CP04_1 (from rev 8411, branches/Seam_1_2_1_AP)
16 years, 6 months
Seam SVN: r8411 - in branches/Seam_1_2_1_AP/examples/icefaces: src/org/jboss/seam/example/booking and 1 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-06-24 12:28:14 -0400 (Tue, 24 Jun 2008)
New Revision: 8411
Removed:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/navigation.xml
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedIn.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedInInterceptor.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Login.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoginAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Logout.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LogoutAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingUnitTest.java
Log:
JBPAPP-801
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/navigation.xml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/navigation.xml 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/navigation.xml 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE faces-config
- PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
-
-<faces-config>
-
- <navigation-rule>
- <from-view-id>/home.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>main</from-outcome>
- <to-view-id>/main.xhtml</to-view-id>
- <redirect/>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <from-view-id>/hotel.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>main</from-outcome>
- <to-view-id>/main.xhtml</to-view-id>
- <redirect/>
- </navigation-case>
- </navigation-rule>
-
-
- <navigation-rule>
-
- <navigation-case>
- <from-outcome>login</from-outcome>
- <to-view-id>/home.xhtml</to-view-id>
- <redirect />
- </navigation-case>
-
- <navigation-case>
- <from-outcome>register</from-outcome>
- <to-view-id>/register.xhtml</to-view-id>
- <redirect />
- </navigation-case>
-
- <navigation-case>
- <from-outcome>password</from-outcome>
- <to-view-id>/password.xhtml</to-view-id>
- <redirect />
- </navigation-case>
-
- <navigation-case>
- <from-outcome>main</from-outcome>
- <to-view-id>/main.xhtml</to-view-id>
- </navigation-case>
-
- <navigation-case>
- <from-outcome>hotel</from-outcome>
- <to-view-id>/hotel.xhtml</to-view-id>
- <redirect />
- </navigation-case>
-
- </navigation-rule>
-
- <navigation-rule>
-
- <from-view-id>/hotel.xhtml</from-view-id>
-
- <navigation-case>
- <from-outcome>book</from-outcome>
- <to-view-id>/book.xhtml</to-view-id>
- <redirect />
- </navigation-case>
-
- </navigation-rule>
-
- <navigation-rule>
-
- <from-view-id>/book.xhtml</from-view-id>
-
- <navigation-case>
- <from-outcome>confirm</from-outcome>
- <to-view-id>/confirm.xhtml</to-view-id>
- <redirect />
- </navigation-case>
-
- </navigation-rule>
-
- <navigation-rule>
-
- <from-view-id>/confirm.xhtml</from-view-id>
-
- <navigation-case>
- <from-outcome>confirmed</from-outcome>
- <to-view-id>/main.xhtml</to-view-id>
- <redirect/>
- </navigation-case>
-
- <navigation-case>
- <from-outcome>back</from-outcome>
- <to-view-id>/book.xhtml</to-view-id>
- <redirect />
- </navigation-case>
-
- </navigation-rule>
-
-</faces-config>
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedIn.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedIn.java 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedIn.java 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,17 +0,0 @@
-//$Id$
-package org.jboss.seam.example.booking;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.interceptor.Interceptors;
-
-@Target(TYPE)
-@Retention(RUNTIME)
-@Documented
-(a)Interceptors(LoggedInInterceptor.class)
-public @interface LoggedIn {}
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedInInterceptor.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedInInterceptor.java 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoggedInInterceptor.java 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,61 +0,0 @@
-//$Id$
-package org.jboss.seam.example.booking;
-
-import java.lang.reflect.Method;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-import javax.faces.event.PhaseId;
-
-import org.jboss.seam.annotations.Interceptor;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.Lifecycle;
-import org.jboss.seam.interceptors.BijectionInterceptor;
-import org.jboss.seam.interceptors.BusinessProcessInterceptor;
-import org.jboss.seam.interceptors.ConversationInterceptor;
-import org.jboss.seam.interceptors.RemoveInterceptor;
-import org.jboss.seam.interceptors.ValidationInterceptor;
-
-(a)Interceptor(around={BijectionInterceptor.class, ValidationInterceptor.class,
- ConversationInterceptor.class, BusinessProcessInterceptor.class},
- within=RemoveInterceptor.class)
-public class LoggedInInterceptor
-{
-
- @AroundInvoke
- public Object checkLoggedIn(InvocationContext invocation) throws Exception
- {
- boolean isLoggedIn = Contexts.getSessionContext().get("loggedIn")!=null;
- if ( Lifecycle.getPhaseId()==PhaseId.INVOKE_APPLICATION )
- {
- if (isLoggedIn)
- {
- return invocation.proceed();
- }
- else
- {
- return "login";
- }
- }
- else
- {
- if ( isLoggedIn )
- {
- return invocation.proceed();
- }
- else
- {
- Method method = invocation.getMethod();
- if ( method.getReturnType().equals(void.class) )
- {
- return null;
- }
- else
- {
- return method.invoke( invocation.getTarget(), invocation.getParameters() );
- }
- }
- }
- }
-
-}
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Login.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Login.java 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Login.java 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,10 +0,0 @@
-//$Id$
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
-@Local
-public interface Login
-{
- public String login();
-}
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoginAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoginAction.java 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LoginAction.java 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,49 +0,0 @@
-//$Id$
-package org.jboss.seam.example.booking;
-
-import java.util.List;
-
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.FacesMessages;
-
-@Stateless
-@Name("login")
-public class LoginAction implements Login
-{
-
- @In @Out
- private User user;
-
- @PersistenceContext
- private EntityManager em;
-
- public String login()
- {
- List<User> results = em.createQuery("select u from User u where u.username=:username and u.password=:password")
- .setParameter("username", user.getUsername())
- .setParameter("password", user.getPassword())
- .getResultList();
-
- if ( results.size()==0 )
- {
- FacesMessages.instance().add("Invalid login");
- return "login";
- }
- else
- {
- user = results.get(0);
- Contexts.getSessionContext().set("loggedIn", true);
- FacesMessages.instance().add("Welcome, #{user.name}");
- return "main";
- }
-
- }
-
-}
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Logout.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Logout.java 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Logout.java 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,10 +0,0 @@
-//$Id$
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
-@Local
-public interface Logout
-{
- public String logout();
-}
\ No newline at end of file
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LogoutAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LogoutAction.java 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/LogoutAction.java 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,19 +0,0 @@
-//$Id$
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Stateless;
-
-import org.jboss.seam.Seam;
-import org.jboss.seam.annotations.Name;
-
-@Stateless
-@LoggedIn
-@Name("logout")
-public class LogoutAction implements Logout
-{
- public String logout()
- {
- Seam.invalidateSession();
- return "login";
- }
-}
Deleted: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingUnitTest.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingUnitTest.java 2008-06-24 16:20:32 UTC (rev 8410)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingUnitTest.java 2008-06-24 16:28:14 UTC (rev 8411)
@@ -1,86 +0,0 @@
-package org.jboss.seam.example.booking.test;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.jboss.seam.core.Events;
-import org.jboss.seam.core.FacesMessages;
-import org.jboss.seam.example.booking.Booking;
-import org.jboss.seam.example.booking.Hotel;
-import org.jboss.seam.example.booking.HotelBooking;
-import org.jboss.seam.example.booking.HotelBookingAction;
-import org.jboss.seam.example.booking.HotelSearching;
-import org.jboss.seam.example.booking.HotelSearchingAction;
-import org.jboss.seam.example.booking.User;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
-
-public class BookingUnitTest extends SeamTest
-{
-
- @Test
- public void testHotelSearching() throws Exception
- {
- EntityManagerFactory emf = Persistence.createEntityManagerFactory("bookingDatabase");
-
- EntityManager em = emf.createEntityManager();
-
- HotelSearching hs = new HotelSearchingAction();
-
- setField(hs, "em", em);
-
- hs.setSearchString("atlanta");
- hs.find();
-
- List<Hotel> hotels = (List<Hotel>) getField(hs, "hotels");
- assert hotels!=null;
- assert hotels.size()==3;
-
- em.close();
- }
-
- @Test
- public void testHotelBooking() throws Exception
- {
- EntityManagerFactory emf = Persistence.createEntityManagerFactory("bookingDatabase");
- final EntityManager em = emf.createEntityManager();
-
- Hotel hotel = em.getReference(Hotel.class, 1l);
-
- HotelBooking hb = new HotelBookingAction();
-
- setField(hb, "em", em);
- //setField(hb, "hotelSearch", hs);
- setField(hb, "user", em.getReference(User.class, "gavin"));
- setField(hb, "facesMessages", new FacesMessages());
- setField(hb, "events", new Events() { @Override public void raiseEvent(String type, Object... params) { assert "bookingConfirmed".equals(type); } } );
- setField(hb, "log", Logging.getLog(HotelBookingAction.class));
-
- assert hb.selectHotel(hotel).equals("hotel");
-
- User user = em.getReference(User.class, "gavin");
- assert user!=null;
- assert hb.bookHotel().equals("book");
-
- Booking booking = (Booking) getField(hb, "booking");
- assert booking!=null;
- assert booking.getHotel()!=null;
- assert booking.getUser()!=null;
-
- booking.setCreditCard("1234123412341234");
- booking.setCreditCardName("GAVIN A KING");
-
- assert hb.setBookingDetails().equals("confirm");
-
- getUserTransaction().begin();
- assert hb.confirm().equals("confirmed");
- getUserTransaction().commit();
-
- em.close();
- }
-
-}
16 years, 6 months
Seam SVN: r8410 - in branches/Seam_1_2_1_AP/examples/icefaces: resources and 8 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-06-24 12:20:32 -0400 (Tue, 24 Jun 2008)
New Revision: 8410
Added:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/backport-util-concurrent.jar
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java
branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css
branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css
branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-next.png
branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-prev.png
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/build.xml
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/commons-fileupload.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-comps.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-facelets.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml
branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css
branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml
Log:
JBPAPP-801, JBPAPP-477 - rewriten whole icefaces example
Modified: branches/Seam_1_2_1_AP/examples/icefaces/build.xml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/build.xml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/build.xml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -14,7 +14,7 @@
<property name="src.test.dir" value="src"/>
<property name="test.classpath" value="test.eejb.classpath"/>
<property name="tomcat.conf" value="eejb.conf"/>
-
+ <property name="example.commons.lib" value="yes"/>
<property name="example.commons-digester.lib" value="yes"/>
<import file="../../build.xml"/>
Added: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,74 @@
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be a number
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character
+javax.faces.convert.DateTimeConverter.CONVERSION = Conversion Error
+javax.faces.convert.DateTimeConverter.CONVERSION_detail = "{1}": Specified value is not a valid date/time.
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be a number
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be a number between -2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be a number
+javax.faces.converter.LongConverter.LONG_detail=must be a number between -9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be a number
+javax.faces.converter.ShortConverter.SHORT_detail=value must be a number between -32768 and 32767
+
+#JSF 1.1:
+javax.faces.convert.BigDecimalConverter.CONVERSION = value must be a number
+javax.faces.convert.BigDecimalConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.BigIntegerConverter.CONVERSION = value must be an integre
+javax.faces.convert.BigIntegerConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.BooleanConverter.CONVERSION = value must be true or false
+javax.faces.convert.BooleanConverter.CONVERSION_detail = value must be true or false
+javax.faces.convert.ByteConverter.CONVERSION = value must be a byte
+javax.faces.convert.ByteConverter.CONVERSION_detail = value must be a byte
+javax.faces.convert.CharacterConverter.CONVERSION = value must be a character
+javax.faces.convert.CharacterConverter.CONVERSION_detail = value must be a character
+javax.faces.convert.DateTimeConverter.CONVERSION = value must be a datetime
+javax.faces.convert.DateTimeConverter.CONVERSION_detail = value must be a datetime
+javax.faces.convert.DoubleConverter.CONVERSION = value must be a number
+javax.faces.convert.DoubleConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.FloatConverter.CONVERSION = value must be a number
+javax.faces.convert.FloatConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.IntegerConverter.CONVERSION = value must be an integer
+javax.faces.convert.IntegerConverter.CONVERSION_detail = value must be an integer
+javax.faces.convert.LongConverter.CONVERSION = value must be an integer
+javax.faces.convert.LongConverter.CONVERSION_detail = value must be a long integer
+javax.faces.convert.NumberConverter.CONVERSION = value must be a number
+javax.faces.convert.NumberConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.ShortConverter.CONVERSION = value must be an integer
+javax.faces.convert.ShortConverter.CONVERSION_detail = value must be a short integer
+
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/backport-util-concurrent.jar
===================================================================
(Binary files differ)
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/backport-util-concurrent.jar
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Modified: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/commons-fileupload.jar
===================================================================
(Binary files differ)
Modified: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-comps.jar
===================================================================
(Binary files differ)
Modified: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-facelets.jar
===================================================================
(Binary files differ)
Modified: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces.jar
===================================================================
(Binary files differ)
Modified: branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,22 +1,22 @@
insert into Customer (username, password, name) values ('gavin', 'foobar', 'Gavin King')
insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User')
-insert into Hotel (id, name, address, city, state, zip, country) values (1, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (2, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (3, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (4, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (5, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (6, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (8, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (9, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (10, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (11, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (12, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
-insert into Hotel (id, name, address, city, state, zip, country) values (13, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
-insert into Hotel (id, name, address, city, state, zip, country) values (14, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
-insert into Hotel (id, name, address, city, state, zip, country) values (15, 'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
-insert into Hotel (id, name, address, city, state, zip, country) values (16, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
-insert into Hotel (id, name, address, city, state, zip, country) values (17, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
-insert into Hotel (id, name, address, city, state, zip, country) values (18, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (19, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
-insert into Hotel (id, name, address, city, state, zip, country) values (20, 'Meli� White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
-insert into Hotel (id, name, address, city, state, zip, country) values (21, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130, 'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250, 'Meli� White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')
Added: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,9 @@
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+@Local
+public interface Authenticator
+{
+ boolean authenticate();
+}
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,39 @@
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.util.List;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+@Stateless
+@Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+ @PersistenceContext EntityManager em;
+
+ @Out(required=false, scope = SESSION)
+ private User user;
+
+ public boolean authenticate()
+ {
+ List results = em.createQuery("select u from User u where u.username=#{identity.username} and u.password=#{identity.password}")
+ .getResultList();
+
+ if ( results.size()==0 )
+ {
+ return false;
+ }
+ else
+ {
+ user = (User) results.get(0);
+ return true;
+ }
+ }
+
+}
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,7 +1,8 @@
-//$Id: Booking.java,v 1.11 2006/10/25 15:31:57 gavin Exp $
+//$Id: Booking.java 3028 2006-12-16 14:38:42Z gavin $
package org.jboss.seam.example.booking;
import java.io.Serializable;
+import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Date;
@@ -42,7 +43,19 @@
this.hotel = hotel;
this.user = user;
}
+
+ @Transient
+ public BigDecimal getTotal()
+ {
+ return hotel.getPrice().multiply( new BigDecimal( getNights() ) );
+ }
+ @Transient
+ public int getNights()
+ {
+ return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / 1000 / 60 / 60 / 24;
+ }
+
@Id @GeneratedValue
public Long getId()
{
@@ -112,7 +125,7 @@
public String getDescription()
{
DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
- return hotel.getName() +
+ return hotel==null ? null : hotel.getName() +
", " + df.format( getCheckinDate() ) +
" to " + df.format( getCheckoutDate() );
}
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: BookingList.java,v 1.2 2006/11/20 18:03:01 gavin Exp $
+//$Id: BookingList.java 3036 2006-12-17 01:07:25Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -7,6 +7,7 @@
public interface BookingList
{
public void getBookings();
- public String cancel();
+ public Booking getBooking();
+ public void cancel();
public void destroy();
}
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,39 +1,34 @@
-//$Id: BookingListAction.java,v 1.2 2006/11/20 18:03:01 gavin Exp $
+//$Id: BookingListAction.java 3830 2007-02-13 03:49:42Z sbryzak2 $
package org.jboss.seam.example.booking;
-
import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
import static org.jboss.seam.ScopeType.SESSION;
-
import java.io.Serializable;
import java.util.List;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.ejb.TransactionAttribute;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.core.FacesMessages;
import org.jboss.seam.log.Log;
-
@Stateful
@Scope(SESSION)
@Name("bookingList")
-@LoggedIn
+@Restrict("#{identity.loggedIn}")
@TransactionAttribute(REQUIRES_NEW)
public class BookingListAction implements BookingList, Serializable
{
-
+ private static final long serialVersionUID = 1L;
@PersistenceContext
private EntityManager em;
@@ -43,7 +38,6 @@
@DataModel
private List<Booking> bookings;
@DataModelSelection
- @Out(required=false)
private Booking booking;
@Logger
@@ -58,17 +52,20 @@
.getResultList();
}
- public String cancel()
+ public void cancel()
{
- log.info("Cancel booking: #0 for #{user.username}", booking.getId());
+ log.info("Cancel booking: #{bookingList.booking.id} for #{user.username}");
Booking cancelled = em.find(Booking.class, booking.getId());
if (cancelled!=null) em.remove( cancelled );
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number #{booking.id}");
- return "main";
+ FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
}
+ public Booking getBooking()
+ {
+ return booking;
+ }
+
@Destroy @Remove
public void destroy() {}
-
}
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: ChangePassword.java,v 1.2 2005/09/10 16:23:35 gavin Exp $
+//$Id: ChangePassword.java 3036 2006-12-17 01:07:25Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -6,8 +6,8 @@
@Local
public interface ChangePassword
{
- public String changePassword();
- public String cancel();
+ public void changePassword();
+ public boolean isChanged();
public String getVerify();
public void setVerify(String verify);
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,27 +1,23 @@
-//$Id: ChangePasswordAction.java,v 1.15 2006/04/27 23:04:47 gavin Exp $
+//$Id: ChangePasswordAction.java 3830 2007-02-13 03:49:42Z sbryzak2 $
package org.jboss.seam.example.booking;
-
import static org.jboss.seam.ScopeType.EVENT;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.core.FacesMessages;
-
@Stateful
@Scope(EVENT)
@Name("changePassword")
-@LoggedIn
+@Restrict("#{identity.loggedIn}")
public class ChangePasswordAction implements ChangePassword
{
-
@In @Out
private User user;
@@ -30,39 +26,40 @@
private String verify;
- public String changePassword()
+ private boolean changed;
+
+ @In
+ private FacesMessages facesMessages;
+
+ public void changePassword()
{
if ( user.getPassword().equals(verify) )
{
user = em.merge(user);
- FacesMessages.instance().add("Password updated");
- return "main";
+ facesMessages.add("Password updated");
+ changed = true;
}
else
{
- FacesMessages.instance().add("verify", "Re-enter new password");
+ facesMessages.addToControl("verify", "Re-enter new password");
revertUser();
verify=null;
- return null;
}
}
- public String cancel()
+ public boolean isChanged()
{
- revertUser();
- return "main";
+ return changed;
}
-
+
private void revertUser()
{
user = em.find(User.class, user.getUsername());
}
-
public String getVerify()
{
return verify;
}
-
public void setVerify(String verify)
{
this.verify = verify;
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,8 +1,10 @@
-//$Id: Hotel.java,v 1.10 2006/10/25 15:31:57 gavin Exp $
+//$Id: Hotel.java 3009 2006-12-15 13:26:33Z gavin $
package org.jboss.seam.example.booking;
import java.io.Serializable;
+import java.math.BigDecimal;
+import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@@ -22,6 +24,7 @@
private String state;
private String zip;
private String country;
+ private BigDecimal price;
@Id @GeneratedValue
public Long getId()
@@ -88,12 +91,21 @@
{
return country;
}
-
public void setCountry(String country)
{
this.country = country;
}
+ @Column(precision=6, scale=2)
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ public void setPrice(BigDecimal price)
+ {
+ this.price = price;
+ }
+
@Override
public String toString()
{
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: HotelBooking.java,v 1.11 2006/09/28 01:16:05 gavin Exp $
+//$Id: HotelBooking.java 3036 2006-12-17 01:07:25Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -6,15 +6,17 @@
@Local
public interface HotelBooking
{
- public String selectHotel(Hotel selectedHotel);
+ public void selectHotel(Hotel selectedHotel);
- public String bookHotel();
+ public void bookHotel();
- public String setBookingDetails();
+ public void setBookingDetails();
+ public boolean isBookingValid();
- public String confirm();
- public String cancel();
+ public void confirm();
+ public void cancel();
+
public void destroy();
}
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,15 +1,11 @@
-//$Id: HotelBookingAction.java,v 1.2 2006/11/20 09:22:11 gavin Exp $
+//$Id: HotelBookingAction.java 4306 2007-03-09 01:18:21Z gavin $
package org.jboss.seam.example.booking;
-
import static javax.persistence.PersistenceContextType.EXTENDED;
-
import java.util.Calendar;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.End;
@@ -17,13 +13,13 @@
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.core.Events;
import org.jboss.seam.core.FacesMessages;
import org.jboss.seam.log.Log;
-
@Stateful
@Name("hotelBooking")
-@LoggedIn
+@Restrict("#{identity.loggedIn}")
public class HotelBookingAction implements HotelBooking
{
@@ -33,8 +29,7 @@
@In
private User user;
- @In(required=false)
- @Out(required=false)
+ @In(required=false) @Out
private Hotel hotel;
@In(required=false)
@@ -50,65 +45,59 @@
@Logger
private Log log;
+ private boolean bookingValid;
+
@Begin
- public String selectHotel(Hotel selectedHotel)
+ public void selectHotel(Hotel selectedHotel)
{
hotel = em.merge(selectedHotel);
- return "hotel";
}
- public String bookHotel()
+ public void bookHotel()
{
booking = new Booking(hotel, user);
Calendar calendar = Calendar.getInstance();
booking.setCheckinDate( calendar.getTime() );
calendar.add(Calendar.DAY_OF_MONTH, 1);
booking.setCheckoutDate( calendar.getTime() );
-
- return "book";
}
-
- public String setBookingDetails()
+ public void setBookingDetails()
{
- if (booking==null || hotel==null) return "main";
-
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
if ( booking.getCheckinDate().before( calendar.getTime() ) )
{
- facesMessages.add("Check in date must be a future date");
- return null;
+ facesMessages.addToControl("checkinDate", "Check in date must be a future date");
+ bookingValid=false;
}
else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
{
- facesMessages.add("Check out date must be later than check in date");
- return null;
+ facesMessages.addToControl("checkoutDate", "Check out date must be later than check in date");
+ bookingValid=false;
}
else
{
- return "confirm";
+ bookingValid=true;
}
}
-
+
+ public boolean isBookingValid()
+ {
+ return bookingValid;
+ }
+
@End
- public String confirm()
+ public void confirm()
{
- if (booking==null || hotel==null) return "main";
em.persist(booking);
facesMessages.add("Thank you, #{user.name}, your confimation number for #{hotel.name} is #{booking.id}");
log.info("New booking: #{booking.id} for #{user.username}");
- events.raiseEvent("bookingConfirmed");
- return "confirmed";
+ events.raiseTransactionSuccessEvent("bookingConfirmed");
}
@End
- public String cancel()
- {
- System.out.println("Cancelling hotel booking. ");
- return "main";
- }
+ public void cancel() {}
@Destroy @Remove
public void destroy() {}
-
}
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,11 +1,8 @@
-//$Id: HotelSearching.java,v 1.3 2006/11/20 16:54:53 gavin Exp $
+//$Id: HotelSearching.java 4127 2007-02-25 19:09:39Z gavin $
package org.jboss.seam.example.booking;
-import java.util.List;
-
import javax.ejb.Local;
import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
@Local
public interface HotelSearching
@@ -15,15 +12,16 @@
public String getSearchString();
public void setSearchString(String searchString);
- public void handleSearchStringChange(ValueChangeEvent e);
- public void handlePageSizeChange(ValueChangeEvent e);
- public SelectItem[] getPageSizes();
- public List<SelectItem> getCities();
- public String find();
- public String nextPage();
+ public String getSearchPattern();
+
+ public void find();
+ public void nextPage();
public boolean isNextPageAvailable();
+
+ public void handleSearchStringChange(ValueChangeEvent e);
+ public void handlePageSizeChange(ValueChangeEvent e);
public void destroy();
-}
+}
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,25 +1,24 @@
-//$Id: HotelSearchingAction.java,v 1.4 2006/11/20 18:03:01 gavin Exp $
+//$Id: HotelSearchingAction.java 4127 2007-02-25 19:09:39Z gavin $
package org.jboss.seam.example.booking;
-
import java.util.List;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;
-
+import org.jboss.seam.annotations.security.Restrict;
@Stateful
@Name("hotelSearch")
@Scope(ScopeType.SESSION)
-@LoggedIn
+@Restrict("#{identity.loggedIn}")
public class HotelSearchingAction implements HotelSearching
{
@@ -33,83 +32,68 @@
@DataModel
private List<Hotel> hotels;
- public String find()
+ public void find()
{
page = 0;
- queryHotels();
- return "main";
+ queryHotels();
}
-
- public String nextPage()
+ public void nextPage()
{
page++;
queryHotels();
- return "main";
}
-
+
+ public void handleSearchStringChange(ValueChangeEvent e) {
+ page = 0;
+ setSearchString( (String) e.getNewValue() );
+ queryHotels();
+ }
+
+ public void handlePageSizeChange(ValueChangeEvent e) {
+ page=0;
+ setPageSize( (Integer) e.getNewValue() );
+ queryHotels();
+ }
+
private void queryHotels()
{
- hotels = em.createQuery("select h from Hotel h where lower(h.name) like :search or lower(h.city) like :search or lower(h.zip) like :search or lower(h.address) like :search")
- .setParameter( "search", getSearchPattern() )
+ hotels = em.createQuery("select h from Hotel h where lower(h.name) like #{pattern} or lower(h.city) like #{pattern} or lower(h.zip) like #{pattern} or lower(h.address) like #{pattern}")
.setMaxResults(pageSize)
.setFirstResult( page * pageSize )
.getResultList();
+
}
-
- private String getSearchPattern()
- {
- return searchString==null ? "%" : searchString.toLowerCase().replace('*', '%') + '%';
- }
public boolean isNextPageAvailable()
{
- return hotels!=null && hotels.size()==pageSize;
+ return (hotels!=null && hotels.size()==pageSize);
}
- public SelectItem[] getPageSizes() {
- return new SelectItem[] {
- new SelectItem("5"),
- new SelectItem("10"),
- new SelectItem("20")
- };
- }
-
public int getPageSize() {
return pageSize;
}
-
+
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
-
+
+ @Factory(value="pattern", scope=ScopeType.EVENT)
+ public String getSearchPattern()
+ {
+ return searchString==null ?
+ "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
+ }
+
public String getSearchString()
{
return searchString;
}
-
+
public void setSearchString(String searchString)
{
this.searchString = searchString;
}
-
- public void handleSearchStringChange(ValueChangeEvent e) {
- page = 0;
- setSearchString( (String) e.getNewValue() );
- queryHotels();
- }
- public List<SelectItem> getCities() {
- return em.createQuery("select distinct new javax.faces.model.SelectItem(h.city) from Hotel h where lower(h.city) like :search order by h.city")
- .setParameter("search", getSearchPattern())
- .getResultList();
- }
-
- public void handlePageSizeChange(ValueChangeEvent e) {
- setPageSize( (Integer) e.getNewValue() );
- queryHotels();
- }
-
@Destroy @Remove
public void destroy() {}
-
-}
+}
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: Register.java,v 1.1 2005/08/23 09:17:39 gavin Exp $
+//$Id: Register.java 3069 2006-12-19 01:38:51Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -6,9 +6,11 @@
@Local
public interface Register
{
- public String register();
+ public void register();
+ public void invalid();
public String getVerify();
public void setVerify(String verify);
+ public boolean isRegistered();
public void destroy();
}
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,27 +1,21 @@
-//$Id: RegisterAction.java,v 1.1 2006/11/20 05:19:01 gavin Exp $
+//$Id: RegisterAction.java 4127 2007-02-25 19:09:39Z gavin $
package org.jboss.seam.example.booking;
-
import static org.jboss.seam.ScopeType.EVENT;
-
import java.util.List;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.FacesMessages;
-
@Stateful
@Scope(EVENT)
@Name("register")
public class RegisterAction implements Register
{
-
@In
private User user;
@@ -29,42 +23,49 @@
private EntityManager em;
@In
- private transient FacesMessages facesMessages;
+ private FacesMessages facesMessages;
private String verify;
- public String register()
+ private boolean registered;
+
+ public void register()
{
if ( user.getPassword().equals(verify) )
{
- List existing = em.createQuery("select u.username from User u where u.username=:username")
- .setParameter("username", user.getUsername())
+ List existing = em.createQuery("select u.username from User u where u.username=#{user.username}")
.getResultList();
if (existing.size()==0)
{
em.persist(user);
facesMessages.add("Successfully registered as #{user.username}");
- return "login";
+ registered = true;
}
else
{
- facesMessages.add("Username #{user.username} already exists");
- return null;
+ facesMessages.addToControl("username", "Username #{user.username} already exists");
}
}
else
{
- facesMessages.add("verify", "Re-enter your password");
+ facesMessages.addToControl("verify", "Re-enter your password");
verify=null;
- return null;
}
}
-
+
+ public void invalid()
+ {
+ facesMessages.add("Please try again");
+ }
+
+ public boolean isRegistered()
+ {
+ return registered;
+ }
public String getVerify()
{
return verify;
}
-
public void setVerify(String verify)
{
this.verify = verify;
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: User.java,v 1.5 2006/10/25 15:31:57 gavin Exp $
+//$Id: User.java 2352 2006-10-25 15:31:57Z gavin $
package org.jboss.seam.example.booking;
import static org.jboss.seam.ScopeType.SESSION;
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: BookingTest.java,v 1.39 2006/10/26 21:10:41 gavin Exp $
+//$Id: BookingTest.java 3831 2007-02-13 04:00:57Z sbryzak2 $
package org.jboss.seam.example.booking.test;
import java.util.Calendar;
@@ -26,13 +26,15 @@
public void testBookHotel() throws Exception
{
- new FacesRequest()
- {
+ new FacesRequest() {
+
@Override
protected void invokeApplication() throws Exception
{
- Contexts.getSessionContext().set("loggedIn", true);
Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
}
}.run();
@@ -48,7 +50,7 @@
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{hotelSearch.find}").equals("main");
+ assert invokeMethod("#{hotelSearch.find}")==null;
}
@Override
@@ -63,16 +65,19 @@
}.run();
- String id = new NonFacesRequest("/hotel.xhtml") {
-
+ String id = new FacesRequest("/hotel.xhtml") {
+
@Override
- protected void renderResponse()
- {
+ protected void invokeApplication() throws Exception {
HotelBooking hotelBooking = (HotelBooking) getInstance("hotelBooking");
DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
assert hotels.getRowCount()==1;
- String outcome = hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
- assert "hotel".equals(outcome);
+ hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
+ }
+
+ @Override
+ protected void renderResponse()
+ {
Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
assert hotel.getCity().equals("NY");
assert hotel.getZip().equals("10011");
@@ -86,7 +91,7 @@
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{hotelBooking.bookHotel}").equals("book");
+ invokeMethod("#{hotelBooking.bookHotel}");
}
@Override
@@ -191,7 +196,7 @@
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{hotelBooking.setBookingDetails}").equals("confirm");
+ invokeMethod("#{hotelBooking.setBookingDetails}");
}
@Override
@@ -207,18 +212,12 @@
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{hotelBooking.confirm}").equals("confirmed");
+ invokeMethod("#{hotelBooking.confirm}");
}
-
- @Override
- protected void renderResponse()
- {
- assert !Manager.instance().isLongRunningConversation();
- }
}.run();
- new NonFacesRequest("/confirmed.xhtml") {
+ new NonFacesRequest("/main.xhtml") {
@Override
protected void renderResponse()
@@ -241,7 +240,7 @@
{
ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
bookings.setRowIndex(0);
- assert invokeMethod("#{bookingList.cancel}").equals("main");
+ invokeMethod("#{bookingList.cancel}");
}
@Override
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: ChangePasswordTest.java,v 1.13 2006/10/26 21:10:41 gavin Exp $
+//$Id: ChangePasswordTest.java 3831 2007-02-13 04:00:57Z sbryzak2 $
package org.jboss.seam.example.booking.test;
import org.jboss.seam.contexts.Contexts;
@@ -19,8 +19,10 @@
@Override
protected void invokeApplication() throws Exception
{
- Contexts.getSessionContext().set("loggedIn", true);
Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
}
}.run();
@@ -41,7 +43,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
@@ -69,7 +71,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
}.run();
@@ -86,7 +88,7 @@
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{changePassword.changePassword}").equals("main");
+ invokeMethod("#{changePassword.changePassword}");
}
@Override
@@ -96,7 +98,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("xxxyyy");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
@@ -115,7 +117,7 @@
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{changePassword.changePassword}").equals("main");
+ invokeMethod("#{changePassword.changePassword}");
}
@Override
@@ -125,7 +127,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,8 +1,7 @@
-//$Id: LoginTest.java,v 1.21 2006/10/26 18:34:08 gavin Exp $
+//$Id: LoginTest.java 3831 2007-02-13 04:00:57Z sbryzak2 $
package org.jboss.seam.example.booking.test;
import org.jboss.seam.Seam;
-import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Manager;
import org.jboss.seam.mock.SeamTest;
import org.testng.annotations.Test;
@@ -20,16 +19,8 @@
protected void invokeApplication()
{
assert !isSessionInvalid();
- assert invokeMethod("#{hotelSearch.find}").equals("login");
+ assert getValue("#{identity.loggedIn}").equals(false);
}
-
- @Override
- protected void renderResponse()
- {
- assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn")==null;
-
- }
}.run();
@@ -39,14 +30,14 @@
protected void updateModelValues() throws Exception
{
assert !isSessionInvalid();
- setValue("#{user.username}", "gavin");
- setValue("#{user.password}", "foobar");
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
}
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{login.login}").equals("main");
+ invokeMethod("#{identity.login}");
}
@Override
@@ -56,8 +47,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
-
+ assert getValue("#{identity.loggedIn}").equals(true);
}
}.run();
@@ -68,16 +58,8 @@
protected void invokeApplication()
{
assert !isSessionInvalid();
- assert invokeMethod("#{hotelSearch.find}").equals("main");
+ assert getValue("#{identity.loggedIn}").equals(true);
}
-
- @Override
- protected void renderResponse()
- {
- assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
-
- }
}.run();
@@ -88,13 +70,14 @@
{
assert !Manager.instance().isLongRunningConversation();
assert !isSessionInvalid();
- assert invokeMethod("#{logout.logout}").equals("login");
+ invokeMethod("#{identity.logout}");
assert Seam.isSessionInvalid();
}
@Override
protected void renderResponse()
{
+ assert getValue("#{identity.loggedIn}").equals(false);
assert Seam.isSessionInvalid();
}
Modified: branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -20,16 +20,4 @@
</classes>
</test>
- <!--test name="Switch Conversation">
- <classes>
- <class name="org.jboss.seam.example.booking.test.SwitchConversationTest"/>
- </classes>
- </test-->
-
- <test name="Booking Unit">
- <classes>
- <class name="org.jboss.seam.example.booking.test.BookingUnitTest"/>
- </classes>
- </test>
-
</suite>
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -7,157 +7,102 @@
xmlns:ice="http://www.icesoft.com/icefaces/component"
template="template.xhtml">
+<ice:outputStyle href="./xmlhttp/css/xp/xp.css"/>
+
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Book Hotel</h1>
</div>
<div class="section">
- <h:form id="booking">
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <div style="clear:both"/>
+
+ <ice:form id="booking">
<fieldset>
- <div class="entry">
- <div class="label">Name:</div>
- <div class="output">#{hotel.name}</div>
- </div>
- <div class="entry">
- <div class="label">Address:</div>
- <div class="output">#{hotel.address}</div>
- </div>
- <div class="entry">
- <div class="label">City, State:</div>
- <div class="output">#{hotel.city}, #{hotel.state}</div>
- </div>
- <div class="entry">
- <div class="label">Zip:</div>
- <div class="output">#{hotel.zip}</div>
- </div>
- <div class="entry">
- <div class="label">Country:</div>
- <div class="output">#{hotel.country}</div>
- </div>
-
- <s:validateAll>
-
- <f:facet name="aroundInvalidField">
- <s:span styleClass="errors"/>
- </f:facet>
-
- <div class="entry">
- <div class="label"><h:outputLabel for="checkinDate">Check In Date:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:selectInputDate id="checkinDate" value="#{booking.checkinDate}" renderAsPopup="true" partialSubmit="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
- <div class="entry">
- <div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:selectInputDate id="checkoutDate" value="#{booking.checkoutDate}" renderAsPopup="true" partialSubmit="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div class="entry">
- <div class="label"><h:outputLabel for="beds">Room Preference:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:selectOneMenu id="beds" value="#{booking.beds}">
- <f:selectItem itemLabel="One king-size bed" itemValue="1"/>
- <f:selectItem itemLabel="Two double beds" itemValue="2"/>
- <f:selectItem itemLabel="Three beds" itemValue="3"/>
- </h:selectOneMenu>
- <br/>
- </s:decorate>
- </div>
- </div>
-
- <div class="entry">
- <div class="label"><h:outputLabel for="smoking">Smoking Preference:</h:outputLabel></div>
- <div id="radio" class="input">
- <s:decorate>
- <h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection">
- <f:selectItem itemLabel="Smoking" itemValue="true"/>
- <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
- </h:selectOneRadio>
- <br/>
- </s:decorate>
- </div>
- </div>
-
- <div id="ccdiv" class="entry">
- <div class="label"><h:outputLabel for="creditCard">Credit Card #:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="creditCard" value="#{booking.creditCard}" partialSubmit="true" required="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div id="cndiv" class="entry">
- <div class="label"><h:outputLabel for="creditCardName">Credit Card Name:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="creditCardName" value="#{booking.creditCardName}" partialSubmit="true" required="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div class="entry">
- <div class="label"><h:outputLabel for="creditCardExpiryMonth">Credit Card Expiry:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
- <f:selectItem itemLabel="Jan" itemValue="1"/>
- <f:selectItem itemLabel="Feb" itemValue="2"/>
- <f:selectItem itemLabel="Mar" itemValue="3"/>
- <f:selectItem itemLabel="Apr" itemValue="4"/>
- <f:selectItem itemLabel="May" itemValue="5"/>
- <f:selectItem itemLabel="Jun" itemValue="6"/>
- <f:selectItem itemLabel="Jul" itemValue="7"/>
- <f:selectItem itemLabel="Aug" itemValue="8"/>
- <f:selectItem itemLabel="Sep" itemValue="9"/>
- <f:selectItem itemLabel="Oct" itemValue="10"/>
- <f:selectItem itemLabel="Nov" itemValue="11"/>
- <f:selectItem itemLabel="Dec" itemValue="12"/>
- </h:selectOneMenu>
- <h:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
- <f:selectItem itemLabel="2005" itemValue="2005"/>
- <f:selectItem itemLabel="2006" itemValue="2006"/>
- <f:selectItem itemLabel="2007" itemValue="2007"/>
- <f:selectItem itemLabel="2008" itemValue="2008"/>
- <f:selectItem itemLabel="2009" itemValue="2009"/>
- </h:selectOneMenu>
- <br/>
- </s:decorate>
- </div>
- </div>
-
- </s:validateAll>
+ <s:decorate id="checkinDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <ice:selectInputDate id="checkinDate" value="#{booking.checkinDate}" renderAsPopup="true" partialSubmit="true">
+ <f:convertDateTime type="date" dateStyle="medium" />
+ </ice:selectInputDate>
+ </s:decorate>
- <div class="entry errors">
- <h:messages globalOnly="true"/>
+ <s:decorate id="checkoutDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <ice:selectInputDate id="checkoutDate" value="#{booking.checkoutDate}" renderAsPopup="true" partialSubmit="true">
+ <f:convertDateTime type="date" dateStyle="medium" />
+ </ice:selectInputDate>
+ </s:decorate>
+
+ <s:decorate id="bedsDecorate" template="edit.xhtml">
+ <ui:define name="label">Room Preference:</ui:define>
+ <h:selectOneMenu id="beds" value="#{booking.beds}">
+ <f:selectItem itemLabel="One king-size bed" itemValue="1"/>
+ <f:selectItem itemLabel="Two double beds" itemValue="2"/>
+ <f:selectItem itemLabel="Three beds" itemValue="3"/>
+ </h:selectOneMenu>
+ </s:decorate>
+
+ <s:decorate id="smokingDecorate" template="edit.xhtml">
+ <ui:define name="label">Smoking Preference:</ui:define>
+ <ice:selectOneRadio id="smoking" value="#{booking.smoking}"
+ layout="pageDirection" styleClass="radio">
+ <f:selectItem itemLabel="Smoking" itemValue="true"/>
+ <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
+ </ice:selectOneRadio>
+ </s:decorate>
+
+ <s:decorate id="creditCardDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ <ice:inputText id="creditCard" value="#{booking.creditCard}" partialSubmit="true" required="true"/>
+ </s:decorate>
+
+ <s:decorate id="creditCardNameDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card Name:</ui:define>
+ <ice:inputText id="creditCardName" value="#{booking.creditCardName}" partialSubmit="true" required="true"/>
+ </s:decorate>
+
+ <s:decorate id="creditCardExpiryDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card Expiry:</ui:define>
+ <ice:selectOneMenu id="creditCardExpiryMonth"
+ value="#{booking.creditCardExpiryMonth}">
+ <f:selectItem itemLabel="Jan" itemValue="1" />
+ <f:selectItem itemLabel="Feb" itemValue="2" />
+ <f:selectItem itemLabel="Mar" itemValue="3" />
+ <f:selectItem itemLabel="Apr" itemValue="4" />
+ <f:selectItem itemLabel="May" itemValue="5" />
+ <f:selectItem itemLabel="Jun" itemValue="6" />
+ <f:selectItem itemLabel="Jul" itemValue="7" />
+ <f:selectItem itemLabel="Aug" itemValue="8" />
+ <f:selectItem itemLabel="Sep" itemValue="9" />
+ <f:selectItem itemLabel="Oct" itemValue="10" />
+ <f:selectItem itemLabel="Nov" itemValue="11" />
+ <f:selectItem itemLabel="Dec" itemValue="12" />
+ </ice:selectOneMenu>
+ <ice:selectOneMenu id="creditCardExpiryYear"
+ value="#{booking.creditCardExpiryYear}">
+ <f:selectItem itemLabel="2007" itemValue="2007" />
+ <f:selectItem itemLabel="2008" itemValue="2008" />
+ <f:selectItem itemLabel="2009" itemValue="2009" />
+ <f:selectItem itemLabel="2010" itemValue="2010" />
+ <f:selectItem itemLabel="2011" itemValue="2011" />
+ </ice:selectOneMenu>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/>
+  
+ <s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
</div>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}" styleClass="button"/> 
- <s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}" styleClass="button"/>
- </div>
- </div>
</fieldset>
- </h:form>
+ </ice:form>
</div>
</ui:define>
@@ -172,7 +117,7 @@
</p>
<p>
<a href="#" onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
- How does the workspace list work?
+ How does the workspace list work?
</a>
</p>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -3,60 +3,54 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
- xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:s="http://jboss.com/products/seam/taglib"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
+
<div class="section">
<h1>Confirm Hotel Booking</h1>
</div>
+
<div class="section">
- <h:form id="confirm">
- <fieldset>
- <div class="entry">
- <div class="label">Name:</div>
- <div class="output">#{hotel.name}</div>
- </div>
- <div class="entry">
- <div class="label">Address:</div>
- <div class="output">#{hotel.address}</div>
- </div>
- <div class="entry">
- <div class="label">City, State:</div>
- <div class="output">#{hotel.city}, #{hotel.state}</div>
- </div>
- <div class="entry">
- <div class="label">Zip:</div>
- <div class="output">#{hotel.zip}</div>
- </div>
- <div class="entry">
- <div class="label">Country:</div>
- <div class="output">#{hotel.country}</div>
- </div>
- <div class="entry">
- <div class="label">Check In Date:</div>
- <div class="output"><h:outputText value="#{booking.checkinDate}"/></div>
- </div>
- <div class="entry">
- <div class="label">Check Out Date:</div>
- <div class="output"><h:outputText value="#{booking.checkoutDate}"/></div>
- </div>
- <div class="entry">
- <div class="label">Credit Card #:</div>
- <div class="output">#{booking.creditCard}</div>
- </div>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}" styleClass="button"/> 
- <h:commandButton id="revise" value="Revise" action="back" styleClass="button"/> 
- <h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}" styleClass="button"/>
- </div>
- </div>
- </fieldset>
- </h:form>
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Total Payment:</ui:define>
+ <h:outputText value="#{booking.total}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <h:outputText value="#{booking.checkinDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <h:outputText value="#{booking.checkoutDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ #{booking.creditCard}
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:form id="confirm">
+ <h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/>
+  
+ <s:button id="revise" value="Revise" view="/book.xhtml"/>
+  
+ <h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </h:form>
+ </div>
+
</div>
+
</ui:define>
<!-- sidebar -->
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,185 @@
+div.seam-date
+{
+ margin-top: 5px;
+ border: 1px solid #AAAAAA;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+ background-color: #FFFFFF;
+ color: #505050;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+table.seam-date td {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: 11px;
+}
+
+.seam-date-monthNames
+{
+ width: 70px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-monthNameLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+.seam-date-years
+{
+ height: 10em;
+ overflow: auto;
+ width: 60px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-yearLink, a.seam-date-yearLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-yearLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+tr.seam-date-header
+{
+ padding: 2px 0px 2px 0px;
+}
+
+td.seam-date-header
+{
+ padding: 0px 8px 0px 8px;
+ text-align: center;
+ color: gray;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+td.seam-date-header-prevMonth
+{
+ background-image: url("../img/cal-prev.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-left: 2px;
+}
+
+td.seam-date-header-nextMonth
+{
+ background-image: url("../img/cal-next.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-right: 2px;
+}
+
+tr.seam-date-headerDays
+{
+ color: white;
+ font-weight: normal;
+}
+
+tr.seam-date-headerDays > td
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: white;
+ text-align: center;
+ width: 26px;
+}
+
+tr.seam-date-footer
+{
+ background-color: white;
+ color: #505050;
+ font-weight: bold;
+}
+
+tr.seam-date-footer > td
+{
+ text-align: center;
+}
+
+td.seam-date-inMonth
+{
+ background-color: white;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-outMonth
+{
+ background-color: white;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-selected
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: black;
+ font-weight: normal;
+}
+
+td.seam-date-dayOff-inMonth
+{
+ background-color: #efefef;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-dayOff-outMonth
+{
+ background-color: #efefef;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-hover
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ cursor: pointer;
+ color: red;
+}
\ No newline at end of file
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,6 +1,6 @@
/* Setup defaults since variable in browsers
----------------------------------------------- */
-body, div, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset {
+body, div, span, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset {
margin: 0;
padding: 0;
}
@@ -24,7 +24,7 @@
margin-left: auto;
margin-right: auto;
}
-label {
+.label {
font-weight: bold;
color: #5E5147;
}
@@ -34,16 +34,13 @@
margin: 5px 0;
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
}
-input[type="image"] {
- border: none;
- background: transparent;
-}
select {
border: 1px solid #C3BBB6;
padding: 4px;
margin: 5px 0;
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
-}ol, ul {
+}
+ol, ul {
margin: 10px 0px 10px 6px;
}
li {
@@ -97,7 +94,7 @@
}
/* General
----------------------------------------------- */
-.button {
+input[type="submit"], input[type="button"] {
font-weight: bold;
color: #fff;
border: 1px solid #5D1414;
@@ -114,23 +111,27 @@
}
.entry .label {
float: left;
- padding-top: 10px;
padding-right: 5px;
font-weight: bold;
width: 150px;
text-align: right;
}
.entry .output {
- float: left;
- width: 250px;
+ float: right;
+ width: 360px;
padding-top: 10px;
text-align: left;
}
.entry .input {
- float: left;
- width: 250px;
+ float: right;
+ width: 360px;
text-align: left;
}
+.entry .error {
+ float: right;
+ width: 360px;
+ text-align: left;
+}
/* Sidebar
----------------------------------------------- */
.notes {
@@ -143,6 +144,12 @@
text-align: center;
color: #600;
}
+.errors div {
+ text-align: left;
+}
+.errors span {
+ text-align: left;
+}
.errors input {
border: 1px solid #600;
}
@@ -152,6 +159,7 @@
.buttonBox {
text-align: center;
padding: 5px 0;
+ clear: both;
}
#sidebar p {
font-size: small;
@@ -225,10 +233,10 @@
float: left;
width: 66%;
}
-#radio table {
+#content table.radio {
border: 0px;
}
-#radio table tr td {
+#content table.radio tbody tr td {
border: 0px;
border-left: 0px;
border-bottom: 0px;
@@ -253,13 +261,6 @@
color: #C7B299;
text-decoration: none;
}
-.connectionStatus {
- display: inline;
-}
-.connectionStatus div {
- display: inline;
-}
-
/* Homepage Modifications
----------------------------------------------- */
#pgHome #container {
@@ -271,10 +272,6 @@
#pgHome #content {
margin-top: 183px;
}
-#pgHome .button {
- height: 30px;
-}
-
/*
----------- Calendar Component classes
*/
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,148 @@
+* {
+ margin: 0px;
+ padding: 0px;
+ border: none;
+}
+
+body {
+ font: 1em verdana, arial, sans-serif;
+ background: #CCCCCC;
+}
+
+div#main {
+ margin-left: 0px;
+ width: 751px;
+ background: #ecefdf;
+}
+
+div#top,div#pictures{
+}
+
+div#pictures img {
+ float:left;
+}
+
+img#head1 {
+ margin-right: 3px;
+}
+
+img#head2 {
+ margin-right: 4px;
+}
+
+div.trail {
+ clear:both;
+ margin-left: 50px;
+ margin-top: 0px;
+ margin-right: 50px
+}
+
+div.foot {
+ margin-left: 50px;
+ margin-right: 50px;
+ margin-top: 50px;
+ text-align: center;
+ font-size: .5em;
+ height: 36px;
+}
+
+div.trail h1 {
+ margin-top: -30px;
+ margin-left: -50px;
+ font-size: 1.2em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h2 {
+ float: left;
+ font-size: 1em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h3 {
+ float: left;
+ font-size: .8em;
+ font-weight: bold;
+ margin-left: -1.4em;
+ margin-bottom: 1em;
+}
+
+
+div.trail p {
+ clear: both;
+ margin-top: 20px;
+ font-size: .8em;
+ text-decoration: none;
+}
+
+div#next_trail {
+ margin-left: 36px;
+}
+
+div.numbox {
+ border: thin solid black;
+ margin-left: -.8em;
+ float: left;
+ background: #ffffff;
+ padding: .2em .35em .3em;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 1.4em;
+}
+
+div.figure {
+ text-align: center;
+ font-size: .6em;
+ margin-top: 30px;
+}
+
+div.figure img {
+ display: block;
+ margin-right: auto;
+ margin-left: auto;
+}
+
+code {
+ font: 1.1em "Courier New", Courier, mono;
+}
+
+code.block {
+ white-space: pre;
+ font: 10pt "Courier New", Courier, mono;
+ display: block;
+ border-style: dashed;
+ border-width: thin;
+ padding: .5em;
+ background: #ffffff;
+ margin: 20px;
+}
+
+div.foot_image {
+ float: left;
+ height: 86px;
+}
+
+a:active {
+ color : #666666;
+ text-decoration: none;
+}
+
+a:hover {
+ color : #000000;
+ background-color : #D6E0FE;
+ text-decoration: none;
+}
+
+a:link {
+ color : #005EB6;
+ text-decoration: none;
+}
+
+a:visited {
+ color : #888888;
+ text-decoration: none;
+}
+
+
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,16 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <span class="label">
+ <ui:insert name="label"/>
+ </span>
+ <span class="input">
+ <ui:insert/>
+ </span>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,20 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <s:label styleClass="label #{invalid?'errors':''}">
+ <ui:insert name="label"/>
+ <s:span styleClass="required" rendered="#{required}">*</s:span>
+ </s:label>
+ <span class="input #{invalid?'errors':''}">
+ <s:validateAll>
+ <ui:insert/>
+ </s:validateAll>
+ </span>
+ <s:message styleClass="error errors"/>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -2,7 +2,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core">
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>JBoss Suites: Seam Framework</title>
@@ -20,16 +21,16 @@
<fieldset>
<div>
<h:outputLabel for="username">Login Name</h:outputLabel>
- <h:inputText id="username" value="#{user.username}" style="width: 175px;"/>
+ <h:inputText id="username" value="#{identity.username}" style="width: 175px;"/>
<div class="errors"><h:message for="username"/></div>
</div>
<div>
<h:outputLabel for="password">Password</h:outputLabel>
- <h:inputSecret id="password" value="#{user.password}" style="width: 175px;"/>
+ <h:inputSecret id="password" value="#{identity.password}" style="width: 175px;"/>
</div>
<div class="errors"><h:messages globalOnly="true"/></div>
- <div class="buttonBox"><h:commandButton id="login" action="#{login.login}" value="Account Login" styleClass="button"/></div>
- <div class="notes"><h:commandLink id="register" action="register">Register New User</h:commandLink></div>
+ <div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
+ <div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
</fieldset>
</h:form>
</div>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -3,48 +3,30 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
- xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:s="http://jboss.com/products/seam/taglib"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
+
<div class="section">
<h1>View Hotel</h1>
</div>
+
<div class="section">
- <div class="entry">
- <div class="label">Name:</div>
- <div class="output">#{hotel.name}</div>
+ <ui:include src="hotelview.xhtml"/>
+
+ <div class="buttonBox">
+ <h:form id="hotel">
+ <h:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/>
+  
+ <h:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
+ </h:form>
</div>
- <div class="entry">
- <div class="label">Address:</div>
- <div class="output">#{hotel.address}</div>
- </div>
- <div class="entry">
- <div class="label">City:</div>
- <div class="output">#{hotel.city}</div>
- </div>
- <div class="entry">
- <div class="label">State:</div>
- <div class="output">#{hotel.state}</div>
- </div>
- <div class="entry">
- <div class="label">Zip:</div>
- <div class="output">#{hotel.zip}</div>
- </div>
- <div class="entry">
- <div class="label">Country:</div>
- <div class="output">#{hotel.country}</div>
- </div>
+
+
</div>
-<div class="section">
- <h:form id="hotel">
- <fieldset class="buttonBox">
- <h:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel" styleClass="button"/> 
- <h:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search" styleClass="button"/>
- </fieldset>
- </h:form>
-</div>
+
</ui:define>
<!-- sidebar -->
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml (rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -0,0 +1,44 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Name:</ui:define>
+ #{hotel.name}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Address:</ui:define>
+ #{hotel.address}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">City:</ui:define>
+ #{hotel.city}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">State:</ui:define>
+ #{hotel.state}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Zip:</ui:define>
+ #{hotel.zip}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Country:</ui:define>
+ #{hotel.country}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Nightly rate:</ui:define>
+ <h:outputText value="#{hotel.name}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+</ui:composition>
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-next.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-prev.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -11,32 +11,35 @@
<ui:define name="content">
<div class="section">
- <h:form id="main">
<span class="errors">
<h:messages globalOnly="true"/>
</span>
- <h1>Search Hotels</h1>
+ <h1>Search Hotels</h1>
+
+ <h:form id="searchCriteria">
<fieldset>
- <ice:selectInputText id="searchString"
+ <ice:selectInputText id="searchString"
valueChangeListener="#{hotelSearch.handleSearchStringChange}"
value="#{hotelSearch.searchString}"
- style="display: inline; width: 165px;">
- <f:selectItems value="#{hotelSearch.cities}"/>
- </ice:selectInputText>
+ style="display: inline; width: 165px;"/> 
+ <ice:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" />
<ice:outputConnectionStatus activeLabel="requesting..." styleClass="connectionStatus"/>
<br/>
<h:outputLabel for="pageSize">Maximum results:</h:outputLabel> 
- <ice:selectOneMenu id="pageSize"
+ <ice:selectOneMenu id="pageSize"
value="#{hotelSearch.pageSize}"
valueChangeListener="#{hotelSearch.handlePageSizeChange}"
partialSubmit="true">
- <f:selectItems value="#{hotelSearch.pageSizes}"/>
+ <f:selectItem itemLabel="5" itemValue="5"/>
+ <f:selectItem itemLabel="10" itemValue="10"/>
+ <f:selectItem itemLabel="20" itemValue="20"/>
</ice:selectOneMenu>
+
</fieldset>
+ </h:form>
- </h:form>
</div>
<div class="section">
@@ -63,6 +66,7 @@
<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}"/>
</div>
<div class="section">
@@ -86,11 +90,11 @@
</h:column>
<h:column>
<f:facet name="header">Check in date</f:facet>
- <h:outputText value="#{book.checkinDate}" onmouseovereffect="#{highlight}"/>
+ <ice:outputText 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}"/>
+ <ice:outputText value="#{book.checkinDate}" onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Confirmation number</f:facet>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -8,59 +8,42 @@
<!-- content -->
<ui:define name="content">
+
<div class="section">
<h1>Change Your Password</h1>
</div>
+
<div class="section">
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
<h:form id="setpassword">
- <f:facet name="aroundInvalidField">
- <s:span styleClass="errors"/>
- </f:facet>
- <f:facet name="afterInvalidField">
- <s:div styleClass="errors">
- <s:message/>
- </s:div>
- </f:facet>
-
<fieldset>
- <div class="entry">
- <div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:inputSecret id="password" value="#{user.password}" required="true">
- <s:validate/>
- </h:inputSecret>
- </s:decorate>
- </div>
- </div>
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <h:inputSecret id="password" value="#{user.password}" required="true"/>
+ </s:decorate>
- <div class="entry">
- <div class="label"><h:outputLabel for="verify">Verify:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
- </s:decorate>
- </div>
- </div>
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Verify:</ui:define>
+ <h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
+ </s:decorate>
- <div class="entry errors">
- <h:messages globalOnly="true"/>
+ <div class="buttonBox">
+ <h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/>
+  
+ <s:button id="cancel" value="Cancel" view="/main.xhtml"/>
</div>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="change" value="Change" action="#{changePassword.changePassword}" styleClass="button"/> 
- <s:link id="cancel" value="Cancel" action="#{changePassword.cancel}" linkStyle="button" buttonClass="button"/>
- </div>
- </div>
-
</fieldset>
</h:form>
</div>
+
</ui:define>
<!-- sidebar -->
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -3,19 +3,24 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ice="http://www.icesoft.com/icefaces/component"
- xmlns:s="http://jboss.com/products/seam/taglib">
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ice="http://www.icesoft.com/icefaces/component">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
+
<body id="pgHome">
+
<div id="document">
+
<div id="header">
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
</div>
+
<div id="container">
+
<div id="sidebar">
<h1>Integrated multi-layer validation</h1>
<p>
@@ -33,88 +38,60 @@
</a>
</p>
</div>
+
<div id="content">
+
<div class="section">
<h1>Register</h1>
</div>
+
<div class="section">
- <h:form id="register">
- <fieldset>
-
- <s:validateAll>
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
- <f:facet name="aroundInvalidField">
- <s:span styleClass="errors"/>
- </f:facet>
-
- <div id="undiv" class="entry">
- <div class="label"><h:outputLabel for="username">Username:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="username" value="#{user.username}" required="true" partialSubmit="true" >
- </ice:inputText>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div id="rndiv" class="entry">
- <div class="label"><h:outputLabel for="name">Real Name:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="name" value="#{user.name}" required="true" partialSubmit="true">
- </ice:inputText>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div id="pw1div" class="entry">
- <div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputSecret id="password" value="#{user.password}" redisplay="true" required="true" partialSubmit="true" />
- <br/>
- <h:message for="password"/>
- </s:decorate>
- </div>
- </div>
-
- <div id="pw2div" class="entry">
- <div class="label"><h:outputLabel for="verify">Verify Password:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputSecret id="verify" value="#{register.verify}" redisplay="true" required="true" partialSubmit="true"/>
- <br/>
- <h:message for="verify"/>
- </s:decorate>
- </div>
- </div>
-
- </s:validateAll>
+ <h:form id="registration">
+ <fieldset>
+ <s:validateAll>
+ <s:decorate id="usernameDecorate" template="edit.xhtml">
+ <ui:define name="label">Username:</ui:define>
+ <ice:inputText id="username" value="#{user.username}" required="true" partialSubmit="true" />
+ </s:decorate>
- <div class="entry errors">
- <h:messages globalOnly="true"/>
- </div>
+ <s:decorate id="nameDecorate" template="edit.xhtml">
+ <ui:define name="label">Real Name:</ui:define>
+ <ice:inputText id="name" value="#{user.name}" required="true" partialSubmit="true" />
+ </s:decorate>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="register" value="Register" action="#{register.register}" styleClass="button"/> 
- <s:link id="cancel" value="Cancel" action="login" linkStyle="button" buttonClass="button"/>
- </div>
- </div>
+ <s:decorate id="passwordDecorate" template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <ice:inputSecret id="password" value="#{user.password}" redisplay="true" required="true" partialSubmit="true" />
+ </s:decorate>
+ <s:decorate id="verifyDecorate" template="edit.xhtml">
+ <ui:define name="label">Verify Password:</ui:define>
+ <ice:inputSecret id="verify" value="#{register.verify}" redisplay="true" required="true" partialSubmit="true"/>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:commandButton id="register" value="Register" action="#{register.register}"/> 
+ <s:button id="cancel" value="Cancel" view="/home.xhtml"/>
+ </div>
+ </s:validateAll>
</fieldset>
</h:form>
- </div>
+ </div>
+
</div>
+
</div>
+
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
+
</div>
+
</body>
+
</html>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -1,11 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html">
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
+ <link href="css/date.css" rel="stylesheet" type="text/css" />
+ <link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />
</head>
<body>
@@ -13,12 +16,10 @@
<div id="header">
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
<div id="status">
- <h:form id="navigation">
- Welcome #{user.name}
- | <h:outputLink id="main" value="main.seam">Search</h:outputLink>
- | <h:outputLink id="password" value="password.seam">Settings</h:outputLink>
- | <h:commandLink id="logout" action="#{logout.logout}">Logout</h:commandLink>
- </h:form>
+ Welcome #{user.name}
+ | <s:link id="search" view="/main.xhtml" value="Search" propagation="none"/>
+ | <s:link id="settings" view="/password.xhtml" value="Settings" propagation="none"/>
+ | <s:link id="logout" action="#{identity.logout}" value="Logout"/>
</div>
</div>
<div id="container">
16 years, 6 months