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/05 16:01:43 UTC

svn commit: r582274 - in /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav: UrlParameterNavigationHandler.java UrlParameterViewHandler.java package.html

Author: skitching
Date: Fri Oct  5 07:01:42 2007
New Revision: 582274

URL: http://svn.apache.org/viewvc?rev=582274&view=rev
Log:
Add javadoc only.

Added:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/package.html
Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterNavigationHandler.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterViewHandler.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterNavigationHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterNavigationHandler.java?rev=582274&r1=582273&r2=582274&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterNavigationHandler.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterNavigationHandler.java Fri Oct  5 07:01:42 2007
@@ -25,20 +25,20 @@
 import java.io.IOException;
 
 /**
+ * This navigation handler replaces EL expressions (value bindings) within the to-view-id
+ * property of a navigation rule.
  * <p>
- * This navigation handler replace all value bindings from the url a redirect will be issued to.
- * </p>
+ * Since we do not know quite how this feature may interact with other JSF frameworks that
+ * also provide navigation handlers, this feature is not enabled by default.
  * <p>
- * Since we do not know how this interfere with other framweworks you have to enable it
- * for your application manually.<br />
- * So to make this handler work you have to:
+ * To enable this feature:
  * <ul>
  * <li>add this navigation handler to your faces-config.xml</li>
  * <li>add the {@link UrlParameterViewHandler} to your faces-config.xml</li>
- * <li>configure the navigation case to use &lt;redirect/&gt; flag.<br />
- * This is quite natural as without redirect there are not url parameter</li> 
+ * <li>configure the navigation case to use &lt;redirect/&gt; flag.<li/>
  * </ul>
- * </p>
+ * Note that redirect is required for the rule; this is only natural as without redirect
+ * there is no bookmarkable URL for the user. 
  */
 public class UrlParameterNavigationHandler extends NavigationHandler
 {
@@ -66,6 +66,8 @@
 		}, fromAction, outcome);
 	}
 
+	// TODO: this only supports one EL expression at the moment; it would be nice
+	// to support multiple.
 	protected String interceptRedirect(FacesContext context, String url)
 	{
 		int pos = url.indexOf("#{");

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterViewHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterViewHandler.java?rev=582274&r1=582273&r2=582274&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterViewHandler.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/UrlParameterViewHandler.java Fri Oct  5 07:01:42 2007
@@ -30,9 +30,7 @@
 import java.util.Locale;
 
 /**
- * <p/>
- * This view handler helps to preserve any url parameter you configured in your navigation
- * </p>
+ * This view handler helps to preserve any url parameter you configured in your navigation.
  *
  * @see org.apache.myfaces.orchestra.urlParamNav.UrlParameterNavigationHandler
  */

Added: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/package.html
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/package.html?rev=582274&view=auto
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/package.html (added)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/urlParamNav/package.html Fri Oct  5 07:01:42 2007
@@ -0,0 +1,24 @@
+<html>
+<body>
+This JSF-specific package helps JSF applications produce "bookmarkable" views.
+A custom JSF NavigationHandler is provided that supports EL expressions in the to-view-id
+element of a navigation rule. For example:
+<pre><[!CDATA[
+  <navigation-case>
+    <from-outcome>EditSelectedProduct</from-outcome>
+    <to-view-id>/mops/EditProduct.jsp?productId=#{param.productId}</to-view-id>
+    <redirect/>
+  </navigation-case>
+]]></pre>
+<p>
+The URL that the browser sees contains a query parameter that specifies the relevane productId;
+when this url bookmarked and reactivated later the target view will receive the productId value back.
+<p>
+See the documentation for class UrlParameterNavigationHandler for further details.
+<p>
+Note that while the navigation features of this class (ie the enhancements to xml
+navigation rules) are part of the public functionality of Orchestra, the classes
+in this package are not. The API of classes in this package should not be called
+directly by external code and may change without notice.
+</body>
+</html>