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

Shane Bryzak sbryzak at redhat.com
Tue Nov 20 22:09:32 EST 2007


  User: sbryzak2
  Date: 07/11/20 22:09:32

  Modified:    src/main/org/jboss/seam/navigation  ConversationControl.java
  Log:
  initial support for named conversations
  
  Revision  Changes    Path
  1.4       +161 -158  jboss-seam/src/main/org/jboss/seam/navigation/ConversationControl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConversationControl.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/navigation/ConversationControl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- ConversationControl.java	21 Jun 2007 05:27:29 -0000	1.3
  +++ ConversationControl.java	21 Nov 2007 03:09:32 -0000	1.4
  @@ -1,10 +1,11 @@
   package org.jboss.seam.navigation;
  -
   import org.jboss.seam.annotations.FlushModeType;
   import org.jboss.seam.core.Conversation;
  +import org.jboss.seam.core.ConversationEntries;
  +import org.jboss.seam.core.ConversationEntry;
  +import org.jboss.seam.core.Manager;
   import org.jboss.seam.core.Expressions.ValueExpression;
   import org.jboss.seam.pageflow.Pageflow;
  -
   /**
    * 
    * Demarcation of the conversation in pages.xml
  @@ -13,7 +14,6 @@
    */
   public class ConversationControl
   {
  -
      private boolean isBeginConversation;
      private boolean isEndConversation;
      private boolean isEndConversationBeforeRedirect;
  @@ -23,22 +23,19 @@
      private String pageflow;
      private ValueExpression<Boolean> beginConversationCondition;
      private ValueExpression<Boolean> endConversationCondition;
  -   
  +   private String conversationName;
      public boolean isBeginConversation()
      {
         return isBeginConversation;
      }
  -
      public void setBeginConversation(boolean isBeginConversation)
      {
         this.isBeginConversation = isBeginConversation;
      }
  -
      public boolean isEndConversation()
      {
         return isEndConversation;
      }
  -
      public void setEndConversation(boolean isEndConversation)
      {
         this.isEndConversation = isEndConversation;
  @@ -59,6 +56,18 @@
         }
         if ( beginConversation() )
         {
  +         if (conversationName != null)
  +         {
  +            ConversationIdParameter param = Pages.instance().getConversationIdParameter(conversationName);
  +            
  +            ConversationEntry ce = ConversationEntries.instance().getConversationEntry(param.getConversationId());
  +            if (ce != null)
  +            {
  +               ce.redirect();
  +               return;
  +            }            
  +         }
  +         
            boolean begun = Conversation.instance().begin(join, nested);
            if (begun)
            {
  @@ -73,87 +82,81 @@
            }
         }
      }
  -
      private boolean beginConversation()
      {
         return isBeginConversation && 
            (beginConversationCondition==null || Boolean.TRUE.equals( beginConversationCondition.getValue() ) );
      }
  -
      private boolean endConversation()
      {
         return isEndConversation && 
            (endConversationCondition==null || Boolean.TRUE.equals( endConversationCondition.getValue() ) );
      }
  -
      public FlushModeType getFlushMode()
      {
         return flushMode;
      }
  -
      public void setFlushMode(FlushModeType flushMode)
      {
         this.flushMode = flushMode;
      }
  -
      public boolean isJoin()
      {
         return join;
      }
  -
      public void setJoin(boolean join)
      {
         this.join = join;
      }
  -
      public boolean isNested()
      {
         return nested;
      }
  -
      public void setNested(boolean nested)
      {
         this.nested = nested;
      }
  -
      public String getPageflow()
      {
         return pageflow;
      }
  -
      public void setPageflow(String pageflow)
      {
         this.pageflow = pageflow;
      }
  -
      public boolean isEndConversationBeforeRedirect()
      {
         return isEndConversationBeforeRedirect;
      }
  -
      public void setEndConversationBeforeRedirect(boolean isEndConversationBeforeRedirect)
      {
         this.isEndConversationBeforeRedirect = isEndConversationBeforeRedirect;
      }
  -
      public ValueExpression<Boolean> getBeginConversationCondition()
      {
         return beginConversationCondition;
      }
  -
      public void setBeginConversationCondition(ValueExpression<Boolean> beginConversationCondition)
      {
         this.beginConversationCondition = beginConversationCondition;
      }
  -
      public ValueExpression<Boolean> getEndConversationCondition()
      {
         return endConversationCondition;
      }
  -
      public void setEndConversationCondition(ValueExpression<Boolean> endConversationCondition)
      {
         this.endConversationCondition = endConversationCondition;
      }
      
  +   public String getConversationName()
  +   {
  +      return conversationName;
  +   }
  +   
  +   public void setConversationName(String conversationName)
  +   {
  +      this.conversationName = conversationName;
  +   }
  +   
   }
  \ No newline at end of file
  
  
  



More information about the jboss-cvs-commits mailing list