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 2019/12/02 23:02:20 UTC
[isis-app-helloworld] 01/04: ISIS-2148 - Initial take-on (moved out
from apache/isis)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis-app-helloworld.git
commit 6a66e161a0a6311fa8a6555b64ac89933d67ae91
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Dec 2 10:38:34 2019 +0000
ISIS-2148 - Initial take-on (moved out from apache/isis)
---
.gitattributes | 51 ++++++
.gitignore | 43 +++++
README.adoc | 31 ++++
enhance-all.sh | 2 +
logging-dn-enhance.properties | 41 +++++
pom.xml | 174 +++++++++++++++++++++
src/main/java/META-INF/persistence.xml | 26 +++
.../java/domainapp/application/HelloWorldApp.java | 65 ++++++++
.../java/domainapp/application/menubars.layout.xml | 115 ++++++++++++++
src/main/java/domainapp/dom/HelloWorldModule.java | 28 ++++
.../java/domainapp/dom/impl/HelloWorldObject.java | 120 ++++++++++++++
.../domainapp/dom/impl/HelloWorldObject.layout.xml | 76 +++++++++
.../java/domainapp/dom/impl/HelloWorldObject.png | Bin 0 -> 653 bytes
.../java/domainapp/dom/impl/HelloWorldObjects.java | 76 +++++++++
src/main/java/domainapp/dom/types/Name.java | 42 +++++
src/main/java/domainapp/dom/types/Notes.java | 45 ++++++
src/main/resources/application.yml | 80 ++++++++++
src/main/resources/banner.txt | 6 +
src/main/resources/config/application.properties | 12 ++
src/main/resources/log4j2-spring.xml | 42 +++++
src/main/resources/shiro.ini | 58 +++++++
src/main/resources/static/css/application.css | 19 +++
.../static/images/apache-isis/logo-48x48.png | Bin 0 -> 2622 bytes
.../resources/static/images/apache-isis/logo.png | Bin 0 -> 14160 bytes
src/main/resources/static/images/favicon.png | Bin 0 -> 2143 bytes
src/main/resources/static/index.html | 100 ++++++++++++
src/main/resources/static/scripts/application.js | 3 +
src/main/webapp/META-INF/context.xml | 2 +
src/main/webapp/WEB-INF/web.xml | 28 ++++
.../dom/impl/HelloWorldObject_delete_Test.java | 69 ++++++++
.../dom/impl/HelloWorldObject_updateName_Test.java | 40 +++++
31 files changed, 1394 insertions(+)
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..b1eafb6
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,51 @@
+#
+#
+# text files are normalized (convert crlf => lf)
+# binary files are not normalized (binary is a macro for -text -diff)
+#
+#
+
+
+# Unless otherwise stated, assume text
+
+* text=auto
+
+
+*.java text diff=java
+*.html text diff=html
+*.xhtml text diff=html
+*.xml text
+*.txt text
+
+
+*.jar binary
+*.so binary
+*.dll binary
+
+# images
+*.jpg binary
+*.jpeg binary
+*.png binary
+*.pdn binary
+*.pdn binary
+
+
+*.cs text diff=csharp
+
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2b5e580
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,43 @@
+*~
+*.swp
+*.class
+bin/
+target/
+target-ide/
+logs/
+.settings/
+.project
+.classpath
+.idea
+*.iml
+
+build/
+
+JArchitectOut/
+*.jdproj
+
+neo4j_DB/
+
+# log files
+datanucleus.log
+isis.log
+i18n-po.log
+hs_err_pid*.log
+
+# Package Files #
+*.war
+*.ear
+
+dependency-reduced-pom.xml
+pom.xml.tag
+pom.xml.next
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+
+.clover/
+
+
+rebel.xml
+translations.pot
+/.factorypath
+/.apt_generated_tests/
diff --git a/README.adoc b/README.adoc
new file mode 100644
index 0000000..d317190
--- /dev/null
+++ b/README.adoc
@@ -0,0 +1,31 @@
+= HelloWorld
+
+This is a minimal Apache Isis application, intended as a starting point to learn what Apache Isis is all about.
+
+For real-world development, we recommend you start with the link:https://github.com/apache/isis-app-simpleapp[simpleapp] starter app, which has more structure and includes unit and integration tests.
+
+
+== Quick start
+
+Build using:
+
+[source,bash]
+----
+mvn clean install
+----
+
+Run using:
+
+[source,bash]
+----
+mvn spring-boot:run
+----
+
+Login using:
+
+* username: `sven`
+* password: `pass`
+
+The app runs with H2 running in-memory.
+
+
diff --git a/enhance-all.sh b/enhance-all.sh
new file mode 100644
index 0000000..2da7b0f
--- /dev/null
+++ b/enhance-all.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+mvn datanucleus:enhance -o
\ No newline at end of file
diff --git a/logging-dn-enhance.properties b/logging-dn-enhance.properties
new file mode 100644
index 0000000..ca165ac
--- /dev/null
+++ b/logging-dn-enhance.properties
@@ -0,0 +1,41 @@
+# 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.
+
+# LOG4J Configuration
+# ===================
+
+# Basic logging goes to "datanucleus.log"
+log4j.appender.A1=org.apache.log4j.FileAppender
+log4j.appender.A1.File=datanucleus.log
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n
+#log4j.appender.A1.Threshold=INFO
+
+# Categories
+# Each category can be set to a "level", and to direct to an appender
+
+# Default to DEBUG level for all DataNucleus categories
+log4j.logger.DataNucleus = DEBUG, A1
+
+log4j.category.com.mchange.v2.c3p0=INFO, A1
+log4j.category.com.mchange.v2.resourcepool=INFO, A1
+log4j.category.org.logicalcobwebs.proxool=INFO,A1
+
+
+# Hbase libs logging
+log4j.category.org.apache.hadoop=INFO,A1
+log4j.category.org.apache.zookeeper=INFO,A1
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..fc259e6
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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. -->
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.isis.app</groupId>
+ <artifactId>isis-app-starter-parent</artifactId>
+ <version>2.0.0-M3-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.isis.examples.apps</groupId>
+ <artifactId>helloworld</artifactId>
+
+ <name>Apache Isis App - HelloWorld</name>
+
+ <packaging>${packaging.type}</packaging>
+
+ <properties>
+ <maven-war-plugin.warName>${project.artifactId}</maven-war-plugin.warName>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.isis.mavendeps</groupId>
+ <artifactId>isis-mavendeps-webapp</artifactId>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.mavendeps</groupId>
+ <artifactId>isis-mavendeps-jdk11</artifactId>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+
+
+ <!-- TEST DEPENDENCIES -->
+ <dependency>
+ <groupId>org.apache.isis.mavendeps</groupId>
+ <artifactId>isis-mavendeps-testing</artifactId>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+
+ <profile>
+ <id>actuator</id>
+ <activation>
+ <property>
+ <name>!skip.actuator</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-actuator-autoconfigure</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <!-- running: mvn spring-boot:run -->
+ <profile>
+ <id>package-as-jar</id>
+ <activation>
+ <property>
+ <name>!package-as-war</name>
+ </property>
+ </activation>
+ <properties>
+ <packaging.type>jar</packaging.type>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>docker</id>
+ <activation>
+ <property>
+ <name>docker</name>
+ </property>
+ </activation>
+ <properties>
+ <packaging.type>jar</packaging.type>
+ <package-as-war>false</package-as-war>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ <configuration>
+ <from>
+ <image>openjdk:13-alpine</image>
+ </from>
+ <container>
+ <jvmFlags>
+ <jvmFlag>-Xmx512m</jvmFlag>
+ </jvmFlags>
+ <mainClass>domainapp.application.HelloWorldApp</mainClass>
+ <ports>
+ <port>8080</port>
+ </ports>
+ </container>
+ <to>
+ <image>docker.io/apacheisis/helloworld:latest</image>
+ <auth>
+ <username>${env.DOCKER_REGISTRY_USERNAME}</username>
+ <password>${env.DOCKER_REGISTRY_PASSWORD}</password>
+ </auth>
+ </to>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+</project>
diff --git a/src/main/java/META-INF/persistence.xml b/src/main/java/META-INF/persistence.xml
new file mode 100644
index 0000000..6dcbe51
--- /dev/null
+++ b/src/main/java/META-INF/persistence.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
+
+ <persistence-unit name="helloworld"/>
+
+</persistence>
diff --git a/src/main/java/domainapp/application/HelloWorldApp.java b/src/main/java/domainapp/application/HelloWorldApp.java
new file mode 100644
index 0000000..5b0d1fe
--- /dev/null
+++ b/src/main/java/domainapp/application/HelloWorldApp.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.application;
+
+import domainapp.dom.HelloWorldModule;
+
+import org.apache.isis.config.IsisPresets;
+import org.apache.isis.jdo.IsisBootDataNucleus;
+import org.apache.isis.runtime.spring.IsisBoot;
+import org.apache.isis.security.shiro.IsisBootSecurityShiro;
+import org.apache.isis.viewer.restfulobjects.IsisBootViewerRestfulObjects;
+import org.apache.isis.viewer.wicket.viewer.IsisBootViewerWicket;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+import org.springframework.context.annotation.*;
+
+@SpringBootApplication
+@Import({
+ HelloWorldApp.AppManifest.class,
+})
+public class HelloWorldApp extends SpringBootServletInitializer {
+
+ @Configuration
+ @PropertySources({
+ @PropertySource(IsisPresets.NoTranslations),
+ @PropertySource(IsisPresets.DataNucleusAutoCreate),
+ })
+ @Import({
+ IsisBoot.class,
+ IsisBootSecurityShiro.class,
+ IsisBootDataNucleus.class,
+ IsisBootViewerRestfulObjects.class,
+ IsisBootViewerWicket.class,
+ HelloWorldModule.class
+ })
+ public static class AppManifest {
+ }
+
+ /**
+ * @implNote this is to support the <em>Spring Boot Maven Plugin</em>, which auto-detects an
+ * entry point by searching for classes having a {@code main(...)}
+ */
+ public static void main(String[] args) {
+ SpringApplication.run(new Class[] { HelloWorldApp.class }, args);
+ }
+
+}
diff --git a/src/main/java/domainapp/application/menubars.layout.xml b/src/main/java/domainapp/application/menubars.layout.xml
new file mode 100644
index 0000000..53a140d
--- /dev/null
+++ b/src/main/java/domainapp/application/menubars.layout.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ 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.
+-->
+<mb3:menuBars xsi:schemaLocation="http://isis.apache.org/applib/layout/menubars/bootstrap3 http://isis.apache.org/applib/layout/menubars/bootstrap3/menubars.xsd http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/links http://isis.apache.org/applib/layout/links/links.xsd" xmlns:cpt="http://isis.apache.org/applib/layout/component" xmlns:lnk="http://isis.apache.org/applib/layout/links" xmlns:mb3="h [...]
+ <mb3:primary>
+ <mb3:menu>
+ <mb3:named>Hello World Objects</mb3:named>
+ <mb3:section>
+ <mb3:serviceAction objectType="helloworld.HelloWorldObjects" id="create">
+ <cpt:named>Create</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="helloworld.HelloWorldObjects" id="findByName">
+ <cpt:named>Find By Name</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="helloworld.HelloWorldObjects" id="listAll">
+ <cpt:named>List All</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ </mb3:menu>
+ <mb3:menu unreferencedActions="true">
+ <mb3:named>Other</mb3:named>
+ </mb3:menu>
+ </mb3:primary>
+ <mb3:secondary>
+ <mb3:menu>
+ <mb3:named>Prototyping</mb3:named>
+ <mb3:section>
+ <mb3:serviceAction objectType="isisApplib.FixtureScriptsDefault" id="runFixtureScript">
+ <cpt:named>Run Fixture Script</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.FixtureScriptsDefault" id="runFixtureScriptWithAutoComplete">
+ <cpt:named>Run Fixture Script</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.FixtureScriptsDefault" id="recreateObjectsAndReturnFirst">
+ <cpt:named>Recreate Objects And Return First</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ <mb3:section>
+ <mb3:serviceAction objectType="isisApplib.LayoutServiceMenu" id="downloadLayouts">
+ <cpt:named>Download Object Layouts (ZIP)</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.LayoutServiceMenu" id="downloadMenuBarsLayout">
+ <cpt:named>Download Menu Bars Layout (XML)</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ <mb3:section>
+ <mb3:serviceAction objectType="isisApplib.MetaModelServicesMenu" id="downloadMetaModelXml">
+ <cpt:named>Download Meta Model (XML)</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.MetaModelServicesMenu" id="downloadMetaModelCsv">
+ <cpt:named>Download Meta Model (CSV)</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ <mb3:section>
+ <mb3:serviceAction objectType="isisApplib.SwaggerServiceMenu" id="openSwaggerUi">
+ <cpt:named>Open Swagger Ui</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.SwaggerServiceMenu" id="openRestApi">
+ <cpt:named>Open Rest Api</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.SwaggerServiceMenu" id="downloadSwaggerSchemaDefinition">
+ <cpt:named>Download Swagger Schema Definition</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ <mb3:section>
+ <mb3:serviceAction objectType="isisApplib.TranslationServicePoMenu" id="downloadTranslations">
+ <cpt:named>Download Translations</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.TranslationServicePoMenu" id="resetTranslationCache">
+ <cpt:named>Clear translation cache</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.TranslationServicePoMenu" id="switchToReadingTranslations">
+ <cpt:named>Switch To Reading Translations</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.TranslationServicePoMenu" id="switchToWritingTranslations">
+ <cpt:named>Switch To Writing Translations</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ <mb3:section>
+ <mb3:serviceAction objectType="isisApplib.HsqlDbManagerMenu" id="hsqlDbManager">
+ <cpt:named>HSQL DB Manager</cpt:named>
+ </mb3:serviceAction>
+ <mb3:serviceAction objectType="isisApplib.H2ManagerMenu" id="openH2Console">
+ <cpt:named>H2 Console</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ </mb3:menu>
+ </mb3:secondary>
+ <mb3:tertiary>
+ <mb3:menu>
+ <mb3:named>Configuration Service Menu</mb3:named>
+ <mb3:section>
+ <mb3:serviceAction objectType="isisApplib.ConfigurationMenu" id="configuration">
+ <cpt:named>Configuration</cpt:named>
+ </mb3:serviceAction>
+ </mb3:section>
+ </mb3:menu>
+ </mb3:tertiary>
+</mb3:menuBars>
diff --git a/src/main/java/domainapp/dom/HelloWorldModule.java b/src/main/java/domainapp/dom/HelloWorldModule.java
new file mode 100644
index 0000000..1443506
--- /dev/null
+++ b/src/main/java/domainapp/dom/HelloWorldModule.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.dom;
+
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ComponentScan
+public class HelloWorldModule {
+
+}
diff --git a/src/main/java/domainapp/dom/impl/HelloWorldObject.java b/src/main/java/domainapp/dom/impl/HelloWorldObject.java
new file mode 100644
index 0000000..786041d
--- /dev/null
+++ b/src/main/java/domainapp/dom/impl/HelloWorldObject.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.dom.impl;
+
+import java.util.Comparator;
+
+import javax.inject.Inject;
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.VersionStrategy;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+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.MemberOrder;
+import org.apache.isis.applib.annotation.Publishing;
+import org.apache.isis.applib.annotation.SemanticsOf;
+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 domainapp.dom.types.Name;
+import domainapp.dom.types.Notes;
+
+@javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "helloworld" )
+@javax.jdo.annotations.DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
+@javax.jdo.annotations.Version(strategy= VersionStrategy.DATE_TIME, column ="version")
+@javax.jdo.annotations.Unique(name="HelloWorldObject_name_UNQ", members = {"name"})
+@DomainObject(auditing = Auditing.ENABLED)
+@DomainObjectLayout() // causes UI events to be triggered
+public class HelloWorldObject implements Comparable<HelloWorldObject> {
+
+ private HelloWorldObject(){}
+
+ public HelloWorldObject(final String name) {
+ this.name = name;
+ }
+
+ public String title() {
+ return "Object: " + getName();
+ }
+
+ @Name
+ @MemberOrder(name = "identity", sequence = "1")
+ private String name;
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Notes
+ @MemberOrder(name = "details", sequence = "1")
+ private String notes;
+ public String getNotes() {
+ return notes;
+ }
+ public void setNotes(String notes) {
+ this.notes = notes;
+ }
+
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ command = CommandReification.ENABLED, publishing = Publishing.ENABLED,
+ associateWith = "name"
+ )
+ public HelloWorldObject updateName(
+ @Name final String name) {
+ setName(name);
+ return this;
+ }
+ public String default0UpdateName() {
+ return getName();
+ }
+
+
+ @Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE, associateWith = "name")
+ @ActionLayout(position = ActionLayout.Position.PANEL)
+ public void delete() {
+ final String title = titleService.titleOf(this);
+ messageService.informUser(String.format("'%s' deleted", title));
+ repositoryService.removeAndFlush(this);
+ }
+
+ @Override
+ public String toString() {
+ return getName();
+ }
+
+ @Override
+ public int compareTo(final HelloWorldObject other) {
+ return Comparator.comparing(HelloWorldObject::getName).compare(this, other);
+ }
+
+
+ @Inject RepositoryService repositoryService;
+ @Inject TitleService titleService;
+ @Inject MessageService messageService;
+
+}
\ No newline at end of file
diff --git a/src/main/java/domainapp/dom/impl/HelloWorldObject.layout.xml b/src/main/java/domainapp/dom/impl/HelloWorldObject.layout.xml
new file mode 100644
index 0000000..648ca86
--- /dev/null
+++ b/src/main/java/domainapp/dom/impl/HelloWorldObject.layout.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ 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.
+-->
+<bs3:grid xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns:c="http://isis.apache.org/applib/layout/component" xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="12" unreferencedActions="true">
+ <c:domainObject bookmarking="AS_ROOT"/>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="6">
+ <bs3:row>
+ <bs3:col span="12">
+ <bs3:tabGroup>
+ <bs3:tab name="Identity">
+ <bs3:row>
+ <bs3:col span="12">
+ <c:fieldSet name="Identity" id="identity">
+ <c:action id="delete">
+ <c:describedAs>Deletes this object from the persistent datastore</c:describedAs>
+ </c:action>
+ <c:property id="name" namedEscaped="true">
+ <c:action id="updateName">
+ <c:describedAs>Updates the object's name</c:describedAs>
+ </c:action>
+ </c:property>
+ </c:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Other">
+ <bs3:row>
+ <bs3:col span="12">
+ <c:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Metadata">
+ <bs3:row>
+ <bs3:col span="12">
+ <c:fieldSet name="Metadata" id="metadata"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ </bs3:tabGroup>
+ </bs3:col>
+ <bs3:col span="12">
+ <c:fieldSet name="" id="details">
+ <c:property id="notes" namedEscaped="true" multiLine="10" hidden="ALL_TABLES"/>
+ </c:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ </bs3:col>
+ <bs3:col span="6">
+ <bs3:tabGroup unreferencedCollections="true">
+ </bs3:tabGroup>
+ </bs3:col>
+ </bs3:row>
+</bs3:grid>
diff --git a/src/main/java/domainapp/dom/impl/HelloWorldObject.png b/src/main/java/domainapp/dom/impl/HelloWorldObject.png
new file mode 100644
index 0000000..0bd6f57
Binary files /dev/null and b/src/main/java/domainapp/dom/impl/HelloWorldObject.png differ
diff --git a/src/main/java/domainapp/dom/impl/HelloWorldObjects.java b/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
new file mode 100644
index 0000000..86276b5
--- /dev/null
+++ b/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.dom.impl;
+
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.jdo.JDOQLTypedQuery;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.repository.RepositoryService;
+import org.apache.isis.jdo.jdosupport.IsisJdoSupport_v3_2;
+
+import domainapp.dom.types.Name;
+
+@DomainService(
+ nature = NatureOfService.VIEW,
+ objectType = "helloworld.HelloWorldObjects"
+ )
+public class HelloWorldObjects {
+
+ @Action(semantics = SemanticsOf.NON_IDEMPOTENT)
+ @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
+ public HelloWorldObject create(
+ @Name final String name) {
+ return repositoryService.persist(new HelloWorldObject(name));
+ }
+ public String default0Create() {
+ return "Hello World!";
+ }
+
+
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(promptStyle = PromptStyle.DIALOG_SIDEBAR)
+ public List<HelloWorldObject> findByName(
+ @Name final String name) {
+ JDOQLTypedQuery<HelloWorldObject> q = isisJdoSupport.newTypesafeQuery(HelloWorldObject.class);
+ final QHelloWorldObject cand = QHelloWorldObject.candidate();
+ q = q.filter(
+ cand.name.indexOf(q.stringParameter("name")).ne(-1)
+ );
+ return q.setParameter("name", name)
+ .executeList();
+ }
+
+ @Action(semantics = SemanticsOf.SAFE, restrictTo = RestrictTo.PROTOTYPING)
+ public List<HelloWorldObject> listAll() {
+ return repositoryService.allInstances(HelloWorldObject.class);
+ }
+
+ @Inject RepositoryService repositoryService;
+ @Inject IsisJdoSupport_v3_2 isisJdoSupport;
+
+}
diff --git a/src/main/java/domainapp/dom/types/Name.java b/src/main/java/domainapp/dom/types/Name.java
new file mode 100644
index 0000000..99713c9
--- /dev/null
+++ b/src/main/java/domainapp/dom/types/Name.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.dom.types;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.jdo.annotations.Column;
+
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Property;
+
+@Column(length = Name.MAX_LEN, allowsNull = "false")
+@Property(editing = Editing.DISABLED, maxLength = Name.MAX_LEN)
+@Parameter(maxLength = Name.MAX_LEN)
+@ParameterLayout(named = "Name")
+@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Name {
+
+ int MAX_LEN = 40;
+}
diff --git a/src/main/java/domainapp/dom/types/Notes.java b/src/main/java/domainapp/dom/types/Notes.java
new file mode 100644
index 0000000..f1b05e5
--- /dev/null
+++ b/src/main/java/domainapp/dom/types/Notes.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.dom.types;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.jdo.annotations.Column;
+
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+
+@Column(length = Notes.MAX_LEN, allowsNull = "true")
+@Property(editing = Editing.ENABLED, maxLength = Notes.MAX_LEN)
+@PropertyLayout(multiLine = 5)
+@Parameter(maxLength = Notes.MAX_LEN)
+@ParameterLayout(multiLine = 5)
+@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Notes {
+
+ int MAX_LEN = 4000;
+
+}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
new file mode 100644
index 0000000..de91a4d
--- /dev/null
+++ b/src/main/resources/application.yml
@@ -0,0 +1,80 @@
+#
+# Recommend use for static configuration that does not change between environments.
+#
+# See also config/application.properties
+#
+isis:
+ reflector:
+ explicit-annotations:
+ action: true
+ validator:
+ allowDeprecated: false
+ noParamsOnly: true
+ explicitObjectType: true
+ serviceActionsOnly: true
+
+ mixinsOnly: true
+
+ facet:
+ cssClassFa:
+ patterns:
+ new.*:fa-plus,\
+ add.*:fa-plus-square,\
+ create.*:fa-plus,\
+ update.*:fa-edit,\
+ delete.*:fa-trash,\
+ find.*:fa-search,\
+ list.*:fa-list
+
+ cssClass:
+ patterns:
+ delete.*:btn-danger
+
+ objects:
+ editing: false
+
+ viewer:
+ wicket:
+ application:
+ menubarsLayoutXml: domainapp/application/menubars.layout.xml
+ brandLogoHeader: /images/apache-isis/logo-48x48.png
+ faviconUrl: /images/favicon.png
+ name: Hello World App
+ css: css/application.css
+ js: scripts/application.js
+ about: Hello World
+ welcome:
+ file: welcome.html #not implemented, currently only welcome.text is implemented
+
+ credit[0]:
+ image: /images/apache-isis/logo-48x48.png
+ name: Apache Isis
+ url: http://isis.apache.org
+
+ themes:
+ initial: Flatly
+ showChooser: true
+ enabled: Cosmo,Flatly,Darkly,Sandstone,United
+
+ maxTitleLengthInStandaloneTables: 0
+ maxTitleLengthInParentedTables: 0
+
+ persistor:
+ datanucleus:
+ impl:
+ datanucleus:
+ schema:
+ validateTables: true
+ validateConstraints: true
+
+ persistenceByReachabilityAtCommit: false
+ identifier:
+ case: MixedCase
+
+ cache:
+ level2:
+ type: none
+ mode: ENABLE_SELECTIVE
+spring:
+ banner:
+ location: banner.txt
diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt
new file mode 100644
index 0000000..1348a76
--- /dev/null
+++ b/src/main/resources/banner.txt
@@ -0,0 +1,6 @@
+ _ _ ___ _
+ / \ _ __ __ _ ___| |__ ___ |_ _|___(_)___
+ / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | |/ __| / __|
+ / ___ \| |_) | (_| | (__| | | | __/ | |\__ \ \__ \
+ /_/ \_\ .__/ \__,_|\___|_| |_|\___| |___|___/_|___/
+ |_|
\ No newline at end of file
diff --git a/src/main/resources/config/application.properties b/src/main/resources/config/application.properties
new file mode 100644
index 0000000..cb0aeef
--- /dev/null
+++ b/src/main/resources/config/application.properties
@@ -0,0 +1,12 @@
+#
+# Recommend use for configuration that changes between environments.
+#
+# To override externally, see Spring Boot docs
+# https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config
+#
+# See also /application.yml
+#
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL = jdbc:h2:mem:test
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName = org.h2.Driver
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName = sa
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword =
diff --git a/src/main/resources/log4j2-spring.xml b/src/main/resources/log4j2-spring.xml
new file mode 100644
index 0000000..08a5edb
--- /dev/null
+++ b/src/main/resources/log4j2-spring.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="WARN">
+ <Properties>
+ <Property name="PID">????</Property>
+ <Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property>
+ <Property name="LOG_LEVEL_PATTERN">%5p</Property>
+ <Property name="LOG_DATEFORMAT_PATTERN">yyyy-MM-dd HH:mm:ss.SSS</Property>
+ <Property name="CONSOLE_LOG_PATTERN">%clr{%d{${LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${LOG_LEVEL_PATTERN}} %clr{${sys:PID}}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
+ <Property name="FILE_LOG_PATTERN">%d{${LOG_DATEFORMAT_PATTERN}} ${LOG_LEVEL_PATTERN} ${sys:PID} --- [%t] %-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
+ </Properties>
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT" follow="true">
+ <PatternLayout pattern="${sys:CONSOLE_LOG_PATTERN}" />
+ </Console>
+ </Appenders>
+ <Loggers>
+
+ <!-- silence Wicket -->
+ <Logger name="org.apache.wicket.page.PartialPageUpdate" level="error" />
+
+ <Logger name="org.apache.catalina.startup.DigesterFactory" level="error" />
+ <Logger name="org.apache.catalina.util.LifecycleBase" level="error" />
+ <Logger name="org.apache.coyote.http11.Http11NioProtocol" level="warn" />
+ <logger name="org.apache.sshd.common.util.SecurityUtils" level="warn"/>
+ <Logger name="org.apache.tomcat.util.net.NioSelectorPool" level="warn" />
+ <Logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="error" />
+ <Logger name="org.hibernate.validator.internal.util.Version" level="warn" />
+ <logger name="org.springframework.boot.actuate.endpoint.jmx" level="warn"/>
+
+ <logger name="org.apache.directory" level="warn"/>
+ <logger name="org.apache.directory.api.ldap.model.entry.Value" level="off"/>
+
+ <logger name="DataNucleus.Persistence" level="info"/>
+ <logger name="DataNucleus.Transaction" level="info"/>
+ <logger name="DataNucleus.Datastore.Schema" level="info"/>
+ <logger name="DataNucleus.Datastore.Native" level="info"/>
+
+ <Root level="info">
+ <AppenderRef ref="Console" />
+ </Root>
+ </Loggers>
+</Configuration>
diff --git a/src/main/resources/shiro.ini b/src/main/resources/shiro.ini
new file mode 100644
index 0000000..bc52895
--- /dev/null
+++ b/src/main/resources/shiro.ini
@@ -0,0 +1,58 @@
+#
+# 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.
+#
+
+[main]
+
+
+# to use .ini file
+securityManager.realms = $iniRealm
+
+
+# -----------------------------------------------------------------------------
+# Users and their assigned roles
+#
+# Each line conforms to the format defined in the
+# org.apache.shiro.realm.text.TextConfigurationRealm#setUserDefinitions JavaDoc
+# -----------------------------------------------------------------------------
+
+[users]
+# user = password, role1, role2, role3, ...
+
+
+sven = pass, admin_role
+dick = pass, user_role
+bob = pass, user_role
+joe = pass, user_role
+
+
+
+# -----------------------------------------------------------------------------
+# Roles with assigned permissions
+#
+# Each line conforms to the format defined in the
+# org.apache.shiro.realm.text.TextConfigurationRealm#setRoleDefinitions JavaDoc
+# -----------------------------------------------------------------------------
+
+[roles]
+# role = perm1, perm2, perm3, ...
+# perm in format: packageName:className:memberName:r,w
+
+user_role = *:HelloWorldObjects:*:*,\
+ *:HelloWorldObject:*:*
+admin_role = *
diff --git a/src/main/resources/static/css/application.css b/src/main/resources/static/css/application.css
new file mode 100644
index 0000000..9f1612a
--- /dev/null
+++ b/src/main/resources/static/css/application.css
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+
diff --git a/src/main/resources/static/images/apache-isis/logo-48x48.png b/src/main/resources/static/images/apache-isis/logo-48x48.png
new file mode 100644
index 0000000..08e012c
Binary files /dev/null and b/src/main/resources/static/images/apache-isis/logo-48x48.png differ
diff --git a/src/main/resources/static/images/apache-isis/logo.png b/src/main/resources/static/images/apache-isis/logo.png
new file mode 100644
index 0000000..5284fe7
Binary files /dev/null and b/src/main/resources/static/images/apache-isis/logo.png differ
diff --git a/src/main/resources/static/images/favicon.png b/src/main/resources/static/images/favicon.png
new file mode 100644
index 0000000..2586589
Binary files /dev/null and b/src/main/resources/static/images/favicon.png differ
diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html
new file mode 100644
index 0000000..be415dd
--- /dev/null
+++ b/src/main/resources/static/index.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>Apache Isis™ HelloWorld</title>
+
+ <style type="text/css">
+body {
+ background-color: #1A467B;
+ font-family: Verdana, Helvetica, Arial, serif;
+ font-size: 90%;
+}
+
+li {
+ margin-top: 6px;
+ margin-bottom: 6px;
+}
+table {
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px;
+ border-style: solid;
+ border-color: lightgray;
+}
+th, td {
+ padding: 10px;
+}
+#wrapper {
+ background-color: #ffffff;
+ width: 900px;
+ margin: 8px auto;
+ padding: 12px;
+}
+ </style>
+ </head>
+ <body>
+ <div id="wrapper">
+ <img alt="Isis Logo" src="images/apache-isis/logo.png" />
+
+ <p>
+ This is a minimal Apache Isis application, intended as a starting point to learn what Apache Isis is all about.
+ <br/>
+ </p>
+
+ <p>To access the app:</p>
+ <ul>
+ <li>
+ <p>
+ <b><a href="wicket/">wicket/</a></b>
+ </p>
+ <p>
+ provides access to a generic UI for end-users,
+ Apache Isis' <a href="http://isis.apache.org/guides/ugvw/ugvw.html" target="_blank">Wicket Viewer</a>.
+ As its name suggests, this viewer is built on top of <a href="http://wicket.apache.org" target="_blank">Apache Wicket</a>™.
+ </p>
+ </li>
+ <li>
+ <p>
+ <b>
+ <a href="swagger-ui/index.template.html">swagger-ui/</a>
+ </b>
+ </p>
+ <p>
+ provides access to a Swagger UI which uses a subset of the framework's automatically
+ generated <a href="restful/">RESTful API</a> (provided by the
+ <a href="http://isis.apache.org/guides/ugvro/ugvro.html" target="_blank">Restful Objects viewer</a>).
+ </p>
+ <p>The RESTful API can return both simple representations and also richer hypermedia representations
+ that are conformant with the <a href="http://restfulobjects.org" target="_blank">Restful Objects</a> spec.
+ The HTTP <code>Accept</code> header is used to select which representation should be generated.
+ </p>
+ </li>
+ </ul>
+
+ <p>
+ The default user/password is <b><i>sven/pass</i></b>.
+ </p>
+
+ </div>
+ </body>
+</html>
diff --git a/src/main/resources/static/scripts/application.js b/src/main/resources/static/scripts/application.js
new file mode 100644
index 0000000..d8cf6fe
--- /dev/null
+++ b/src/main/resources/static/scripts/application.js
@@ -0,0 +1,3 @@
+$(document).ready(function() {
+ /// here...
+});
\ No newline at end of file
diff --git a/src/main/webapp/META-INF/context.xml b/src/main/webapp/META-INF/context.xml
new file mode 100644
index 0000000..fd2fac1
--- /dev/null
+++ b/src/main/webapp/META-INF/context.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context path=""/>
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..f5f0dd4
--- /dev/null
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+ id="WebApp_ID" version="3.1">
+
+ <display-name>Hello World</display-name>
+
+
+</web-app>
diff --git a/src/test/java/domainapp/dom/impl/HelloWorldObject_delete_Test.java b/src/test/java/domainapp/dom/impl/HelloWorldObject_delete_Test.java
new file mode 100644
index 0000000..c09e6ca
--- /dev/null
+++ b/src/test/java/domainapp/dom/impl/HelloWorldObject_delete_Test.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.dom.impl;
+
+import org.jmock.Expectations;
+import org.jmock.auto.Mock;
+import org.junit.Rule;
+import org.junit.Test;
+
+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 org.apache.isis.unittestsupport.jmocking.JUnitRuleMockery2;
+
+import static org.hamcrest.CoreMatchers.containsString;
+
+public class HelloWorldObject_delete_Test {
+
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(JUnitRuleMockery2.Mode.INTERFACES_AND_CLASSES);
+
+ @Mock
+ TitleService mockTitleService;
+
+ @Mock
+ MessageService mockMessageService;
+
+ @Mock
+ RepositoryService mockRepositoryService;
+
+ @Test
+ public void happy_case() throws Exception {
+
+ // given
+ final HelloWorldObject object = new HelloWorldObject("Foo");
+ object.titleService = mockTitleService;
+ object.messageService = mockMessageService;
+ object.repositoryService = mockRepositoryService;
+
+ // expecting
+ context.checking(new Expectations() {{
+ allowing(mockTitleService).titleOf(object); will(returnValue("Foo"));
+
+ oneOf(mockMessageService).informUser(with(containsString("'Foo' deleted")));
+ oneOf(mockRepositoryService).removeAndFlush(object);
+ }});
+
+ // when
+ object.delete();
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/test/java/domainapp/dom/impl/HelloWorldObject_updateName_Test.java b/src/test/java/domainapp/dom/impl/HelloWorldObject_updateName_Test.java
new file mode 100644
index 0000000..0d04182
--- /dev/null
+++ b/src/test/java/domainapp/dom/impl/HelloWorldObject_updateName_Test.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package domainapp.dom.impl;
+
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class HelloWorldObject_updateName_Test {
+
+ @Test
+ public void happy_case() throws Exception {
+ // given
+ final HelloWorldObject object = new HelloWorldObject("Foo");
+ assertThat(object.getName()).isEqualTo("Foo");
+
+ // when
+ object.updateName("Bar");
+
+ // then
+ assertThat(object.getName()).isEqualTo("Bar");
+ }
+
+}
\ No newline at end of file