You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2019/08/04 10:55:44 UTC
[isis] branch v2 updated: ISIS-2158 rename Presets -> IsisPresets
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/v2 by this push:
new 29ec5d8 ISIS-2158 rename Presets -> IsisPresets
29ec5d8 is described below
commit 29ec5d8e9717325b62150d2e57f88fd5d19f2fad
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Aug 4 12:55:35 2019 +0200
ISIS-2158 rename Presets -> IsisPresets
- also simplifies preset property source configuration usage
---
.../java/org/apache/isis/config/IsisPresets.java | 148 +++++++++++++++++++++
.../main/java/org/apache/isis/config/Presets.java | 146 --------------------
.../presets/DataNucleusAutoCreate.properties | 26 ++++
.../main/resources/presets/H2InMemory.properties | 21 +++
.../resources/presets/HsqlDbInMemory.properties | 21 +++
.../resources/presets/IsisIntegTest.properties | 21 +++
.../resources/presets/NoTranslations.properties | 18 +++
.../main/java/domainapp/application/DemoApp.java | 6 +-
.../domainapp/application/DemoAppManifest.java | 6 +-
.../java/domainapp/application/HelloWorldApp.java | 4 +-
.../application/HelloWorldAppManifest.java | 8 +-
.../application/manifest/SimpleAppManifest.java | 8 +-
.../integtests/SimpleModuleManifestForTesting.java | 6 +-
.../main/java/domainapp/application/SimpleApp.java | 4 +-
.../isis/testdomain/jdo/JdoTestDomainModule.java | 6 +-
.../jdo/JdoTestDomainModule_withShiro.java | 6 +-
16 files changed, 282 insertions(+), 173 deletions(-)
diff --git a/core/config/src/main/java/org/apache/isis/config/IsisPresets.java b/core/config/src/main/java/org/apache/isis/config/IsisPresets.java
new file mode 100644
index 0000000..0326c82
--- /dev/null
+++ b/core/config/src/main/java/org/apache/isis/config/IsisPresets.java
@@ -0,0 +1,148 @@
+/*
+ * 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 agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.config;
+
+/**
+ * Introduced to support Spring's {@code @PropertySource} annotation.
+ *
+ * @since 2.0
+ *
+ */
+public final class IsisPresets {
+
+// public static final String ISIS_PERSISTOR = "isis.persistor.";
+// public static final String ISIS_PERSISTOR_DATANUCLEUS = ISIS_PERSISTOR + "datanucleus.";
+// public static final String ISIS_PERSISTOR_DATANUCLEUS_IMPL = ISIS_PERSISTOR_DATANUCLEUS + "impl.";
+
+// @RequiredArgsConstructor
+// private static enum Providers {
+//
+// H2InMemory(Providers::withH2InMemoryProperties),
+// HsqlDbInMemory(Providers::withHsqlDbInMemoryProperties),
+// DataNucleusAutoCreate(Providers::withDataNucleusProperties),
+// IsisIntegTest(Providers::withIsisIntegTestProperties),
+// NoTranslations(map->map.put("isis.services.translation.po.mode", "disable")),
+// ;
+//
+// private final Consumer<Map<String, String>> populator;
+//
+// private 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.ConnectionURL", "jdbc:h2:mem:test");
+// 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;
+// }
+//
+// private 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.ConnectionURL", "jdbc:hsqldb:mem:test");
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionDriverName", "org.hsqldb.jdbcDriver");
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionUserName", "sa");
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionPassword", "");
+//
+// return map;
+// }
+//
+// private static Map<String,String> withDataNucleusProperties(final Map<String, String> map) {
+//
+// // Don't do validations that consume setup time.
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.schema.autoCreateAll", "true");
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.schema.validateAll", "false");
+//
+// // other properties as per WEB-INF/persistor_datanucleus.properties
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.persistenceByReachabilityAtCommit", "false");
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.identifier.case", "MixedCase");
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.cache.level2.type" ,"none");
+// map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.cache.level2.mode", "ENABLE_SELECTIVE");
+//
+// return map;
+// }
+//
+// private static Map<String,String> withIsisIntegTestProperties(final Map<String, String> map) {
+//
+// // automatically install any fixtures that might have been registered
+// map.put(ISIS_PERSISTOR_DATANUCLEUS + "install-fixtures", "true");
+// map.put(ISIS_PERSISTOR + "enforceSafeSemantics", "false");
+// map.put("isis.services.eventbus.allowLateRegistration", "true");
+//
+// return map;
+// }
+//
+// }
+
+ public static final String NoTranslations = "classpath:/presets/NoTranslations.properties";
+
+ public static final String H2InMemory = "classpath:/presets/H2InMemory.properties";
+ public static final String HsqlDbInMemory = "classpath:/presets/HsqlDbInMemory.properties";
+ public static final String DataNucleusAutoCreate = "classpath:/presets/DataNucleusAutoCreate.properties";
+
+ /**
+ * @deprecated seems no longer required anyway
+ */
+ @Deprecated
+ public static final String IsisIntegTest = "classpath:/presets/IsisIntegTest.properties";
+
+
+
+// public static class Factory implements PropertySourceFactory {
+//
+// @Override
+// public PropertySource<?> createPropertySource(
+// String name,
+// EncodedResource resource) throws IOException {
+//
+// val map = new HashMap<String, String>();
+// Providers.valueOf(name).populator.accept(map);
+//
+// val widenedMap = new HashMap<String, Object>();
+// widenedMap.putAll(map);
+//
+// val propSource = new MapPropertySource(name, widenedMap);
+//
+// return propSource;
+// }
+//
+// }
+
+ /**
+ * Use PROTOTYPING mode as the default. Does not override if the system-property
+ * 'PROTOTYPING' was already set.
+ */
+ public static void prototyping() {
+ if(System.getProperty("PROTOTYPING")==null) {
+ forcePrototyping();
+ }
+ }
+
+ /**
+ * Use PROTOTYPING mode, overrides the system-property 'PROTOTYPING', if already
+ * set via command-line.
+ */
+ public static void forcePrototyping() {
+ System.setProperty("PROTOTYPING", "true");
+ }
+
+ public static void logging(Class<?> clazz, String loggingLevel) {
+ System.setProperty("logging.level." + clazz.getName(), loggingLevel);
+ }
+
+}
diff --git a/core/config/src/main/java/org/apache/isis/config/Presets.java b/core/config/src/main/java/org/apache/isis/config/Presets.java
deleted file mode 100644
index 8e4c56d..0000000
--- a/core/config/src/main/java/org/apache/isis/config/Presets.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * 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 agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.config;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.core.env.PropertySource;
-import org.springframework.core.io.support.EncodedResource;
-import org.springframework.core.io.support.PropertySourceFactory;
-
-import lombok.RequiredArgsConstructor;
-import lombok.val;
-
-/**
- * Introduced to support Spring's {@code @PropertySource} annotation.
- *
- * @since 2.0
- *
- */
-public final class Presets {
-
- public static final String ISIS_PERSISTOR = "isis.persistor.";
- public static final String ISIS_PERSISTOR_DATANUCLEUS = ISIS_PERSISTOR + "datanucleus.";
- public static final String ISIS_PERSISTOR_DATANUCLEUS_IMPL = ISIS_PERSISTOR_DATANUCLEUS + "impl.";
-
- @RequiredArgsConstructor
- private static enum Providers {
-
- H2InMemory(Providers::withH2InMemoryProperties),
- HsqlDbInMemory(Providers::withHsqlDbInMemoryProperties),
- DataNucleusAutoCreate(Providers::withDataNucleusProperties),
- IsisIntegTest(Providers::withIsisIntegTestProperties),
- NoTranslations(map->map.put("isis.services.translation.po.mode", "disable")),
- ;
-
- private final Consumer<Map<String, String>> populator;
-
- private 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.ConnectionURL", "jdbc:h2:mem:test");
- 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;
- }
-
- private 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.ConnectionURL", "jdbc:hsqldb:mem:test");
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionDriverName", "org.hsqldb.jdbcDriver");
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionUserName", "sa");
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "javax.jdo.option.ConnectionPassword", "");
-
- return map;
- }
-
- private static Map<String,String> withDataNucleusProperties(final Map<String, String> map) {
-
- // Don't do validations that consume setup time.
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.schema.autoCreateAll", "true");
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.schema.validateAll", "false");
-
- // other properties as per WEB-INF/persistor_datanucleus.properties
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.persistenceByReachabilityAtCommit", "false");
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.identifier.case", "MixedCase");
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.cache.level2.type" ,"none");
- map.put(ISIS_PERSISTOR_DATANUCLEUS_IMPL + "datanucleus.cache.level2.mode", "ENABLE_SELECTIVE");
-
- return map;
- }
-
- private static Map<String,String> withIsisIntegTestProperties(final Map<String, String> map) {
-
- // automatically install any fixtures that might have been registered
- map.put(ISIS_PERSISTOR_DATANUCLEUS + "install-fixtures", "true");
- map.put(ISIS_PERSISTOR + "enforceSafeSemantics", "false");
- map.put("isis.services.eventbus.allowLateRegistration", "true");
-
- return map;
- }
-
- }
-
- public static final String H2InMemory = "H2InMemory";
- public static final String HsqlDbInMemory = "HsqlDbInMemory";
- public static final String DataNucleusAutoCreate = "DataNucleusAutoCreate";
- public static final String IsisIntegTest = "IsisIntegTest";
- public static final String NoTranslations = "NoTranslations";
-
-
- public static class Factory implements PropertySourceFactory {
-
- @Override
- public PropertySource<?> createPropertySource(
- String name,
- EncodedResource resource) throws IOException {
-
- val map = new HashMap<String, String>();
- Providers.valueOf(name).populator.accept(map);
-
- val widenedMap = new HashMap<String, Object>();
- widenedMap.putAll(map);
-
- val propSource = new MapPropertySource(name, widenedMap);
-
- return propSource;
- }
-
- }
-
- /**
- * Use PROTOTYPING mode as the default. Does not override if the system-property
- * 'PROTOTYPING' was already set.
- */
- public static void prototyping() {
- if(System.getProperty("PROTOTYPING")==null) {
- System.setProperty("PROTOTYPING", "true");
- }
- }
-
- public static void logging(Class<?> clazz, String loggingLevel) {
- System.setProperty("logging.level." + clazz.getName(), loggingLevel);
- }
-
-}
diff --git a/core/config/src/main/resources/presets/DataNucleusAutoCreate.properties b/core/config/src/main/resources/presets/DataNucleusAutoCreate.properties
new file mode 100644
index 0000000..574b600
--- /dev/null
+++ b/core/config/src/main/resources/presets/DataNucleusAutoCreate.properties
@@ -0,0 +1,26 @@
+# 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 agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# don't do validations that consume setup time
+isis.persistor.datanucleus.impl.datanucleus.schema.autoCreateAll = true
+isis.persistor.datanucleus.impl.datanucleus.schema.validateAll = false
+
+# other properties as per WEB-INF/persistor_datanucleus.properties
+isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit = false
+isis.persistor.datanucleus.impl.datanucleus.identifier.case = MixedCase
+isis.persistor.datanucleus.impl.datanucleus.cache.level2.type = none
+isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode = ENABLE_SELECTIVE
diff --git a/core/config/src/main/resources/presets/H2InMemory.properties b/core/config/src/main/resources/presets/H2InMemory.properties
new file mode 100644
index 0000000..dd0d60a
--- /dev/null
+++ b/core/config/src/main/resources/presets/H2InMemory.properties
@@ -0,0 +1,21 @@
+# 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 agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL = jdbc:h2:mem:test
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName = org.h2.Driver
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName = sa
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword =
\ No newline at end of file
diff --git a/core/config/src/main/resources/presets/HsqlDbInMemory.properties b/core/config/src/main/resources/presets/HsqlDbInMemory.properties
new file mode 100644
index 0000000..763bb1b
--- /dev/null
+++ b/core/config/src/main/resources/presets/HsqlDbInMemory.properties
@@ -0,0 +1,21 @@
+# 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 agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL = jdbc:hsqldb:mem:test
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName = org.hsqldb.jdbcDriver
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName = sa
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword =
diff --git a/core/config/src/main/resources/presets/IsisIntegTest.properties b/core/config/src/main/resources/presets/IsisIntegTest.properties
new file mode 100644
index 0000000..6596fd5
--- /dev/null
+++ b/core/config/src/main/resources/presets/IsisIntegTest.properties
@@ -0,0 +1,21 @@
+# 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 agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# automatically install any fixtures that might have been registered
+isis.persistor.datanucleus.install-fixtures = true
+isis.persistor.enforceSafeSemantics = false
+isis.services.eventbus.allowLateRegistration = true
\ No newline at end of file
diff --git a/core/config/src/main/resources/presets/NoTranslations.properties b/core/config/src/main/resources/presets/NoTranslations.properties
new file mode 100644
index 0000000..0815d07
--- /dev/null
+++ b/core/config/src/main/resources/presets/NoTranslations.properties
@@ -0,0 +1,18 @@
+# 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 agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+isis.services.translation.po.mode = disable
\ No newline at end of file
diff --git a/examples/apps/demo/src/main/java/domainapp/application/DemoApp.java b/examples/apps/demo/src/main/java/domainapp/application/DemoApp.java
index 4bfe393..13e600f 100644
--- a/examples/apps/demo/src/main/java/domainapp/application/DemoApp.java
+++ b/examples/apps/demo/src/main/java/domainapp/application/DemoApp.java
@@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Import;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.webapp.modules.resources.ResourceServlet;
/**
@@ -42,10 +42,10 @@ public class DemoApp extends SpringBootServletInitializer {
* entry point by searching for classes having a {@code main(...)}
*/
public static void main(String[] args) {
- Presets.prototyping();
+ IsisPresets.prototyping();
//Presets.logging(IsisBeanScanInterceptorForSpring.class, "DEBUG");
//Presets.logging(IsisBeanTypeRegistry.class, "DEBUG");
- Presets.logging(ResourceServlet.class, "DEBUG");
+ IsisPresets.logging(ResourceServlet.class, "DEBUG");
SpringApplication.run(new Class[] { DemoApp.class }, args);
}
}
diff --git a/examples/apps/demo/src/main/java/domainapp/application/DemoAppManifest.java b/examples/apps/demo/src/main/java/domainapp/application/DemoAppManifest.java
index 2c65354..c4078b8 100644
--- a/examples/apps/demo/src/main/java/domainapp/application/DemoAppManifest.java
+++ b/examples/apps/demo/src/main/java/domainapp/application/DemoAppManifest.java
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.core.io.ClassPathResource;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.config.beans.IsisBeanScanInterceptorForSpring;
import org.apache.isis.config.beans.WebAppConfigBean;
import org.apache.isis.extensions.fixtures.IsisBootFixtures;
@@ -54,8 +54,8 @@ import domainapp.dom.DemoModule;
@Configuration
@PropertySources({
@PropertySource("classpath:/domainapp/application/isis-non-changing.properties"),
- @PropertySource(name=Presets.HsqlDbInMemory, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.NoTranslations, factory = Presets.Factory.class, value = { "" }),
+ @PropertySource(IsisPresets.HsqlDbInMemory),
+ @PropertySource(IsisPresets.NoTranslations),
})
@Import({
IsisBoot.class,
diff --git a/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldApp.java b/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldApp.java
index b4aa482..443b20d 100644
--- a/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldApp.java
+++ b/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldApp.java
@@ -24,7 +24,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Import;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
/**
* Bootstrap the application.
@@ -44,7 +44,7 @@ public class HelloWorldApp extends SpringBootServletInitializer {
* entry point by searching for classes having a {@code main(...)}
*/
public static void main(String[] args) {
- Presets.prototyping();
+ IsisPresets.prototyping();
SpringApplication.run(new Class[] { HelloWorldApp.class }, args);
}
diff --git a/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java b/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java
index a6b6393..342caff 100644
--- a/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java
+++ b/examples/apps/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.core.io.ClassPathResource;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.config.beans.IsisBeanScanInterceptorForSpring;
import org.apache.isis.config.beans.WebAppConfigBean;
import org.apache.isis.jdo.IsisBootDataNucleus;
@@ -47,9 +47,9 @@ import domainapp.dom.HelloWorldModule;
@Configuration
@PropertySources({
@PropertySource("classpath:/domainapp/application/isis-non-changing.properties"),
- @PropertySource(name=Presets.H2InMemory, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.NoTranslations, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.DataNucleusAutoCreate, factory = Presets.Factory.class, value = { "" }),
+ @PropertySource(IsisPresets.H2InMemory),
+ @PropertySource(IsisPresets.NoTranslations),
+ @PropertySource(IsisPresets.DataNucleusAutoCreate),
})
@Import({
IsisBoot.class,
diff --git a/examples/apps/simpleapp/application/src/main/java/domainapp/application/manifest/SimpleAppManifest.java b/examples/apps/simpleapp/application/src/main/java/domainapp/application/manifest/SimpleAppManifest.java
index 3805593..fcf7be5 100644
--- a/examples/apps/simpleapp/application/src/main/java/domainapp/application/manifest/SimpleAppManifest.java
+++ b/examples/apps/simpleapp/application/src/main/java/domainapp/application/manifest/SimpleAppManifest.java
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.core.io.ClassPathResource;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.config.beans.IsisBeanScanInterceptorForSpring;
import org.apache.isis.config.beans.WebAppConfigBean;
import org.apache.isis.extensions.fixtures.IsisBootFixtures;
@@ -49,9 +49,9 @@ import domainapp.modules.simple.SimpleModule;
@Configuration
@PropertySources({
@PropertySource("classpath:/domainapp/application/manifest/isis-non-changing.properties"),
- @PropertySource(name=Presets.HsqlDbInMemory, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.NoTranslations, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.DataNucleusAutoCreate, factory = Presets.Factory.class, value = { "" }),
+ @PropertySource(IsisPresets.HsqlDbInMemory),
+ @PropertySource(IsisPresets.NoTranslations),
+ @PropertySource(IsisPresets.DataNucleusAutoCreate),
})
@Import({
IsisBoot.class,
diff --git a/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java b/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java
index bb990f9..17ca124 100644
--- a/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java
+++ b/examples/apps/simpleapp/module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleManifestForTesting.java
@@ -29,7 +29,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.config.beans.IsisBeanScanInterceptorForSpring;
import org.apache.isis.config.beans.WebAppConfigBean;
import org.apache.isis.extensions.fixtures.IsisBootFixtures;
@@ -46,8 +46,8 @@ import domainapp.modules.simple.SimpleModule;
@Configuration
@PropertySources({
//@PropertySource("classpath:/domainapp/application/manifest/isis-non-changing.properties"),
- @PropertySource(name=Presets.HsqlDbInMemory, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.DataNucleusAutoCreate, factory = Presets.Factory.class, value = { "" }),
+ @PropertySource(IsisPresets.HsqlDbInMemory),
+ @PropertySource(IsisPresets.DataNucleusAutoCreate),
})
@Import({
IsisBoot.class,
diff --git a/examples/apps/simpleapp/webapp/src/main/java/domainapp/application/SimpleApp.java b/examples/apps/simpleapp/webapp/src/main/java/domainapp/application/SimpleApp.java
index bc310e7..1809e26 100644
--- a/examples/apps/simpleapp/webapp/src/main/java/domainapp/application/SimpleApp.java
+++ b/examples/apps/simpleapp/webapp/src/main/java/domainapp/application/SimpleApp.java
@@ -24,7 +24,7 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.security.shiro.IsisBootSecurityShiro;
import org.apache.isis.viewer.wicket.viewer.IsisBootWebWicket;
@@ -49,7 +49,7 @@ public class SimpleApp extends SpringBootServletInitializer {
* entry point by searching for classes having a {@code main(...)}
*/
public static void main(String[] args) {
- Presets.prototyping();
+ IsisPresets.prototyping();
SpringApplication.run(new Class[] { SimpleApp.class }, args);
}
diff --git a/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule.java b/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule.java
index 6f2a474..979a1ae 100644
--- a/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule.java
+++ b/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule.java
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.config.beans.IsisBeanScanInterceptorForSpring;
import org.apache.isis.config.beans.WebAppConfigBean;
import org.apache.isis.extensions.fixtures.IsisBootFixtures;
@@ -54,8 +54,8 @@ import org.apache.isis.security.IsisBootSecurityBypass;
)
@PropertySources({
@PropertySource("classpath:/org/apache/isis/testdomain/jdo/isis-non-changing.properties"),
- @PropertySource(name=Presets.H2InMemory, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.NoTranslations, factory = Presets.Factory.class, value = { "" }),
+ @PropertySource(IsisPresets.H2InMemory),
+ @PropertySource(IsisPresets.NoTranslations),
})
//by default disable shiro specific config to be picked up by Spring
@ConditionalOnProperty(value = "smoketest.withShiro", havingValue = "false", matchIfMissing = true)
diff --git a/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule_withShiro.java b/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule_withShiro.java
index 10232b9..8006aee 100644
--- a/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule_withShiro.java
+++ b/examples/smoketests/src/main/java/org/apache/isis/testdomain/jdo/JdoTestDomainModule_withShiro.java
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
-import org.apache.isis.config.Presets;
+import org.apache.isis.config.IsisPresets;
import org.apache.isis.config.beans.IsisBeanScanInterceptorForSpring;
import org.apache.isis.config.beans.WebAppConfigBean;
import org.apache.isis.extensions.fixtures.IsisBootFixtures;
@@ -59,8 +59,8 @@ import org.apache.isis.security.shiro.IsisBootSecurityShiro;
})
@PropertySources({
@PropertySource("classpath:/org/apache/isis/testdomain/jdo/isis-non-changing.properties"),
- @PropertySource(name=Presets.H2InMemory, factory = Presets.Factory.class, value = { "" }),
- @PropertySource(name=Presets.NoTranslations, factory = Presets.Factory.class, value = { "" }),
+ @PropertySource(IsisPresets.H2InMemory),
+ @PropertySource(IsisPresets.NoTranslations),
})
// enable shiro specific config to be picked up by Spring
@ConditionalOnProperty(value = "smoketest.withShiro", havingValue = "true", matchIfMissing = false)