You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/11/16 09:26:53 UTC

git commit: ISIS-590: implemented.

Updated Branches:
  refs/heads/master 71df3f63f -> 929d5f545


ISIS-590: implemented.

Thus:
- if in Isis SERVER mode (= Wicket DEPLOYMENT mode), should strip wicket tags
- if in Isis PROTOTYPE mode (= Wicket DEVELOPMENT mode), should not strip wicket tags.

In both cases, can be overridden by setting "isis.viewer.wicket.stripWicketTags" config in one of the loaded configuration files (typically viewer_wicket.properties, but isis.properties would also work).

Have updated the example apps (for archetypes) also


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/929d5f54
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/929d5f54
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/929d5f54

Branch: refs/heads/master
Commit: 929d5f545aacc58af96e7ab28c68ac7b64da5123
Parents: 71df3f6
Author: Dan Haywood <da...@apache.org>
Authored: Sat Nov 16 08:17:55 2013 +0000
Committer: Dan Haywood <da...@apache.org>
Committed: Sat Nov 16 08:17:55 2013 +0000

----------------------------------------------------------------------
 .../viewer/wicket/viewer/IsisWicketApplication.java   | 14 +++++++++++---
 .../src/main/webapp/WEB-INF/viewer_wicket.properties  |  5 +++--
 .../src/main/webapp/WEB-INF/viewer_wicket.properties  |  5 +++--
 3 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/929d5f54/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index 68457e7..32a933a 100644
--- a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -227,7 +227,7 @@ public class IsisWicketApplication extends AuthenticatedWebApplication implement
             injector.injectMembers(this);
             
             final IsisConfiguration configuration = isisConfigurationBuilder.getConfiguration();
-            this.getMarkupSettings().setStripWicketTags(determineStripWicketTags(configuration));
+            this.getMarkupSettings().setStripWicketTags(determineStripWicketTags(deploymentType, configuration));
     
             this.bookmarkedPagesModel = new BookmarkedPagesModel();
     
@@ -325,8 +325,16 @@ public class IsisWicketApplication extends AuthenticatedWebApplication implement
         }
     }
     
-    private boolean determineStripWicketTags(IsisConfiguration configuration) {
-        final boolean strip = configuration.getBoolean("isis.viewer.wicket.stripWicketTags", true);
+    /**
+     * Whether Wicket tags should be stripped from the markup, as specified by configuration settings (otherwise 
+     * depends on the {@link #deploymentType deployment type}. 
+     * 
+     * <p>
+     * If the <tt>isis.viewer.wicket.stripWicketTags</tt> is set, then this is used, otherwise the default is to strip 
+     * tags if in {@link DeploymentType#isProduction() production} mode, but not to strip if in prototyping mode.
+     */
+    private boolean determineStripWicketTags(final DeploymentType deploymentType, IsisConfiguration configuration) {
+        final boolean strip = configuration.getBoolean("isis.viewer.wicket.stripWicketTags", deploymentType.isProduction());
         return strip;
     }
     

http://git-wip-us.apache.org/repos/asf/isis/blob/929d5f54/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
index 05e8c38..b937fc3 100644
--- a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
@@ -44,6 +44,7 @@ isis.viewer.wicket.datePickerPattern=dd-mm-yy
 #isis.viewer.wicket.suppressRememberMe=true
 
 
-# default is for wicket tags to be stripped
-#isis.viewer.wicket.stripWicketTags=false
+# default is for wicket tags to be stripped in production (Isis SERVER mode == Wicket deployment mode), 
+# not stripped otherwise (Isis' PROTOTYPE mode == Wicket's DEVELOPMENT mode)
+# isis.viewer.wicket.stripWicketTags=false
 

http://git-wip-us.apache.org/repos/asf/isis/blob/929d5f54/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
----------------------------------------------------------------------
diff --git a/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties b/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
index 05e8c38..b937fc3 100644
--- a/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
+++ b/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
@@ -44,6 +44,7 @@ isis.viewer.wicket.datePickerPattern=dd-mm-yy
 #isis.viewer.wicket.suppressRememberMe=true
 
 
-# default is for wicket tags to be stripped
-#isis.viewer.wicket.stripWicketTags=false
+# default is for wicket tags to be stripped in production (Isis SERVER mode == Wicket deployment mode), 
+# not stripped otherwise (Isis' PROTOTYPE mode == Wicket's DEVELOPMENT mode)
+# isis.viewer.wicket.stripWicketTags=false