[jboss-cvs] jboss-seam/src/main/org/jboss/seam/pages ...

Shane Bryzak sbryzak at redhat.com
Thu Mar 8 02:34:15 EST 2007


  User: sbryzak2
  Date: 07/03/08 02:34:15

  Modified:    src/main/org/jboss/seam/pages    
                        ConversationIdParameter.java
                        ELConversationIdParameter.java Page.java
                        SyntheticConversationIdParameter.java
  Log:
  natural conversation ids
  
  Revision  Changes    Path
  1.2       +5 -3      jboss-seam/src/main/org/jboss/seam/pages/ConversationIdParameter.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConversationIdParameter.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/pages/ConversationIdParameter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ConversationIdParameter.java	5 Mar 2007 11:25:12 -0000	1.1
  +++ ConversationIdParameter.java	8 Mar 2007 07:34:15 -0000	1.2
  @@ -2,8 +2,10 @@
   
   public interface ConversationIdParameter
   {
  +   String getName();
     String getParameterName();
     String getParameterValue();
     
     String getInitialConversationId();
  +   String getRequestConversationId();
   }
  
  
  
  1.2       +23 -19    jboss-seam/src/main/org/jboss/seam/pages/ELConversationIdParameter.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ELConversationIdParameter.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/pages/ELConversationIdParameter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ELConversationIdParameter.java	5 Mar 2007 11:25:12 -0000	1.1
  +++ ELConversationIdParameter.java	8 Mar 2007 07:34:15 -0000	1.2
  @@ -5,7 +5,6 @@
   import org.jboss.seam.core.Expressions;
   import org.jboss.seam.core.Manager;
   import org.jboss.seam.core.Expressions.ValueBinding;
  -import org.jboss.seam.util.Id;
   
   /**
    * Represents a conversation parameter that can be used to create a "natural"
  @@ -34,17 +33,8 @@
      
      public String getParameterName()
      {
  -      String conversationId = Manager.instance().getCurrentConversationId();
  -      int idx = conversationId.indexOf(':');
  -      if (idx != -1)
  -      {
            return paramName;
         }
  -      else
  -      {
  -         return Manager.instance().getConversationIdParameter();
  -      }            
  -   }
      
      public String getInitialConversationId()
      {
  @@ -54,8 +44,10 @@
         
         if (value == null)
         {
  -         // TODO - redirect to no-conversation-view-id ?
  -         return Id.nextId();
  +         return null;
  +         
  +//          TODO - redirect to no-conversation-view-id ?
  +//         return Id.nextId();
         }
         else
         {
  @@ -63,6 +55,11 @@
         }
      }
   
  +   public String getRequestConversationId()
  +   {
  +      return getInitialConversationId();
  +   }
  +
      public String getParameterValue()
      {
         Object value = vb.getValue();
  @@ -73,6 +70,8 @@
         else
         {      
            String conversationId = Manager.instance().getCurrentConversationId();
  +         if (conversationId != null)
  +         {
            int idx = conversationId.indexOf(':');
            if (idx != -1)
            {
  @@ -83,6 +82,11 @@
               return conversationId;
            }      
         }
  +         else
  +         {
  +            return null;
  +         }
  +      }
   
      }
   }
  
  
  
  1.15      +15 -0     jboss-seam/src/main/org/jboss/seam/pages/Page.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Page.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/pages/Page.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- Page.java	22 Feb 2007 15:12:22 -0000	1.14
  +++ Page.java	8 Mar 2007 07:34:15 -0000	1.15
  @@ -31,6 +31,7 @@
      private ConversationControl conversationControl = new ConversationControl();
      private TaskControl taskControl = new TaskControl();
      private ProcessControl processControl = new ProcessControl();
  +   private ConversationIdParameter conversationIdParameter;
      
      /**
       * The scheme (http/https) required by this page.
  @@ -60,6 +61,8 @@
               this.setResourceBundleName( viewId.substring(1, loc) );
            }
         }
  +      
  +      conversationIdParameter = new SyntheticConversationIdParameter();
      }
      
      public java.util.ResourceBundle getResourceBundle()
  @@ -279,4 +282,16 @@
      {
         this.scheme = scheme;
      }
  +   
  +   public ConversationIdParameter getConversationIdParameter()
  +   {
  +      return conversationIdParameter;
  +   }
  +   
  +   public void setConversationIdParameter(ConversationIdParameter param)
  +   {
  +      this.conversationIdParameter = param;
  +   }
  +   
  +   
   }
  \ No newline at end of file
  
  
  
  1.2       +16 -0     jboss-seam/src/main/org/jboss/seam/pages/SyntheticConversationIdParameter.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SyntheticConversationIdParameter.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/pages/SyntheticConversationIdParameter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- SyntheticConversationIdParameter.java	5 Mar 2007 11:25:12 -0000	1.1
  +++ SyntheticConversationIdParameter.java	8 Mar 2007 07:34:15 -0000	1.2
  @@ -1,10 +1,17 @@
   package org.jboss.seam.pages;
   
  +import javax.faces.context.FacesContext;
  +
   import org.jboss.seam.core.Manager;
   import org.jboss.seam.util.Id;
   
   public class SyntheticConversationIdParameter implements ConversationIdParameter
   {
  +   public String getName()
  +   {
  +      return null;
  +   }
  +   
      public String getParameterName()
      {
         return Manager.instance().getConversationIdParameter();
  @@ -19,4 +26,13 @@
      {
         return Id.nextId();  
      }
  +   
  +   public String getRequestConversationId()
  +   {
  +      FacesContext ctx = FacesContext.getCurrentInstance();
  +      
  +      String value = (String) ctx.getExternalContext().getRequestParameterMap().get(getParameterName());      
  +      
  +      return value != null ? value : Manager.instance().getCurrentConversationId();
  +   }
   }
  
  
  



More information about the jboss-cvs-commits mailing list