incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r419655 - in /incubator/adffaces/trunk/adf-faces: adf-faces-demo/src/main/webapp/WEB-INF/web.xml adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/application/NavigationHandlerImpl.java
Date Thu, 06 Jul 2006 18:54:01 GMT
Author: matzew
Date: Thu Jul  6 11:54:01 2006
New Revision: 419655

URL: http://svn.apache.org/viewvc?rev=419655&view=rev
Log:
ADFFACES-2 (thx Pierre)

Modified:
    incubator/adffaces/trunk/adf-faces/adf-faces-demo/src/main/webapp/WEB-INF/web.xml
    incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/application/NavigationHandlerImpl.java

Modified: incubator/adffaces/trunk/adf-faces/adf-faces-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-demo/src/main/webapp/WEB-INF/web.xml?rev=419655&r1=419654&r2=419655&view=diff
==============================================================================
--- incubator/adffaces/trunk/adf-faces/adf-faces-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/adffaces/trunk/adf-faces/adf-faces-demo/src/main/webapp/WEB-INF/web.xml Thu
Jul  6 11:54:01 2006
@@ -67,6 +67,14 @@
     <param-value>session</param-value>
   </context-param>
 
+  <!-- With setting this parameter you are able to specify the logical
+       outcome prefix to launch the dialog framework. If not set, the
+       default value (dialog:) is used. -->
+  <!--context-param>
+    <param-name>org.apache.myfaces.adf.DIALOG_NAVIGATION_PREFIX</param-name>
+    <param-value>userInputHere:</param-value>
+  </context-param--> 
+
   <filter>
     <filter-name>adfFaces</filter-name>
     <filter-class>org.apache.myfaces.adf.webapp.AdfFacesFilter</filter-class>

Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/application/NavigationHandlerImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/application/NavigationHandlerImpl.java?rev=419655&r1=419654&r2=419655&view=diff
==============================================================================
--- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/application/NavigationHandlerImpl.java
(original)
+++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/application/NavigationHandlerImpl.java
Thu Jul  6 11:54:01 2006
@@ -20,13 +20,13 @@
 import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.adf.context.AdfFacesContext;
-import org.apache.myfaces.adf.context.DialogService;
 
 public class NavigationHandlerImpl extends NavigationHandler
 {
   public NavigationHandlerImpl(NavigationHandler delegate)
   {
     _delegate = delegate;
+    _dialogPrefix = null;
   }
 
   public void handleNavigation(
@@ -35,14 +35,14 @@
     String       outcome)
   {
     UIViewRoot oldRoot = context.getViewRoot();
-
+        
     _delegate.handleNavigation(context, fromAction, outcome);
 
     UIViewRoot newRoot = context.getViewRoot();
     if ((outcome != null) && (newRoot != oldRoot))
     {
       // Handle "dialog:" URLs
-      if (outcome.startsWith("dialog:"))
+      if (outcome.startsWith(_getDialogPrefix(context)))
       {
         // Navigate back to the original root
         context.setViewRoot(oldRoot);
@@ -56,6 +56,22 @@
       }
     }
   }
+  
+  private String _getDialogPrefix(FacesContext context) {
+    if (_dialogPrefix == null) {
+        _dialogPrefix = context.getExternalContext().getInitParameter(DIALOG_NAVIGATION_PREFIX_PARAM_NAME);
+        
+        if(_dialogPrefix == null) {
+        	_dialogPrefix = DEFAULT_DIALOG_NAVIGATION_PREFIX;
+        }
+    }
+
+    return _dialogPrefix;
+  }
 
+  public static final String DEFAULT_DIALOG_NAVIGATION_PREFIX = "dialog:";
+  public static final String DIALOG_NAVIGATION_PREFIX_PARAM_NAME = "org.apache.myfaces.adf.DIALOG_NAVIGATION_PREFIX";
+  
   private NavigationHandler _delegate;
-}
+  private static String _dialogPrefix;
+}
\ No newline at end of file



Mime
View raw message