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 2015/08/04 08:07:05 UTC
[2/2] isis git commit: ISIS-1052: recreating simpleapp archetype
ISIS-1052: recreating simpleapp archetype
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/20c819c3
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/20c819c3
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/20c819c3
Branch: refs/heads/master
Commit: 20c819c31574335b76d9d39cc6ac1649a0e11b0b
Parents: f417608
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Aug 4 07:04:39 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Aug 4 07:04:39 2015 +0100
----------------------------------------------------------------------
.../fixture/DomainAppFixturesProvider.java | 47 ++++++++++++
.../fixture/DomainAppFixturesService.java | 79 --------------------
.../modules/simple/SimpleObjectsTearDown.java | 2 +-
.../webapp/src/main/webapp/WEB-INF/web.xml | 2 +-
.../projects/basic/archetype.properties | 2 +-
5 files changed, 50 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/20c819c3/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
new file mode 100644
index 0000000..f3e1f5f
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
@@ -0,0 +1,47 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 domainapp.fixture;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecification;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecificationProvider;
+
+import domainapp.fixture.scenarios.RecreateSimpleObjects;
+
+/**
+ * Specifies where to find fixtures, and other settings.
+ */
+@DomainService(nature = NatureOfService.DOMAIN)
+public class DomainAppFixturesProvider implements FixtureScriptsSpecificationProvider {
+ @Override
+ public FixtureScriptsSpecification getSpecification() {
+ return FixtureScriptsSpecification
+ .builder(DomainAppFixturesProvider.class)
+ .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
+ .withRunScriptDefault(RecreateSimpleObjects.class)
+ .withRunScriptDropDown(FixtureScriptsSpecification.DropDownPolicy.CHOICES)
+ .withRecreate(RecreateSimpleObjects.class)
+ .build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/20c819c3/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesService.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesService.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesService.java
deleted file mode 100644
index c21a081..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesService.java
+++ /dev/null
@@ -1,79 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 domainapp.fixture;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.fixturescripts.FixtureResult;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-
-import domainapp.fixture.scenarios.RecreateSimpleObjects;
-
-/**
- * Enables fixtures to be installed from the application.
- */
-@DomainService
-@DomainServiceLayout(
- named="Prototyping",
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- menuOrder = "500"
-)
-public class DomainAppFixturesService extends FixtureScripts {
-
- public DomainAppFixturesService() {
- super(DomainAppFixturesService.class.getPackage().getName(), MultipleExecutionStrategy.EXECUTE);
- }
-
- @Override
- public FixtureScript default0RunFixtureScript() {
- return findFixtureScriptFor(RecreateSimpleObjects.class);
- }
-
- @Override
- public List<FixtureScript> choices0RunFixtureScript() {
- return super.choices0RunFixtureScript();
- }
-
-
- // //////////////////////////////////////
-
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @ActionLayout(
- cssClassFa="fa fa-refresh"
- )
- @MemberOrder(sequence="20")
- public Object recreateObjectsAndReturnFirst() {
- final List<FixtureResult> run = findFixtureScriptFor(RecreateSimpleObjects.class).run(null);
- return run.get(0).getObject();
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/20c819c3/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
index 32b739f..4db93d1 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
@@ -29,7 +29,7 @@ public class SimpleObjectsTearDown extends FixtureScript {
@Override
protected void execute(ExecutionContext executionContext) {
- isisJdoSupport.executeUpdate("delete from simple.${symbol_escape}"SimpleObject${symbol_escape}"");
+ isisJdoSupport.executeUpdate("delete from ${symbol_escape}"simple${symbol_escape}".${symbol_escape}"SimpleObject${symbol_escape}"");
}
http://git-wip-us.apache.org/repos/asf/isis/blob/20c819c3/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
index ed2c701..905f9dd 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
@@ -215,7 +215,7 @@
<context-param>
<param-name>deploymentType</param-name>
- <param-value>SERVER_EXPLORATION</param-value>
+ <param-value>SERVER_PROTOTYPE</param-value>
</context-param>
<context-param>
http://git-wip-us.apache.org/repos/asf/isis/blob/20c819c3/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
index 843f345..12f4b7b 100644
--- a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Wed Jul 08 00:44:31 BST 2015
+#Tue Aug 04 07:04:28 BST 2015
package=it.pkg
version=0.1-SNAPSHOT
groupId=archetype.it