[seam-commits] Seam SVN: r9168 - in trunk/src/main/org/jboss/seam: navigation and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Oct 1 23:46:37 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-10-01 23:46:37 -0400 (Wed, 01 Oct 2008)
New Revision: 9168

Modified:
   trunk/src/main/org/jboss/seam/core/ConversationPropagation.java
   trunk/src/main/org/jboss/seam/core/Manager.java
   trunk/src/main/org/jboss/seam/navigation/NaturalConversationIdParameter.java
Log:
restore natural conversation from conversation name request parameter

Modified: trunk/src/main/org/jboss/seam/core/ConversationPropagation.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/ConversationPropagation.java	2008-10-02 03:44:15 UTC (rev 9167)
+++ trunk/src/main/org/jboss/seam/core/ConversationPropagation.java	2008-10-02 03:46:37 UTC (rev 9168)
@@ -52,7 +52,6 @@
     */
    public void restoreConversationId(Map parameters)
    {
-      getConversationNameFromRequestParameters(parameters);
       restoreNaturalConversationId(parameters);
       restoreSyntheticConversationId(parameters);
       restorePageContextConversationId();
@@ -93,14 +92,19 @@
          log.debug("Found conversation id in request parameter: " + conversationId);
       }
    }
-   
-   private void getConversationNameFromRequestParameters(Map parameters)
-   {
-      conversationName = getRequestParameterValue(parameters, CONVERSATION_NAME_PARAMETER);
-   }
 
    private void restoreNaturalConversationId(Map parameters)
    {
+      conversationName = getRequestParameterValue(parameters, CONVERSATION_NAME_PARAMETER);
+      
+      if (conversationName != null && conversationName.contains(":"))
+      {
+         int idx = conversationName.indexOf(':');
+         conversationId = conversationName;
+         conversationName = conversationName.substring(0, idx);         
+         return;
+      }
+      
       //First, try to get the conversation id from the request parameter defined for the page
       String viewId = Pages.getCurrentViewId();
       if ( viewId!=null )

Modified: trunk/src/main/org/jboss/seam/core/Manager.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Manager.java	2008-10-02 03:44:15 UTC (rev 9167)
+++ trunk/src/main/org/jboss/seam/core/Manager.java	2008-10-02 03:46:37 UTC (rev 9168)
@@ -97,6 +97,12 @@
     */
    public void updateCurrentConversationId(String id)
    {
+      if (id != null && id.equals(currentConversationId))
+      {
+         // the conversation id hasn't changed, do nothing       
+         return;
+      }
+      
       if ( ConversationEntries.instance().getConversationIds().contains(id) )
       {
          throw new IllegalStateException("Conversation id is already in use: " + id);
@@ -128,8 +134,7 @@
           if (pos != -1) 
           {
               currentConversationIdStack.set(pos, id);
-          }
-          
+          }          
       }
       
       for (int i=0; i<names.length; i++)

Modified: trunk/src/main/org/jboss/seam/navigation/NaturalConversationIdParameter.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/NaturalConversationIdParameter.java	2008-10-02 03:44:15 UTC (rev 9167)
+++ trunk/src/main/org/jboss/seam/navigation/NaturalConversationIdParameter.java	2008-10-02 03:46:37 UTC (rev 9168)
@@ -5,7 +5,6 @@
 import org.jboss.seam.core.ConversationPropagation;
 import org.jboss.seam.core.Expressions;
 import org.jboss.seam.core.Expressions.ValueExpression;
-import org.jboss.seam.util.Id;
 
 /**
  * A conversation parameter strategy for "natural" conversation ids.




More information about the seam-commits mailing list