EXTCDI-311 support external handling of navigation-cases

git-svn-id: https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk@1551537 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java b/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java
index 64c808e..0561a49 100644
--- a/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java
+++ b/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/navigation/NavigationCaseMapWrapper.java
@@ -268,10 +268,26 @@
         @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