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 2014/12/19 09:07:24 UTC

[01/11] isis git commit: ISIS-284: updating archetype generation stuff so that the isis profile is not active in the examples but is active for (applications generated from) the archetypes.

Repository: isis
Updated Branches:
  refs/heads/master ad9951eec -> a90691ade


ISIS-284: updating archetype generation stuff so that the isis profile is not active in the examples but is active for (applications generated from) the archetypes.


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

Branch: refs/heads/master
Commit: 26ddb282fabd5d1fe20765ae9e37152d17a00922
Parents: ad9951e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Dec 18 07:19:20 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 06:22:41 2014 +0000

----------------------------------------------------------------------
 example/application/simpleapp/dom/pom.xml      |  3 ++
 example/application/todoapp/dom/pom.xml        |  3 ++
 scripts/updateGeneratedArchetypeSources.groovy | 39 +++++++++++++++++++--
 3 files changed, 43 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/26ddb282/example/application/simpleapp/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/pom.xml b/example/application/simpleapp/dom/pom.xml
index 9c3b00d..627ad06 100644
--- a/example/application/simpleapp/dom/pom.xml
+++ b/example/application/simpleapp/dom/pom.xml
@@ -127,6 +127,9 @@
     <profiles>
         <profile>
             <id>isis</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/isis/blob/26ddb282/example/application/todoapp/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/pom.xml b/example/application/todoapp/dom/pom.xml
index b6ee984..0c2e8f2 100644
--- a/example/application/todoapp/dom/pom.xml
+++ b/example/application/todoapp/dom/pom.xml
@@ -127,6 +127,9 @@
     <profiles>
         <profile>
             <id>isis</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
             <build>
                 <plugins>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/isis/blob/26ddb282/scripts/updateGeneratedArchetypeSources.groovy
----------------------------------------------------------------------
diff --git a/scripts/updateGeneratedArchetypeSources.groovy b/scripts/updateGeneratedArchetypeSources.groovy
index 6f0c509..e763b4b 100644
--- a/scripts/updateGeneratedArchetypeSources.groovy
+++ b/scripts/updateGeneratedArchetypeSources.groovy
@@ -103,7 +103,7 @@ isis_version=options.v
 
 /////////////////////////////////////////////////////
 //
-// update pom.xml's groupId
+// update archetype's own pom.xml's groupId
 //
 /////////////////////////////////////////////////////
 
@@ -145,6 +145,41 @@ pomFile.text =
 
 /////////////////////////////////////////////////////
 //
+// update archetype's resource's dom/pom.xml's activeByDefault=true
+//
+/////////////////////////////////////////////////////
+
+def pomDomFile=new File(BASE+"src/main/resources/archetype-resources/dom/pom.xml")
+
+println "updating ${pomDomFile.path}"
+
+// read file, ignoring XML pragma
+def pomDomFileText = stripXmlPragma(pomDomFile)
+
+def pomDomXml = new XmlSlurper(false,true).parseText(pomDomFileText)
+
+pomDomXml.profiles.profile.activation.activeByDefault='true'
+
+def pomDomSmb = new groovy.xml.StreamingMarkupBuilder().bind {
+     mkp.declareNamespace("":"http://maven.apache.org/POM/4.0.0")
+     mkp.yield(pomDomXml)
+}
+
+
+def pomDomTempFile = File.createTempFile("temp",".xml")
+def indentedDomXml = indentXml(pomDomSmb.toString())
+pomDomTempFile.text = indentedDomXml
+def pomDomXmlText = stripXmlPragma(pomDomTempFile)
+
+
+pomDomFile.text = 
+    license_using_xml_comments + 
+    pomDomXmlText
+
+
+
+/////////////////////////////////////////////////////
+//
 // update archetype-metadata.xml
 //
 /////////////////////////////////////////////////////
@@ -227,7 +262,7 @@ supplementalModelsFile.text = supplemental_models_text
 
 String indentXml(xml) {
     def factory = TransformerFactory.newInstance()
-    factory.setAttribute("indent-number", 2);
+    factory.setAttribute("indent-number", 4);
 
     Transformer transformer = factory.newTransformer()
     transformer.setOutputProperty(OutputKeys.INDENT, 'yes')


[08/11] isis git commit: ISIS-982: changing the names of the generated war files for simpleapp and todoapp.

Posted by da...@apache.org.
ISIS-982: changing the names of the generated war files for simpleapp and todoapp.


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

Branch: refs/heads/master
Commit: eea7e73f2dc0a41ad968bf27e43024e5bd17c988
Parents: 2520b00
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 07:56:16 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 07:56:16 2014 +0000

----------------------------------------------------------------------
 example/application/simpleapp/webapp/pom.xml | 2 +-
 example/application/todoapp/webapp/pom.xml   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/eea7e73f/example/application/simpleapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/pom.xml b/example/application/simpleapp/webapp/pom.xml
index 0b6ad19..1b9961c 100644
--- a/example/application/simpleapp/webapp/pom.xml
+++ b/example/application/simpleapp/webapp/pom.xml
@@ -78,7 +78,7 @@
             <plugin>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
-                    <warName>simple</warName>
+                    <warName>simpleapp</warName>
                     <archive>
                         <manifest>
                             <addClasspath>false</addClasspath>

http://git-wip-us.apache.org/repos/asf/isis/blob/eea7e73f/example/application/todoapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/pom.xml b/example/application/todoapp/webapp/pom.xml
index 7ea3bac..deba3b7 100644
--- a/example/application/todoapp/webapp/pom.xml
+++ b/example/application/todoapp/webapp/pom.xml
@@ -78,7 +78,7 @@
             <plugin>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
-                    <warName>quickstart</warName>
+                    <warName>todoapp</warName>
                     <archive>
                         <manifest>
                             <addClasspath>false</addClasspath>


[03/11] isis git commit: ISIS-928: minor incidental changes to the todoapp (additional tests)

Posted by da...@apache.org.
ISIS-928: minor incidental changes to the todoapp (additional tests)


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

Branch: refs/heads/master
Commit: f4197f196fbe10a8c3b12cc1bacaa8371590d09f
Parents: a1529f7
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Dec 18 08:53:48 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 06:22:43 2014 +0000

----------------------------------------------------------------------
 .../dom/src/main/java/dom/todo/ToDoItem.java    | 34 ++++++++++-----
 .../src/test/java/dom/todo/ToDoItemTest.java    | 46 ++++++++++++++++++--
 .../integration/glue/todoitem/ToDoItemGlue.java |  4 +-
 3 files changed, 67 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/f4197f19/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
index 2c79aee..1fff120 100644
--- a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
+++ b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
@@ -182,6 +182,14 @@ public class ToDoItem implements Categorized, Comparable<ToDoItem> {
         return dueBy;
     }
 
+    /**
+     * Demonstrates how to perform security checks within the domain code.
+     *
+     * <p>
+     *     Generally speaking this approach is not recommended; such checks should
+     *     wherever possible be externalized in the security subsystem.
+     * </p>
+     */
     public boolean hideDueBy() {
         final UserMemento user = container.getUser();
         return user.hasRole("realm1:noDueBy_role");
@@ -903,26 +911,28 @@ public class ToDoItem implements Categorized, Comparable<ToDoItem> {
 
     //region > injected services
     @javax.inject.Inject
-    private DomainObjectContainer container;
+    DomainObjectContainer container;
 
     @javax.inject.Inject
-    private ToDoItems toDoItems;
+    ToDoItems toDoItems;
 
-    Bulk.InteractionContext bulkInteractionContext;
-    public void injectBulkInteractionContext(Bulk.InteractionContext bulkInteractionContext) {
-        this.bulkInteractionContext = bulkInteractionContext;
-    }
+    @javax.inject.Inject
+    Scratchpad scratchpad;
 
+    /**
+     * public only so can be injected from integ tests
+     */
     @javax.inject.Inject
-    private Scratchpad scratchpad;
+    public Bulk.InteractionContext bulkInteractionContext;
 
-    EventBusService eventBusService;
-    public void injectEventBusService(EventBusService eventBusService) {
-        this.eventBusService = eventBusService;
-    }
+    /**
+     * public only so can be injected from integ tests
+     */
+    @javax.inject.Inject
+    public EventBusService eventBusService;
 
     @javax.inject.Inject
-    private WrapperFactory wrapperFactory;
+    WrapperFactory wrapperFactory;
 
     //endregion
 

http://git-wip-us.apache.org/repos/asf/isis/blob/f4197f19/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java b/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
index 63512c1..a9c102c 100644
--- a/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
+++ b/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
@@ -16,11 +16,15 @@
  */
 package dom.todo;
 
+import org.jmock.Expectations;
 import org.jmock.auto.Mock;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
+import org.apache.isis.applib.DomainObjectContainer;
 import org.apache.isis.applib.annotation.Bulk;
+import org.apache.isis.applib.security.RoleMemento;
+import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.applib.services.eventbus.EventBusService;
 import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
 import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
@@ -50,9 +54,45 @@ public abstract class ToDoItemTest {
         context.ignoring(eventBusService);
     }
 
-    public static class Actions {
+    public static class Properties extends ToDoItemTest {
 
-        public static class Completed extends ToDoItemTest {
+        @Mock
+        DomainObjectContainer mockContainer;
+
+        public static class DueBy extends Properties {
+
+            @Test
+            public void hiddenForNoDueByRole() {
+                final UserMemento userWithRole = new UserMemento("user", new RoleMemento("realm1:noDueBy_role"));
+                context.checking(new Expectations() {{
+                    allowing(mockContainer).getUser();
+                    will(returnValue(userWithRole));
+                }});
+
+                toDoItem.container = mockContainer;
+
+                assertThat(toDoItem.hideDueBy(), is(true));
+            }
+
+            @Test
+            public void notHiddenWithoutRole() {
+                final UserMemento userWithRole = new UserMemento("user", new RoleMemento("realm1:someOtherRole"));
+                context.checking(new Expectations() {{
+                    allowing(mockContainer).getUser();
+                    will(returnValue(userWithRole));
+                }});
+
+                toDoItem.container = mockContainer;
+
+                assertThat(toDoItem.hideDueBy(), is(false));
+            }
+        }
+
+    }
+
+    public static class Actions extends ToDoItemTest {
+
+        public static class Completed extends Actions {
 
             @Test
             public void happyCase() throws Exception {
@@ -70,7 +110,7 @@ public abstract class ToDoItemTest {
             }
         }
 
-        public static class NotYetCompleted extends ToDoItemTest {
+        public static class NotYetCompleted extends Actions {
 
             @Test
             public void happyCase() throws Exception {

http://git-wip-us.apache.org/repos/asf/isis/blob/f4197f19/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java b/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
index 1997ce1..0782e38 100644
--- a/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
+++ b/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
@@ -80,8 +80,8 @@ public class ToDoItemGlue extends CukeGlueAbstract {
                     allowing(eventBusService);
                 }
             });
-            toDoItem.injectBulkInteractionContext(bulkInteractionContext);
-            toDoItem.injectEventBusService(eventBusService);
+            toDoItem.bulkInteractionContext = bulkInteractionContext;
+            toDoItem.eventBusService = eventBusService;
         }
         wrap(toDoItem).completed();
     }


[11/11] isis git commit: ISIS-928: recreating todoapp archetype

Posted by da...@apache.org.
ISIS-928: recreating todoapp archetype


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

Branch: refs/heads/master
Commit: a90691ade545c142468be71fcbeb51117bdc9865
Parents: 57a56de
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 08:03:10 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 08:03:10 2014 +0000

----------------------------------------------------------------------
 example/archetype/todoapp/pom.xml               |  56 ++--
 .../META-INF/maven/archetype-metadata.xml       | 286 +++++++++----------
 .../resources/archetype-resources/dom/pom.xml   |   6 +-
 .../dom/src/main/java/dom/todo/ToDoItem.java    |  42 +--
 .../src/main/java/dom/todo/ToDoItem.layout.json |   3 +-
 .../src/test/java/dom/todo/ToDoItemTest.java    |  46 ++-
 .../integration/glue/todoitem/ToDoItemGlue.java |   4 +-
 .../archetype-resources/webapp/pom.xml          |   2 +-
 .../projects/basic/archetype.properties         |   2 +-
 9 files changed, 250 insertions(+), 197 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/pom.xml b/example/archetype/todoapp/pom.xml
index a1ce46a..dfc82e5 100644
--- a/example/archetype/todoapp/pom.xml
+++ b/example/archetype/todoapp/pom.xml
@@ -18,33 +18,33 @@
   under the License.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.isis.archetype</groupId>
-  <artifactId>todoapp-archetype</artifactId>
-  <version>1.8.0-SNAPSHOT</version>
-  <packaging>maven-archetype</packaging>
-  <name>todoapp-archetype</name>
-  <build>
-    <extensions>
-      <extension>
-        <groupId>org.apache.maven.archetype</groupId>
-        <artifactId>archetype-packaging</artifactId>
-        <version>2.2</version>
-      </extension>
-    </extensions>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <artifactId>maven-archetype-plugin</artifactId>
-          <version>2.2</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-  <parent>
-    <groupId>org.apache.isis.core</groupId>
-    <artifactId>isis</artifactId>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.isis.archetype</groupId>
+    <artifactId>todoapp-archetype</artifactId>
     <version>1.8.0-SNAPSHOT</version>
-    <relativePath>../../../core/pom.xml</relativePath>
-  </parent>
+    <packaging>maven-archetype</packaging>
+    <name>todoapp-archetype</name>
+    <build>
+        <extensions>
+            <extension>
+                <groupId>org.apache.maven.archetype</groupId>
+                <artifactId>archetype-packaging</artifactId>
+                <version>2.2</version>
+            </extension>
+        </extensions>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-archetype-plugin</artifactId>
+                    <version>2.2</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+    <parent>
+        <groupId>org.apache.isis.core</groupId>
+        <artifactId>isis</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../../../core/pom.xml</relativePath>
+    </parent>
 </project>

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
index 2698586..165865d 100644
--- a/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -18,147 +18,147 @@
   under the License.
 -->
 <archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="todoapp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modules>
-    <module id="${rootArtifactId}-dom" dir="dom" name="${rootArtifactId}-dom">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.xml</include>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.png</include>
-            <include>**/*.json</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/resources</directory>
-          <includes>
-            <include>**/*.xml</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/test/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory/>
-          <includes>
-            <include>log4j.properties</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-    <module id="${rootArtifactId}-fixture" dir="fixture" name="${rootArtifactId}-fixture">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory/>
-          <includes>
-            <include>.gitignore</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-    <module id="${rootArtifactId}-integtests" dir="integtests" name="${rootArtifactId}-integtests">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/test/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/test/java</directory>
-          <includes>
-            <include>**/*.feature</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory/>
-          <includes>
-            <include>logging.properties</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-    <module id="${rootArtifactId}-webapp" dir="webapp" name="${rootArtifactId}-webapp">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/webapp</directory>
-          <includes>
-            <include>**/*.xml</include>
-            <include>**/*.html</include>
-            <include>**/*.properties</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/resources</directory>
-          <includes>
-            <include>**/*.html</include>
-            <include>**/*.properties</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/main/jettyconsole</directory>
-          <includes>
-            <include>**/*.png</include>
-            <include>**/*.pdn</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/main/webapp</directory>
-          <includes>
-            <include>**/*.png</include>
-            <include>**/*.js</include>
-            <include>**/*.ini</include>
-            <include>**/*.gif</include>
-            <include>**/*.css</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/main/resources</directory>
-          <includes>
-            <include>**/*.ini</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>ide/intellij</directory>
-          <includes>
-            <include>**/*.xml</include>
-            <include>**/*.txt</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>lib</directory>
-          <includes>
-            <include>**/*.gitignore</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>ide/eclipse</directory>
-          <includes>
-            <include>**/*.launch</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-  </modules>
+    <modules>
+        <module id="${rootArtifactId}-dom" dir="dom" name="${rootArtifactId}-dom">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.png</include>
+                        <include>**/*.json</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/resources</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/test/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory/>
+                    <includes>
+                        <include>log4j.properties</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+        <module id="${rootArtifactId}-fixture" dir="fixture" name="${rootArtifactId}-fixture">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory/>
+                    <includes>
+                        <include>.gitignore</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+        <module id="${rootArtifactId}-integtests" dir="integtests" name="${rootArtifactId}-integtests">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/test/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/test/java</directory>
+                    <includes>
+                        <include>**/*.feature</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory/>
+                    <includes>
+                        <include>logging.properties</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+        <module id="${rootArtifactId}-webapp" dir="webapp" name="${rootArtifactId}-webapp">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/webapp</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                        <include>**/*.html</include>
+                        <include>**/*.properties</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/resources</directory>
+                    <includes>
+                        <include>**/*.html</include>
+                        <include>**/*.properties</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/jettyconsole</directory>
+                    <includes>
+                        <include>**/*.png</include>
+                        <include>**/*.pdn</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/webapp</directory>
+                    <includes>
+                        <include>**/*.png</include>
+                        <include>**/*.js</include>
+                        <include>**/*.ini</include>
+                        <include>**/*.gif</include>
+                        <include>**/*.css</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/resources</directory>
+                    <includes>
+                        <include>**/*.ini</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>ide/intellij</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                        <include>**/*.txt</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>lib</directory>
+                    <includes>
+                        <include>**/*.gitignore</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>ide/eclipse</directory>
+                    <includes>
+                        <include>**/*.launch</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+    </modules>
 </archetype-descriptor>

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
index b7589e6..38e5063 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
@@ -117,7 +117,9 @@
 
     <profiles>
         <profile>
-            <id>isis</id>
+            <id>isis-validate</id>
+            <activation>
+            </activation>
             <build>
                 <plugins>
                     <plugin>
@@ -125,7 +127,7 @@
                         <artifactId>isis-maven-plugin</artifactId>
                         <version>1.8.0-SNAPSHOT</version>
                         <configuration>
-                            <isisConfigDir>..\webapp\src\main\webapp\WEB-INF</isisConfigDir>
+                            <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
                         </configuration>
                         <dependencies>
                             <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
index 27749f4..11da27a 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
@@ -43,6 +43,7 @@ import org.apache.isis.applib.Identifier;
 import org.apache.isis.applib.NonRecoverableException;
 import org.apache.isis.applib.RecoverableException;
 import org.apache.isis.applib.annotation.ActionInteraction;
+import org.apache.isis.applib.annotation.ActionLayout;
 import org.apache.isis.applib.annotation.ActionSemantics;
 import org.apache.isis.applib.annotation.ActionSemantics.Of;
 import org.apache.isis.applib.annotation.AutoComplete;
@@ -60,7 +61,6 @@ import org.apache.isis.applib.annotation.Optional;
 import org.apache.isis.applib.annotation.ParameterLayout;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.applib.annotation.PropertyInteraction;
-import org.apache.isis.applib.annotation.Prototype;
 import org.apache.isis.applib.annotation.RegEx;
 import org.apache.isis.applib.annotation.TypicalLength;
 import org.apache.isis.applib.security.UserMemento;
@@ -185,6 +185,14 @@ public class ToDoItem implements Categorized, Comparable<ToDoItem> {
         return dueBy;
     }
 
+    /**
+     * Demonstrates how to perform security checks within the domain code.
+     *
+     * <p>
+     *     Generally speaking this approach is not recommended; such checks should
+     *     wherever possible be externalized in the security subsystem.
+     * </p>
+     */
     public boolean hideDueBy() {
         final UserMemento user = container.getUser();
         return user.hasRole("realm1:noDueBy_role");
@@ -641,7 +649,7 @@ public class ToDoItem implements Categorized, Comparable<ToDoItem> {
     //endregion
 
     //region > openSourceCodeOnGithub (action)
-    @Prototype
+    @ActionLayout(prototype = true)
     @ActionSemantics(Of.SAFE)
     public URL openSourceCodeOnGithub() throws MalformedURLException {
         return new URL("https://github.com/apache/isis/tree/master/example/application/${parentArtifactId}/dom/src/main/java/dom/todo/ToDoItem.java");
@@ -655,8 +663,8 @@ public class ToDoItem implements Categorized, Comparable<ToDoItem> {
         RecoverableExceptionAutoEscalated,
         NonRecoverableException;
     }
-    
-    @Prototype
+
+    @ActionLayout(prototype = true)
     @ActionSemantics(Of.SAFE)
     public void demoException(
             final @ParameterLayout(named="Type") DemoExceptionType type) {
@@ -906,26 +914,28 @@ public class ToDoItem implements Categorized, Comparable<ToDoItem> {
 
     //region > injected services
     @javax.inject.Inject
-    private DomainObjectContainer container;
+    DomainObjectContainer container;
 
     @javax.inject.Inject
-    private ToDoItems toDoItems;
+    ToDoItems toDoItems;
 
-    Bulk.InteractionContext bulkInteractionContext;
-    public void injectBulkInteractionContext(Bulk.InteractionContext bulkInteractionContext) {
-        this.bulkInteractionContext = bulkInteractionContext;
-    }
+    @javax.inject.Inject
+    Scratchpad scratchpad;
 
+    /**
+     * public only so can be injected from integ tests
+     */
     @javax.inject.Inject
-    private Scratchpad scratchpad;
+    public Bulk.InteractionContext bulkInteractionContext;
 
-    EventBusService eventBusService;
-    public void injectEventBusService(EventBusService eventBusService) {
-        this.eventBusService = eventBusService;
-    }
+    /**
+     * public only so can be injected from integ tests
+     */
+    @javax.inject.Inject
+    public EventBusService eventBusService;
 
     @javax.inject.Inject
-    private WrapperFactory wrapperFactory;
+    WrapperFactory wrapperFactory;
 
     //endregion
 

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
index 5cf21cd..1820be7 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
@@ -111,7 +111,8 @@
                             },
                             "next": {
                                 "actionLayout": {
-                                    "cssClassFa": "fa fa-step-forward"
+                                    "cssClassFa": "fa fa-step-forward",
+                                    "cssClassFaPosition": "right"
                                 }
                             }
                         }

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
index 1af588b..22a9ab2 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
@@ -19,11 +19,15 @@
  */
 package dom.todo;
 
+import org.jmock.Expectations;
 import org.jmock.auto.Mock;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
+import org.apache.isis.applib.DomainObjectContainer;
 import org.apache.isis.applib.annotation.Bulk;
+import org.apache.isis.applib.security.RoleMemento;
+import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.applib.services.eventbus.EventBusService;
 import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
 import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
@@ -53,9 +57,45 @@ public abstract class ToDoItemTest {
         context.ignoring(eventBusService);
     }
 
-    public static class Actions {
+    public static class Properties extends ToDoItemTest {
 
-        public static class Completed extends ToDoItemTest {
+        @Mock
+        DomainObjectContainer mockContainer;
+
+        public static class DueBy extends Properties {
+
+            @Test
+            public void hiddenForNoDueByRole() {
+                final UserMemento userWithRole = new UserMemento("user", new RoleMemento("realm1:noDueBy_role"));
+                context.checking(new Expectations() {{
+                    allowing(mockContainer).getUser();
+                    will(returnValue(userWithRole));
+                }});
+
+                toDoItem.container = mockContainer;
+
+                assertThat(toDoItem.hideDueBy(), is(true));
+            }
+
+            @Test
+            public void notHiddenWithoutRole() {
+                final UserMemento userWithRole = new UserMemento("user", new RoleMemento("realm1:someOtherRole"));
+                context.checking(new Expectations() {{
+                    allowing(mockContainer).getUser();
+                    will(returnValue(userWithRole));
+                }});
+
+                toDoItem.container = mockContainer;
+
+                assertThat(toDoItem.hideDueBy(), is(false));
+            }
+        }
+
+    }
+
+    public static class Actions extends ToDoItemTest {
+
+        public static class Completed extends Actions {
 
             @Test
             public void happyCase() throws Exception {
@@ -73,7 +113,7 @@ public abstract class ToDoItemTest {
             }
         }
 
-        public static class NotYetCompleted extends ToDoItemTest {
+        public static class NotYetCompleted extends Actions {
 
             @Test
             public void happyCase() throws Exception {

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
index 9b73ad7..0a3c5a6 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
@@ -83,8 +83,8 @@ public class ToDoItemGlue extends CukeGlueAbstract {
                     allowing(eventBusService);
                 }
             });
-            toDoItem.injectBulkInteractionContext(bulkInteractionContext);
-            toDoItem.injectEventBusService(eventBusService);
+            toDoItem.bulkInteractionContext = bulkInteractionContext;
+            toDoItem.eventBusService = eventBusService;
         }
         wrap(toDoItem).completed();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
index 406385b..9c51e78 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
@@ -78,7 +78,7 @@
             <plugin>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
-                    <warName>quickstart</warName>
+                    <warName>todoapp</warName>
                     <archive>
                         <manifest>
                             <addClasspath>false</addClasspath>

http://git-wip-us.apache.org/repos/asf/isis/blob/a90691ad/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
index dc26e49..70ecada 100644
--- a/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Wed Dec 17 22:39:38 GMT 2014
+#Fri Dec 19 08:03:00 GMT 2014
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it


[04/11] isis git commit: ISIS-284: renaming of mojo classes to better capture intent (IsisRunnable -> MetaModelProcessor, IsisMojoReporter -> MetaModelProcessor.Context).

Posted by da...@apache.org.
ISIS-284: renaming of mojo classes to better capture intent (IsisRunnable -> MetaModelProcessor, IsisMojoReporter -> MetaModelProcessor.Context).

Also add the MavenProject into the MetaModelValidator.Context interface, and make private in IsisMojoAbstract.  That way all the stuff that the subclasses (eg IsisMojoValidate) needs is available in the MetaModelProcessor.Context API)


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

Branch: refs/heads/master
Commit: b1c643aed072fdaa88c3b8e41ba115d38be03899
Parents: f4197f1
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 07:02:01 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 07:02:01 2014 +0000

----------------------------------------------------------------------
 .../isis/tool/mavenplugin/IsisMojoAbstract.java | 40 ++++++++++-------
 .../isis/tool/mavenplugin/IsisMojoReporter.java | 18 --------
 .../isis/tool/mavenplugin/IsisMojoValidate.java | 10 ++---
 .../isis/tool/mavenplugin/IsisRunnable.java     | 27 ------------
 .../tool/mavenplugin/MetaModelProcessor.java    | 46 ++++++++++++++++++++
 5 files changed, 76 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/b1c643ae/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
index bd3634c..09de280 100644
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
@@ -45,15 +45,16 @@ import org.apache.isis.tool.mavenplugin.util.Xpp3Doms;
 public abstract class IsisMojoAbstract extends AbstractMojo {
 
     protected static final String CURRENT_PLUGIN_KEY = "org.apache.isis.tool:isis-maven-plugin";
-    private final IsisRunnable isisRunnable;
 
     @Component
-    protected MavenProject mavenProject;
-    private IsisMojoReporterWithLog reporter;
+    private MavenProject mavenProject;
 
-    protected IsisMojoAbstract(final IsisRunnable isisRunnable) {
-        this.isisRunnable = isisRunnable;
-        this.reporter = new IsisMojoReporterWithLog(getLog());
+    private final MetaModelProcessor metaModelProcessor;
+    private final ContextForMojo context;
+
+    protected IsisMojoAbstract(final MetaModelProcessor metaModelProcessor) {
+        this.metaModelProcessor = metaModelProcessor;
+        this.context = new ContextForMojo(mavenProject, getLog());
     }
 
     public void execute() throws MojoExecutionException, MojoFailureException {
@@ -65,15 +66,17 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
         }
         getLog().info("Found " + serviceList.size() + " services");
 
-        usingIsisMetaModel(serviceList, isisRunnable);
+        usingIsisMetaModel(serviceList, metaModelProcessor);
     }
 
-    private void usingIsisMetaModel(List<Object> serviceList, IsisRunnable isisRunnable) throws MojoExecutionException, MojoFailureException {
+    private void usingIsisMetaModel(
+            final List<Object> serviceList,
+            final MetaModelProcessor metaModelProcessor) throws MojoExecutionException, MojoFailureException {
 
         IsisMetaModel isisMetaModel = null;
         try {
             isisMetaModel = bootstrapIsis(serviceList);
-            isisRunnable.run(isisMetaModel, reporter);
+            metaModelProcessor.process(isisMetaModel, context);
         } finally {
             IsisMetaModels.disposeSafely(isisMetaModel);
         }
@@ -100,12 +103,12 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
     private IsisConfiguration isisConfigurationFor(final Plugin plugin) throws MojoFailureException {
         final Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
         if (configuration == null) {
-            reporter.throwFailureException("Configuration error", "No <configuration> element found");
+            context.throwFailureException("Configuration error", "No <configuration> element found");
         }
 
         final Xpp3Dom servicesEl = configuration.getChild("isisConfigDir");
         if (servicesEl == null) {
-            reporter.throwFailureException("Configuration error", "No <configuration>/<isisConfigDir> element found");
+            context.throwFailureException("Configuration error", "No <configuration>/<isisConfigDir> element found");
         }
         final String isisConfigDir = Xpp3Doms.GET_VALUE.apply(servicesEl);
 
@@ -113,7 +116,7 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
         final File file = new File(basedir, isisConfigDir);
         final String absoluteConfigDir = file.getAbsolutePath();
         if(!file.exists() || !file.isDirectory()) {
-            reporter.throwFailureException("Configuration error",
+            context.throwFailureException("Configuration error",
                     String.format("isisConfigDir (%s) does not exist or is not a directory", absoluteConfigDir));
         }
         final IsisConfigurationBuilderDefault configBuilder = new IsisConfigurationBuilderDefault(absoluteConfigDir);
@@ -130,16 +133,23 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
         return isisMetaModel;
     }
 
-    //region > IsisMojoReporter
-    static class IsisMojoReporterWithLog implements IsisMojoReporter {
+    //region > Context
+    static class ContextForMojo implements MetaModelProcessor.Context {
 
+        private final MavenProject mavenProject;
         private final Log log;
 
-        public IsisMojoReporterWithLog(final Log log) {
+        public ContextForMojo(final MavenProject mavenProject, final Log log) {
+            this.mavenProject = mavenProject;
             this.log = log;
         }
 
         @Override
+        public MavenProject getMavenProject() {
+            return mavenProject;
+        }
+
+        @Override
         public Log getLog() {
             return log;
         }

http://git-wip-us.apache.org/repos/asf/isis/blob/b1c643ae/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java
deleted file mode 100644
index 5f7e2ea..0000000
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.apache.isis.tool.mavenplugin;
-
-import java.util.Set;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.logging.Log;
-
-public interface IsisMojoReporter {
-    Log getLog();
-
-    void logErrors(String... logMessages);
-
-    void throwFailureException(String errorMessage, Set<String> logMessages) throws MojoFailureException;
-
-    void throwFailureException(String errorMessage, String... logMessages) throws MojoFailureException;
-
-    void throwExecutionException(String errorMessage, Exception e) throws MojoExecutionException;
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b1c643ae/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java
index eede660..e8bf8fa 100644
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java
@@ -38,20 +38,20 @@ import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
 public class IsisMojoValidate extends IsisMojoAbstract {
 
     protected IsisMojoValidate() {
-        super(new Validate());
+        super(new ValidateMetaModelProcessor());
     }
 
-    static class Validate implements IsisRunnable {
+    static class ValidateMetaModelProcessor implements MetaModelProcessor {
         @Override
-        public void run(final IsisMetaModel isisMetaModel, final IsisMojoReporter reporter) throws MojoFailureException, MojoExecutionException {
+        public void process(final IsisMetaModel isisMetaModel, final Context context) throws MojoFailureException, MojoExecutionException {
             final Collection<ObjectSpecification> objectSpecifications = isisMetaModel.getSpecificationLoader().allSpecifications();
             for (ObjectSpecification objectSpecification : objectSpecifications) {
-                reporter.getLog().debug("loaded: " + objectSpecification.getFullIdentifier());
+                context.getLog().debug("loaded: " + objectSpecification.getFullIdentifier());
             }
 
             final ValidationFailures validationFailures = isisMetaModel.getValidationFailures();
             if (validationFailures.occurred()) {
-                reporter.throwFailureException(validationFailures.getNumberOfMessages() + " problems found.", validationFailures.getMessages());
+                context.throwFailureException(validationFailures.getNumberOfMessages() + " problems found.", validationFailures.getMessages());
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/b1c643ae/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java
deleted file mode 100644
index 4298bae..0000000
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java
+++ /dev/null
@@ -1,27 +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.tool.mavenplugin;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.isis.core.metamodel.app.IsisMetaModel;
-
-interface IsisRunnable {
-    public void run(IsisMetaModel isisMetaModel, IsisMojoReporter isisMojo) throws MojoFailureException, MojoExecutionException;
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b1c643ae/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/MetaModelProcessor.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/MetaModelProcessor.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/MetaModelProcessor.java
new file mode 100644
index 0000000..2b2c688
--- /dev/null
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/MetaModelProcessor.java
@@ -0,0 +1,46 @@
+/*
+ *  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.tool.mavenplugin;
+
+import java.util.Set;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.apache.isis.core.metamodel.app.IsisMetaModel;
+
+interface MetaModelProcessor {
+
+    public interface Context {
+
+        MavenProject getMavenProject();
+
+        Log getLog();
+
+        void logErrors(final String... logMessages);
+
+        void throwFailureException(final String errorMessage, final Set<String> logMessages) throws MojoFailureException;
+
+        void throwFailureException(final String errorMessage, final String... logMessages) throws MojoFailureException;
+
+        void throwExecutionException(final String errorMessage, final Exception e) throws MojoExecutionException;
+    }
+
+    public void process(final IsisMetaModel isisMetaModel, final Context context) throws MojoFailureException, MojoExecutionException;
+}


[06/11] isis git commit: ISIS-284: change the todoapp and simpleapp's "isis" profile to be called "isis-validate".

Posted by da...@apache.org.
ISIS-284: change the todoapp and simpleapp's "isis" profile to be called "isis-validate".


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

Branch: refs/heads/master
Commit: a5b728f0606fa12c254ca1a0ecd49b88b816d6df
Parents: fce738a
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 07:03:54 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 07:03:54 2014 +0000

----------------------------------------------------------------------
 example/application/simpleapp/dom/pom.xml | 2 +-
 example/application/todoapp/dom/pom.xml   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a5b728f0/example/application/simpleapp/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/pom.xml b/example/application/simpleapp/dom/pom.xml
index 627ad06..a788c6c 100644
--- a/example/application/simpleapp/dom/pom.xml
+++ b/example/application/simpleapp/dom/pom.xml
@@ -126,7 +126,7 @@
 
     <profiles>
         <profile>
-            <id>isis</id>
+            <id>isis-validate</id>
             <activation>
                 <activeByDefault>false</activeByDefault>
             </activation>

http://git-wip-us.apache.org/repos/asf/isis/blob/a5b728f0/example/application/todoapp/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/pom.xml b/example/application/todoapp/dom/pom.xml
index 0c2e8f2..09f46d9 100644
--- a/example/application/todoapp/dom/pom.xml
+++ b/example/application/todoapp/dom/pom.xml
@@ -126,7 +126,7 @@
 
     <profiles>
         <profile>
-            <id>isis</id>
+            <id>isis-validate</id>
             <activation>
                 <activeByDefault>false</activeByDefault>
             </activation>


[07/11] isis git commit: ISIS-284: use injected @Parameter for configuration rather than reading directly.

Posted by da...@apache.org.
ISIS-284: use injected @Parameter for configuration rather than reading directly.


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

Branch: refs/heads/master
Commit: 2520b007e12eca32fde39cb82fe95e1422a554b4
Parents: a5b728f
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 07:55:55 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 07:55:55 2014 +0000

----------------------------------------------------------------------
 .../isis/tool/mavenplugin/IsisMojoAbstract.java | 33 ++++++++++----------
 1 file changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/2520b007/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
index 09de280..7e9d958 100644
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
@@ -27,8 +27,8 @@ import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilderDefault;
 import org.apache.isis.core.metamodel.app.IsisMetaModel;
@@ -40,7 +40,6 @@ import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
 import org.apache.isis.tool.mavenplugin.util.IsisMetaModels;
 import org.apache.isis.tool.mavenplugin.util.MavenProjects;
-import org.apache.isis.tool.mavenplugin.util.Xpp3Doms;
 
 public abstract class IsisMojoAbstract extends AbstractMojo {
 
@@ -49,6 +48,9 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
     @Component
     private MavenProject mavenProject;
 
+    @Parameter(required = true, readonly = false, property = "isisConfigDir")
+    private String isisConfigDir;
+
     private final MetaModelProcessor metaModelProcessor;
     private final ContextForMojo context;
 
@@ -83,7 +85,7 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
     }
 
     private List<Object> serviceListFor(Plugin plugin) throws MojoFailureException {
-        IsisConfiguration isisConfiguration = isisConfigurationFor(plugin);
+        IsisConfiguration isisConfiguration = getIsisConfiguration();
 
         final ServicesInstaller servicesInstaller;
         if(isisConfiguration == null) {
@@ -100,20 +102,8 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
         return servicesInstaller.getServices(DeploymentType.SERVER_PROTOTYPE);
     }
 
-    private IsisConfiguration isisConfigurationFor(final Plugin plugin) throws MojoFailureException {
-        final Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
-        if (configuration == null) {
-            context.throwFailureException("Configuration error", "No <configuration> element found");
-        }
-
-        final Xpp3Dom servicesEl = configuration.getChild("isisConfigDir");
-        if (servicesEl == null) {
-            context.throwFailureException("Configuration error", "No <configuration>/<isisConfigDir> element found");
-        }
-        final String isisConfigDir = Xpp3Doms.GET_VALUE.apply(servicesEl);
-
-        final File basedir = mavenProject.getBasedir();
-        final File file = new File(basedir, isisConfigDir);
+    private IsisConfiguration getIsisConfiguration() throws MojoFailureException {
+        final File file = getIsisConfigDir();
         final String absoluteConfigDir = file.getAbsolutePath();
         if(!file.exists() || !file.isDirectory()) {
             context.throwFailureException("Configuration error",
@@ -124,6 +114,15 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
         return configBuilder.getConfiguration();
     }
 
+    private File getIsisConfigDir() {
+        File file = new File(isisConfigDir);
+        if(!file.isAbsolute()) {
+            final File basedir = mavenProject.getBasedir();
+            file = new File(basedir, isisConfigDir);
+        }
+        return file;
+    }
+
     private static IsisMetaModel bootstrapIsis(List<Object> serviceList) {
         IsisMetaModel isisMetaModel = new IsisMetaModel(
                                             new RuntimeContextNoRuntime(),


[09/11] isis git commit: ISIS-284: started improving script to generate archetypes

Posted by da...@apache.org.
ISIS-284: started improving script to generate archetypes

... so the isis-validate profile would be active by default.  Not there yet, though, hence commented out the new stuff


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

Branch: refs/heads/master
Commit: 841a58121fc502967114bc6781fd68c8e59c9da6
Parents: eea7e73
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 08:01:19 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 08:01:53 2014 +0000

----------------------------------------------------------------------
 scripts/updateGeneratedArchetypeSources.groovy | 60 ++++++++++-----------
 1 file changed, 30 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/841a5812/scripts/updateGeneratedArchetypeSources.groovy
----------------------------------------------------------------------
diff --git a/scripts/updateGeneratedArchetypeSources.groovy b/scripts/updateGeneratedArchetypeSources.groovy
index e763b4b..9e3a8c0 100644
--- a/scripts/updateGeneratedArchetypeSources.groovy
+++ b/scripts/updateGeneratedArchetypeSources.groovy
@@ -143,38 +143,38 @@ pomFile.text =
 
 
 
-/////////////////////////////////////////////////////
+///////////////////////////////////////////////////////
+////
+//// update archetype's resource's dom/pom.xml's activeByDefault=true
+////
+///////////////////////////////////////////////////////
 //
-// update archetype's resource's dom/pom.xml's activeByDefault=true
+//def pomDomFile=new File(BASE+"src/main/resources/archetype-resources/dom/pom.xml")
 //
-/////////////////////////////////////////////////////
-
-def pomDomFile=new File(BASE+"src/main/resources/archetype-resources/dom/pom.xml")
-
-println "updating ${pomDomFile.path}"
-
-// read file, ignoring XML pragma
-def pomDomFileText = stripXmlPragma(pomDomFile)
-
-def pomDomXml = new XmlSlurper(false,true).parseText(pomDomFileText)
-
-pomDomXml.profiles.profile.activation.activeByDefault='true'
-
-def pomDomSmb = new groovy.xml.StreamingMarkupBuilder().bind {
-     mkp.declareNamespace("":"http://maven.apache.org/POM/4.0.0")
-     mkp.yield(pomDomXml)
-}
-
-
-def pomDomTempFile = File.createTempFile("temp",".xml")
-def indentedDomXml = indentXml(pomDomSmb.toString())
-pomDomTempFile.text = indentedDomXml
-def pomDomXmlText = stripXmlPragma(pomDomTempFile)
-
-
-pomDomFile.text = 
-    license_using_xml_comments + 
-    pomDomXmlText
+//println "updating ${pomDomFile.path}"
+//
+//// read file, ignoring XML pragma
+//def pomDomFileText = stripXmlPragma(pomDomFile)
+//
+//def pomDomXml = new XmlSlurper(false,true).parseText(pomDomFileText)
+//
+//pomDomXml.profiles.profile.activation.activeByDefault='true'
+//
+//def pomDomSmb = new groovy.xml.StreamingMarkupBuilder().bind {
+//     mkp.declareNamespace("":"http://maven.apache.org/POM/4.0.0")
+//     mkp.yield(pomDomXml)
+//}
+//
+//
+//def pomDomTempFile = File.createTempFile("temp",".xml")
+//def indentedDomXml = indentXml(pomDomSmb.toString())
+//pomDomTempFile.text = indentedDomXml
+//def pomDomXmlText = stripXmlPragma(pomDomTempFile)
+//
+//
+//pomDomFile.text = 
+//    license_using_xml_comments + 
+//    pomDomXmlText
 
 
 


[02/11] isis git commit: ISIS-284: refactored isis-maven-plugin, factoring out IsisMojoAbstract superclass to remove boilerplate in future mojos.

Posted by da...@apache.org.
ISIS-284: refactored isis-maven-plugin, factoring out IsisMojoAbstract superclass to remove boilerplate in future mojos.


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

Branch: refs/heads/master
Commit: a1529f7d0d6d0207e8259082945ff8ee953a301e
Parents: 26ddb28
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Dec 18 08:53:16 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 06:22:42 2014 +0000

----------------------------------------------------------------------
 .../isis/tool/mavenplugin/IsisMojoAbstract.java | 184 +++++++++++++++++++
 .../isis/tool/mavenplugin/IsisMojoReporter.java |  18 ++
 .../isis/tool/mavenplugin/IsisMojoValidate.java |  59 ++++++
 .../isis/tool/mavenplugin/IsisRunnable.java     |  27 +++
 .../isis/tool/mavenplugin/ValidateMojo.java     | 172 -----------------
 5 files changed, 288 insertions(+), 172 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a1529f7d/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
new file mode 100644
index 0000000..bd3634c
--- /dev/null
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
@@ -0,0 +1,184 @@
+/*
+ *  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.tool.mavenplugin;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationBuilderDefault;
+import org.apache.isis.core.metamodel.app.IsisMetaModel;
+import org.apache.isis.core.metamodel.runtimecontext.noruntime.RuntimeContextNoRuntime;
+import org.apache.isis.core.runtime.services.ServicesInstaller;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation;
+import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
+import org.apache.isis.tool.mavenplugin.util.IsisMetaModels;
+import org.apache.isis.tool.mavenplugin.util.MavenProjects;
+import org.apache.isis.tool.mavenplugin.util.Xpp3Doms;
+
+public abstract class IsisMojoAbstract extends AbstractMojo {
+
+    protected static final String CURRENT_PLUGIN_KEY = "org.apache.isis.tool:isis-maven-plugin";
+    private final IsisRunnable isisRunnable;
+
+    @Component
+    protected MavenProject mavenProject;
+    private IsisMojoReporterWithLog reporter;
+
+    protected IsisMojoAbstract(final IsisRunnable isisRunnable) {
+        this.isisRunnable = isisRunnable;
+        this.reporter = new IsisMojoReporterWithLog(getLog());
+    }
+
+    public void execute() throws MojoExecutionException, MojoFailureException {
+
+        final Plugin plugin = MavenProjects.lookupPlugin(mavenProject, CURRENT_PLUGIN_KEY);
+        final List<Object> serviceList = plugin != null ? serviceListFor(plugin) : null;
+        if(serviceList == null || serviceList.size() == 0) {
+            return;
+        }
+        getLog().info("Found " + serviceList.size() + " services");
+
+        usingIsisMetaModel(serviceList, isisRunnable);
+    }
+
+    private void usingIsisMetaModel(List<Object> serviceList, IsisRunnable isisRunnable) throws MojoExecutionException, MojoFailureException {
+
+        IsisMetaModel isisMetaModel = null;
+        try {
+            isisMetaModel = bootstrapIsis(serviceList);
+            isisRunnable.run(isisMetaModel, reporter);
+        } finally {
+            IsisMetaModels.disposeSafely(isisMetaModel);
+        }
+    }
+
+    private List<Object> serviceListFor(Plugin plugin) throws MojoFailureException {
+        IsisConfiguration isisConfiguration = isisConfigurationFor(plugin);
+
+        final ServicesInstaller servicesInstaller;
+        if(isisConfiguration == null) {
+            servicesInstaller = new ServicesInstallerFromAnnotation();
+        } else {
+            final ServicesInstallerFromConfigurationAndAnnotation servicesInstallerFromConfigurationAndAnnotation = new ServicesInstallerFromConfigurationAndAnnotation();
+            servicesInstallerFromConfigurationAndAnnotation.setConfiguration(isisConfiguration);
+            servicesInstaller = servicesInstallerFromConfigurationAndAnnotation;
+        }
+
+        servicesInstaller.setIgnoreFailures(true);
+        servicesInstaller.init();
+
+        return servicesInstaller.getServices(DeploymentType.SERVER_PROTOTYPE);
+    }
+
+    private IsisConfiguration isisConfigurationFor(final Plugin plugin) throws MojoFailureException {
+        final Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
+        if (configuration == null) {
+            reporter.throwFailureException("Configuration error", "No <configuration> element found");
+        }
+
+        final Xpp3Dom servicesEl = configuration.getChild("isisConfigDir");
+        if (servicesEl == null) {
+            reporter.throwFailureException("Configuration error", "No <configuration>/<isisConfigDir> element found");
+        }
+        final String isisConfigDir = Xpp3Doms.GET_VALUE.apply(servicesEl);
+
+        final File basedir = mavenProject.getBasedir();
+        final File file = new File(basedir, isisConfigDir);
+        final String absoluteConfigDir = file.getAbsolutePath();
+        if(!file.exists() || !file.isDirectory()) {
+            reporter.throwFailureException("Configuration error",
+                    String.format("isisConfigDir (%s) does not exist or is not a directory", absoluteConfigDir));
+        }
+        final IsisConfigurationBuilderDefault configBuilder = new IsisConfigurationBuilderDefault(absoluteConfigDir);
+        configBuilder.addDefaultConfigurationResources();
+        return configBuilder.getConfiguration();
+    }
+
+    private static IsisMetaModel bootstrapIsis(List<Object> serviceList) {
+        IsisMetaModel isisMetaModel = new IsisMetaModel(
+                                            new RuntimeContextNoRuntime(),
+                                            new ProgrammingModelFacetsJava5(),
+                                            serviceList);
+        isisMetaModel.init();
+        return isisMetaModel;
+    }
+
+    //region > IsisMojoReporter
+    static class IsisMojoReporterWithLog implements IsisMojoReporter {
+
+        private final Log log;
+
+        public IsisMojoReporterWithLog(final Log log) {
+            this.log = log;
+        }
+
+        @Override
+        public Log getLog() {
+            return log;
+        }
+
+        @Override
+        public void throwFailureException(String errorMessage, Set<String> logMessages) throws MojoFailureException {
+            logErrors(logMessages);
+            throw new MojoFailureException(errorMessage);
+        }
+
+        @Override
+        public void throwFailureException(String errorMessage, String... logMessages) throws MojoFailureException {
+            logErrors(logMessages);
+            throw new MojoFailureException(errorMessage);
+        }
+
+        @Override
+        public void throwExecutionException(String errorMessage, Exception e) throws MojoExecutionException {
+            logErrors(errorMessage);
+            throw new MojoExecutionException(errorMessage, e);
+        }
+
+        private void logErrors(Set<String> logMessages) {
+            logErrors(logMessages.toArray(new String[] {}));
+        }
+
+        @Override
+        public void logErrors(String... logMessages) {
+            log.error("");
+            log.error("");
+            log.error("");
+            for (String logMessage : logMessages) {
+                log.error(logMessage);
+            }
+            log.error("");
+            log.error("");
+            log.error("");
+        }
+    }
+    //endregion
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/a1529f7d/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java
new file mode 100644
index 0000000..5f7e2ea
--- /dev/null
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoReporter.java
@@ -0,0 +1,18 @@
+package org.apache.isis.tool.mavenplugin;
+
+import java.util.Set;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
+
+public interface IsisMojoReporter {
+    Log getLog();
+
+    void logErrors(String... logMessages);
+
+    void throwFailureException(String errorMessage, Set<String> logMessages) throws MojoFailureException;
+
+    void throwFailureException(String errorMessage, String... logMessages) throws MojoFailureException;
+
+    void throwExecutionException(String errorMessage, Exception e) throws MojoExecutionException;
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/a1529f7d/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java
new file mode 100644
index 0000000..eede660
--- /dev/null
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoValidate.java
@@ -0,0 +1,59 @@
+/*
+ *  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.tool.mavenplugin;
+
+import java.util.Collection;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.isis.core.metamodel.app.IsisMetaModel;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
+
+@Mojo(
+        name = "validate",
+        defaultPhase = LifecyclePhase.TEST,
+        requiresProject = true,
+        requiresDependencyResolution = ResolutionScope.COMPILE,
+        requiresDependencyCollection = ResolutionScope.COMPILE
+)
+public class IsisMojoValidate extends IsisMojoAbstract {
+
+    protected IsisMojoValidate() {
+        super(new Validate());
+    }
+
+    static class Validate implements IsisRunnable {
+        @Override
+        public void run(final IsisMetaModel isisMetaModel, final IsisMojoReporter reporter) throws MojoFailureException, MojoExecutionException {
+            final Collection<ObjectSpecification> objectSpecifications = isisMetaModel.getSpecificationLoader().allSpecifications();
+            for (ObjectSpecification objectSpecification : objectSpecifications) {
+                reporter.getLog().debug("loaded: " + objectSpecification.getFullIdentifier());
+            }
+
+            final ValidationFailures validationFailures = isisMetaModel.getValidationFailures();
+            if (validationFailures.occurred()) {
+                reporter.throwFailureException(validationFailures.getNumberOfMessages() + " problems found.", validationFailures.getMessages());
+            }
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/a1529f7d/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java
new file mode 100644
index 0000000..4298bae
--- /dev/null
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisRunnable.java
@@ -0,0 +1,27 @@
+/*
+ *  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.tool.mavenplugin;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.isis.core.metamodel.app.IsisMetaModel;
+
+interface IsisRunnable {
+    public void run(IsisMetaModel isisMetaModel, IsisMojoReporter isisMojo) throws MojoFailureException, MojoExecutionException;
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/a1529f7d/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/ValidateMojo.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/ValidateMojo.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/ValidateMojo.java
deleted file mode 100644
index 1db4ed2..0000000
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/ValidateMojo.java
+++ /dev/null
@@ -1,172 +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.tool.mavenplugin;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.config.IsisConfigurationBuilderDefault;
-import org.apache.isis.core.metamodel.app.IsisMetaModel;
-import org.apache.isis.core.metamodel.runtimecontext.noruntime.RuntimeContextNoRuntime;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
-import org.apache.isis.core.runtime.services.ServicesInstaller;
-import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
-import org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
-import org.apache.isis.tool.mavenplugin.util.IsisMetaModels;
-import org.apache.isis.tool.mavenplugin.util.MavenProjects;
-import org.apache.isis.tool.mavenplugin.util.Xpp3Doms;
-
-@Mojo(
-        name = "validate",
-        defaultPhase = LifecyclePhase.TEST,
-        requiresProject = true,
-        requiresDependencyResolution = ResolutionScope.COMPILE,
-        requiresDependencyCollection = ResolutionScope.COMPILE
-)
-public class ValidateMojo extends AbstractMojo {
-
-    private static final String CURRENT_PLUGIN_KEY = "org.apache.isis.tool:isis-maven-plugin";
-
-    @Component
-    protected MavenProject mavenProject;
-
-    public void execute() throws MojoExecutionException, MojoFailureException {
-
-        final Plugin plugin = MavenProjects.lookupPlugin(mavenProject, CURRENT_PLUGIN_KEY);
-        final List<Object> serviceList = plugin != null ? serviceListFor(plugin) : null;
-        if(serviceList == null || serviceList.size() == 0) {
-            return;
-        }
-        getLog().info("Found " + serviceList.size() + " services");
-
-        final ValidationFailures validationFailures = bootIsisThenShutdown(serviceList);
-        if (validationFailures.occurred()) {
-            throwFailureException(validationFailures.getNumberOfMessages() + " problems found.", validationFailures.getMessages());
-        }
-    }
-
-    private ValidationFailures bootIsisThenShutdown(List<Object> serviceList) throws MojoExecutionException, MojoFailureException {
-        IsisMetaModel isisMetaModel = null;
-        try {
-            isisMetaModel = bootstrapIsis(serviceList);
-            final Collection<ObjectSpecification> objectSpecifications = isisMetaModel.getSpecificationLoader().allSpecifications();
-            for (ObjectSpecification objectSpecification : objectSpecifications) {
-                getLog().debug("loaded: " + objectSpecification.getFullIdentifier());
-            }
-            return isisMetaModel.getValidationFailures();
-        } finally {
-            IsisMetaModels.disposeSafely(isisMetaModel);
-        }
-    }
-
-    private List<Object> serviceListFor(Plugin plugin) throws MojoFailureException {
-        IsisConfiguration isisConfiguration = isisConfigurationFor(plugin);
-
-        final ServicesInstaller servicesInstaller;
-        if(isisConfiguration == null) {
-            servicesInstaller = new ServicesInstallerFromAnnotation();
-        } else {
-            final ServicesInstallerFromConfigurationAndAnnotation servicesInstallerFromConfigurationAndAnnotation = new ServicesInstallerFromConfigurationAndAnnotation();
-            servicesInstallerFromConfigurationAndAnnotation.setConfiguration(isisConfiguration);
-            servicesInstaller = servicesInstallerFromConfigurationAndAnnotation;
-        }
-
-        servicesInstaller.setIgnoreFailures(true);
-        servicesInstaller.init();
-
-        return servicesInstaller.getServices(DeploymentType.SERVER_PROTOTYPE);
-    }
-
-    private IsisConfiguration isisConfigurationFor(final Plugin plugin) throws MojoFailureException {
-        final Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
-        if (configuration == null) {
-            throwFailureException("Configuration error", "No <configuration> element found");
-        }
-
-        final Xpp3Dom servicesEl = configuration.getChild("isisConfigDir");
-        if (servicesEl == null) {
-            throwFailureException("Configuration error", "No <configuration>/<isisConfigDir> element found");
-        }
-        final String isisConfigDir = Xpp3Doms.GET_VALUE.apply(servicesEl);
-
-        final File basedir = mavenProject.getBasedir();
-        final File file = new File(basedir, isisConfigDir);
-        final String absoluteConfigDir = file.getAbsolutePath();
-        if(!file.exists() || !file.isDirectory()) {
-            throwFailureException("Configuration error",
-                    String.format("isisConfigDir (%s) does not exist or is not a directory", absoluteConfigDir));
-        }
-        final IsisConfigurationBuilderDefault configBuilder = new IsisConfigurationBuilderDefault(absoluteConfigDir);
-        configBuilder.addDefaultConfigurationResources();
-        return configBuilder.getConfiguration();
-    }
-
-    private static IsisMetaModel bootstrapIsis(List<Object> serviceList) {
-
-        IsisMetaModel isisMetaModel = new IsisMetaModel(
-                                            new RuntimeContextNoRuntime(),
-                                            new ProgrammingModelFacetsJava5(),
-                                            serviceList);
-        isisMetaModel.init();
-        return isisMetaModel;
-    }
-
-    private void throwFailureException(String errorMessage, Set<String> logMessages) throws MojoFailureException {
-        logErrors(logMessages);
-        throw new MojoFailureException(errorMessage);
-    }
-
-    private void throwFailureException(String errorMessage, String... logMessages) throws MojoFailureException {
-        logErrors(logMessages);
-        throw new MojoFailureException(errorMessage);
-    }
-
-    private void throwExecutionException(String errorMessage, Exception e) throws MojoExecutionException {
-        logErrors(errorMessage);
-        throw new MojoExecutionException(errorMessage, e);
-    }
-
-    private void logErrors(String... logMessages) {
-        getLog().error("");
-        for (String logMessage : logMessages) {
-            getLog().error(logMessage);
-        }
-        getLog().error("");
-    }
-
-    private void logErrors(Set<String> logMessages) {
-        logErrors(logMessages.toArray(new String[] {}));
-    }
-
-}
\ No newline at end of file


[05/11] isis git commit: ISIS-284: tiny incidental fix to one of the metamodel validator errors.

Posted by da...@apache.org.
ISIS-284: tiny incidental fix to one of the metamodel validator errors.

(to test the valdator have been renaming ToDoItem#hideDueBy to ToDoItem#hideXDueBy, which triggers this error.   Felt the wording could be improved).


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

Branch: refs/heads/master
Commit: fce738aa29fdeb8df66ad27441f88691abea5d3b
Parents: b1c643a
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 07:03:14 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 07:03:14 2014 +0000

----------------------------------------------------------------------
 .../metamodel/facets/MethodPrefixBasedFacetFactoryAbstract.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/fce738aa/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/MethodPrefixBasedFacetFactoryAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/MethodPrefixBasedFacetFactoryAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/MethodPrefixBasedFacetFactoryAbstract.java
index 7292ca2..676dcc2 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/MethodPrefixBasedFacetFactoryAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/MethodPrefixBasedFacetFactoryAbstract.java
@@ -71,7 +71,7 @@ public abstract class MethodPrefixBasedFacetFactoryAbstract extends FacetFactory
                     for (String prefix : prefixes) {
                         final String actionId = objectAction.getId();
                         if (actionId.startsWith(prefix) && prefix.length() < actionId.length()) {
-                            validationFailures.add("%s#%s has prefix %s, has probably been orphaned.  If not an orphan, then rename and use @Named annotation", objectSpec.getIdentifier().getClassName(), actionId, prefix);
+                            validationFailures.add("Method '%s#%s' has prefix %s, is probably a supporting method for a property, collection or action.  If the method is intended to be an action, then rename and use @ActionLayout(named=\"...\") or ignore completely using @Programmatic", objectSpec.getIdentifier().getClassName(), actionId, prefix);
                         }
                     }
                 }


[10/11] isis git commit: ISIS-928: recreating simpleapp archetype

Posted by da...@apache.org.
ISIS-928: 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/57a56de0
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/57a56de0
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/57a56de0

Branch: refs/heads/master
Commit: 57a56de0ee690e76b447c8b241f312dcee3fe7da
Parents: 841a581
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Dec 19 08:02:51 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Dec 19 08:02:51 2014 +0000

----------------------------------------------------------------------
 example/archetype/simpleapp/pom.xml             |  56 ++--
 .../META-INF/maven/archetype-metadata.xml       | 272 +++++++++----------
 .../resources/archetype-resources/dom/pom.xml   |   6 +-
 .../archetype-resources/webapp/pom.xml          |   2 +-
 .../projects/basic/archetype.properties         |   2 +-
 5 files changed, 170 insertions(+), 168 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/57a56de0/example/archetype/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/pom.xml b/example/archetype/simpleapp/pom.xml
index aa28ecb..9c16524 100644
--- a/example/archetype/simpleapp/pom.xml
+++ b/example/archetype/simpleapp/pom.xml
@@ -18,33 +18,33 @@
   under the License.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.isis.archetype</groupId>
-  <artifactId>simpleapp-archetype</artifactId>
-  <version>1.8.0-SNAPSHOT</version>
-  <packaging>maven-archetype</packaging>
-  <name>simpleapp-archetype</name>
-  <build>
-    <extensions>
-      <extension>
-        <groupId>org.apache.maven.archetype</groupId>
-        <artifactId>archetype-packaging</artifactId>
-        <version>2.2</version>
-      </extension>
-    </extensions>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <artifactId>maven-archetype-plugin</artifactId>
-          <version>2.2</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-  <parent>
-    <groupId>org.apache.isis.core</groupId>
-    <artifactId>isis</artifactId>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.isis.archetype</groupId>
+    <artifactId>simpleapp-archetype</artifactId>
     <version>1.8.0-SNAPSHOT</version>
-    <relativePath>../../../core/pom.xml</relativePath>
-  </parent>
+    <packaging>maven-archetype</packaging>
+    <name>simpleapp-archetype</name>
+    <build>
+        <extensions>
+            <extension>
+                <groupId>org.apache.maven.archetype</groupId>
+                <artifactId>archetype-packaging</artifactId>
+                <version>2.2</version>
+            </extension>
+        </extensions>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-archetype-plugin</artifactId>
+                    <version>2.2</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+    <parent>
+        <groupId>org.apache.isis.core</groupId>
+        <artifactId>isis</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../../../core/pom.xml</relativePath>
+    </parent>
 </project>

http://git-wip-us.apache.org/repos/asf/isis/blob/57a56de0/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
index e821417..eadd90d 100644
--- a/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -18,140 +18,140 @@
   under the License.
 -->
 <archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="simpleapp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modules>
-    <module id="${rootArtifactId}-dom" dir="dom" name="${rootArtifactId}-dom">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.xml</include>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.png</include>
-            <include>**/*.json</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/resources</directory>
-          <includes>
-            <include>**/*.xml</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/test/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory/>
-          <includes>
-            <include>log4j.properties</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-    <module id="${rootArtifactId}-fixture" dir="fixture" name="${rootArtifactId}-fixture">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory/>
-          <includes>
-            <include>.gitignore</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-    <module id="${rootArtifactId}-integtests" dir="integtests" name="${rootArtifactId}-integtests">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/test/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/test/java</directory>
-          <includes>
-            <include>**/*.feature</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory/>
-          <includes>
-            <include>logging.properties</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-    <module id="${rootArtifactId}-webapp" dir="webapp" name="${rootArtifactId}-webapp">
-      <fileSets>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/java</directory>
-          <includes>
-            <include>**/*.java</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/webapp</directory>
-          <includes>
-            <include>**/*.xml</include>
-            <include>**/*.html</include>
-            <include>**/*.properties</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>src/main/resources</directory>
-          <includes>
-            <include>**/*.html</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/main/jettyconsole</directory>
-          <includes>
-            <include>**/*.png</include>
-            <include>**/*.pdn</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>src/main/webapp</directory>
-          <includes>
-            <include>**/*.png</include>
-            <include>**/*.js</include>
-            <include>**/*.ini</include>
-            <include>**/*.gif</include>
-            <include>**/*.css</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>ide/intellij</directory>
-          <includes>
-            <include>**/*.xml</include>
-            <include>**/*.txt</include>
-          </includes>
-        </fileSet>
-        <fileSet encoding="UTF-8">
-          <directory>lib</directory>
-          <includes>
-            <include>**/*.gitignore</include>
-          </includes>
-        </fileSet>
-        <fileSet filtered="true" encoding="UTF-8">
-          <directory>ide/eclipse</directory>
-          <includes>
-            <include>**/*.launch</include>
-          </includes>
-        </fileSet>
-      </fileSets>
-    </module>
-  </modules>
+    <modules>
+        <module id="${rootArtifactId}-dom" dir="dom" name="${rootArtifactId}-dom">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.png</include>
+                        <include>**/*.json</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/resources</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/test/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory/>
+                    <includes>
+                        <include>log4j.properties</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+        <module id="${rootArtifactId}-fixture" dir="fixture" name="${rootArtifactId}-fixture">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory/>
+                    <includes>
+                        <include>.gitignore</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+        <module id="${rootArtifactId}-integtests" dir="integtests" name="${rootArtifactId}-integtests">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/test/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/test/java</directory>
+                    <includes>
+                        <include>**/*.feature</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory/>
+                    <includes>
+                        <include>logging.properties</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+        <module id="${rootArtifactId}-webapp" dir="webapp" name="${rootArtifactId}-webapp">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/webapp</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                        <include>**/*.html</include>
+                        <include>**/*.properties</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/resources</directory>
+                    <includes>
+                        <include>**/*.html</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/jettyconsole</directory>
+                    <includes>
+                        <include>**/*.png</include>
+                        <include>**/*.pdn</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/webapp</directory>
+                    <includes>
+                        <include>**/*.png</include>
+                        <include>**/*.js</include>
+                        <include>**/*.ini</include>
+                        <include>**/*.gif</include>
+                        <include>**/*.css</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>ide/intellij</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                        <include>**/*.txt</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>lib</directory>
+                    <includes>
+                        <include>**/*.gitignore</include>
+                    </includes>
+                </fileSet>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>ide/eclipse</directory>
+                    <includes>
+                        <include>**/*.launch</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
+    </modules>
 </archetype-descriptor>

http://git-wip-us.apache.org/repos/asf/isis/blob/57a56de0/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
index 6abf41e..0c5fd67 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
@@ -117,7 +117,9 @@
 
     <profiles>
         <profile>
-            <id>isis</id>
+            <id>isis-validate</id>
+            <activation>
+            </activation>
             <build>
                 <plugins>
                     <plugin>
@@ -125,7 +127,7 @@
                         <artifactId>isis-maven-plugin</artifactId>
                         <version>1.8.0-SNAPSHOT</version>
                         <configuration>
-                            <isisConfigDir>..\webapp\src\main\webapp\WEB-INF</isisConfigDir>
+                            <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
                         </configuration>
                         <dependencies>
                             <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/57a56de0/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
index 20d212d..aebfe99 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
@@ -78,7 +78,7 @@
             <plugin>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
-                    <warName>simple</warName>
+                    <warName>simpleapp</warName>
                     <archive>
                         <manifest>
                             <addClasspath>false</addClasspath>

http://git-wip-us.apache.org/repos/asf/isis/blob/57a56de0/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 4e187a2..0ed87b1 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 Dec 17 22:39:23 GMT 2014
+#Fri Dec 19 08:02:44 GMT 2014
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it