You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gp...@apache.org on 2013/12/17 14:19:20 UTC

svn commit: r1551537 - /myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java

Author: gpetracek
Date: Tue Dec 17 13:19:19 2013
New Revision: 1551537

URL: http://svn.apache.org/r1551537
Log:
EXTCDI-311 support external handling of navigation-cases

Modified:
    myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java?rev=1551537&r1=1551536&r2=1551537&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java Tue Dec 17 13:19:19 2013
@@ -268,10 +268,26 @@ class NavigationCaseMapWrapper implement
         @Override
         public Set<NavigationCase> put(String key, Set<NavigationCase> value)
         {
+            if (value == null)
+            {
+                return null;
+            }
+
+            Set<NavigationCase> result = new HashSet<NavigationCase>();
+
+            //filter entries created by createViewConfigBasedNavigationCases
+            for (NavigationCase navigationCase : value)
+            {
+                if (!(navigationCase.getFromOutcome() == null && navigationCase.getFromAction() == null))
+                {
+                    result.add(navigationCase);
+                }
+            }
+
             //delegate to the wrapped instance -> the innermost handler needs to receive it
             //(because mojarra uses ConfigurableNavigationHandler#getNavigationCases
             // to add cases for std. nav.rules from the outside)
-            return this.wrapped.getNavigationCases().put(key, value);
+            return this.wrapped.getNavigationCases().put(key, result);
         }
 
         @Override