[jboss-cvs] JBossAS SVN: r105532 - projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 1 22:56:17 EDT 2010


Author: misty at redhat.com
Date: 2010-06-01 22:56:17 -0400 (Tue, 01 Jun 2010)
New Revision: 105532

Modified:
   projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Conversations.xml
Log:
JBPAPP-4387

Modified: projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Conversations.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Conversations.xml	2010-06-02 02:16:54 UTC (rev 105531)
+++ projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Conversations.xml	2010-06-02 02:56:17 UTC (rev 105532)
@@ -83,7 +83,7 @@
 			To propagate a Seam conversation across a non-Faces request, the Seam <emphasis>conversation ID</emphasis> must be explicitly coded as a request parameter:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<a href="main.jsf?#{manager.conversationIdParameter}=#{conversation.id}"> 
+<programlisting language="XML" role="XML"><![CDATA[<a href="main.jsf?#{manager.conversationIdParameter}=#{conversation.id}"> 
   Continue
 </a>]]>
 </programlisting>
@@ -91,7 +91,7 @@
 			Or, for JSF:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:outputLink value="main.jsf"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:outputLink value="main.jsf"> 
   <f:param name="#{manager.conversationIdParameter}" 
      value="#{conversation.id}"/> 
   <h:outputText value="Continue"/> 
@@ -101,7 +101,7 @@
 			If you use the Seam tag library, this is equivalent:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:outputLink value="main.jsf"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:outputLink value="main.jsf"> 
   <s:conversationId/> 
   <h:outputText value="Continue"/> 
 </h:outputLink>]]>
@@ -110,7 +110,7 @@
 			The code to disable propagation of the conversation context for a postback is similar:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="main" value="Exit"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="main" value="Exit"> 
   <f:param name="conversationPropagation" value="none"/> 
 </h:commandLink>]]>
 </programlisting>
@@ -118,7 +118,7 @@
 			The equivalent for the Seam tag library is:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="main" value="Exit"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="main" value="Exit"> 
   <s:conversationPropagation type="none"/> 
 </h:commandLink>]]>
 </programlisting>
@@ -131,22 +131,22 @@
 			The <literal>conversationPropagation</literal> request parameter or <literal><![CDATA[<s:conversationPropagation>]]></literal> tag can also be used to begin and end conversations, or to begin a nested conversation.
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="main" value="Exit"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="main" value="Exit"> 
   <s:conversationPropagation type="end"/> 
 </h:commandLink>]]>
 </programlisting>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="main" value="Select Child"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="main" value="Select Child"> 
   <s:conversationPropagation type="nested"/> 
 </h:commandLink>]]>
 </programlisting>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="main" value="Select Hotel"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="main" value="Select Hotel"> 
   <s:conversationPropagation type="begin"/> 
 </h:commandLink>]]>
 </programlisting>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="main" value="Select Hotel"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="main" value="Select Hotel"> 
   <s:conversationPropagation type="join"/> 
 </h:commandLink>]]>
 </programlisting>
@@ -327,7 +327,7 @@
             </listitem>
             <listitem>
                 <para>redirects the user to an alternative page, if defined in the <literal>no-conversation-view-id</literal> attribute, like so:</para>
-<programlisting><![CDATA[<pages no-conversation-view-id="/main.xhtml"/>
+<programlisting language="XML" role="XML"><![CDATA[<pages no-conversation-view-id="/main.xhtml"/>
 ]]>
 </programlisting>
                 <para>This page will be used across the entire application; at present, multiple alternative pages cannot be defined.</para>
@@ -362,49 +362,49 @@
 			The link can specify only the JSF ID:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link view="/login.xhtml" value="Login"/>
+<programlisting language="XML" role="XML"><![CDATA[<s:link view="/login.xhtml" value="Login"/>
 ]]>
 </programlisting>
 		 <para>
 			It can also specify an action method, in which case the action outcome determines the page that results:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link action="#{login.logout}" value="Logout"/>
+<programlisting language="XML" role="XML"><![CDATA[<s:link action="#{login.logout}" value="Logout"/>
 ]]>
 </programlisting>
 		 <para>
 			If both a JSF view ID and an action method are specified, the view will be used unless the action method returns a non-null outcome:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link view="/loggedOut.xhtml"  action="#{login.logout}" value="Logout"/>
+<programlisting language="XML" role="XML"><![CDATA[<s:link view="/loggedOut.xhtml"  action="#{login.logout}" value="Logout"/>
 ]]>
 </programlisting>
 		 <para>
 			The link automatically propagates the selected row of a <literal>DataModel</literal> inside <literal><![CDATA[<h:dataTable>]]></literal>:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link view="/hotel.xhtml" action="#{hotelSearch.selectHotel}" 
+<programlisting language="XML" role="XML"><![CDATA[<s:link view="/hotel.xhtml" action="#{hotelSearch.selectHotel}" 
    value="#{hotel.name}"/>
  ]]></programlisting>
 		 <para>
 			You can leave the scope of an existing conversation:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link view="/main.xhtml" propagation="none"/>
+<programlisting language="XML" role="XML"><![CDATA[<s:link view="/main.xhtml" propagation="none"/>
 ]]>
 </programlisting>
 		 <para>
 			You can begin, end, or nest conversations:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link action="#{issueEditor.viewComment}" propagation="nest"/>
+<programlisting language="XML" role="XML"><![CDATA[<s:link action="#{issueEditor.viewComment}" propagation="nest"/>
 ]]>
 </programlisting>
 		 <para>
 			If the link begins a conversation, you can specify the use of a particular pageflow:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link action="#{documentEditor.getDocument}" propagation="begin" 
+<programlisting language="XML" role="XML"><![CDATA[<s:link action="#{documentEditor.getDocument}" propagation="begin" 
    pageflow="EditDocument"/>
 ]]>
 </programlisting>
@@ -412,7 +412,7 @@
 			The <literal>taskInstance</literal> attribute is for use in jBPM task lists, as follows. (See the DVD Store demo application for examples of this.<!-- #modify: xref? -->)
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link action="#{documentApproval.approveOrReject}" 
+<programlisting language="XML" role="XML"><![CDATA[<s:link action="#{documentApproval.approveOrReject}" 
    taskInstance="#{task}"/>
  ]]>
 </programlisting>
@@ -420,7 +420,7 @@
 			Finally, use <literal><![CDATA[<s:button>]]></literal> if you want the "link" rendered as a button:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:button action="#{login.logout}" value="Logout"/>
+<programlisting language="XML" role="XML"><![CDATA[<s:button action="#{login.logout}" value="Logout"/>
 ]]>
 </programlisting>
 	</section>
@@ -434,7 +434,7 @@
 			The built-in conversation-scoped Seam component named <literal>facesMessages</literal> solves this problem. (This requires the Seam redirect filter.)
 		</para>
 		 
-<programlisting role="JAVA"><![CDATA[@Name("editDocumentAction") 
+<programlisting language="Java" role="JAVA">@Name("editDocumentAction") 
 @Stateless 
 public class EditDocumentBean implements EditDocument { 
   @In EntityManager em; 
@@ -445,8 +445,7 @@
     em.merge(document); 
     facesMessages.add("Document updated");  
   } 
-}]]>
-</programlisting>
+}</programlisting>
 		 <para>
 			When a message is added to <literal>facesMessages</literal>, it is used in the nextg render response phase for the current conversation. Since Seam preserves even temporary conversation contexts across redirects, this works even without a long-running conversation.
 		</para>
@@ -454,14 +453,12 @@
 			You can even include JSF EL expressions in a Faces message summary:
 		</para>
 		 
-<programlisting role="JAVA"><![CDATA[facesMessages.add("Document #{document.title} was updated");
-]]>
-</programlisting>
+<programlisting language="Java" role="JAVA">facesMessages.add("Document #{document.title} was updated");</programlisting>
 		 <para>
 			Messages are displayed as usual:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:messages globalOnly="true"/>
+<programlisting language="XML" role="XML"><![CDATA[<h:messages globalOnly="true"/>
 ]]>
 </programlisting>
 	</section>
@@ -547,15 +544,13 @@
 			Here we see that invoking <literal>#{bidAction.placeBid}</literal> redirects us to <filename>/bid.xhtml</filename>, which is configured with the natural conversation ID <literal>PlaceBid</literal>. Our action method declaration looks like this:
 		</para>
 		 
-<programlisting role="JAVA"><![CDATA[@Begin(join = true) 
-public void placeBid()
-]]>
-</programlisting>
+<programlisting language="Java" role="JAVA">@Begin(join = true) 
+public void placeBid() </programlisting>
 		 <para>
 			When named conversations are specified in the <literal><![CDATA[<page/>]]></literal> element, redirection to the named conversation occurs as part of navigation rules following the invocation of the action method. This can cause problems when redirecting to an existing conversation, since redirection needs to occur before the action method is invoked. Therefore, the conversation name must be specified before the action is invoked. One method of doing this uses the <literal><![CDATA[<s:conversationName>]]></literal> tag:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandButton id="placeBidWithAmount" styleClass="placeBid" 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandButton id="placeBidWithAmount" styleClass="placeBid" 
    action="#{bidAction.placeBid}"> 
   <s:conversationName value="PlaceBid"/> 
 </h:commandButton>]]>
@@ -564,7 +559,7 @@
 			You can also specify the <literal>conversationName</literal> attribute for either the <literal>s:link</literal> or <literal>s:button</literal>:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<s:link value="Place Bid" action="#{bidAction.placeBid}" 
+<programlisting language="XML" role="XML"><![CDATA[<s:link value="Place Bid" action="#{bidAction.placeBid}" 
    conversationName="PlaceBid"/>
 ]]>
 </programlisting>
@@ -593,7 +588,7 @@
 				With JSF or Seam navigation rules in place, Seam switches to a conversation by restoring the current <literal>view-id</literal> for that conversation. The descriptive text for the workspace is defined in a file called <filename>pages.xml</filename>, which Seam expects to find in the <literal>WEB-INF</literal> directory alongside <filename>faces-config.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<pages> 
+<programlisting language="XML" role="XML"><![CDATA[<pages> 
   <page view-id="/main.xhtml"> 
     <description>Search hotels: #{hotelBooking.searchString}</description> 
   </page> 
@@ -622,7 +617,7 @@
 				When a jPDL pageflow definition is in place, Seam switches to a particular conversation by restoring the current jBPM process state. This is a more flexible model, since it allows the same <literal>view-id</literal> to have different descriptions depending on the current <literal><![CDATA[<page>]]></literal> node. The description text is defined by the <literal><![CDATA[<page>]]></literal> node:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<pageflow-definition name="shopping"> 
+<programlisting language="XML" role="XML"><![CDATA[<pageflow-definition name="shopping"> 
   <start-state name="start"> 
     <transition to="browse"/> 
   </start-state> 
@@ -649,7 +644,7 @@
 				Including the following fragment in your JSP or Facelets page will include a drop-down menu that lets you switch to any current conversation, or any other page of the application:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:selectOneMenu value="#{switcher.conversationIdOrOutcome}"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:selectOneMenu value="#{switcher.conversationIdOrOutcome}"> 
   <f:selectItem itemLabel="Find Issues" itemValue="findIssue"/> 
   <f:selectItem itemLabel="Create Issue" itemValue="editIssue"/> 
   <f:selectItems value="#{switcher.selectItems}"/> 
@@ -679,7 +674,7 @@
 				The conversation list is similar to the conversation switcher, except that it is displayed as a table:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:dataTable value="#{conversationList}" var="entry" 
+<programlisting language="XML" role="XML"><![CDATA[<h:dataTable value="#{conversationList}" var="entry" 
    rendered="#{not empty conversationList}">
   <h:column>
     <f:facet name="header">Workspace</f:facet>
@@ -729,7 +724,7 @@
 				Breadcrumbs are a list of links to conversations in the current conversation stack. They are useful for applications with a nested conversation model:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<ui:repeat value="#{conversationStack}" var="entry"> 
+<programlisting language="XML" role="XML"><![CDATA[<ui:repeat value="#{conversationStack}" var="entry"> 
   <h:outputText value=" | "/> 
   <h:commandLink value="#{entry.description}" action="#{entry.select}"/> 
 </ui:repeat
@@ -756,25 +751,21 @@
 			You can work around this by storing component bindings with an event-scoped component, and injecting this into the requiring conversation-scoped component.
 		</para>
 		 
-<programlisting role="JAVA"><![CDATA[@Name("grid") 
+<programlisting language="Java" role="JAVA">@Name("grid") 
 @Scope(ScopeType.EVENT) 
 public class Grid { 
   private HtmlPanelGrid htmlPanelGrid; // getters and setters 
   ... 
-}
-]]>
-</programlisting>
+}</programlisting>
 		 
-<programlisting role="JAVA"><![CDATA[@Name("gridEditor") 
+<programlisting language="Java" role="JAVA">@Name("gridEditor") 
 @Scope(ScopeType.CONVERSATION) 
 public class GridEditor { 
   @In(required=false) 
   
   private Grid grid; 
   ... 
-}
-]]>
-</programlisting>
+}</programlisting>
 		 <para>
 			You are also limited in that a conversation-scoped component cannot be injected into an event-scoped component with a JSF control bound to it. This includes Seam built-in components like <literal>facesMessages</literal>.
 		</para>
@@ -782,7 +773,7 @@
 			You can also access the JSF component tree with the implicit <literal>uiComponent</literal> handle. The following example accesses the <literal>getRowIndex()</literal> of the <literal>UIData</literal> component that backs the data table during iteration, and prints the current row number:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:dataTable id="lineItemTable" var="lineItem" 
+<programlisting language="XML" role="XML"><![CDATA[<h:dataTable id="lineItemTable" var="lineItem" 
    value="#{orderHome.lineItems}"> 
   <h:column> 
     Row: #{uiComponent[&#39;lineItemTable&#39;].rowIndex} 
@@ -810,14 +801,14 @@
 			We can set a sensible default for the concurrent request timeout (in milliseconds) in components.xml:
 		</para>
 		 
-<programlisting role="XML"><![CDATA[<core:manager concurrent-request-timeout="500" />
+<programlisting language="XML" role="XML"><![CDATA[<core:manager concurrent-request-timeout="500" />
 ]]>
 </programlisting>
 		 <para>
 			The concurrent request timeout can also be adjusted on a page-by-page basis:
 		</para>
 		 
-<programlisting role="XML"><![CDATA[<page view-id="/book.xhtml" conversation-required="true" 
+<programlisting language="XML" role="XML"><![CDATA[<page view-id="/book.xhtml" conversation-required="true" 
       login-required="true" concurrent-request-timeout="2000" />
 ]]>
 </programlisting>
@@ -842,7 +833,7 @@
 				A polling approach requires less fine-tuning &#8212; simply mark your action method <literal>@Asynchronous</literal> and decide on a polling interval:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[int total; 
+<programlisting language="Java" role="JAVA">int total; 
 
 // This method is called when an event occurs on the client 
 // It takes a really long time to execute 
@@ -855,9 +846,7 @@
 // It's very quick to execute    
 public int getTotal() { 
   return total; 
-}
-]]>
-</programlisting>
+}</programlisting>
 		</section>
 		
 		 <section>
@@ -866,7 +855,7 @@
 				However carefully your application is designed to queue concurrent requests to your conversational component, there is a risk that the server will overload. When overload occurs, not all requests will be processed before the <literal>concurrent-request-timeout</literal> period expires. In this case, Seam throws a <exceptionname>ConcurrentRequestTimeoutException</exceptionname>, which is handled in <filename>pages.xml</filename>. We recommend sending a HTTP 503 error:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<exception class="org.jboss.seam.ConcurrentRequestTimeoutException" 
+<programlisting language="XML" role="XML"><![CDATA[<exception class="org.jboss.seam.ConcurrentRequestTimeoutException" 
            log-level="trace"> 
   <http-error error-code="503" /> 
 </exception>]]>
@@ -881,7 +870,7 @@
 				Alternatively you could redirect to an error page:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<exception class="org.jboss.seam.ConcurrentRequestTimeoutException" 
+<programlisting language="XML" role="XML"><![CDATA[<exception class="org.jboss.seam.ConcurrentRequestTimeoutException" 
            log-level="trace"> 
   <end-conversation/> 
   <redirect view-id="/error.xhtml"> 
@@ -897,7 +886,7 @@
 				ICEfaces, RichFaces AJAX and Seam Remoting can all handle HTTP error codes. Seam Remoting will pop up a dialog box showing the HTTP error. ICEfaces will indicate the error in its connection status component. RichFaces provides the most complete support for handling HTTP errors by providing a user definable callback. For example, to show the error message to the user:
 			</para>
 			 
-<programlisting><![CDATA[<script type="text/javascript"> 
+<programlisting language="XML" role="XML"><![CDATA[<script type="text/javascript"> 
   A4J.AJAX.onError = function(req,status,message) { 
     alert("An error occurred"); 
   }; 
@@ -907,7 +896,7 @@
 				If, rather than an error code, the server reports that the view has expired, perhaps because a session timed out, use a separate callback function in RichFaces:
 			</para>
 			 
-<programlisting><![CDATA[<script type="text/javascript"> 
+<programlisting language="XML" role="XML"><![CDATA[<script type="text/javascript"> 
   A4J.AJAX.onExpired = function(loc,message) { 
     alert("View expired"); 
   }; 
@@ -918,9 +907,7 @@
 				Alternatively, you can allow RichFaces to handle the error. In this case, the user will receive a prompt reading, "View state could not be restored &#8212; reload page?" This message can be globally customized by setting the following message key in an application resource bundle:
 			</para>
 			 
-<programlisting><![CDATA[AJAX_VIEW_EXPIRED=View expired. Please reload the page.
-]]>
-</programlisting>
+<screen>AJAX_VIEW_EXPIRED=View expired. Please reload the page.</screen>
 		</section>
 		
 		 <section>




More information about the jboss-cvs-commits mailing list