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 2018/10/19 14:39:35 UTC

[isis] branch v2 updated (204a52d -> 879b7a7)

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

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


    from 204a52d  ISIS-1977: further changes to flattening.
     new bd3cf3d  ISIS-2013: adds support for H2 database (in integration tests)
     new 917f7f8  ISIS-2003: updates some stale documentation on themes
     new 879b7a7  ISIS-2003: adds theme config props for simple app, hello world

The 3 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:
 .../ugvw/_ugvw_configuration-properties.adoc       | 16 ++++++++----
 .../asciidoc/guides/ugvw/_ugvw_customisation.adoc  |  1 -
 .../ugvw/_ugvw_customisation_default-theme.adoc    | 29 ----------------------
 .../java/org/apache/isis/applib/AppManifest.java   | 28 ++++++++++++++++++++-
 .../integtestsupport/IntegrationTestAbstract3.java | 15 +++++++++--
 .../integtestsupport/IntegrationTestJupiter.java   | 15 +++++++++--
 .../isis/core/integtestsupport/ModuleBuilder.java  | 14 +++++++----
 core/pom.xml                                       |  8 ++++++
 .../application/isis-non-changing.properties       |  2 ++
 .../manifest/isis-non-changing.properties          |  2 ++
 .../bdd/specglue/BootstrappingGlueAbstract.java    |  7 +++++-
 11 files changed, 91 insertions(+), 46 deletions(-)
 delete mode 100644 adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation_default-theme.adoc


[isis] 03/03: ISIS-2003: adds theme config props for simple app, hello world

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

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

commit 879b7a75208f2bed86815e914327269b7cc5b7b9
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Oct 19 15:39:12 2018 +0100

    ISIS-2003: adds theme config props for simple app, hello world
---
 .../src/main/java/domainapp/application/isis-non-changing.properties    | 2 ++
 .../domainapp/application/manifest/isis-non-changing.properties         | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/example/application/helloworld/src/main/java/domainapp/application/isis-non-changing.properties b/example/application/helloworld/src/main/java/domainapp/application/isis-non-changing.properties
index b084f69..e1cd661 100644
--- a/example/application/helloworld/src/main/java/domainapp/application/isis-non-changing.properties
+++ b/example/application/helloworld/src/main/java/domainapp/application/isis-non-changing.properties
@@ -69,6 +69,8 @@ isis.viewer.wicket.credit.1.name=Apache Isis
 isis.viewer.wicket.credit.1.url=http://isis.apache.org
 
 isis.viewer.wicket.themes.initial=Flatly
+isis.viewer.wicket.themes.showChooser=yes
+isis.viewer.wicket.themes.enabled=Cosmo,Flatly,Darkly,Sandstone,United
 
 
 isis.viewer.wicket.maxTitleLengthInStandaloneTables=0
diff --git a/example/application/simpleapp/application/src/main/resources/domainapp/application/manifest/isis-non-changing.properties b/example/application/simpleapp/application/src/main/resources/domainapp/application/manifest/isis-non-changing.properties
index 353ed23..e3108db 100644
--- a/example/application/simpleapp/application/src/main/resources/domainapp/application/manifest/isis-non-changing.properties
+++ b/example/application/simpleapp/application/src/main/resources/domainapp/application/manifest/isis-non-changing.properties
@@ -372,6 +372,8 @@ isis.viewer.wicket.credit.1.name=Apache Isis
 isis.viewer.wicket.credit.1.url=http://isis.apache.org
 
 isis.viewer.wicket.themes.initial=Flatly
+isis.viewer.wicket.themes.showChooser=yes
+isis.viewer.wicket.themes.enabled=Cosmo,Flatly,Darkly,Sandstone,United
 
 #
 # Specify viewer defaults


[isis] 02/03: ISIS-2003: updates some stale documentation on themes

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

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

commit 917f7f862b22e8127f8ba5af6a5220f9548817d4
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Oct 19 14:55:45 2018 +0100

    ISIS-2003: updates some stale documentation on themes
---
 .../ugvw/_ugvw_configuration-properties.adoc       | 16 ++++++++----
 .../asciidoc/guides/ugvw/_ugvw_customisation.adoc  |  1 -
 .../ugvw/_ugvw_customisation_default-theme.adoc    | 29 ----------------------
 3 files changed, 11 insertions(+), 35 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_configuration-properties.adoc b/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_configuration-properties.adoc
index ab8fb1c..5f10581 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_configuration-properties.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_configuration-properties.adoc
@@ -588,10 +588,15 @@ See further discussion below.
 
 The Wicket viewer uses link:http://getbootstrap.com/[Bootstrap] styles and components (courtesy of the https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap] integration).
 
-Unless a xref:../ugvw/ugvw.adoc#_ugvw_customisation_default-theme[default theme has been specified], the viewer uses the default bootstrap theme.
-However, the viewer can also be configured to allow the end-user to switch theme to another theme, in particular one of those provided by http://bootswatch.com[bootswatch.com].
+By default the viewer uses the "Flatly" theme from http://bootswatch.com[bootswatch.com].
+This can be overridden using the following configuration property:
 
-This is done using the following configuration property (in `WEB-INF/viewer_wicket.properties`):
+[source,ini]
+----
+isis.viewer.wicket.themes.initial=Darky
+----
+
+The end-user can also be given the choice of changing the theme:
 
 [source,ini]
 ----
@@ -605,7 +610,9 @@ image::{_imagesdir}theme-chooser/example-1.png[width="720px",link="{_imagesdir}t
 .Example 2:
 image::{_imagesdir}theme-chooser/example-2.png[width="720px",link="{_imagesdir}theme-chooser/example-2.png"]
 
-It is also possible to restrict the themes shown to some subset of those in bootswatch. This is done using a further
+
+It is also possible to restrict the themes shown to some subset of those in bootswatch.
+This is done using a further
 property:
 
 [source,ini]
@@ -622,7 +629,6 @@ You can also develop and install a custom themes (eg to fit your company's look-
 
 
 
-
 [[_ugvw_configuration-properties_date-formatting]]
 == Date Formatting & Date Picker
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation.adoc b/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation.adoc
index d8e75f8..4579c02 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation.adoc
@@ -8,7 +8,6 @@
 
 include::_ugvw_customisation_top-level-index-page.adoc[leveloffset=+1]
 include::_ugvw_customisation_brand-logo.adoc[leveloffset=+1]
-include::_ugvw_customisation_default-theme.adoc[leveloffset=+1]
 include::_ugvw_customisation_welcome-page.adoc[leveloffset=+1]
 include::_ugvw_customisation_about-page.adoc[leveloffset=+1]
 include::_ugvw_customisation_tweaking-css-classes.adoc[leveloffset=+1]
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation_default-theme.adoc b/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation_default-theme.adoc
deleted file mode 100644
index 837c941..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_customisation_default-theme.adoc
+++ /dev/null
@@ -1,29 +0,0 @@
-[[_ugvw_customisation_default-theme]]
-= Specifying a default theme
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-:_basedir: ../../
-:_imagesdir: images/
-
-
-
-The Apache Isis Wicket viewer uses http://getbootstrap.com/[Bootstrap] styles and components (courtesy of the https://github.com/l0rdn1kk0n/wicket-bootstrap[Wicket Bootstrap] integration).
-
-Unless specified otherwise, the viewer uses the default bootstrap theme. However, this can be changed by overriding `init()` in the application's subclass of `IsisWicketApplication`. For example, to set the http://bootswatch.com/flatly/[bootswatch.com flatly] theme
- as the default, use:
-
-[source,java]
-----
-@Override
-protected void init() {
-    super.init();
-    IBootstrapSettings settings = Bootstrap.getSettings();
-    settings.setThemeProvider(new BootswatchThemeProvider(BootswatchTheme.Flatly));
-}
-----
-
-If you have developed a custom Bootstrap theme (as described xref:../ugvw/ugvw.adoc#_ugvw_extending_custom-bootstrap-theme[here]) then this can also be specified using the https://github.com/l0rdn1kk0n/wicket-bootstrap/wiki/Themes[Wicket Bootstrap API].
-
-
-
-
-


[isis] 01/03: ISIS-2013: adds support for H2 database (in integration tests)

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

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

commit bd3cf3dbf3601247cc30f8f6b6635c9129ed4145
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Oct 19 14:46:06 2018 +0100

    ISIS-2013: adds support for H2 database (in integration tests)
---
 .../java/org/apache/isis/applib/AppManifest.java   | 28 +++++++++++++++++++++-
 .../integtestsupport/IntegrationTestAbstract3.java | 15 ++++++++++--
 .../integtestsupport/IntegrationTestJupiter.java   | 15 ++++++++++--
 .../isis/core/integtestsupport/ModuleBuilder.java  | 14 +++++++----
 core/pom.xml                                       |  8 +++++++
 .../bdd/specglue/BootstrappingGlueAbstract.java    |  7 +++++-
 6 files changed, 76 insertions(+), 11 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java b/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java
index 9d84fbf..b834758 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java
@@ -263,8 +263,16 @@ public interface AppManifest {
         public static final String ISIS_PERSISTOR_DATANUCLEUS       = ISIS_PERSISTOR + "datanucleus.";
         public static final String ISIS_PERSISTOR_DATANUCLEUS_IMPL  = ISIS_PERSISTOR_DATANUCLEUS + "impl.";
 
-        public static Map<String,String> withJavaxJdoRunInMemoryProperties(final Map<String, String> map) {
+        public static Map<String,String> withH2InMemoryProperties(final Map<String, String> map) {
+            map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionURL", "jdbc:h2:mem:test-" + UUID.randomUUID().toString());
+            map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionDriverName", "org.h2.Driver");
+            map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionUserName", "sa");
+            map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionPassword", "");
 
+            return map;
+        }
+
+        public static Map<String,String> withHsqlDbInMemoryProperties(final Map<String, String> map) {
             map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionURL", "jdbc:hsqldb:mem:test-" + UUID.randomUUID().toString());
             map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionDriverName", "org.hsqldb.jdbcDriver");
             map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionUserName", "sa");
@@ -272,6 +280,10 @@ public interface AppManifest {
 
             return map;
         }
+        @Deprecated
+        public static Map<String,String> withJavaxJdoRunInMemoryProperties(final Map<String, String> map) {
+            return withHsqlDbInMemoryProperties(map);
+        }
 
         public static Map<String,String> withDataNucleusProperties(final Map<String, String> map) {
 
@@ -299,6 +311,20 @@ public interface AppManifest {
             return map;
         }
 
+        public enum MemDb {
+            HSQLDB{
+                @Override public void withProperties(final Map<String, String> map) {
+                    withHsqlDbInMemoryProperties(map);
+                }
+            },
+            H2{
+                @Override public void withProperties(final Map<String, String> map) {
+                    withH2InMemoryProperties(map);
+                }
+            };
+
+            public abstract void withProperties(final Map<String, String> map);
+        }
     }
 
 }
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract3.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract3.java
index 7dfb208..518052a 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract3.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract3.java
@@ -76,16 +76,27 @@ public abstract class IntegrationTestAbstract3 extends HeadlessWithBootstrapping
     }
 
     protected IntegrationTestAbstract3(final Module module) {
-        this(new LogConfig(Level.INFO), module);
+        this(new LogConfig(Level.INFO), module, AppManifest.Util.MemDb.HSQLDB);
+    }
+
+    protected IntegrationTestAbstract3(final Module module, final AppManifest.Util.MemDb memDb) {
+        this(new LogConfig(Level.INFO), module, memDb);
     }
 
     protected IntegrationTestAbstract3(
             final LogConfig logConfig,
             final Module module) {
+        this(logConfig, module, AppManifest.Util.MemDb.HSQLDB);
+    }
+
+    protected IntegrationTestAbstract3(
+            final LogConfig logConfig,
+            final Module module,
+            final AppManifest.Util.MemDb memDb) {
         super(logConfig,
                 ModuleBuilder.create(module)
                 .withHeadlessTransactionSupport()
-                .withIntegrationTestConfigFallback()
+                .withIntegrationTestConfigFallback(memDb)
                 .build() );
     }
 
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestJupiter.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestJupiter.java
index 5745398..976c051 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestJupiter.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestJupiter.java
@@ -71,16 +71,27 @@ public abstract class IntegrationTestJupiter extends HeadlessWithBootstrappingAb
     }
 
     protected IntegrationTestJupiter(final Module module) {
-        this(new LogConfig(Level.INFO), module);
+        this(new LogConfig(Level.INFO), module, AppManifest.Util.MemDb.HSQLDB);
+    }
+
+    protected IntegrationTestJupiter(final Module module, final AppManifest.Util.MemDb memDb) {
+        this(new LogConfig(Level.INFO), module, memDb);
     }
 
     protected IntegrationTestJupiter(
             final LogConfig logConfig,
             final Module module) {
+        this(logConfig, module, AppManifest.Util.MemDb.HSQLDB);
+    }
+
+    protected IntegrationTestJupiter(
+            final LogConfig logConfig,
+            final Module module,
+            final AppManifest.Util.MemDb memDb) {
         super(logConfig,
                 ModuleBuilder.create(module)
                 .withHeadlessTransactionSupport()
-                .withIntegrationTestConfigFallback()
+                .withIntegrationTestConfigFallback(memDb)
                 .build() );
     }
 
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/ModuleBuilder.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/ModuleBuilder.java
index 561db04..0159896 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/ModuleBuilder.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/ModuleBuilder.java
@@ -51,17 +51,21 @@ public class ModuleBuilder {
         module.getAdditionalServices().add(HeadlessTransactionSupportDefault.class);
         return this;
     }
+
     /**
      * Adds default fallback configuration values for integration tests,
      * without overriding any existing key value pairs.
      */
     public ModuleBuilder withIntegrationTestConfigFallback() {
-        final Map<String, String> integrationTestDefaultConfig = new HashMap<>();
-        AppManifest.Util.withJavaxJdoRunInMemoryProperties(integrationTestDefaultConfig);
-        AppManifest.Util.withDataNucleusProperties(integrationTestDefaultConfig);
-        AppManifest.Util.withIsisIntegTestProperties(integrationTestDefaultConfig);
+        return withIntegrationTestConfigFallback(AppManifest.Util.MemDb.HSQLDB);
+    }
+    public ModuleBuilder withIntegrationTestConfigFallback(AppManifest.Util.MemDb memDb) {
+        final Map<String, String> map = new HashMap<>();
+        memDb.withProperties(map);
+        AppManifest.Util.withDataNucleusProperties(map);
+        AppManifest.Util.withIsisIntegTestProperties(map);
 
-        integrationTestDefaultConfig.forEach((k, v)-> module.getFallbackConfigProps().putIfAbsent(k, v));
+        map.forEach((k, v)-> module.getFallbackConfigProps().putIfAbsent(k, v));
         return this;
     }
 }
diff --git a/core/pom.xml b/core/pom.xml
index 3b01d5f..79d147e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -149,6 +149,7 @@
         <swagger-core.version>1.5.21</swagger-core.version>
 
         <hsqldb.version>2.4.1</hsqldb.version>
+        <h2.version>1.4.197</h2.version>
         <log4jdbc-remix.version>0.2.7</log4jdbc-remix.version>
 
         <jetty.version>9.4.3.v20170317</jetty.version>
@@ -1601,6 +1602,13 @@ ${license.additional-notes}
             </dependency>
 
             <dependency>
+                <groupId>com.h2database</groupId>
+                <artifactId>h2</artifactId>
+                <version>${h2.version}</version>
+            </dependency>
+
+
+            <dependency>
               <groupId>org.lazyluke</groupId>
               <artifactId>log4jdbc-remix</artifactId>
               <version>${log4jdbc-remix.version}</version>
diff --git a/example/application/simpleapp/application/src/test/java/domainapp/application/bdd/specglue/BootstrappingGlueAbstract.java b/example/application/simpleapp/application/src/test/java/domainapp/application/bdd/specglue/BootstrappingGlueAbstract.java
index 92e9eb8..43acc8e 100644
--- a/example/application/simpleapp/application/src/test/java/domainapp/application/bdd/specglue/BootstrappingGlueAbstract.java
+++ b/example/application/simpleapp/application/src/test/java/domainapp/application/bdd/specglue/BootstrappingGlueAbstract.java
@@ -16,6 +16,7 @@ O *  Licensed to the Apache Software Foundation (ASF) under one or more
  */
 package domainapp.application.bdd.specglue;
 
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.applib.Module;
 import org.apache.isis.core.integtestsupport.ModuleBuilder;
 import org.apache.isis.core.runtime.headless.HeadlessWithBootstrappingAbstract;
@@ -23,9 +24,13 @@ import org.apache.isis.core.runtime.headless.HeadlessWithBootstrappingAbstract;
 public class BootstrappingGlueAbstract extends HeadlessWithBootstrappingAbstract {
 
     public BootstrappingGlueAbstract(final Module module) {
+        this(module, AppManifest.Util.MemDb.HSQLDB);
+    }
+
+    public BootstrappingGlueAbstract(final Module module, final AppManifest.Util.MemDb memDb) {
         super(ModuleBuilder.create(module)
                 .withHeadlessTransactionSupport()
-                .withIntegrationTestConfigFallback()
+                .withIntegrationTestConfigFallback(memDb)
                 .build());
     }