Author: sabrashevich
Date: 2007-11-15 10:29:25 -0500 (Thu, 15 Nov 2007)
New Revision: 4921
Added:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_12.png
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_15.png
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_16.png
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_17.png
Modified:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_13.png
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_14.png
trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/first_seam.xml
Log:
http://jira.jboss.com/jira/browse/RHDS-137 updated text context and added new screenshots
accordingly to a new build
Added:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_12.png
===================================================================
(Binary files differ)
Property changes on:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_12.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_13.png
===================================================================
(Binary files differ)
Modified:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_14.png
===================================================================
(Binary files differ)
Added:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_15.png
===================================================================
(Binary files differ)
Property changes on:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_15.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_16.png
===================================================================
(Binary files differ)
Property changes on:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_17.png
===================================================================
(Binary files differ)
Property changes on:
trunk/documentation/guides/userguide/GettingStartedGuide/en/images/first_seam/first_seam_17.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/first_seam.xml
===================================================================
---
trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/first_seam.xml 2007-11-15
14:55:25 UTC (rev 4920)
+++
trunk/documentation/guides/userguide/GettingStartedGuide/en/modules/first_seam.xml 2007-11-15
15:29:25 UTC (rev 4921)
@@ -163,16 +163,14 @@
</mediaobject>
</figure>
- <!-- Not yet ...
- <para>Notice that we do not need to re-build and re-deploy the application.
Just save the edited page and reload the browser.</para>
- -->
-
+ <para>Notice that we do not need to re-build and re-deploy the application.
Just save the edited page and reload the browser.</para>
+
</section>
<section>
<title>Add a Web Page and an Action</title>
- <para>To add a new page and related UI action to the project, use the
<emphasis><property>New > Other ... > Seam > Seam
Form</property></emphasis> wizard. You are prompted to enter the name of the
web page, the name for the Seam component that handles UI actions from the page, and UI
action method name.</para>
+ <para>To add a new page and related UI action to the project, use the
<emphasis><property>New > Other ... > Seam > Seam
Form</property></emphasis> wizard. You are prompted to enter the name of the
project and seam component name, all the others fields will be filled by the
wizard.</para>
<figure>
<title>New Form for the Application</title>
@@ -183,45 +181,38 @@
</mediaobject>
</figure>
- <para>The wizard generate a web page with a single text input field and an
action button. Notice that the generated page uses
<emphasis>layout/template.xhtml</emphasis> as a template. The template page
provides the page header, footer, side menu, and CSS styles (see the template.xhtml for
more details). The Simplepage.xhtml is assembled into the template when the
Simplepage.seam URL is loaded.</para>
+ <para>The wizard generate a web page with a single text input field and an
action button. Notice that the generated page uses
<emphasis><property>layout/template.xhtml</property></emphasis> as
a template. The template page provides the page header, footer, side menu, and CSS styles
(see the template.xhtml for more details). The simpleAction.xhtml is assembled into the
template when the simpleAction.seam URL is loaded.</para>
<programlisting role="XML"><![CDATA[
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
xmlns:s="http://jboss.com/products/seam/taglib"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
- template="layout/template.xhtml">
+ <ui:composition>
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+ template="layout/template.xhtml">
<ui:define name="body">
- <h1>Simplepage</h1>
- <p>Generated form page</p>
-
<h:messages globalOnly="true" styleClass="message"/>
- <h:form id="simpleAction">
- <div class="dialog">
- <s:validateAll>
- <div class="prop">
- <span class="name">Value</span>
- <span class="value">
- <s:decorate>
+ <h:form id="simpleActionForm">
+ <rich:panel>
+ <f:facet name="header">simpleAction</f:facet>
+ <s:decorate id="valueDecoration"
template="layout/edit.xhtml">
+ <ui:define name="label">Value</ui:define>
<h:inputText id="value" required="true"
value="#{simpleAction.value}"/>
</s:decorate>
- </span>
- </div>
- </s:validateAll>
- </div>
- <div class="actionButtons">
- <h:commandButton id="hello" value="hello"
- action="#{simpleAction.hello}"/>
- </div>
- </h:form>
-
+ <div style="clear:both"/>
+ </rich:panel>
+
+ <div class="actionButtons">
+ <h:commandButton id="simpleAction" value="simpleAction"
+ action="#{simpleAction.simpleAction}"/>
+ </div>
+ </h:form>
</ui:define>
</ui:composition>
@@ -234,9 +225,17 @@
</imageobject>
</mediaobject>
</figure>
- <para>The <emphasis>#{simpleAction.value}</emphasis> notation on
the web page maps to the "value" property in the backend component named
"simpleAction", and the
<emphasis>#{simpleAction.hello}</emphasis> notation indicates that the
<emphasis><property>hello()</property></emphasis> method is called
when the button is clicked on. Here is the "simpleAction" named backend
Seam component generated by the wizard.</para>
+ <para>The
<emphasis><property>#{simpleAction.value}</property></emphasis>
notation on the web page maps to the "value" property in the backend
component named "simpleAction", and the
<emphasis><property>#{simpleAction.simpleAction}</property></emphasis>
notation indicates that the
<emphasis><property>simpleAction()</property></emphasis> method is
called when the button is clicked on. Here is the "simpleAction" named
backend Seam component generated by the wizard.</para>
- <programlisting role="JAVA"><![CDATA[
+ <programlisting role="JAVA"><![CDATA[package
org.domain.MySeamProj.session;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+import org.hibernate.validator.Length;
+
@Name("simpleAction")
public class SimpleAction {
@@ -248,12 +247,11 @@
private String value;
//seam-gen method
- public String hello()
+ public void simpleAction()
{
//implement your business logic here
- log.info("simpleAction.echo() action called with:
#{simpleAction.value}");
- facesMessages.add("echo #{simpleAction.value}");
- return "success";
+ log.info("simpleAction.simpleAction() action called with:
#{simpleAction.value}");
+ facesMessages.add("simpleAction #{simpleAction.value}");
}
//add additional action methods
@@ -272,14 +270,14 @@
}
]]></programlisting>
- <para>Load the Simplepage.seam in the web browser. Type something in the text
field and click on the "hello" button. A JSF message containing the
input string is created by the
<emphasis><property>SimpleAction.hello()</property></emphasis>
method. The message is displayed on the page via the <emphasis
role="bold"><property><h:messages></property></emphasis>
tag.</para>
+ <para>Load the Simplepage.seam in the web browser. Type something in the text
field and click on the "simpleAction" button. A JSF message containing
the input string is created by the
<emphasis><property>simpleAction.simpleAction()</property></emphasis>
method. The message is displayed on the page via the <emphasis
role="bold"><property><h:message></property></emphasis>
tag.</para>
</section>
<section>
<title>Input Validation</title>
- <para>Notice that in the generated SimpleAction class, there is a
<emphasis>@Length</emphasis> annotation to validate the input when the input
string is bound to <emphasis>#{simpleAction.value}</emphasis>. To see how this
works, enter a text string longer than 10 chars and click on the button. This is what you
should see.</para>
+ <para>Notice that in the generated SimpleAction class, there is a
<emphasis><property>@Length</property></emphasis> annotation to
validate the input when the input string is bound to
<emphasis><property>#{simpleAction.value}</property></emphasis>.
To see how this works, enter a text string longer than 10 chars and click on the button.
This is what you should see.</para>
<figure>
<title>The Input Validation in Action</title>
@@ -290,10 +288,9 @@
</mediaobject>
</figure>
- <para>Seam supports many different input validation annotations. To see an
example, you can replace the <emphasis>@Length(max=10)</emphasis> annotation
with the following. It would require the input string to have a first name and last name
separated by a space. If the validation fails, the web page would print the customized
error message.</para>
+ <para>Seam supports many different input validation annotations. To see an
example, you can replace the
<emphasis><property>@Length(max=10)</property></emphasis>
annotation with the following. It would require the input string to have a first name and
last name separated by a space. If the validation fails, the web page would print the
customized error message.</para>
- <programlisting role="JAVA"><![CDATA[
-@NotNull
+ <programlisting role="JAVA"><![CDATA[@NotNull
@Pattern(regex="^[a-zA-Z.-]+ [a-zA-Z.-]+",
message="Need a firstname and a lastname")
public String getValue()
@@ -367,7 +364,7 @@
<section>
<title>Add Security to the Application</title>
- <para>You have probably noticed that the web page template has a login link at
the top of the page. You can use the Seam security framework to secure access to any web
page or web action. You can implement the login logic in the
<emphasis>checkLoggedIn</emphasis> method. In the following example, we just
use hardcoded username and password. But you can easily change it to use database, LDAP or
any other means.</para>
+ <para>You have probably noticed that the web page template has a login link at
the top of the page. You can use the Seam security framework to secure access to any web
page or web action. You can implement the login logic in the
<emphasis><property>checkLoggedIn</property></emphasis> method. In
the following example, we just use hardcoded username and password. But you can easily
change it to use database, LDAP or any other means.</para>
<programlisting role="JAVA"><![CDATA[
]]></programlisting>