deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject deltaspike git commit: DELTASPIKE-919 higher priority for manually added navigation-parameters
Date Tue, 09 Jun 2015 13:08:28 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 8ed97fb72 -> 04d406f32


DELTASPIKE-919 higher priority for manually added navigation-parameters


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/04d406f3
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/04d406f3
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/04d406f3

Branch: refs/heads/master
Commit: 04d406f32c505ffa07a35dd09311deff434a5fda
Parents: 8ed97fb
Author: gpetracek <gpetracek@apache.org>
Authored: Tue Jun 9 15:03:06 2015 +0200
Committer: gpetracek <gpetracek@apache.org>
Committed: Tue Jun 9 15:07:51 2015 +0200

----------------------------------------------------------------------
 .../DefaultNavigationParameterStrategy.java          |  4 +++-
 .../navigation/ViewConfigAwareNavigationHandler.java |  3 ++-
 .../apache/deltaspike/jsf/impl/util/JsfUtils.java    | 15 +++++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/04d406f3/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/DefaultNavigationParameterStrategy.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/DefaultNavigationParameterStrategy.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/DefaultNavigationParameterStrategy.java
index 089cd35..9144493 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/DefaultNavigationParameterStrategy.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/DefaultNavigationParameterStrategy.java
@@ -20,6 +20,7 @@ package org.apache.deltaspike.jsf.impl.config.view.navigation;
 
 import org.apache.deltaspike.core.api.config.view.navigation.NavigationParameter;
 import org.apache.deltaspike.core.api.config.view.navigation.NavigationParameterContext;
+import org.apache.deltaspike.jsf.impl.util.JsfUtils;
 import org.apache.deltaspike.jsf.spi.config.view.navigation.NavigationParameterStrategy;
 
 import javax.enterprise.context.Dependent;
@@ -58,7 +59,8 @@ public class DefaultNavigationParameterStrategy implements NavigationParameterSt
 
         for (NavigationParameter currentParameter : parameterList)
         {
-            this.navigationParameterContext.addPageParameter(currentParameter.key(), currentParameter.value());
+            JsfUtils.addStaticNavigationParameter(
+                this.navigationParameterContext, currentParameter.key(), currentParameter.value());
         }
 
         return ic.proceed();

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/04d406f3/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/ViewConfigAwareNavigationHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/ViewConfigAwareNavigationHandler.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/ViewConfigAwareNavigationHandler.java
index 2f92c0c..a3171f8 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/ViewConfigAwareNavigationHandler.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/navigation/ViewConfigAwareNavigationHandler.java
@@ -174,7 +174,8 @@ public class ViewConfigAwareNavigationHandler extends NavigationHandler
 
     private void addConfiguredPageParameter(NavigationParameter viewParameter)
     {
-        this.navigationParameterContext.addPageParameter(viewParameter.key(), viewParameter.value());
+        JsfUtils.addStaticNavigationParameter(
+            this.navigationParameterContext, viewParameter.key(), viewParameter.value());
     }
 
     private String convertEntryToOutcome(ExternalContext externalContext, ViewConfigDescriptor
entry)

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/04d406f3/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
index 8abad99..248b766 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
@@ -373,4 +373,19 @@ public abstract class JsfUtils
                     "org.apache.deltaspike.modules:deltaspike-jsf-module-impl-ee6 to " +
                         "org.apache.deltaspike.modules:deltaspike-jsf-module-impl");
     }
+
+    public static void addStaticNavigationParameter(
+        NavigationParameterContext navigationParameterContext, String key, String value)
+    {
+        Map<String, String> existingParameters = navigationParameterContext.getPageParameters();
+
+        String existingValue = existingParameters.get(key);
+
+        if (existingValue != null && value != null) //support null for special cases
to reset an entry
+        {
+            return;
+        }
+        navigationParameterContext.addPageParameter(key, value);
+    }
+
 }


Mime
View raw message