You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/01/29 12:24:18 UTC

svn commit: r616265 - in /myfaces/orchestra/trunk/core/src/site/xdoc: alternative-configuration.xml bestPractice.xml component-bindings.xml conversation.xml installation.xml usage.xml

Author: skitching
Date: Tue Jan 29 03:24:17 2008
New Revision: 616265

URL: http://svn.apache.org/viewvc?rev=616265&view=rev
Log:
Update docs to talk about "access" scope rather than "flash".

Modified:
    myfaces/orchestra/trunk/core/src/site/xdoc/alternative-configuration.xml
    myfaces/orchestra/trunk/core/src/site/xdoc/bestPractice.xml
    myfaces/orchestra/trunk/core/src/site/xdoc/component-bindings.xml
    myfaces/orchestra/trunk/core/src/site/xdoc/conversation.xml
    myfaces/orchestra/trunk/core/src/site/xdoc/installation.xml
    myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/alternative-configuration.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/alternative-configuration.xml?rev=616265&r1=616264&r2=616265&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/alternative-configuration.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/alternative-configuration.xml Tue Jan 29 03:24:17 2008
@@ -68,7 +68,7 @@
     <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
       <property name="scopes">
         <map>
-          <entry key="conversation.flash">
+          <entry key="conversation.access">
             <bean class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope">
               <property name="advices">
                 <list>
@@ -173,4 +173,4 @@
 		
 		</section>
 	</body>
-</document>		
\ No newline at end of file
+</document>		

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/bestPractice.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/bestPractice.xml?rev=616265&r1=616264&r2=616265&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/bestPractice.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/bestPractice.xml Tue Jan 29 03:24:17 2008
@@ -31,7 +31,7 @@
 			is best used. As always, best practices evolve - see the wiki for the latest
 			information.
 
-			<subsection name="Single Page Conversation With Flash Scope">
+			<subsection name="Single Page Conversation With Access Scope">
 
 				<p>
 					This applies when you have a single page that the user may submit multiple times
@@ -42,7 +42,7 @@
 
 				<p>
 					Write a single managed bean for the view. Configure this bean as belonging
-					to an unnamed "flash" conversation scope and reference it as normal from 
+					to an unnamed access-scoped conversation and reference it as normal from 
 					your presentation pages (jsp, facelets, clay, etc).
 				</p>
 
@@ -67,7 +67,7 @@
 
 			</subsection>
 
-			<subsection name="Multi Page Conversation With Flash Scope">
+			<subsection name="Multi Page Conversation With Access Scope">
 				<p>
 					This applies when you have a set of pages that cooperate together to interact
 					with the user, but where the state used by these pages must be held in memory.
@@ -77,8 +77,8 @@
 				</p>
 
 				<p>
-					Use one flash-scoped controller for the whole conversation, plus one simple
-					request-scoped or flash-scoped bean per view. For example, if you have three
+					Use one access-scoped controller for the whole conversation, plus one simple
+					request-scoped or access-scoped bean per view. For example, if you have three
 					pages then structure things as follows:
 
 					<ul>
@@ -95,7 +95,7 @@
 				</p>
 				<p>
 				The per-view beans handle logic and state that is specific to that page. If there is state needed
-				for the page, then use "flash" scope, otherwise use "request" scope. Inject the controller bean
+				for the page, then use "access" scope, otherwise use "request" scope. Inject the controller bean
 				into each per-view bean so that state and logic which is shared between views can be accessed.
 				</p>
 				<p>
@@ -140,6 +140,12 @@
 				</p>
 
 				<p>
+				There is one issue: after redirect it would sometimes be nice to display an error
+				message indicating *why* the redirect happened, eg "Invalid Conversation State". This
+				is not easy on a redirect. A forward would be easier to handle, as that data could
+				be placed in request scope.  
+				</p>
+				<p>
 					Without this check, when a user leaps into the middle of a conversation, EL expressions
 					will trigger the creation of the missing purchaseController (and its associated conversation)
 					but the bean probably does not have the appropriate state to render the page correctly.
@@ -177,11 +183,11 @@
 				<p>
 					In some cases a conversation should not terminate until page N has been visited,
 					but in the middle a user can go off and visit a page that has no references to
-					any managed beans within the main conversation. When using Flash scopes, Orchestra
+					any managed beans within the main conversation. When using Access scopes, Orchestra
 					will interpret a visit to such as page as the user "abandoning" the conversation,
 					so the conversation will be discarded. In this case, use a manual scoped conversation,
 					ie one that must be explicitly ended via either a JSF component (ox:endConversation)
-					or a call to the Orchestra API from an action method. Use flash scopes where possible,
+					or a call to the Orchestra API from an action method. Use access scopes where possible,
 					though - they are less work.
 				</p>
 

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/component-bindings.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/component-bindings.xml?rev=616265&r1=616264&r2=616265&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/component-bindings.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/component-bindings.xml Tue Jan 29 03:24:17 2008
@@ -63,8 +63,8 @@
 				binding must be request-scoped.
 				</p>
 				<p>
-				However what has been recommended in the "Orchestra best practices" is a flash-scoped backing bean for
-				a view and an additional (flash or manual) conversation-scoped controller for multi-page conversations.
+				However what has been recommended in the "Orchestra best practices" is an access-scoped backing bean for
+				a view and an additional (access or manual) conversation-scoped controller for multi-page conversations.
 				The page controller/model now is stateful, which is exactly what we wanted, however when component bindings
 				are needed then they should not be stored on these beans because they are not request-scoped.
 				</p>
@@ -105,7 +105,7 @@
    &lt;aop:scoped-proxy /&gt;
 &lt;/bean&gt;
 
-&lt;bean id="viewcontrollerbean" scope="conversation.flash" ...&gt;
+&lt;bean id="viewcontrollerbean" scope="conversation.access" ...&gt;
       &lt;property name="componentbindingmodel"
             ref="componentbindingmodel" /&gt;
 

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/conversation.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/conversation.xml?rev=616265&r1=616264&r2=616265&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/conversation.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/conversation.xml Tue Jan 29 03:24:17 2008
@@ -132,7 +132,7 @@
 			difficult to achieve with simple session storage. A conversation can be
 			terminated in a number of ways:
 			<ul>
-				<li><p>flash conversations end when a request occurs that does not access any bean in that conversation;</p></li>
+				<li><p>access-scoped conversations end when a request occurs that does not access any bean in that conversation;</p></li>
 				<li><p>a JSF endConversation component is provided that can be inserted into a page;</p></li>
 				<li><p>a direct call can be made from a backing bean, eg after performing a "save" or "cancel" operation;</p></li>
 				<li><p>a conversation timeout can be configured to automatically expire conversations after a specified time limit.</p></li>
@@ -147,8 +147,8 @@
 			</p>
 
 			<p>
-			A conversation can have a <i>policy</i> of "flash" or "manual".
-			A "flash" conversation is automatically ended (ie deleted) if a request is executed
+			A conversation can have a <i>lifetime</i> of "access" or "manual".
+			An access-scoped conversation is automatically ended (ie deleted) if a request is executed
 			which does not reference any bean in that conversation's scope. This is
 			very convenient when a sequence of pages all have at least one reference
 			to a bean of that conversation scope. If the user navigates to any other

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/installation.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/installation.xml?rev=616265&r1=616264&r2=616265&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/installation.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/installation.xml Tue Jan 29 03:24:17 2008
@@ -116,7 +116,7 @@
             </bean>
           </entry>
 
-          <entry key="conversation.flash">
+          <entry key="conversation.access">
             <bean class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope">
               <property name="timeout" value="30" />
               <property name="advices">
@@ -124,7 +124,7 @@
                   <ref bean="persistentContextConversationInterceptor"/>
                 </list>
               </property>
-              <property name="lifetime" value="flash"/>
+              <property name="lifetime" value="access"/>
             </bean>
           </entry>
         </map>
@@ -185,8 +185,8 @@
 					</li>
 					<li>2. the conversation scopes
 						<br/>
-						Here we configure both "conversation.flash" and "conversation.manual" as new Spring
-						custom scopes. This configuration allows us to use	scope="conversation.flash"
+						Here we configure both "conversation.access" and "conversation.manual" as new Spring
+						custom scopes. This configuration allows us to use scope="conversation.access"
 						or scope="conversation.manual" within our bean declarations. The scope definition
 						also allows a number of advices (interceptors) to be configured; advices intercept
 						each method call to a bean in that scope. We add an interceptor here to ensure that

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml?rev=616265&r1=616264&r2=616265&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml Tue Jan 29 03:24:17 2008
@@ -50,7 +50,7 @@
 				<code><pre>
 &lt;bean name="userInfo"
     class="my.app.pck.backings.UserInfo"
-    scope="conversation.flash"
+    scope="conversation.access"
     autowire="byName"&gt;
     &lt;aop:scoped-proxy /&gt;
 &lt;/bean&gt;
@@ -58,21 +58,8 @@
 				<p>
 					We've learned about this syntax in the small example in the introduction - a short repetition:
 					<br/>
-					First, the scope-attribute of the bean-element will be defining the name of the scope; the 
-					names can be whatever you like but we recommend "conversation.flash" and "conversation.manual".
-					<br/>
-					Second, it is very important to use the
-					<b>
-						<code>&lt;aop:scoped-proxy /&gt;</code>
-					</b>
-					child-element. Bear with us - we'll explain to you why that is right now.
-					<br/>
-					Using the <code>&lt;aop:scoped-proxy /&gt;</code>
-					ensures that you will never have a reference to
-					the real instance of your bean, but to a proxy to it. There is no difference
-					in the way how you work with this instance in your code, but if you
-					end a conversation and restart it, you'll appreciate the difference: the proxy will make
-					sure that your application will see the new instance.
+					The scope-attribute of the bean-element will be defining the name of the scope; the 
+					names can be whatever you like but we recommend "conversation.access" and "conversation.manual".
 				</p>
 				<p>The
 					<code>autowire="byName"</code>
@@ -117,7 +104,7 @@
 			<subsection name="Closing a conversation">
 			<p>
 				Closing a conversation is straightforward as well. If the bean is in a scope
-				that has been marked with lifetime=flash then the conversation terminates 
+				that has been marked with lifetime=access then the conversation terminates 
 				when a request is processed without referring to anything in that conversation.
 				If you've using a "manual" conversation instead, then you need to call:
 				<pre>
@@ -248,6 +235,33 @@
 				</p>
 			</subsection>
 
+			<subsection name="Using older Orchestra Releases">
+				<p>
+				The documentation above applies to the most recent Orchestra code. When using older
+				releases, the following information is useful.
+				</p>
+				<subsection name="Using aop:scoped-proxy">
+					<p>
+					For Orchestra 1.0, you should add an <code>&lt;aop:scoped-proxy /&gt;</code>
+					within the declaration of each bean that is of conversation scope. This ensures
+					that you will never have a reference to the real instance of your bean, but to
+					a proxy to it. There is no difference in the way how you work with this instance
+					in your code, but if you end a conversation and restart it, you'll appreciate the
+					difference: the proxy will make	sure that your application will see the new instance.
+					</p>
+					<p>
+					This is automatically done for you with Orchestra 1.1 and later.
+					</p>
+				</subsection>
+				<subsection name="Flash Scope">
+					In version 1.0, the name "flash scope" was used for what is now called
+					"access scope". The two concepts are the same; when using orchestra 1.1
+					you must simply write "flash" wherever the more modern documentation
+					states "access". Orchestra 1.1 supports the old term for backwards
+					compatibility, so configuration files written for 1.0 should work fine
+					with release 1.1.
+				</subsection>
+			</subsection>
 		</section>
 	</body>
-</document>
\ No newline at end of file
+</document>