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 2019/10/01 06:47:48 UTC

[isis] branch ISIS-2086 updated (b817f98 -> 4259cbd)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from b817f98  ISIS-2086: refactors 'isis.viewer.restfulobjects.XXX' (7 more of them) to type-safe config
     add 26468ff  ISIS-2158: fixes concurrent spec-loading
     add cf5ae35  ISIS-2158: re-enables IsisSessionFactory concurrent init
     add 32bde33  ISIS-2158: re-wires the RuntimeEventService, fixes sec-man seed
     add 3269440  Merge pull request #148 from apache/ISIS-2086
     add 3152221  ISIS-2158: fixes provisioning and test issues after merge
     add 3cf4a33  ISIS-2158: minor polishing
     add 7dea892  ISIS-2158: spec-loading: fixing todo markers, removing hacks
     new 9898210  ISIS-2086: refactors 'isis.viewer.wicket.*' to type-safe (about 6 of em)
     new bf86575  ISIS-2086: just reorders some of the config setting members for wicket
     new b7dd538  ISIS-2086: declares isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL in metadata
     new 66641ef  ISIS-2086: refactors 'isis.viewer.wicket.bookmarkedPages.maxSize' to type-safe config
     new 4edb04e  ISIS-2086: converts 'isis.persistor.datanucleus.standaloneCollection.bulkLoad' to type-safe config
     new a5b6a1c  ISIS-2086: refactors 'isis.viewer.wicket.whereAmI.*' (2 of em) to type-safe config
     new 4259cbd  ISIS-2086: converts 'isis.viewer.wicket.bookmarkedPages.showChooser' to type-safe config

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/isis/commons/internal/debug/_Probe.java |  11 ++
 .../org/apache/isis/config/IsisConfiguration.java  | 158 +++++++++++++++------
 .../additional-spring-configuration-metadata.json  |  13 ++
 ...assFacetOnActionFromConfiguredRegexFactory.java |   5 -
 .../DomainObjectLayoutFacetFactory.java            |   6 +-
 .../facets/object/grid/GridFacetFactory.java       |  16 ++-
 .../metamodel/MetaModelServiceDefault.java         |   1 -
 .../apache/isis/metamodel/spec/Hierarchical.java   |  18 +--
 .../specloader/SpecificationCacheDefault.java      |  62 ++++----
 .../metamodel/specloader/SpecificationLoader.java  |   2 -
 .../specloader/SpecificationLoaderDefault.java     |  84 +++++------
 .../specloader/specimpl/FacetedMethodsBuilder.java |  60 +++-----
 .../specimpl/ObjectSpecificationAbstract.java      |  94 +++++++-----
 .../specimpl/dflt/ObjectSpecificationDefault.java  |  23 +--
 .../traverser/SpecificationTraverser.java          |   5 +-
 .../specloader/SpecificationCacheDefaultTest.java  |  15 +-
 .../testspec/ObjectSpecificationStub.java          |  10 +-
 .../facets/object/query/VisitorForFromClause.java  |   9 +-
 .../context/session/RuntimeEventService.java       |  31 ++--
 .../system/session/IsisSessionFactoryDefault.java  |  17 ++-
 .../shiro/authentication/ShiroAuthenticator.java   |  29 ++--
 ...AuthenticatorOrAuthorizorTest_authenticate.java |  12 +-
 ...ticatorOrAuthorizorTest_isVisibleInAnyRole.java |  12 +-
 .../wicket/viewer/IsisWicketApplication.java       |  90 +++---------
 .../wicket/model/models/BookmarkedPagesModel.java  |  11 +-
 .../wicket/model/models/EntityCollectionModel.java |   5 +-
 .../model/models/whereami/WhereAmIModel.java       |   7 -
 .../models/whereami/WhereAmIModelDefault.java      |  22 ++-
 .../bookmarkedpages/BookmarkedPagesPanel.java      |   6 -
 .../isis/viewer/wicket/ui/pages/PageAbstract.java  |  15 +-
 .../secman/jdo/seed/SeedSecurityModuleService.java |  38 ++++-
 31 files changed, 461 insertions(+), 426 deletions(-)
 create mode 100644 core/config/src/main/resources/META-INF/additional-spring-configuration-metadata.json


[isis] 01/07: ISIS-2086: refactors 'isis.viewer.wicket.*' to type-safe (about 6 of em)

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 989821021c9e7961e85c514a60b82852fc3e7b2c
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 1 07:30:03 2019 +0100

    ISIS-2086: refactors 'isis.viewer.wicket.*' to type-safe (about 6 of em)
---
 .../org/apache/isis/config/IsisConfiguration.java  | 36 ++++++++-
 .../wicket/viewer/IsisWicketApplication.java       | 90 ++++------------------
 2 files changed, 51 insertions(+), 75 deletions(-)

diff --git a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
index 79d3517..c60c395 100644
--- a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
+++ b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
@@ -87,7 +87,6 @@ public class IsisConfiguration {
             private final Impl impl = new Impl();
             @Data
             public static class Impl {
-
             }
             private boolean installFixtures = false;
         }
@@ -450,8 +449,43 @@ public class IsisConfiguration {
             @Data
             public static class RememberMe {
                 private boolean suppress = false;
+                private String cookieKey = "isisWicketRememberMe";
+                private String encryptionKey;
+            }
+
+            private final DevelopmentUtilities developmentUtilities = new DevelopmentUtilities();
+            @Data
+            public static class DevelopmentUtilities {
+                /**
+                 * A configuration setting which value determines whether debug bar and other stuff influenced by <tt>org.apache.wicket.settings.DebugSettings#isDevelopmentUtilitiesEnabled()</tt> is enabled or not.
+                 *
+                 * <p>
+                 *     By default, depends on the mode (prototyping = enabled, server = disabled).  This property acts as an override.
+                 * </p>
+                 */
+                private boolean enable = false;
             }
 
+            /**
+             * Whether Wicket tags should be stripped from the markup.
+             *
+             * <p>
+             * Be aware that if Wicket tags are <i>not</i> stripped, then this may break CSS rules on some browsers.
+             * </p>
+             */
+            private boolean stripWicketTags = true;
+            /**
+             * Whether the Ajax debug should be shown.
+             */
+            private boolean ajaxDebugMode = false;
+            /**
+             * Whether the Wicket source plugin should be enabled; if so, the markup includes links to the Wicket source.
+             *
+             * <p>
+             *     Be aware that this can substantially impact performance.
+             * </p>
+             */
+            private boolean wicketSourcePlugin = false;
             private boolean suppressSignUp = false;
             private boolean suppressPasswordReset = false;
             private boolean clearOriginalDestination = false;
diff --git a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java b/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index 44fbb4d..7cbf82a 100644
--- a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ b/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -28,6 +28,7 @@ import java.util.function.Function;
 
 import javax.inject.Inject;
 
+import org.apache.isis.config.IsisConfiguration;
 import org.apache.wicket.Application;
 import org.apache.wicket.ConverterLocator;
 import org.apache.wicket.IConverterLocator;
@@ -55,7 +56,6 @@ import org.apache.wicket.request.cycle.IRequestCycleListener;
 import org.apache.wicket.request.cycle.PageRequestHandlerTracker;
 import org.apache.wicket.request.cycle.RequestCycleListenerCollection;
 import org.apache.wicket.request.resource.CssResourceReference;
-import org.apache.wicket.settings.DebugSettings;
 import org.apache.wicket.settings.RequestCycleSettings;
 import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
 import org.apache.wicket.util.time.Duration;
@@ -137,27 +137,6 @@ implements ComponentFactoryRegistryAccessor, PageClassRegistryAccessor, WicketVi
 
     private static final long serialVersionUID = 1L;
 
-    private static final String STRIP_WICKET_TAGS_KEY = "isis.viewer.wicket.stripWicketTags";
-    private static final boolean STRIP_WICKET_TAGS_DEFAULT = true;
-    private static final String AJAX_DEBUG_MODE_KEY = "isis.viewer.wicket.ajaxDebugMode";
-    private static final boolean AJAX_DEBUG_MODE_DEFAULT = false;
-    private static final String WICKET_SOURCE_PLUGIN_KEY = "isis.viewer.wicket.wicketSourcePlugin";
-    private static final boolean WICKET_SOURCE_PLUGIN_DEFAULT = false;
-
-    private static final String WICKET_REMEMBER_ME_COOKIE_KEY = "isis.viewer.wicket.rememberMe.cookieKey";
-    private static final String WICKET_REMEMBER_ME_COOKIE_KEY_DEFAULT = "isisWicketRememberMe";
-    private static final String WICKET_REMEMBER_ME_ENCRYPTION_KEY = "isis.viewer.wicket.rememberMe.encryptionKey";
-
-    /**
-     * A configuration setting which value determines whether debug bar and other stuff influenced by {@link DebugSettings#isDevelopmentUtilitiesEnabled()} is enabled or not.
-     *
-     * <p>
-     *     By default, depends on the mode (prototyping = enabled, server = disabled).  This property acts as an override.
-     * </p>
-     */
-    public static final String ENABLE_DEVELOPMENT_UTILITIES_KEY = "isis.viewer.wicket.developmentUtilities.enable";
-    public static final boolean ENABLE_DEVELOPMENT_UTILITIES_DEFAULT = false;
-
     /**
      * Convenience locator, down-casts inherited functionality.
      */
@@ -224,7 +203,8 @@ implements ComponentFactoryRegistryAccessor, PageClassRegistryAccessor, WicketVi
     @Override
     protected void init() {
 
-        val configuration = IsisContext.getConfigurationLegacy();
+        val configurationLegacy = IsisContext.getConfigurationLegacy();
+        val configuration = IsisContext.getConfiguration();
         val serviceRegistry = IsisContext.getServiceRegistry();
         //val serviceInjector = IsisContext.getServiceInjector();
 
@@ -262,11 +242,11 @@ implements ComponentFactoryRegistryAccessor, PageClassRegistryAccessor, WicketVi
                 webRequestCycleForIsis.setPageClassRegistry(pageClassRegistry);
             }
 
-            this.getMarkupSettings().setStripWicketTags(determineStripWicketTags(configuration));
+            this.getMarkupSettings().setStripWicketTags(configuration.getViewer().getWicket().isStripWicketTags());
 
             configureSecurity(configuration);
 
-            getDebugSettings().setAjaxDebugModeEnabled(determineAjaxDebugModeEnabled(configuration));
+            getDebugSettings().setAjaxDebugModeEnabled(((IsisConfiguration) null).getViewer().getWicket().isAjaxDebugMode());
 
             // must be done after injected componentFactoryRegistry into the app itself
             buildCssBundle();
@@ -296,8 +276,7 @@ implements ComponentFactoryRegistryAccessor, PageClassRegistryAccessor, WicketVi
                 log.debug("DebugDiskDataStore: eg, http://localhost:8080/wicket/wicket/internal/debug/diskDataStore");
 
                 if(!getDebugSettings().isDevelopmentUtilitiesEnabled()) {
-                    boolean enableDevUtils = configuration
-                            .getBoolean(ENABLE_DEVELOPMENT_UTILITIES_KEY, ENABLE_DEVELOPMENT_UTILITIES_DEFAULT);
+                    boolean enableDevUtils = configuration.getViewer().getWicket().getDevelopmentUtilities().isEnable();
                     if(enableDevUtils) {
                         getDebugSettings().setDevelopmentUtilitiesEnabled(true);
 
@@ -345,26 +324,28 @@ implements ComponentFactoryRegistryAccessor, PageClassRegistryAccessor, WicketVi
     /**
      * protected visibility to allow ad-hoc overriding of some other authentication strategy.
      */
-    protected void configureSecurity(final IsisConfigurationLegacy configuration) {
+    void configureSecurity(IsisConfiguration configuration) {
         getSecuritySettings().setAuthenticationStrategy(newAuthenticationStrategy(configuration));
     }
 
     /**
      * protected visibility to allow ad-hoc overriding of some other authentication strategy.
      */
-    protected IAuthenticationStrategy newAuthenticationStrategy(final IsisConfigurationLegacy configuration) {
-        final String cookieKey = configuration.getString(WICKET_REMEMBER_ME_COOKIE_KEY,
-                WICKET_REMEMBER_ME_COOKIE_KEY_DEFAULT);
-        final String encryptionKey = configuration.getString(WICKET_REMEMBER_ME_ENCRYPTION_KEY, defaultEncryptionKeyIfNotConfigured());
+    IAuthenticationStrategy newAuthenticationStrategy(IsisConfiguration configuration) {
+        final String cookieKey = configuration.getViewer().getWicket().getRememberMe().getCookieKey();
+        String encryptionKey = configuration.getViewer().getWicket().getRememberMe().getEncryptionKey();
+        if (encryptionKey == null) {
+            encryptionKey = defaultEncryptionKey();
+        }
         return new DefaultAuthenticationStrategy(cookieKey, encryptionKey);
     }
 
     /**
-     * As called by {@link #newAuthenticationStrategy(IsisConfigurationLegacy)}; if an encryption key for the 'rememberMe'
+     * As called by {@link #newAuthenticationStrategy(IsisConfiguration)}; if an encryption key for the 'rememberMe'
      * cookie hasn't been configured, then use a different encryption key for the 'rememberMe' cookie each time the
      * app is restarted.
      */
-    protected String defaultEncryptionKeyIfNotConfigured() {
+    String defaultEncryptionKey() {
         return _Context.isPrototyping()
                 ? "PrototypingEncryptionKey"
                         : UUID.randomUUID().toString();
@@ -394,7 +375,7 @@ implements ComponentFactoryRegistryAccessor, PageClassRegistryAccessor, WicketVi
         final IsisConfigurationLegacy configuration = _Config.getConfiguration();
         requireNonNull(configuration, "Configuration must be prepared prior to init().");
 
-        if(isWicketSourcePluginEnabled(configuration)) {
+        if(((IsisConfiguration) configuration).getViewer().getWicket().isWicketSourcePlugin()) {
             configureWicketSourcePlugin();
         }
     }
@@ -580,45 +561,6 @@ implements ComponentFactoryRegistryAccessor, PageClassRegistryAccessor, WicketVi
                 log.error(msg);
             }
 
-            // //////////////////////////////////////
-
-            /**
-             * Whether Wicket tags should be stripped from the markup, as specified by configuration settings..
-             *
-             * <p>
-             * If the <tt>isis.viewer.wicket.stripWicketTags</tt> is set, then this is used, otherwise the default is to strip
-             * the tags because they may break some CSS rules.
-             */
-            private boolean determineStripWicketTags(IsisConfigurationLegacy configuration) {
-                final boolean strip = configuration.getBoolean(STRIP_WICKET_TAGS_KEY, STRIP_WICKET_TAGS_DEFAULT);
-                return strip;
-            }
-
-            // //////////////////////////////////////
-
-            /**
-             * Whether the Ajax debug should be shown, as specified by configuration settings.
-             *
-             * <p>
-             * If the <tt>isis.viewer.wicket.ajaxDebugMode</tt> is set, then this is used, otherwise the default is to disable.
-             */
-            private boolean determineAjaxDebugModeEnabled(IsisConfigurationLegacy configuration) {
-                final boolean debugModeEnabled = configuration.getBoolean(AJAX_DEBUG_MODE_KEY, AJAX_DEBUG_MODE_DEFAULT);
-                return debugModeEnabled;
-            }
-
-            /**
-             * Whether the Wicket source plugin should be enabled, as specified by configuration settings.
-             *
-             * <p>
-             * If the <tt>isis.viewer.wicket.wicketSourcePlugin</tt> is set, then this is used, otherwise the default is to disable.
-             */
-            private boolean isWicketSourcePluginEnabled(IsisConfigurationLegacy configuration) {
-                final boolean pluginEnabled = configuration.getBoolean(WICKET_SOURCE_PLUGIN_KEY, WICKET_SOURCE_PLUGIN_DEFAULT);
-                return pluginEnabled;
-            }
-
-            // //////////////////////////////////////
 
             @Override
             protected void onDestroy() {


[isis] 03/07: ISIS-2086: declares isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL in metadata

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b7dd5389e70a33e53409a8d7f4fb1b6658ba7c27
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 1 07:34:50 2019 +0100

    ISIS-2086: declares isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL in metadata
    
    this can't be declared using type-safe config, because key must be called "ConnectionURL", (probably) not recognised by Spring.
---
 .../META-INF/additional-spring-configuration-metadata.json  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/core/config/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/core/config/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 0000000..91eb779
--- /dev/null
+++ b/core/config/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,13 @@
+{
+  "properties": [
+    {
+      "name": "isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL",
+      "type": "java.lang.String",
+      "description": "URL used by DataNucleus Object store to connect.",
+      "defaultValue": ""
+    }
+  ],
+  "hints": [
+  ]
+}
+


[isis] 05/07: ISIS-2086: converts 'isis.persistor.datanucleus.standaloneCollection.bulkLoad' to type-safe config

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4edb04e398013e367c7fa8c0803c8e5d2b505f30
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 1 07:40:57 2019 +0100

    ISIS-2086: converts 'isis.persistor.datanucleus.standaloneCollection.bulkLoad' to type-safe config
---
 .../main/java/org/apache/isis/config/IsisConfiguration.java | 13 +++++++++++--
 .../viewer/wicket/model/models/EntityCollectionModel.java   |  5 +----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
index 902e16d..ff0846a 100644
--- a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
+++ b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
@@ -70,6 +70,7 @@ public class IsisConfiguration {
             private boolean autoLogoutIfAlreadyAuthenticated = false;
         }
     }
+
     private final Objects objects = new Objects();
     @Data
     public static class Objects {
@@ -84,11 +85,18 @@ public class IsisConfiguration {
         public static class Datanucleus {
             private String classMetadataLoadedListener = "org.apache.isis.jdo.datanucleus.CreateSchemaObjectFromClassMetadata";
 
+            private boolean installFixtures = false;
+
             private final Impl impl = new Impl();
             @Data
             public static class Impl {
             }
-            private boolean installFixtures = false;
+
+            private final StandaloneCollection standaloneCollection = new StandaloneCollection();
+            @Data
+            public static class StandaloneCollection {
+                private boolean bulkLoad = false;
+            }
         }
         /**
          * Default is <code>false</code> only for backward compatibility (to avoid lots of breakages in existing code);
@@ -103,6 +111,7 @@ public class IsisConfiguration {
         @Deprecated
         private boolean enforceSafeSemantics = false;
     }
+
     private final Reflector reflector = new Reflector();
     @Data
     public static class Reflector {
@@ -333,6 +342,7 @@ public class IsisConfiguration {
             }
         }
     }
+
     private final Services services = new Services();
     @Data
     public static class Services {
@@ -618,7 +628,6 @@ public class IsisConfiguration {
         }
     }
 
-
     private final Viewers viewers = new Viewers();
     @Data
     public static class Viewers {
diff --git a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
index b5f714e..9528203 100644
--- a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
+++ b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
@@ -76,8 +76,6 @@ implements LinksProvider, UiHintContainer {
 
     private static final long serialVersionUID = 1L;
 
-    private static final String KEY_BULK_LOAD = "isis.persistor.datanucleus.standaloneCollection.bulkLoad";
-
     private static final int PAGE_SIZE_DEFAULT_FOR_PARENTED = 12;
     private static final int PAGE_SIZE_DEFAULT_FOR_STANDALONE = 25;
 
@@ -92,8 +90,7 @@ implements LinksProvider, UiHintContainer {
             @Override
             List<ObjectAdapter> load(final EntityCollectionModel entityCollectionModel) {
 
-                //XXX lombok issue, cannot use val here 
-                boolean isBulkLoad = IsisContext.getConfigurationLegacy().getBoolean(KEY_BULK_LOAD, false);
+                val isBulkLoad = IsisContext.getConfiguration().getPersistor().getDatanucleus().getStandaloneCollection().isBulkLoad();
                 final Stream<ObjectAdapter> resolveResults = isBulkLoad
                         ? loadInBulk(entityCollectionModel)
                                 : loadOneByOne(entityCollectionModel);


[isis] 02/07: ISIS-2086: just reorders some of the config setting members for wicket

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git

commit bf86575acb25665eb0381e3f4e24a4f3bd8114c2
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 1 07:33:33 2019 +0100

    ISIS-2086: just reorders some of the config setting members for wicket
---
 .../org/apache/isis/config/IsisConfiguration.java  | 146 +++++++++++----------
 1 file changed, 80 insertions(+), 66 deletions(-)

diff --git a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
index c60c395..ce1fca3 100644
--- a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
+++ b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
@@ -442,53 +442,40 @@ public class IsisConfiguration {
         @Data
         public static class Wicket {
 
-            private String basePath = "/wicket";
             private String app = "org.apache.isis.viewer.wicket.viewer.IsisWicketApplication";
-            
-            private final RememberMe rememberMe = new RememberMe();
-            @Data
-            public static class RememberMe {
-                private boolean suppress = false;
-                private String cookieKey = "isisWicketRememberMe";
-                private String encryptionKey;
-            }
 
-            private final DevelopmentUtilities developmentUtilities = new DevelopmentUtilities();
-            @Data
-            public static class DevelopmentUtilities {
-                /**
-                 * A configuration setting which value determines whether debug bar and other stuff influenced by <tt>org.apache.wicket.settings.DebugSettings#isDevelopmentUtilitiesEnabled()</tt> is enabled or not.
-                 *
-                 * <p>
-                 *     By default, depends on the mode (prototyping = enabled, server = disabled).  This property acts as an override.
-                 * </p>
-                 */
-                private boolean enable = false;
-            }
+            /**
+             * Whether the Ajax debug should be shown.
+             */
+            private boolean ajaxDebugMode = false;
+
+            private String basePath = "/wicket";
+
+            private boolean clearOriginalDestination = false;
 
             /**
-             * Whether Wicket tags should be stripped from the markup.
+             * The pattern used for rendering and parsing dates.
              *
              * <p>
-             * Be aware that if Wicket tags are <i>not</i> stripped, then this may break CSS rules on some browsers.
-             * </p>
-             */
-            private boolean stripWicketTags = true;
-            /**
-             * Whether the Ajax debug should be shown.
+             * Each Date scalar panel will use {@ #getDatePattern()} or {@linkplain #getDateTimePattern()} depending on its
+             * date type.  In the case of panels with a date picker, the pattern will be dynamically adjusted so that it can be
+             * used by the <a href="https://github.com/Eonasdan/bootstrap-datetimepicker">Bootstrap Datetime Picker</a>
+             * component (which uses <a href="http://momentjs.com/docs/#/parsing/string-format/">Moment.js formats</a>, rather
+             * than those of regular Java code).
              */
-            private boolean ajaxDebugMode = false;
+            private String datePattern = "dd-MM-yyyy";
+
             /**
-             * Whether the Wicket source plugin should be enabled; if so, the markup includes links to the Wicket source.
+             * The pattern used for rendering and parsing date/times.
              *
              * <p>
-             *     Be aware that this can substantially impact performance.
-             * </p>
+             * Each Date scalar panel will use {@link Wicket#getDatePattern()} or {@link Wicket#getDateTimePattern()} depending on its
+             * date type.  In the case of panels with a date time picker, the pattern will be dynamically adjusted so that it can be
+             * used by the <a href="https://github.com/Eonasdan/bootstrap-datetimepicker">Bootstrap Datetime Picker</a>
+             * component (which uses <a href="http://momentjs.com/docs/#/parsing/string-format/">Moment.js formats</a>, rather
+             * than those of regular Java code).
              */
-            private boolean wicketSourcePlugin = false;
-            private boolean suppressSignUp = false;
-            private boolean suppressPasswordReset = false;
-            private boolean clearOriginalDestination = false;
+            private String dateTimePattern = "dd-MM-yyyy HH:mm";
 
             /**
              * Whether to use a modal dialog for property edits and for actions associated with properties.
@@ -500,8 +487,6 @@ public class IsisConfiguration {
              */
             private PromptStyle promptStyle = PromptStyle.INLINE;
 
-            private boolean showFooter = true;
-
             private int maxTitleLengthInTables = 12;
 
             private Integer maxTitleLengthInParentedTables;
@@ -529,37 +514,21 @@ public class IsisConfiguration {
             }
 
             /**
-             * The pattern used for rendering and parsing dates.
-             *
-             * <p>
-             * Each Date scalar panel will use {@ #getDatePattern()} or {@linkplain #getDateTimePattern()} depending on its
-             * date type.  In the case of panels with a date picker, the pattern will be dynamically adjusted so that it can be
-             * used by the <a href="https://github.com/Eonasdan/bootstrap-datetimepicker">Bootstrap Datetime Picker</a>
-             * component (which uses <a href="http://momentjs.com/docs/#/parsing/string-format/">Moment.js formats</a>, rather
-             * than those of regular Java code).
-             */
-            private String datePattern = "dd-MM-yyyy";
-            /**
-             * The pattern used for rendering and parsing date/times.
+             * Whether to redirect to a new page, even if the object being shown (after an action invocation or a property edit)
+             * is the same as the previous page.
              *
-             * <p>
-             * Each Date scalar panel will use {@link Wicket#getDatePattern()} or {@link Wicket#getDateTimePattern()} depending on its
-             * date type.  In the case of panels with a date time picker, the pattern will be dynamically adjusted so that it can be
-             * used by the <a href="https://github.com/Eonasdan/bootstrap-datetimepicker">Bootstrap Datetime Picker</a>
-             * component (which uses <a href="http://momentjs.com/docs/#/parsing/string-format/">Moment.js formats</a>, rather
-             * than those of regular Java code).
-             */
-            private String dateTimePattern = "dd-MM-yyyy HH:mm";
-            /**
-             * The pattern used for rendering and parsing timestamps.
+             * This behaviour is disabled by default; the viewer will update the existing page if it can, making for a
+             * smoother user experience. If enabled then this reinstates the pre-1.15.0 behaviour of redirecting in all cases.
              */
-            private String timestampPattern = "yyyy-MM-dd HH:mm:ss.SSS";
+            private boolean redirectEvenIfSameObject = false;
+
             /**
              * in Firefox and more recent versions of Chrome 54+, cannot copy out of disabled fields; instead we use the
              * readonly attribute (https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#the-readonly-attribute)
              * This behaviour is enabled by default but can be disabled using this flag
              */
             private boolean replaceDisabledTagWithReadonlyTag = true;
+
             /**
              * Whether to disable a form submit button after it has been clicked, to prevent users causing an error if they
              * do a double click.
@@ -567,6 +536,7 @@ public class IsisConfiguration {
              * This behaviour is enabled by default, but can be disabled using this flag.
              */
             private boolean preventDoubleClickForFormSubmit = true;
+
             /**
              * Whether to disable a no-arg action button after it has been clicked, to prevent users causing an error if they
              * do a double click.
@@ -574,6 +544,27 @@ public class IsisConfiguration {
              * This behaviour is enabled by default, but can be disabled using this flag.
              */
             private boolean preventDoubleClickForNoArgAction = true;
+
+            private boolean showFooter = true;
+
+            /**
+             * Whether Wicket tags should be stripped from the markup.
+             *
+             * <p>
+             * Be aware that if Wicket tags are <i>not</i> stripped, then this may break CSS rules on some browsers.
+             * </p>
+             */
+            private boolean stripWicketTags = true;
+
+            private boolean suppressSignUp = false;
+
+            private boolean suppressPasswordReset = false;
+
+            /**
+             * The pattern used for rendering and parsing timestamps.
+             */
+            private String timestampPattern = "yyyy-MM-dd HH:mm:ss.SSS";
+
             /**
              * Whether to show an indicator for a form submit button that it has been clicked.
              *
@@ -588,13 +579,36 @@ public class IsisConfiguration {
             private boolean useIndicatorForNoArgAction = true;
 
             /**
-             * Whether to redirect to a new page, even if the object being shown (after an action invocation or a property edit)
-             * is the same as the previous page.
+             * Whether the Wicket source plugin should be enabled; if so, the markup includes links to the Wicket source.
              *
-             * This behaviour is disabled by default; the viewer will update the existing page if it can, making for a
-             * smoother user experience. If enabled then this reinstates the pre-1.15.0 behaviour of redirecting in all cases.
+             * <p>
+             *     Be aware that this can substantially impact performance.
+             * </p>
              */
-            private boolean redirectEvenIfSameObject = false;
+            private boolean wicketSourcePlugin = false;
+
+            private final DevelopmentUtilities developmentUtilities = new DevelopmentUtilities();
+            @Data
+            public static class DevelopmentUtilities {
+
+                /**
+                 * Determines whether debug bar and other stuff influenced by <tt>org.apache.wicket.settings.DebugSettings#isDevelopmentUtilitiesEnabled()</tt> is enabled or not.
+                 *
+                 * <p>
+                 *     By default, depends on the mode (prototyping = enabled, server = disabled).  This property acts as an override.
+                 * </p>
+                 */
+                private boolean enable = false;
+            }
+
+            private final RememberMe rememberMe = new RememberMe();
+            @Data
+            public static class RememberMe {
+                private boolean suppress = false;
+                private String cookieKey = "isisWicketRememberMe";
+                private String encryptionKey;
+            }
+
         }
     }
 


[isis] 07/07: ISIS-2086: converts 'isis.viewer.wicket.bookmarkedPages.showChooser' to type-safe config

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4259cbd906aa09e5cb31143f5a11f7a38967e09b
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 1 07:47:27 2019 +0100

    ISIS-2086: converts 'isis.viewer.wicket.bookmarkedPages.showChooser' to type-safe config
---
 .../java/org/apache/isis/config/IsisConfiguration.java    |  6 ++++++
 .../components/bookmarkedpages/BookmarkedPagesPanel.java  |  6 ------
 .../apache/isis/viewer/wicket/ui/pages/PageAbstract.java  | 15 +++++++++------
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
index 5dbf7cd..590adfd 100644
--- a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
+++ b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
@@ -601,6 +601,12 @@ public class IsisConfiguration {
             private final BookmarkedPages bookmarkedPages = new BookmarkedPages();
             @Data
             public static class BookmarkedPages {
+
+                /**
+                 * Determines whether the bookmarks should be available in the header.
+                 */
+                private boolean showChooser = true;
+
                 private int maxSize = 15;
             }
 
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.java
index 8e68918..c37e037 100644
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.java
+++ b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.java
@@ -72,12 +72,6 @@ public class BookmarkedPagesPanel extends PanelAbstract<BookmarkedPagesModel> {
     private static final String CLEAR_BOOKMARKS = "clearBookmarks";
 
 
-    /**
-     * A configuration setting which value determines whether the bookmarks should be available in the header
-     */
-    public static final String SHOW_BOOKMARKS_KEY = "isis.viewer.wicket.bookmarkedPages.showChooser";
-    public static final boolean SHOW_BOOKMARKS_DEFAULT = true;
-
     private static final JavaScriptResourceReference SLIDE_PANEL_JS = new JavaScriptResourceReference(BookmarkedPagesPanel.class, "slide-panel.js");
 
     @Inject
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
index 8a9051f..e6e07ff 100644
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
+++ b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
@@ -28,6 +28,7 @@ import java.util.stream.Stream;
 
 import javax.inject.Inject;
 
+import org.apache.isis.config.IsisConfiguration;
 import org.apache.wicket.Component;
 import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.Page;
@@ -301,7 +302,7 @@ public abstract class PageAbstract extends WebPage implements ActionPromptProvid
             response.render(JavaScriptReferenceHeaderItem.forUrl(applicationJs));
         }
 
-        String liveReloadUrl = getConfiguration().getString(LIVE_RELOAD_URL_KEY);
+        String liveReloadUrl = getConfigurationLegacy().getString(LIVE_RELOAD_URL_KEY);
         if(liveReloadUrl != null) {
             response.render(JavaScriptReferenceHeaderItem.forUrl(liveReloadUrl));
         }
@@ -427,12 +428,11 @@ public abstract class PageAbstract extends WebPage implements ActionPromptProvid
     }
 
     private boolean isShowBookmarks() {
-        return getConfiguration() .getBoolean(
-                BookmarkedPagesPanel.SHOW_BOOKMARKS_KEY, BookmarkedPagesPanel.SHOW_BOOKMARKS_DEFAULT);
+        return getConfiguration().getViewer().getWicket().getBookmarkedPages().isShowChooser();
     }
 
     protected boolean isShowBreadcrumbs() {
-        return getConfiguration() .getBoolean(
+        return getConfigurationLegacy() .getBoolean(
                 BreadcrumbPanel.SHOW_BREADCRUMBS_KEY, BreadcrumbPanel.SHOW_BREADCRUMBS_DEFAULT);
     }
 
@@ -477,7 +477,7 @@ public abstract class PageAbstract extends WebPage implements ActionPromptProvid
             sort == BeanSort.MANAGED_BEAN
             ? CONFIG_DIALOG_MODE_FOR_MENUS
                     : CONFIG_DIALOG_MODE;
-            final DialogMode dialogMode = configProp.from(getConfiguration());
+            final DialogMode dialogMode = configProp.from(getConfigurationLegacy());
             switch (dialogMode) {
             case SIDEBAR:
                 return actionPromptSidebar;
@@ -539,9 +539,12 @@ public abstract class PageAbstract extends WebPage implements ActionPromptProvid
 
     // -- DEPS
 
-    protected IsisConfigurationLegacy getConfiguration() {
+    protected IsisConfigurationLegacy getConfigurationLegacy() {
         return IsisContext.getConfigurationLegacy();
     }
+    protected IsisConfiguration getConfiguration() {
+        return IsisContext.getConfiguration();
+    }
 
     protected ServiceRegistry getServiceRegistry() {
         return IsisContext.getServiceRegistry();


[isis] 04/07: ISIS-2086: refactors 'isis.viewer.wicket.bookmarkedPages.maxSize' to type-safe config

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 66641efd6f1a1ad15434e2a376136d8a9e9c1f67
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 1 07:37:12 2019 +0100

    ISIS-2086: refactors 'isis.viewer.wicket.bookmarkedPages.maxSize' to type-safe config
---
 .../main/java/org/apache/isis/config/IsisConfiguration.java   |  6 ++++++
 .../isis/viewer/wicket/model/models/BookmarkedPagesModel.java | 11 ++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
index ce1fca3..902e16d 100644
--- a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
+++ b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
@@ -587,6 +587,12 @@ public class IsisConfiguration {
              */
             private boolean wicketSourcePlugin = false;
 
+            private final BookmarkedPages bookmarkedPages = new BookmarkedPages();
+            @Data
+            public static class BookmarkedPages {
+                private int maxSize = 15;
+            }
+
             private final DevelopmentUtilities developmentUtilities = new DevelopmentUtilities();
             @Data
             public static class DevelopmentUtilities {
diff --git a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.java b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.java
index d1e9533..69986ae 100644
--- a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.java
+++ b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.java
@@ -24,6 +24,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
 
+import org.apache.isis.config.IsisConfiguration;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 
 import org.apache.isis.commons.internal.collections._Lists;
@@ -37,9 +38,6 @@ public class BookmarkedPagesModel extends ModelAbstract<List<BookmarkTreeNode>>
 
     private static final long serialVersionUID = 1L;
 
-    private static final String MAX_SIZE_KEY = "isis.viewer.wicket.bookmarkedPages.maxSize";
-    private static final int MAX_SIZE_DEFAULT_VALUE = 15;
-
     private final List<BookmarkTreeNode> rootNodes = _Lists.newArrayList();
 
     private transient PageParameters current;
@@ -79,7 +77,7 @@ public class BookmarkedPagesModel extends ModelAbstract<List<BookmarkTreeNode>>
     }
 
     private int getMaxSize() {
-        return getConfiguration().getInteger(MAX_SIZE_KEY, MAX_SIZE_DEFAULT_VALUE);
+        return getConfiguration().getViewer().getWicket().getBookmarkedPages().getMaxSize();
     }
 
     private static void trim(List<?> list, int requiredSize) {
@@ -143,9 +141,12 @@ public class BookmarkedPagesModel extends ModelAbstract<List<BookmarkTreeNode>>
     // //////////////////////////////////////
 
 
-    protected IsisConfigurationLegacy getConfiguration() {
+    protected IsisConfigurationLegacy getConfigurationLegacy() {
         return IsisContext.getConfigurationLegacy();
     }
+    protected IsisConfiguration getConfiguration() {
+        return IsisContext.getConfiguration();
+    }
 
 
 }


[isis] 06/07: ISIS-2086: refactors 'isis.viewer.wicket.whereAmI.*' (2 of em) to type-safe config

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2086
in repository https://gitbox.apache.org/repos/asf/isis.git

commit a5b6a1ca1f7e04461464f689e4357cf454b03ddf
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 1 07:45:07 2019 +0100

    ISIS-2086: refactors 'isis.viewer.wicket.whereAmI.*' (2 of em) to type-safe config
---
 .../org/apache/isis/config/IsisConfiguration.java  |  7 +++++++
 .../model/models/whereami/WhereAmIModel.java       |  7 -------
 .../models/whereami/WhereAmIModelDefault.java      | 22 +++++++++-------------
 3 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
index ff0846a..5dbf7cd 100644
--- a/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
+++ b/core/config/src/main/java/org/apache/isis/config/IsisConfiguration.java
@@ -448,6 +448,7 @@ public class IsisConfiguration {
                 private boolean legacyParamDetails = false;
             }
         }
+
         private final Wicket wicket = new Wicket();
         @Data
         public static class Wicket {
@@ -625,6 +626,12 @@ public class IsisConfiguration {
                 private String encryptionKey;
             }
 
+            private final WhereAmI whereAmI = new WhereAmI();
+            @Data
+            public static class WhereAmI {
+                private boolean enabled = true;
+                private int maxParentChainLength = 64;
+            }
         }
     }
 
diff --git a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java
index dd14576..99ba91e 100644
--- a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java
+++ b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java
@@ -31,13 +31,6 @@ import org.apache.isis.viewer.wicket.model.models.EntityModel;
  */
 public interface WhereAmIModel {
 
-    public final static String CONFIG_KEY_IS_WHERE_AM_I_FEATURE_ENABLED = "isis.viewer.wicket.whereAmI.enabled";
-    public final static String CONFIG_KEY_MAX_NAVIGABLE_PARENT_CHAIN_LENGTH = "isis.viewer.wicket.whereAmI.maxParentChainLength";
-
-    public final static boolean IS_WHERE_AM_I_FEATURE_ENABLED_DEFAULT = true;
-    public final static int MAX_NAVIGABLE_PARENT_CHAIN_LENGTH_DEFAULT = 64;
-
-
     public static WhereAmIModel of(EntityModel startOfChain) {
         return new WhereAmIModelDefault(startOfChain);
     }
diff --git a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java
index 4bf31a7..9d61fcc 100644
--- a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java
+++ b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java
@@ -22,6 +22,7 @@ package org.apache.isis.viewer.wicket.model.models.whereami;
 import java.util.LinkedList;
 import java.util.stream.Stream;
 
+import org.apache.isis.config.IsisConfiguration;
 import org.apache.isis.config.IsisConfigurationLegacy;
 import org.apache.isis.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.metamodel.util.pchain.ParentChain;
@@ -40,14 +41,15 @@ class WhereAmIModelDefault implements WhereAmIModel {
     private final LinkedList<Object> reversedChainOfParents = new LinkedList<>();
     private final EntityModel startOfChain;
 
-    private static boolean isWhereAmIEnabled = IS_WHERE_AM_I_FEATURE_ENABLED_DEFAULT;
-    private static int maxChainLength = MAX_NAVIGABLE_PARENT_CHAIN_LENGTH_DEFAULT;
+    private boolean isWhereAmIEnabled;
+    private int maxChainLength;
+
     private static int configHash = 0;
 
     public WhereAmIModelDefault(EntityModel startOfChain) {
         this.startOfChain = startOfChain;
 
-        overrideFromConfigIfNew(IsisContext.getConfigurationLegacy());
+        overrideFromConfigIfNew(IsisContext.getConfigurationLegacy(), IsisContext.getConfiguration());
 
         final ObjectAdapter adapter = startOfChain.getObject();
         final Object startNode = adapter.getPojo();
@@ -87,7 +89,7 @@ class WhereAmIModelDefault implements WhereAmIModel {
         return new EntityModel(objectAdapter);
     }
 
-    private void overrideFromConfigIfNew(IsisConfigurationLegacy configuration) {
+    private void overrideFromConfigIfNew(IsisConfigurationLegacy configurationLegacy, IsisConfiguration configuration) {
 
         //[ahuber] without evidence that this significantly improves performance,
         // (skipping 2 hash-table lookups) we use the smart update idiom here ...
@@ -98,20 +100,14 @@ class WhereAmIModelDefault implements WhereAmIModel {
 
         // that's the hash of the object (we don't care about the actual config values)
         // assuming that, we get a new (immutable) config instance each app's life-cycle:
-        final int newConfigHash = System.identityHashCode(configuration);
+        final int newConfigHash = System.identityHashCode(configurationLegacy);
         if(newConfigHash == configHash)
             return;
 
         configHash = newConfigHash;
 
-        isWhereAmIEnabled = configuration.getBoolean(
-                CONFIG_KEY_IS_WHERE_AM_I_FEATURE_ENABLED,
-                IS_WHERE_AM_I_FEATURE_ENABLED_DEFAULT);
-        maxChainLength = configuration.getInteger(
-                CONFIG_KEY_MAX_NAVIGABLE_PARENT_CHAIN_LENGTH,
-                MAX_NAVIGABLE_PARENT_CHAIN_LENGTH_DEFAULT);
-
+        isWhereAmIEnabled = configuration.getViewer().getWicket().getWhereAmI().isEnabled();
+        maxChainLength = configuration.getViewer().getWicket().getWhereAmI().getMaxParentChainLength();
     }
 
-
 }