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/10/27 10:44:50 UTC

svn commit: r708116 - /myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/config/FlowCall.java

Author: skitching
Date: Mon Oct 27 02:44:50 2008
New Revision: 708116

URL: http://svn.apache.org/viewvc?rev=708116&view=rev
Log:
Add the ability for a FlowCall to specify a viewId to navigate to.

Modified:
    myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/config/FlowCall.java

Modified: myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/config/FlowCall.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/config/FlowCall.java?rev=708116&r1=708115&r2=708116&view=diff
==============================================================================
--- myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/config/FlowCall.java (original)
+++ myfaces/orchestra/trunk/flow/src/main/java/org/apache/myfaces/orchestra/flow/config/FlowCall.java Mon Oct 27 02:44:50 2008
@@ -41,7 +41,9 @@
 
     private String outcome;
 
+    private String viewId;
     private String service;
+
     private List params = new ArrayList(4);  // list of FlowParamSend
     private List returns = new ArrayList(4); // list of FlowReturnAccept
 
@@ -83,6 +85,8 @@
             throw new OrchestraException("outcome is null");
         }
 
+        // viewId is optional
+
         if (service == null)
         {
             throw new OrchestraException("service is null");
@@ -171,6 +175,30 @@
     }
 
     /**
+     * Return the viewId to navigate to when this flowCall is triggered.
+     * <p>
+     * Optional; when null then the normal JSF navigation rules apply.
+     * <p>
+     * This can be useful when the JSF command-component that triggers the call is a view "fragment" that
+     * is included into many pages, eg via jsp:include or facelets templating. In this case, specifying
+     * a separate navigation-case for each view that includes the fragment is unreasonable. One option
+     * is to specify the navigation case as a global rule, but it also can be reasonable to hard-wire it
+     * in the "included" page.
+     * <p>
+     * For other cases
+     */
+    public String getViewId()
+    {
+        return viewId;
+    }
+
+    /** For use only during object initialization. */
+    public void setViewId(String viewId)
+    {
+        this.viewId = viewId;
+    }
+
+    /**
      * Return the logical function that this flow implements.
      * <p>
      * This is a free-form text string, but it is recommended that the contents