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 2017/09/21 23:34:31 UTC
[09/11] isis git commit: ISIS-1712: recreating helloworld archetype
ISIS-1712: recreating helloworld archetype
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/057b85c9
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/057b85c9
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/057b85c9
Branch: refs/heads/release-1.15.1-RC1
Commit: 057b85c906fb108a64daab6f0f545e8993d525aa
Parents: 498c9bb
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Sep 22 00:27:20 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Sep 22 00:27:20 2017 +0100
----------------------------------------------------------------------
example/archetype/helloworld/pom.xml | 7 +++----
.../resources/META-INF/maven/archetype-metadata.xml | 1 +
.../resources/archetype-resources/enhance-all.sh | 2 ++
.../src/main/resources/archetype-resources/pom.xml | 4 ++--
.../java/domainapp/dom/impl/HelloWorldObject.java | 16 +++++++++++-----
.../java/domainapp/dom/impl/HelloWorldObjects.java | 5 +----
.../dom/impl/HelloWorldObjectTest_delete.java | 2 +-
.../dom/impl/HelloWorldObjectTest_updateName.java | 2 +-
.../resources/projects/basic/archetype.properties | 2 +-
9 files changed, 23 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/pom.xml b/example/archetype/helloworld/pom.xml
index 811a887..6adeb64 100644
--- a/example/archetype/helloworld/pom.xml
+++ b/example/archetype/helloworld/pom.xml
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<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>helloworld-archetype</artifactId>
@@ -65,12 +65,11 @@
<connection>scm:git:git@github.com:incodehq/incode-build.git/helloworld</connection>
<developerConnection>scm:git:git@github.com:incodehq/incode-build.git/helloworld</developerConnection>
<url>git@github.com:incodehq/incode-build.git/helloworld</url>
- <tag>HEAD</tag>
- </scm>
+ </scm>
<parent>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis</artifactId>
- <version>1.15.0</version>
+ <version>1.15.1</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
<properties>
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/main/resources/META-INF/maven/archetype-metadata.xml b/example/archetype/helloworld/src/main/resources/META-INF/maven/archetype-metadata.xml
index 3d3fcec..fbec4e4 100644
--- a/example/archetype/helloworld/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/example/archetype/helloworld/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -72,6 +72,7 @@
<includes>
<include>.gitattributes</include>
<include>.gitignore</include>
+ <include>enhance-all.sh</include>
<include>README.adoc</include>
</includes>
</fileSet>
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/main/resources/archetype-resources/enhance-all.sh
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/main/resources/archetype-resources/enhance-all.sh b/example/archetype/helloworld/src/main/resources/archetype-resources/enhance-all.sh
new file mode 100644
index 0000000..2da7b0f
--- /dev/null
+++ b/example/archetype/helloworld/src/main/resources/archetype-resources/enhance-all.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+mvn datanucleus:enhance -o
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/main/resources/archetype-resources/pom.xml b/example/archetype/helloworld/src/main/resources/archetype-resources/pom.xml
index fb3c632..c11f281 100644
--- a/example/archetype/helloworld/src/main/resources/archetype-resources/pom.xml
+++ b/example/archetype/helloworld/src/main/resources/archetype-resources/pom.xml
@@ -34,9 +34,9 @@
<packaging>war</packaging>
<properties>
- <isis.version>1.15.0</isis.version>
+ <isis.version>1.15.1</isis.version>
- <lombok.version>1.16.10</lombok.version>
+ <lombok.version>1.16.18</lombok.version>
<compiler-plugin.source>1.8</compiler-plugin.source>
<compiler-plugin.target>1.8</compiler-plugin.target>
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObject.java
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObject.java b/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObject.java
index 5e0c7b0..6d7850c 100644
--- a/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObject.java
+++ b/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObject.java
@@ -31,6 +31,7 @@ import org.apache.isis.applib.annotation.Action;
import org.apache.isis.applib.annotation.Auditing;
import org.apache.isis.applib.annotation.CommandReification;
import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
import org.apache.isis.applib.annotation.Editing;
import org.apache.isis.applib.annotation.Parameter;
import org.apache.isis.applib.annotation.ParameterLayout;
@@ -42,6 +43,8 @@ import org.apache.isis.applib.services.message.MessageService;
import org.apache.isis.applib.services.repository.RepositoryService;
import org.apache.isis.applib.services.title.TitleService;
+import lombok.AccessLevel;
+
@javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "${artifactId}" )
@javax.jdo.annotations.DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
@javax.jdo.annotations.Version(strategy= VersionStrategy.DATE_TIME, column ="version")
@@ -54,20 +57,20 @@ import org.apache.isis.applib.services.title.TitleService;
})
@javax.jdo.annotations.Unique(name="HelloWorldObject_name_UNQ", members = {"name"})
@DomainObject(auditing = Auditing.ENABLED)
+@DomainObjectLayout() // trigger events etc.
+@lombok.RequiredArgsConstructor(staticName = "create")
+@lombok.Getter @lombok.Setter
public class HelloWorldObject implements Comparable<HelloWorldObject> {
- public HelloWorldObject(final String name) {
- this.name = name;
- }
@javax.jdo.annotations.Column(allowsNull = "false", length = 40)
- @lombok.Getter @lombok.Setter
+ @lombok.NonNull
@Property(editing = Editing.DISABLED)
@Title(prepend = "Object: ")
private String name;
+
@javax.jdo.annotations.Column(allowsNull = "true", length = 4000)
- @lombok.Getter @lombok.Setter
@Property(editing = Editing.ENABLED)
private String notes;
@@ -102,12 +105,15 @@ public class HelloWorldObject implements Comparable<HelloWorldObject> {
//region > injected services
@javax.inject.Inject
+ @lombok.Getter(AccessLevel.NONE) @lombok.Setter(AccessLevel.NONE)
RepositoryService repositoryService;
@javax.inject.Inject
+ @lombok.Getter(AccessLevel.NONE) @lombok.Setter(AccessLevel.NONE)
TitleService titleService;
@javax.inject.Inject
+ @lombok.Getter(AccessLevel.NONE) @lombok.Setter(AccessLevel.NONE)
MessageService messageService;
//endregion
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObjects.java b/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
index c89d3af..b27729a 100644
--- a/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
+++ b/example/archetype/helloworld/src/main/resources/archetype-resources/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
@@ -47,10 +47,7 @@ public class HelloWorldObjects {
@Parameter(maxLength = 40)
@ParameterLayout(named = "Name")
final String name) {
- final HelloWorldObject object = new HelloWorldObject(name);
- serviceRegistry.injectServicesInto(object);
- repositoryService.persistAndFlush(object);
- return object;
+ return repositoryService.persist(HelloWorldObject.create(name));
}
@Action(semantics = SemanticsOf.SAFE)
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_delete.java
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_delete.java b/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_delete.java
index da9d6f2..4adb55a 100644
--- a/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_delete.java
+++ b/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_delete.java
@@ -51,7 +51,7 @@ public class HelloWorldObjectTest_delete {
public void happy_case() throws Exception {
// given
- final HelloWorldObject object = new HelloWorldObject("Foo");
+ final HelloWorldObject object = HelloWorldObject.create("Foo");
object.titleService = mockTitleService;
object.messageService = mockMessageService;
object.repositoryService = mockRepositoryService;
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_updateName.java
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_updateName.java b/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_updateName.java
index 4f5a1f2..287187f 100644
--- a/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_updateName.java
+++ b/example/archetype/helloworld/src/main/resources/archetype-resources/src/test/java/domainapp/dom/impl/HelloWorldObjectTest_updateName.java
@@ -30,7 +30,7 @@ public class HelloWorldObjectTest_updateName {
@Test
public void happy_case() throws Exception {
// given
- final HelloWorldObject object = new HelloWorldObject("Foo");
+ final HelloWorldObject object = HelloWorldObject.create("Foo");
assertThat(object.getName()).isEqualTo("Foo");
// when
http://git-wip-us.apache.org/repos/asf/isis/blob/057b85c9/example/archetype/helloworld/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/helloworld/src/test/resources/projects/basic/archetype.properties b/example/archetype/helloworld/src/test/resources/projects/basic/archetype.properties
index 833fb3e..7582506 100644
--- a/example/archetype/helloworld/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/helloworld/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Sun Aug 06 10:13:56 BST 2017
+#Fri Sep 22 00:27:13 BST 2017
package=it.pkg
version=0.1-SNAPSHOT
groupId=archetype.it