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 2007/10/04 13:54:22 UTC

svn commit: r581867 - in /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf: components/ lib/

Author: skitching
Date: Thu Oct  4 04:54:21 2007
New Revision: 581867

URL: http://svn.apache.org/viewvc?rev=581867&view=rev
Log:
Prefix EndConversationMethodBindingFacade classname with underscore to indicate it is for internal use only.

Added:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/_EndConversationMethodBindingFacade.java
      - copied, changed from r581866, myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/EndConversationMethodBindingFacade.java
Removed:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/EndConversationMethodBindingFacade.java
Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/EndConversationTag.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/EndConversationTag.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/EndConversationTag.java?rev=581867&r1=581866&r2=581867&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/EndConversationTag.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/EndConversationTag.java Thu Oct  4 04:54:21 2007
@@ -20,7 +20,6 @@
 package org.apache.myfaces.orchestra.conversation.jsf.components;
 
 import javax.faces.component.UIComponent;
-import javax.faces.el.MethodBinding;
 
 /**
  * End a conversation.

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java?rev=581867&r1=581866&r2=581867&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java Thu Oct  4 04:54:21 2007
@@ -19,18 +19,19 @@
 
 package org.apache.myfaces.orchestra.conversation.jsf.components;
 
-import org.apache.myfaces.orchestra.conversation.ConversationUtils;
-import org.apache.myfaces.orchestra.conversation._ConversationUtils;
-import org.apache.myfaces.orchestra.conversation.jsf.lib.EndConversationMethodBindingFacade;
-import org.apache.myfaces.shared_orchestra.util.StringUtils;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
 
 import javax.faces.component.UICommand;
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
 import javax.faces.el.ValueBinding;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
+
+import org.apache.myfaces.orchestra.conversation.ConversationUtils;
+import org.apache.myfaces.orchestra.conversation._ConversationUtils;
+import org.apache.myfaces.orchestra.conversation.jsf.lib._EndConversationMethodBindingFacade;
+import org.apache.myfaces.shared_orchestra.util.StringUtils;
 
 /**
  * End a conversation.
@@ -48,19 +49,34 @@
  * The "name" attribute is mandatory, and specifies which conversation is to be ended.
  * The optional attributes are:
  * <ul>
- * <li>onOutcome: end the conversation only if the method returns a specific outcome.
- * This can be a comma-separated list of outcomes in which case the conversation
- * ends if any of the outcomes are returned. It is not possible to match a
- * null outcome.</li>
- * <li>errorOutcome: in case of an exception, use the given outcome as new outcome
- * so you can issue a navigation instead of the default errorPage. This value is
- * checked against the onOutcome list to determine whether the specified conversation
- * should be terminated when an exception occurs.</li>
+ * <li>onOutcome</li>
+ * <li>errorOutcome</li>
  * </ul>
- * <p>
- * If this component has no ancestor UICommand component then the specified conversation
- * is always ended when the page is rendered. The "onOutcome" and "errorOutcome" attributes
- * are not used.
+ * 
+ * <h2>onOutcome</h2>
+ * 
+ * This is a string or comma-separated list of strings. After invoking the action
+ * associated with the nearest ancestor UICommand component, the following rules
+ * are executed:
+ * <ul>
+ *   <li>If there is no ancestor UICommand component then end the conversation, else</li>
+ *   <li>If the action returned null, then do not end the conversation, else</li>
+ *   <li>If the onOutcomes list is null or empty then end the conversation, else</li>
+ *   <li>If the returned value is in the onOutcomes list then end the conversation, else</li>
+ *   <li>do not end the conversation.</li>
+ * </ul>
+ * 
+ * Note in particular that when this component has no enclosing UICommand component, then
+ * the specified conversation is always terminated. This is often useful on the "confirmation"
+ * page of a wizard-style page sequence.
+ * 
+ * <h2>errorOutcome</h2>
+ * 
+ * In case of an exception, use the given outcome as new outcome so normal navigation to a 
+ * specified page can occur instead of showing the default errorPage. This value is
+ * checked against the onOutcome list to determine whether the specified conversation
+ * should be terminated when an exception occurs. If an exception occurs, but no
+ * errorOutcome is specified then the conversation is never terminated.
  */
 public class UIEndConversation extends AbstractConversationComponent
 {
@@ -83,7 +99,7 @@
 			if (!inited)
 			{
 				MethodBinding original = command.getAction();
-				command.setAction(new EndConversationMethodBindingFacade(
+				command.setAction(new _EndConversationMethodBindingFacade(
 					getName(),
 					getOnOutcomes(),
 					original,

Copied: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/_EndConversationMethodBindingFacade.java (from r581866, myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/EndConversationMethodBindingFacade.java)
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/_EndConversationMethodBindingFacade.java?p2=myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/_EndConversationMethodBindingFacade.java&p1=myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/EndConversationMethodBindingFacade.java&r1=581866&r2=581867&rev=581867&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/EndConversationMethodBindingFacade.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/lib/_EndConversationMethodBindingFacade.java Thu Oct  4 04:54:21 2007
@@ -45,7 +45,7 @@
  * reported to the ConversationMessager object associated with the conversation, so it can
  * choose whether and how to present the error to the user.
  */
-public class EndConversationMethodBindingFacade extends MethodBinding implements StateHolder
+public class _EndConversationMethodBindingFacade extends MethodBinding implements StateHolder
 {
 	private MethodBinding original;
 	private String conversationName;
@@ -54,7 +54,7 @@
 
 	private boolean _transient = false;
 
-	public EndConversationMethodBindingFacade()
+	public _EndConversationMethodBindingFacade()
 	{
 	}
 
@@ -81,7 +81,7 @@
 	 * values just as if the action method had actually returned this value. When not specified,
 	 * then on exception the current conversation is not ended.
 	 */
-	public EndConversationMethodBindingFacade(
+	public _EndConversationMethodBindingFacade(
 		String conversation,
 		Collection onOutcomes,
 		MethodBinding original,