You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/02/14 15:00:58 UTC
[01/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Repository: isis
Updated Branches:
refs/heads/ISIS-903 4d3eb5789 -> 68899a294 (forced update)
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
new file mode 100644
index 0000000..2a425e5
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
@@ -0,0 +1,178 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!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™ TodoApp</title>
+
+ <style type="text/css">
+body {
+ background-color: ${symbol_pound}1A467B;
+ font-family: Verdana, Helvetica, Arial;
+ 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;
+}
+${symbol_pound}wrapper {
+ background-color: ${symbol_pound}ffffff;
+ width: 900px;
+ margin: 8px auto;
+ padding: 12px;
+}
+ </style>
+ </head>
+ <body>
+ <div id="wrapper">
+ <img alt="Isis Logo" src="about/images/isis-logo.png" />
+
+ <p>
+ <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a framework to let you rapidly develop
+ domain-driven apps in Java. This app has been generated using Isis'
+ <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
+ which configures Isis to run a (quite feature rich) "todo" app.
+
+ <p>
+ The app itself consists of a single domain class, <tt>ToDoItem</tt>, along with a number of supporting
+ services.
+ </p>
+
+ <p>To access the app:</p>
+ <ul>
+ <li>
+ <p>
+ <b><a href="wicket/">wicket/</a></b>
+ </p>
+ <p>
+ provides accesses to a generic UI for end-users,
+ Isis' <a href="http://isis.apache.org/components/viewers/wicket/about.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="restful/">restful/</a>
+ </b>
+ </p>
+ <p>
+ provides access to a RESTful API conformant with the
+ <a href="http://restfulobjects.org">Restful Objects</a> spec</td>. This is part of Isis Core. The
+ implementation technology is JBoss RestEasy.
+ </p>
+ </li>
+ </ul>
+
+ <p>
+ The default user/password is <b><i>sven/pass</i></b> (as configured in the
+ <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">shiro.ini</a> file).
+ </p>
+
+ <p>
+ To build your own app, while you could start with this todo app and remove/rename as required, you are
+ probably better off using the extremely minimal
+ <a href="http://isis.apache.org/intro/getting-started/simpleapp-archetype.html" target="_blank">SimpleApp</a> archetype.
+ </p>
+
+ <h2>App contents</h2>
+ <p>The key files in this "todo" app are:</p>
+ <!-- the hrefs below are partially URL encoded to prevent them from being modified when the archetype is created -->
+ <ul>
+ <li>Domain classes (todo functionality) (in <tt>dom</tt> module)
+ <ul>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank"><tt>ToDoItem</tt></a> domain entity
+ </li>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItems.java" target="_blank"><tt>ToDoItems</tt></a> domain service (repository/factory)
+ </li>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoItemAnalysis.java" target="_blank"><tt>ToDoItemAnalysis</tt></a> application service analysing todo items
+ </li>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoAppDashboard.java" target="_blank"><tt>ToDoAppDashboard</tt></a> dashboard application service
+ </li>
+ </ul>
+ </li>
+ <li>Fixture scripts (in <tt>fixture</tt> module)
+ <ul>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java" target="_blank"><tt>ToDoItemsFixtureService</tt></a> domain service to install fixtures at run-time
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml" target="_blank">WEB-INF/web.xml</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L98" target="_blank">ResourceCachingFilter</a></tt> and <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L134" target="_blank">ResourceServlet</a></tt> - filter and servlet for serving up static resources.
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L174" target="_blank">WicketFilter</a></tt> - filter for the wicket application, mapped to <tt>/wicket/*</tt>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L223" target="_blank">ResteasyBootstrap</a></tt>,
+ <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L240" target="_blank">IsisSessionFilterForRestfulObjects</a></tt>,
+ <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L271" target="_blank">RestfulObjectsRestEasyDispatcher</a></tt> - listeners, filters and servlets to bootstrap and map restful objects viewer to <tt>/restful/*</tt>.
+ </li>
+ <li>commented out <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L208" target="_blank">IsisWebAppBootstrapper</a></tt> listener; this is NOT required unless wicket viewer config is removed
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/isis.properties" target="_blank">WEB-INF/isis.properties</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li><tt>isis.services</tt> - explicitly loaded framework-provide domain services. Other services (including <tt>ToDoItems</tt> and <tt>ToDoItemsFixtureService</tt> described above),
+ are loaded automatically from the classpath.
+ </li>
+ <li><tt>isis.persistor</tt> - specifies to use Isis' integration with <a href="http://datanucleus.org">DataNucleus</a> for (JDO-based) persistence.
+ </li>
+ <li><tt>isis.authentication</tt> and <tt>isis.authorization</tt> - specifies to use Isis' integration with <a href="http://shiro.apache.org">Apache Shiro</a> for security.
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties" target="_blank">WEB-INF/persistor_datanucleus.properties</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li>configuration for the DataNucleus (JDO) object store
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor.properties" target="_blank">WEB-INF/persistor.properties</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li>JDBC URL for DataNucleus (JDO) object store
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">WEB-INF/shiro.ini</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li>configuration for Shiro security
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
new file mode 100644
index 0000000..e4aed6e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+.navbar-brand img {
+ margin-top: -5px;
+ margin-left: 5px;
+}
+
+.x-key label.scalarName {
+ color: red;
+}
+
+tr.todo {
+}
+
+tr.done {
+ text-decoration: line-through;
+ color: #d3d3d3;
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn
new file mode 100644
index 0000000..016c9b8
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png
new file mode 100644
index 0000000..2c417fb
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
new file mode 100644
index 0000000..7a164e1
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png
new file mode 100644
index 0000000..ee2feb4
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn
new file mode 100644
index 0000000..4983ca9
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js
new file mode 100644
index 0000000..d8cf6fe
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js
@@ -0,0 +1,3 @@
+$(document).ready(function() {
+ /// here...
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties b/mothballed/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
new file mode 100644
index 0000000..465d32c
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
@@ -0,0 +1,5 @@
+#Tue Feb 03 23:39:52 GMT 2015
+package=it.pkg
+version=0.1-SNAPSHOT
+groupId=archetype.it
+artifactId=basic
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/test/resources/projects/basic/goal.txt b/mothballed/example/archetype/todoapp/src/test/resources/projects/basic/goal.txt
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c24b464..73d7a95 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,10 +54,8 @@
<module>component/viewer/wicket</module>
<module>tck</module>
- <module>example/application/todoapp</module>
<module>example/application/simpleapp</module>
- <module>example/archetype/todoapp</module>
<module>example/archetype/simpleapp</module>
<module>component/viewer/scimpi</module>
@@ -69,11 +67,7 @@
<modules>
<module>core</module>
<module>component/viewer/wicket</module>
-
- <module>example/application/todoapp</module>
<module>example/application/simpleapp</module>
-
- <module>example/archetype/todoapp</module>
<module>example/archetype/simpleapp</module>
</modules>
</profile>
@@ -103,7 +97,6 @@
<profile>
<id>examples</id>
<modules>
- <module>example/application/todoapp</module>
<module>example/application/simpleapp</module>
</modules>
</profile>
[09/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
new file mode 100644
index 0000000..c859340
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
@@ -0,0 +1,165 @@
+/**
+ * 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 integration.glue.todoitem;
+
+import cucumber.api.java.en.Given;
+import cucumber.api.java.en.Then;
+import cucumber.api.java.en.When;
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+
+import java.util.List;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.jmock.Expectations;
+import org.junit.Assert;
+import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
+import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemGlue extends CukeGlueAbstract {
+
+ @Given("^there are a number of incomplete ToDo items$")
+ public void there_are_a_number_of_incomplete_ToDo_items() throws Throwable {
+ if(supportsMocks()) {
+ checking(new Expectations() {
+ {
+ allowing(service(ToDoItems.class)).notYetComplete();
+ will(returnValue(notYetCompleteItems()));
+ }
+ });
+ }
+ try {
+ final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
+ assertThat(notYetComplete.isEmpty(), is(false));
+ putVar("list", "notYetCompleteItems", notYetComplete);
+
+ } finally {
+ assertMocksSatisfied();
+ }
+ }
+
+ @When("^I choose the first of the incomplete items$")
+ public void I_choose_the_first_one() throws Throwable {
+ @SuppressWarnings("unchecked")
+ List<ToDoItem> notYetComplete = getVar(null, "notYetCompleteItems", List.class);
+ assertThat(notYetComplete.isEmpty(), is(false));
+
+ putVar("todo", "toDoItem", notYetComplete.get(0));
+ }
+
+ @When("^mark the item as complete$")
+ public void mark_it_as_complete() throws Throwable {
+ final ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ if(supportsMocks()) {
+ final ActionInvocationContext actionInvocationContext = service(ActionInvocationContext.class);
+ final EventBusService eventBusService = service(EventBusService.class);
+ checking(new Expectations() {
+ {
+ allowing(actionInvocationContext);
+ allowing(eventBusService);
+ }
+ });
+ toDoItem.actionInvocationContext = actionInvocationContext;
+ toDoItem.eventBusService = eventBusService;
+ }
+ wrap(toDoItem).completed();
+ }
+
+ @Then("^the item is no longer listed as incomplete$")
+ public void the_item_is_no_longer_listed_as_incomplete() throws Throwable {
+ ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ whetherNotYetCompletedContains(toDoItem, false);
+ }
+
+ @Given("^.*completed .*item$")
+ public void a_completed_ToDo_item() throws Throwable {
+ if(supportsMocks()) {
+ checking(new Expectations(){{
+ allowing(service(ToDoItems.class)).allToDos();
+ will(returnValue(findItems(Predicates.<ToDoItem>alwaysTrue()) ));
+ }});
+ }
+ try {
+ final List<ToDoItem> allToDos = service(ToDoItems.class).allToDos();
+ for (ToDoItem toDoItem : allToDos) {
+ if(toDoItem.isComplete()) {
+ putVar("todo", "toDoItem", toDoItem);
+ return;
+ }
+ }
+ Assert.fail("could not locate any completed ToDo items");
+ } finally {
+ assertMocksSatisfied();
+ }
+ }
+
+ @When("^I mark the .*item as not yet complete$")
+ public void I_mark_it_as_not_yet_complete() throws Throwable {
+ ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ assertThat(toDoItem.isComplete(), is(true));
+
+ toDoItem.setComplete(false);
+ }
+
+ @Then("^the .*item is listed as incomplete$")
+ public void the_item_is_listed_as_incomplete() throws Throwable {
+ ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ whetherNotYetCompletedContains(toDoItem, true);
+ }
+
+ private void whetherNotYetCompletedContains(ToDoItem toDoItem, final boolean whetherContained) {
+ if(supportsMocks()) {
+ final List<ToDoItem> notYetCompleteItems = notYetCompleteItems();
+ checking(new Expectations() {
+ {
+ oneOf(service(ToDoItems.class)).notYetComplete();
+ will(returnValue(notYetCompleteItems));
+ }
+ });
+ }
+ try {
+ final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
+ assertThat(notYetComplete.contains(toDoItem), is(whetherContained));
+ } finally {
+ assertMocksSatisfied();
+ }
+ }
+
+
+ // helper
+ private List<ToDoItem> notYetCompleteItems() {
+ return findItems(new Predicate<ToDoItem>(){
+ @Override
+ public boolean apply(ToDoItem input) {
+ return !input.isComplete();
+ }
+ });
+ }
+
+ private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
+ final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
+ final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
+ return Lists.newArrayList(Iterables.filter(items, predicate));
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
new file mode 100644
index 0000000..dcb56ad
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
@@ -0,0 +1,38 @@
+/**
+ * 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 integration.specs.todoitem;
+
+import cucumber.api.junit.Cucumber;
+
+import org.junit.runner.RunWith;
+
+
+/**
+ * Runs scenarios in all <tt>.feature</tt> files (this package and any subpackages).
+ */
+@RunWith(Cucumber.class)
+@Cucumber.Options(
+ format = {
+ "html:target/cucumber-html-report"
+ ,"json:target/cucumber.json"
+ },
+ glue={"classpath:integration.glue"},
+ strict = true,
+ tags = { "~@backlog", "~@ignore" })
+public class RunSpecs {
+ // intentionally empty
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature b/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
new file mode 100644
index 0000000..9fc1596
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
@@ -0,0 +1,39 @@
+#
+# 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.
+#
+@ToDoItemsFixture
+Feature: Find And Complete ToDo Items
+
+ # the scenario is listed twice here just to demonstrate that it
+ # can be run either at @unit-level scope (using mocks) or
+ # at @integration-level scope (against the running system).
+
+ @unit
+ Scenario: Todo items once completed are no longer listed
+ Given there are a number of incomplete ToDo items
+ When I choose the first of the incomplete items
+ And mark the item as complete
+ Then the item is no longer listed as incomplete
+
+
+ @integration
+ Scenario: Todo items once completed are no longer listed
+ Given there are a number of incomplete ToDo items
+ When I choose the first of the incomplete items
+ And mark the item as complete
+ Then the item is no longer listed as incomplete
+
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature b/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
new file mode 100644
index 0000000..1f5f73e
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
@@ -0,0 +1,35 @@
+#
+# 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.
+#
+@ToDoItemsFixture
+Feature: Find completed ToDoItem and mark as not yet complete
+
+ # the scenario is listed twice here just to demonstrate that it
+ # can be run either at @unit-level scope (using mocks) or
+ # at @integration-level scope (against the running system).
+
+ @integration
+ Scenario: Todo items can be uncompleted
+ Given a completed item
+ When I mark the item as not yet complete
+ Then the item is listed as incomplete
+
+
+ @unit
+ Scenario: Todo items can be uncompleted
+ Given a completed ToDo item
+ When I mark the item as not yet complete
+ Then the item is listed as incomplete
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
new file mode 100644
index 0000000..ab15a30
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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 integration.tests;
+
+import integration.ToDoAppSystemInitializer;
+
+import org.junit.BeforeClass;
+import org.apache.isis.core.integtestsupport.IntegrationTestAbstract;
+import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForIntegration;
+
+public abstract class AbstractToDoIntegTest extends IntegrationTestAbstract {
+
+ @BeforeClass
+ public static void initClass() {
+ org.apache.log4j.PropertyConfigurator.configure("logging.properties");
+ ToDoAppSystemInitializer.initIsft();
+
+ // instantiating will install onto ThreadLocal
+ new ScenarioExecutionForIntegration();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
new file mode 100644
index 0000000..f377f52
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
@@ -0,0 +1,158 @@
+/*
+ * 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 integration.tests;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemContributions;
+import dom.todo.ToDoItems;
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public abstract class ToDoItemContributionsIntegTest extends AbstractToDoIntegTest {
+
+ ToDoItemsRecreateAndCompleteSeveral fixtureScript;
+
+ @Before
+ public void setUpData() throws Exception {
+ fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
+ fixtureScripts.runFixtureScript(fixtureScript, null);
+ }
+
+ @Inject
+ FixtureScripts fixtureScripts;
+ @Inject
+ ToDoItems toDoItems;
+ @Inject
+ ToDoItemContributions toDoItemContributions;
+
+ ToDoItemContributions toDoItemContributionsWrapped;
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+
+ toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-complete-for-buy-stamps/item-1", ToDoItem.class));
+ assertThat(toDoItem, is(not(nullValue())));
+
+ toDoItemContributionsWrapped = wrap(toDoItemContributions);
+ }
+
+ public static class Actions {
+ public static class UpdateCategory extends ToDoItemContributionsIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Consulting);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Professional));
+ assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Consulting));
+
+ // when
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Domestic, ToDoItem.Subcategory.Chores);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Domestic));
+ assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Chores));
+ }
+
+
+ @Test
+ public void categoryCannotBeNull() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("'Category' is mandatory");
+ toDoItemContributionsWrapped.updateCategory(toDoItem, null, ToDoItem.Subcategory.Chores);
+ }
+
+ @Test
+ public void subcategoryCanBeNull() throws Exception {
+
+ // when, then
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, null);
+ }
+
+ @Test
+ public void subcategoryMustBelongToCategory() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Invalid subcategory"));
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Chores);
+ }
+ }
+
+ public static class SimilarTo extends ToDoItemContributionsIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ List<ToDoItem> similarItems = toDoItemContributionsWrapped.similarTo(toDoItem);
+
+ // then
+ assertThat(similarItems.size(), is(6));
+ }
+
+ }
+ }
+
+ public static class Properties {
+ public static class Priority extends ToDoItemContributionsIntegTest {
+
+ private List<ToDoItem> notYetComplete;
+
+ @Before
+ public void setUp() throws Exception {
+ notYetComplete = wrap(toDoItems).notYetComplete();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+ assertPriority(0, 1);
+ assertPriority(1, 2);
+ assertPriority(2, 4);
+ assertPriority(3, 6);
+ assertPriority(4, 5);
+ assertPriority(5, 7);
+ assertPriority(6, 9);
+ assertPriority(7, 8);
+ assertPriority(8, 3);
+ assertPriority(9, 10);
+ }
+
+ private void assertPriority(final int n, final int priority) {
+ assertThat(toDoItemContributions.relativePriority(notYetComplete.get(n)), is(Integer.valueOf(priority)));
+ }
+ }
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
new file mode 100644
index 0000000..5bb2f0f
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
@@ -0,0 +1,1057 @@
+/*
+ * 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 integration.tests;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemSubscriptions;
+import dom.todo.ToDoItems;
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import java.math.BigDecimal;
+import java.nio.charset.Charset;
+import java.util.EventObject;
+import java.util.List;
+import javax.activation.MimeType;
+import javax.inject.Inject;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+import org.jmock.Expectations;
+import org.jmock.Sequence;
+import org.jmock.auto.Mock;
+import org.joda.time.LocalDate;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.services.clock.ClockService;
+import org.apache.isis.applib.services.eventbus.AbstractInteractionEvent;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
+import org.apache.isis.applib.value.Blob;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemIntegTest extends AbstractToDoIntegTest {
+
+ ToDoItemsRecreateAndCompleteSeveral fixtureScript;
+
+ @Before
+ public void setUpData() throws Exception {
+ fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
+ fixtureScripts.runFixtureScript(fixtureScript, null);
+ }
+
+ @Inject
+ FixtureScripts fixtureScripts;
+ @Inject
+ ToDoItems toDoItems;
+ @Inject
+ ToDoItemSubscriptions toDoItemSubscriptions;
+
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = toDoItems.notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ toDoItemSubscriptions.reset();
+ }
+
+
+ public static class Title extends ToDoItemIntegTest {
+
+ private LocalDate dueBy;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+
+ toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-for-buy-bread/item-1", ToDoItem.class));
+ assertThat(toDoItem, is(not(nullValue())));
+
+ nextTransaction();
+
+ dueBy = toDoItem.getDueBy();
+ }
+
+
+ @Test
+ public void includesDescription() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread due by"));
+
+ // when
+ unwrap(toDoItem).setDescription("Buy bread and butter");
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread and butter due by"));
+ }
+
+ @Test
+ public void includesDueDateIfAny() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("due by " + dueBy.toString("yyyy-MM-dd")));
+
+ // when
+ final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
+ unwrap(toDoItem).setDueBy(fiveDaysFromNow);
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
+ }
+
+
+ @Test
+ public void ignoresDueDateIfNone() throws Exception {
+
+ // when
+ // (since wrapped, will call clearDueBy)
+ toDoItem.setDueBy(null);
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ }
+
+ @Test
+ public void usesWhetherCompleted() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), not(containsString("Completed!")));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread - Completed!"));
+ }
+ }
+
+ public static class Actions {
+
+ public static class Completed extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.isComplete(), is(false));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(true));
+ }
+
+ @Test
+ public void cannotCompleteIfAlreadyCompleted() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Already completed");
+ toDoItem.completed();
+
+ // and then
+ final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
+ assertThat(ev, is(nullValue()));
+ }
+
+
+ @Test
+ public void cannotSetPropertyDirectly() throws Exception {
+
+ // given
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Always disabled");
+ toDoItem.setComplete(true);
+
+ // and then
+ final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
+ assertThat(ev, is(nullValue()));
+ }
+
+ @Test
+ public void subscriberReceivesEvents() throws Exception {
+
+ // given
+ toDoItemSubscriptions.reset();
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ assertThat(unwrap(toDoItem).isComplete(), is(false));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(unwrap(toDoItem).isComplete(), is(true));
+
+ // and then
+ final List<ToDoItem.CompletedEvent> receivedEvents = toDoItemSubscriptions.receivedEvents(ToDoItem.CompletedEvent.class);
+
+ // hide, disable, validate, executing, executed
+ // sent to both the general on(ActionInteractionEvent ev)
+ // and also the specific on(final ToDoItem.CompletedEvent ev)
+ assertThat(receivedEvents.size(), is(5*2));
+ final ToDoItem.CompletedEvent ev = receivedEvents.get(0);
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("completed"));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ }
+
+ /**
+ * This test demonstrates how a single service can be replaced, eg to use a mock.
+ */
+ public static class Completed_withMockService extends ToDoItemIntegTest {
+
+ private EventBusService originalEventBusService;
+ @Mock
+ private EventBusService mockEventBusService;
+
+ @Before
+ public void setUpMockEventBusService() throws Exception {
+ originalEventBusService = scenarioExecution().service(EventBusService.class);
+
+ context.checking(new Expectations() {{
+ ignoring(mockEventBusService).register(with(any(Object.class)));
+ ignoring(mockEventBusService).unregister(with(any(Object.class)));
+ }});
+
+ scenarioExecution().replaceService(originalEventBusService, mockEventBusService);
+ scenarioExecution().closeSession();
+ scenarioExecution().openSession();
+
+ final List<ToDoItem> all = toDoItems.notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+
+ @After
+ public void reinstateOriginalEventBusService() throws Exception {
+ scenarioExecution().replaceService(mockEventBusService, originalEventBusService);
+ }
+
+ @Test
+ public void raisesEvent() throws Exception {
+
+ final Sequence busRulesThenExec = context.sequence("busRulesThenExec");
+ // then
+ context.checking(new Expectations() {{
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.HIDE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.DISABLE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.VALIDATE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTING)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTED)));
+ inSequence(busRulesThenExec);
+ }});
+
+ // when
+ toDoItem.completed();
+ }
+
+ private Matcher<Object> completedEvent(final AbstractInteractionEvent.Phase phase) {
+ return new TypeSafeMatcher<Object>() {
+ @Override
+ protected boolean matchesSafely(Object item) {
+ if (!(item instanceof ToDoItem.CompletedEvent)) {
+ return false;
+ }
+
+ final ToDoItem.CompletedEvent completedEvent = (ToDoItem.CompletedEvent) item;
+ return completedEvent.getPhase() == phase;
+
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText(" instance of a ToDoItem.CompletedEvent, " + phase);
+ }
+ };
+ }
+ }
+
+
+ public static class Duplicate extends ToDoItemIntegTest {
+
+ ToDoItem duplicateToDoItem;
+
+ @Inject
+ private ClockService clockService;
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ final LocalDate todaysDate = clockService.now();
+ toDoItem.setDueBy(todaysDate);
+ toDoItem.updateCost(new BigDecimal("123.45"));
+
+ duplicateToDoItem = toDoItem.duplicate(
+ unwrap(toDoItem).default0Duplicate(),
+ unwrap(toDoItem).default1Duplicate(),
+ unwrap(toDoItem).default2Duplicate(),
+ unwrap(toDoItem).default3Duplicate(),
+ new BigDecimal("987.65"));
+
+ // then
+ assertThat(duplicateToDoItem.getDescription(), is(toDoItem.getDescription() + " - Copy"));
+ assertThat(duplicateToDoItem.getCategory(), is(toDoItem.getCategory()));
+ assertThat(duplicateToDoItem.getDueBy(), is(todaysDate));
+ assertThat(duplicateToDoItem.getCost(), is(new BigDecimal("987.65")));
+ }
+ }
+
+ public static class NotYetCompleted extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(false));
+ }
+
+ @Test
+ public void cannotUndoIfNotYetCompleted() throws Exception {
+
+ // given
+ assertThat(toDoItem.isComplete(), is(false));
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Not yet completed");
+ toDoItem.notYetCompleted();
+ }
+
+ /**
+ * Even though {@link dom.todo.ToDoItem#notYetCompleted()} is not annotated with
+ * {@link org.apache.isis.applib.annotation.ActionInteraction}, an event is still raised.
+ */
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ unwrap(toDoItem).setComplete(true);
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(unwrap(toDoItem).isComplete(), is(false));
+
+ // and then
+ final ActionDomainEvent<ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
+ assertThat(ev, is(not(nullValue())));
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("notYetCompleted"));
+ }
+ }
+ }
+
+ public static class Collections {
+
+ public static class Dependencies {
+ public static class Add extends ToDoItemIntegTest {
+
+ private ToDoItem otherToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ otherToDoItem = wrap(items.get(1));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ super.tearDown();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDependencies().size(), is(0));
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then
+ assertThat(toDoItem.getDependencies().size(), is(1));
+ assertThat(toDoItem.getDependencies().iterator().next(), is(unwrap(otherToDoItem)));
+ }
+
+
+ @Test
+ public void cannotDependOnSelf() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("Can't set up a dependency to self");
+
+ // when
+ toDoItem.add(toDoItem);
+ }
+
+ @Test
+ public void cannotAddIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ toDoItemSubscriptions.reset();
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then received events
+ @SuppressWarnings("unchecked")
+ final List<EventObject> receivedEvents = toDoItemSubscriptions.receivedEvents();
+
+ assertThat(receivedEvents.size(), is(7));
+ assertThat(receivedEvents.get(0) instanceof ActionDomainEvent, is(true)); // ToDoItem#add() executed
+ assertThat(receivedEvents.get(1) instanceof CollectionDomainEvent, is(true)); // ToDoItem#dependencies add, executed
+ assertThat(receivedEvents.get(2) instanceof CollectionDomainEvent, is(true)); // ToDoItem#dependencies add, executing
+ assertThat(receivedEvents.get(3) instanceof ActionDomainEvent, is(true)); // ToDoItem#add executing
+ assertThat(receivedEvents.get(4) instanceof ActionDomainEvent, is(true)); // ToDoItem#add validate
+ assertThat(receivedEvents.get(5) instanceof ActionDomainEvent, is(true)); // ToDoItem#add disable
+ assertThat(receivedEvents.get(6) instanceof ActionDomainEvent, is(true)); // ToDoItem#add hide
+
+ // inspect the collection interaction (posted programmatically in ToDoItem#add)
+ final CollectionDomainEvent<ToDoItem,ToDoItem> ciEv = (CollectionDomainEvent<ToDoItem, ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionDomainEvent.class);
+ assertThat(ciEv, is(notNullValue()));
+
+ assertThat(ciEv.getSource(), is(equalTo(unwrap(toDoItem))));
+ assertThat(ciEv.getIdentifier().getMemberName(), is("dependencies"));
+ assertThat(ciEv.getOf(), is(CollectionDomainEvent.Of.ADD_TO));
+ assertThat(ciEv.getValue(), is(unwrap(otherToDoItem)));
+
+ // inspect the action interaction (posted declaratively by framework)
+ final ActionDomainEvent<ToDoItem> aiEv = (ActionDomainEvent<ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
+ assertThat(aiEv, is(notNullValue()));
+
+ assertThat(aiEv.getSource(), is(equalTo(unwrap(toDoItem))));
+ assertThat(aiEv.getIdentifier().getMemberName(), is("add"));
+ assertThat(aiEv.getArguments().size(), is(1));
+ assertThat(aiEv.getArguments().get(0), is(unwrap((Object)otherToDoItem)));
+ assertThat(aiEv.getCommand(), is(notNullValue()));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+ }
+ public static class Remove extends ToDoItemIntegTest {
+
+ private ToDoItem otherToDoItem;
+ private ToDoItem yetAnotherToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ otherToDoItem = wrap(items.get(1));
+ yetAnotherToDoItem = wrap(items.get(2));
+
+ toDoItem.add(otherToDoItem);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ super.tearDown();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDependencies().size(), is(1));
+
+ // when
+ toDoItem.remove(otherToDoItem);
+
+ // then
+ assertThat(toDoItem.getDependencies().size(), is(0));
+ }
+
+
+ @Test
+ public void cannotRemoveItemIfNotADependency() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("Not a dependency");
+
+ // when
+ toDoItem.remove(yetAnotherToDoItem);
+ }
+
+ @Test
+ public void cannotRemoveDependencyIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+ }
+ }
+
+ }
+
+ public static class Properties {
+
+ public static class Attachment extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ byte[] bytes = "{\"foo\": \"bar\"}".getBytes(Charset.forName("UTF-8"));
+ final Blob newAttachment = new Blob("myfile.json", new MimeType("application/json"), bytes);
+
+ // when
+ toDoItem.setAttachment(newAttachment);
+
+ // then
+ assertThat(toDoItem.getAttachment(), is(newAttachment));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setAttachment((Blob)null);
+
+ // then
+ assertThat(toDoItem.getAttachment(), is((Blob)null));
+ }
+ }
+
+ public static class Category extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setCategory(ToDoItem.Category.Professional);
+ }
+ }
+
+ public static class Cost extends ToDoItemIntegTest {
+
+ private BigDecimal cost;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ cost = toDoItem.getCost();
+ }
+
+ @Test
+ public void happyCaseUsingProperty() throws Exception {
+
+ final BigDecimal newCost = new BigDecimal("123.45");
+
+ // when
+ toDoItem.updateCost(newCost);
+
+ // then
+ assertThat(toDoItem.getCost(), is(newCost));
+ }
+
+ @Test
+ public void happyCaseUsingAction() throws Exception {
+
+ final BigDecimal newCost = new BigDecimal("123.45");
+
+ // when
+ toDoItem.updateCost(newCost);
+
+ // then
+ assertThat(toDoItem.getCost(), is(newCost));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.updateCost((BigDecimal)null);
+
+ // then
+ assertThat(toDoItem.getCost(), is((BigDecimal)null));
+ }
+
+ @Test
+ public void defaultForAction() throws Exception {
+
+ // then
+ assertThat(unwrap(toDoItem).default0UpdateCost(), is(cost));
+ }
+
+ }
+
+ public static class Description extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread and butter"));
+ }
+
+
+ @Test
+ public void failsRegex() throws Exception {
+
+ // when
+ expectedExceptions.expectMessage("Doesn't match pattern");
+ toDoItem.setDescription("exclamation marks are not allowed!!!");
+ }
+
+ @Test
+ public void cannotBeNull() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Mandatory");
+ toDoItem.setDescription(null);
+ }
+
+ @Test
+ public void cannotUseModify() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.modifyDescription("Buy bread and butter");
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+ @Test
+ public void cannotUseClear() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.clearDescription();
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+
+ @Test
+ public void onlyJustShortEnough() throws Exception {
+
+ // when, then
+ toDoItem.setDescription(characters(100));
+ }
+
+ @Test
+ public void tooLong() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
+
+ // when
+ toDoItem.setDescription(characters(101));
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then published and received
+ @SuppressWarnings("unchecked")
+ final PropertyDomainEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.class);
+ assertThat(ev, is(not(nullValue())));
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("description"));
+ assertThat(ev.getOldValue(), is("Buy bread"));
+ assertThat(ev.getNewValue(), is("Buy bread and butter"));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ private static String characters(final int n) {
+ StringBuffer buf = new StringBuffer();
+ for(int i=0; i<n; i++) {
+ buf.append("a");
+ }
+ return buf.toString();
+ }
+ }
+
+ public static class DueBy extends ToDoItemIntegTest {
+
+ @Inject
+ private ClockService clockService;
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ final LocalDate fiveDaysFromNow = clockService.now().plusDays(5);
+ toDoItem.setDueBy(fiveDaysFromNow);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is(fiveDaysFromNow));
+ }
+
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setDueBy((LocalDate)null);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is((LocalDate)null));
+ }
+
+ @Test
+ public void canBeUpToSixDaysInPast() throws Exception {
+
+ final LocalDate nowAsLocalDate = clockService.now();
+ final LocalDate sixDaysAgo = nowAsLocalDate.plusDays(-5);
+
+ // when
+ toDoItem.setDueBy(sixDaysAgo);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is(sixDaysAgo));
+ }
+
+
+ @Test
+ public void cannotBeMoreThanSixDaysInPast() throws Exception {
+
+ final LocalDate sevenDaysAgo = Clock.getTimeAsLocalDate().plusDays(-7);
+
+ // when, then
+ expectedExceptions.expectMessage("Due by date cannot be more than one week old");
+ toDoItem.setDueBy(sevenDaysAgo);
+ }
+ }
+
+ public static class Notes extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ final String newNotes = "Lorem ipsum yada yada";
+
+ // when
+ toDoItem.setNotes(newNotes);
+
+ // then
+ assertThat(toDoItem.getNotes(), is(newNotes));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setNotes((String)null);
+
+ // then
+ assertThat(toDoItem.getNotes(), is((String)null));
+ }
+
+ @Test
+ public void suscriberReceivedDefaultEvent() throws Exception {
+
+ final String newNotes = "Lorem ipsum yada yada";
+
+ // when
+ toDoItem.setNotes(newNotes);
+
+ // then
+ assertThat(unwrap(toDoItem).getNotes(), is(newNotes));
+
+ // and then receive the default event.
+ @SuppressWarnings("unchecked")
+ final PropertyDomainEvent.Default ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.Default.class);
+ assertThat(ev, is(notNullValue()));
+
+ assertThat(ev.getSource(), is((Object)unwrap(toDoItem)));
+ assertThat(ev.getNewValue(), is((Object)newNotes));
+ }
+
+
+ }
+
+ public static class OwnedBy extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Reason: Hidden on Everywhere. Identifier: dom.todo.ToDoItem#ownedBy()");
+ toDoItem.setOwnedBy("other");
+ }
+
+
+ }
+
+ public static class Subcategory extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setSubcategory(ToDoItem.Subcategory.Chores);
+ }
+ }
+
+ }
+
+
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
new file mode 100644
index 0000000..2c06dc0
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
@@ -0,0 +1,132 @@
+/*
+ * 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 integration.tests;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemsIntegTest extends AbstractToDoIntegTest {
+
+ @Inject
+ FixtureScripts fixtureScripts;
+ @Inject
+ ToDoItems toDoItems;
+
+ public static class Finders extends ToDoItemsIntegTest {
+
+ ToDoItemsIntegTestFixture fixture;
+
+ @Before
+ public void setUpData() throws Exception {
+ // executing the fixtures directly allows us to look up the results later.
+ fixtureScripts.runFixtureScript(fixture = new ToDoItemsIntegTestFixture(), null);
+ }
+
+ private int notYetCompletedSize;
+ private int completedSize;
+
+ @Before
+ public void setUp() throws Exception {
+
+ // could use fixture#lookup(...), but can also just search directly.
+ final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
+ final List<ToDoItem> completedItems = wrap(toDoItems).complete();
+
+ notYetCompletedSize = notYetCompleteItems.size();
+ completedSize = completedItems.size();
+
+ assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
+ }
+
+ @Test
+ public void complete_and_notYetComplete() throws Exception {
+
+ // given
+ List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
+ final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
+ nextTransaction();
+
+ // when
+ toDoItem.completed();
+ nextTransaction();
+
+ // then
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize-1));
+ assertThat(wrap(toDoItems).complete().size(), is(completedSize+1));
+ nextTransaction();
+
+ // and when
+ toDoItem.notYetCompleted();
+ nextTransaction();
+
+ // then
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize));
+ assertThat(wrap(toDoItems).complete().size(), is(completedSize));
+ }
+ }
+
+ public static class NewToDo_and_Delete extends ToDoItemsIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ // none
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ int size = wrap(toDoItems).notYetComplete().size();
+ nextTransaction();
+
+ // when
+ final ToDoItem newToDo = toDoItems.newToDo("new todo", ToDoItem.Category.Professional, ToDoItem.Subcategory.OpenSource, null, null);
+ nextTransaction();
+
+ // then
+ assertThat(newToDo.getDescription(), is("new todo"));
+ assertThat(newToDo.getCategory(), is(ToDoItem.Category.Professional));
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(size+1));
+ assertThat(container().isPersistent(newToDo), is(true));
+ assertThat(container().isPersistent(wrap(newToDo)), is(true));
+
+ nextTransaction();
+
+ // when
+ newToDo.delete();
+ nextTransaction();
+
+ // then
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(size));
+ }
+
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/pom.xml b/mothballed/example/application/todoapp/pom.xml
new file mode 100644
index 0000000..c47dc8e
--- /dev/null
+++ b/mothballed/example/application/todoapp/pom.xml
@@ -0,0 +1,378 @@
+<?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>
+
+ <groupId>org.apache.isis.example.application</groupId>
+ <artifactId>todoapp</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+
+ <name>ToDo App</name>
+
+ <packaging>pom</packaging>
+
+ <prerequisites>
+ <maven>3.0.4</maven>
+ </prerequisites>
+
+ <properties>
+ <isis.version>1.8.0-SNAPSHOT</isis.version>
+ <isis-viewer-wicket.version>1.8.0-SNAPSHOT</isis-viewer-wicket.version>
+
+ <!-- must be consistent with the versions defined by the JDO Objectstore -->
+ <datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
+ <datanucleus-maven-plugin.version>3.3.2</datanucleus-maven-plugin.version>
+
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshots</name>
+ <url>https://repository.apache.org/content/repositories/snapshots/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>Cloudbees snapshots</id>
+ <url>http://repository-estatio.forge.cloudbees.com/snapshot/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ <executions>
+ <execution>
+ <id>source</id>
+ <phase>compile</phase>
+ </execution>
+ <execution>
+ <id>test</id>
+ <phase>test-compile</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ <include>**/*Test$*.java</include>
+ <include>**/*Test_*.java</include>
+ <include>**/*Spec*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Test*.java</exclude>
+ <exclude>**/*ForTesting.java</exclude>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ <useFile>true</useFile>
+ <printSummary>true</printSummary>
+ <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ <include>**/*Test$*.java</include>
+ <include>**/*Test_*.java</include>
+ <include>**/*Spec*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Test*.java</exclude>
+ <exclude>**/*ForTesting.java</exclude>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ <showSuccess>false</showSuccess>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.5.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.3</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.26</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- http://simplericity.com/2009/11/10/1257880778509.html -->
+ <plugin>
+ <groupId>org.simplericity.jettyconsole</groupId>
+ <artifactId>jetty-console-maven-plugin</artifactId>
+ <!-- update to 1.54 reversed,since seems compiled against 1.7 (major.minor version 51.0) -->
+ <version>1.43</version>
+ </plugin>
+
+ <!-- Apache Release Audit Tool -->
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.10</version>
+ <configuration>
+ <addDefaultLicenseMatchers>true</addDefaultLicenseMatchers>
+ <excludeSubProjects>true</excludeSubProjects>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ <exclude>**/target-ide/**</exclude>
+
+ <exclude>**/*.project</exclude>
+ <exclude>**/.classpath</exclude>
+ <exclude>**/.settings/**</exclude>
+ <exclude>**/*.launch</exclude>
+ <exclude>**/ide/eclipse/launch/**</exclude>
+ <exclude>**/ide/intellij/launch/**</exclude>
+ <exclude>src/site/resources/ide/eclipse/**</exclude>
+
+ <exclude>**/rebel.xml</exclude>
+ <exclude>**/*.gitignore</exclude>
+ <exclude>**/*.log</exclude>
+ <exclude>**/*.pdn</exclude>
+ <exclude>**/*.svg</exclude>
+ <exclude>**/*.json</exclude>
+ <exclude>**/*.min.js</exclude>
+ <exclude>**/*.js</exclude>
+ </excludes>
+ <licenses>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>AL2</licenseFamilyCategory>
+ <licenseFamilyName>Apache License 2.0</licenseFamilyName>
+ <notes/>
+ <patterns>
+ <pattern>Licensed to the Apache Software Foundation (ASF) under one</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>JQRY</licenseFamilyCategory>
+ <licenseFamilyName>MIT</licenseFamilyName>
+ <notes/>
+ <patterns>
+ <pattern>Dual licensed under the MIT or GPL Version 2 licenses.</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>JMOCK</licenseFamilyCategory>
+ <licenseFamilyName>JMock</licenseFamilyName>
+ <notes/>
+ <patterns>
+ <pattern>Copyright (c) 2000-2007, jMock.org</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>DOCBK</licenseFamilyCategory>
+ <licenseFamilyName>DocBook 4.5</licenseFamilyName>
+ <notes/>
+ <patterns>
+ <pattern>Permission to copy in any form is granted for use</pattern>
+ <pattern>Permission to use, copy, modify and distribute the DocBook DTD</pattern>
+ <pattern>is hereby granted in perpetuity, provided that the above copyright
+ </pattern>
+ <pattern>This is the catalog data file for DocBook XML V4.5. It is provided as
+ </pattern>
+ <pattern>XML Catalog data for DocBook XML V4.5</pattern>
+ <pattern>DocBook additional general entities V4.5</pattern>
+ <pattern>XML EXCHANGE TABLE MODEL DECLARATION MODULE</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>W3C</licenseFamilyCategory>
+ <licenseFamilyName>XHTML</licenseFamilyName>
+ <notes/>
+ <patterns>
+ <pattern>Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),</pattern>
+ </patterns>
+ </license>
+ </licenses>
+ <licenseFamilies>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>Apache License 2.0</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>MIT</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>JMock</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>DocBook 4.5</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>XHTML</familyName>
+ </licenseFamily>
+ </licenseFamilies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <modules>
+ <module>dom</module>
+ <module>fixture</module>
+ <module>integtests</module>
+ <module>webapp</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis</artifactId>
+ <version>${isis.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.viewer</groupId>
+ <artifactId>isis-viewer-wicket</artifactId>
+ <version>${isis-viewer-wicket.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+
+ <!-- this project's own modules -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>todoapp-dom</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>todoapp-fixture</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>todoapp-webapp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ </dependencies>
+ </dependencyManagement>
+
+
+ <profiles>
+ <profile>
+ <id>m2e</id>
+ <activation>
+ <property>
+ <name>m2e.version</name>
+ </property>
+ </activation>
+ <build>
+ <directory>target-ide</directory>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
new file mode 100644
index 0000000..14ac1bf
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 --type SERVER_PROTOTYPE"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="${jrebel_args} -Drebel.log=false -Drebel.check_class_hash=true -Drebel.packages_exclude=org.apache.isis -Dproject.root=${project_loc}/.. -Dtarget.dir=target-ide -Drebel.plugins=C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar -Disis-jrebel-plugin.packagePrefix=dom.todo,org.apache.isis.objectstore.jdo.applib -Disis-jrebel-plugin.loggingLevel=warn -XX:MaxPermSize=128m"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
new file mode 100644
index 0000000..2e272aa
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 -D isis.persistor.datanucleus.install-fixtures=true --type SERVER_PROTOTYPE"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
+</launchConfiguration>
[05/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
new file mode 100644
index 0000000..0c2b1c8
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
@@ -0,0 +1,260 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dom.todo;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+import java.math.BigDecimal;
+import java.util.List;
+import com.google.common.base.Predicates;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.query.QueryDefault;
+import org.apache.isis.applib.services.clock.ClockService;
+
+@DomainServiceLayout(named="ToDos", menuOrder = "10")
+@DomainService(repositoryFor = ToDoItem.class)
+public class ToDoItems {
+
+ //region > notYetComplete (action)
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(
+ cssClassFa = "fa fa-thumbs-down",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @MemberOrder(sequence = "10")
+ public List<ToDoItem> notYetComplete() {
+ final List<ToDoItem> items = notYetCompleteNoUi();
+ if(items.isEmpty()) {
+ container.informUser("All to-do items have been completed :-)");
+ }
+ return items;
+ }
+
+ @Programmatic
+ public List<ToDoItem> notYetCompleteNoUi() {
+ return container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedByAndCompleteIsFalse",
+ "ownedBy", currentUserName()));
+ }
+ //endregion
+
+ //region > complete (action)
+ @ActionLayout(
+ cssClassFa = "fa fa-thumbs-up"
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ @MemberOrder(sequence = "20")
+ public List<ToDoItem> complete() {
+ final List<ToDoItem> items = completeNoUi();
+ if(items.isEmpty()) {
+ container.informUser("No to-do items have yet been completed :-(");
+ }
+ return items;
+ }
+
+ @Programmatic
+ public List<ToDoItem> completeNoUi() {
+ return container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedByAndCompleteIsTrue",
+ "ownedBy", currentUserName()));
+ }
+ //endregion
+
+ //region > categorized (action)
+ @SuppressWarnings("unchecked")
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(
+ cssClassFa = "fa fa-question",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @MemberOrder(sequence = "40")
+ public List<ToDoItem> categorized(
+ @ParameterLayout(named="Category") final Category category,
+ @ParameterLayout(named="Subcategory") final Subcategory subcategory,
+ @ParameterLayout(named="Completed?") final boolean completed) {
+ // an example "naive" implementation (filtered in Java code, not DBMS)
+ return container.allMatches(ToDoItem.class,
+ Predicates.and(
+ ToDoItem.Predicates.thoseOwnedBy(currentUserName()),
+ ToDoItem.Predicates.thoseCompleted(completed),
+ ToDoItem.Predicates.thoseCategorised(category, subcategory)));
+ }
+ public Category default0Categorized() {
+ return Category.Professional;
+ }
+ public Subcategory default1Categorized() {
+ return default0Categorized().subcategories().get(0);
+ }
+ public boolean default2Categorized() {
+ return false;
+ }
+ public List<Subcategory> choices1Categorized(
+ final Category category) {
+ return Subcategory.listFor(category);
+ }
+ public String validateCategorized(
+ final Category category,
+ final Subcategory subcategory,
+ final boolean completed) {
+ return Subcategory.validate(category, subcategory);
+ }
+ //endregion
+
+ //region > newToDo (action)
+ @ActionLayout(cssClassFa = "fa fa-plus")
+ @MemberOrder(sequence = "5")
+ public ToDoItem newToDo(
+ @Parameter(regexPattern = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*")
+ @ParameterLayout(named="Description")
+ final String description,
+ @ParameterLayout(named="Category")
+ final Category category,
+ @Parameter(optional = Optionality.TRUE)
+ @ParameterLayout(named="Subcategory")
+ final Subcategory subcategory,
+ @Parameter(optional = Optionality.TRUE)
+ @ParameterLayout(named="Due by")
+ final LocalDate dueBy,
+ @Parameter(optional = Optionality.TRUE)
+ @ParameterLayout(named="Cost")
+ final BigDecimal cost) {
+ return newToDo(description, category, subcategory, currentUserName(), dueBy, cost);
+ }
+ public Category default1NewToDo() {
+ return Category.Professional;
+ }
+ public Subcategory default2NewToDo() {
+ return Category.Professional.subcategories().get(0);
+ }
+ public LocalDate default3NewToDo() {
+ return clockService.now().plusDays(14);
+ }
+ public List<Subcategory> choices2NewToDo(
+ final String description, final Category category) {
+ return Subcategory.listFor(category);
+ }
+ public String validateNewToDo(
+ final String description,
+ final Category category, final Subcategory subcategory,
+ final LocalDate dueBy, final BigDecimal cost) {
+ return Subcategory.validate(category, subcategory);
+ }
+ //endregion
+
+ //region > allToDos (action)
+ @ActionLayout(
+ cssClassFa = "fa fa-globe"
+ )
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @MemberOrder(sequence = "50")
+ public List<ToDoItem> allToDos() {
+ final List<ToDoItem> items = container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedBy",
+ "ownedBy", currentUserName()));
+ if(items.isEmpty()) {
+ container.warnUser("No to-do items found.");
+ }
+ return items;
+ }
+ //endregion
+
+ //region > autoComplete (programmatic)
+ @Programmatic // not part of metamodel
+ public List<ToDoItem> autoComplete(final String description) {
+ return container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedByAndDescriptionContains",
+ "ownedBy", currentUserName(),
+ "description", description));
+ }
+ //endregion
+
+ //region > helpers
+ @Programmatic // for use by fixtures
+ public ToDoItem newToDo(
+ final String description,
+ final Category category,
+ final Subcategory subcategory,
+ final String userName,
+ final LocalDate dueBy, final BigDecimal cost) {
+ final ToDoItem toDoItem = container.newTransientInstance(ToDoItem.class);
+ toDoItem.setDescription(description);
+ toDoItem.setCategory(category);
+ toDoItem.setSubcategory(subcategory);
+ toDoItem.setOwnedBy(userName);
+ toDoItem.setDueBy(dueBy);
+ toDoItem.setCost(cost);
+
+ container.persist(toDoItem);
+ container.flush();
+
+ return toDoItem;
+ }
+
+ private String currentUserName() {
+ return container.getUser().getName();
+ }
+
+ //endregion
+
+ //region > common validation
+ private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
+
+ @Programmatic
+ public String validateDueBy(final LocalDate dueBy) {
+ return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
+ }
+ @Programmatic
+ boolean isMoreThanOneWeekInPast(final LocalDate dueBy) {
+ return dueBy.toDateTimeAtStartOfDay().getMillis() < clockService.nowAsMillis() - ONE_WEEK_IN_MILLIS;
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+
+ @javax.inject.Inject
+ private ClockService clockService;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
new file mode 100644
index 0000000..cd23b44
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
@@ -0,0 +1,136 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package 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.services.actinvoc.ActionInvocationContext;
+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;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public abstract class ToDoItemTest {
+
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+ @Mock
+ EventBusService eventBusService;
+
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ toDoItem = new ToDoItem();
+
+ toDoItem.actionInvocationContext = ActionInvocationContext.onObject(toDoItem);
+ toDoItem.eventBusService = eventBusService;
+
+ context.ignoring(eventBusService);
+ }
+
+ public static class Properties 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 {
+
+ // given
+ toDoItem.setComplete(false);
+ assertThat(toDoItem.disableCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(true));
+ assertThat(toDoItem.disableCompleted(), is(not(nullValue())));
+ }
+ }
+
+ public static class NotYetCompleted extends Actions {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ toDoItem.setComplete(true);
+ assertThat(toDoItem.disableNotYetCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(false));
+ assertThat(toDoItem.disableNotYetCompleted(), is(not(nullValue())));
+ }
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
new file mode 100644
index 0000000..478ac42
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
@@ -0,0 +1,38 @@
+<?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>${groupId}</groupId>
+ <artifactId>${rootArtifactId}</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <artifactId>${artifactId}</artifactId>
+ <name>ToDo App Fixtures</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-dom</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
new file mode 100644
index 0000000..d56a515
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
@@ -0,0 +1,100 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo;
+
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import java.util.List;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.fixturescripts.FixtureResult;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+
+/**
+ * Enables fixtures to be installed from the application.
+ */
+@DomainService
+@DomainServiceLayout(
+ named = "Prototyping",
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ menuOrder = "10")
+public class ToDoItemsFixturesService extends FixtureScripts {
+
+ public ToDoItemsFixturesService() {
+ super("fixture.todo");
+ }
+
+ @ActionLayout(
+ cssClassFa="fa fa-bolt"
+ )
+ @Action(
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @Override
+ public List<FixtureResult> runFixtureScript(
+ final FixtureScript fixtureScript,
+ @ParameterLayout(
+ named="Parameters",
+ describedAs = "Script-specific parameters (key=value) ",
+ multiLine = 10)
+ @Parameter(optional = Optionality.TRUE)
+ final String parameters) {
+ return super.runFixtureScript(fixtureScript, parameters);
+ }
+
+ @Override
+ public FixtureScript default0RunFixtureScript() {
+ return findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class);
+ }
+
+ /**
+ * Raising visibility to <tt>public</tt> so that choices are available for first param
+ * of {@link ${symbol_pound}runFixtureScript(FixtureScript, String)}.
+ */
+ @Override
+ public List<FixtureScript> choices0RunFixtureScript() {
+ return super.choices0RunFixtureScript();
+ }
+
+ // //////////////////////////////////////
+
+
+ @ActionLayout(
+ cssClassFa="fa fa-list"
+ )
+ @Action(
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @MemberOrder(sequence="20")
+ public Object recreateToDoItemsReturnFirst() {
+ final List<FixtureResult> run = findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class).run(null);
+ return run.get(0).getObject();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
new file mode 100644
index 0000000..eb2c28f
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
@@ -0,0 +1,43 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package fixture.todo.integtests;
+
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Refactored to reuse the newer {@link FixtureScript} API.
+ */
+public class ToDoItemsIntegTestFixture extends FixtureScript {
+
+ public ToDoItemsIntegTestFixture() {
+ super(null, "integ-test");
+ }
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ executionContext.executeChild(this, new ToDoItemsRecreateAndCompleteSeveral());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
new file mode 100644
index 0000000..b1ffcd1
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
@@ -0,0 +1,55 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.actions.complete;
+
+import dom.todo.ToDoItem;
+
+import java.util.Collection;
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+public abstract class ToDoItemCompleteAbstract extends FixtureScript {
+
+ /**
+ * Looks up item from repository, and completes.
+ */
+ protected void complete(final String description, final ExecutionContext executionContext) {
+ String ownedBy = executionContext.getParameter("ownedBy");
+ final ToDoItem toDoItem = findToDoItem(description, ownedBy);
+ toDoItem.setComplete(true);
+ executionContext.addResult(this, toDoItem);
+ }
+
+ private ToDoItem findToDoItem(final String description, final String ownedBy) {
+ final Collection<ToDoItem> filtered = Collections2.filter(getContainer().allInstances(ToDoItem.class), new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(ToDoItem input) {
+ return Objects.equal(description, input.getDescription()) &&
+ Objects.equal(ownedBy, input.getOwnedBy());
+ }
+ });
+ return filtered.isEmpty()? null: filtered.iterator().next();
+ }
+ //endregion
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
new file mode 100644
index 0000000..3a5d149
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
@@ -0,0 +1,33 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.actions.complete;
+
+import fixture.todo.items.create.ToDoItemForBuyStamps;
+
+public class ToDoItemCompleteForBuyStamps extends ToDoItemCompleteAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ complete(ToDoItemForBuyStamps.DESCRIPTION, executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
new file mode 100644
index 0000000..14e417f
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
@@ -0,0 +1,34 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.actions.complete;
+
+import fixture.todo.items.create.ToDoItemForWriteBlogPost;
+
+public class ToDoItemCompleteForWriteBlogPost extends ToDoItemCompleteAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ complete(ToDoItemForWriteBlogPost.DESCRIPTION, executionContext);
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
new file mode 100644
index 0000000..305cef7
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
@@ -0,0 +1,72 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+import dom.todo.ToDoItems;
+
+import java.math.BigDecimal;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.services.clock.ClockService;
+
+public abstract class ToDoItemAbstract extends FixtureScript {
+
+ protected ToDoItem createToDoItem(
+ final String description,
+ final Category category, final Subcategory subcategory,
+ final LocalDate dueBy,
+ final BigDecimal cost,
+ final ExecutionContext executionContext) {
+
+ // validate parameters
+ final String ownedBy = executionContext.getParameter("ownedBy");
+ if(ownedBy == null) {
+ throw new IllegalArgumentException("'ownedBy' must be specified");
+ }
+
+ // execute
+ ToDoItem newToDo = toDoItems.newToDo(
+ description, category, subcategory, ownedBy, dueBy, cost);
+ return executionContext.addResult(this, newToDo);
+ }
+
+ protected LocalDate nowPlusDays(int days) {
+ return clockService.now().plusDays(days);
+ }
+
+ protected BigDecimal BD(String str) {
+ return new BigDecimal(str);
+ }
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ protected ClockService clockService;
+ //endregion
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
new file mode 100644
index 0000000..f13fe6f
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForBuyBread extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Buy bread",
+ Category.Domestic, Subcategory.Shopping,
+ nowPlusDays(0),
+ BD("1.75"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
new file mode 100644
index 0000000..d7140fb
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForBuyMilk extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Buy milk",
+ Category.Domestic, Subcategory.Shopping,
+ nowPlusDays(0),
+ BD("0.75"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
new file mode 100644
index 0000000..a5f760b
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
@@ -0,0 +1,42 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForBuyStamps extends ToDoItemAbstract {
+
+ public static final String DESCRIPTION = "Buy stamps";
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ DESCRIPTION,
+ Category.Domestic, Subcategory.Shopping,
+ nowPlusDays(0),
+ BD("10.00"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
new file mode 100644
index 0000000..c13606b
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForMowLawn extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Mow lawn",
+ Category.Domestic, Subcategory.Garden,
+ nowPlusDays(6),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
new file mode 100644
index 0000000..0df57a4
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForOrganizeBrownBag extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Organize brown bag",
+ Category.Professional, Subcategory.Consulting,
+ nowPlusDays(14),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
new file mode 100644
index 0000000..74ba550
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForPickUpLaundry extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Pick up laundry",
+ Category.Domestic, Subcategory.Chores,
+ nowPlusDays(6),
+ BD("7.50"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
new file mode 100644
index 0000000..191d941
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForSharpenKnives extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Sharpen knives",
+ Category.Domestic, Subcategory.Chores,
+ nowPlusDays(14),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
new file mode 100644
index 0000000..c3a1633
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForStageIsisRelease extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Stage Isis release",
+ Category.Professional, Subcategory.OpenSource,
+ null,
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
new file mode 100644
index 0000000..5c84305
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForSubmitConferenceSession extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Submit conference session",
+ Category.Professional, Subcategory.Education,
+ nowPlusDays(21),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
new file mode 100644
index 0000000..87efcc0
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForVacuumHouse extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Vacuum house",
+ Category.Domestic, Subcategory.Housework,
+ nowPlusDays(3),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
new file mode 100644
index 0000000..48154e0
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
@@ -0,0 +1,42 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForWriteBlogPost extends ToDoItemAbstract {
+
+ public static final String DESCRIPTION = "Write blog post";
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ DESCRIPTION,
+ Category.Professional, Subcategory.Marketing,
+ nowPlusDays(7),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
new file mode 100644
index 0000000..96c5b53
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForWriteToPenPal extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Write to penpal",
+ Category.Other, Subcategory.Other,
+ null,
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
new file mode 100644
index 0000000..429d596
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
@@ -0,0 +1,41 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.items.delete;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
+
+public class ToDoItemsDelete extends FixtureScript {
+
+ //region > execute
+ protected void execute(ExecutionContext executionContext) {
+ final String ownedBy = executionContext.getParameter("ownedBy");
+ isisJdoSupport.executeUpdate("delete from ${symbol_escape}"ToDoItem${symbol_escape}" where ${symbol_escape}"ownedBy${symbol_escape}" = '" + ownedBy + "'");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private IsisJdoSupport isisJdoSupport;
+ //endregion
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
new file mode 100644
index 0000000..a1bb33f
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
@@ -0,0 +1,84 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.scenarios;
+
+import fixture.todo.items.delete.ToDoItemsDelete;
+import fixture.todo.items.create.ToDoItemForBuyBread;
+import fixture.todo.items.create.ToDoItemForBuyMilk;
+import fixture.todo.items.create.ToDoItemForBuyStamps;
+import fixture.todo.items.create.ToDoItemForMowLawn;
+import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
+import fixture.todo.items.create.ToDoItemForPickUpLaundry;
+import fixture.todo.items.create.ToDoItemForSharpenKnives;
+import fixture.todo.items.create.ToDoItemForStageIsisRelease;
+import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
+import fixture.todo.items.create.ToDoItemForVacuumHouse;
+import fixture.todo.items.create.ToDoItemForWriteBlogPost;
+import fixture.todo.items.create.ToDoItemForWriteToPenPal;
+import fixture.todo.util.Util;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+public class ToDoItemsRecreate extends FixtureScript {
+
+ public ToDoItemsRecreate() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+ }
+
+ //region > ownedBy (optional)
+ private String ownedBy;
+
+ public String getOwnedBy() {
+ return ownedBy;
+ }
+
+ public void setOwnedBy(String ownedBy) {
+ this.ownedBy = ownedBy;
+ }
+ //endregion
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ // defaults
+ executionContext.setParameterIfNotPresent(
+ "ownedBy",
+ Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
+
+ // prereqs
+ executionContext.executeChild(this, new ToDoItemsDelete());
+
+ // create items
+ executionContext.executeChild(this, new ToDoItemForBuyMilk());
+ executionContext.executeChild(this, new ToDoItemForBuyBread());
+ executionContext.executeChild(this, new ToDoItemForBuyStamps());
+ executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
+ executionContext.executeChild(this, new ToDoItemForMowLawn());
+ executionContext.executeChild(this, new ToDoItemForVacuumHouse());
+ executionContext.executeChild(this, new ToDoItemForSharpenKnives());
+ executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
+ executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
+ executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
+ executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
+ executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
new file mode 100644
index 0000000..3d790b7
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
@@ -0,0 +1,89 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.scenarios;
+
+import fixture.todo.items.actions.complete.ToDoItemCompleteForBuyStamps;
+import fixture.todo.items.actions.complete.ToDoItemCompleteForWriteBlogPost;
+import fixture.todo.items.create.ToDoItemForBuyBread;
+import fixture.todo.items.create.ToDoItemForBuyMilk;
+import fixture.todo.items.create.ToDoItemForBuyStamps;
+import fixture.todo.items.create.ToDoItemForMowLawn;
+import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
+import fixture.todo.items.create.ToDoItemForPickUpLaundry;
+import fixture.todo.items.create.ToDoItemForSharpenKnives;
+import fixture.todo.items.create.ToDoItemForStageIsisRelease;
+import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
+import fixture.todo.items.create.ToDoItemForVacuumHouse;
+import fixture.todo.items.create.ToDoItemForWriteBlogPost;
+import fixture.todo.items.create.ToDoItemForWriteToPenPal;
+import fixture.todo.items.delete.ToDoItemsDelete;
+import fixture.todo.util.Util;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+public class ToDoItemsRecreateAndCompleteSeveral extends FixtureScript {
+
+ public ToDoItemsRecreateAndCompleteSeveral() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+ }
+
+ //region > ownedBy (optional)
+ private String ownedBy;
+
+ public String getOwnedBy() {
+ return ownedBy;
+ }
+
+ public void setOwnedBy(String ownedBy) {
+ this.ownedBy = ownedBy;
+ }
+ //endregion
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ // defaults
+ executionContext.setParameterIfNotPresent(
+ "ownedBy",
+ Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
+
+ executionContext.executeChild(this, new ToDoItemsDelete());
+
+ // create items
+ executionContext.executeChild(this, new ToDoItemForBuyMilk());
+ executionContext.executeChild(this, new ToDoItemForBuyBread());
+ executionContext.executeChild(this, new ToDoItemForBuyStamps());
+ executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
+ executionContext.executeChild(this, new ToDoItemForMowLawn());
+ executionContext.executeChild(this, new ToDoItemForVacuumHouse());
+ executionContext.executeChild(this, new ToDoItemForSharpenKnives());
+ executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
+ executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
+ executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
+ executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
+ executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
+
+ // this fixture
+ executionContext.executeChild(this, new ToDoItemCompleteForBuyStamps());
+ executionContext.executeChild(this, new ToDoItemCompleteForWriteBlogPost());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
new file mode 100644
index 0000000..82d1a4e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
@@ -0,0 +1,31 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.scenarios;
+
+public final class ToDoItemsRecreateAndCompleteSeveralForDick extends ToDoItemsRecreateAndCompleteSeveral {
+
+ public ToDoItemsRecreateAndCompleteSeveralForDick() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+
+ setOwnedBy("dick");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
new file mode 100644
index 0000000..e2cfc0e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
@@ -0,0 +1,31 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.scenarios;
+
+public final class ToDoItemsRecreateAndCompleteSeveralForJoe extends ToDoItemsRecreateAndCompleteSeveral {
+
+ public ToDoItemsRecreateAndCompleteSeveralForJoe() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+
+ setOwnedBy("joe");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
new file mode 100644
index 0000000..bf58168
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
@@ -0,0 +1,32 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.scenarios;
+
+public final class ToDoItemsRecreateForSven extends ToDoItemsRecreate {
+
+ public ToDoItemsRecreateForSven() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+
+ setOwnedBy("sven");
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java
new file mode 100644
index 0000000..7a0ae71
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java
@@ -0,0 +1,35 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package fixture.todo.util;
+
+public final class Util {
+
+ private Util(){}
+
+ public static String coalesce(final String... strings) {
+ for (String str : strings) {
+ if(str != null) { return str; }
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties
new file mode 100644
index 0000000..f49afbf
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties
@@ -0,0 +1,104 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+
+${symbol_pound}
+${symbol_pound} Isis uses log4j is used to provide system logging
+${symbol_pound}
+log4j.rootCategory=INFO, Console
+
+${symbol_pound} The console appender
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.target=System.out
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
+
+log4j.appender.File=org.apache.log4j.RollingFileAppender
+log4j.appender.File.file=isis.log
+log4j.appender.File.append=false
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+
+! turn on the internal log4j debugging flag so we can see what it is doing
+${symbol_pound}log4j.debug=true
+
+${symbol_pound} DataNucleus
+${symbol_pound} the first two log the DML and DDL (if set to DEBUG)
+log4j.logger.DataNucleus.Datastore.Native=WARN, Console
+log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
+${symbol_pound} the remainder can probably be left to WARN
+log4j.logger.DataNucleus.Persistence=WARN, Console
+log4j.logger.DataNucleus.Transaction=WARN, Console
+log4j.logger.DataNucleus.Connection=WARN, Console
+log4j.logger.DataNucleus.Query=WARN, Console
+log4j.logger.DataNucleus.Cache=WARN, Console
+log4j.logger.DataNucleus.MetaData=WARN, Console
+log4j.logger.DataNucleus.Datastore=WARN, Console
+log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
+log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
+log4j.logger.DataNucleus.General=WARN, Console
+log4j.logger.DataNucleus.Lifecycle=WARN, Console
+log4j.logger.DataNucleus.ValueGeneration=WARN, Console
+log4j.logger.DataNucleus.Enhancer=WARN, Console
+log4j.logger.DataNucleus.SchemaTool=ERROR, Console
+log4j.logger.DataNucleus.JDO=WARN, Console
+log4j.logger.DataNucleus.JPA=ERROR, Console
+log4j.logger.DataNucleus.JCA=WARN, Console
+log4j.logger.DataNucleus.IDE=ERROR, Console
+
+log4j.additivity.DataNucleus.Datastore.Native=false
+log4j.additivity.DataNucleus.Datastore.Schema=false
+log4j.additivity.DataNucleus.Datastore.Persistence=false
+log4j.additivity.DataNucleus.Datastore.Transaction=false
+log4j.additivity.DataNucleus.Datastore.Connection=false
+log4j.additivity.DataNucleus.Datastore.Query=false
+log4j.additivity.DataNucleus.Datastore.Cache=false
+log4j.additivity.DataNucleus.Datastore.MetaData=false
+log4j.additivity.DataNucleus.Datastore.Datastore=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
+log4j.additivity.DataNucleus.Datastore.General=false
+log4j.additivity.DataNucleus.Datastore.Lifecycle=false
+log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
+log4j.additivity.DataNucleus.Datastore.Enhancer=false
+log4j.additivity.DataNucleus.Datastore.SchemaTool=false
+log4j.additivity.DataNucleus.Datastore.JDO=false
+log4j.additivity.DataNucleus.Datastore.JPA=false
+log4j.additivity.DataNucleus.Datastore.JCA=false
+log4j.additivity.DataNucleus.Datastore.IDE=false
+
+
+
+
+${symbol_pound} if using log4jdbc-remix as JDBC driver
+${symbol_pound}log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
+${symbol_pound}log4j.additivity.jdbc.sqlonly=false
+${symbol_pound}log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
+${symbol_pound}log4j.additivity.jdbc.resultsettable=false
+
+${symbol_pound}log4j.logger.jdbc.audit=WARN,jdbc, Console
+${symbol_pound}log4j.additivity.jdbc.audit=false
+${symbol_pound}log4j.logger.jdbc.resultset=WARN,jdbc
+${symbol_pound}log4j.additivity.jdbc.resultset=false
+${symbol_pound}log4j.logger.jdbc.sqltiming=WARN,sqltiming
+${symbol_pound}log4j.additivity.jdbc.sqltiming=false
+${symbol_pound}log4j.logger.jdbc.connection=FATAL,connection
+${symbol_pound}log4j.additivity.jdbc.connection=false
+
[17/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
deleted file mode 100644
index 7c528ac..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
+++ /dev/null
@@ -1,140 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package app;
-
-import app.ToDoItemAnalysis.DateRange;
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-
-import java.util.List;
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.joda.time.DateTime;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.DomainObjectLayout;
-import org.apache.isis.applib.annotation.Nature;
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.services.clock.ClockService;
-import org.apache.isis.applib.util.ObjectContracts;
-
-@DomainObjectLayout(
- named="By Date Range",
- bookmarking = BookmarkPolicy.AS_ROOT
-)
-@DomainObject(
- nature = Nature.VIEW_MODEL
-)
-public class ToDoItemsByDateRangeViewModel
- implements Comparable<ToDoItemsByDateRangeViewModel> {
-
- //region > constructors
- public ToDoItemsByDateRangeViewModel() {
- }
- public ToDoItemsByDateRangeViewModel(final DateRange dateRange) {
- setDateRange(dateRange);
- }
- //endregion
-
- //region > dateRange (property)
- private DateRange dateRange;
-
- @Title
- public DateRange getDateRange() {
- return dateRange;
- }
-
- public void setDateRange(final DateRange dateRange) {
- this.dateRange = dateRange;
- }
- //endregion
-
- //region > count (derived property)
- public int getCount() {
- return getItemsNotYetComplete().size();
- }
- //endregion
-
- //region > getItemsNotYetComplete (collection)
- /**
- * All those items {@link ToDoItems${symbol_pound}notYetComplete() not yet complete}, for this {@link ${symbol_pound}getDateRange() date range}.
- */
- @CollectionLayout(
- render = RenderType.EAGERLY
- )
- public List<ToDoItem> getItemsNotYetComplete() {
- final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
- return Lists.newArrayList(Iterables.filter(notYetComplete, thoseInDateRange()));
- }
-
- private Predicate<ToDoItem> thoseInDateRange() {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return Objects.equal(dateRangeFor(t), getDateRange());
- }
- };
- }
-
- private DateRange dateRangeFor(final ToDoItem t) {
- if(t.getDueBy() == null) {
- return DateRange.Unknown;
- }
- final DateTime dueBy = t.getDueBy().toDateTimeAtStartOfDay();
- final DateTime today = clockService.now().toDateTimeAtStartOfDay();
-
- if(dueBy.isBefore(today)) {
- return DateRange.OverDue;
- }
- if(dueBy.isBefore(today.plusDays(1))) {
- return DateRange.Today;
- }
- if(dueBy.isBefore(today.plusDays(2))) {
- return DateRange.Tomorrow;
- }
- if(dueBy.isBefore(today.plusDays(7))) {
- return DateRange.ThisWeek;
- }
- return DateRange.Later;
- }
- //endregion
-
- //region > compareTo
- @Override
- public int compareTo(final ToDoItemsByDateRangeViewModel other) {
- return ObjectContracts.compare(this, other, "dateRange");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItems toDoItems;
-
- @javax.inject.Inject
- private ClockService clockService;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
deleted file mode 100644
index 648e146..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "columns": [
- {
- "span": 4,
- "memberGroups": {
- "General": {
- "members": {
- "dateRange": {},
- "count": {}
- }
- }
- }
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 8,
- "collections": {
- "itemsNotYetComplete": {}
- }
- }
- ],
- "actions": {
- "downloadLayout": {},
- "refreshLayout": {}
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
deleted file mode 100644
index 034a1f9..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
deleted file mode 100644
index 9bb6bad..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
+++ /dev/null
@@ -1,35 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package dom.todo;
-
-/**
- * Enables {@link dom.todo.ToDoItemContributions${symbol_pound}updateCategory(dom.todo.Categorized, dom.todo.ToDoItem.Category, dom.todo.ToDoItem.Subcategory)} to be contributed to
- * both the {@link dom.todo.ToDoItem} (entity) and also the {@link app.ToDoItemWizard} (wizard).
- */
-public interface Categorized {
-
- ToDoItem.Category getCategory();
- void setCategory(ToDoItem.Category category);
-
- ToDoItem.Subcategory getSubcategory();
- void setSubcategory(ToDoItem.Subcategory subcategory);
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png
deleted file mode 100644
index b0fc6e8..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png
deleted file mode 100644
index 99a9fed..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index cadc117..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
+++ /dev/null
@@ -1,982 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package dom.todo;
-
-import java.math.BigDecimal;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import javax.jdo.JDOHelper;
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.VersionStrategy;
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Ordering;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.Collection;
-import org.apache.isis.applib.annotation.CollectionLayout;
-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.RestrictTo;
-import org.apache.isis.applib.annotation.InvokeOn;
-import org.apache.isis.applib.annotation.InvokedOn;
-import org.apache.isis.applib.annotation.Optionality;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.Property;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.security.UserMemento;
-import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.scratchpad.Scratchpad;
-import org.apache.isis.applib.services.wrapper.HiddenException;
-import org.apache.isis.applib.services.wrapper.WrapperFactory;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.applib.util.TitleBuffer;
-import org.apache.isis.applib.value.Blob;
-import org.apache.isis.applib.value.Clob;
-
-@javax.jdo.annotations.PersistenceCapable(identityType=IdentityType.DATASTORE)
-@javax.jdo.annotations.DatastoreIdentity(
- strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
- column="id")
-@javax.jdo.annotations.Version(
- strategy=VersionStrategy.VERSION_NUMBER,
- column="version")
-@javax.jdo.annotations.Uniques({
- @javax.jdo.annotations.Unique(
- name="ToDoItem_description_must_be_unique",
- members={"ownedBy","description"})
-})
-@javax.jdo.annotations.Queries( {
- @javax.jdo.annotations.Query(
- name = "findByOwnedBy", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndCompleteIsFalse", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy "
- + " && complete == false"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndCompleteIsTrue", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy "
- + "&& complete == true"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndCategory", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy "
- + "&& category == :category"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndDescriptionContains", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy && "
- + "description.indexOf(:description) >= 0")
-})
-@DomainObject(
- autoCompleteRepository = ToDoItems.class, // for drop-downs, unless autoCompleteNXxx() is present
- autoCompleteAction = "autoComplete",
- // bounded = true, // for drop-downs if only a small number of instances only (overrides autoComplete)
- objectType = "TODO"
-)
-@DomainObjectLayout(
- bookmarking = BookmarkPolicy.AS_ROOT
-)
-public class ToDoItem implements Categorized, Comparable<ToDoItem> {
-
- //region > LOG
- /**
- * It isn't common for entities to log, but they can if required.
- * Isis uses slf4j API internally (with log4j as implementation), and is the recommended API to use.
- */
- private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItem.class);
- //endregion
-
- // region > title, icon
- public String title() {
- final TitleBuffer buf = new TitleBuffer();
- buf.append(getDescription());
- if (isComplete()) {
- buf.append("- Completed!");
- } else {
- try {
- final LocalDate dueBy = wrapperFactory.wrap(this).getDueBy();
- if (dueBy != null) {
- buf.append(" due by", dueBy);
- }
- } catch(final HiddenException ignored) {
- }
- }
- return buf.toString();
- }
-
- public String iconName() {
- return !isComplete() ? "todo" : "done";
- }
-
- public String cssClass() { return iconName(); }
-
- //endregion
-
- //region > description (property)
- private String description;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=100)
- @Property(
- regexPattern = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*"
- )
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
- public void modifyDescription(final String description) {
- setDescription(description);
- }
- public void clearDescription() {
- setDescription(null);
- }
- //endregion
-
- //region > dueBy (property)
- @javax.jdo.annotations.Persistent(defaultFetchGroup="true")
- private LocalDate dueBy;
-
- @javax.jdo.annotations.Column(allowsNull="true")
- public LocalDate getDueBy() {
- 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");
- }
-
- public void setDueBy(final LocalDate dueBy) {
- this.dueBy = dueBy;
- }
- public void clearDueBy() {
- setDueBy(null);
- }
- // proposed new value is validated before setting
- public String validateDueBy(final LocalDate dueBy) {
- if (dueBy == null) {
- return null;
- }
- return toDoItems.validateDueBy(dueBy);
- }
- //endregion
-
- //region > category and subcategory (property)
-
- public static enum Category {
- Professional {
- @Override
- public List<Subcategory> subcategories() {
- return Arrays.asList(null, Subcategory.OpenSource, Subcategory.Consulting, Subcategory.Education, Subcategory.Marketing);
- }
- }, Domestic {
- @Override
- public List<Subcategory> subcategories() {
- return Arrays.asList(null, Subcategory.Shopping, Subcategory.Housework, Subcategory.Garden, Subcategory.Chores);
- }
- }, Other {
- @Override
- public List<Subcategory> subcategories() {
- return Arrays.asList(null, Subcategory.Other);
- }
- };
-
- public abstract List<Subcategory> subcategories();
- }
-
- public static enum Subcategory {
- // professional
- OpenSource, Consulting, Education, Marketing,
- // domestic
- Shopping, Housework, Garden, Chores,
- // other
- Other;
-
- public static List<Subcategory> listFor(final Category category) {
- return category != null? category.subcategories(): Collections.<Subcategory>emptyList();
- }
-
- static String validate(final Category category, final Subcategory subcategory) {
- if(category == null) {
- return "Enter category first";
- }
- return !category.subcategories().contains(subcategory)
- ? "Invalid subcategory for category '" + category + "'"
- : null;
- }
-
- public static Predicate<Subcategory> thoseFor(final Category category) {
- return new Predicate<Subcategory>() {
-
- @Override
- public boolean apply(final Subcategory subcategory) {
- return category.subcategories().contains(subcategory);
- }
- };
- }
- }
-
- // //////////////////////////////////////
-
- private Category category;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- @Property(
- editing = Editing.DISABLED,
- editingDisabledReason = "Use action to update both category and subcategory"
- )
- public Category getCategory() {
- return category;
- }
-
- public void setCategory(final Category category) {
- this.category = category;
- }
-
- // //////////////////////////////////////
-
- private Subcategory subcategory;
-
- @javax.jdo.annotations.Column(allowsNull="true")
- @Property(
- editing = Editing.DISABLED,
- editingDisabledReason = "Use action to update both category and subcategory"
- )
- public Subcategory getSubcategory() {
- return subcategory;
- }
- public void setSubcategory(final Subcategory subcategory) {
- this.subcategory = subcategory;
- }
- //endregion
-
- //region > ownedBy (property)
-
- private String ownedBy;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- public String getOwnedBy() {
- return ownedBy;
- }
-
- public void setOwnedBy(final String ownedBy) {
- this.ownedBy = ownedBy;
- }
- //endregion
-
- //region > complete (property), completed (action), notYetCompleted (action)
-
- private boolean complete;
-
- @Property(
- editing = Editing.DISABLED
- )
- public boolean isComplete() {
- return complete;
- }
-
- public void setComplete(final boolean complete) {
- this.complete = complete;
- }
-
- @Action(
- domainEvent =CompletedEvent.class,
- invokeOn = InvokeOn.OBJECT_AND_COLLECTION
- )
- public ToDoItem completed() {
- setComplete(true);
-
- //
- // remainder of method just demonstrates the use of the Bulk.InteractionContext service
- //
- @SuppressWarnings("unused")
- final List<Object> allObjects = actionInvocationContext.getDomainObjects();
-
- LOG.debug("completed: "
- + actionInvocationContext.getIndex() +
- " [" + actionInvocationContext.getSize() + "]"
- + (actionInvocationContext.isFirst() ? " (first)" : "")
- + (actionInvocationContext.isLast() ? " (last)" : ""));
-
- // if invoked as a regular action, return this object;
- // otherwise (if invoked as bulk), return null (so go back to the list)
- return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT? this: null;
- }
- // disable action dependent on state of object
- public String disableCompleted() {
- return isComplete() ? "Already completed" : null;
- }
-
- @Action(
- invokeOn = InvokeOn.OBJECT_AND_COLLECTION
- )
- public ToDoItem notYetCompleted() {
- setComplete(false);
-
- // if invoked as a regular action, return this object;
- // otherwise (if invoked as bulk), return null (so go back to the list)
- return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT ? this: null;
- }
- // disable action dependent on state of object
- public String disableNotYetCompleted() {
- return !complete ? "Not yet completed" : null;
- }
- //endregion
-
- //region > completeSlowly (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- @Action(
- hidden = Where.EVERYWHERE
- )
- public void completeSlowly(final int millis) {
- try {
- Thread.sleep(millis);
- } catch (final InterruptedException ignored) {
- }
- setComplete(true);
- }
- //endregion
-
- //region > cost (property), updateCost (action)
- private BigDecimal cost;
-
- @javax.jdo.annotations.Column(allowsNull="true", scale=2)
- @javax.validation.constraints.Digits(integer=10, fraction=2)
- @Property(
- editing = Editing.DISABLED,
- editingDisabledReason = "Update using action"
- )
- public BigDecimal getCost() {
- return cost;
- }
-
- public void setCost(final BigDecimal cost) {
- this.cost = cost!=null?cost.setScale(2, BigDecimal.ROUND_HALF_EVEN):null;
- }
-
- @Action(
- semantics = SemanticsOf.IDEMPOTENT
- )
- public ToDoItem updateCost(
- @Parameter(optional = Optionality.TRUE)
- @ParameterLayout(named = "New cost")
- @javax.validation.constraints.Digits(integer=10, fraction=2)
- final BigDecimal cost) {
- LOG.debug("%s: cost updated: %s -> %s", container.titleOf(this), getCost(), cost);
-
- // just to simulate a long-running action
- try {
- Thread.sleep(3000);
- } catch (final InterruptedException ignored) {
- }
-
- setCost(cost);
- return this;
- }
-
- // provide a default value for argument ${symbol_pound}0
- public BigDecimal default0UpdateCost() {
- return getCost();
- }
-
- // validate action arguments
- public String validateUpdateCost(final BigDecimal proposedCost) {
- if(proposedCost == null) { return null; }
- return proposedCost.compareTo(BigDecimal.ZERO) < 0? "Cost must be positive": null;
- }
- //endregion
-
- //region > notes (property)
- private String notes;
-
- @javax.jdo.annotations.Column(allowsNull="true", length=400)
- public String getNotes() {
- return notes;
- }
-
- public void setNotes(final String notes) {
- this.notes = notes;
- }
- //endregion
-
- //region > attachment (property)
- private Blob attachment;
- @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
- @javax.jdo.annotations.Column(name = "attachment_name"),
- @javax.jdo.annotations.Column(name = "attachment_mimetype"),
- @javax.jdo.annotations.Column(name = "attachment_bytes", jdbcType = "BLOB", sqlType = "BLOB")
- })
- @Property(
- optional = Optionality.TRUE
- )
- public Blob getAttachment() {
- return attachment;
- }
-
- public void setAttachment(final Blob attachment) {
- this.attachment = attachment;
- }
- //endregion
-
- //region > doc (property)
- private Clob doc;
- @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
- @javax.jdo.annotations.Column(name = "doc_name"),
- @javax.jdo.annotations.Column(name = "doc_mimetype"),
- @javax.jdo.annotations.Column(name = "doc_chars", jdbcType = "CLOB", sqlType = "CLOB")
- })
- @Property(
- optional = Optionality.TRUE
- )
- public Clob getDoc() {
- return doc;
- }
-
- public void setDoc(final Clob doc) {
- this.doc = doc;
- }
- //endregion
-
- //region > version (derived property)
- public Long getVersionSequence() {
- if(!(this instanceof javax.jdo.spi.PersistenceCapable)) {
- return null;
- }
- return (Long) JDOHelper.getVersion((javax.jdo.spi.PersistenceCapable) this);
- }
- // hide property (imperatively, based on state of object)
- public boolean hideVersionSequence() {
- return !(this instanceof javax.jdo.spi.PersistenceCapable);
- }
- //endregion
-
- //region > dependencies (property), add (action), remove (action)
-
- // overrides the natural ordering
- public static class DependenciesComparator implements Comparator<ToDoItem> {
- @Override
- public int compare(final ToDoItem p, final ToDoItem q) {
- final Ordering<ToDoItem> byDescription = new Ordering<ToDoItem>() {
- public int compare(final ToDoItem p, final ToDoItem q) {
- return Ordering.natural().nullsFirst().compare(p.getDescription(), q.getDescription());
- }
- };
- return byDescription
- .compound(Ordering.<ToDoItem>natural())
- .compare(p, q);
- }
- }
-
- @javax.jdo.annotations.Persistent(table="ToDoItemDependencies")
- @javax.jdo.annotations.Join(column="dependingId")
- @javax.jdo.annotations.Element(column="dependentId")
-
- private Set<ToDoItem> dependencies = new TreeSet<>();
- //private SortedSet<ToDoItem> dependencies = new TreeSet<>(); // not compatible with neo4j (as of DN v3.2.3)
-
- @Collection()
- @CollectionLayout(/*sortedBy = DependenciesComparator.class*/) // not compatible with neo4j (as of DN v3.2.3)
- public Set<ToDoItem> getDependencies() {
- return dependencies;
- }
-
- public void setDependencies(final Set<ToDoItem> dependencies) {
- this.dependencies = dependencies;
- }
-
- public void addToDependencies(final ToDoItem toDoItem) {
- getDependencies().add(toDoItem);
- }
- public void removeFromDependencies(final ToDoItem toDoItem) {
- getDependencies().remove(toDoItem);
- }
-
- public ToDoItem add(
- @ParameterLayout(typicalLength = 20)
- final ToDoItem toDoItem) {
- // By wrapping the call, Isis will detect that the collection is modified
- // and it will automatically send CollectionInteractionEvents to the Event Bus.
- // ToDoItemSubscriptions is a demo subscriber to this event
- wrapperFactory.wrapSkipRules(this).addToDependencies(toDoItem);
- return this;
- }
- public List<ToDoItem> autoComplete0Add(
- @Parameter(minLength = 2)
- final String search) {
- final List<ToDoItem> list = toDoItems.autoComplete(search);
- list.removeAll(getDependencies());
- list.remove(this);
- return list;
- }
-
- public String disableAdd(final ToDoItem toDoItem) {
- if(isComplete()) {
- return "Cannot add dependencies for items that are complete";
- }
- return null;
- }
- // validate the provided argument prior to invoking action
- public String validateAdd(final ToDoItem toDoItem) {
- if(getDependencies().contains(toDoItem)) {
- return "Already a dependency";
- }
- if(toDoItem == this) {
- return "Can't set up a dependency to self";
- }
- return null;
- }
-
- public ToDoItem remove(
- @ParameterLayout(typicalLength = 20)
- final ToDoItem toDoItem) {
- // By wrapping the call, Isis will detect that the collection is modified
- // and it will automatically send a CollectionInteractionEvent to the Event Bus.
- // ToDoItemSubscriptions is a demo subscriber to this event
- wrapperFactory.wrapSkipRules(this).removeFromDependencies(toDoItem);
- return this;
- }
- // disable action dependent on state of object
- public String disableRemove(final ToDoItem toDoItem) {
- if(isComplete()) {
- return "Cannot remove dependencies for items that are complete";
- }
- return getDependencies().isEmpty()? "No dependencies to remove": null;
- }
- // validate the provided argument prior to invoking action
- public String validateRemove(final ToDoItem toDoItem) {
- if(!getDependencies().contains(toDoItem)) {
- return "Not a dependency";
- }
- return null;
- }
- // provide a drop-down
- public java.util.Collection<ToDoItem> choices0Remove() {
- return getDependencies();
- }
- //endregion
-
- //region > clone (action)
-
- // the name of the action in the UI
- // nb: method is not called "clone()" is inherited by java.lang.Object and
- // (a) has different semantics and (b) is in any case automatically ignored
- // by the framework
- public ToDoItem duplicate(
- @Parameter(regexPattern = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*" )
- @ParameterLayout(named="Description")
- final String description,
- @ParameterLayout(named="Category")
- final Category category,
- @ParameterLayout(named="Subcategory")
- final Subcategory subcategory,
- @Parameter(optional = Optionality.TRUE)
- @ParameterLayout(named="Due by")
- final LocalDate dueBy,
- @Parameter(optional = Optionality.TRUE)
- @ParameterLayout(named="Cost")
- final BigDecimal cost) {
- return toDoItems.newToDo(description, category, subcategory, dueBy, cost);
- }
- public String default0Duplicate() {
- return getDescription() + " - Copy";
- }
- public Category default1Duplicate() {
- return getCategory();
- }
- public Subcategory default2Duplicate() {
- return getSubcategory();
- }
- public LocalDate default3Duplicate() {
- return getDueBy();
- }
- public List<Subcategory> choices2Duplicate(
- final String description, final Category category) {
- return toDoItems.choices2NewToDo(description, category);
- }
- public String validateDuplicate(
- final String description,
- final Category category, final Subcategory subcategory,
- final LocalDate dueBy, final BigDecimal cost) {
- return toDoItems.validateNewToDo(description, category, subcategory, dueBy, cost);
- }
- //endregion
-
- //region > delete (action)
- @Action(
- domainEvent =DeletedEvent.class,
- invokeOn = InvokeOn.OBJECT_AND_COLLECTION
- )
- public List<ToDoItem> delete() {
-
- container.removeIfNotAlready(this);
-
- container.informUser("Deleted " + container.titleOf(this));
-
- // invalid to return 'this' (cannot render a deleted object)
- return toDoItems.notYetComplete();
- }
- //endregion
-
- //region > totalCost (property)
- @Action(
- semantics = SemanticsOf.SAFE,
- invokeOn = InvokeOn.COLLECTION_ONLY
- )
- public BigDecimal totalCost() {
- BigDecimal total = (BigDecimal) scratchpad.get("runningTotal");
- if(getCost() != null) {
- total = total != null ? total.add(getCost()) : getCost();
- scratchpad.put("runningTotal", total);
- }
- return total.setScale(2, BigDecimal.ROUND_HALF_EVEN);
- }
- //endregion
-
- //region > openSourceCodeOnGithub (action)
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- 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");
- }
- //endregion
-
- //region > demoException (action)
-
- static enum DemoExceptionType {
- RecoverableException,
- RecoverableExceptionAutoEscalated,
- NonRecoverableException;
- }
-
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- public void demoException(
- @ParameterLayout(named="Type")
- final DemoExceptionType type) {
- switch(type) {
- case NonRecoverableException:
- throw new NonRecoverableException("Demo throwing " + type.name());
- case RecoverableException:
- throw new RecoverableException("Demo throwing " + type.name());
- case RecoverableExceptionAutoEscalated:
- try {
- // this will trigger an exception (because category cannot be null), causing the xactn to be aborted
- setCategory(null);
- container.flush();
- } catch(Exception e) {
- // it's a programming mistake to throw only a recoverable exception here, because of the xactn's state.
- // the framework should instead auto-escalate this to a non-recoverable exception
- throw new RecoverableException("Demo throwing " + type.name(), e);
- }
- }
- }
- //endregion
-
- //region > lifecycle callbacks
-
- public void created() {
- LOG.debug("lifecycle callback: created: " + this.toString());
- }
- public void loaded() {
- LOG.debug("lifecycle callback: loaded: " + this.toString());
- }
- public void persisting() {
- LOG.debug("lifecycle callback: persisting: " + this.toString());
- }
- public void persisted() {
- LOG.debug("lifecycle callback: persisted: " + this.toString());
- }
- public void updating() {
- LOG.debug("lifecycle callback: updating: " + this.toString());
- }
- public void updated() {
- LOG.debug("lifecycle callback: updated: " + this.toString());
- }
- public void removing() {
- LOG.debug("lifecycle callback: removing: " + this.toString());
- }
- public void removed() {
- LOG.debug("lifecycle callback: removed: " + this.toString());
- }
- //endregion
-
- //region > object-level validation
-
- /**
- * Prevent user from viewing another user's data.
- */
- public boolean hidden() {
- // uncomment to enable. As things stand, the disabled() method below instead will make object "read-only".
- //return !Objects.equal(getOwnedBy(), container.getUser().getName());
- return false;
- }
-
- /**
- * Prevent user from modifying any other user's data.
- */
- public String disabled(final Identifier.Type identifierType){
- final UserMemento currentUser = container.getUser();
- final String currentUserName = currentUser.getName();
- if(Objects.equal(getOwnedBy(), currentUserName)) { return null; }
- return "This object is owned by '" + getOwnedBy() + "' and cannot be modified by you";
- }
-
- /**
- * In a real app, if this were actually a rule, then we'd expect that
- * invoking the {@link ${symbol_pound}completed() done} action would clear the {@link ${symbol_pound}getDueBy() dueBy}
- * property (rather than require the user to have to clear manually).
- */
- public String validate() {
- if(isComplete() && getDueBy() != null) {
- return "Due by date must be set to null if item has been completed";
- }
- return null;
- }
-
-
- //endregion
-
-
- //region > programmatic helpers
- @Programmatic // excluded from the framework's metamodel
- public boolean isDue() {
- if (getDueBy() == null) {
- return false;
- }
- return !toDoItems.isMoreThanOneWeekInPast(getDueBy());
- }
- //endregion
-
- //region > events
-
- public static abstract class AbstractActionDomainEvent extends ActionDomainEvent<ToDoItem> {
- private static final long serialVersionUID = 1L;
- private final String description;
- public AbstractActionDomainEvent(
- final String description,
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super(source, identifier, arguments);
- this.description = description;
- }
- public String getEventDescription() {
- return description;
- }
- }
-
- public static class CompletedEvent extends AbstractActionDomainEvent {
- private static final long serialVersionUID = 1L;
- public CompletedEvent(
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super("completed", source, identifier, arguments);
- }
- }
-
- public static class NoLongerCompletedEvent extends AbstractActionDomainEvent {
- private static final long serialVersionUID = 1L;
- public NoLongerCompletedEvent(
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super("no longer completed", source, identifier, arguments);
- }
- }
-
- public static class DeletedEvent extends AbstractActionDomainEvent {
- private static final long serialVersionUID = 1L;
- public DeletedEvent(
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super("deleted", source, identifier, arguments);
- }
- }
-
- //endregion
-
- //region > predicates
-
- public static class Predicates {
-
- public static Predicate<ToDoItem> thoseOwnedBy(final String currentUser) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem toDoItem) {
- return Objects.equal(toDoItem.getOwnedBy(), currentUser);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseCompleted(
- final boolean completed) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return Objects.equal(t.isComplete(), completed);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseWithSimilarDescription(final String description) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return t.getDescription().contains(description);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static Predicate<ToDoItem> thoseSimilarTo(final ToDoItem toDoItem) {
- return com.google.common.base.Predicates.and(
- thoseNot(toDoItem),
- thoseOwnedBy(toDoItem.getOwnedBy()),
- thoseCategorised(toDoItem.getCategory()));
- }
-
- public static Predicate<ToDoItem> thoseNot(final ToDoItem toDoItem) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return t != toDoItem;
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseCategorised(final Category category) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem toDoItem) {
- return Objects.equal(toDoItem.getCategory(), category);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseSubcategorised(
- final Subcategory subcategory) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return Objects.equal(t.getSubcategory(), subcategory);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseCategorised(
- final Category category, final Subcategory subcategory) {
- return com.google.common.base.Predicates.and(
- thoseCategorised(category),
- thoseSubcategorised(subcategory));
- }
-
- }
-
- //endregion
-
- //region > toString, compareTo
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "description,complete,dueBy,ownedBy");
- }
-
- /**
- * Required so can store in {@link SortedSet sorted set}s (eg {@link ${symbol_pound}getDependencies()}).
- */
- @Override
- public int compareTo(final ToDoItem other) {
- return ObjectContracts.compare(this, other, "complete,dueBy,description");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- DomainObjectContainer container;
-
- @javax.inject.Inject
- ToDoItems toDoItems;
-
- @javax.inject.Inject
- Scratchpad scratchpad;
-
- /**
- * public only so can be injected from integ tests
- */
- @javax.inject.Inject
- public ActionInvocationContext actionInvocationContext;
-
- /**
- * public only so can be injected from integ tests
- */
- @javax.inject.Inject
- public EventBusService eventBusService;
-
- @javax.inject.Inject
- WrapperFactory wrapperFactory;
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index cda5fdc..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
+++ /dev/null
@@ -1,222 +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.
- */
-{
- "columns": [
- {
- "span": 6,
- "memberGroups": {
- "General": {
- "members": {
- "description": {
- "propertyLayout": {
- "cssClass": "x-key",
- "labelPosition": "TOP"
- }
- },
- "category": {
- "propertyLayout": {
- "labelPosition": "TOP"
- }
- },
- "subcategory": {
- "propertyLayout": {
- "labelPosition": "NONE"
- },
- "actions": {
- "updateCategory": {
- "actionLayout": {
- "named": "Update"
- }
- },
- "analyseCategory": {
- "actionLayout": {
- "cssClass": "btn-default",
- "cssClassFa": "fa fa-pie-chart"
- }
- }
- }
- },
- "ownedBy": {
- "propertyLayout": {
- "hidden": "EVERYWHERE"
- }
- },
- "complete": {
- "propertyLayout": {
- "named": "Whether this todo item has been <i>completed</i> or not.",
- "namedEscaped": false,
- "describedAs": "Whether this todo item has been completed, or not.",
- "labelPosition": "LEFT"
- },
- "actions": {
- "completed": {
- "actionLayout": {
- "named": "Done",
- "describedAs": "Update this todo item as complete",
- "cssClass": "btn-success",
- "cssClassFa": "fa fa-thumbs-up"
- }
- },
- "notYetCompleted": {
- "actionLayout": {
- "named": "Not done",
- "describedAs": "Update this todo item as not yet complete",
- "cssClass": "btn-info",
- "cssClassFa": "fa fa-thumbs-down"
- }
- },
- "scheduleExplicitly": {
- },
- "scheduleImplicitly": {
- }
- }
- }
- }
- },
- "Misc": {
- "members": {
- "versionSequence": {
- "propertyLayout": {
- "named": "Version",
- "hidden": "ALL_TABLES"
- },
- "disabled": {}
- }
- }
- }
- }
- },
- {
- "span": 6,
- "memberGroups": {
- "Priority": {
- "members": {
- "relativePriority": {
- "actions": {
- "previous": {
- "actionLayout": {
- "cssClassFa": "fa fa-step-backward"
- }
- },
- "next": {
- "actionLayout": {
- "cssClassFa": "fa fa-step-forward",
- "cssClassFaPosition": "right"
- }
- }
- }
- },
- "dueBy": {
- "propertyLayout": {
- "renderedAsDayBefore": "false"
- }
- }
- }
- },
- "Other": {
- "members": {
- "cost": {
- "actions": {
- "updateCost":{
- "actionLayout": {
- "named": "Update",
- "cssClassFa": "fa fa-dollar"
- }
- }
- }
- },
- "notes": {
- "propertyLayout": {
- "hidden": "ALL_TABLES",
- "labelPosition": "TOP",
- "multiLine": 5
- }
- },
- "attachment": {
- "propertyLayout": {
- "hidden": "STANDALONE_TABLES"
- }
- },
- "doc": {
- "propertyLayout": {
- "hidden": "STANDALONE_TABLES"
- }
- }
- }
- }
- }
- },
- {
- "span": 0
- },
- {
- "span": 6,
- "collections": {
- "dependencies": {
- "collectionLayout": {
- "named": "Todo items that are <i>dependencies</i> of this item.",
- "namedEscaped": false,
- "describedAs": "Todo items that must be completed before this one",
- "paged": 5,
- "render": "EAGERLY"
- },
- "disabled": {},
- "actions": {
- "add":{
- "actionLayout": {
- "cssClass": "btn-default",
- "cssClassFa": "fa fa-plus-square"
- }
- },
- "remove": {
- "actionLayout": {
- "cssClass": "x-caution btn-default",
- "cssClassFa": "fa fa-minus-square"
- }
- }
- }
- },
- "similarTo": {
- "collectionLayout": {
- "named": "Todo items that are <i>similar to</i> this one",
- "namedEscaped": false,
- "paged": 3,
- "render": "LAZILY"
- },
- "disabled": {}
- }
- }
- }
- ],
- "actions": {
- "totalCost": {},
- "delete": {
- "actionLayout": {
- "cssClass": "btn btn-danger",
- "cssClassFa": "fa fa-trash fa-lg"
- }
- },
- "duplicate": {
- "actionLayout": {
- "named": "Clone",
- "describedAs": "Create a new todo item from this one",
- "cssClass": "btn-warn",
- "cssClassFa": "fa fa-copy fa-lg"
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png
deleted file mode 100644
index 99a9fed..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
deleted file mode 100644
index 1d3b870..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package dom.todo;
-
-import org.apache.isis.applib.annotation.PublishingChangeKind;
-import org.apache.isis.applib.annotation.PublishingPayloadFactoryForObject;
-import org.apache.isis.applib.services.publish.EventPayload;
-import org.apache.isis.applib.services.publish.EventPayloadForObjectChanged;
-
-public class ToDoItemChangedPayloadFactory implements PublishingPayloadFactoryForObject {
-
- public static class ToDoItemPayload extends EventPayloadForObjectChanged<ToDoItem> {
-
- public ToDoItemPayload(ToDoItem changed) {
- super(changed);
- }
-
- /**
- * Expose the item's {@link ToDoItem${symbol_pound}getDescription() description} more explicitly
- * in the payload.
- */
- public String getDescription() {
- return getChanged().getDescription();
- }
- }
-
- @Override
- public EventPayload payloadFor(final Object changedObject, final PublishingChangeKind publishingChangeKind) {
- return new ToDoItemPayload((ToDoItem) changedObject);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
deleted file mode 100644
index c33097e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
+++ /dev/null
@@ -1,274 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package dom.todo;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Ordering;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.Contributed;
-import org.apache.isis.applib.annotation.Disabled;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
-import org.apache.isis.applib.value.Clob;
-
-@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
-public class ToDoItemContributions extends AbstractFactoryAndRepository {
-
- //region > priority (contributed property)
- @Action(
- semantics = SemanticsOf.SAFE,
- hidden = Where.ALL_TABLES
- )
- @ActionLayout(
- describedAs = "The relative priority of this item compared to others not yet complete (using 'due by' date)",
- contributed = Contributed.AS_ASSOCIATION
- )
- @Disabled(reason="Relative priority, derived from due date")
- public Integer relativePriority(final ToDoItem toDoItem) {
- return queryResultsCache.execute(new Callable<Integer>(){
- @Override
- public Integer call() throws Exception {
- if(toDoItem.isComplete()) {
- return null;
- }
-
- // sort items, then locate this one
- int i=1;
- for (final ToDoItem each : sortedNotYetComplete()) {
- if(each == toDoItem) {
- return i;
- }
- i++;
- }
- return null;
- }}, ToDoItemContributions.class, "relativePriority", toDoItem);
- }
-
- private List<ToDoItem> sortedNotYetComplete() {
- return ORDERING_DUE_BY
- .compound(ORDERING_DESCRIPTION)
- .sortedCopy(toDoItems.notYetComplete());
- }
-
- private static final Ordering<ToDoItem> ORDERING_DUE_BY =
- Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, LocalDate>(){
- @Override
- public LocalDate apply(final ToDoItem input) {
- return input.getDueBy();
- }
- });
-
- private static final Ordering<ToDoItem> ORDERING_DESCRIPTION =
- Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, String>(){
- @Override
- public String apply(final ToDoItem input) {
- return input.getDescription();
- }
- });
-
-
- //endregion
-
- //region > next, previous (contributed actions)
- @Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(
- describedAs = "The next item not yet completed",
- contributed = Contributed.AS_ACTION
- )
- public ToDoItem next(final ToDoItem item) {
- final Integer priority = relativePriority(item);
- if(priority == null) {
- return item;
- }
- int priorityOfNext = priority != null ? priority + 1 : 0;
- return itemWithPriorityElse(priorityOfNext, item);
- }
- public String disableNext(final ToDoItem toDoItem) {
- if (toDoItem.isComplete()) {
- return "Completed";
- }
- if(next(toDoItem) == null) {
- return "No next item";
- }
- return null;
- }
-
- // //////////////////////////////////////
-
- @ActionLayout(
- describedAs = "The previous item not yet completed",
- contributed = Contributed.AS_ACTION
- )
- @Action(semantics = SemanticsOf.SAFE)
- public ToDoItem previous(final ToDoItem item) {
- final Integer priority = relativePriority(item);
- if(priority == null) {
- return item;
- }
- int priorityOfPrevious = priority != null? priority - 1 : 0;
- return itemWithPriorityElse(priorityOfPrevious, item);
- }
- public String disablePrevious(final ToDoItem toDoItem) {
- if (toDoItem.isComplete()) {
- return "Completed";
- }
- if(previous(toDoItem) == null) {
- return "No previous item";
- }
- return null;
- }
-
- // //////////////////////////////////////
-
- /**
- * @param priority : 1-based priority
- */
- private ToDoItem itemWithPriorityElse(int priority, final ToDoItem itemElse) {
- if(priority < 1) {
- return null;
- }
- final List<ToDoItem> items = sortedNotYetComplete();
- if(priority > items.size()) {
- return null;
- }
- return priority>=0 && items.size()>=priority? items.get(priority-1): itemElse;
- }
- //endregion
-
- //region > similarTo (contributed collection)
- @ActionLayout(
- contributed = Contributed.AS_ASSOCIATION
- )
- @Action(semantics = SemanticsOf.SAFE)
- public List<ToDoItem> similarTo(final ToDoItem toDoItem) {
- final List<ToDoItem> similarToDoItems = allMatches(
- new QueryDefault<ToDoItem>(ToDoItem.class,
- "findByOwnedByAndCategory",
- "ownedBy", currentUserName(),
- "category", toDoItem.getCategory()));
- return Lists.newArrayList(Iterables.filter(similarToDoItems, excluding(toDoItem)));
- }
-
-
- private static Predicate<ToDoItem> excluding(final ToDoItem toDoItem) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(ToDoItem input) {
- return input != toDoItem;
- }
- };
- }
- //endregion
-
- //region > updateCategory (contributed action)
-
- @ActionLayout(
- describedAs = "Update category and subcategory"
- )
- @Action(semantics = SemanticsOf.IDEMPOTENT)
- public Categorized updateCategory(
- final Categorized item,
- final @ParameterLayout(named="Category") Category category,
- final @Optional @ParameterLayout(named="Subcategory") Subcategory subcategory) {
- item.setCategory(category);
- item.setSubcategory(subcategory);
- return item;
- }
- public Category default1UpdateCategory(
- final Categorized item) {
- return item != null? item.getCategory(): null;
- }
- public Subcategory default2UpdateCategory(
- final Categorized item) {
- return item != null? item.getSubcategory(): null;
- }
-
- public List<Subcategory> choices2UpdateCategory(
- final Categorized item, final Category category) {
- return Subcategory.listFor(category);
- }
-
- public String validateUpdateCategory(
- final Categorized item, final Category category, final Subcategory subcategory) {
- return Subcategory.validate(category, subcategory);
- }
- //endregion
-
- // region > exportAsJson (action)
- /**
- * Demonstrates functionality of streaming back Clob/Blob result within an action with a prompt, i.e. Ajax request
- */
- @Action(semantics = SemanticsOf.SAFE)
- public Clob exportAsJson(
- final ToDoItem toDoItem,
- @ParameterLayout(named = "File name") String fileName
- ) {
- if(!fileName.endsWith(".json")) {
- fileName += ".json";
- }
- return new Clob(
- fileName,
- "application/json",
- "{" +
- "${symbol_escape}"description${symbol_escape}": ${symbol_escape}"" + toDoItem.getDescription()+"${symbol_escape}"" +
- ",${symbol_escape}"complete${symbol_escape}": " + ""+toDoItem.isComplete() +
- "}");
- }
-
- public String default1ExportAsJson() {
- return "todo";
- }
- //endregion
-
-
- //region > helpers
- protected String currentUserName() {
- return getContainer().getUser().getName();
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItems toDoItems;
-
- @javax.inject.Inject
- private QueryResultsCache queryResultsCache;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
deleted file mode 100644
index ea76566..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
+++ /dev/null
@@ -1,402 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package dom.todo;
-
-import java.util.EventObject;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
-import com.google.common.eventbus.Subscribe;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
-
-/**
- * Subscribes to changes made to the {@link dom.todo.ToDoItem} entity.
- *
- * <p>
- * (For demo purposes) the behaviour can be influenced using {@link ${symbol_pound}subscriberBehaviour(dom.todo.ToDoItemSubscriptions.Behaviour)}.
- * In particular, the subscriber can be used to hide/disable/validate actions, or just to perform pre- or post-execute
- * tasks. This also includes being set to throw an exception during the execution of the action (also in effect
- * vetoing the change).
- * </p>
- */
-@DomainService(nature = NatureOfService.VIEW_MENU_ONLY)
-@DomainServiceLayout(menuBar = DomainServiceLayout.MenuBar.SECONDARY, menuOrder = "30")
-public class ToDoItemSubscriptions {
-
- //region > LOG
- private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItemSubscriptions.class);
- //endregion
-
- //region > postConstruct, preDestroy
-
- /**
- * Registers this service with the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
- *
- * <p>
- * Because this service is a singleton, this is called during initial bootstrap.
- * </p>
- */
- @Programmatic
- @PostConstruct
- public void postConstruct() {
- LOG.info("postConstruct: registering to event bus");
- eventBusService.register(this);
- }
-
- /**
- * Unregisters this service from the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
- *
- * <p>
- * Because this service is a singleton, this is only done when the system is shutdown.
- * </p>
- */
- @Programmatic
- @PreDestroy
- public void preDestroy() {
- LOG.info("preDestroy: unregistering from event bus");
- eventBusService.unregister(this);
- }
- //endregion
-
-
- //region > on(Event)...
-
- public static enum Behaviour {
- AnyExecuteAccept,
- AnyExecuteVetoWithRecoverableException,
- AnyExecuteVetoWithNonRecoverableException,
- AnyExecuteVetoWithOtherException,
- UpdateCostActionHide,
- UpdateCostActionDisable,
- UpdateCostActionInvalidate,
- DescriptionPropertyHide,
- DescriptionPropertyDisable,
- DescriptionPropertyInvalidate,
- DependenciesCollectionHide,
- // not implemented in Wicket viewer, but supported in wrapped objects
- DependenciesCollectionDisable,
- // not implemented in Wicket viewer, but supported in wrapped objects
- DependenciesCollectionInvalidateAdd,
- DependenciesCollectionInvalidateRemove,
- SimilarToCollectionHide
- }
-
- /**
- * The desired behaviour of this service.
- */
- private Behaviour behaviour = Behaviour.AnyExecuteAccept;
-
- /**
- * To demo/test what occurs if a subscriber that might veto an event.
- */
- @MemberOrder(name = "Prototyping", sequence = "80")
- @ActionLayout(
- named="Set subscriber behaviour"
- )
- @Action(
- semantics = SemanticsOf.IDEMPOTENT,
- restrictTo = RestrictTo.PROTOTYPING
- )
- public void subscriberBehaviour(
- @ParameterLayout(
- named="Behaviour"
- )
- final Behaviour behaviour) {
- this.behaviour = behaviour;
- container.informUser("Subscriber behaviour set to: " + behaviour);
- }
- public Behaviour default0SubscriberBehaviour() {
- return this.behaviour;
- }
-
- @Programmatic
- public Behaviour getSubscriberBehaviour() {
- return behaviour;
- }
-
-
- private void onExecutedThrowExceptionIfSet(final ActionDomainEvent<?> ev) {
- if(ev != null && ev.getSemantics().isSafe()) {
- return;
- }
- onExecutedThrowExceptionIfSet();
- }
- private void onExecutedThrowExceptionIfSet(final PropertyDomainEvent<?, ?> ev) {
- onExecutedThrowExceptionIfSet();
- }
- private void onExecutedThrowExceptionIfSet(final CollectionDomainEvent<?, ?> ev) {
- onExecutedThrowExceptionIfSet();
- }
-
-
- private void onExecutedThrowExceptionIfSet() {
- if(behaviour == Behaviour.AnyExecuteVetoWithRecoverableException) {
- throw new RecoverableException("Rejecting event (recoverable exception thrown)");
- }
- if(behaviour == Behaviour.AnyExecuteVetoWithNonRecoverableException) {
- throw new NonRecoverableException("Rejecting event (non-recoverable exception thrown)");
- }
- if(behaviour == Behaviour.AnyExecuteVetoWithOtherException) {
- throw new RuntimeException("Throwing some other exception");
- }
- }
- //endregion
-
- //region > on(Event) for ToDoItem-specific events
- @Programmatic
- @Subscribe
- public void on(final ToDoItem.CompletedEvent ev) {
- recordEvent(ev);
- switch(ev.getEventPhase()) {
- case HIDE:
- break;
- case DISABLE:
- break;
- case VALIDATE:
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- LOG.info("Received ToDoItem.CompletedEvent for : " + ev.getSource().toString());
- break;
- }
- }
- //endregion
-
- //region > on(Event) ... general purpose
-
- @Programmatic
- @Subscribe
- public void on(final ActionDomainEvent<?> ev) {
- recordEvent(ev);
- switch(ev.getEventPhase()) {
- case HIDE:
- if(getSubscriberBehaviour() == Behaviour.UpdateCostActionHide) {
- if(ev.getIdentifier().getMemberName().equals("updateCost")) {
- ev.hide();
- }
- }
- break;
- case DISABLE:
- if(getSubscriberBehaviour() == Behaviour.UpdateCostActionDisable) {
- if(ev.getIdentifier().getMemberName().equals("updateCost")) {
- ev.disable("ToDoItemSubscriptions says: updateCost action disabled!");
- }
- }
- break;
- case VALIDATE:
- if(getSubscriberBehaviour() == Behaviour.UpdateCostActionInvalidate &&
- ev.getIdentifier().getMemberName().equals("updateCost")) {
- ev.invalidate("ToDoItemSubscriptions says: can't invoke updateCost action with these args!");
- }
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- LOG.info("Received ActionDomainEvent, " + ev.getSource().toString() + ", invoked " + ev.getIdentifier().getMemberName());
- onExecutedThrowExceptionIfSet(ev);
- break;
- }
- }
-
- @Programmatic
- @Subscribe
- public void on(PropertyDomainEvent<?,?> ev) {
- recordEvent(ev);
- switch(ev.getEventPhase()) {
- case HIDE:
- if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyHide &&
- ev.getIdentifier().getMemberName().equals("description")) {
- ev.veto("");
- }
- break;
- case DISABLE:
- if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyDisable &&
- ev.getIdentifier().getMemberName().equals("description")) {
- ev.veto("ToDoItemSubscriptions says: description property disabled!");
- }
- break;
- case VALIDATE:
- if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyInvalidate &&
- ev.getIdentifier().getMemberName().equals("description")) {
- ev.veto("ToDoItemSubscriptions says: can't change description property to this value!");
- }
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- LOG.info("Received PropertyDomainEvent, " + ev.getSource().toString() + ", changed " + ev.getIdentifier().getMemberName() + " : " + ev.getOldValue() + " -> " + ev.getNewValue());
- onExecutedThrowExceptionIfSet(ev);
-
- if(ev.getIdentifier().getMemberName().contains("description")) {
- String newValue = (String) ev.getNewValue();
- if(newValue.matches(".*demo veto.*")) {
- throw new RecoverableException("oh no you don't! " + ev.getNewValue());
- }
- }
- break;
- }
- }
-
- @Programmatic
- @Subscribe
- public void on(CollectionDomainEvent<?,?> ev) {
- recordEvent(ev);
- switch (ev.getEventPhase()) {
- case HIDE:
- if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionHide &&
- ev.getIdentifier().getMemberName().equals("dependencies")) {
- ev.veto("");
- }
- if (getSubscriberBehaviour() == Behaviour.SimilarToCollectionHide &&
- ev.getIdentifier().getMemberName().equals("similarTo")) {
- ev.veto("");
- }
- break;
- case DISABLE:
- if (getSubscriberBehaviour() == Behaviour.DependenciesCollectionDisable &&
- ev.getIdentifier().getMemberName().equals("dependencies")) {
- ev.veto("ToDoItemSubscriptions says: dependencies collection disabled!");
- }
- break;
- case VALIDATE:
- if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateAdd &&
- ev.getIdentifier().getMemberName().equals("dependencies") &&
- ev.getOf() == CollectionDomainEvent.Of.ADD_TO ) {
- ev.veto("ToDoItemSubscriptions says: can't add this object to dependencies collection!");
- }
- if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateRemove &&
- ev.getIdentifier().getMemberName().equals("dependencies") &&
- ev.getOf() == CollectionDomainEvent.Of.REMOVE_FROM ) {
- ev.veto("ToDoItemSubscriptions says: can't remove this object from dependencies collection!");
- }
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- if(ev.getOf() == CollectionDomainEvent.Of.ADD_TO) {
- LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", added to " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
- } else {
- LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", removed from " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
- }
- onExecutedThrowExceptionIfSet(ev);
- break;
- }
-
- }
-
- //endregion
-
- //region > receivedEvents
- private final List<java.util.EventObject> receivedEvents = Lists.newLinkedList();
-
- /**
- * Used in integration tests.
- */
- @Programmatic
- public List<java.util.EventObject> receivedEvents() {
- return receivedEvents;
- }
-
- /**
- * Used in integration tests.
- */
- @Programmatic
- public <T extends java.util.EventObject> List<T> receivedEvents(final Class<T> expectedType) {
- return newArrayList(
- transform(
- filter(receivedEvents, instanceOf(expectedType)),
- castTo(expectedType)));
- }
-
- private static <T extends EventObject> Function<EventObject, T> castTo(Class<T> expectedType) {
- return new Function<EventObject, T>() {
- @Override
- public T apply(EventObject input) {
- return (T) input;
- }
- };
- }
-
- private static <T extends EventObject> Predicate<EventObject> instanceOf(final Class<T> expectedType) {
- return new Predicate<EventObject>() {
- @Override
- public boolean apply(EventObject input) {
- return expectedType.isInstance(input);
- }
- };
- }
-
- /**
- * Used in integration tests.
- */
- @Programmatic
- public <T extends java.util.EventObject> T mostRecentlyReceivedEvent(Class<T> expectedType) {
- final List<T> receivedEvents = receivedEvents(expectedType);
- return !receivedEvents.isEmpty() ? receivedEvents.get(0) : null;
- }
- private void recordEvent(final java.util.EventObject ev) {
- receivedEvents.add(0, ev);
- }
- /**
- * Used in integration tests.
- */
- @Programmatic
- public void reset() {
- receivedEvents.clear();
- subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept);
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
-
- @javax.inject.Inject
- private EventBusService eventBusService;
- //endregion
-
-
-}
[07/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
new file mode 100644
index 0000000..0a85fb6
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
@@ -0,0 +1,66 @@
+# 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.
+
+#
+# configuration file for the Restful Objects viewer
+#
+
+# the baseUrl for hrefs in the events generated by the RO EventSerializer
+isis.viewer.restfulobjects.RestfulObjectsSpecEventSerializer.baseUrl=http://localhost:8080/restful/
+
+# renders param details in the (incorrect) form that they were for GSOC2013 viewers
+# isis.viewer.restfulobjects.gsoc2013.legacyParamDetails=true
+
+# whether to honor UI hints, in particular Render(EAGERLY). Defaults to false.
+#isis.viewer.restfulobjects.honorUiHints=false
+
+
+
+###############################################################################
+# Non-standard configuration settings.
+#
+# If enabled of the following are enabled then the viewer is deviating from the
+# RO spec standard; compatibility may be compromised with RO clients.
+###############################################################################
+
+# whether to show only object properties for object members
+# (on the object representation only)
+# Takes precedence over the other 'suppress' below.
+#isis.viewer.restfulobjects.objectPropertyValuesOnly=true
+
+# whether to suppress "describedby" links. Defaults to false.
+#isis.viewer.restfulobjects.suppressDescribedByLinks=true
+
+# whether to suppress "update" links. Defaults to false.
+#isis.viewer.restfulobjects.suppressUpdateLink=true
+
+# whether to suppress "id" json-prop for object members. Defaults to false.
+#isis.viewer.restfulobjects.suppressMemberId=true
+
+# whether to suppress "links" json-prop for object members
+# (on the object representation only). Defaults to false.
+#isis.viewer.restfulobjects.suppressMemberLinks=true
+
+# whether to suppress "extensions" json-prop for object members
+# (on the object representation only). Defaults to false.
+#isis.viewer.restfulobjects.suppressMemberExtensions=true
+
+# whether to suppress "disabledReason" json-prop for object members
+# (on the object representation only). Defaults to false.
+#isis.viewer.restfulobjects.suppressMemberDisabledReason=true
+
+###############################################################################
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
new file mode 100644
index 0000000..41bd21b
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
@@ -0,0 +1,87 @@
+# 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.
+
+#
+# configuration file for the Wicket viewer
+#
+
+#
+# The maximum length of titles to display in standalone or parented tables.
+# Titles longer than this length will be truncated with trailing ellipses (...)
+#
+# For example, if set to 12, the title
+# "Buy milk on 15-Feb-13" will be truncated to "Buy milk ..."
+#
+# If set to 0, then only the icon will be shown.
+#
+isis.viewer.wicket.maxTitleLengthInStandaloneTables=0
+isis.viewer.wicket.maxTitleLengthInParentedTables=0
+
+
+#isis.viewer.wicket.datePattern=dd-MM-yyyy
+#isis.viewer.wicket.dateTimePattern=dd-MM-yyyy HH:mm
+#isis.viewer.wicket.datePickerPattern=DD-MM-YYYY
+
+#isis.viewer.wicket.datePattern=dd/MM/yy
+#isis.viewer.wicket.dateTimePattern=dd/MM/yy HH:mm
+#isis.viewer.wicket.datePickerPattern=DD/MM/YY
+
+
+
+#
+# whether to strip wicket tags from markup (default is true, as they may break some CSS rules)
+#
+#isis.viewer.wicket.stripWicketTags=false
+
+
+#
+# whether to suppress the 'rememberMe' checkbox on the login page (default is false)
+#
+#isis.viewer.wicket.suppressRememberMe=false
+
+#
+# if user attempts to access a protected URL before signing in, then as a convenience the viewer will continue
+# through to that destination after successful login. If you consider this to be a security risk then this flag
+# disables that behaviour (default is false).
+#
+#isis.viewer.wicket.clearOriginalDestination=true
+
+
+#
+# whether to show action dialogs on their own page rather than as a modal dialog (default is false)
+#
+#isis.viewer.wicket.disableModalDialogs=false
+
+
+#
+# the maximum number of pages to list in bookmark (default is 15)
+#
+#isis.viewer.wicket.bookmarkedPages.maxSize=15
+
+
+#
+# whether to show the bootstrap theme chooser (defaults false)
+#
+#isis.viewer.wicket.themes.showChooser=false
+isis.viewer.wicket.themes.showChooser=true
+
+#
+# comma-separated list of themes to choose from (default is to show all themes from bootswatch.com).
+#
+#isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
+isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..5cc79b5
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,308 @@
+<?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 id="WebApp_ID" version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Todo app</display-name>
+
+ <welcome-file-list>
+ <welcome-file>about/index.html</welcome-file>
+ </welcome-file-list>
+
+ <!-- shiro security configuration -->
+ <listener>
+ <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>ShiroFilter</filter-name>
+ <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ShiroFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+
+
+ <!-- which configuration directory to read overloaded property files from -->
+ <!--
+ Normally configuration like this should be done from outside your web
+ application. Especially if your configuration is not know in advance or
+ if it can change depending on where the application gets deployed.
+
+ For instance to configure this in Tomcat outside the application WAR add
+ the following line to your application context ( For more detail see:
+ http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Context_Parameters )
+
+ <Parameter name="isis.config.dir" value="/usr/local/tomcat/conf/"
+ override="true"/>
+
+ If your configuration directory is fixed you can enable the following
+ context parameter in here and forget about the outside part.
+
+ <context-param>
+ <param-name>isis.config.dir</param-name>
+ <param-value>location of your config directory if fixed</param-value>
+ </context-param>
+ -->
+
+
+ <!--
+ determines which additional configuration files to search for
+ -->
+ <context-param>
+ <param-name>isis.viewers</param-name>
+ <param-value>wicket,restfulobjects</param-value>
+ </context-param>
+
+
+ <!--
+ for diagnostics
+ -->
+ <filter>
+ <filter-name>IsisLogOnExceptionFilter</filter-name>
+ <filter-class>org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>IsisLogOnExceptionFilter</filter-name>
+ <url-pattern>/wicket/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>IsisLogOnExceptionFilter</filter-name>
+ <url-pattern>/restful/*</url-pattern>
+ </filter-mapping>
+
+
+ <!-- cache static resources for 1 day -->
+ <filter>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
+ <init-param>
+ <param-name>CacheTime</param-name>
+ <param-value>86400</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.js</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.jpg</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.html</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.swf</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Resource</servlet-name>
+ <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.css</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.png</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.jpg</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.gif</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.js</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.html</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.swf</url-pattern>
+ </servlet-mapping>
+
+
+
+ <!--
+ -
+ - config specific to the wicket-viewer
+ -
+ -->
+ <filter>
+ <filter-name>WicketFilter</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>webapp.ToDoApplication</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>WicketFilter</filter-name>
+ <url-pattern>/wicket/*</url-pattern>
+ </filter-mapping>
+
+
+ <context-param>
+ <param-name>configuration</param-name>
+ <!--
+ <param-value>deployment</param-value>
+ -->
+ <param-value>development</param-value>
+ </context-param>
+
+
+ <!--
+ -
+ - config specific to the restfulobjects-viewer
+ -
+ -->
+
+ <!--
+ THE FOLLOWING CONFIGURATION IS NOT REQUIRED IF THE WICKET VIEWER IS IN USE.
+ IF THE WICKET VIEWER CONFIGURATION IS REMOVED, THEN UNCOMMENT
+
+ <listener>
+ <listener-class>org.apache.isis.core.webapp.IsisWebAppBootstrapper</listener-class>
+ </listener>
+
+ <context-param>
+ <param-name>deploymentType</param-name>
+ <param-value>SERVER_EXPLORATION</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>isis.viewers</param-name>
+ <param-value>restfulobjects</param-value>
+ </context-param>
+ -->
+
+ <!-- bootstrap the RestEasy framework -->
+ <listener>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+ </listener>
+
+ <!-- used by RestEasy to determine the JAX-RS resources and other related configuration -->
+ <context-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.apache.isis.viewer.restfulobjects.server.RestfulObjectsApplication</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>resteasy.servlet.mapping.prefix</param-name>
+ <param-value>/restful/</param-value>
+ </context-param>
+
+
+ <!-- authenticate user, set up an Isis session -->
+ <filter>
+ <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
+ <filter-class>org.apache.isis.core.webapp.IsisSessionFilter</filter-class>
+ <!-- authentication required for REST -->
+ <init-param>
+ <param-name>authenticationSessionStrategy</param-name>
+ <param-value>org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyBasicAuth</param-value>
+ </init-param>
+ <init-param>
+ <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
+ <param-name>whenNoSession</param-name>
+ <param-value>basicAuthChallenge</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <!-- this is mapped to the entire app; however the IsisSessionFilter will "notice" if the session filter has already been
+ executed for the request pipeline, and if so will do nothing -->
+ <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ </filter-mapping>
+
+ <filter>
+ <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
+ <filter-class>org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ </filter-mapping>
+
+
+ <servlet>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ <url-pattern>/restful/*</url-pattern>
+ </servlet-mapping>
+
+
+ <!--
+ uncomment to use container-managed datasource;
+ for both container-managed (JTA) and non-container-managed transactions
+ -->
+ <!--
+ <resource-ref>
+ <description>db</description>
+ <res-ref-name>jdbc/quickstart</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ -->
+
+ <!--
+ uncomment to use container-managed datasource
+ with container-managed transactions (JTA).
+ -->
+ <!--
+ <resource-ref>
+ <description>db</description>
+ <res-ref-name>jdbc/quickstart-nontx</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ -->
+
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png b/mothballed/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png
new file mode 100644
index 0000000..5284fe7
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/about/index.html b/mothballed/example/application/todoapp/webapp/src/main/webapp/about/index.html
new file mode 100644
index 0000000..5762e8f
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/about/index.html
@@ -0,0 +1,175 @@
+<!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™ TodoApp</title>
+
+ <style type="text/css">
+body {
+ background-color: #1A467B;
+ font-family: Verdana, Helvetica, Arial;
+ 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="about/images/isis-logo.png" />
+
+ <p>
+ <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a framework to let you rapidly develop
+ domain-driven apps in Java. This app has been generated using Isis'
+ <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
+ which configures Isis to run a (quite feature rich) "todo" app.
+
+ <p>
+ The app itself consists of a single domain class, <tt>ToDoItem</tt>, along with a number of supporting
+ services.
+ </p>
+
+ <p>To access the app:</p>
+ <ul>
+ <li>
+ <p>
+ <b><a href="wicket/">wicket/</a></b>
+ </p>
+ <p>
+ provides accesses to a generic UI for end-users,
+ Isis' <a href="http://isis.apache.org/components/viewers/wicket/about.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="restful/">restful/</a>
+ </b>
+ </p>
+ <p>
+ provides access to a RESTful API conformant with the
+ <a href="http://restfulobjects.org">Restful Objects</a> spec</td>. This is part of Isis Core. The
+ implementation technology is JBoss RestEasy.
+ </p>
+ </li>
+ </ul>
+
+ <p>
+ The default user/password is <b><i>sven/pass</i></b> (as configured in the
+ <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">shiro.ini</a> file).
+ </p>
+
+ <p>
+ To build your own app, while you could start with this todo app and remove/rename as required, you are
+ probably better off using the extremely minimal
+ <a href="http://isis.apache.org/intro/getting-started/simpleapp-archetype.html" target="_blank">SimpleApp</a> archetype.
+ </p>
+
+ <h2>App contents</h2>
+ <p>The key files in this "todo" app are:</p>
+ <!-- the hrefs below are partially URL encoded to prevent them from being modified when the archetype is created -->
+ <ul>
+ <li>Domain classes (todo functionality) (in <tt>dom</tt> module)
+ <ul>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank"><tt>ToDoItem</tt></a> domain entity
+ </li>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItems.java" target="_blank"><tt>ToDoItems</tt></a> domain service (repository/factory)
+ </li>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoItemAnalysis.java" target="_blank"><tt>ToDoItemAnalysis</tt></a> application service analysing todo items
+ </li>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoAppDashboard.java" target="_blank"><tt>ToDoAppDashboard</tt></a> dashboard application service
+ </li>
+ </ul>
+ </li>
+ <li>Fixture scripts (in <tt>fixture</tt> module)
+ <ul>
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java" target="_blank"><tt>ToDoItemsFixtureService</tt></a> domain service to install fixtures at run-time
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml" target="_blank">WEB-INF/web.xml</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L98" target="_blank">ResourceCachingFilter</a></tt> and <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L134" target="_blank">ResourceServlet</a></tt> - filter and servlet for serving up static resources.
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L174" target="_blank">WicketFilter</a></tt> - filter for the wicket application, mapped to <tt>/wicket/*</tt>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L223" target="_blank">ResteasyBootstrap</a></tt>,
+ <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L240" target="_blank">IsisSessionFilterForRestfulObjects</a></tt>,
+ <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L271" target="_blank">RestfulObjectsRestEasyDispatcher</a></tt> - listeners, filters and servlets to bootstrap and map restful objects viewer to <tt>/restful/*</tt>.
+ </li>
+ <li>commented out <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L208" target="_blank">IsisWebAppBootstrapper</a></tt> listener; this is NOT required unless wicket viewer config is removed
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/isis.properties" target="_blank">WEB-INF/isis.properties</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li><tt>isis.services</tt> - explicitly loaded framework-provide domain services. Other services (including <tt>ToDoItems</tt> and <tt>ToDoItemsFixtureService</tt> described above),
+ are loaded automatically from the classpath.
+ </li>
+ <li><tt>isis.persistor</tt> - specifies to use Isis' integration with <a href="http://datanucleus.org">DataNucleus</a> for (JDO-based) persistence.
+ </li>
+ <li><tt>isis.authentication</tt> and <tt>isis.authorization</tt> - specifies to use Isis' integration with <a href="http://shiro.apache.org">Apache Shiro</a> for security.
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties" target="_blank">WEB-INF/persistor_datanucleus.properties</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li>configuration for the DataNucleus (JDO) object store
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor.properties" target="_blank">WEB-INF/persistor.properties</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li>JDBC URL for DataNucleus (JDO) object store
+ </li>
+ </ul>
+ </li>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">WEB-INF/shiro.ini</a></tt> (in <tt>webapp</tt> module)
+ <ul>
+ <li>configuration for Shiro security
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/css/application.css
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/css/application.css b/mothballed/example/application/todoapp/webapp/src/main/webapp/css/application.css
new file mode 100644
index 0000000..7cc31cf
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/css/application.css
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+.navbar-brand img {
+ margin-top: -7px;
+ margin-left: 5px;
+}
+
+.x-key label.scalarName {
+ color: red;
+}
+
+tr.todo {
+}
+
+tr.done {
+ text-decoration: line-through;
+ color: #d3d3d3;
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn
new file mode 100644
index 0000000..016c9b8
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png
new file mode 100644
index 0000000..2c417fb
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
new file mode 100644
index 0000000..7a164e1
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png
new file mode 100644
index 0000000..ee2feb4
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn
new file mode 100644
index 0000000..4983ca9
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/scripts/application.js
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/scripts/application.js b/mothballed/example/application/todoapp/webapp/src/main/webapp/scripts/application.js
new file mode 100644
index 0000000..d8cf6fe
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/scripts/application.js
@@ -0,0 +1,3 @@
+$(document).ready(function() {
+ /// here...
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/pom.xml b/mothballed/example/archetype/todoapp/pom.xml
new file mode 100644
index 0000000..dfc82e5
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/pom.xml
@@ -0,0 +1,50 @@
+<?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" 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>
+ <version>1.8.0-SNAPSHOT</version>
+ <relativePath>../../../core/pom.xml</relativePath>
+ </parent>
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/appended-resources/supplemental-models.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/appended-resources/supplemental-models.xml b/mothballed/example/archetype/todoapp/src/main/appended-resources/supplemental-models.xml
new file mode 100644
index 0000000..01c58d8
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/appended-resources/supplemental-models.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.
+-->
+<supplementalDataModels
+ xmlns="http://maven.apache.org/supplemental-model/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/supplemental-model/1.0.0
+ http://maven.apache.org/xsd/supplemental-model-1.0.0.xsd">
+
+</supplementalDataModels>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/mothballed/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..fbe878e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,167 @@
+<?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.
+-->
+<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">
+ <fileSets>
+ <fileSet encoding="UTF-8">
+ <directory/>
+ <includes>
+ <include>.gitattributes</include>
+ <include>.gitignore</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <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>
+ </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>**/*.pdn</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/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.gitattributes
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.gitattributes b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.gitattributes
new file mode 100644
index 0000000..b1eafb6
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.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
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore
new file mode 100644
index 0000000..ad3f5e2
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore
@@ -0,0 +1,40 @@
+*~
+*.swp
+*.class
+bin/
+target/
+target-ide/
+logs/
+.settings/
+.project
+.classpath
+.idea
+*.iml
+
+JArchitectOut/
+*.jdproj
+
+neo4j_DB/
+
+# log files
+datanucleus.log
+isis.log
+hs_err_pid*.log
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+dependency-reduced-pom.xml
+pom.xml.tag
+pom.xml.next
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+
+.clover/
+*.jdproj
+JArchitectOut/
+
+
+rebel.xml
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties
new file mode 100644
index 0000000..2040d89
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties
@@ -0,0 +1,44 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+${symbol_pound} LOG4J Configuration
+${symbol_pound} ===================
+
+${symbol_pound} 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
+${symbol_pound}log4j.appender.A1.Threshold=INFO
+
+${symbol_pound} Categories
+${symbol_pound} Each category can be set to a "level", and to direct to an appender
+
+${symbol_pound} 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
+
+
+${symbol_pound} Hbase libs logging
+log4j.category.org.apache.hadoop=INFO,A1
+log4j.category.org.apache.zookeeper=INFO,A1
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
new file mode 100644
index 0000000..38e5063
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
@@ -0,0 +1,162 @@
+<?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>${groupId}</groupId>
+ <artifactId>${rootArtifactId}</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <artifactId>${artifactId}</artifactId>
+ <name>ToDo App DOM</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-maven-plugin</artifactId>
+ <version>${datanucleus-maven-plugin.version}</version>
+ <configuration>
+ <fork>false</fork>
+ <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
+ <verbose>true</verbose>
+ <props>${basedir}/datanucleus.properties</props>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>enhance</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-maven-plugin</artifactId>
+ <versionRange>[3.2.0-release,)</versionRange>
+ <goals>
+ <goal>enhance</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-applib</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-unittestsupport</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Bytecode libraries (for mocking) -->
+ <dependency>
+ <groupId>org.objenesis</groupId>
+ <artifactId>objenesis</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>isis-validate</id>
+ <activation>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.isis.tool</groupId>
+ <artifactId>isis-maven-plugin</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ <configuration>
+ <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.isis.example.application</groupId>
+ <artifactId>todoapp-dom</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </dependency>
+ <!--
+ ... workaround to avoid conflict with plexus-default
+ (not sure why exclusions in the isis-maven-plugin aren't sufficient, though ...
+ -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>16.0.1</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>validate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml
new file mode 100644
index 0000000..020d759
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml
@@ -0,0 +1,29 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?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="quickstart">
+ </persistence-unit>
+</persistence>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
new file mode 100644
index 0000000..2686139
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
@@ -0,0 +1,86 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package app;
+
+import java.util.List;
+import org.apache.isis.applib.AbstractViewModel;
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.applib.annotation.CollectionLayout;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.RenderType;
+
+public class ToDoAppDashboard extends AbstractViewModel {
+
+ //region > identification in the UI
+ public String title() {
+ return "Dashboard";
+ }
+ //endregion
+
+ //region > ViewModel contract
+ private String memento;
+
+ @Override
+ public String viewModelMemento() {
+ return memento;
+ }
+
+ @Override
+ public void viewModelInit(final String memento) {
+ this.memento = memento;
+ }
+
+ //endregion
+
+ //region > getAnalysisByCategory (collection)
+ @CollectionLayout(
+ named="By Category",
+ render = RenderType.EAGERLY
+ )
+ @Collection(
+ editing = Editing.DISABLED
+ )
+ public List<ToDoItemsByCategoryViewModel> getAnalysisByCategory() {
+ return toDoItemAnalysis.toDoItemsByCategory();
+ }
+ //endregion
+
+ //region > getAnalysisByDateRange (collection)
+ @CollectionLayout(
+ named="By Date Range",
+ render = RenderType.EAGERLY
+ )
+ @Collection(
+ editing = Editing.DISABLED
+ )
+ public List<ToDoItemsByDateRangeViewModel> getAnalysisByDateRange() {
+ return toDoItemAnalysis.toDoItemsByDateRange();
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItemAnalysis toDoItemAnalysis;
+
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json
new file mode 100644
index 0000000..3421543
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json
@@ -0,0 +1,26 @@
+{
+ "columns": [
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 12,
+ "collections": {
+ "analysisByCategory": {}
+ }
+ }
+ ],
+ "actions": {
+ "downloadLayout": {},
+ "refreshLayout": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png
new file mode 100644
index 0000000..fe6e6a1
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
new file mode 100644
index 0000000..190c7ba
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
@@ -0,0 +1,35 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package app;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.services.homepage.AbstractHomePageDashboardService;
+
+@DomainService(nature = NatureOfService.DOMAIN)
+public class ToDoAppDashboardService extends AbstractHomePageDashboardService<ToDoAppDashboard> {
+
+ public ToDoAppDashboardService() {
+ super(ToDoAppDashboard.class);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
new file mode 100644
index 0000000..f5ff7f9
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
@@ -0,0 +1,129 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package app;
+
+import dom.todo.ToDoItem.Category;
+
+import java.util.Arrays;
+import java.util.List;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainServiceLayout(
+ named="Analysis",
+ menuOrder = "20")
+@DomainService
+public class ToDoItemAnalysis {
+
+
+ //region > identification in the UI
+ public String getId() {
+ return "analysis";
+ }
+
+ public String iconName() {
+ return "ToDoItem";
+ }
+ //endregion
+
+
+ //region > byCategory (action)
+ @ActionLayout(
+ cssClassFa="fa fa-pie-chart",
+ named="By Category",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ @MemberOrder(sequence = "1")
+ public List<ToDoItemsByCategoryViewModel> toDoItemsByCategory() {
+ final List<Category> categories = Arrays.asList(Category.values());
+ return Lists.newArrayList(Iterables.transform(categories, byCategory()));
+ }
+
+ private Function<Category, ToDoItemsByCategoryViewModel> byCategory() {
+ return new Function<Category, ToDoItemsByCategoryViewModel>(){
+ @Override
+ public ToDoItemsByCategoryViewModel apply(final Category category) {
+ return new ToDoItemsByCategoryViewModel(category);
+ }
+ };
+ }
+ //endregion
+
+ //region > byDateRange (action)
+
+ public enum DateRange {
+ OverDue,
+ Today,
+ Tomorrow,
+ ThisWeek,
+ Later,
+ Unknown,
+ }
+
+ @ActionLayout(
+ cssClassFa="fa fa-calendar",
+ named="By Date Range",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ @MemberOrder(sequence = "1")
+ public List<ToDoItemsByDateRangeViewModel> toDoItemsByDateRange() {
+ final List<DateRange> dateRanges = Arrays.asList(DateRange.values());
+ return Lists.newArrayList(Iterables.transform(dateRanges, byDateRange()));
+ }
+
+ private static Function<DateRange, ToDoItemsByDateRangeViewModel> byDateRange() {
+ return new Function<DateRange, ToDoItemsByDateRangeViewModel>(){
+ @Override
+ public ToDoItemsByDateRangeViewModel apply(final DateRange dateRange) {
+ return new ToDoItemsByDateRangeViewModel(dateRange);
+ }
+ };
+ }
+ //endregion
+
+ //region > forCategory (programmatic)
+ @Programmatic
+ public ToDoItemsByCategoryViewModel toDoItemsForCategory(final Category category) {
+ return byCategory().apply(category);
+ }
+
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
new file mode 100644
index 0000000..f40e14d
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
@@ -0,0 +1,53 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package app;
+
+import dom.todo.ToDoItem;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Contributed;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
+public class ToDoItemAnalysisContributions {
+
+
+ //region > analyseCategory (action)
+ @ActionLayout(contributed = Contributed.AS_ACTION)
+ @Action(
+ semantics = SemanticsOf.SAFE
+ )
+ public ToDoItemsByCategoryViewModel analyseCategory(final ToDoItem item) {
+ return toDoAppAnalysis.toDoItemsForCategory(item.getCategory());
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItemAnalysis toDoAppAnalysis;
+
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
new file mode 100644
index 0000000..9226e54
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
@@ -0,0 +1,171 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package app;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItems;
+
+import java.util.Arrays;
+import java.util.List;
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.CollectionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.RenderType;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.util.ObjectContracts;
+
+@DomainObjectLayout(
+ named="By Category",
+ bookmarking = BookmarkPolicy.AS_ROOT
+)
+@DomainObject(
+ nature = Nature.VIEW_MODEL
+)
+public class ToDoItemsByCategoryViewModel
+ implements Comparable<ToDoItemsByCategoryViewModel> {
+
+ //region > constructors
+ public ToDoItemsByCategoryViewModel() {
+ }
+ public ToDoItemsByCategoryViewModel(final Category category) {
+ setCategory(category);
+ }
+ //endregion
+
+
+ //region > category (property)
+ private Category category;
+
+ @Title
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(final Category category) {
+ this.category = category;
+ }
+ //endregion
+
+ //region > notYetComplete (property), complete (property)
+ @PropertyLayout(
+ multiLine=5
+ )
+ public String getNotYetComplete() {
+ final List<ToDoItem> notYetComplete = getItemsNotYetComplete();
+ return Joiner.on(", ").join(
+ Iterables.transform(subcategories(), summarizeBySubcategory(notYetComplete)));
+ }
+
+ @PropertyLayout(
+ multiLine=5
+ )
+ public String getComplete() {
+ final List<ToDoItem> completeInCategory = getItemsComplete();
+ return Joiner.on(", ").join(
+ Iterables.transform(subcategories(), summarizeBySubcategory(completeInCategory)));
+ }
+
+ // //////////////////////////////////////
+
+ private Iterable<ToDoItem.Subcategory> subcategories() {
+ return Iterables.filter(Arrays.asList(ToDoItem.Subcategory.values()), ToDoItem.Subcategory.thoseFor(getCategory()));
+ }
+
+ private Function<ToDoItem.Subcategory, String> summarizeBySubcategory(final Iterable<ToDoItem> itemsInCategory) {
+ return new Function<ToDoItem.Subcategory, String>() {
+ @Override
+ public String apply(final ToDoItem.Subcategory subcategory) {
+ return subcategory + ": " + countIn(itemsInCategory, subcategory);
+ }
+ };
+ }
+
+ private static int countIn(final Iterable<ToDoItem> items, final ToDoItem.Subcategory subcategory) {
+ return Iterables.size(Iterables.filter(items,
+ ToDoItem.Predicates.thoseSubcategorised(subcategory)));
+ }
+ //endregion
+
+ //region > getItemsNotYetComplete (collection), getItemsComplete (collection)
+ /**
+ * All those items {@link ToDoItems${symbol_pound}notYetComplete() not yet complete}, for this {@link ${symbol_pound}getCategory() category}.
+ */
+ @CollectionLayout(
+ render = RenderType.EAGERLY
+ )
+ public List<ToDoItem> getItemsNotYetComplete() {
+ final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
+ return Lists.newArrayList(Iterables.filter(notYetComplete, ToDoItem.Predicates.thoseCategorised(getCategory())));
+ }
+
+ /**
+ * All those items {@link ToDoItems${symbol_pound}complete() complete}, for this {@link ${symbol_pound}getCategory() category}.
+ */
+ @CollectionLayout(
+ render = RenderType.EAGERLY
+ )
+ public List<ToDoItem> getItemsComplete() {
+ final List<ToDoItem> complete = toDoItems.completeNoUi();
+ return Lists.newArrayList(Iterables.filter(complete, ToDoItem.Predicates.thoseCategorised(getCategory())));
+ }
+
+ //endregion
+
+ //region > deleteCompleted (action)
+ @ActionLayout(
+ named="Delete"
+ )
+ public ToDoItemsByCategoryViewModel deleteCompleted() {
+ for (final ToDoItem item : getItemsComplete()) {
+ container.removeIfNotAlready(item);
+ }
+ // force reload of page
+ return this;
+ }
+
+ //endregion
+
+ //region > compareTo
+ @Override
+ public int compareTo(final ToDoItemsByCategoryViewModel other) {
+ return ObjectContracts.compare(this, other, "category");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
new file mode 100644
index 0000000..c87b554
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
@@ -0,0 +1,43 @@
+{
+ "columns": [
+ {
+ "span": 4,
+ "memberGroups": {
+ "General": {
+ "members": {
+ "category": {}
+ }
+ },
+ "Analysis": {
+ "members": {
+ "notYetComplete": {},
+ "complete": {}
+ }
+ }
+ }
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 8,
+ "collections": {
+ "itemsNotYetComplete": {},
+ "itemsComplete": {
+ "actions": {
+ "deleteCompleted": {}
+ }
+ }
+ }
+ }
+ ],
+ "actions": {
+ "downloadLayout": {},
+ "refreshLayout": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
new file mode 100644
index 0000000..c22ab2b
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png differ
[29/29] isis git commit: ISIS-903: integtests now calls shutdown so
PoWriter can dump .pot file to log on shutdown;
skeleton impl and new unit tests (marked @Ignore) for PoReader;
updates to logging.properties for the simpleapp.
Posted by da...@apache.org.
ISIS-903: integtests now calls shutdown so PoWriter can dump .pot file to log on shutdown; skeleton impl and new unit tests (marked @Ignore) for PoReader; updates to logging.properties for the simpleapp.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/68899a29
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/68899a29
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/68899a29
Branch: refs/heads/ISIS-903
Commit: 68899a2944155c77710da7ef5b103f37079ccf10
Parents: 2b5f47c
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Feb 14 14:00:42 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Feb 14 14:00:42 2015 +0000
----------------------------------------------------------------------
.../integtestsupport/IsisSystemForTest.java | 50 ++++++++-
.../metamodel/services/i18n/po/PoReader.java | 65 ++++++++++--
.../metamodel/services/i18n/po/PoWriter.java | 101 ++++++++++++++++++
.../metamodel/services/i18n/po/PotWriter.java | 102 ------------------
.../services/i18n/po/TranslationServicePo.java | 8 +-
.../services/i18n/po/PoReaderTest.java | 105 +++++++++++++++++++
.../runtime/services/ServicesInstaller.java | 3 +-
.../IsisConfigurationForJdoIntegTests.java | 2 +
example/application/simpleapp/.gitignore | 1 +
.../simpleapp/integtests/logging.properties | 8 ++
.../integration/SimpleAppSystemInitializer.java | 9 +-
.../java/integration/specs/simple/RunSpecs.java | 5 +-
.../src/main/webapp/WEB-INF/logging.properties | 11 +-
13 files changed, 336 insertions(+), 134 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index 03fce17..0da50c0 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -21,6 +21,7 @@ package org.apache.isis.core.integtestsupport;
import java.util.Arrays;
import java.util.List;
+import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.Assert;
@@ -34,6 +35,7 @@ import org.apache.isis.applib.services.command.Command;
import org.apache.isis.applib.services.command.CommandContext;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
import org.apache.isis.core.metamodel.adapter.oid.RootOid;
@@ -47,7 +49,8 @@ import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
import org.apache.isis.core.runtime.fixtures.FixturesInstallerDelegate;
import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
import org.apache.isis.core.runtime.logging.IsisLoggingConfigurer;
-import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
+import org.apache.isis.core.runtime.services.ServicesInstaller;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation;
import org.apache.isis.core.runtime.system.DeploymentType;
import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.core.runtime.system.persistence.ObjectStore;
@@ -129,6 +132,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
if(isft == null) {
throw new IllegalStateException("No IsisSystemForTest available on thread; call #set(IsisSystemForTest) first");
}
+
return isft;
}
@@ -165,7 +169,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
private AuthenticationRequest authenticationRequest = new AuthenticationRequestNameOnly("tester");
- private IsisConfiguration configuration;
+ private IsisConfigurationDefault configuration;
private PersistenceMechanismInstaller persistenceMechanismInstaller = new InMemoryPersistenceMechanismInstaller();
private MetaModelValidator metaModelValidator;
private ProgrammingModel programmingModel;
@@ -178,7 +182,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
private org.apache.log4j.Level level;
public Builder with(IsisConfiguration configuration) {
- this.configuration = configuration;
+ this.configuration = (IsisConfigurationDefault) configuration;
return this;
}
@@ -196,9 +200,14 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
if(packagePrefixes.length == 0) {
throw new IllegalArgumentException("Specify packagePrefixes to search for @DomainService-annotated services");
}
- final ServicesInstallerFromAnnotation installer = new ServicesInstallerFromAnnotation();
+
+ configuration.put(
+ "isis.services.ServicesInstallerFromAnnotation.packagePrefix",
+ Joiner.on(",").join(packagePrefixes)
+ );
+
+ final ServicesInstaller installer = new ServicesInstallerFromConfigurationAndAnnotation();
installer.setConfiguration(configuration);
- installer.withPackagePrefixes(packagePrefixes);
final List<Object> serviceList = installer.getServices(null);
this.services.addAll(serviceList);
@@ -239,6 +248,33 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
if(level != null) {
isisSystem.setLevel(level);
}
+
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public synchronized void run() {
+ try {
+ if (isisSystem != null) {
+ isisSystem.tearDownSystem();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ try {
+ if (isisSystem != null) {
+ isisSystem.shutdown();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ try {
+ IsisContext.shutdown();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
return isisSystem;
}
@@ -389,6 +425,10 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
}
}
+ private void shutdown() {
+ isisSystem.shutdown();
+ }
+
public void bounceSystem() throws Exception {
firePreBounceSystem();
closeSession();
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java
index 293488f..514c81c 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java
@@ -18,9 +18,15 @@
*/
package org.apache.isis.core.metamodel.services.i18n.po;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
+import com.google.common.base.Charsets;
import com.google.common.collect.Maps;
+import com.google.common.io.Files;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,20 +51,59 @@ class PoReader extends PoAbstract {
public String translate(final String context, final String msgId, final Locale targetLocale) {
- Map<MsgIdAndContext, String> translationByKey = translationByKeyByLocale.get(targetLocale);
- if(translationByKey == null) {
- translationByKey = Maps.newTreeMap();
- translationByKeyByLocale.put(targetLocale, translationByKey);
- }
+ final Map<MsgIdAndContext, String> translationsByKey = readAndCacheTranslationsIfRequired(targetLocale);
final MsgIdAndContext key = new MsgIdAndContext(msgId, context);
- String translation = translationByKey.get(key);
- if (translation == null) {
- translation = translate(targetLocale, key);
- translationByKey.put(key, translation);
+ final String translation = translationsByKey.get(key);
+ if (translation != null) {
+ return translation;
+ }
+
+ final MsgIdAndContext keyNoContext = new MsgIdAndContext(msgId, "");
+ final String translationNoContext = translationsByKey.get(keyNoContext);
+ if (translationNoContext != null) {
+ return translationNoContext;
+ }
+
+ LOG.warn("No translation found for: " + key);
+ return msgId;
+ }
+
+ private Map<MsgIdAndContext, String> readAndCacheTranslationsIfRequired(final Locale locale) {
+ Map<MsgIdAndContext, String> translationsByKey = translationByKeyByLocale.get(locale);
+ if(translationsByKey != null) {
+ return translationsByKey;
+ }
+
+ translationsByKey = Maps.newHashMap();
+ read(locale, translationsByKey);
+ translationByKeyByLocale.put(locale, translationsByKey);
+
+ return translationsByKey;
+ }
+
+ /**
+ * @param locale - the .po file to load
+ * @param translationsByKey - the translations to be populated
+ */
+ private void read(final Locale locale, final Map<MsgIdAndContext, String> translationsByKey) {
+ final List<String> fileContents = readFile(locale);
+
+ // TODO: parse fileContents into translationsByKey
+ }
+
+ List<String> readFile(final Locale locale) {
+ final File file = locateFile(locale);
+ try {
+ return Files.readLines(file, Charsets.UTF_8);
+ } catch (final IOException ex) {
+ LOG.warn("Could not locate file for locale: " + locale, ex);
+ return Collections.emptyList();
}
+ }
- return translation;
+ File locateFile(final Locale locale) {
+ return null;
}
private String translate(final Locale locale, final MsgIdAndContext key) {
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoWriter.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoWriter.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoWriter.java
new file mode 100644
index 0000000..372a2df
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoWriter.java
@@ -0,0 +1,101 @@
+/*
+ * 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.core.metamodel.services.i18n.po;
+
+import java.util.Collection;
+import java.util.Locale;
+import java.util.Map;
+import java.util.NavigableSet;
+import com.google.common.collect.TreeMultimap;
+import org.joda.time.LocalDateTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+class PoWriter extends PoAbstract {
+
+ public static Logger LOG = LoggerFactory.getLogger(PoWriter.class);
+
+ private final TreeMultimap<String, String> contextsByMsgId = TreeMultimap.create();
+
+ public PoWriter(final TranslationServicePo translationServicePo) {
+ super(translationServicePo);
+ }
+
+ //region > init, shutdown
+ void init(final Map<String,String> config) {
+ }
+
+ void shutdown() {
+ LOG.info("");
+ LOG.info("");
+ LOG.info("################################################################################");
+ LOG.info("#");
+ LOG.info("# " + LocalDateTime.now().toString("yyyy-MM-dd HH:mm:ss"));
+ LOG.info("#");
+ LOG.info("################################################################################");
+ LOG.info("");
+ LOG.info("");
+ LOG.info("");
+ LOG.info(toPo());
+ LOG.info("");
+ LOG.info("");
+ LOG.info("");
+ }
+ //endregion
+
+
+ public String translate(final String context, final String originalText, final Locale targetLocale) {
+ final NavigableSet<String> contexts = contextsByMsgId.get(originalText);
+ contexts.add(context);
+ return originalText;
+ }
+
+ /**
+ * Not API
+ */
+ String toPo() {
+ final Map<String, Collection<String>> messages = messagesWithContext();
+ final StringBuilder buf = new StringBuilder();
+ for (String message : messages.keySet()) {
+ final Collection<String> contexts = messages.get(message);
+ for (String context : contexts) {
+ buf.append("#: ").append(context).append("\n");
+ }
+ buf.append("msgid: \"").append(message).append("\"\n");
+ buf.append("msgstr: \"\"\n");
+ buf.append("\n\n\n");
+ }
+ return buf.toString();
+ }
+
+ /**
+ * Returns the set of messages encountered and cached by the service (the key of the map) along with a set of
+ * context strings (the value of the map)
+ *
+ * <p>
+ * The intention is that an implementation running in prototype mode should retain all requests to
+ * {@link #translate(String, String, java.util.Locale)}, such that they can be translated and used by the
+ * same implementation in non-prototype mode.
+ * </p>
+ */
+ Map<String, Collection<String>> messagesWithContext() {
+ return contextsByMsgId.asMap();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java
deleted file mode 100644
index 6247c86..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java
+++ /dev/null
@@ -1,102 +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.core.metamodel.services.i18n.po;
-
-import java.util.Collection;
-import java.util.Locale;
-import java.util.Map;
-import java.util.NavigableSet;
-import com.google.common.collect.TreeMultimap;
-import org.joda.time.LocalDateTime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class PotWriter extends PoAbstract {
-
- public static Logger LOG = LoggerFactory.getLogger(PotWriter.class);
-
- private final TreeMultimap<String, String> contextsByMsgId = TreeMultimap.create();
-
- public PotWriter(final TranslationServicePo translationServicePo) {
- super(translationServicePo);
- }
-
-
- //region > init, shutdown
- void init(final Map<String,String> config) {
- }
-
- void shutdown() {
- LOG.info("");
- LOG.info("");
- LOG.info("################################################################################");
- LOG.info("#");
- LOG.info("# " + LocalDateTime.now().toString("yyyy-MM-dd HH:mm:ss"));
- LOG.info("#");
- LOG.info("################################################################################");
- LOG.info("");
- LOG.info("");
- LOG.info("");
- LOG.info(toPo());
- LOG.info("");
- LOG.info("");
- LOG.info("");
- }
- //endregion
-
-
- public String translate(final String context, final String originalText, final Locale targetLocale) {
- final NavigableSet<String> contexts = contextsByMsgId.get(originalText);
- contexts.add(context);
- return originalText;
- }
-
- /**
- * Not API
- */
- String toPo() {
- final Map<String, Collection<String>> messages = messagesWithContext();
- final StringBuilder buf = new StringBuilder();
- for (String message : messages.keySet()) {
- final Collection<String> contexts = messages.get(message);
- for (String context : contexts) {
- buf.append("#: ").append(context).append("\n");
- }
- buf.append("msgid: \"").append(message).append("\"\n");
- buf.append("msgstr: \"\"\n");
- buf.append("\n\n\n");
- }
- return buf.toString();
- }
-
- /**
- * Returns the set of messages encountered and cached by the service (the key of the map) along with a set of
- * context strings (the value of the map)
- *
- * <p>
- * The intention is that an implementation running in prototype mode should retain all requests to
- * {@link #translate(String, String, java.util.Locale)}, such that they can be translated and used by the
- * same implementation in non-prototype mode.
- * </p>
- */
- Map<String, Collection<String>> messagesWithContext() {
- return contextsByMsgId.asMap();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java
index a5b012d..a8cf426 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java
@@ -39,7 +39,7 @@ public class TranslationServicePo implements TranslationService {
private PoAbstract po;
public TranslationServicePo() {
- po = new PotWriter(this);
+ po = new PoWriter(this);
}
//region > init, shutdown
@@ -48,7 +48,9 @@ public class TranslationServicePo implements TranslationService {
@PostConstruct
public void init(final Map<String,String> config) {
final String deploymentType = config.get("isis.deploymentType");
- prototype = deploymentType.toLowerCase().contains("prototype");
+ prototype = deploymentType==null ||
+ deploymentType.toLowerCase().contains("prototype") ||
+ deploymentType.toLowerCase().contains("test") ;
if (!prototype) {
po = new PoReader(this);
@@ -81,7 +83,7 @@ public class TranslationServicePo implements TranslationService {
if (!prototype) {
throw new IllegalStateException("Not in prototype mode");
}
- return ((PotWriter)po).toPo();
+ return ((PoWriter)po).toPo();
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/metamodel/src/test/java/org/apache/isis/core/metamodel/services/i18n/po/PoReaderTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/services/i18n/po/PoReaderTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/services/i18n/po/PoReaderTest.java
new file mode 100644
index 0000000..bbab018
--- /dev/null
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/services/i18n/po/PoReaderTest.java
@@ -0,0 +1,105 @@
+package org.apache.isis.core.metamodel.services.i18n.po;
+
+import java.util.List;
+import java.util.Locale;
+import com.google.common.collect.Lists;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class PoReaderTest {
+
+ PoReader poReader;
+
+ public static class ReadFile extends PoReaderTest {
+
+ @Ignore // TODO
+ @Test
+ public void singleContext() throws Exception {
+
+ // given
+ final String context =
+ "org.apache.isis.applib.services.bookmark.BookmarkHolderAssociationContributions#object()";
+ final String msgId = "Work of art";
+ final String msgStr = "Objet d'art";
+
+ poReader = new PoReader(null) {
+ @Override
+ List<String> readFile(final Locale locale) {
+ final List<String> lines = Lists.newArrayList();
+ lines.add(String.format("#: %s", context));
+ lines.add(String.format("msgid: \"%s\"", msgId));
+ lines.add(String.format("msgstr: \"%s\"", msgStr));
+ return lines;
+ }
+ };
+
+ // when
+ final String translated = poReader.translate(context, msgId, Locale.FRENCH);
+
+ // then
+ assertThat(translated, is(equalTo(msgStr)));
+ }
+
+ @Ignore // TODO
+ @Test
+ public void multipleContext() throws Exception {
+
+ // given
+ final String context1 =
+ "fixture.simple.SimpleObjectsFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String)";
+ final String context2 =
+ "org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String)";
+ final String msgId = "Parameters";
+ final String msgStr = "Paramètres";
+
+ poReader = new PoReader(null) {
+ @Override
+ List<String> readFile(final Locale locale) {
+ final List<String> lines = Lists.newArrayList();
+ lines.add(String.format("#: %s", context1));
+ lines.add(String.format("#: %s", context2));
+ lines.add(String.format("msgid: \"%s\"", msgId));
+ lines.add(String.format("msgstr: \"%s\"", msgStr));
+ return lines;
+ }
+ };
+ // when
+ final String translated = poReader.translate(context1, msgId, Locale.FRENCH);
+
+ // then
+ assertThat(translated, is(equalTo(msgStr)));
+
+ // when
+ final String translated2 = poReader.translate(context2, msgId, Locale.FRENCH);
+
+ // then
+ assertThat(translated2, is(equalTo(msgStr)));
+ }
+
+ @Ignore // TODO
+ @Test
+ public void noTranslation() throws Exception {
+
+ // given
+
+ poReader = new PoReader(null) {
+ @Override
+ List<String> readFile(final Locale locale) {
+ return Lists.newArrayList();
+ }
+ };
+
+ // when
+ final String translated = poReader.translate("someContext", "Something to translate", Locale.FRENCH);
+
+ // then
+ assertThat(translated, is(equalTo("Something to translate")));
+ }
+
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
index 250a60c..604c8bc 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
@@ -22,9 +22,10 @@ package org.apache.isis.core.runtime.services;
import java.util.List;
import org.apache.isis.core.commons.components.Installer;
+import org.apache.isis.core.commons.config.IsisConfigurationAware;
import org.apache.isis.core.runtime.system.DeploymentType;
-public interface ServicesInstaller extends Installer {
+public interface ServicesInstaller extends Installer, IsisConfigurationAware {
/**
* NB: this has the suffix '-installer' because in the command line we must
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/IsisConfigurationForJdoIntegTests.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/IsisConfigurationForJdoIntegTests.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/IsisConfigurationForJdoIntegTests.java
index ee6de7e..d57c95a 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/IsisConfigurationForJdoIntegTests.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/IsisConfigurationForJdoIntegTests.java
@@ -79,6 +79,8 @@ public class IsisConfigurationForJdoIntegTests extends IsisConfigurationDefault
add(DataNucleusObjectStore.INSTALL_FIXTURES_KEY , "true");
add(PersistenceConstants.ENFORCE_SAFE_SEMANTICS, ""+PersistenceConstants.ENFORCE_SAFE_SEMANTICS_DEFAULT);
+
+ add("isis.deploymentType", "server_prototype");
}
public final IsisConfigurationForJdoIntegTests addDataNucleusProperty(final String key, final String value) {
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/example/application/simpleapp/.gitignore
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/.gitignore b/example/application/simpleapp/.gitignore
index ad3f5e2..2e331eb 100644
--- a/example/application/simpleapp/.gitignore
+++ b/example/application/simpleapp/.gitignore
@@ -17,6 +17,7 @@ JArchitectOut/
neo4j_DB/
# log files
+i18n-po.log
datanucleus.log
isis.log
hs_err_pid*.log
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/example/application/simpleapp/integtests/logging.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/logging.properties b/example/application/simpleapp/integtests/logging.properties
index d0b81cb..d6ec4ed 100644
--- a/example/application/simpleapp/integtests/logging.properties
+++ b/example/application/simpleapp/integtests/logging.properties
@@ -33,6 +33,11 @@ log4j.appender.File.append=false
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+log4j.appender.i18n-po=org.apache.log4j.FileAppender
+log4j.appender.i18n-po.File=./i18n-po.log
+log4j.appender.i18n-po.Append=false
+log4j.appender.i18n-po.layout=org.apache.log4j.PatternLayout
+log4j.appender.i18n-po.layout.ConversionPattern=%m%n
! turn on the internal log4j debugging flag so we can see what it is doing
#log4j.debug=true
@@ -101,3 +106,6 @@ log4j.additivity.DataNucleus.Datastore.IDE=false
#log4j.logger.jdbc.connection=FATAL,connection
#log4j.additivity.jdbc.connection=false
+
+log4j.logger.org.apache.isis.core.metamodel.services.i18n.po.PoWriter=INFO,i18n-po
+log4j.additivity.org.apache.isis.core.metamodel.services.i18n.po.PotWriter=false
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/example/application/simpleapp/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/integration/SimpleAppSystemInitializer.java b/example/application/simpleapp/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
index fa67f2a..108a7fe 100644
--- a/example/application/simpleapp/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
+++ b/example/application/simpleapp/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
@@ -48,14 +48,7 @@ public class SimpleAppSystemInitializer {
// services annotated with @DomainService
withServicesIn( "dom.simple"
- ,"fixture.simple"
- ,"org.apache.isis.core.wrapper"
- ,"org.apache.isis.applib"
- ,"org.apache.isis.core.metamodel.services"
- ,"org.apache.isis.core.runtime.services"
- ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
- ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
- );
+ ,"fixture.simple" );
}
private static IsisConfiguration testConfiguration() {
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/example/application/simpleapp/integtests/src/test/java/integration/specs/simple/RunSpecs.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/integration/specs/simple/RunSpecs.java b/example/application/simpleapp/integtests/src/test/java/integration/specs/simple/RunSpecs.java
index b4d0913..b829818 100644
--- a/example/application/simpleapp/integtests/src/test/java/integration/specs/simple/RunSpecs.java
+++ b/example/application/simpleapp/integtests/src/test/java/integration/specs/simple/RunSpecs.java
@@ -18,13 +18,12 @@ package integration.specs.simple;
import cucumber.api.junit.Cucumber;
-import org.junit.runner.RunWith;
-
/**
* Runs scenarios in all <tt>.feature</tt> files (this package and any subpackages).
*/
-@RunWith(Cucumber.class)
+// TODO: reinstate
+//@RunWith(Cucumber.class)
@Cucumber.Options(
format = {
"html:target/cucumber-html-report"
http://git-wip-us.apache.org/repos/asf/isis/blob/68899a29/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties
index 0467c62..6b6086b 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties
@@ -68,6 +68,11 @@ log4j.appender.connection.Append=false
log4j.appender.connection.layout=org.apache.log4j.PatternLayout
log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+log4j.appender.i18n-po=org.apache.log4j.FileAppender
+log4j.appender.i18n-po.File=./logs/i18n-po.log
+log4j.appender.i18n-po.Append=false
+log4j.appender.i18n-po.layout=org.apache.log4j.PatternLayout
+log4j.appender.i18n-po.layout.ConversionPattern=%m%n
@@ -178,8 +183,10 @@ log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN
log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false
+log4j.logger.org.apache.isis.core.metamodel.services.i18n.po.PoWriter=INFO,i18n-po
+log4j.additivity.org.apache.isis.core.metamodel.services.i18n.po.PoWriter=false
# Application-specific logging
-log4j.logger.dom.todo.ToDoItem=DEBUG, Stderr
-log4j.additivity.dom.todo.ToDoItem=false
\ No newline at end of file
+log4j.logger.dom.simple.SimpleObject=DEBUG, Stderr
+log4j.additivity.dom.simple.SimpleObject=false
\ No newline at end of file
[13/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
deleted file mode 100644
index 54f35cd..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
+++ /dev/null
@@ -1,280 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} specify system components.
-${symbol_pound}
-${symbol_pound} The values correspond to the named components in the installer-registry.properties file
-${symbol_pound} in the org.apache.isis.core:isis-core-runtime JAR (in the org.apache.isis.core.runtime package)
-${symbol_pound}
-${symbol_pound} Although all configuration could reside in isis.properties, the recommendation is
-${symbol_pound} to split out into component specific files:
-${symbol_pound}
-${symbol_pound} xxx_yyy.properties files
-${symbol_pound}
-${symbol_pound} where
-${symbol_pound} * xxx is the component type, and
-${symbol_pound} * yyy is the component name.
-${symbol_pound}
-${symbol_pound} For example, viewer_wicket.properties holds configuration information specific to the Wicket viewer.
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-
-${symbol_pound}
-${symbol_pound} configure the persistor (object store) to use
-${symbol_pound}
-
-${symbol_pound} JDO/DataNucleus objectstore
-isis.persistor=datanucleus
-
-
-
-${symbol_pound}
-${symbol_pound} configure authentication mechanism to use (to logon to the system)
-${symbol_pound}
-
-${symbol_pound}isis.authentication=bypass
-isis.authentication=shiro
-
-
-${symbol_pound}
-${symbol_pound} configure authorization mechanism to use
-${symbol_pound}
-
-${symbol_pound}isis.authorization=bypass
-isis.authorization=shiro
-
-
-
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} MetaModel
-${symbol_pound}
-${symbol_pound} The metamodel typically does not require additional configuration, although
-${symbol_pound} the system components (defined above) may refine the metamodel for their needs.
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-
-${symbol_pound}
-${symbol_pound} additional programming model facets
-${symbol_pound}
-
-${symbol_pound}isis.reflector.facets.include=
-${symbol_pound}isis.reflector.facets.exclude=
-
-
-${symbol_pound}
-${symbol_pound} metamodel validator
-${symbol_pound}
-
-${symbol_pound}isis.reflector.validator=
-
-
-
-${symbol_pound}
-${symbol_pound} layoutMetadataReader(s)
-${symbol_pound}
-
-${symbol_pound} isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson
-
-
-
-${symbol_pound}
-${symbol_pound} patterns for applying CssClassFa facet (font-awesome icons) to member names
-${symbol_pound}
-isis.reflector.facet.cssClassFa.patterns=${symbol_escape}
- new.*:fa-plus,${symbol_escape}
- add.*:fa-plus-square,${symbol_escape}
- create.*:fa-plus,${symbol_escape}
- update.*:fa-edit,${symbol_escape}
- change.*:fa-edit,${symbol_escape}
- remove.*:fa-minus-square,${symbol_escape}
- move.*:fa-exchange,${symbol_escape}
- first.*:fa-star,${symbol_escape}
- find.*:fa-search,${symbol_escape}
- lookup.*:fa-search,${symbol_escape}
- clear.*:fa-remove,${symbol_escape}
- previous.*:fa-step-backward,${symbol_escape}
- next.*:fa-step-forward,${symbol_escape}
- list.*:fa-list, ${symbol_escape}
- all.*:fa-list, ${symbol_escape}
- download.*:fa-download, ${symbol_escape}
- upload.*:fa-upload, ${symbol_escape}
- execute.*:fa-bolt, ${symbol_escape}
- run.*:fa-bolt, ${symbol_escape}
- calculate.*:fa-calculator, ${symbol_escape}
- verify.*:fa-check-circle, ${symbol_escape}
- refresh.*:fa-refresh, ${symbol_escape}
- install.*:fa-wrench
-
-isis.reflector.facet.cssClass.patterns=${symbol_escape}
- delete.*:btn-warning,${symbol_escape}
- .*:btn-default
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Value facet defaults
-${symbol_pound}
-${symbol_pound} (see also viewer-specific config files, eg viewer_wicket.properties)
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound} as used by @Title of a date
-isis.value.format.date=dd-MM-yyyy
-
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Facet Decorators
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound}
-${symbol_pound} Providing such capabilities as i18n
-${symbol_pound}
-
-isis.reflector.facet-decorators=org.apache.isis.core.metamodel.facetdecorator.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Application Services and fixtures
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound}
-${symbol_pound} Specify the domain services.
-${symbol_pound}
-${symbol_pound} These are the most important configuration properties in the system, as they define
-${symbol_pound} the set of the classes for Isis to instantiate as domain service singletons.
-${symbol_pound} From these domain service instances the rest of the metamodel is discovered, while the
-${symbol_pound} end-user gains access to other domain objects by invoking the actions of the domain services.
-${symbol_pound}
-isis.services-installer=configuration-and-annotation
-isis.services.ServicesInstallerFromAnnotation.packagePrefix=app,${symbol_escape}
- dom.todo,${symbol_escape}
- fixture.todo,${symbol_escape}
- webapp.userprof,${symbol_escape}
- webapp.prototyping
-
-isis.services = ${symbol_escape}
- org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} customizable exception handling, ${symbol_escape}
- org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,${symbol_escape}
- ${symbol_pound},${symbol_escape}
- 1:webapp.CustomMementoService,${symbol_escape}
- 1:webapp.CustomRepresentationService
-
-
-${symbol_pound} Specify the (optional) test fixtures
-${symbol_pound}
-${symbol_pound} Fixtures are used to seed the object store with an initial set of data. For the
-${symbol_pound} in-memory object store, the fixtures are installed on every run. For other
-${symbol_pound} object stores, they are used only when the object store is first initialized.
-${symbol_pound}
-${symbol_pound}isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven
-
-
-${symbol_pound}
-${symbol_pound} required by EmailServiceDefault
-${symbol_pound}
-${symbol_pound}isis.service.email.sender.address=some.valid@email.address
-${symbol_pound}isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
-
-
-${symbol_pound}
-${symbol_pound} whether ExceptionRecognizers should also log any recognized exceptions
-${symbol_pound} (default false; enable for diagnostics/debugging)
-${symbol_pound}
-${symbol_pound}isis.services.exceprecog.logRecognizedExceptions=true
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Auditing, Publishing, Command
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound}
-${symbol_pound} Whether changes to objects should be audited; if not set, defaults to "none"
-${symbol_pound} - if not set or set to "none", can explicitly enable using @DomainObject(auditing=Auditing.ENABLED)
-${symbol_pound} - if set to "all", can explicitly disable using @Object(auditing=Auditing.DISABLED)
-${symbol_pound}
-${symbol_pound}isis.services.audit.objects=all|none
-
-${symbol_pound}
-${symbol_pound} Whether changes to objects should be published; if not set, defaults to "none"
-${symbol_pound} - if not set or set to "none", can explicitly enable using @DomainObject(publishing=Publishing.ENABLED)
-${symbol_pound} - if set to "all", can explicitly disable using @Object(publishing=Publishing.DISABLED)
-${symbol_pound}
-${symbol_pound}isis.services.publish.objects=all|none
-
-${symbol_pound}
-${symbol_pound} Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
-${symbol_pound} - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
-${symbol_pound} - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
-${symbol_pound}
-${symbol_pound}isis.services.publish.actions=all|none|ignoreQueryOnly
-
-
-${symbol_pound}
-${symbol_pound} Whether all (or all non-query only) actions should be reified as commands; if not set, defaults to "none"
-${symbol_pound} - if not set or set to "none", can explicitly enable using @Action(command=CommandReification.ENABLED)
-${symbol_pound} - if set to "all", can explicitly disable using @Action(command=CommandReification.DISABLED)
-${symbol_pound}
-${symbol_pound}isis.services.command.actions=all|none|ignoreQueryOnly
-
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Policies
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound}
-${symbol_pound} Whether editing of object properties is allowed; if not set, defaults to "true"
-${symbol_pound} - if not set or set to "true", can explicitly disable using @DomainObject(editing=Editing.DISABLED)
-${symbol_pound} - if set to "false", can explicitly enable using @DomainObject(editing=Editing.ENABLED)
-${symbol_pound}
-${symbol_pound}isis.objects.editing=true|false
-
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Viewer defaults
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound}isis.viewers.paged.standalone=30
-${symbol_pound}isis.viewers.paged.parented=10
-
-${symbol_pound}isis.viewers.propertyLayout.labelPosition=LEFT
-${symbol_pound}isis.viewers.parameterLayout.labelPosition=LEFT
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
deleted file mode 100644
index 9720880..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
+++ /dev/null
@@ -1,223 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-
-${symbol_pound}
-${symbol_pound} Isis uses log4j is used to provide system logging
-${symbol_pound}
-log4j.rootCategory=INFO, Console
-${symbol_pound}log4j.rootCategory=DEBUG, Console
-
-
-${symbol_pound} The console appender
-log4j.appender.Console=org.apache.log4j.ConsoleAppender
-log4j.appender.Console.target=System.out
-log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
-
-
-${symbol_pound} The stderr appender
-log4j.appender.Stderr=org.apache.log4j.ConsoleAppender
-log4j.appender.Stderr.target=System.err
-log4j.appender.Stderr.layout=org.apache.log4j.PatternLayout
-log4j.appender.Stderr.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
-
-
-${symbol_pound} other appenders
-log4j.appender.File=org.apache.log4j.RollingFileAppender
-log4j.appender.File.file=isis.log
-log4j.appender.File.append=false
-log4j.appender.File.layout=org.apache.log4j.PatternLayout
-log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
-
-log4j.appender.sql=org.apache.log4j.FileAppender
-log4j.appender.sql.File=./logs/sql.log
-log4j.appender.sql.Append=false
-log4j.appender.sql.layout=org.apache.log4j.PatternLayout
-log4j.appender.sql.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
-
-log4j.appender.sqltiming=org.apache.log4j.FileAppender
-log4j.appender.sqltiming.File=./logs/sqltiming.log
-log4j.appender.sqltiming.Append=false
-log4j.appender.sqltiming.layout=org.apache.log4j.PatternLayout
-log4j.appender.sqltiming.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
-
-log4j.appender.jdbc=org.apache.log4j.FileAppender
-log4j.appender.jdbc.File=./logs/jdbc.log
-log4j.appender.jdbc.Append=false
-log4j.appender.jdbc.layout=org.apache.log4j.PatternLayout
-log4j.appender.jdbc.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
-
-log4j.appender.connection=org.apache.log4j.FileAppender
-log4j.appender.connection.File=./logs/connection.log
-log4j.appender.connection.Append=false
-log4j.appender.connection.layout=org.apache.log4j.PatternLayout
-log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
-
-log4j.appender.wicket.i18n=org.apache.log4j.RollingFileAppender
-log4j.appender.wicket.i18n.file=./logs/wicket-i18n.log
-log4j.appender.wicket.i18n.append=false
-log4j.appender.wicket.i18n.layout=org.apache.log4j.PatternLayout
-log4j.appender.wicket.i18n.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
-
-
-
-
-
-! turn on the internal log4j debugging flag so we can see what it is doing
-${symbol_pound}log4j.debug=true
-
-
-${symbol_pound} DataNucleus
-${symbol_pound} the first two log the DML and DDL (if set to DEBUG)
-log4j.logger.DataNucleus.Datastore.Native=WARN, Console
-log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
-${symbol_pound} the remainder can probably be left to WARN
-log4j.logger.DataNucleus.Persistence=WARN, Console
-log4j.logger.DataNucleus.Transaction=WARN, Console
-log4j.logger.DataNucleus.Connection=WARN, Console
-log4j.logger.DataNucleus.Query=WARN, Console
-log4j.logger.DataNucleus.Cache=WARN, Console
-log4j.logger.DataNucleus.MetaData=WARN, Console
-log4j.logger.DataNucleus.Datastore=WARN, Console
-log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
-log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
-log4j.logger.DataNucleus.General=WARN, Console
-log4j.logger.DataNucleus.Lifecycle=WARN, Console
-log4j.logger.DataNucleus.ValueGeneration=WARN, Console
-log4j.logger.DataNucleus.Enhancer=WARN, Console
-log4j.logger.DataNucleus.SchemaTool=ERROR, Console
-log4j.logger.DataNucleus.JDO=WARN, Console
-log4j.logger.DataNucleus.JPA=ERROR, Console
-log4j.logger.DataNucleus.JCA=WARN, Console
-log4j.logger.DataNucleus.IDE=ERROR, Console
-
-log4j.additivity.DataNucleus.Datastore.Native=false
-log4j.additivity.DataNucleus.Datastore.Schema=false
-log4j.additivity.DataNucleus.Datastore.Persistence=false
-log4j.additivity.DataNucleus.Datastore.Transaction=false
-log4j.additivity.DataNucleus.Datastore.Connection=false
-log4j.additivity.DataNucleus.Datastore.Query=false
-log4j.additivity.DataNucleus.Datastore.Cache=false
-log4j.additivity.DataNucleus.Datastore.MetaData=false
-log4j.additivity.DataNucleus.Datastore.Datastore=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
-log4j.additivity.DataNucleus.Datastore.General=false
-log4j.additivity.DataNucleus.Datastore.Lifecycle=false
-log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
-log4j.additivity.DataNucleus.Datastore.Enhancer=false
-log4j.additivity.DataNucleus.Datastore.SchemaTool=false
-log4j.additivity.DataNucleus.Datastore.JDO=false
-log4j.additivity.DataNucleus.Datastore.JPA=false
-log4j.additivity.DataNucleus.Datastore.JCA=false
-log4j.additivity.DataNucleus.Datastore.IDE=false
-
-
-${symbol_pound} if using log4jdbc-remix as JDBC driver
-${symbol_pound}log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
-${symbol_pound}log4j.additivity.jdbc.sqlonly=false
-${symbol_pound}log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
-${symbol_pound}log4j.additivity.jdbc.resultsettable=false
-
-${symbol_pound}log4j.logger.jdbc.audit=WARN,jdbc, Console
-${symbol_pound}log4j.additivity.jdbc.audit=false
-${symbol_pound}log4j.logger.jdbc.resultset=WARN,jdbc
-${symbol_pound}log4j.additivity.jdbc.resultset=false
-${symbol_pound}log4j.logger.jdbc.sqltiming=WARN,sqltiming
-${symbol_pound}log4j.additivity.jdbc.sqltiming=false
-${symbol_pound}log4j.logger.jdbc.connection=FATAL,connection
-${symbol_pound}log4j.additivity.jdbc.connection=false
-
-
-
-${symbol_pound} track Isis/JDO lifecycle integration
-
-${symbol_pound}log4j.logger.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=DEBUG, Console
-${symbol_pound}log4j.additivity.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=false
-
-${symbol_pound}log4j.logger.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=DEBUG,Console
-${symbol_pound}log4j.additivity.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=false
-
-
-
-
-${symbol_pound} track Isis/Wicket lifecycle integration
-
-${symbol_pound}log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=DEBUG, Console
-${symbol_pound}log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=false
-
-${symbol_pound}log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=INFO,Console
-${symbol_pound}log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=false
-
-
-
-${symbol_pound} to track Wicket i18n
-log4j.logger.org.apache.wicket.Localizer=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.Localizer=false
-
-log4j.logger.org.apache.wicket.resource.loader.ClassStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.ClassStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.ComponentStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.ComponentStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.PackageStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.PackageStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.BundleStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.BundleStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.InitializerStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.InitializerStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=false
-
-
-
-${symbol_pound} quieten some of the noisier classes in Isis' bootstrapping
-log4j.logger.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=WARN,Console
-log4j.additivity.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=false
-
-log4j.logger.org.apache.isis.core.metamodel.specloader.ServiceInitializer=WARN,Console
-log4j.additivity.org.apache.isis.core.metamodel.specloader.ServiceInitializer=false
-
-log4j.logger.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=WARN,Console
-log4j.additivity.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=false
-
-log4j.logger.org.apache.isis.core.commons.config.IsisConfigurationDefault=WARN,Console
-log4j.additivity.org.apache.isis.core.commons.config.IsisConfigurationDefault=false
-
-log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN,Console
-log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false
-
-
-
-
-${symbol_pound} Application-specific logging
-log4j.logger.dom.todo.ToDoItem=DEBUG, Stderr
-log4j.additivity.dom.todo.ToDoItem=false
-
-log4j.logger.dom.todo.ToDoItemSubscriptions=DEBUG, Stderr
-log4j.additivity.dom.todo.ToDoItemSubscriptions=false
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
deleted file mode 100644
index 7f0a4f2..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
+++ /dev/null
@@ -1,132 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Persistor
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-
-
-${symbol_pound} generally speaking this should not be enabled
-isis.persistor.disableConcurrencyChecking=false
-
-
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} JDBC configuration
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-
-
-${symbol_pound}
-${symbol_pound} configuration file holding the JDO objectstore's JDBC configuration
-${symbol_pound} (this is a bit of a hack... just exploiting fact that Isis also loads this file)
-${symbol_pound}
-
-
-${symbol_pound}
-${symbol_pound} JDBC connection details
-${symbol_pound} (also update the pom.xml to reference the appropriate JDBC driver)
-${symbol_pound}
-
-
-${symbol_pound}
-${symbol_pound} HSQLDB in-memory
-${symbol_pound}
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-${symbol_pound}
-${symbol_pound} HSQLDB in-memory (using log4jdbc-remix)
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-
-
-${symbol_pound}
-${symbol_pound} HSQLDB to file
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-${symbol_pound}
-${symbol_pound} HSQLDB to file (using log4jdbc-remix)
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-
-
-${symbol_pound}
-${symbol_pound} PostgreSQL Server
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.postgresql.Driver
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:postgresql://localhost:5432/isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-${symbol_pound}
-${symbol_pound} PostgreSQL Server (using log4jdbc-remix)
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:postgresql://localhost:5432/isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-
-
-${symbol_pound}
-${symbol_pound} MS SQL Server
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-${symbol_pound}
-${symbol_pound} MS SQL Server (using log4jdbc-remix)
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-
-
-${symbol_pound}
-${symbol_pound} neo4j
-${symbol_pound} (experimental; run with '-P neo4j' profile in webapp project)
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=neo4j:neo4j_DB
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
deleted file mode 100644
index b979a9d..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
+++ /dev/null
@@ -1,91 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-${symbol_pound}
-${symbol_pound} configuration file for the JDO/DataNucleus objectstore
-${symbol_pound}
-
-${symbol_pound} identifies @PersistenceCapable entities to be eagerly registered
-${symbol_pound} if move class to other package (eg com.mycompany.myapp.dom) then update
-isis.persistor.datanucleus.RegisterEntities.packagePrefix=dom
-
-${symbol_pound} whether to persist the event data as a "clob" or as a "zipped" byte[]
-${symbol_pound} default is "zipped"
-${symbol_pound}isis.persistor.datanucleus.PublishingService.serializedForm=zipped
-
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} DataNucleus' configuration
-${symbol_pound}
-${symbol_pound} The 'isis.persistor.datanucleus.impl' prefix is stripped off,
-${symbol_pound} remainder is passed through to DataNucleus
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}
-
-isis.persistor.datanucleus.impl.datanucleus.autoCreateSchema=true
-isis.persistor.datanucleus.impl.datanucleus.validateTables=true
-isis.persistor.datanucleus.impl.datanucleus.validateConstraints=true
-
-
-${symbol_pound}
-${symbol_pound} Require explicit persistence (since entities are Comparable and using ObjectContracts${symbol_pound}compareTo).
-${symbol_pound} see http://www.datanucleus.org/products/accessplatform_3_0/jdo/transaction_types.html
-${symbol_pound}
-isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false
-
-
-${symbol_pound}
-${symbol_pound} How column names are identified
-${symbol_pound} (http://www.datanucleus.org/products/datanucleus/jdo/orm/datastore_identifiers.html)
-${symbol_pound}
-isis.persistor.datanucleus.impl.datanucleus.identifier.case=PreserveCase
-
-
-${symbol_pound}
-${symbol_pound} L2 cache
-${symbol_pound} off except if explicitly marked as cacheable
-${symbol_pound} http://www.datanucleus.org/products/datanucleus/jdo/cache.html
-${symbol_pound}
-isis.persistor.datanucleus.impl.datanucleus.cache.level2.type=none
-isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode=ENABLE_SELECTIVE
-
-
-
-${symbol_pound}
-${symbol_pound} uncomment to use JNDI rather than direct JDBC
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart
-
-${symbol_pound}
-${symbol_pound} uncomment to use JTA resource
-${symbol_pound}
-${symbol_pound}isis.persistor.datanucleus.impl.datanucleus.ConnectionFactory2Name=java:comp/env/jdbc/quickstart-nontx
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.TransactionType=JTA
-
-
-
-${symbol_pound}
-${symbol_pound}
-${symbol_pound} JDBC connection details
-${symbol_pound} ... are in persistor.properties
-${symbol_pound}
-${symbol_pound}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
deleted file mode 100644
index 07ea04f..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
+++ /dev/null
@@ -1,103 +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.
-#
-
-[main]
-
-#######
-# configure a couple of iniRealms
-# (nb: not possible for their .ini files to live in WEB-INF, because Shiro does not
-# provide a mechanism to load resources from that location)
-#######
-
-realm1 = org.apache.shiro.realm.text.IniRealm
-realm1.resourcePath=classpath:webapp/realm1.ini
-
-
-
-
-#######
-# configure an ldap-based realm
-#######
-
-contextFactory = org.apache.isis.security.shiro.IsisLdapContextFactory
-contextFactory.url = ldap://localhost:10389
-contextFactory.authenticationMechanism = CRAM-MD5
-contextFactory.systemAuthenticationMechanism = simple
-contextFactory.systemUsername = uid=admin,ou=system
-contextFactory.systemPassword = secret
-
-ldapRealm = org.apache.isis.security.shiro.IsisLdapRealm
-ldapRealm.contextFactory = $contextFactory
-
-ldapRealm.searchBase = ou=groups,o=mojo
-ldapRealm.groupObjectClass = groupOfUniqueNames
-ldapRealm.uniqueMemberAttribute = uniqueMember
-ldapRealm.uniqueMemberAttributeValueTemplate = uid={0}
-
-# optional mapping from physical groups to logical application roles
-#ldapRealm.rolesByGroup = \
-# LDN_USERS: user_role,\
-# NYK_USERS: user_role,\
-# HKG_USERS: user_role,\
-# GLOBAL_ADMIN: admin_role,\
-# DEMOS: self-install_role
-
-# configuring ldapRealm role/perm mappings
-# (use same as realm1)
-ldapRealm.resourcePath=classpath:webapp/realm1.ini
-
-
-#######
-# configure security manager to use realm(s)
-#######
-
-# authenticate/authorize using realm1
-securityManager.realms = $realm1
-
-
-# or to use ldap with realm1 as a backup...
-# (see docs for details of how to setup users/groups in Apache Directory Studio).
-#securityManager.realms = $ldapRealm,$realm1
-
-
-# or to just use this .ini file...
-# (would require [users] and [roles] to be set up)
-#securityManager.realms = $iniRealm
-
-
-
-#######
-# optional, configure realm(s) to use Isis' extended permission syntax
-# (see webapp/realm1.ini for usage)
-#######
-
-# permissionResolver = org.apache.isis.security.shiro.authorization.IsisPermissionResolver
-# realm1.permissionResolver = $permissionResolver
-# realm2.permissionResolver = $permissionResolver
-
-
-# -----------------------------------------------------------------------------
-# Users and their assigned roles
-# -----------------------------------------------------------------------------
-
-[users]
-# unused (assuming not configured $iniRealm)
-
-[roles]
-# unused (assuming not configured $iniRealm)
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
deleted file mode 100644
index 85e658a..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-${symbol_pound}
-${symbol_pound} configuration file for the Restful Objects viewer
-${symbol_pound}
-
-${symbol_pound} the baseUrl for hrefs in the events generated by the RO EventSerializer
-isis.viewer.restfulobjects.RestfulObjectsSpecEventSerializer.baseUrl=http://localhost:8080/restful/
-
-${symbol_pound} renders param details in the (incorrect) form that they were for GSOC2013 viewers
-${symbol_pound} isis.viewer.restfulobjects.gsoc2013.legacyParamDetails=true
-
-${symbol_pound} whether to honor UI hints, in particular Render(EAGERLY). Defaults to false.
-${symbol_pound}isis.viewer.restfulobjects.honorUiHints=false
-
-
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound} Non-standard configuration settings.
-${symbol_pound}
-${symbol_pound} If enabled of the following are enabled then the viewer is deviating from the
-${symbol_pound} RO spec standard; compatibility may be compromised with RO clients.
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound} whether to show only object properties for object members
-${symbol_pound} (on the object representation only)
-${symbol_pound} Takes precedence over the other 'suppress' below.
-${symbol_pound}isis.viewer.restfulobjects.objectPropertyValuesOnly=true
-
-${symbol_pound} whether to suppress "describedby" links. Defaults to false.
-${symbol_pound}isis.viewer.restfulobjects.suppressDescribedByLinks=true
-
-${symbol_pound} whether to suppress "update" links. Defaults to false.
-${symbol_pound}isis.viewer.restfulobjects.suppressUpdateLink=true
-
-${symbol_pound} whether to suppress "id" json-prop for object members. Defaults to false.
-${symbol_pound}isis.viewer.restfulobjects.suppressMemberId=true
-
-${symbol_pound} whether to suppress "links" json-prop for object members
-${symbol_pound} (on the object representation only). Defaults to false.
-${symbol_pound}isis.viewer.restfulobjects.suppressMemberLinks=true
-
-${symbol_pound} whether to suppress "extensions" json-prop for object members
-${symbol_pound} (on the object representation only). Defaults to false.
-${symbol_pound}isis.viewer.restfulobjects.suppressMemberExtensions=true
-
-${symbol_pound} whether to suppress "disabledReason" json-prop for object members
-${symbol_pound} (on the object representation only). Defaults to false.
-${symbol_pound}isis.viewer.restfulobjects.suppressMemberDisabledReason=true
-
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
deleted file mode 100644
index 9644f0e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
+++ /dev/null
@@ -1,90 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-${symbol_pound}
-${symbol_pound} configuration file for the Wicket viewer
-${symbol_pound}
-
-${symbol_pound}
-${symbol_pound} The maximum length of titles to display in standalone or parented tables.
-${symbol_pound} Titles longer than this length will be truncated with trailing ellipses (...)
-${symbol_pound}
-${symbol_pound} For example, if set to 12, the title
-${symbol_pound} "Buy milk on 15-Feb-13" will be truncated to "Buy milk ..."
-${symbol_pound}
-${symbol_pound} If set to 0, then only the icon will be shown.
-${symbol_pound}
-isis.viewer.wicket.maxTitleLengthInStandaloneTables=0
-isis.viewer.wicket.maxTitleLengthInParentedTables=0
-
-
-${symbol_pound}isis.viewer.wicket.datePattern=dd-MM-yyyy
-${symbol_pound}isis.viewer.wicket.dateTimePattern=dd-MM-yyyy HH:mm
-${symbol_pound}isis.viewer.wicket.datePickerPattern=DD-MM-YYYY
-
-${symbol_pound}isis.viewer.wicket.datePattern=dd/MM/yy
-${symbol_pound}isis.viewer.wicket.dateTimePattern=dd/MM/yy HH:mm
-${symbol_pound}isis.viewer.wicket.datePickerPattern=DD/MM/YY
-
-
-
-${symbol_pound}
-${symbol_pound} whether to strip wicket tags from markup (default is true, as they may break some CSS rules)
-${symbol_pound}
-${symbol_pound}isis.viewer.wicket.stripWicketTags=false
-
-
-${symbol_pound}
-${symbol_pound} whether to suppress the 'rememberMe' checkbox on the login page (default is false)
-${symbol_pound}
-${symbol_pound}isis.viewer.wicket.suppressRememberMe=false
-
-${symbol_pound}
-${symbol_pound} if user attempts to access a protected URL before signing in, then as a convenience the viewer will continue
-${symbol_pound} through to that destination after successful login. If you consider this to be a security risk then this flag
-${symbol_pound} disables that behaviour (default is false).
-${symbol_pound}
-${symbol_pound}isis.viewer.wicket.clearOriginalDestination=true
-
-
-${symbol_pound}
-${symbol_pound} whether to show action dialogs on their own page rather than as a modal dialog (default is false)
-${symbol_pound}
-${symbol_pound}isis.viewer.wicket.disableModalDialogs=false
-
-
-${symbol_pound}
-${symbol_pound} the maximum number of pages to list in bookmark (default is 15)
-${symbol_pound}
-${symbol_pound}isis.viewer.wicket.bookmarkedPages.maxSize=15
-
-
-${symbol_pound}
-${symbol_pound} whether to show the bootstrap theme chooser (defaults false)
-${symbol_pound}
-${symbol_pound}isis.viewer.wicket.themes.showChooser=false
-isis.viewer.wicket.themes.showChooser=true
-
-${symbol_pound}
-${symbol_pound} comma-separated list of themes to choose from (default is to show all themes from bootswatch.com).
-${symbol_pound}
-${symbol_pound}isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
-isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index be328e1..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,311 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?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 id="WebApp_ID" version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>Todo app</display-name>
-
- <welcome-file-list>
- <welcome-file>about/index.html</welcome-file>
- </welcome-file-list>
-
- <!-- shiro security configuration -->
- <listener>
- <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
- </listener>
-
- <filter>
- <filter-name>ShiroFilter</filter-name>
- <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>ShiroFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-
-
- <!-- which configuration directory to read overloaded property files from -->
- <!--
- Normally configuration like this should be done from outside your web
- application. Especially if your configuration is not know in advance or
- if it can change depending on where the application gets deployed.
-
- For instance to configure this in Tomcat outside the application WAR add
- the following line to your application context ( For more detail see:
- http://tomcat.apache.org/tomcat-7.0-doc/config/context.html${symbol_pound}Context_Parameters )
-
- <Parameter name="isis.config.dir" value="/usr/local/tomcat/conf/"
- override="true"/>
-
- If your configuration directory is fixed you can enable the following
- context parameter in here and forget about the outside part.
-
- <context-param>
- <param-name>isis.config.dir</param-name>
- <param-value>location of your config directory if fixed</param-value>
- </context-param>
- -->
-
-
- <!--
- determines which additional configuration files to search for
- -->
- <context-param>
- <param-name>isis.viewers</param-name>
- <param-value>wicket,restfulobjects</param-value>
- </context-param>
-
-
- <!--
- for diagnostics
- -->
- <filter>
- <filter-name>IsisLogOnExceptionFilter</filter-name>
- <filter-class>org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>IsisLogOnExceptionFilter</filter-name>
- <url-pattern>/wicket/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>IsisLogOnExceptionFilter</filter-name>
- <url-pattern>/restful/*</url-pattern>
- </filter-mapping>
-
-
- <!-- cache static resources for 1 day -->
- <filter>
- <filter-name>ResourceCachingFilter</filter-name>
- <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
- <init-param>
- <param-name>CacheTime</param-name>
- <param-value>86400</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.js</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.css</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.png</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.jpg</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.gif</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.html</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.swf</url-pattern>
- </filter-mapping>
-
- <servlet>
- <servlet-name>Resource</servlet-name>
- <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.css</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.png</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.jpg</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.gif</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.js</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.html</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.swf</url-pattern>
- </servlet-mapping>
-
-
-
- <!--
- -
- - config specific to the wicket-viewer
- -
- -->
- <filter>
- <filter-name>WicketFilter</filter-name>
- <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
- <init-param>
- <param-name>applicationClassName</param-name>
- <param-value>webapp.ToDoApplication</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>WicketFilter</filter-name>
- <url-pattern>/wicket/*</url-pattern>
- </filter-mapping>
-
-
- <context-param>
- <param-name>configuration</param-name>
- <!--
- <param-value>deployment</param-value>
- -->
- <param-value>development</param-value>
- </context-param>
-
-
- <!--
- -
- - config specific to the restfulobjects-viewer
- -
- -->
-
- <!--
- THE FOLLOWING CONFIGURATION IS NOT REQUIRED IF THE WICKET VIEWER IS IN USE.
- IF THE WICKET VIEWER CONFIGURATION IS REMOVED, THEN UNCOMMENT
-
- <listener>
- <listener-class>org.apache.isis.core.webapp.IsisWebAppBootstrapper</listener-class>
- </listener>
-
- <context-param>
- <param-name>deploymentType</param-name>
- <param-value>SERVER_EXPLORATION</param-value>
- </context-param>
-
- <context-param>
- <param-name>isis.viewers</param-name>
- <param-value>restfulobjects</param-value>
- </context-param>
- -->
-
- <!-- bootstrap the RestEasy framework -->
- <listener>
- <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
- </listener>
-
- <!-- used by RestEasy to determine the JAX-RS resources and other related configuration -->
- <context-param>
- <param-name>javax.ws.rs.Application</param-name>
- <param-value>org.apache.isis.viewer.restfulobjects.server.RestfulObjectsApplication</param-value>
- </context-param>
-
- <context-param>
- <param-name>resteasy.servlet.mapping.prefix</param-name>
- <param-value>/restful/</param-value>
- </context-param>
-
-
- <!-- authenticate user, set up an Isis session -->
- <filter>
- <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
- <filter-class>org.apache.isis.core.webapp.IsisSessionFilter</filter-class>
- <!-- authentication required for REST -->
- <init-param>
- <param-name>authenticationSessionStrategy</param-name>
- <param-value>org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyBasicAuth</param-value>
- </init-param>
- <init-param>
- <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
- <param-name>whenNoSession</param-name>
- <param-value>basicAuthChallenge</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <!-- this is mapped to the entire app; however the IsisSessionFilter will "notice" if the session filter has already been
- executed for the request pipeline, and if so will do nothing -->
- <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- </filter-mapping>
-
- <filter>
- <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
- <filter-class>org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- </filter-mapping>
-
-
- <servlet>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- <url-pattern>/restful/*</url-pattern>
- </servlet-mapping>
-
-
- <!--
- uncomment to use container-managed datasource;
- for both container-managed (JTA) and non-container-managed transactions
- -->
- <!--
- <resource-ref>
- <description>db</description>
- <res-ref-name>jdbc/quickstart</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- </resource-ref>
- -->
-
- <!--
- uncomment to use container-managed datasource
- with container-managed transactions (JTA).
- -->
- <!--
- <resource-ref>
- <description>db</description>
- <res-ref-name>jdbc/quickstart-nontx</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- </resource-ref>
- -->
-
-
-</web-app>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png
deleted file mode 100644
index 5284fe7..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png and /dev/null differ
[11/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
new file mode 100644
index 0000000..75f5583
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
@@ -0,0 +1,979 @@
+/*
+ * 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 dom.todo;
+
+import java.math.BigDecimal;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import javax.jdo.JDOHelper;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.VersionStrategy;
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Ordering;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.applib.annotation.CollectionLayout;
+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.RestrictTo;
+import org.apache.isis.applib.annotation.InvokeOn;
+import org.apache.isis.applib.annotation.InvokedOn;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.security.UserMemento;
+import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.applib.services.scratchpad.Scratchpad;
+import org.apache.isis.applib.services.wrapper.HiddenException;
+import org.apache.isis.applib.services.wrapper.WrapperFactory;
+import org.apache.isis.applib.util.ObjectContracts;
+import org.apache.isis.applib.util.TitleBuffer;
+import org.apache.isis.applib.value.Blob;
+import org.apache.isis.applib.value.Clob;
+
+@javax.jdo.annotations.PersistenceCapable(identityType=IdentityType.DATASTORE)
+@javax.jdo.annotations.DatastoreIdentity(
+ strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
+ column="id")
+@javax.jdo.annotations.Version(
+ strategy=VersionStrategy.VERSION_NUMBER,
+ column="version")
+@javax.jdo.annotations.Uniques({
+ @javax.jdo.annotations.Unique(
+ name="ToDoItem_description_must_be_unique",
+ members={"ownedBy","description"})
+})
+@javax.jdo.annotations.Queries( {
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedBy", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndCompleteIsFalse", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy "
+ + " && complete == false"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndCompleteIsTrue", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy "
+ + "&& complete == true"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndCategory", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy "
+ + "&& category == :category"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndDescriptionContains", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy && "
+ + "description.indexOf(:description) >= 0")
+})
+@DomainObject(
+ autoCompleteRepository = ToDoItems.class, // for drop-downs, unless autoCompleteNXxx() is present
+ autoCompleteAction = "autoComplete",
+ // bounded = true, // for drop-downs if only a small number of instances only (overrides autoComplete)
+ objectType = "TODO"
+)
+@DomainObjectLayout(
+ bookmarking = BookmarkPolicy.AS_ROOT
+)
+public class ToDoItem implements Categorized, Comparable<ToDoItem> {
+
+ //region > LOG
+ /**
+ * It isn't common for entities to log, but they can if required.
+ * Isis uses slf4j API internally (with log4j as implementation), and is the recommended API to use.
+ */
+ private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItem.class);
+ //endregion
+
+ // region > title, icon
+ public String title() {
+ final TitleBuffer buf = new TitleBuffer();
+ buf.append(getDescription());
+ if (isComplete()) {
+ buf.append("- Completed!");
+ } else {
+ try {
+ final LocalDate dueBy = wrapperFactory.wrap(this).getDueBy();
+ if (dueBy != null) {
+ buf.append(" due by", dueBy);
+ }
+ } catch(final HiddenException ignored) {
+ }
+ }
+ return buf.toString();
+ }
+
+ public String iconName() {
+ return !isComplete() ? "todo" : "done";
+ }
+
+ public String cssClass() { return iconName(); }
+
+ //endregion
+
+ //region > description (property)
+ private String description;
+
+ @javax.jdo.annotations.Column(allowsNull="false", length=100)
+ @Property(
+ regexPattern = "\\w[@&:\\-\\,\\.\\+ \\w]*"
+ )
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(final String description) {
+ this.description = description;
+ }
+ public void modifyDescription(final String description) {
+ setDescription(description);
+ }
+ public void clearDescription() {
+ setDescription(null);
+ }
+ //endregion
+
+ //region > dueBy (property)
+ @javax.jdo.annotations.Persistent(defaultFetchGroup="true")
+ private LocalDate dueBy;
+
+ @javax.jdo.annotations.Column(allowsNull="true")
+ public LocalDate getDueBy() {
+ 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");
+ }
+
+ public void setDueBy(final LocalDate dueBy) {
+ this.dueBy = dueBy;
+ }
+ public void clearDueBy() {
+ setDueBy(null);
+ }
+ // proposed new value is validated before setting
+ public String validateDueBy(final LocalDate dueBy) {
+ if (dueBy == null) {
+ return null;
+ }
+ return toDoItems.validateDueBy(dueBy);
+ }
+ //endregion
+
+ //region > category and subcategory (property)
+
+ public static enum Category {
+ Professional {
+ @Override
+ public List<Subcategory> subcategories() {
+ return Arrays.asList(null, Subcategory.OpenSource, Subcategory.Consulting, Subcategory.Education, Subcategory.Marketing);
+ }
+ }, Domestic {
+ @Override
+ public List<Subcategory> subcategories() {
+ return Arrays.asList(null, Subcategory.Shopping, Subcategory.Housework, Subcategory.Garden, Subcategory.Chores);
+ }
+ }, Other {
+ @Override
+ public List<Subcategory> subcategories() {
+ return Arrays.asList(null, Subcategory.Other);
+ }
+ };
+
+ public abstract List<Subcategory> subcategories();
+ }
+
+ public static enum Subcategory {
+ // professional
+ OpenSource, Consulting, Education, Marketing,
+ // domestic
+ Shopping, Housework, Garden, Chores,
+ // other
+ Other;
+
+ public static List<Subcategory> listFor(final Category category) {
+ return category != null? category.subcategories(): Collections.<Subcategory>emptyList();
+ }
+
+ static String validate(final Category category, final Subcategory subcategory) {
+ if(category == null) {
+ return "Enter category first";
+ }
+ return !category.subcategories().contains(subcategory)
+ ? "Invalid subcategory for category '" + category + "'"
+ : null;
+ }
+
+ public static Predicate<Subcategory> thoseFor(final Category category) {
+ return new Predicate<Subcategory>() {
+
+ @Override
+ public boolean apply(final Subcategory subcategory) {
+ return category.subcategories().contains(subcategory);
+ }
+ };
+ }
+ }
+
+ // //////////////////////////////////////
+
+ private Category category;
+
+ @javax.jdo.annotations.Column(allowsNull="false")
+ @Property(
+ editing = Editing.DISABLED,
+ editingDisabledReason = "Use action to update both category and subcategory"
+ )
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(final Category category) {
+ this.category = category;
+ }
+
+ // //////////////////////////////////////
+
+ private Subcategory subcategory;
+
+ @javax.jdo.annotations.Column(allowsNull="true")
+ @Property(
+ editing = Editing.DISABLED,
+ editingDisabledReason = "Use action to update both category and subcategory"
+ )
+ public Subcategory getSubcategory() {
+ return subcategory;
+ }
+ public void setSubcategory(final Subcategory subcategory) {
+ this.subcategory = subcategory;
+ }
+ //endregion
+
+ //region > ownedBy (property)
+
+ private String ownedBy;
+
+ @javax.jdo.annotations.Column(allowsNull="false")
+ public String getOwnedBy() {
+ return ownedBy;
+ }
+
+ public void setOwnedBy(final String ownedBy) {
+ this.ownedBy = ownedBy;
+ }
+ //endregion
+
+ //region > complete (property), completed (action), notYetCompleted (action)
+
+ private boolean complete;
+
+ @Property(
+ editing = Editing.DISABLED
+ )
+ public boolean isComplete() {
+ return complete;
+ }
+
+ public void setComplete(final boolean complete) {
+ this.complete = complete;
+ }
+
+ @Action(
+ domainEvent =CompletedEvent.class,
+ invokeOn = InvokeOn.OBJECT_AND_COLLECTION
+ )
+ public ToDoItem completed() {
+ setComplete(true);
+
+ //
+ // remainder of method just demonstrates the use of the Bulk.InteractionContext service
+ //
+ @SuppressWarnings("unused")
+ final List<Object> allObjects = actionInvocationContext.getDomainObjects();
+
+ LOG.debug("completed: "
+ + actionInvocationContext.getIndex() +
+ " [" + actionInvocationContext.getSize() + "]"
+ + (actionInvocationContext.isFirst() ? " (first)" : "")
+ + (actionInvocationContext.isLast() ? " (last)" : ""));
+
+ // if invoked as a regular action, return this object;
+ // otherwise (if invoked as bulk), return null (so go back to the list)
+ return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT? this: null;
+ }
+ // disable action dependent on state of object
+ public String disableCompleted() {
+ return isComplete() ? "Already completed" : null;
+ }
+
+ @Action(
+ invokeOn = InvokeOn.OBJECT_AND_COLLECTION
+ )
+ public ToDoItem notYetCompleted() {
+ setComplete(false);
+
+ // if invoked as a regular action, return this object;
+ // otherwise (if invoked as bulk), return null (so go back to the list)
+ return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT ? this: null;
+ }
+ // disable action dependent on state of object
+ public String disableNotYetCompleted() {
+ return !complete ? "Not yet completed" : null;
+ }
+ //endregion
+
+ //region > completeSlowly (property)
+ // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ @Action(
+ hidden = Where.EVERYWHERE
+ )
+ public void completeSlowly(final int millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (final InterruptedException ignored) {
+ }
+ setComplete(true);
+ }
+ //endregion
+
+ //region > cost (property), updateCost (action)
+ private BigDecimal cost;
+
+ @javax.jdo.annotations.Column(allowsNull="true", scale=2)
+ @javax.validation.constraints.Digits(integer=10, fraction=2)
+ @Property(
+ editing = Editing.DISABLED,
+ editingDisabledReason = "Update using action"
+ )
+ public BigDecimal getCost() {
+ return cost;
+ }
+
+ public void setCost(final BigDecimal cost) {
+ this.cost = cost!=null?cost.setScale(2, BigDecimal.ROUND_HALF_EVEN):null;
+ }
+
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT
+ )
+ public ToDoItem updateCost(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(named = "New cost")
+ @javax.validation.constraints.Digits(integer=10, fraction=2)
+ final BigDecimal cost) {
+ LOG.debug("%s: cost updated: %s -> %s", container.titleOf(this), getCost(), cost);
+
+ // just to simulate a long-running action
+ try {
+ Thread.sleep(3000);
+ } catch (final InterruptedException ignored) {
+ }
+
+ setCost(cost);
+ return this;
+ }
+
+ // provide a default value for argument #0
+ public BigDecimal default0UpdateCost() {
+ return getCost();
+ }
+
+ // validate action arguments
+ public String validateUpdateCost(final BigDecimal proposedCost) {
+ if(proposedCost == null) { return null; }
+ return proposedCost.compareTo(BigDecimal.ZERO) < 0? "Cost must be positive": null;
+ }
+ //endregion
+
+ //region > notes (property)
+ private String notes;
+
+ @javax.jdo.annotations.Column(allowsNull="true", length=400)
+ public String getNotes() {
+ return notes;
+ }
+
+ public void setNotes(final String notes) {
+ this.notes = notes;
+ }
+ //endregion
+
+ //region > attachment (property)
+ private Blob attachment;
+ @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
+ @javax.jdo.annotations.Column(name = "attachment_name"),
+ @javax.jdo.annotations.Column(name = "attachment_mimetype"),
+ @javax.jdo.annotations.Column(name = "attachment_bytes", jdbcType = "BLOB", sqlType = "BLOB")
+ })
+ @Property(
+ optionality = Optionality.OPTIONAL
+ )
+ public Blob getAttachment() {
+ return attachment;
+ }
+
+ public void setAttachment(final Blob attachment) {
+ this.attachment = attachment;
+ }
+ //endregion
+
+ //region > doc (property)
+ private Clob doc;
+ @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
+ @javax.jdo.annotations.Column(name = "doc_name"),
+ @javax.jdo.annotations.Column(name = "doc_mimetype"),
+ @javax.jdo.annotations.Column(name = "doc_chars", jdbcType = "CLOB", sqlType = "CLOB")
+ })
+ @Property(
+ optionality = Optionality.OPTIONAL
+ )
+ public Clob getDoc() {
+ return doc;
+ }
+
+ public void setDoc(final Clob doc) {
+ this.doc = doc;
+ }
+ //endregion
+
+ //region > version (derived property)
+ public Long getVersionSequence() {
+ if(!(this instanceof javax.jdo.spi.PersistenceCapable)) {
+ return null;
+ }
+ return (Long) JDOHelper.getVersion((javax.jdo.spi.PersistenceCapable) this);
+ }
+ // hide property (imperatively, based on state of object)
+ public boolean hideVersionSequence() {
+ return !(this instanceof javax.jdo.spi.PersistenceCapable);
+ }
+ //endregion
+
+ //region > dependencies (property), add (action), remove (action)
+
+ // overrides the natural ordering
+ public static class DependenciesComparator implements Comparator<ToDoItem> {
+ @Override
+ public int compare(final ToDoItem p, final ToDoItem q) {
+ final Ordering<ToDoItem> byDescription = new Ordering<ToDoItem>() {
+ public int compare(final ToDoItem p, final ToDoItem q) {
+ return Ordering.natural().nullsFirst().compare(p.getDescription(), q.getDescription());
+ }
+ };
+ return byDescription
+ .compound(Ordering.<ToDoItem>natural())
+ .compare(p, q);
+ }
+ }
+
+ @javax.jdo.annotations.Persistent(table="ToDoItemDependencies")
+ @javax.jdo.annotations.Join(column="dependingId")
+ @javax.jdo.annotations.Element(column="dependentId")
+
+ private Set<ToDoItem> dependencies = new TreeSet<>();
+ //private SortedSet<ToDoItem> dependencies = new TreeSet<>(); // not compatible with neo4j (as of DN v3.2.3)
+
+ @Collection()
+ @CollectionLayout(/*sortedBy = DependenciesComparator.class*/) // not compatible with neo4j (as of DN v3.2.3)
+ public Set<ToDoItem> getDependencies() {
+ return dependencies;
+ }
+
+ public void setDependencies(final Set<ToDoItem> dependencies) {
+ this.dependencies = dependencies;
+ }
+
+ public void addToDependencies(final ToDoItem toDoItem) {
+ getDependencies().add(toDoItem);
+ }
+ public void removeFromDependencies(final ToDoItem toDoItem) {
+ getDependencies().remove(toDoItem);
+ }
+
+ public ToDoItem add(
+ @ParameterLayout(typicalLength = 20)
+ final ToDoItem toDoItem) {
+ // By wrapping the call, Isis will detect that the collection is modified
+ // and it will automatically send CollectionInteractionEvents to the Event Bus.
+ // ToDoItemSubscriptions is a demo subscriber to this event
+ wrapperFactory.wrapSkipRules(this).addToDependencies(toDoItem);
+ return this;
+ }
+ public List<ToDoItem> autoComplete0Add(
+ @Parameter(minLength = 2)
+ final String search) {
+ final List<ToDoItem> list = toDoItems.autoComplete(search);
+ list.removeAll(getDependencies());
+ list.remove(this);
+ return list;
+ }
+
+ public String disableAdd(final ToDoItem toDoItem) {
+ if(isComplete()) {
+ return "Cannot add dependencies for items that are complete";
+ }
+ return null;
+ }
+ // validate the provided argument prior to invoking action
+ public String validateAdd(final ToDoItem toDoItem) {
+ if(getDependencies().contains(toDoItem)) {
+ return "Already a dependency";
+ }
+ if(toDoItem == this) {
+ return "Can't set up a dependency to self";
+ }
+ return null;
+ }
+
+ public ToDoItem remove(
+ @ParameterLayout(typicalLength = 20)
+ final ToDoItem toDoItem) {
+ // By wrapping the call, Isis will detect that the collection is modified
+ // and it will automatically send a CollectionInteractionEvent to the Event Bus.
+ // ToDoItemSubscriptions is a demo subscriber to this event
+ wrapperFactory.wrapSkipRules(this).removeFromDependencies(toDoItem);
+ return this;
+ }
+ // disable action dependent on state of object
+ public String disableRemove(final ToDoItem toDoItem) {
+ if(isComplete()) {
+ return "Cannot remove dependencies for items that are complete";
+ }
+ return getDependencies().isEmpty()? "No dependencies to remove": null;
+ }
+ // validate the provided argument prior to invoking action
+ public String validateRemove(final ToDoItem toDoItem) {
+ if(!getDependencies().contains(toDoItem)) {
+ return "Not a dependency";
+ }
+ return null;
+ }
+ // provide a drop-down
+ public java.util.Collection<ToDoItem> choices0Remove() {
+ return getDependencies();
+ }
+ //endregion
+
+ //region > clone (action)
+
+ // the name of the action in the UI
+ // nb: method is not called "clone()" is inherited by java.lang.Object and
+ // (a) has different semantics and (b) is in any case automatically ignored
+ // by the framework
+ public ToDoItem duplicate(
+ @Parameter(regexPattern = "\\w[@&:\\-\\,\\.\\+ \\w]*" )
+ @ParameterLayout(named="Description")
+ final String description,
+ @ParameterLayout(named="Category")
+ final Category category,
+ @ParameterLayout(named="Subcategory")
+ final Subcategory subcategory,
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(named="Due by")
+ final LocalDate dueBy,
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(named="Cost")
+ final BigDecimal cost) {
+ return toDoItems.newToDo(description, category, subcategory, dueBy, cost);
+ }
+ public String default0Duplicate() {
+ return getDescription() + " - Copy";
+ }
+ public Category default1Duplicate() {
+ return getCategory();
+ }
+ public Subcategory default2Duplicate() {
+ return getSubcategory();
+ }
+ public LocalDate default3Duplicate() {
+ return getDueBy();
+ }
+ public List<Subcategory> choices2Duplicate(
+ final String description, final Category category) {
+ return toDoItems.choices2NewToDo(description, category);
+ }
+ public String validateDuplicate(
+ final String description,
+ final Category category, final Subcategory subcategory,
+ final LocalDate dueBy, final BigDecimal cost) {
+ return toDoItems.validateNewToDo(description, category, subcategory, dueBy, cost);
+ }
+ //endregion
+
+ //region > delete (action)
+ @Action(
+ domainEvent =DeletedEvent.class,
+ invokeOn = InvokeOn.OBJECT_AND_COLLECTION
+ )
+ public List<ToDoItem> delete() {
+
+ container.removeIfNotAlready(this);
+
+ container.informUser("Deleted " + container.titleOf(this));
+
+ // invalid to return 'this' (cannot render a deleted object)
+ return toDoItems.notYetComplete();
+ }
+ //endregion
+
+ //region > totalCost (property)
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ invokeOn = InvokeOn.COLLECTION_ONLY
+ )
+ public BigDecimal totalCost() {
+ BigDecimal total = (BigDecimal) scratchpad.get("runningTotal");
+ if(getCost() != null) {
+ total = total != null ? total.add(getCost()) : getCost();
+ scratchpad.put("runningTotal", total);
+ }
+ return total.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ }
+ //endregion
+
+ //region > openSourceCodeOnGithub (action)
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ public URL openSourceCodeOnGithub() throws MalformedURLException {
+ return new URL("https://github.com/apache/isis/tree/master/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java");
+ }
+ //endregion
+
+ //region > demoException (action)
+
+ static enum DemoExceptionType {
+ RecoverableException,
+ RecoverableExceptionAutoEscalated,
+ NonRecoverableException;
+ }
+
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ public void demoException(
+ @ParameterLayout(named="Type")
+ final DemoExceptionType type) {
+ switch(type) {
+ case NonRecoverableException:
+ throw new NonRecoverableException("Demo throwing " + type.name());
+ case RecoverableException:
+ throw new RecoverableException("Demo throwing " + type.name());
+ case RecoverableExceptionAutoEscalated:
+ try {
+ // this will trigger an exception (because category cannot be null), causing the xactn to be aborted
+ setCategory(null);
+ container.flush();
+ } catch(Exception e) {
+ // it's a programming mistake to throw only a recoverable exception here, because of the xactn's state.
+ // the framework should instead auto-escalate this to a non-recoverable exception
+ throw new RecoverableException("Demo throwing " + type.name(), e);
+ }
+ }
+ }
+ //endregion
+
+ //region > lifecycle callbacks
+
+ public void created() {
+ LOG.debug("lifecycle callback: created: " + this.toString());
+ }
+ public void loaded() {
+ LOG.debug("lifecycle callback: loaded: " + this.toString());
+ }
+ public void persisting() {
+ LOG.debug("lifecycle callback: persisting: " + this.toString());
+ }
+ public void persisted() {
+ LOG.debug("lifecycle callback: persisted: " + this.toString());
+ }
+ public void updating() {
+ LOG.debug("lifecycle callback: updating: " + this.toString());
+ }
+ public void updated() {
+ LOG.debug("lifecycle callback: updated: " + this.toString());
+ }
+ public void removing() {
+ LOG.debug("lifecycle callback: removing: " + this.toString());
+ }
+ public void removed() {
+ LOG.debug("lifecycle callback: removed: " + this.toString());
+ }
+ //endregion
+
+ //region > object-level validation
+
+ /**
+ * Prevent user from viewing another user's data.
+ */
+ public boolean hidden() {
+ // uncomment to enable. As things stand, the disabled() method below instead will make object "read-only".
+ //return !Objects.equal(getOwnedBy(), container.getUser().getName());
+ return false;
+ }
+
+ /**
+ * Prevent user from modifying any other user's data.
+ */
+ public String disabled(final Identifier.Type identifierType){
+ final UserMemento currentUser = container.getUser();
+ final String currentUserName = currentUser.getName();
+ if(Objects.equal(getOwnedBy(), currentUserName)) { return null; }
+ return "This object is owned by '" + getOwnedBy() + "' and cannot be modified by you";
+ }
+
+ /**
+ * In a real app, if this were actually a rule, then we'd expect that
+ * invoking the {@link #completed() done} action would clear the {@link #getDueBy() dueBy}
+ * property (rather than require the user to have to clear manually).
+ */
+ public String validate() {
+ if(isComplete() && getDueBy() != null) {
+ return "Due by date must be set to null if item has been completed";
+ }
+ return null;
+ }
+
+
+ //endregion
+
+
+ //region > programmatic helpers
+ @Programmatic // excluded from the framework's metamodel
+ public boolean isDue() {
+ if (getDueBy() == null) {
+ return false;
+ }
+ return !toDoItems.isMoreThanOneWeekInPast(getDueBy());
+ }
+ //endregion
+
+ //region > events
+
+ public static abstract class AbstractActionDomainEvent extends ActionDomainEvent<ToDoItem> {
+ private static final long serialVersionUID = 1L;
+ private final String description;
+ public AbstractActionDomainEvent(
+ final String description,
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super(source, identifier, arguments);
+ this.description = description;
+ }
+ public String getEventDescription() {
+ return description;
+ }
+ }
+
+ public static class CompletedEvent extends AbstractActionDomainEvent {
+ private static final long serialVersionUID = 1L;
+ public CompletedEvent(
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super("completed", source, identifier, arguments);
+ }
+ }
+
+ public static class NoLongerCompletedEvent extends AbstractActionDomainEvent {
+ private static final long serialVersionUID = 1L;
+ public NoLongerCompletedEvent(
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super("no longer completed", source, identifier, arguments);
+ }
+ }
+
+ public static class DeletedEvent extends AbstractActionDomainEvent {
+ private static final long serialVersionUID = 1L;
+ public DeletedEvent(
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super("deleted", source, identifier, arguments);
+ }
+ }
+
+ //endregion
+
+ //region > predicates
+
+ public static class Predicates {
+
+ public static Predicate<ToDoItem> thoseOwnedBy(final String currentUser) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem toDoItem) {
+ return Objects.equal(toDoItem.getOwnedBy(), currentUser);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseCompleted(
+ final boolean completed) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return Objects.equal(t.isComplete(), completed);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseWithSimilarDescription(final String description) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return t.getDescription().contains(description);
+ }
+ };
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Predicate<ToDoItem> thoseSimilarTo(final ToDoItem toDoItem) {
+ return com.google.common.base.Predicates.and(
+ thoseNot(toDoItem),
+ thoseOwnedBy(toDoItem.getOwnedBy()),
+ thoseCategorised(toDoItem.getCategory()));
+ }
+
+ public static Predicate<ToDoItem> thoseNot(final ToDoItem toDoItem) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return t != toDoItem;
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseCategorised(final Category category) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem toDoItem) {
+ return Objects.equal(toDoItem.getCategory(), category);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseSubcategorised(
+ final Subcategory subcategory) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return Objects.equal(t.getSubcategory(), subcategory);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseCategorised(
+ final Category category, final Subcategory subcategory) {
+ return com.google.common.base.Predicates.and(
+ thoseCategorised(category),
+ thoseSubcategorised(subcategory));
+ }
+
+ }
+
+ //endregion
+
+ //region > toString, compareTo
+ @Override
+ public String toString() {
+ return ObjectContracts.toString(this, "description,complete,dueBy,ownedBy");
+ }
+
+ /**
+ * Required so can store in {@link SortedSet sorted set}s (eg {@link #getDependencies()}).
+ */
+ @Override
+ public int compareTo(final ToDoItem other) {
+ return ObjectContracts.compare(this, other, "complete,dueBy,description");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ DomainObjectContainer container;
+
+ @javax.inject.Inject
+ ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ Scratchpad scratchpad;
+
+ /**
+ * public only so can be injected from integ tests
+ */
+ @javax.inject.Inject
+ public ActionInvocationContext actionInvocationContext;
+
+ /**
+ * public only so can be injected from integ tests
+ */
+ @javax.inject.Inject
+ public EventBusService eventBusService;
+
+ @javax.inject.Inject
+ WrapperFactory wrapperFactory;
+
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json
new file mode 100644
index 0000000..cda5fdc
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json
@@ -0,0 +1,222 @@
+/**
+ * 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.
+ */
+{
+ "columns": [
+ {
+ "span": 6,
+ "memberGroups": {
+ "General": {
+ "members": {
+ "description": {
+ "propertyLayout": {
+ "cssClass": "x-key",
+ "labelPosition": "TOP"
+ }
+ },
+ "category": {
+ "propertyLayout": {
+ "labelPosition": "TOP"
+ }
+ },
+ "subcategory": {
+ "propertyLayout": {
+ "labelPosition": "NONE"
+ },
+ "actions": {
+ "updateCategory": {
+ "actionLayout": {
+ "named": "Update"
+ }
+ },
+ "analyseCategory": {
+ "actionLayout": {
+ "cssClass": "btn-default",
+ "cssClassFa": "fa fa-pie-chart"
+ }
+ }
+ }
+ },
+ "ownedBy": {
+ "propertyLayout": {
+ "hidden": "EVERYWHERE"
+ }
+ },
+ "complete": {
+ "propertyLayout": {
+ "named": "Whether this todo item has been <i>completed</i> or not.",
+ "namedEscaped": false,
+ "describedAs": "Whether this todo item has been completed, or not.",
+ "labelPosition": "LEFT"
+ },
+ "actions": {
+ "completed": {
+ "actionLayout": {
+ "named": "Done",
+ "describedAs": "Update this todo item as complete",
+ "cssClass": "btn-success",
+ "cssClassFa": "fa fa-thumbs-up"
+ }
+ },
+ "notYetCompleted": {
+ "actionLayout": {
+ "named": "Not done",
+ "describedAs": "Update this todo item as not yet complete",
+ "cssClass": "btn-info",
+ "cssClassFa": "fa fa-thumbs-down"
+ }
+ },
+ "scheduleExplicitly": {
+ },
+ "scheduleImplicitly": {
+ }
+ }
+ }
+ }
+ },
+ "Misc": {
+ "members": {
+ "versionSequence": {
+ "propertyLayout": {
+ "named": "Version",
+ "hidden": "ALL_TABLES"
+ },
+ "disabled": {}
+ }
+ }
+ }
+ }
+ },
+ {
+ "span": 6,
+ "memberGroups": {
+ "Priority": {
+ "members": {
+ "relativePriority": {
+ "actions": {
+ "previous": {
+ "actionLayout": {
+ "cssClassFa": "fa fa-step-backward"
+ }
+ },
+ "next": {
+ "actionLayout": {
+ "cssClassFa": "fa fa-step-forward",
+ "cssClassFaPosition": "right"
+ }
+ }
+ }
+ },
+ "dueBy": {
+ "propertyLayout": {
+ "renderedAsDayBefore": "false"
+ }
+ }
+ }
+ },
+ "Other": {
+ "members": {
+ "cost": {
+ "actions": {
+ "updateCost":{
+ "actionLayout": {
+ "named": "Update",
+ "cssClassFa": "fa fa-dollar"
+ }
+ }
+ }
+ },
+ "notes": {
+ "propertyLayout": {
+ "hidden": "ALL_TABLES",
+ "labelPosition": "TOP",
+ "multiLine": 5
+ }
+ },
+ "attachment": {
+ "propertyLayout": {
+ "hidden": "STANDALONE_TABLES"
+ }
+ },
+ "doc": {
+ "propertyLayout": {
+ "hidden": "STANDALONE_TABLES"
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "span": 0
+ },
+ {
+ "span": 6,
+ "collections": {
+ "dependencies": {
+ "collectionLayout": {
+ "named": "Todo items that are <i>dependencies</i> of this item.",
+ "namedEscaped": false,
+ "describedAs": "Todo items that must be completed before this one",
+ "paged": 5,
+ "render": "EAGERLY"
+ },
+ "disabled": {},
+ "actions": {
+ "add":{
+ "actionLayout": {
+ "cssClass": "btn-default",
+ "cssClassFa": "fa fa-plus-square"
+ }
+ },
+ "remove": {
+ "actionLayout": {
+ "cssClass": "x-caution btn-default",
+ "cssClassFa": "fa fa-minus-square"
+ }
+ }
+ }
+ },
+ "similarTo": {
+ "collectionLayout": {
+ "named": "Todo items that are <i>similar to</i> this one",
+ "namedEscaped": false,
+ "paged": 3,
+ "render": "LAZILY"
+ },
+ "disabled": {}
+ }
+ }
+ }
+ ],
+ "actions": {
+ "totalCost": {},
+ "delete": {
+ "actionLayout": {
+ "cssClass": "btn btn-danger",
+ "cssClassFa": "fa fa-trash fa-lg"
+ }
+ },
+ "duplicate": {
+ "actionLayout": {
+ "named": "Clone",
+ "describedAs": "Create a new todo item from this one",
+ "cssClass": "btn-warn",
+ "cssClassFa": "fa fa-copy fa-lg"
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png
new file mode 100644
index 0000000..99a9fed
Binary files /dev/null and b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
new file mode 100644
index 0000000..32b2aa4
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
@@ -0,0 +1,48 @@
+/*
+ * 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 dom.todo;
+
+import org.apache.isis.applib.annotation.PublishingChangeKind;
+import org.apache.isis.applib.annotation.PublishingPayloadFactoryForObject;
+import org.apache.isis.applib.services.publish.EventPayload;
+import org.apache.isis.applib.services.publish.EventPayloadForObjectChanged;
+
+public class ToDoItemChangedPayloadFactory implements PublishingPayloadFactoryForObject {
+
+ public static class ToDoItemPayload extends EventPayloadForObjectChanged<ToDoItem> {
+
+ public ToDoItemPayload(ToDoItem changed) {
+ super(changed);
+ }
+
+ /**
+ * Expose the item's {@link ToDoItem#getDescription() description} more explicitly
+ * in the payload.
+ */
+ public String getDescription() {
+ return getChanged().getDescription();
+ }
+ }
+
+ @Override
+ public EventPayload payloadFor(final Object changedObject, final PublishingChangeKind publishingChangeKind) {
+ return new ToDoItemPayload((ToDoItem) changedObject);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java
new file mode 100644
index 0000000..b35135c
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java
@@ -0,0 +1,276 @@
+/*
+ * 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 dom.todo;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+import java.util.List;
+import java.util.concurrent.Callable;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Ordering;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.AbstractFactoryAndRepository;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Contributed;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.Optionality;
+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.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.query.QueryDefault;
+import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
+import org.apache.isis.applib.value.Clob;
+
+@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
+public class ToDoItemContributions extends AbstractFactoryAndRepository {
+
+ //region > priority (contributed property)
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ hidden = Where.ALL_TABLES
+ )
+ @ActionLayout(
+ describedAs = "The relative priority of this item compared to others not yet complete (using 'due by' date)",
+ contributed = Contributed.AS_ASSOCIATION
+ )
+ @Property(
+ editing = Editing.DISABLED,
+ editingDisabledReason = "Relative priority, derived from due date"
+ )
+ public Integer relativePriority(final ToDoItem toDoItem) {
+ return queryResultsCache.execute(new Callable<Integer>(){
+ @Override
+ public Integer call() throws Exception {
+ if(toDoItem.isComplete()) {
+ return null;
+ }
+
+ // sort items, then locate this one
+ int i=1;
+ for (final ToDoItem each : sortedNotYetComplete()) {
+ if(each == toDoItem) {
+ return i;
+ }
+ i++;
+ }
+ return null;
+ }}, ToDoItemContributions.class, "relativePriority", toDoItem);
+ }
+
+ private List<ToDoItem> sortedNotYetComplete() {
+ return ORDERING_DUE_BY
+ .compound(ORDERING_DESCRIPTION)
+ .sortedCopy(toDoItems.notYetComplete());
+ }
+
+ private static final Ordering<ToDoItem> ORDERING_DUE_BY =
+ Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, LocalDate>(){
+ @Override
+ public LocalDate apply(final ToDoItem input) {
+ return input.getDueBy();
+ }
+ });
+
+ private static final Ordering<ToDoItem> ORDERING_DESCRIPTION =
+ Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, String>(){
+ @Override
+ public String apply(final ToDoItem input) {
+ return input.getDescription();
+ }
+ });
+
+
+ //endregion
+
+ //region > next, previous (contributed actions)
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(
+ describedAs = "The next item not yet completed",
+ contributed = Contributed.AS_ACTION
+ )
+ public ToDoItem next(final ToDoItem item) {
+ final Integer priority = relativePriority(item);
+ if(priority == null) {
+ return item;
+ }
+ int priorityOfNext = priority != null ? priority + 1 : 0;
+ return itemWithPriorityElse(priorityOfNext, item);
+ }
+ public String disableNext(final ToDoItem toDoItem) {
+ if (toDoItem.isComplete()) {
+ return "Completed";
+ }
+ if(next(toDoItem) == null) {
+ return "No next item";
+ }
+ return null;
+ }
+
+ // //////////////////////////////////////
+
+ @ActionLayout(
+ describedAs = "The previous item not yet completed",
+ contributed = Contributed.AS_ACTION
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ public ToDoItem previous(final ToDoItem item) {
+ final Integer priority = relativePriority(item);
+ if(priority == null) {
+ return item;
+ }
+ int priorityOfPrevious = priority != null? priority - 1 : 0;
+ return itemWithPriorityElse(priorityOfPrevious, item);
+ }
+ public String disablePrevious(final ToDoItem toDoItem) {
+ if (toDoItem.isComplete()) {
+ return "Completed";
+ }
+ if(previous(toDoItem) == null) {
+ return "No previous item";
+ }
+ return null;
+ }
+
+ // //////////////////////////////////////
+
+ /**
+ * @param priority : 1-based priority
+ */
+ private ToDoItem itemWithPriorityElse(int priority, final ToDoItem itemElse) {
+ if(priority < 1) {
+ return null;
+ }
+ final List<ToDoItem> items = sortedNotYetComplete();
+ if(priority > items.size()) {
+ return null;
+ }
+ return priority>=0 && items.size()>=priority? items.get(priority-1): itemElse;
+ }
+ //endregion
+
+ //region > similarTo (contributed collection)
+ @ActionLayout(
+ contributed = Contributed.AS_ASSOCIATION
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ public List<ToDoItem> similarTo(final ToDoItem toDoItem) {
+ final List<ToDoItem> similarToDoItems = allMatches(
+ new QueryDefault<ToDoItem>(ToDoItem.class,
+ "findByOwnedByAndCategory",
+ "ownedBy", currentUserName(),
+ "category", toDoItem.getCategory()));
+ return Lists.newArrayList(Iterables.filter(similarToDoItems, excluding(toDoItem)));
+ }
+
+
+ private static Predicate<ToDoItem> excluding(final ToDoItem toDoItem) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(ToDoItem input) {
+ return input != toDoItem;
+ }
+ };
+ }
+ //endregion
+
+ //region > updateCategory (contributed action)
+
+ @ActionLayout(
+ describedAs = "Update category and subcategory"
+ )
+ @Action(semantics = SemanticsOf.IDEMPOTENT)
+ public Categorized updateCategory(
+ final Categorized item,
+ final @ParameterLayout(named="Category") Category category,
+ final @Parameter(optionality = Optionality.OPTIONAL) @ParameterLayout(named="Subcategory") Subcategory subcategory) {
+ item.setCategory(category);
+ item.setSubcategory(subcategory);
+ return item;
+ }
+ public Category default1UpdateCategory(
+ final Categorized item) {
+ return item != null? item.getCategory(): null;
+ }
+ public Subcategory default2UpdateCategory(
+ final Categorized item) {
+ return item != null? item.getSubcategory(): null;
+ }
+
+ public List<Subcategory> choices2UpdateCategory(
+ final Categorized item, final Category category) {
+ return Subcategory.listFor(category);
+ }
+
+ public String validateUpdateCategory(
+ final Categorized item, final Category category, final Subcategory subcategory) {
+ return Subcategory.validate(category, subcategory);
+ }
+ //endregion
+
+ // region > exportAsJson (action)
+ /**
+ * Demonstrates functionality of streaming back Clob/Blob result within an action with a prompt, i.e. Ajax request
+ */
+ @Action(semantics = SemanticsOf.SAFE)
+ public Clob exportAsJson(
+ final ToDoItem toDoItem,
+ @ParameterLayout(named = "File name") String fileName
+ ) {
+ if(!fileName.endsWith(".json")) {
+ fileName += ".json";
+ }
+ return new Clob(
+ fileName,
+ "application/json",
+ "{" +
+ "\"description\": \"" + toDoItem.getDescription()+"\"" +
+ ",\"complete\": " + ""+toDoItem.isComplete() +
+ "}");
+ }
+
+ public String default1ExportAsJson() {
+ return "todo";
+ }
+ //endregion
+
+
+ //region > helpers
+ protected String currentUserName() {
+ return getContainer().getUser().getName();
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ private QueryResultsCache queryResultsCache;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
new file mode 100644
index 0000000..91b0ee8
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
@@ -0,0 +1,399 @@
+/*
+ * 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 dom.todo;
+
+import java.util.EventObject;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Lists;
+import com.google.common.eventbus.Subscribe;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
+
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.transform;
+import static com.google.common.collect.Lists.newArrayList;
+
+/**
+ * Subscribes to changes made to the {@link dom.todo.ToDoItem} entity.
+ *
+ * <p>
+ * (For demo purposes) the behaviour can be influenced using {@link #subscriberBehaviour(dom.todo.ToDoItemSubscriptions.Behaviour)}.
+ * In particular, the subscriber can be used to hide/disable/validate actions, or just to perform pre- or post-execute
+ * tasks. This also includes being set to throw an exception during the execution of the action (also in effect
+ * vetoing the change).
+ * </p>
+ */
+@DomainService(nature = NatureOfService.VIEW_MENU_ONLY)
+@DomainServiceLayout(menuBar = DomainServiceLayout.MenuBar.SECONDARY, menuOrder = "30")
+public class ToDoItemSubscriptions {
+
+ //region > LOG
+ private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItemSubscriptions.class);
+ //endregion
+
+ //region > postConstruct, preDestroy
+
+ /**
+ * Registers this service with the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
+ *
+ * <p>
+ * Because this service is a singleton, this is called during initial bootstrap.
+ * </p>
+ */
+ @Programmatic
+ @PostConstruct
+ public void postConstruct() {
+ LOG.info("postConstruct: registering to event bus");
+ eventBusService.register(this);
+ }
+
+ /**
+ * Unregisters this service from the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
+ *
+ * <p>
+ * Because this service is a singleton, this is only done when the system is shutdown.
+ * </p>
+ */
+ @Programmatic
+ @PreDestroy
+ public void preDestroy() {
+ LOG.info("preDestroy: unregistering from event bus");
+ eventBusService.unregister(this);
+ }
+ //endregion
+
+
+ //region > on(Event)...
+
+ public static enum Behaviour {
+ AnyExecuteAccept,
+ AnyExecuteVetoWithRecoverableException,
+ AnyExecuteVetoWithNonRecoverableException,
+ AnyExecuteVetoWithOtherException,
+ UpdateCostActionHide,
+ UpdateCostActionDisable,
+ UpdateCostActionInvalidate,
+ DescriptionPropertyHide,
+ DescriptionPropertyDisable,
+ DescriptionPropertyInvalidate,
+ DependenciesCollectionHide,
+ // not implemented in Wicket viewer, but supported in wrapped objects
+ DependenciesCollectionDisable,
+ // not implemented in Wicket viewer, but supported in wrapped objects
+ DependenciesCollectionInvalidateAdd,
+ DependenciesCollectionInvalidateRemove,
+ SimilarToCollectionHide
+ }
+
+ /**
+ * The desired behaviour of this service.
+ */
+ private Behaviour behaviour = Behaviour.AnyExecuteAccept;
+
+ /**
+ * To demo/test what occurs if a subscriber that might veto an event.
+ */
+ @MemberOrder(name = "Prototyping", sequence = "80")
+ @ActionLayout(
+ named="Set subscriber behaviour"
+ )
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ public void subscriberBehaviour(
+ @ParameterLayout(
+ named="Behaviour"
+ )
+ final Behaviour behaviour) {
+ this.behaviour = behaviour;
+ container.informUser("Subscriber behaviour set to: " + behaviour);
+ }
+ public Behaviour default0SubscriberBehaviour() {
+ return this.behaviour;
+ }
+
+ @Programmatic
+ public Behaviour getSubscriberBehaviour() {
+ return behaviour;
+ }
+
+
+ private void onExecutedThrowExceptionIfSet(final ActionDomainEvent<?> ev) {
+ if(ev != null && ev.getSemantics().isSafe()) {
+ return;
+ }
+ onExecutedThrowExceptionIfSet();
+ }
+ private void onExecutedThrowExceptionIfSet(final PropertyDomainEvent<?, ?> ev) {
+ onExecutedThrowExceptionIfSet();
+ }
+ private void onExecutedThrowExceptionIfSet(final CollectionDomainEvent<?, ?> ev) {
+ onExecutedThrowExceptionIfSet();
+ }
+
+
+ private void onExecutedThrowExceptionIfSet() {
+ if(behaviour == Behaviour.AnyExecuteVetoWithRecoverableException) {
+ throw new RecoverableException("Rejecting event (recoverable exception thrown)");
+ }
+ if(behaviour == Behaviour.AnyExecuteVetoWithNonRecoverableException) {
+ throw new NonRecoverableException("Rejecting event (non-recoverable exception thrown)");
+ }
+ if(behaviour == Behaviour.AnyExecuteVetoWithOtherException) {
+ throw new RuntimeException("Throwing some other exception");
+ }
+ }
+ //endregion
+
+ //region > on(Event) for ToDoItem-specific events
+ @Programmatic
+ @Subscribe
+ public void on(final ToDoItem.CompletedEvent ev) {
+ recordEvent(ev);
+ switch(ev.getEventPhase()) {
+ case HIDE:
+ break;
+ case DISABLE:
+ break;
+ case VALIDATE:
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received ToDoItem.CompletedEvent for : " + ev.getSource().toString());
+ break;
+ }
+ }
+ //endregion
+
+ //region > on(Event) ... general purpose
+
+ @Programmatic
+ @Subscribe
+ public void on(final ActionDomainEvent<?> ev) {
+ recordEvent(ev);
+ switch(ev.getEventPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionHide) {
+ if(ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.hide();
+ }
+ }
+ break;
+ case DISABLE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionDisable) {
+ if(ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.disable("ToDoItemSubscriptions says: updateCost action disabled!");
+ }
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionInvalidate &&
+ ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.invalidate("ToDoItemSubscriptions says: can't invoke updateCost action with these args!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received ActionDomainEvent, " + ev.getSource().toString() + ", invoked " + ev.getIdentifier().getMemberName());
+ onExecutedThrowExceptionIfSet(ev);
+ break;
+ }
+ }
+
+ @Programmatic
+ @Subscribe
+ public void on(PropertyDomainEvent<?,?> ev) {
+ recordEvent(ev);
+ switch(ev.getEventPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyHide &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.veto("");
+ }
+ break;
+ case DISABLE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyDisable &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.veto("ToDoItemSubscriptions says: description property disabled!");
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyInvalidate &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.veto("ToDoItemSubscriptions says: can't change description property to this value!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received PropertyDomainEvent, " + ev.getSource().toString() + ", changed " + ev.getIdentifier().getMemberName() + " : " + ev.getOldValue() + " -> " + ev.getNewValue());
+ onExecutedThrowExceptionIfSet(ev);
+
+ if(ev.getIdentifier().getMemberName().contains("description")) {
+ String newValue = (String) ev.getNewValue();
+ if(newValue.matches(".*demo veto.*")) {
+ throw new RecoverableException("oh no you don't! " + ev.getNewValue());
+ }
+ }
+ break;
+ }
+ }
+
+ @Programmatic
+ @Subscribe
+ public void on(CollectionDomainEvent<?,?> ev) {
+ recordEvent(ev);
+ switch (ev.getEventPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionHide &&
+ ev.getIdentifier().getMemberName().equals("dependencies")) {
+ ev.veto("");
+ }
+ if (getSubscriberBehaviour() == Behaviour.SimilarToCollectionHide &&
+ ev.getIdentifier().getMemberName().equals("similarTo")) {
+ ev.veto("");
+ }
+ break;
+ case DISABLE:
+ if (getSubscriberBehaviour() == Behaviour.DependenciesCollectionDisable &&
+ ev.getIdentifier().getMemberName().equals("dependencies")) {
+ ev.veto("ToDoItemSubscriptions says: dependencies collection disabled!");
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateAdd &&
+ ev.getIdentifier().getMemberName().equals("dependencies") &&
+ ev.getOf() == CollectionDomainEvent.Of.ADD_TO ) {
+ ev.veto("ToDoItemSubscriptions says: can't add this object to dependencies collection!");
+ }
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateRemove &&
+ ev.getIdentifier().getMemberName().equals("dependencies") &&
+ ev.getOf() == CollectionDomainEvent.Of.REMOVE_FROM ) {
+ ev.veto("ToDoItemSubscriptions says: can't remove this object from dependencies collection!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ if(ev.getOf() == CollectionDomainEvent.Of.ADD_TO) {
+ LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", added to " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
+ } else {
+ LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", removed from " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
+ }
+ onExecutedThrowExceptionIfSet(ev);
+ break;
+ }
+
+ }
+
+ //endregion
+
+ //region > receivedEvents
+ private final List<java.util.EventObject> receivedEvents = Lists.newLinkedList();
+
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public List<java.util.EventObject> receivedEvents() {
+ return receivedEvents;
+ }
+
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public <T extends java.util.EventObject> List<T> receivedEvents(final Class<T> expectedType) {
+ return newArrayList(
+ transform(
+ filter(receivedEvents, instanceOf(expectedType)),
+ castTo(expectedType)));
+ }
+
+ private static <T extends EventObject> Function<EventObject, T> castTo(Class<T> expectedType) {
+ return new Function<EventObject, T>() {
+ @Override
+ public T apply(EventObject input) {
+ return (T) input;
+ }
+ };
+ }
+
+ private static <T extends EventObject> Predicate<EventObject> instanceOf(final Class<T> expectedType) {
+ return new Predicate<EventObject>() {
+ @Override
+ public boolean apply(EventObject input) {
+ return expectedType.isInstance(input);
+ }
+ };
+ }
+
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public <T extends java.util.EventObject> T mostRecentlyReceivedEvent(Class<T> expectedType) {
+ final List<T> receivedEvents = receivedEvents(expectedType);
+ return !receivedEvents.isEmpty() ? receivedEvents.get(0) : null;
+ }
+ private void recordEvent(final java.util.EventObject ev) {
+ receivedEvents.add(0, ev);
+ }
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public void reset() {
+ receivedEvents.clear();
+ subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept);
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+
+ @javax.inject.Inject
+ private EventBusService eventBusService;
+ //endregion
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java
new file mode 100644
index 0000000..da392a5
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java
@@ -0,0 +1,257 @@
+/*
+ * 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 dom.todo;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+import java.math.BigDecimal;
+import java.util.List;
+import com.google.common.base.Predicates;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.query.QueryDefault;
+import org.apache.isis.applib.services.clock.ClockService;
+
+@DomainServiceLayout(named="ToDos", menuOrder = "10")
+@DomainService(repositoryFor = ToDoItem.class)
+public class ToDoItems {
+
+ //region > notYetComplete (action)
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(
+ cssClassFa = "fa fa-thumbs-down",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @MemberOrder(sequence = "10")
+ public List<ToDoItem> notYetComplete() {
+ final List<ToDoItem> items = notYetCompleteNoUi();
+ if(items.isEmpty()) {
+ container.informUser("All to-do items have been completed :-)");
+ }
+ return items;
+ }
+
+ @Programmatic
+ public List<ToDoItem> notYetCompleteNoUi() {
+ return container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedByAndCompleteIsFalse",
+ "ownedBy", currentUserName()));
+ }
+ //endregion
+
+ //region > complete (action)
+ @ActionLayout(
+ cssClassFa = "fa fa-thumbs-up"
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ @MemberOrder(sequence = "20")
+ public List<ToDoItem> complete() {
+ final List<ToDoItem> items = completeNoUi();
+ if(items.isEmpty()) {
+ container.informUser("No to-do items have yet been completed :-(");
+ }
+ return items;
+ }
+
+ @Programmatic
+ public List<ToDoItem> completeNoUi() {
+ return container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedByAndCompleteIsTrue",
+ "ownedBy", currentUserName()));
+ }
+ //endregion
+
+ //region > categorized (action)
+ @SuppressWarnings("unchecked")
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(
+ cssClassFa = "fa fa-question",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @MemberOrder(sequence = "40")
+ public List<ToDoItem> categorized(
+ @ParameterLayout(named="Category") final Category category,
+ @ParameterLayout(named="Subcategory") final Subcategory subcategory,
+ @ParameterLayout(named="Completed?") final boolean completed) {
+ // an example "naive" implementation (filtered in Java code, not DBMS)
+ return container.allMatches(ToDoItem.class,
+ Predicates.and(
+ ToDoItem.Predicates.thoseOwnedBy(currentUserName()),
+ ToDoItem.Predicates.thoseCompleted(completed),
+ ToDoItem.Predicates.thoseCategorised(category, subcategory)));
+ }
+ public Category default0Categorized() {
+ return Category.Professional;
+ }
+ public Subcategory default1Categorized() {
+ return default0Categorized().subcategories().get(0);
+ }
+ public boolean default2Categorized() {
+ return false;
+ }
+ public List<Subcategory> choices1Categorized(
+ final Category category) {
+ return Subcategory.listFor(category);
+ }
+ public String validateCategorized(
+ final Category category,
+ final Subcategory subcategory,
+ final boolean completed) {
+ return Subcategory.validate(category, subcategory);
+ }
+ //endregion
+
+ //region > newToDo (action)
+ @ActionLayout(cssClassFa = "fa fa-plus")
+ @MemberOrder(sequence = "5")
+ public ToDoItem newToDo(
+ @Parameter(regexPattern = "\\w[@&:\\-\\,\\.\\+ \\w]*")
+ @ParameterLayout(named="Description")
+ final String description,
+ @ParameterLayout(named="Category")
+ final Category category,
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(named="Subcategory")
+ final Subcategory subcategory,
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(named="Due by")
+ final LocalDate dueBy,
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(named="Cost")
+ final BigDecimal cost) {
+ return newToDo(description, category, subcategory, currentUserName(), dueBy, cost);
+ }
+ public Category default1NewToDo() {
+ return Category.Professional;
+ }
+ public Subcategory default2NewToDo() {
+ return Category.Professional.subcategories().get(0);
+ }
+ public LocalDate default3NewToDo() {
+ return clockService.now().plusDays(14);
+ }
+ public List<Subcategory> choices2NewToDo(
+ final String description, final Category category) {
+ return Subcategory.listFor(category);
+ }
+ public String validateNewToDo(
+ final String description,
+ final Category category, final Subcategory subcategory,
+ final LocalDate dueBy, final BigDecimal cost) {
+ return Subcategory.validate(category, subcategory);
+ }
+ //endregion
+
+ //region > allToDos (action)
+ @ActionLayout(
+ cssClassFa = "fa fa-globe"
+ )
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @MemberOrder(sequence = "50")
+ public List<ToDoItem> allToDos() {
+ final List<ToDoItem> items = container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedBy",
+ "ownedBy", currentUserName()));
+ if(items.isEmpty()) {
+ container.warnUser("No to-do items found.");
+ }
+ return items;
+ }
+ //endregion
+
+ //region > autoComplete (programmatic)
+ @Programmatic // not part of metamodel
+ public List<ToDoItem> autoComplete(final String description) {
+ return container.allMatches(
+ new QueryDefault<>(ToDoItem.class,
+ "findByOwnedByAndDescriptionContains",
+ "ownedBy", currentUserName(),
+ "description", description));
+ }
+ //endregion
+
+ //region > helpers
+ @Programmatic // for use by fixtures
+ public ToDoItem newToDo(
+ final String description,
+ final Category category,
+ final Subcategory subcategory,
+ final String userName,
+ final LocalDate dueBy, final BigDecimal cost) {
+ final ToDoItem toDoItem = container.newTransientInstance(ToDoItem.class);
+ toDoItem.setDescription(description);
+ toDoItem.setCategory(category);
+ toDoItem.setSubcategory(subcategory);
+ toDoItem.setOwnedBy(userName);
+ toDoItem.setDueBy(dueBy);
+ toDoItem.setCost(cost);
+
+ container.persist(toDoItem);
+ container.flush();
+
+ return toDoItem;
+ }
+
+ private String currentUserName() {
+ return container.getUser().getName();
+ }
+
+ //endregion
+
+ //region > common validation
+ private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
+
+ @Programmatic
+ public String validateDueBy(final LocalDate dueBy) {
+ return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
+ }
+ @Programmatic
+ boolean isMoreThanOneWeekInPast(final LocalDate dueBy) {
+ return dueBy.toDateTimeAtStartOfDay().getMillis() < clockService.nowAsMillis() - ONE_WEEK_IN_MILLIS;
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+
+ @javax.inject.Inject
+ private ClockService clockService;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java b/mothballed/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
new file mode 100644
index 0000000..b1f5168
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
@@ -0,0 +1,133 @@
+/**
+ * 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 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.services.actinvoc.ActionInvocationContext;
+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;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public abstract class ToDoItemTest {
+
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+ @Mock
+ EventBusService eventBusService;
+
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ toDoItem = new ToDoItem();
+
+ toDoItem.actionInvocationContext = ActionInvocationContext.onObject(toDoItem);
+ toDoItem.eventBusService = eventBusService;
+
+ context.ignoring(eventBusService);
+ }
+
+ public static class Properties 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 {
+
+ // given
+ toDoItem.setComplete(false);
+ assertThat(toDoItem.disableCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(true));
+ assertThat(toDoItem.disableCompleted(), is(not(nullValue())));
+ }
+ }
+
+ public static class NotYetCompleted extends Actions {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ toDoItem.setComplete(true);
+ assertThat(toDoItem.disableNotYetCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(false));
+ assertThat(toDoItem.disableNotYetCompleted(), is(not(nullValue())));
+ }
+ }
+ }
+
+
+}
[28/29] isis git commit: ISIS-903: fixing bug introduced on minor
improvement to CssClassFa facet
Posted by da...@apache.org.
ISIS-903: fixing bug introduced on minor improvement to CssClassFa facet
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/2b5f47c6
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/2b5f47c6
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/2b5f47c6
Branch: refs/heads/ISIS-903
Commit: 2b5f47c64d26240b0c05e65b6e628ca07ed7a3d6
Parents: f23f4e7
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Feb 14 09:01:20 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Feb 14 09:07:37 2015 +0000
----------------------------------------------------------------------
.../java/org/apache/isis/applib/services/i18n/TrStringTest.java | 4 ----
.../facets/members/cssclassfa/CssClassFaFacetAbstract.java | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/2b5f47c6/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
----------------------------------------------------------------------
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java b/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
index 7399a2d..3b801ad 100644
--- a/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
+++ b/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
@@ -108,10 +108,6 @@ public class TrStringTest {
assertThat(ts.translate(echoTranslationService, null, null), is("My name is James Bond."));
assertThat(originalTextToTranslate, is("My name is {firstName} {lastName}."));
}
-
}
-
-
-
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/2b5f47c6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
index 963b860..e381e65 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
@@ -63,7 +63,7 @@ public class CssClassFaFacetAbstract extends SingleStringValueFacetAbstract impl
}
private static String faPrefix(final String cssClass) {
- return cssClass.startsWith("fa-")
+ return cssClass.startsWith("fa-") || "fa".equals(cssClass)
? cssClass
: "fa-" + cssClass;
}
[22/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index 75f5583..0000000
--- a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java
+++ /dev/null
@@ -1,979 +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 dom.todo;
-
-import java.math.BigDecimal;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import javax.jdo.JDOHelper;
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.VersionStrategy;
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Ordering;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.Collection;
-import org.apache.isis.applib.annotation.CollectionLayout;
-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.RestrictTo;
-import org.apache.isis.applib.annotation.InvokeOn;
-import org.apache.isis.applib.annotation.InvokedOn;
-import org.apache.isis.applib.annotation.Optionality;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.Property;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.security.UserMemento;
-import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.scratchpad.Scratchpad;
-import org.apache.isis.applib.services.wrapper.HiddenException;
-import org.apache.isis.applib.services.wrapper.WrapperFactory;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.applib.util.TitleBuffer;
-import org.apache.isis.applib.value.Blob;
-import org.apache.isis.applib.value.Clob;
-
-@javax.jdo.annotations.PersistenceCapable(identityType=IdentityType.DATASTORE)
-@javax.jdo.annotations.DatastoreIdentity(
- strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
- column="id")
-@javax.jdo.annotations.Version(
- strategy=VersionStrategy.VERSION_NUMBER,
- column="version")
-@javax.jdo.annotations.Uniques({
- @javax.jdo.annotations.Unique(
- name="ToDoItem_description_must_be_unique",
- members={"ownedBy","description"})
-})
-@javax.jdo.annotations.Queries( {
- @javax.jdo.annotations.Query(
- name = "findByOwnedBy", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndCompleteIsFalse", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy "
- + " && complete == false"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndCompleteIsTrue", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy "
- + "&& complete == true"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndCategory", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy "
- + "&& category == :category"),
- @javax.jdo.annotations.Query(
- name = "findByOwnedByAndDescriptionContains", language = "JDOQL",
- value = "SELECT "
- + "FROM dom.todo.ToDoItem "
- + "WHERE ownedBy == :ownedBy && "
- + "description.indexOf(:description) >= 0")
-})
-@DomainObject(
- autoCompleteRepository = ToDoItems.class, // for drop-downs, unless autoCompleteNXxx() is present
- autoCompleteAction = "autoComplete",
- // bounded = true, // for drop-downs if only a small number of instances only (overrides autoComplete)
- objectType = "TODO"
-)
-@DomainObjectLayout(
- bookmarking = BookmarkPolicy.AS_ROOT
-)
-public class ToDoItem implements Categorized, Comparable<ToDoItem> {
-
- //region > LOG
- /**
- * It isn't common for entities to log, but they can if required.
- * Isis uses slf4j API internally (with log4j as implementation), and is the recommended API to use.
- */
- private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItem.class);
- //endregion
-
- // region > title, icon
- public String title() {
- final TitleBuffer buf = new TitleBuffer();
- buf.append(getDescription());
- if (isComplete()) {
- buf.append("- Completed!");
- } else {
- try {
- final LocalDate dueBy = wrapperFactory.wrap(this).getDueBy();
- if (dueBy != null) {
- buf.append(" due by", dueBy);
- }
- } catch(final HiddenException ignored) {
- }
- }
- return buf.toString();
- }
-
- public String iconName() {
- return !isComplete() ? "todo" : "done";
- }
-
- public String cssClass() { return iconName(); }
-
- //endregion
-
- //region > description (property)
- private String description;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=100)
- @Property(
- regexPattern = "\\w[@&:\\-\\,\\.\\+ \\w]*"
- )
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
- public void modifyDescription(final String description) {
- setDescription(description);
- }
- public void clearDescription() {
- setDescription(null);
- }
- //endregion
-
- //region > dueBy (property)
- @javax.jdo.annotations.Persistent(defaultFetchGroup="true")
- private LocalDate dueBy;
-
- @javax.jdo.annotations.Column(allowsNull="true")
- public LocalDate getDueBy() {
- 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");
- }
-
- public void setDueBy(final LocalDate dueBy) {
- this.dueBy = dueBy;
- }
- public void clearDueBy() {
- setDueBy(null);
- }
- // proposed new value is validated before setting
- public String validateDueBy(final LocalDate dueBy) {
- if (dueBy == null) {
- return null;
- }
- return toDoItems.validateDueBy(dueBy);
- }
- //endregion
-
- //region > category and subcategory (property)
-
- public static enum Category {
- Professional {
- @Override
- public List<Subcategory> subcategories() {
- return Arrays.asList(null, Subcategory.OpenSource, Subcategory.Consulting, Subcategory.Education, Subcategory.Marketing);
- }
- }, Domestic {
- @Override
- public List<Subcategory> subcategories() {
- return Arrays.asList(null, Subcategory.Shopping, Subcategory.Housework, Subcategory.Garden, Subcategory.Chores);
- }
- }, Other {
- @Override
- public List<Subcategory> subcategories() {
- return Arrays.asList(null, Subcategory.Other);
- }
- };
-
- public abstract List<Subcategory> subcategories();
- }
-
- public static enum Subcategory {
- // professional
- OpenSource, Consulting, Education, Marketing,
- // domestic
- Shopping, Housework, Garden, Chores,
- // other
- Other;
-
- public static List<Subcategory> listFor(final Category category) {
- return category != null? category.subcategories(): Collections.<Subcategory>emptyList();
- }
-
- static String validate(final Category category, final Subcategory subcategory) {
- if(category == null) {
- return "Enter category first";
- }
- return !category.subcategories().contains(subcategory)
- ? "Invalid subcategory for category '" + category + "'"
- : null;
- }
-
- public static Predicate<Subcategory> thoseFor(final Category category) {
- return new Predicate<Subcategory>() {
-
- @Override
- public boolean apply(final Subcategory subcategory) {
- return category.subcategories().contains(subcategory);
- }
- };
- }
- }
-
- // //////////////////////////////////////
-
- private Category category;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- @Property(
- editing = Editing.DISABLED,
- editingDisabledReason = "Use action to update both category and subcategory"
- )
- public Category getCategory() {
- return category;
- }
-
- public void setCategory(final Category category) {
- this.category = category;
- }
-
- // //////////////////////////////////////
-
- private Subcategory subcategory;
-
- @javax.jdo.annotations.Column(allowsNull="true")
- @Property(
- editing = Editing.DISABLED,
- editingDisabledReason = "Use action to update both category and subcategory"
- )
- public Subcategory getSubcategory() {
- return subcategory;
- }
- public void setSubcategory(final Subcategory subcategory) {
- this.subcategory = subcategory;
- }
- //endregion
-
- //region > ownedBy (property)
-
- private String ownedBy;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- public String getOwnedBy() {
- return ownedBy;
- }
-
- public void setOwnedBy(final String ownedBy) {
- this.ownedBy = ownedBy;
- }
- //endregion
-
- //region > complete (property), completed (action), notYetCompleted (action)
-
- private boolean complete;
-
- @Property(
- editing = Editing.DISABLED
- )
- public boolean isComplete() {
- return complete;
- }
-
- public void setComplete(final boolean complete) {
- this.complete = complete;
- }
-
- @Action(
- domainEvent =CompletedEvent.class,
- invokeOn = InvokeOn.OBJECT_AND_COLLECTION
- )
- public ToDoItem completed() {
- setComplete(true);
-
- //
- // remainder of method just demonstrates the use of the Bulk.InteractionContext service
- //
- @SuppressWarnings("unused")
- final List<Object> allObjects = actionInvocationContext.getDomainObjects();
-
- LOG.debug("completed: "
- + actionInvocationContext.getIndex() +
- " [" + actionInvocationContext.getSize() + "]"
- + (actionInvocationContext.isFirst() ? " (first)" : "")
- + (actionInvocationContext.isLast() ? " (last)" : ""));
-
- // if invoked as a regular action, return this object;
- // otherwise (if invoked as bulk), return null (so go back to the list)
- return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT? this: null;
- }
- // disable action dependent on state of object
- public String disableCompleted() {
- return isComplete() ? "Already completed" : null;
- }
-
- @Action(
- invokeOn = InvokeOn.OBJECT_AND_COLLECTION
- )
- public ToDoItem notYetCompleted() {
- setComplete(false);
-
- // if invoked as a regular action, return this object;
- // otherwise (if invoked as bulk), return null (so go back to the list)
- return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT ? this: null;
- }
- // disable action dependent on state of object
- public String disableNotYetCompleted() {
- return !complete ? "Not yet completed" : null;
- }
- //endregion
-
- //region > completeSlowly (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- @Action(
- hidden = Where.EVERYWHERE
- )
- public void completeSlowly(final int millis) {
- try {
- Thread.sleep(millis);
- } catch (final InterruptedException ignored) {
- }
- setComplete(true);
- }
- //endregion
-
- //region > cost (property), updateCost (action)
- private BigDecimal cost;
-
- @javax.jdo.annotations.Column(allowsNull="true", scale=2)
- @javax.validation.constraints.Digits(integer=10, fraction=2)
- @Property(
- editing = Editing.DISABLED,
- editingDisabledReason = "Update using action"
- )
- public BigDecimal getCost() {
- return cost;
- }
-
- public void setCost(final BigDecimal cost) {
- this.cost = cost!=null?cost.setScale(2, BigDecimal.ROUND_HALF_EVEN):null;
- }
-
- @Action(
- semantics = SemanticsOf.IDEMPOTENT
- )
- public ToDoItem updateCost(
- @Parameter(optionality = Optionality.OPTIONAL)
- @ParameterLayout(named = "New cost")
- @javax.validation.constraints.Digits(integer=10, fraction=2)
- final BigDecimal cost) {
- LOG.debug("%s: cost updated: %s -> %s", container.titleOf(this), getCost(), cost);
-
- // just to simulate a long-running action
- try {
- Thread.sleep(3000);
- } catch (final InterruptedException ignored) {
- }
-
- setCost(cost);
- return this;
- }
-
- // provide a default value for argument #0
- public BigDecimal default0UpdateCost() {
- return getCost();
- }
-
- // validate action arguments
- public String validateUpdateCost(final BigDecimal proposedCost) {
- if(proposedCost == null) { return null; }
- return proposedCost.compareTo(BigDecimal.ZERO) < 0? "Cost must be positive": null;
- }
- //endregion
-
- //region > notes (property)
- private String notes;
-
- @javax.jdo.annotations.Column(allowsNull="true", length=400)
- public String getNotes() {
- return notes;
- }
-
- public void setNotes(final String notes) {
- this.notes = notes;
- }
- //endregion
-
- //region > attachment (property)
- private Blob attachment;
- @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
- @javax.jdo.annotations.Column(name = "attachment_name"),
- @javax.jdo.annotations.Column(name = "attachment_mimetype"),
- @javax.jdo.annotations.Column(name = "attachment_bytes", jdbcType = "BLOB", sqlType = "BLOB")
- })
- @Property(
- optionality = Optionality.OPTIONAL
- )
- public Blob getAttachment() {
- return attachment;
- }
-
- public void setAttachment(final Blob attachment) {
- this.attachment = attachment;
- }
- //endregion
-
- //region > doc (property)
- private Clob doc;
- @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
- @javax.jdo.annotations.Column(name = "doc_name"),
- @javax.jdo.annotations.Column(name = "doc_mimetype"),
- @javax.jdo.annotations.Column(name = "doc_chars", jdbcType = "CLOB", sqlType = "CLOB")
- })
- @Property(
- optionality = Optionality.OPTIONAL
- )
- public Clob getDoc() {
- return doc;
- }
-
- public void setDoc(final Clob doc) {
- this.doc = doc;
- }
- //endregion
-
- //region > version (derived property)
- public Long getVersionSequence() {
- if(!(this instanceof javax.jdo.spi.PersistenceCapable)) {
- return null;
- }
- return (Long) JDOHelper.getVersion((javax.jdo.spi.PersistenceCapable) this);
- }
- // hide property (imperatively, based on state of object)
- public boolean hideVersionSequence() {
- return !(this instanceof javax.jdo.spi.PersistenceCapable);
- }
- //endregion
-
- //region > dependencies (property), add (action), remove (action)
-
- // overrides the natural ordering
- public static class DependenciesComparator implements Comparator<ToDoItem> {
- @Override
- public int compare(final ToDoItem p, final ToDoItem q) {
- final Ordering<ToDoItem> byDescription = new Ordering<ToDoItem>() {
- public int compare(final ToDoItem p, final ToDoItem q) {
- return Ordering.natural().nullsFirst().compare(p.getDescription(), q.getDescription());
- }
- };
- return byDescription
- .compound(Ordering.<ToDoItem>natural())
- .compare(p, q);
- }
- }
-
- @javax.jdo.annotations.Persistent(table="ToDoItemDependencies")
- @javax.jdo.annotations.Join(column="dependingId")
- @javax.jdo.annotations.Element(column="dependentId")
-
- private Set<ToDoItem> dependencies = new TreeSet<>();
- //private SortedSet<ToDoItem> dependencies = new TreeSet<>(); // not compatible with neo4j (as of DN v3.2.3)
-
- @Collection()
- @CollectionLayout(/*sortedBy = DependenciesComparator.class*/) // not compatible with neo4j (as of DN v3.2.3)
- public Set<ToDoItem> getDependencies() {
- return dependencies;
- }
-
- public void setDependencies(final Set<ToDoItem> dependencies) {
- this.dependencies = dependencies;
- }
-
- public void addToDependencies(final ToDoItem toDoItem) {
- getDependencies().add(toDoItem);
- }
- public void removeFromDependencies(final ToDoItem toDoItem) {
- getDependencies().remove(toDoItem);
- }
-
- public ToDoItem add(
- @ParameterLayout(typicalLength = 20)
- final ToDoItem toDoItem) {
- // By wrapping the call, Isis will detect that the collection is modified
- // and it will automatically send CollectionInteractionEvents to the Event Bus.
- // ToDoItemSubscriptions is a demo subscriber to this event
- wrapperFactory.wrapSkipRules(this).addToDependencies(toDoItem);
- return this;
- }
- public List<ToDoItem> autoComplete0Add(
- @Parameter(minLength = 2)
- final String search) {
- final List<ToDoItem> list = toDoItems.autoComplete(search);
- list.removeAll(getDependencies());
- list.remove(this);
- return list;
- }
-
- public String disableAdd(final ToDoItem toDoItem) {
- if(isComplete()) {
- return "Cannot add dependencies for items that are complete";
- }
- return null;
- }
- // validate the provided argument prior to invoking action
- public String validateAdd(final ToDoItem toDoItem) {
- if(getDependencies().contains(toDoItem)) {
- return "Already a dependency";
- }
- if(toDoItem == this) {
- return "Can't set up a dependency to self";
- }
- return null;
- }
-
- public ToDoItem remove(
- @ParameterLayout(typicalLength = 20)
- final ToDoItem toDoItem) {
- // By wrapping the call, Isis will detect that the collection is modified
- // and it will automatically send a CollectionInteractionEvent to the Event Bus.
- // ToDoItemSubscriptions is a demo subscriber to this event
- wrapperFactory.wrapSkipRules(this).removeFromDependencies(toDoItem);
- return this;
- }
- // disable action dependent on state of object
- public String disableRemove(final ToDoItem toDoItem) {
- if(isComplete()) {
- return "Cannot remove dependencies for items that are complete";
- }
- return getDependencies().isEmpty()? "No dependencies to remove": null;
- }
- // validate the provided argument prior to invoking action
- public String validateRemove(final ToDoItem toDoItem) {
- if(!getDependencies().contains(toDoItem)) {
- return "Not a dependency";
- }
- return null;
- }
- // provide a drop-down
- public java.util.Collection<ToDoItem> choices0Remove() {
- return getDependencies();
- }
- //endregion
-
- //region > clone (action)
-
- // the name of the action in the UI
- // nb: method is not called "clone()" is inherited by java.lang.Object and
- // (a) has different semantics and (b) is in any case automatically ignored
- // by the framework
- public ToDoItem duplicate(
- @Parameter(regexPattern = "\\w[@&:\\-\\,\\.\\+ \\w]*" )
- @ParameterLayout(named="Description")
- final String description,
- @ParameterLayout(named="Category")
- final Category category,
- @ParameterLayout(named="Subcategory")
- final Subcategory subcategory,
- @Parameter(optionality = Optionality.OPTIONAL)
- @ParameterLayout(named="Due by")
- final LocalDate dueBy,
- @Parameter(optionality = Optionality.OPTIONAL)
- @ParameterLayout(named="Cost")
- final BigDecimal cost) {
- return toDoItems.newToDo(description, category, subcategory, dueBy, cost);
- }
- public String default0Duplicate() {
- return getDescription() + " - Copy";
- }
- public Category default1Duplicate() {
- return getCategory();
- }
- public Subcategory default2Duplicate() {
- return getSubcategory();
- }
- public LocalDate default3Duplicate() {
- return getDueBy();
- }
- public List<Subcategory> choices2Duplicate(
- final String description, final Category category) {
- return toDoItems.choices2NewToDo(description, category);
- }
- public String validateDuplicate(
- final String description,
- final Category category, final Subcategory subcategory,
- final LocalDate dueBy, final BigDecimal cost) {
- return toDoItems.validateNewToDo(description, category, subcategory, dueBy, cost);
- }
- //endregion
-
- //region > delete (action)
- @Action(
- domainEvent =DeletedEvent.class,
- invokeOn = InvokeOn.OBJECT_AND_COLLECTION
- )
- public List<ToDoItem> delete() {
-
- container.removeIfNotAlready(this);
-
- container.informUser("Deleted " + container.titleOf(this));
-
- // invalid to return 'this' (cannot render a deleted object)
- return toDoItems.notYetComplete();
- }
- //endregion
-
- //region > totalCost (property)
- @Action(
- semantics = SemanticsOf.SAFE,
- invokeOn = InvokeOn.COLLECTION_ONLY
- )
- public BigDecimal totalCost() {
- BigDecimal total = (BigDecimal) scratchpad.get("runningTotal");
- if(getCost() != null) {
- total = total != null ? total.add(getCost()) : getCost();
- scratchpad.put("runningTotal", total);
- }
- return total.setScale(2, BigDecimal.ROUND_HALF_EVEN);
- }
- //endregion
-
- //region > openSourceCodeOnGithub (action)
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- public URL openSourceCodeOnGithub() throws MalformedURLException {
- return new URL("https://github.com/apache/isis/tree/master/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java");
- }
- //endregion
-
- //region > demoException (action)
-
- static enum DemoExceptionType {
- RecoverableException,
- RecoverableExceptionAutoEscalated,
- NonRecoverableException;
- }
-
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- public void demoException(
- @ParameterLayout(named="Type")
- final DemoExceptionType type) {
- switch(type) {
- case NonRecoverableException:
- throw new NonRecoverableException("Demo throwing " + type.name());
- case RecoverableException:
- throw new RecoverableException("Demo throwing " + type.name());
- case RecoverableExceptionAutoEscalated:
- try {
- // this will trigger an exception (because category cannot be null), causing the xactn to be aborted
- setCategory(null);
- container.flush();
- } catch(Exception e) {
- // it's a programming mistake to throw only a recoverable exception here, because of the xactn's state.
- // the framework should instead auto-escalate this to a non-recoverable exception
- throw new RecoverableException("Demo throwing " + type.name(), e);
- }
- }
- }
- //endregion
-
- //region > lifecycle callbacks
-
- public void created() {
- LOG.debug("lifecycle callback: created: " + this.toString());
- }
- public void loaded() {
- LOG.debug("lifecycle callback: loaded: " + this.toString());
- }
- public void persisting() {
- LOG.debug("lifecycle callback: persisting: " + this.toString());
- }
- public void persisted() {
- LOG.debug("lifecycle callback: persisted: " + this.toString());
- }
- public void updating() {
- LOG.debug("lifecycle callback: updating: " + this.toString());
- }
- public void updated() {
- LOG.debug("lifecycle callback: updated: " + this.toString());
- }
- public void removing() {
- LOG.debug("lifecycle callback: removing: " + this.toString());
- }
- public void removed() {
- LOG.debug("lifecycle callback: removed: " + this.toString());
- }
- //endregion
-
- //region > object-level validation
-
- /**
- * Prevent user from viewing another user's data.
- */
- public boolean hidden() {
- // uncomment to enable. As things stand, the disabled() method below instead will make object "read-only".
- //return !Objects.equal(getOwnedBy(), container.getUser().getName());
- return false;
- }
-
- /**
- * Prevent user from modifying any other user's data.
- */
- public String disabled(final Identifier.Type identifierType){
- final UserMemento currentUser = container.getUser();
- final String currentUserName = currentUser.getName();
- if(Objects.equal(getOwnedBy(), currentUserName)) { return null; }
- return "This object is owned by '" + getOwnedBy() + "' and cannot be modified by you";
- }
-
- /**
- * In a real app, if this were actually a rule, then we'd expect that
- * invoking the {@link #completed() done} action would clear the {@link #getDueBy() dueBy}
- * property (rather than require the user to have to clear manually).
- */
- public String validate() {
- if(isComplete() && getDueBy() != null) {
- return "Due by date must be set to null if item has been completed";
- }
- return null;
- }
-
-
- //endregion
-
-
- //region > programmatic helpers
- @Programmatic // excluded from the framework's metamodel
- public boolean isDue() {
- if (getDueBy() == null) {
- return false;
- }
- return !toDoItems.isMoreThanOneWeekInPast(getDueBy());
- }
- //endregion
-
- //region > events
-
- public static abstract class AbstractActionDomainEvent extends ActionDomainEvent<ToDoItem> {
- private static final long serialVersionUID = 1L;
- private final String description;
- public AbstractActionDomainEvent(
- final String description,
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super(source, identifier, arguments);
- this.description = description;
- }
- public String getEventDescription() {
- return description;
- }
- }
-
- public static class CompletedEvent extends AbstractActionDomainEvent {
- private static final long serialVersionUID = 1L;
- public CompletedEvent(
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super("completed", source, identifier, arguments);
- }
- }
-
- public static class NoLongerCompletedEvent extends AbstractActionDomainEvent {
- private static final long serialVersionUID = 1L;
- public NoLongerCompletedEvent(
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super("no longer completed", source, identifier, arguments);
- }
- }
-
- public static class DeletedEvent extends AbstractActionDomainEvent {
- private static final long serialVersionUID = 1L;
- public DeletedEvent(
- final ToDoItem source,
- final Identifier identifier,
- final Object... arguments) {
- super("deleted", source, identifier, arguments);
- }
- }
-
- //endregion
-
- //region > predicates
-
- public static class Predicates {
-
- public static Predicate<ToDoItem> thoseOwnedBy(final String currentUser) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem toDoItem) {
- return Objects.equal(toDoItem.getOwnedBy(), currentUser);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseCompleted(
- final boolean completed) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return Objects.equal(t.isComplete(), completed);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseWithSimilarDescription(final String description) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return t.getDescription().contains(description);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static Predicate<ToDoItem> thoseSimilarTo(final ToDoItem toDoItem) {
- return com.google.common.base.Predicates.and(
- thoseNot(toDoItem),
- thoseOwnedBy(toDoItem.getOwnedBy()),
- thoseCategorised(toDoItem.getCategory()));
- }
-
- public static Predicate<ToDoItem> thoseNot(final ToDoItem toDoItem) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return t != toDoItem;
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseCategorised(final Category category) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem toDoItem) {
- return Objects.equal(toDoItem.getCategory(), category);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseSubcategorised(
- final Subcategory subcategory) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return Objects.equal(t.getSubcategory(), subcategory);
- }
- };
- }
-
- public static Predicate<ToDoItem> thoseCategorised(
- final Category category, final Subcategory subcategory) {
- return com.google.common.base.Predicates.and(
- thoseCategorised(category),
- thoseSubcategorised(subcategory));
- }
-
- }
-
- //endregion
-
- //region > toString, compareTo
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "description,complete,dueBy,ownedBy");
- }
-
- /**
- * Required so can store in {@link SortedSet sorted set}s (eg {@link #getDependencies()}).
- */
- @Override
- public int compareTo(final ToDoItem other) {
- return ObjectContracts.compare(this, other, "complete,dueBy,description");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- DomainObjectContainer container;
-
- @javax.inject.Inject
- ToDoItems toDoItems;
-
- @javax.inject.Inject
- Scratchpad scratchpad;
-
- /**
- * public only so can be injected from integ tests
- */
- @javax.inject.Inject
- public ActionInvocationContext actionInvocationContext;
-
- /**
- * public only so can be injected from integ tests
- */
- @javax.inject.Inject
- public EventBusService eventBusService;
-
- @javax.inject.Inject
- WrapperFactory wrapperFactory;
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json
deleted file mode 100644
index cda5fdc..0000000
--- a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.layout.json
+++ /dev/null
@@ -1,222 +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.
- */
-{
- "columns": [
- {
- "span": 6,
- "memberGroups": {
- "General": {
- "members": {
- "description": {
- "propertyLayout": {
- "cssClass": "x-key",
- "labelPosition": "TOP"
- }
- },
- "category": {
- "propertyLayout": {
- "labelPosition": "TOP"
- }
- },
- "subcategory": {
- "propertyLayout": {
- "labelPosition": "NONE"
- },
- "actions": {
- "updateCategory": {
- "actionLayout": {
- "named": "Update"
- }
- },
- "analyseCategory": {
- "actionLayout": {
- "cssClass": "btn-default",
- "cssClassFa": "fa fa-pie-chart"
- }
- }
- }
- },
- "ownedBy": {
- "propertyLayout": {
- "hidden": "EVERYWHERE"
- }
- },
- "complete": {
- "propertyLayout": {
- "named": "Whether this todo item has been <i>completed</i> or not.",
- "namedEscaped": false,
- "describedAs": "Whether this todo item has been completed, or not.",
- "labelPosition": "LEFT"
- },
- "actions": {
- "completed": {
- "actionLayout": {
- "named": "Done",
- "describedAs": "Update this todo item as complete",
- "cssClass": "btn-success",
- "cssClassFa": "fa fa-thumbs-up"
- }
- },
- "notYetCompleted": {
- "actionLayout": {
- "named": "Not done",
- "describedAs": "Update this todo item as not yet complete",
- "cssClass": "btn-info",
- "cssClassFa": "fa fa-thumbs-down"
- }
- },
- "scheduleExplicitly": {
- },
- "scheduleImplicitly": {
- }
- }
- }
- }
- },
- "Misc": {
- "members": {
- "versionSequence": {
- "propertyLayout": {
- "named": "Version",
- "hidden": "ALL_TABLES"
- },
- "disabled": {}
- }
- }
- }
- }
- },
- {
- "span": 6,
- "memberGroups": {
- "Priority": {
- "members": {
- "relativePriority": {
- "actions": {
- "previous": {
- "actionLayout": {
- "cssClassFa": "fa fa-step-backward"
- }
- },
- "next": {
- "actionLayout": {
- "cssClassFa": "fa fa-step-forward",
- "cssClassFaPosition": "right"
- }
- }
- }
- },
- "dueBy": {
- "propertyLayout": {
- "renderedAsDayBefore": "false"
- }
- }
- }
- },
- "Other": {
- "members": {
- "cost": {
- "actions": {
- "updateCost":{
- "actionLayout": {
- "named": "Update",
- "cssClassFa": "fa fa-dollar"
- }
- }
- }
- },
- "notes": {
- "propertyLayout": {
- "hidden": "ALL_TABLES",
- "labelPosition": "TOP",
- "multiLine": 5
- }
- },
- "attachment": {
- "propertyLayout": {
- "hidden": "STANDALONE_TABLES"
- }
- },
- "doc": {
- "propertyLayout": {
- "hidden": "STANDALONE_TABLES"
- }
- }
- }
- }
- }
- },
- {
- "span": 0
- },
- {
- "span": 6,
- "collections": {
- "dependencies": {
- "collectionLayout": {
- "named": "Todo items that are <i>dependencies</i> of this item.",
- "namedEscaped": false,
- "describedAs": "Todo items that must be completed before this one",
- "paged": 5,
- "render": "EAGERLY"
- },
- "disabled": {},
- "actions": {
- "add":{
- "actionLayout": {
- "cssClass": "btn-default",
- "cssClassFa": "fa fa-plus-square"
- }
- },
- "remove": {
- "actionLayout": {
- "cssClass": "x-caution btn-default",
- "cssClassFa": "fa fa-minus-square"
- }
- }
- }
- },
- "similarTo": {
- "collectionLayout": {
- "named": "Todo items that are <i>similar to</i> this one",
- "namedEscaped": false,
- "paged": 3,
- "render": "LAZILY"
- },
- "disabled": {}
- }
- }
- }
- ],
- "actions": {
- "totalCost": {},
- "delete": {
- "actionLayout": {
- "cssClass": "btn btn-danger",
- "cssClassFa": "fa fa-trash fa-lg"
- }
- },
- "duplicate": {
- "actionLayout": {
- "named": "Clone",
- "describedAs": "Create a new todo item from this one",
- "cssClass": "btn-warn",
- "cssClassFa": "fa fa-copy fa-lg"
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png
deleted file mode 100644
index 99a9fed..0000000
Binary files a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
deleted file mode 100644
index 32b2aa4..0000000
--- a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
+++ /dev/null
@@ -1,48 +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 dom.todo;
-
-import org.apache.isis.applib.annotation.PublishingChangeKind;
-import org.apache.isis.applib.annotation.PublishingPayloadFactoryForObject;
-import org.apache.isis.applib.services.publish.EventPayload;
-import org.apache.isis.applib.services.publish.EventPayloadForObjectChanged;
-
-public class ToDoItemChangedPayloadFactory implements PublishingPayloadFactoryForObject {
-
- public static class ToDoItemPayload extends EventPayloadForObjectChanged<ToDoItem> {
-
- public ToDoItemPayload(ToDoItem changed) {
- super(changed);
- }
-
- /**
- * Expose the item's {@link ToDoItem#getDescription() description} more explicitly
- * in the payload.
- */
- public String getDescription() {
- return getChanged().getDescription();
- }
- }
-
- @Override
- public EventPayload payloadFor(final Object changedObject, final PublishingChangeKind publishingChangeKind) {
- return new ToDoItemPayload((ToDoItem) changedObject);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java
deleted file mode 100644
index b35135c..0000000
--- a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java
+++ /dev/null
@@ -1,276 +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 dom.todo;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Ordering;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.Contributed;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Editing;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.Optionality;
-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.SemanticsOf;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
-import org.apache.isis.applib.value.Clob;
-
-@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
-public class ToDoItemContributions extends AbstractFactoryAndRepository {
-
- //region > priority (contributed property)
- @Action(
- semantics = SemanticsOf.SAFE,
- hidden = Where.ALL_TABLES
- )
- @ActionLayout(
- describedAs = "The relative priority of this item compared to others not yet complete (using 'due by' date)",
- contributed = Contributed.AS_ASSOCIATION
- )
- @Property(
- editing = Editing.DISABLED,
- editingDisabledReason = "Relative priority, derived from due date"
- )
- public Integer relativePriority(final ToDoItem toDoItem) {
- return queryResultsCache.execute(new Callable<Integer>(){
- @Override
- public Integer call() throws Exception {
- if(toDoItem.isComplete()) {
- return null;
- }
-
- // sort items, then locate this one
- int i=1;
- for (final ToDoItem each : sortedNotYetComplete()) {
- if(each == toDoItem) {
- return i;
- }
- i++;
- }
- return null;
- }}, ToDoItemContributions.class, "relativePriority", toDoItem);
- }
-
- private List<ToDoItem> sortedNotYetComplete() {
- return ORDERING_DUE_BY
- .compound(ORDERING_DESCRIPTION)
- .sortedCopy(toDoItems.notYetComplete());
- }
-
- private static final Ordering<ToDoItem> ORDERING_DUE_BY =
- Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, LocalDate>(){
- @Override
- public LocalDate apply(final ToDoItem input) {
- return input.getDueBy();
- }
- });
-
- private static final Ordering<ToDoItem> ORDERING_DESCRIPTION =
- Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, String>(){
- @Override
- public String apply(final ToDoItem input) {
- return input.getDescription();
- }
- });
-
-
- //endregion
-
- //region > next, previous (contributed actions)
- @Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(
- describedAs = "The next item not yet completed",
- contributed = Contributed.AS_ACTION
- )
- public ToDoItem next(final ToDoItem item) {
- final Integer priority = relativePriority(item);
- if(priority == null) {
- return item;
- }
- int priorityOfNext = priority != null ? priority + 1 : 0;
- return itemWithPriorityElse(priorityOfNext, item);
- }
- public String disableNext(final ToDoItem toDoItem) {
- if (toDoItem.isComplete()) {
- return "Completed";
- }
- if(next(toDoItem) == null) {
- return "No next item";
- }
- return null;
- }
-
- // //////////////////////////////////////
-
- @ActionLayout(
- describedAs = "The previous item not yet completed",
- contributed = Contributed.AS_ACTION
- )
- @Action(semantics = SemanticsOf.SAFE)
- public ToDoItem previous(final ToDoItem item) {
- final Integer priority = relativePriority(item);
- if(priority == null) {
- return item;
- }
- int priorityOfPrevious = priority != null? priority - 1 : 0;
- return itemWithPriorityElse(priorityOfPrevious, item);
- }
- public String disablePrevious(final ToDoItem toDoItem) {
- if (toDoItem.isComplete()) {
- return "Completed";
- }
- if(previous(toDoItem) == null) {
- return "No previous item";
- }
- return null;
- }
-
- // //////////////////////////////////////
-
- /**
- * @param priority : 1-based priority
- */
- private ToDoItem itemWithPriorityElse(int priority, final ToDoItem itemElse) {
- if(priority < 1) {
- return null;
- }
- final List<ToDoItem> items = sortedNotYetComplete();
- if(priority > items.size()) {
- return null;
- }
- return priority>=0 && items.size()>=priority? items.get(priority-1): itemElse;
- }
- //endregion
-
- //region > similarTo (contributed collection)
- @ActionLayout(
- contributed = Contributed.AS_ASSOCIATION
- )
- @Action(semantics = SemanticsOf.SAFE)
- public List<ToDoItem> similarTo(final ToDoItem toDoItem) {
- final List<ToDoItem> similarToDoItems = allMatches(
- new QueryDefault<ToDoItem>(ToDoItem.class,
- "findByOwnedByAndCategory",
- "ownedBy", currentUserName(),
- "category", toDoItem.getCategory()));
- return Lists.newArrayList(Iterables.filter(similarToDoItems, excluding(toDoItem)));
- }
-
-
- private static Predicate<ToDoItem> excluding(final ToDoItem toDoItem) {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(ToDoItem input) {
- return input != toDoItem;
- }
- };
- }
- //endregion
-
- //region > updateCategory (contributed action)
-
- @ActionLayout(
- describedAs = "Update category and subcategory"
- )
- @Action(semantics = SemanticsOf.IDEMPOTENT)
- public Categorized updateCategory(
- final Categorized item,
- final @ParameterLayout(named="Category") Category category,
- final @Parameter(optionality = Optionality.OPTIONAL) @ParameterLayout(named="Subcategory") Subcategory subcategory) {
- item.setCategory(category);
- item.setSubcategory(subcategory);
- return item;
- }
- public Category default1UpdateCategory(
- final Categorized item) {
- return item != null? item.getCategory(): null;
- }
- public Subcategory default2UpdateCategory(
- final Categorized item) {
- return item != null? item.getSubcategory(): null;
- }
-
- public List<Subcategory> choices2UpdateCategory(
- final Categorized item, final Category category) {
- return Subcategory.listFor(category);
- }
-
- public String validateUpdateCategory(
- final Categorized item, final Category category, final Subcategory subcategory) {
- return Subcategory.validate(category, subcategory);
- }
- //endregion
-
- // region > exportAsJson (action)
- /**
- * Demonstrates functionality of streaming back Clob/Blob result within an action with a prompt, i.e. Ajax request
- */
- @Action(semantics = SemanticsOf.SAFE)
- public Clob exportAsJson(
- final ToDoItem toDoItem,
- @ParameterLayout(named = "File name") String fileName
- ) {
- if(!fileName.endsWith(".json")) {
- fileName += ".json";
- }
- return new Clob(
- fileName,
- "application/json",
- "{" +
- "\"description\": \"" + toDoItem.getDescription()+"\"" +
- ",\"complete\": " + ""+toDoItem.isComplete() +
- "}");
- }
-
- public String default1ExportAsJson() {
- return "todo";
- }
- //endregion
-
-
- //region > helpers
- protected String currentUserName() {
- return getContainer().getUser().getName();
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItems toDoItems;
-
- @javax.inject.Inject
- private QueryResultsCache queryResultsCache;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
deleted file mode 100644
index 91b0ee8..0000000
--- a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
+++ /dev/null
@@ -1,399 +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 dom.todo;
-
-import java.util.EventObject;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
-import com.google.common.eventbus.Subscribe;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
-
-/**
- * Subscribes to changes made to the {@link dom.todo.ToDoItem} entity.
- *
- * <p>
- * (For demo purposes) the behaviour can be influenced using {@link #subscriberBehaviour(dom.todo.ToDoItemSubscriptions.Behaviour)}.
- * In particular, the subscriber can be used to hide/disable/validate actions, or just to perform pre- or post-execute
- * tasks. This also includes being set to throw an exception during the execution of the action (also in effect
- * vetoing the change).
- * </p>
- */
-@DomainService(nature = NatureOfService.VIEW_MENU_ONLY)
-@DomainServiceLayout(menuBar = DomainServiceLayout.MenuBar.SECONDARY, menuOrder = "30")
-public class ToDoItemSubscriptions {
-
- //region > LOG
- private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItemSubscriptions.class);
- //endregion
-
- //region > postConstruct, preDestroy
-
- /**
- * Registers this service with the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
- *
- * <p>
- * Because this service is a singleton, this is called during initial bootstrap.
- * </p>
- */
- @Programmatic
- @PostConstruct
- public void postConstruct() {
- LOG.info("postConstruct: registering to event bus");
- eventBusService.register(this);
- }
-
- /**
- * Unregisters this service from the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
- *
- * <p>
- * Because this service is a singleton, this is only done when the system is shutdown.
- * </p>
- */
- @Programmatic
- @PreDestroy
- public void preDestroy() {
- LOG.info("preDestroy: unregistering from event bus");
- eventBusService.unregister(this);
- }
- //endregion
-
-
- //region > on(Event)...
-
- public static enum Behaviour {
- AnyExecuteAccept,
- AnyExecuteVetoWithRecoverableException,
- AnyExecuteVetoWithNonRecoverableException,
- AnyExecuteVetoWithOtherException,
- UpdateCostActionHide,
- UpdateCostActionDisable,
- UpdateCostActionInvalidate,
- DescriptionPropertyHide,
- DescriptionPropertyDisable,
- DescriptionPropertyInvalidate,
- DependenciesCollectionHide,
- // not implemented in Wicket viewer, but supported in wrapped objects
- DependenciesCollectionDisable,
- // not implemented in Wicket viewer, but supported in wrapped objects
- DependenciesCollectionInvalidateAdd,
- DependenciesCollectionInvalidateRemove,
- SimilarToCollectionHide
- }
-
- /**
- * The desired behaviour of this service.
- */
- private Behaviour behaviour = Behaviour.AnyExecuteAccept;
-
- /**
- * To demo/test what occurs if a subscriber that might veto an event.
- */
- @MemberOrder(name = "Prototyping", sequence = "80")
- @ActionLayout(
- named="Set subscriber behaviour"
- )
- @Action(
- semantics = SemanticsOf.IDEMPOTENT,
- restrictTo = RestrictTo.PROTOTYPING
- )
- public void subscriberBehaviour(
- @ParameterLayout(
- named="Behaviour"
- )
- final Behaviour behaviour) {
- this.behaviour = behaviour;
- container.informUser("Subscriber behaviour set to: " + behaviour);
- }
- public Behaviour default0SubscriberBehaviour() {
- return this.behaviour;
- }
-
- @Programmatic
- public Behaviour getSubscriberBehaviour() {
- return behaviour;
- }
-
-
- private void onExecutedThrowExceptionIfSet(final ActionDomainEvent<?> ev) {
- if(ev != null && ev.getSemantics().isSafe()) {
- return;
- }
- onExecutedThrowExceptionIfSet();
- }
- private void onExecutedThrowExceptionIfSet(final PropertyDomainEvent<?, ?> ev) {
- onExecutedThrowExceptionIfSet();
- }
- private void onExecutedThrowExceptionIfSet(final CollectionDomainEvent<?, ?> ev) {
- onExecutedThrowExceptionIfSet();
- }
-
-
- private void onExecutedThrowExceptionIfSet() {
- if(behaviour == Behaviour.AnyExecuteVetoWithRecoverableException) {
- throw new RecoverableException("Rejecting event (recoverable exception thrown)");
- }
- if(behaviour == Behaviour.AnyExecuteVetoWithNonRecoverableException) {
- throw new NonRecoverableException("Rejecting event (non-recoverable exception thrown)");
- }
- if(behaviour == Behaviour.AnyExecuteVetoWithOtherException) {
- throw new RuntimeException("Throwing some other exception");
- }
- }
- //endregion
-
- //region > on(Event) for ToDoItem-specific events
- @Programmatic
- @Subscribe
- public void on(final ToDoItem.CompletedEvent ev) {
- recordEvent(ev);
- switch(ev.getEventPhase()) {
- case HIDE:
- break;
- case DISABLE:
- break;
- case VALIDATE:
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- LOG.info("Received ToDoItem.CompletedEvent for : " + ev.getSource().toString());
- break;
- }
- }
- //endregion
-
- //region > on(Event) ... general purpose
-
- @Programmatic
- @Subscribe
- public void on(final ActionDomainEvent<?> ev) {
- recordEvent(ev);
- switch(ev.getEventPhase()) {
- case HIDE:
- if(getSubscriberBehaviour() == Behaviour.UpdateCostActionHide) {
- if(ev.getIdentifier().getMemberName().equals("updateCost")) {
- ev.hide();
- }
- }
- break;
- case DISABLE:
- if(getSubscriberBehaviour() == Behaviour.UpdateCostActionDisable) {
- if(ev.getIdentifier().getMemberName().equals("updateCost")) {
- ev.disable("ToDoItemSubscriptions says: updateCost action disabled!");
- }
- }
- break;
- case VALIDATE:
- if(getSubscriberBehaviour() == Behaviour.UpdateCostActionInvalidate &&
- ev.getIdentifier().getMemberName().equals("updateCost")) {
- ev.invalidate("ToDoItemSubscriptions says: can't invoke updateCost action with these args!");
- }
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- LOG.info("Received ActionDomainEvent, " + ev.getSource().toString() + ", invoked " + ev.getIdentifier().getMemberName());
- onExecutedThrowExceptionIfSet(ev);
- break;
- }
- }
-
- @Programmatic
- @Subscribe
- public void on(PropertyDomainEvent<?,?> ev) {
- recordEvent(ev);
- switch(ev.getEventPhase()) {
- case HIDE:
- if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyHide &&
- ev.getIdentifier().getMemberName().equals("description")) {
- ev.veto("");
- }
- break;
- case DISABLE:
- if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyDisable &&
- ev.getIdentifier().getMemberName().equals("description")) {
- ev.veto("ToDoItemSubscriptions says: description property disabled!");
- }
- break;
- case VALIDATE:
- if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyInvalidate &&
- ev.getIdentifier().getMemberName().equals("description")) {
- ev.veto("ToDoItemSubscriptions says: can't change description property to this value!");
- }
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- LOG.info("Received PropertyDomainEvent, " + ev.getSource().toString() + ", changed " + ev.getIdentifier().getMemberName() + " : " + ev.getOldValue() + " -> " + ev.getNewValue());
- onExecutedThrowExceptionIfSet(ev);
-
- if(ev.getIdentifier().getMemberName().contains("description")) {
- String newValue = (String) ev.getNewValue();
- if(newValue.matches(".*demo veto.*")) {
- throw new RecoverableException("oh no you don't! " + ev.getNewValue());
- }
- }
- break;
- }
- }
-
- @Programmatic
- @Subscribe
- public void on(CollectionDomainEvent<?,?> ev) {
- recordEvent(ev);
- switch (ev.getEventPhase()) {
- case HIDE:
- if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionHide &&
- ev.getIdentifier().getMemberName().equals("dependencies")) {
- ev.veto("");
- }
- if (getSubscriberBehaviour() == Behaviour.SimilarToCollectionHide &&
- ev.getIdentifier().getMemberName().equals("similarTo")) {
- ev.veto("");
- }
- break;
- case DISABLE:
- if (getSubscriberBehaviour() == Behaviour.DependenciesCollectionDisable &&
- ev.getIdentifier().getMemberName().equals("dependencies")) {
- ev.veto("ToDoItemSubscriptions says: dependencies collection disabled!");
- }
- break;
- case VALIDATE:
- if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateAdd &&
- ev.getIdentifier().getMemberName().equals("dependencies") &&
- ev.getOf() == CollectionDomainEvent.Of.ADD_TO ) {
- ev.veto("ToDoItemSubscriptions says: can't add this object to dependencies collection!");
- }
- if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateRemove &&
- ev.getIdentifier().getMemberName().equals("dependencies") &&
- ev.getOf() == CollectionDomainEvent.Of.REMOVE_FROM ) {
- ev.veto("ToDoItemSubscriptions says: can't remove this object from dependencies collection!");
- }
- break;
- case EXECUTING:
- break;
- case EXECUTED:
- if(ev.getOf() == CollectionDomainEvent.Of.ADD_TO) {
- LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", added to " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
- } else {
- LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", removed from " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
- }
- onExecutedThrowExceptionIfSet(ev);
- break;
- }
-
- }
-
- //endregion
-
- //region > receivedEvents
- private final List<java.util.EventObject> receivedEvents = Lists.newLinkedList();
-
- /**
- * Used in integration tests.
- */
- @Programmatic
- public List<java.util.EventObject> receivedEvents() {
- return receivedEvents;
- }
-
- /**
- * Used in integration tests.
- */
- @Programmatic
- public <T extends java.util.EventObject> List<T> receivedEvents(final Class<T> expectedType) {
- return newArrayList(
- transform(
- filter(receivedEvents, instanceOf(expectedType)),
- castTo(expectedType)));
- }
-
- private static <T extends EventObject> Function<EventObject, T> castTo(Class<T> expectedType) {
- return new Function<EventObject, T>() {
- @Override
- public T apply(EventObject input) {
- return (T) input;
- }
- };
- }
-
- private static <T extends EventObject> Predicate<EventObject> instanceOf(final Class<T> expectedType) {
- return new Predicate<EventObject>() {
- @Override
- public boolean apply(EventObject input) {
- return expectedType.isInstance(input);
- }
- };
- }
-
- /**
- * Used in integration tests.
- */
- @Programmatic
- public <T extends java.util.EventObject> T mostRecentlyReceivedEvent(Class<T> expectedType) {
- final List<T> receivedEvents = receivedEvents(expectedType);
- return !receivedEvents.isEmpty() ? receivedEvents.get(0) : null;
- }
- private void recordEvent(final java.util.EventObject ev) {
- receivedEvents.add(0, ev);
- }
- /**
- * Used in integration tests.
- */
- @Programmatic
- public void reset() {
- receivedEvents.clear();
- subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept);
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
-
- @javax.inject.Inject
- private EventBusService eventBusService;
- //endregion
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java
deleted file mode 100644
index da392a5..0000000
--- a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItems.java
+++ /dev/null
@@ -1,257 +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 dom.todo;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-import java.math.BigDecimal;
-import java.util.List;
-import com.google.common.base.Predicates;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Optionality;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.clock.ClockService;
-
-@DomainServiceLayout(named="ToDos", menuOrder = "10")
-@DomainService(repositoryFor = ToDoItem.class)
-public class ToDoItems {
-
- //region > notYetComplete (action)
- @Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(
- cssClassFa = "fa fa-thumbs-down",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @MemberOrder(sequence = "10")
- public List<ToDoItem> notYetComplete() {
- final List<ToDoItem> items = notYetCompleteNoUi();
- if(items.isEmpty()) {
- container.informUser("All to-do items have been completed :-)");
- }
- return items;
- }
-
- @Programmatic
- public List<ToDoItem> notYetCompleteNoUi() {
- return container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedByAndCompleteIsFalse",
- "ownedBy", currentUserName()));
- }
- //endregion
-
- //region > complete (action)
- @ActionLayout(
- cssClassFa = "fa fa-thumbs-up"
- )
- @Action(semantics = SemanticsOf.SAFE)
- @MemberOrder(sequence = "20")
- public List<ToDoItem> complete() {
- final List<ToDoItem> items = completeNoUi();
- if(items.isEmpty()) {
- container.informUser("No to-do items have yet been completed :-(");
- }
- return items;
- }
-
- @Programmatic
- public List<ToDoItem> completeNoUi() {
- return container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedByAndCompleteIsTrue",
- "ownedBy", currentUserName()));
- }
- //endregion
-
- //region > categorized (action)
- @SuppressWarnings("unchecked")
- @Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(
- cssClassFa = "fa fa-question",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @MemberOrder(sequence = "40")
- public List<ToDoItem> categorized(
- @ParameterLayout(named="Category") final Category category,
- @ParameterLayout(named="Subcategory") final Subcategory subcategory,
- @ParameterLayout(named="Completed?") final boolean completed) {
- // an example "naive" implementation (filtered in Java code, not DBMS)
- return container.allMatches(ToDoItem.class,
- Predicates.and(
- ToDoItem.Predicates.thoseOwnedBy(currentUserName()),
- ToDoItem.Predicates.thoseCompleted(completed),
- ToDoItem.Predicates.thoseCategorised(category, subcategory)));
- }
- public Category default0Categorized() {
- return Category.Professional;
- }
- public Subcategory default1Categorized() {
- return default0Categorized().subcategories().get(0);
- }
- public boolean default2Categorized() {
- return false;
- }
- public List<Subcategory> choices1Categorized(
- final Category category) {
- return Subcategory.listFor(category);
- }
- public String validateCategorized(
- final Category category,
- final Subcategory subcategory,
- final boolean completed) {
- return Subcategory.validate(category, subcategory);
- }
- //endregion
-
- //region > newToDo (action)
- @ActionLayout(cssClassFa = "fa fa-plus")
- @MemberOrder(sequence = "5")
- public ToDoItem newToDo(
- @Parameter(regexPattern = "\\w[@&:\\-\\,\\.\\+ \\w]*")
- @ParameterLayout(named="Description")
- final String description,
- @ParameterLayout(named="Category")
- final Category category,
- @Parameter(optionality = Optionality.OPTIONAL)
- @ParameterLayout(named="Subcategory")
- final Subcategory subcategory,
- @Parameter(optionality = Optionality.OPTIONAL)
- @ParameterLayout(named="Due by")
- final LocalDate dueBy,
- @Parameter(optionality = Optionality.OPTIONAL)
- @ParameterLayout(named="Cost")
- final BigDecimal cost) {
- return newToDo(description, category, subcategory, currentUserName(), dueBy, cost);
- }
- public Category default1NewToDo() {
- return Category.Professional;
- }
- public Subcategory default2NewToDo() {
- return Category.Professional.subcategories().get(0);
- }
- public LocalDate default3NewToDo() {
- return clockService.now().plusDays(14);
- }
- public List<Subcategory> choices2NewToDo(
- final String description, final Category category) {
- return Subcategory.listFor(category);
- }
- public String validateNewToDo(
- final String description,
- final Category category, final Subcategory subcategory,
- final LocalDate dueBy, final BigDecimal cost) {
- return Subcategory.validate(category, subcategory);
- }
- //endregion
-
- //region > allToDos (action)
- @ActionLayout(
- cssClassFa = "fa fa-globe"
- )
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- @MemberOrder(sequence = "50")
- public List<ToDoItem> allToDos() {
- final List<ToDoItem> items = container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedBy",
- "ownedBy", currentUserName()));
- if(items.isEmpty()) {
- container.warnUser("No to-do items found.");
- }
- return items;
- }
- //endregion
-
- //region > autoComplete (programmatic)
- @Programmatic // not part of metamodel
- public List<ToDoItem> autoComplete(final String description) {
- return container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedByAndDescriptionContains",
- "ownedBy", currentUserName(),
- "description", description));
- }
- //endregion
-
- //region > helpers
- @Programmatic // for use by fixtures
- public ToDoItem newToDo(
- final String description,
- final Category category,
- final Subcategory subcategory,
- final String userName,
- final LocalDate dueBy, final BigDecimal cost) {
- final ToDoItem toDoItem = container.newTransientInstance(ToDoItem.class);
- toDoItem.setDescription(description);
- toDoItem.setCategory(category);
- toDoItem.setSubcategory(subcategory);
- toDoItem.setOwnedBy(userName);
- toDoItem.setDueBy(dueBy);
- toDoItem.setCost(cost);
-
- container.persist(toDoItem);
- container.flush();
-
- return toDoItem;
- }
-
- private String currentUserName() {
- return container.getUser().getName();
- }
-
- //endregion
-
- //region > common validation
- private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
-
- @Programmatic
- public String validateDueBy(final LocalDate dueBy) {
- return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
- }
- @Programmatic
- boolean isMoreThanOneWeekInPast(final LocalDate dueBy) {
- return dueBy.toDateTimeAtStartOfDay().getMillis() < clockService.nowAsMillis() - ONE_WEEK_IN_MILLIS;
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
-
- @javax.inject.Inject
- private ClockService clockService;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index b1f5168..0000000
--- a/example/application/todoapp/dom/src/test/java/dom/todo/ToDoItemTest.java
+++ /dev/null
@@ -1,133 +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 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.services.actinvoc.ActionInvocationContext;
-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;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public abstract class ToDoItemTest {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
- @Mock
- EventBusService eventBusService;
-
- ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- toDoItem = new ToDoItem();
-
- toDoItem.actionInvocationContext = ActionInvocationContext.onObject(toDoItem);
- toDoItem.eventBusService = eventBusService;
-
- context.ignoring(eventBusService);
- }
-
- public static class Properties 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 {
-
- // given
- toDoItem.setComplete(false);
- assertThat(toDoItem.disableCompleted(), is(nullValue()));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
- assertThat(toDoItem.disableCompleted(), is(not(nullValue())));
- }
- }
-
- public static class NotYetCompleted extends Actions {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- toDoItem.setComplete(true);
- assertThat(toDoItem.disableNotYetCompleted(), is(nullValue()));
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(toDoItem.isComplete(), is(false));
- assertThat(toDoItem.disableNotYetCompleted(), is(not(nullValue())));
- }
- }
- }
-
-
-}
[23/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
ISIS-928: mothballing the todoapp (example app and archetype)
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/a4ec0b72
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/a4ec0b72
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/a4ec0b72
Branch: refs/heads/ISIS-903
Commit: a4ec0b72e5e2d101fc55c53de57e269bb3f23826
Parents: 51d1f20
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Feb 14 09:06:52 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Feb 14 09:06:52 2015 +0000
----------------------------------------------------------------------
example/application/todoapp/.gitattributes | 51 -
example/application/todoapp/.gitignore | 40 -
.../application/todoapp/dom/log4j.properties | 41 -
example/application/todoapp/dom/pom.xml | 172 ---
.../dom/src/main/java/META-INF/persistence.xml | 26 -
.../dom/src/main/java/app/ToDoAppDashboard.java | 69 --
.../main/java/app/ToDoAppDashboard.layout.json | 26 -
.../dom/src/main/java/app/ToDoAppDashboard.png | Bin 834 -> 0 bytes
.../main/java/app/ToDoAppDashboardService.java | 44 -
.../dom/src/main/java/app/ToDoItemAnalysis.java | 126 ---
.../java/app/ToDoItemAnalysisContributions.java | 50 -
.../java/app/ToDoItemsByCategoryViewModel.java | 168 ---
.../ToDoItemsByCategoryViewModel.layout.json | 43 -
.../java/app/ToDoItemsByCategoryViewModel.png | Bin 684 -> 0 bytes
.../java/app/ToDoItemsByDateRangeViewModel.java | 137 ---
.../ToDoItemsByDateRangeViewModel.layout.json | 33 -
.../java/app/ToDoItemsByDateRangeViewModel.png | Bin 613 -> 0 bytes
.../dom/src/main/java/dom/todo/Categorized.java | 32 -
.../src/main/java/dom/todo/ToDoItem-done.png | Bin 1363 -> 0 bytes
.../src/main/java/dom/todo/ToDoItem-todo.png | Bin 971 -> 0 bytes
.../dom/src/main/java/dom/todo/ToDoItem.java | 979 ----------------
.../src/main/java/dom/todo/ToDoItem.layout.json | 222 ----
.../dom/src/main/java/dom/todo/ToDoItem.png | Bin 971 -> 0 bytes
.../dom/todo/ToDoItemChangedPayloadFactory.java | 48 -
.../java/dom/todo/ToDoItemContributions.java | 276 -----
.../java/dom/todo/ToDoItemSubscriptions.java | 399 -------
.../dom/src/main/java/dom/todo/ToDoItems.java | 257 -----
.../src/test/java/dom/todo/ToDoItemTest.java | 133 ---
example/application/todoapp/fixture/pom.xml | 40 -
.../fixture/todo/ToDoItemsFixturesService.java | 97 --
.../integtests/ToDoItemsIntegTestFixture.java | 40 -
.../complete/ToDoItemCompleteAbstract.java | 52 -
.../complete/ToDoItemCompleteForBuyStamps.java | 30 -
.../ToDoItemCompleteForWriteBlogPost.java | 31 -
.../todo/items/create/ToDoItemAbstract.java | 69 --
.../todo/items/create/ToDoItemForBuyBread.java | 37 -
.../todo/items/create/ToDoItemForBuyMilk.java | 37 -
.../todo/items/create/ToDoItemForBuyStamps.java | 39 -
.../todo/items/create/ToDoItemForMowLawn.java | 37 -
.../create/ToDoItemForOrganizeBrownBag.java | 37 -
.../items/create/ToDoItemForPickUpLaundry.java | 37 -
.../items/create/ToDoItemForSharpenKnives.java | 37 -
.../create/ToDoItemForStageIsisRelease.java | 37 -
.../ToDoItemForSubmitConferenceSession.java | 37 -
.../items/create/ToDoItemForVacuumHouse.java | 37 -
.../items/create/ToDoItemForWriteBlogPost.java | 39 -
.../items/create/ToDoItemForWriteToPenPal.java | 37 -
.../todo/items/delete/ToDoItemsDelete.java | 38 -
.../todo/scenarios/ToDoItemsRecreate.java | 81 --
.../ToDoItemsRecreateAndCompleteSeveral.java | 86 --
...oItemsRecreateAndCompleteSeveralForDick.java | 28 -
...DoItemsRecreateAndCompleteSeveralForJoe.java | 28 -
.../scenarios/ToDoItemsRecreateForSven.java | 29 -
.../src/main/java/fixture/todo/util/Util.java | 32 -
.../todoapp/integtests/logging.properties | 101 --
example/application/todoapp/integtests/pom.xml | 159 ---
.../integration/ToDoAppSystemInitializer.java | 77 --
.../integration/glue/BootstrappingGlue.java | 53 -
.../integration/glue/CatalogOfFixturesGlue.java | 47 -
.../integration/glue/InMemoryDBForToDoApp.java | 40 -
.../integration/glue/todoitem/ToDoItemGlue.java | 165 ---
.../integration/specs/todoitem/RunSpecs.java | 38 -
.../ToDoItemSpec_findAndComplete.feature | 39 -
...findCompletedAndMarkAsNotYetComplete.feature | 35 -
.../tests/AbstractToDoIntegTest.java | 38 -
.../tests/ToDoItemContributionsIntegTest.java | 158 ---
.../integration/tests/ToDoItemIntegTest.java | 1057 -----------------
.../integration/tests/ToDoItemsIntegTest.java | 132 ---
example/application/todoapp/pom.xml | 378 -------
.../launch/ToDoApp-PROTOTYPE-jrebel.launch | 24 -
.../ToDoApp-PROTOTYPE-with-fixtures.launch | 20 -
.../ide/eclipse/launch/ToDoApp-PROTOTYPE.launch | 23 -
.../ide/eclipse/launch/ToDoApp-SERVER.launch | 23 -
.../webapp/ide/intellij/launch/README.txt | 3 -
.../ide/intellij/launch/TodoApp_PROTOTYPE.xml | 29 -
.../intellij/launch/TodoApp__enhance_only_.xml | 23 -
.../application/todoapp/webapp/lib/.gitignore | 5 -
example/application/todoapp/webapp/pom.xml | 352 ------
.../main/java/webapp/CustomMementoService.java | 61 -
.../webapp/CustomRepresentationService.java | 32 -
.../src/main/java/webapp/ToDoApplication.java | 150 ---
.../prototyping/ExternalLinksService.java | 71 --
.../prototyping/WicketDeveloperUtilities.java | 44 -
.../userprof/CustomUserProfileService.java | 43 -
.../src/main/jettyconsole/isis-banner.pdn | Bin 69658 -> 0 bytes
.../src/main/jettyconsole/isis-banner.png | Bin 30776 -> 0 bytes
.../webapp/ToDoApplication_en.properties | 52 -
.../webapp/src/main/resources/webapp/realm1.ini | 105 --
.../src/main/resources/webapp/welcome.html | 36 -
.../src/main/webapp/WEB-INF/isis.properties | 290 -----
.../src/main/webapp/WEB-INF/logging.properties | 220 ----
.../main/webapp/WEB-INF/persistor.properties | 129 ---
.../WEB-INF/persistor_datanucleus.properties | 88 --
.../webapp/src/main/webapp/WEB-INF/shiro.ini | 103 --
.../WEB-INF/viewer_restfulobjects.properties | 66 --
.../webapp/WEB-INF/viewer_wicket.properties | 87 --
.../webapp/src/main/webapp/WEB-INF/web.xml | 308 -----
.../src/main/webapp/about/images/isis-logo.png | Bin 14160 -> 0 bytes
.../webapp/src/main/webapp/about/index.html | 175 ---
.../webapp/src/main/webapp/css/application.css | 35 -
.../main/webapp/images/todoapp-logo-header.pdn | Bin 17124 -> 0 bytes
.../main/webapp/images/todoapp-logo-header.png | Bin 5560 -> 0 bytes
.../main/webapp/images/todoapp-logo-signin.pdn | Bin 35612 -> 0 bytes
.../main/webapp/images/todoapp-logo-signin.png | Bin 15079 -> 0 bytes
.../src/main/webapp/images/todoapp-logo.pdn | Bin 138427 -> 0 bytes
.../src/main/webapp/scripts/application.js | 3 -
example/archetype/todoapp/pom.xml | 50 -
.../appended-resources/supplemental-models.xml | 26 -
.../META-INF/maven/archetype-metadata.xml | 167 ---
.../archetype-resources/.gitattributes | 51 -
.../resources/archetype-resources/.gitignore | 40 -
.../archetype-resources/dom/log4j.properties | 44 -
.../resources/archetype-resources/dom/pom.xml | 162 ---
.../dom/src/main/java/META-INF/persistence.xml | 29 -
.../dom/src/main/java/app/ToDoAppDashboard.java | 86 --
.../main/java/app/ToDoAppDashboard.layout.json | 26 -
.../dom/src/main/java/app/ToDoAppDashboard.png | Bin 834 -> 0 bytes
.../main/java/app/ToDoAppDashboardService.java | 35 -
.../dom/src/main/java/app/ToDoItemAnalysis.java | 129 ---
.../java/app/ToDoItemAnalysisContributions.java | 53 -
.../java/app/ToDoItemsByCategoryViewModel.java | 171 ---
.../ToDoItemsByCategoryViewModel.layout.json | 43 -
.../java/app/ToDoItemsByCategoryViewModel.png | Bin 684 -> 0 bytes
.../java/app/ToDoItemsByDateRangeViewModel.java | 140 ---
.../ToDoItemsByDateRangeViewModel.layout.json | 33 -
.../java/app/ToDoItemsByDateRangeViewModel.png | Bin 613 -> 0 bytes
.../dom/src/main/java/dom/todo/Categorized.java | 35 -
.../src/main/java/dom/todo/ToDoItem-done.png | Bin 1363 -> 0 bytes
.../src/main/java/dom/todo/ToDoItem-todo.png | Bin 971 -> 0 bytes
.../dom/src/main/java/dom/todo/ToDoItem.java | 982 ----------------
.../src/main/java/dom/todo/ToDoItem.layout.json | 222 ----
.../dom/src/main/java/dom/todo/ToDoItem.png | Bin 971 -> 0 bytes
.../dom/todo/ToDoItemChangedPayloadFactory.java | 51 -
.../java/dom/todo/ToDoItemContributions.java | 274 -----
.../java/dom/todo/ToDoItemSubscriptions.java | 402 -------
.../dom/src/main/java/dom/todo/ToDoItems.java | 260 -----
.../src/test/java/dom/todo/ToDoItemTest.java | 136 ---
.../archetype-resources/fixture/pom.xml | 38 -
.../fixture/todo/ToDoItemsFixturesService.java | 100 --
.../integtests/ToDoItemsIntegTestFixture.java | 43 -
.../complete/ToDoItemCompleteAbstract.java | 55 -
.../complete/ToDoItemCompleteForBuyStamps.java | 33 -
.../ToDoItemCompleteForWriteBlogPost.java | 34 -
.../todo/items/create/ToDoItemAbstract.java | 72 --
.../todo/items/create/ToDoItemForBuyBread.java | 40 -
.../todo/items/create/ToDoItemForBuyMilk.java | 40 -
.../todo/items/create/ToDoItemForBuyStamps.java | 42 -
.../todo/items/create/ToDoItemForMowLawn.java | 40 -
.../create/ToDoItemForOrganizeBrownBag.java | 40 -
.../items/create/ToDoItemForPickUpLaundry.java | 40 -
.../items/create/ToDoItemForSharpenKnives.java | 40 -
.../create/ToDoItemForStageIsisRelease.java | 40 -
.../ToDoItemForSubmitConferenceSession.java | 40 -
.../items/create/ToDoItemForVacuumHouse.java | 40 -
.../items/create/ToDoItemForWriteBlogPost.java | 42 -
.../items/create/ToDoItemForWriteToPenPal.java | 40 -
.../todo/items/delete/ToDoItemsDelete.java | 41 -
.../todo/scenarios/ToDoItemsRecreate.java | 84 --
.../ToDoItemsRecreateAndCompleteSeveral.java | 89 --
...oItemsRecreateAndCompleteSeveralForDick.java | 31 -
...DoItemsRecreateAndCompleteSeveralForJoe.java | 31 -
.../scenarios/ToDoItemsRecreateForSven.java | 32 -
.../src/main/java/fixture/todo/util/Util.java | 35 -
.../integtests/logging.properties | 104 --
.../archetype-resources/integtests/pom.xml | 122 --
.../integration/ToDoAppSystemInitializer.java | 80 --
.../integration/glue/BootstrappingGlue.java | 56 -
.../integration/glue/CatalogOfFixturesGlue.java | 50 -
.../integration/glue/InMemoryDBForToDoApp.java | 43 -
.../integration/glue/todoitem/ToDoItemGlue.java | 168 ---
.../integration/specs/todoitem/RunSpecs.java | 41 -
.../ToDoItemSpec_findAndComplete.feature | 39 -
...findCompletedAndMarkAsNotYetComplete.feature | 35 -
.../tests/AbstractToDoIntegTest.java | 41 -
.../tests/ToDoItemContributionsIntegTest.java | 161 ---
.../integration/tests/ToDoItemIntegTest.java | 1060 ------------------
.../integration/tests/ToDoItemsIntegTest.java | 135 ---
.../main/resources/archetype-resources/pom.xml | 365 ------
.../launch/ToDoApp-PROTOTYPE-jrebel.launch | 26 -
.../ToDoApp-PROTOTYPE-with-fixtures.launch | 22 -
.../ide/eclipse/launch/ToDoApp-PROTOTYPE.launch | 25 -
.../ide/eclipse/launch/ToDoApp-SERVER.launch | 25 -
.../webapp/ide/intellij/launch/README.txt | 6 -
.../ide/intellij/launch/TodoApp_PROTOTYPE.xml | 32 -
.../intellij/launch/TodoApp__enhance_only_.xml | 26 -
.../archetype-resources/webapp/lib/.gitignore | 5 -
.../archetype-resources/webapp/pom.xml | 346 ------
.../main/java/webapp/CustomMementoService.java | 64 --
.../webapp/CustomRepresentationService.java | 35 -
.../src/main/java/webapp/ToDoApplication.java | 153 ---
.../prototyping/ExternalLinksService.java | 74 --
.../prototyping/WicketDeveloperUtilities.java | 47 -
.../userprof/CustomUserProfileService.java | 46 -
.../src/main/jettyconsole/isis-banner.pdn | Bin 69658 -> 0 bytes
.../src/main/jettyconsole/isis-banner.png | Bin 30776 -> 0 bytes
.../webapp/ToDoApplication_en.properties | 55 -
.../webapp/src/main/resources/webapp/realm1.ini | 105 --
.../src/main/resources/webapp/welcome.html | 39 -
.../src/main/webapp/WEB-INF/isis.properties | 280 -----
.../src/main/webapp/WEB-INF/logging.properties | 223 ----
.../main/webapp/WEB-INF/persistor.properties | 132 ---
.../WEB-INF/persistor_datanucleus.properties | 91 --
.../webapp/src/main/webapp/WEB-INF/shiro.ini | 103 --
.../WEB-INF/viewer_restfulobjects.properties | 69 --
.../webapp/WEB-INF/viewer_wicket.properties | 90 --
.../webapp/src/main/webapp/WEB-INF/web.xml | 311 -----
.../src/main/webapp/about/images/isis-logo.png | Bin 14160 -> 0 bytes
.../webapp/src/main/webapp/about/index.html | 178 ---
.../webapp/src/main/webapp/css/application.css | 35 -
.../main/webapp/images/todoapp-logo-header.pdn | Bin 17124 -> 0 bytes
.../main/webapp/images/todoapp-logo-header.png | Bin 5560 -> 0 bytes
.../main/webapp/images/todoapp-logo-signin.pdn | Bin 35612 -> 0 bytes
.../main/webapp/images/todoapp-logo-signin.png | Bin 15079 -> 0 bytes
.../src/main/webapp/images/todoapp-logo.pdn | Bin 138427 -> 0 bytes
.../src/main/webapp/scripts/application.js | 3 -
.../projects/basic/archetype.properties | 5 -
.../src/test/resources/projects/basic/goal.txt | 0
.../example/application/todoapp/.gitattributes | 51 +
.../example/application/todoapp/.gitignore | 40 +
.../application/todoapp/dom/log4j.properties | 41 +
.../example/application/todoapp/dom/pom.xml | 172 +++
.../dom/src/main/java/META-INF/persistence.xml | 26 +
.../dom/src/main/java/app/ToDoAppDashboard.java | 69 ++
.../main/java/app/ToDoAppDashboard.layout.json | 26 +
.../dom/src/main/java/app/ToDoAppDashboard.png | Bin 0 -> 834 bytes
.../main/java/app/ToDoAppDashboardService.java | 44 +
.../dom/src/main/java/app/ToDoItemAnalysis.java | 126 +++
.../java/app/ToDoItemAnalysisContributions.java | 50 +
.../java/app/ToDoItemsByCategoryViewModel.java | 168 +++
.../ToDoItemsByCategoryViewModel.layout.json | 43 +
.../java/app/ToDoItemsByCategoryViewModel.png | Bin 0 -> 684 bytes
.../java/app/ToDoItemsByDateRangeViewModel.java | 137 +++
.../ToDoItemsByDateRangeViewModel.layout.json | 33 +
.../java/app/ToDoItemsByDateRangeViewModel.png | Bin 0 -> 613 bytes
.../dom/src/main/java/dom/todo/Categorized.java | 32 +
.../src/main/java/dom/todo/ToDoItem-done.png | Bin 0 -> 1363 bytes
.../src/main/java/dom/todo/ToDoItem-todo.png | Bin 0 -> 971 bytes
.../dom/src/main/java/dom/todo/ToDoItem.java | 979 ++++++++++++++++
.../src/main/java/dom/todo/ToDoItem.layout.json | 222 ++++
.../dom/src/main/java/dom/todo/ToDoItem.png | Bin 0 -> 971 bytes
.../dom/todo/ToDoItemChangedPayloadFactory.java | 48 +
.../java/dom/todo/ToDoItemContributions.java | 276 +++++
.../java/dom/todo/ToDoItemSubscriptions.java | 399 +++++++
.../dom/src/main/java/dom/todo/ToDoItems.java | 257 +++++
.../src/test/java/dom/todo/ToDoItemTest.java | 133 +++
.../example/application/todoapp/fixture/pom.xml | 40 +
.../fixture/todo/ToDoItemsFixturesService.java | 97 ++
.../integtests/ToDoItemsIntegTestFixture.java | 40 +
.../complete/ToDoItemCompleteAbstract.java | 52 +
.../complete/ToDoItemCompleteForBuyStamps.java | 30 +
.../ToDoItemCompleteForWriteBlogPost.java | 31 +
.../todo/items/create/ToDoItemAbstract.java | 69 ++
.../todo/items/create/ToDoItemForBuyBread.java | 37 +
.../todo/items/create/ToDoItemForBuyMilk.java | 37 +
.../todo/items/create/ToDoItemForBuyStamps.java | 39 +
.../todo/items/create/ToDoItemForMowLawn.java | 37 +
.../create/ToDoItemForOrganizeBrownBag.java | 37 +
.../items/create/ToDoItemForPickUpLaundry.java | 37 +
.../items/create/ToDoItemForSharpenKnives.java | 37 +
.../create/ToDoItemForStageIsisRelease.java | 37 +
.../ToDoItemForSubmitConferenceSession.java | 37 +
.../items/create/ToDoItemForVacuumHouse.java | 37 +
.../items/create/ToDoItemForWriteBlogPost.java | 39 +
.../items/create/ToDoItemForWriteToPenPal.java | 37 +
.../todo/items/delete/ToDoItemsDelete.java | 38 +
.../todo/scenarios/ToDoItemsRecreate.java | 81 ++
.../ToDoItemsRecreateAndCompleteSeveral.java | 86 ++
...oItemsRecreateAndCompleteSeveralForDick.java | 28 +
...DoItemsRecreateAndCompleteSeveralForJoe.java | 28 +
.../scenarios/ToDoItemsRecreateForSven.java | 29 +
.../src/main/java/fixture/todo/util/Util.java | 32 +
.../todoapp/integtests/logging.properties | 101 ++
.../application/todoapp/integtests/pom.xml | 159 +++
.../integration/ToDoAppSystemInitializer.java | 77 ++
.../integration/glue/BootstrappingGlue.java | 53 +
.../integration/glue/CatalogOfFixturesGlue.java | 47 +
.../integration/glue/InMemoryDBForToDoApp.java | 40 +
.../integration/glue/todoitem/ToDoItemGlue.java | 165 +++
.../integration/specs/todoitem/RunSpecs.java | 38 +
.../ToDoItemSpec_findAndComplete.feature | 39 +
...findCompletedAndMarkAsNotYetComplete.feature | 35 +
.../tests/AbstractToDoIntegTest.java | 38 +
.../tests/ToDoItemContributionsIntegTest.java | 158 +++
.../integration/tests/ToDoItemIntegTest.java | 1057 +++++++++++++++++
.../integration/tests/ToDoItemsIntegTest.java | 132 +++
mothballed/example/application/todoapp/pom.xml | 378 +++++++
.../launch/ToDoApp-PROTOTYPE-jrebel.launch | 24 +
.../ToDoApp-PROTOTYPE-with-fixtures.launch | 20 +
.../ide/eclipse/launch/ToDoApp-PROTOTYPE.launch | 23 +
.../ide/eclipse/launch/ToDoApp-SERVER.launch | 23 +
.../webapp/ide/intellij/launch/README.txt | 3 +
.../ide/intellij/launch/TodoApp_PROTOTYPE.xml | 29 +
.../intellij/launch/TodoApp__enhance_only_.xml | 23 +
.../application/todoapp/webapp/lib/.gitignore | 5 +
.../example/application/todoapp/webapp/pom.xml | 352 ++++++
.../main/java/webapp/CustomMementoService.java | 61 +
.../webapp/CustomRepresentationService.java | 32 +
.../src/main/java/webapp/ToDoApplication.java | 150 +++
.../prototyping/ExternalLinksService.java | 71 ++
.../prototyping/WicketDeveloperUtilities.java | 44 +
.../userprof/CustomUserProfileService.java | 43 +
.../src/main/jettyconsole/isis-banner.pdn | Bin 0 -> 69658 bytes
.../src/main/jettyconsole/isis-banner.png | Bin 0 -> 30776 bytes
.../webapp/ToDoApplication_en.properties | 52 +
.../webapp/src/main/resources/webapp/realm1.ini | 105 ++
.../src/main/resources/webapp/welcome.html | 36 +
.../src/main/webapp/WEB-INF/isis.properties | 290 +++++
.../src/main/webapp/WEB-INF/logging.properties | 220 ++++
.../main/webapp/WEB-INF/persistor.properties | 129 +++
.../WEB-INF/persistor_datanucleus.properties | 88 ++
.../webapp/src/main/webapp/WEB-INF/shiro.ini | 103 ++
.../WEB-INF/viewer_restfulobjects.properties | 66 ++
.../webapp/WEB-INF/viewer_wicket.properties | 87 ++
.../webapp/src/main/webapp/WEB-INF/web.xml | 308 +++++
.../src/main/webapp/about/images/isis-logo.png | Bin 0 -> 14160 bytes
.../webapp/src/main/webapp/about/index.html | 175 +++
.../webapp/src/main/webapp/css/application.css | 35 +
.../main/webapp/images/todoapp-logo-header.pdn | Bin 0 -> 17124 bytes
.../main/webapp/images/todoapp-logo-header.png | Bin 0 -> 5560 bytes
.../main/webapp/images/todoapp-logo-signin.pdn | Bin 0 -> 35612 bytes
.../main/webapp/images/todoapp-logo-signin.png | Bin 0 -> 15079 bytes
.../src/main/webapp/images/todoapp-logo.pdn | Bin 0 -> 138427 bytes
.../src/main/webapp/scripts/application.js | 3 +
mothballed/example/archetype/todoapp/pom.xml | 50 +
.../appended-resources/supplemental-models.xml | 26 +
.../META-INF/maven/archetype-metadata.xml | 167 +++
.../archetype-resources/.gitattributes | 51 +
.../resources/archetype-resources/.gitignore | 40 +
.../archetype-resources/dom/log4j.properties | 44 +
.../resources/archetype-resources/dom/pom.xml | 162 +++
.../dom/src/main/java/META-INF/persistence.xml | 29 +
.../dom/src/main/java/app/ToDoAppDashboard.java | 86 ++
.../main/java/app/ToDoAppDashboard.layout.json | 26 +
.../dom/src/main/java/app/ToDoAppDashboard.png | Bin 0 -> 834 bytes
.../main/java/app/ToDoAppDashboardService.java | 35 +
.../dom/src/main/java/app/ToDoItemAnalysis.java | 129 +++
.../java/app/ToDoItemAnalysisContributions.java | 53 +
.../java/app/ToDoItemsByCategoryViewModel.java | 171 +++
.../ToDoItemsByCategoryViewModel.layout.json | 43 +
.../java/app/ToDoItemsByCategoryViewModel.png | Bin 0 -> 684 bytes
.../java/app/ToDoItemsByDateRangeViewModel.java | 140 +++
.../ToDoItemsByDateRangeViewModel.layout.json | 33 +
.../java/app/ToDoItemsByDateRangeViewModel.png | Bin 0 -> 613 bytes
.../dom/src/main/java/dom/todo/Categorized.java | 35 +
.../src/main/java/dom/todo/ToDoItem-done.png | Bin 0 -> 1363 bytes
.../src/main/java/dom/todo/ToDoItem-todo.png | Bin 0 -> 971 bytes
.../dom/src/main/java/dom/todo/ToDoItem.java | 982 ++++++++++++++++
.../src/main/java/dom/todo/ToDoItem.layout.json | 222 ++++
.../dom/src/main/java/dom/todo/ToDoItem.png | Bin 0 -> 971 bytes
.../dom/todo/ToDoItemChangedPayloadFactory.java | 51 +
.../java/dom/todo/ToDoItemContributions.java | 274 +++++
.../java/dom/todo/ToDoItemSubscriptions.java | 402 +++++++
.../dom/src/main/java/dom/todo/ToDoItems.java | 260 +++++
.../src/test/java/dom/todo/ToDoItemTest.java | 136 +++
.../archetype-resources/fixture/pom.xml | 38 +
.../fixture/todo/ToDoItemsFixturesService.java | 100 ++
.../integtests/ToDoItemsIntegTestFixture.java | 43 +
.../complete/ToDoItemCompleteAbstract.java | 55 +
.../complete/ToDoItemCompleteForBuyStamps.java | 33 +
.../ToDoItemCompleteForWriteBlogPost.java | 34 +
.../todo/items/create/ToDoItemAbstract.java | 72 ++
.../todo/items/create/ToDoItemForBuyBread.java | 40 +
.../todo/items/create/ToDoItemForBuyMilk.java | 40 +
.../todo/items/create/ToDoItemForBuyStamps.java | 42 +
.../todo/items/create/ToDoItemForMowLawn.java | 40 +
.../create/ToDoItemForOrganizeBrownBag.java | 40 +
.../items/create/ToDoItemForPickUpLaundry.java | 40 +
.../items/create/ToDoItemForSharpenKnives.java | 40 +
.../create/ToDoItemForStageIsisRelease.java | 40 +
.../ToDoItemForSubmitConferenceSession.java | 40 +
.../items/create/ToDoItemForVacuumHouse.java | 40 +
.../items/create/ToDoItemForWriteBlogPost.java | 42 +
.../items/create/ToDoItemForWriteToPenPal.java | 40 +
.../todo/items/delete/ToDoItemsDelete.java | 41 +
.../todo/scenarios/ToDoItemsRecreate.java | 84 ++
.../ToDoItemsRecreateAndCompleteSeveral.java | 89 ++
...oItemsRecreateAndCompleteSeveralForDick.java | 31 +
...DoItemsRecreateAndCompleteSeveralForJoe.java | 31 +
.../scenarios/ToDoItemsRecreateForSven.java | 32 +
.../src/main/java/fixture/todo/util/Util.java | 35 +
.../integtests/logging.properties | 104 ++
.../archetype-resources/integtests/pom.xml | 122 ++
.../integration/ToDoAppSystemInitializer.java | 80 ++
.../integration/glue/BootstrappingGlue.java | 56 +
.../integration/glue/CatalogOfFixturesGlue.java | 50 +
.../integration/glue/InMemoryDBForToDoApp.java | 43 +
.../integration/glue/todoitem/ToDoItemGlue.java | 168 +++
.../integration/specs/todoitem/RunSpecs.java | 41 +
.../ToDoItemSpec_findAndComplete.feature | 39 +
...findCompletedAndMarkAsNotYetComplete.feature | 35 +
.../tests/AbstractToDoIntegTest.java | 41 +
.../tests/ToDoItemContributionsIntegTest.java | 161 +++
.../integration/tests/ToDoItemIntegTest.java | 1060 ++++++++++++++++++
.../integration/tests/ToDoItemsIntegTest.java | 135 +++
.../main/resources/archetype-resources/pom.xml | 365 ++++++
.../launch/ToDoApp-PROTOTYPE-jrebel.launch | 26 +
.../ToDoApp-PROTOTYPE-with-fixtures.launch | 22 +
.../ide/eclipse/launch/ToDoApp-PROTOTYPE.launch | 25 +
.../ide/eclipse/launch/ToDoApp-SERVER.launch | 25 +
.../webapp/ide/intellij/launch/README.txt | 6 +
.../ide/intellij/launch/TodoApp_PROTOTYPE.xml | 32 +
.../intellij/launch/TodoApp__enhance_only_.xml | 26 +
.../archetype-resources/webapp/lib/.gitignore | 5 +
.../archetype-resources/webapp/pom.xml | 346 ++++++
.../main/java/webapp/CustomMementoService.java | 64 ++
.../webapp/CustomRepresentationService.java | 35 +
.../src/main/java/webapp/ToDoApplication.java | 153 +++
.../prototyping/ExternalLinksService.java | 74 ++
.../prototyping/WicketDeveloperUtilities.java | 47 +
.../userprof/CustomUserProfileService.java | 46 +
.../src/main/jettyconsole/isis-banner.pdn | Bin 0 -> 69658 bytes
.../src/main/jettyconsole/isis-banner.png | Bin 0 -> 30776 bytes
.../webapp/ToDoApplication_en.properties | 55 +
.../webapp/src/main/resources/webapp/realm1.ini | 105 ++
.../src/main/resources/webapp/welcome.html | 39 +
.../src/main/webapp/WEB-INF/isis.properties | 280 +++++
.../src/main/webapp/WEB-INF/logging.properties | 223 ++++
.../main/webapp/WEB-INF/persistor.properties | 132 +++
.../WEB-INF/persistor_datanucleus.properties | 91 ++
.../webapp/src/main/webapp/WEB-INF/shiro.ini | 103 ++
.../WEB-INF/viewer_restfulobjects.properties | 69 ++
.../webapp/WEB-INF/viewer_wicket.properties | 90 ++
.../webapp/src/main/webapp/WEB-INF/web.xml | 311 +++++
.../src/main/webapp/about/images/isis-logo.png | Bin 0 -> 14160 bytes
.../webapp/src/main/webapp/about/index.html | 178 +++
.../webapp/src/main/webapp/css/application.css | 35 +
.../main/webapp/images/todoapp-logo-header.pdn | Bin 0 -> 17124 bytes
.../main/webapp/images/todoapp-logo-header.png | Bin 0 -> 5560 bytes
.../main/webapp/images/todoapp-logo-signin.pdn | Bin 0 -> 35612 bytes
.../main/webapp/images/todoapp-logo-signin.png | Bin 0 -> 15079 bytes
.../src/main/webapp/images/todoapp-logo.pdn | Bin 0 -> 138427 bytes
.../src/main/webapp/scripts/application.js | 3 +
.../projects/basic/archetype.properties | 5 +
.../src/test/resources/projects/basic/goal.txt | 0
pom.xml | 7 -
435 files changed, 19618 insertions(+), 19625 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/.gitattributes
----------------------------------------------------------------------
diff --git a/example/application/todoapp/.gitattributes b/example/application/todoapp/.gitattributes
deleted file mode 100644
index b1eafb6..0000000
--- a/example/application/todoapp/.gitattributes
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-#
-# 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
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/.gitignore
----------------------------------------------------------------------
diff --git a/example/application/todoapp/.gitignore b/example/application/todoapp/.gitignore
deleted file mode 100644
index ad3f5e2..0000000
--- a/example/application/todoapp/.gitignore
+++ /dev/null
@@ -1,40 +0,0 @@
-*~
-*.swp
-*.class
-bin/
-target/
-target-ide/
-logs/
-.settings/
-.project
-.classpath
-.idea
-*.iml
-
-JArchitectOut/
-*.jdproj
-
-neo4j_DB/
-
-# log files
-datanucleus.log
-isis.log
-hs_err_pid*.log
-
-# Package Files #
-*.jar
-*.war
-*.ear
-
-dependency-reduced-pom.xml
-pom.xml.tag
-pom.xml.next
-pom.xml.releaseBackup
-pom.xml.versionsBackup
-
-.clover/
-*.jdproj
-JArchitectOut/
-
-
-rebel.xml
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/log4j.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/log4j.properties b/example/application/todoapp/dom/log4j.properties
deleted file mode 100644
index ca165ac..0000000
--- a/example/application/todoapp/dom/log4j.properties
+++ /dev/null
@@ -1,41 +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.
-
-# 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
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/pom.xml b/example/application/todoapp/dom/pom.xml
deleted file mode 100644
index 09f46d9..0000000
--- a/example/application/todoapp/dom/pom.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-<?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.example.application</groupId>
- <artifactId>todoapp</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>todoapp-dom</artifactId>
- <name>ToDo App DOM</name>
-
- <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>
- <plugins>
- <plugin>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-maven-plugin</artifactId>
- <version>${datanucleus-maven-plugin.version}</version>
- <configuration>
- <fork>false</fork>
- <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
- <verbose>true</verbose>
- <props>${basedir}/datanucleus.properties</props>
- </configuration>
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>enhance</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.datanucleus
- </groupId>
- <artifactId>
- datanucleus-maven-plugin
- </artifactId>
- <versionRange>
- [3.2.0-release,)
- </versionRange>
- <goals>
- <goal>enhance</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-applib</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-unittestsupport</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- Bytecode libraries (for mocking) -->
- <dependency>
- <groupId>org.objenesis</groupId>
- <artifactId>objenesis</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>isis-validate</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.isis.tool</groupId>
- <artifactId>isis-maven-plugin</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <configuration>
- <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.apache.isis.example.application</groupId>
- <artifactId>todoapp-dom</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </dependency>
- <!--
- ... workaround to avoid conflict with plexus-default
- (not sure why exclusions in the isis-maven-plugin aren't sufficient, though ...
- -->
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>16.0.1</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <phase>test</phase>
- <goals>
- <goal>validate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/META-INF/persistence.xml b/example/application/todoapp/dom/src/main/java/META-INF/persistence.xml
deleted file mode 100644
index 9b38012..0000000
--- a/example/application/todoapp/dom/src/main/java/META-INF/persistence.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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="quickstart">
- </persistence-unit>
-</persistence>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.java b/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.java
deleted file mode 100644
index e3a3723..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.java
+++ /dev/null
@@ -1,69 +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 app;
-
-import java.util.List;
-import org.apache.isis.applib.annotation.Collection;
-import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.Editing;
-import org.apache.isis.applib.annotation.Nature;
-import org.apache.isis.applib.annotation.RenderType;
-
-@DomainObject(nature = Nature.VIEW_MODEL)
-public class ToDoAppDashboard {
-
- //region > identification in the UI
- public String title() {
- return "Dashboard";
- }
- //endregion
-
- //region > getAnalysisByCategory (collection)
- @CollectionLayout(
- named="By Category",
- render = RenderType.EAGERLY
- )
- @Collection(
- editing = Editing.DISABLED
- )
- public List<ToDoItemsByCategoryViewModel> getAnalysisByCategory() {
- return toDoItemAnalysis.toDoItemsByCategory();
- }
- //endregion
-
- //region > getAnalysisByDateRange (collection)
- @CollectionLayout(
- named="By Date Range",
- render = RenderType.EAGERLY
- )
- @Collection(
- editing = Editing.DISABLED
- )
- public List<ToDoItemsByDateRangeViewModel> getAnalysisByDateRange() {
- return toDoItemAnalysis.toDoItemsByDateRange();
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItemAnalysis toDoItemAnalysis;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json b/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json
deleted file mode 100644
index 3421543..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "columns": [
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 12,
- "collections": {
- "analysisByCategory": {}
- }
- }
- ],
- "actions": {
- "downloadLayout": {},
- "refreshLayout": {}
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png b/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png
deleted file mode 100644
index fe6e6a1..0000000
Binary files a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java b/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java
deleted file mode 100644
index 3bc371c..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java
+++ /dev/null
@@ -1,44 +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 app;
-
-import javax.inject.Inject;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.HomePage;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService(nature = NatureOfService.DOMAIN)
-public class ToDoAppDashboardService {
-
- @Action(
- semantics = SemanticsOf.SAFE
- //hidden = Where.EVERYWHERE
- )
- @HomePage
- public ToDoAppDashboard lookup() {
- return container.injectServicesInto(new ToDoAppDashboard());
- }
-
- @Inject
- private DomainObjectContainer container;
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java b/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java
deleted file mode 100644
index 4c7d157..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java
+++ /dev/null
@@ -1,126 +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 app;
-
-import dom.todo.ToDoItem.Category;
-
-import java.util.Arrays;
-import java.util.List;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainServiceLayout(
- named="Analysis",
- menuOrder = "20")
-@DomainService
-public class ToDoItemAnalysis {
-
-
- //region > identification in the UI
- public String getId() {
- return "analysis";
- }
-
- public String iconName() {
- return "ToDoItem";
- }
- //endregion
-
-
- //region > byCategory (action)
- @ActionLayout(
- cssClassFa="fa fa-pie-chart",
- named="By Category",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @Action(semantics = SemanticsOf.SAFE)
- @MemberOrder(sequence = "1")
- public List<ToDoItemsByCategoryViewModel> toDoItemsByCategory() {
- final List<Category> categories = Arrays.asList(Category.values());
- return Lists.newArrayList(Iterables.transform(categories, byCategory()));
- }
-
- private Function<Category, ToDoItemsByCategoryViewModel> byCategory() {
- return new Function<Category, ToDoItemsByCategoryViewModel>(){
- @Override
- public ToDoItemsByCategoryViewModel apply(final Category category) {
- return new ToDoItemsByCategoryViewModel(category);
- }
- };
- }
- //endregion
-
- //region > byDateRange (action)
-
- public enum DateRange {
- OverDue,
- Today,
- Tomorrow,
- ThisWeek,
- Later,
- Unknown,
- }
-
- @ActionLayout(
- cssClassFa="fa fa-calendar",
- named="By Date Range",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @Action(semantics = SemanticsOf.SAFE)
- @MemberOrder(sequence = "1")
- public List<ToDoItemsByDateRangeViewModel> toDoItemsByDateRange() {
- final List<DateRange> dateRanges = Arrays.asList(DateRange.values());
- return Lists.newArrayList(Iterables.transform(dateRanges, byDateRange()));
- }
-
- private static Function<DateRange, ToDoItemsByDateRangeViewModel> byDateRange() {
- return new Function<DateRange, ToDoItemsByDateRangeViewModel>(){
- @Override
- public ToDoItemsByDateRangeViewModel apply(final DateRange dateRange) {
- return new ToDoItemsByDateRangeViewModel(dateRange);
- }
- };
- }
- //endregion
-
- //region > forCategory (programmatic)
- @Programmatic
- public ToDoItemsByCategoryViewModel toDoItemsForCategory(final Category category) {
- return byCategory().apply(category);
- }
-
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java b/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java
deleted file mode 100644
index baf4b00..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java
+++ /dev/null
@@ -1,50 +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 app;
-
-import dom.todo.ToDoItem;
-
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.Contributed;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
-public class ToDoItemAnalysisContributions {
-
-
- //region > analyseCategory (action)
- @ActionLayout(contributed = Contributed.AS_ACTION)
- @Action(
- semantics = SemanticsOf.SAFE
- )
- public ToDoItemsByCategoryViewModel analyseCategory(final ToDoItem item) {
- return toDoAppAnalysis.toDoItemsForCategory(item.getCategory());
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItemAnalysis toDoAppAnalysis;
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java b/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
deleted file mode 100644
index 8ebae61..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
+++ /dev/null
@@ -1,168 +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 app;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItems;
-
-import java.util.Arrays;
-import java.util.List;
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.DomainObjectLayout;
-import org.apache.isis.applib.annotation.Nature;
-import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.util.ObjectContracts;
-
-@DomainObjectLayout(
- named="By Category",
- bookmarking = BookmarkPolicy.AS_ROOT
-)
-@DomainObject(
- nature = Nature.VIEW_MODEL
-)
-public class ToDoItemsByCategoryViewModel
- implements Comparable<ToDoItemsByCategoryViewModel> {
-
- //region > constructors
- public ToDoItemsByCategoryViewModel() {
- }
- public ToDoItemsByCategoryViewModel(final Category category) {
- setCategory(category);
- }
- //endregion
-
-
- //region > category (property)
- private Category category;
-
- @Title
- public Category getCategory() {
- return category;
- }
-
- public void setCategory(final Category category) {
- this.category = category;
- }
- //endregion
-
- //region > notYetComplete (property), complete (property)
- @PropertyLayout(
- multiLine=5
- )
- public String getNotYetComplete() {
- final List<ToDoItem> notYetComplete = getItemsNotYetComplete();
- return Joiner.on(", ").join(
- Iterables.transform(subcategories(), summarizeBySubcategory(notYetComplete)));
- }
-
- @PropertyLayout(
- multiLine=5
- )
- public String getComplete() {
- final List<ToDoItem> completeInCategory = getItemsComplete();
- return Joiner.on(", ").join(
- Iterables.transform(subcategories(), summarizeBySubcategory(completeInCategory)));
- }
-
- // //////////////////////////////////////
-
- private Iterable<ToDoItem.Subcategory> subcategories() {
- return Iterables.filter(Arrays.asList(ToDoItem.Subcategory.values()), ToDoItem.Subcategory.thoseFor(getCategory()));
- }
-
- private Function<ToDoItem.Subcategory, String> summarizeBySubcategory(final Iterable<ToDoItem> itemsInCategory) {
- return new Function<ToDoItem.Subcategory, String>() {
- @Override
- public String apply(final ToDoItem.Subcategory subcategory) {
- return subcategory + ": " + countIn(itemsInCategory, subcategory);
- }
- };
- }
-
- private static int countIn(final Iterable<ToDoItem> items, final ToDoItem.Subcategory subcategory) {
- return Iterables.size(Iterables.filter(items,
- ToDoItem.Predicates.thoseSubcategorised(subcategory)));
- }
- //endregion
-
- //region > getItemsNotYetComplete (collection), getItemsComplete (collection)
- /**
- * All those items {@link ToDoItems#notYetComplete() not yet complete}, for this {@link #getCategory() category}.
- */
- @CollectionLayout(
- render = RenderType.EAGERLY
- )
- public List<ToDoItem> getItemsNotYetComplete() {
- final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
- return Lists.newArrayList(Iterables.filter(notYetComplete, ToDoItem.Predicates.thoseCategorised(getCategory())));
- }
-
- /**
- * All those items {@link ToDoItems#complete() complete}, for this {@link #getCategory() category}.
- */
- @CollectionLayout(
- render = RenderType.EAGERLY
- )
- public List<ToDoItem> getItemsComplete() {
- final List<ToDoItem> complete = toDoItems.completeNoUi();
- return Lists.newArrayList(Iterables.filter(complete, ToDoItem.Predicates.thoseCategorised(getCategory())));
- }
-
- //endregion
-
- //region > deleteCompleted (action)
- @ActionLayout(
- named="Delete"
- )
- public ToDoItemsByCategoryViewModel deleteCompleted() {
- for (final ToDoItem item : getItemsComplete()) {
- container.removeIfNotAlready(item);
- }
- // force reload of page
- return this;
- }
-
- //endregion
-
- //region > compareTo
- @Override
- public int compareTo(final ToDoItemsByCategoryViewModel other) {
- return ObjectContracts.compare(this, other, "category");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
- @javax.inject.Inject
- private ToDoItems toDoItems;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json b/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
deleted file mode 100644
index c87b554..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "columns": [
- {
- "span": 4,
- "memberGroups": {
- "General": {
- "members": {
- "category": {}
- }
- },
- "Analysis": {
- "members": {
- "notYetComplete": {},
- "complete": {}
- }
- }
- }
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 8,
- "collections": {
- "itemsNotYetComplete": {},
- "itemsComplete": {
- "actions": {
- "deleteCompleted": {}
- }
- }
- }
- }
- ],
- "actions": {
- "downloadLayout": {},
- "refreshLayout": {}
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png b/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
deleted file mode 100644
index c22ab2b..0000000
Binary files a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java b/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
deleted file mode 100644
index baf5bac..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
+++ /dev/null
@@ -1,137 +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 app;
-
-import app.ToDoItemAnalysis.DateRange;
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-
-import java.util.List;
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.joda.time.DateTime;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.DomainObjectLayout;
-import org.apache.isis.applib.annotation.Nature;
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.services.clock.ClockService;
-import org.apache.isis.applib.util.ObjectContracts;
-
-@DomainObjectLayout(
- named="By Date Range",
- bookmarking = BookmarkPolicy.AS_ROOT
-)
-@DomainObject(
- nature = Nature.VIEW_MODEL
-)
-public class ToDoItemsByDateRangeViewModel
- implements Comparable<ToDoItemsByDateRangeViewModel> {
-
- //region > constructors
- public ToDoItemsByDateRangeViewModel() {
- }
- public ToDoItemsByDateRangeViewModel(final DateRange dateRange) {
- setDateRange(dateRange);
- }
- //endregion
-
- //region > dateRange (property)
- private DateRange dateRange;
-
- @Title
- public DateRange getDateRange() {
- return dateRange;
- }
-
- public void setDateRange(final DateRange dateRange) {
- this.dateRange = dateRange;
- }
- //endregion
-
- //region > count (derived property)
- public int getCount() {
- return getItemsNotYetComplete().size();
- }
- //endregion
-
- //region > getItemsNotYetComplete (collection)
- /**
- * All those items {@link ToDoItems#notYetComplete() not yet complete}, for this {@link #getDateRange() date range}.
- */
- @CollectionLayout(
- render = RenderType.EAGERLY
- )
- public List<ToDoItem> getItemsNotYetComplete() {
- final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
- return Lists.newArrayList(Iterables.filter(notYetComplete, thoseInDateRange()));
- }
-
- private Predicate<ToDoItem> thoseInDateRange() {
- return new Predicate<ToDoItem>() {
- @Override
- public boolean apply(final ToDoItem t) {
- return Objects.equal(dateRangeFor(t), getDateRange());
- }
- };
- }
-
- private DateRange dateRangeFor(final ToDoItem t) {
- if(t.getDueBy() == null) {
- return DateRange.Unknown;
- }
- final DateTime dueBy = t.getDueBy().toDateTimeAtStartOfDay();
- final DateTime today = clockService.now().toDateTimeAtStartOfDay();
-
- if(dueBy.isBefore(today)) {
- return DateRange.OverDue;
- }
- if(dueBy.isBefore(today.plusDays(1))) {
- return DateRange.Today;
- }
- if(dueBy.isBefore(today.plusDays(2))) {
- return DateRange.Tomorrow;
- }
- if(dueBy.isBefore(today.plusDays(7))) {
- return DateRange.ThisWeek;
- }
- return DateRange.Later;
- }
- //endregion
-
- //region > compareTo
- @Override
- public int compareTo(final ToDoItemsByDateRangeViewModel other) {
- return ObjectContracts.compare(this, other, "dateRange");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItems toDoItems;
-
- @javax.inject.Inject
- private ClockService clockService;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json b/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
deleted file mode 100644
index 648e146..0000000
--- a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "columns": [
- {
- "span": 4,
- "memberGroups": {
- "General": {
- "members": {
- "dateRange": {},
- "count": {}
- }
- }
- }
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 8,
- "collections": {
- "itemsNotYetComplete": {}
- }
- }
- ],
- "actions": {
- "downloadLayout": {},
- "refreshLayout": {}
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png b/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
deleted file mode 100644
index 034a1f9..0000000
Binary files a/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java b/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java
deleted file mode 100644
index fabbc9b..0000000
--- a/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java
+++ /dev/null
@@ -1,32 +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 dom.todo;
-
-/**
- * Enables {@link dom.todo.ToDoItemContributions#updateCategory(dom.todo.Categorized, dom.todo.ToDoItem.Category, dom.todo.ToDoItem.Subcategory)} to be contributed to
- * both the {@link dom.todo.ToDoItem} (entity) and also the {@link app.ToDoItemWizard} (wizard).
- */
-public interface Categorized {
-
- ToDoItem.Category getCategory();
- void setCategory(ToDoItem.Category category);
-
- ToDoItem.Subcategory getSubcategory();
- void setSubcategory(ToDoItem.Subcategory subcategory);
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png
deleted file mode 100644
index b0fc6e8..0000000
Binary files a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png b/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png
deleted file mode 100644
index 99a9fed..0000000
Binary files a/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png and /dev/null differ
[21/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/pom.xml b/example/application/todoapp/fixture/pom.xml
deleted file mode 100644
index 8881b6e..0000000
--- a/example/application/todoapp/fixture/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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.example.application</groupId>
- <artifactId>todoapp</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>todoapp-fixture</artifactId>
- <name>ToDo App Fixtures</name>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>todoapp-dom</artifactId>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
deleted file mode 100644
index 15bc3a9..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
+++ /dev/null
@@ -1,97 +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 fixture.todo;
-
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import java.util.List;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Optionality;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.fixturescripts.FixtureResult;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-
-/**
- * Enables fixtures to be installed from the application.
- */
-@DomainService
-@DomainServiceLayout(
- named = "Prototyping",
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- menuOrder = "10")
-public class ToDoItemsFixturesService extends FixtureScripts {
-
- public ToDoItemsFixturesService() {
- super("fixture.todo");
- }
-
- @ActionLayout(
- cssClassFa="fa fa-bolt"
- )
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @Override
- public List<FixtureResult> runFixtureScript(
- final FixtureScript fixtureScript,
- @ParameterLayout(
- named="Parameters",
- describedAs = "Script-specific parameters (key=value) ",
- multiLine = 10)
- @Parameter(optionality = Optionality.OPTIONAL)
- final String parameters) {
- return super.runFixtureScript(fixtureScript, parameters);
- }
-
- @Override
- public FixtureScript default0RunFixtureScript() {
- return findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class);
- }
-
- /**
- * Raising visibility to <tt>public</tt> so that choices are available for first param
- * of {@link #runFixtureScript(FixtureScript, String)}.
- */
- @Override
- public List<FixtureScript> choices0RunFixtureScript() {
- return super.choices0RunFixtureScript();
- }
-
- // //////////////////////////////////////
-
-
- @ActionLayout(
- cssClassFa="fa fa-list"
- )
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @MemberOrder(sequence="20")
- public Object recreateToDoItemsReturnFirst() {
- final List<FixtureResult> run = findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class).run(null);
- return run.get(0).getObject();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
deleted file mode 100644
index 2634839..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
+++ /dev/null
@@ -1,40 +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 fixture.todo.integtests;
-
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-/**
- * Refactored to reuse the newer {@link FixtureScript} API.
- */
-public class ToDoItemsIntegTestFixture extends FixtureScript {
-
- public ToDoItemsIntegTestFixture() {
- super(null, "integ-test");
- }
-
- @Override
- protected void execute(ExecutionContext executionContext) {
- executionContext.executeChild(this, new ToDoItemsRecreateAndCompleteSeveral());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
deleted file mode 100644
index 3e009fe..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
+++ /dev/null
@@ -1,52 +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 fixture.todo.items.actions.complete;
-
-import dom.todo.ToDoItem;
-
-import java.util.Collection;
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-public abstract class ToDoItemCompleteAbstract extends FixtureScript {
-
- /**
- * Looks up item from repository, and completes.
- */
- protected void complete(final String description, final ExecutionContext executionContext) {
- String ownedBy = executionContext.getParameter("ownedBy");
- final ToDoItem toDoItem = findToDoItem(description, ownedBy);
- toDoItem.setComplete(true);
- executionContext.addResult(this, toDoItem);
- }
-
- private ToDoItem findToDoItem(final String description, final String ownedBy) {
- final Collection<ToDoItem> filtered = Collections2.filter(getContainer().allInstances(ToDoItem.class), new Predicate<ToDoItem>() {
- @Override
- public boolean apply(ToDoItem input) {
- return Objects.equal(description, input.getDescription()) &&
- Objects.equal(ownedBy, input.getOwnedBy());
- }
- });
- return filtered.isEmpty()? null: filtered.iterator().next();
- }
- //endregion
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
deleted file mode 100644
index b05bf36..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
+++ /dev/null
@@ -1,30 +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 fixture.todo.items.actions.complete;
-
-import fixture.todo.items.create.ToDoItemForBuyStamps;
-
-public class ToDoItemCompleteForBuyStamps extends ToDoItemCompleteAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
- complete(ToDoItemForBuyStamps.DESCRIPTION, executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
deleted file mode 100644
index 4b620f4..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
+++ /dev/null
@@ -1,31 +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 fixture.todo.items.actions.complete;
-
-import fixture.todo.items.create.ToDoItemForWriteBlogPost;
-
-public class ToDoItemCompleteForWriteBlogPost extends ToDoItemCompleteAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
- complete(ToDoItemForWriteBlogPost.DESCRIPTION, executionContext);
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
deleted file mode 100644
index 3586c86..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
+++ /dev/null
@@ -1,69 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-import dom.todo.ToDoItems;
-
-import java.math.BigDecimal;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.services.clock.ClockService;
-
-public abstract class ToDoItemAbstract extends FixtureScript {
-
- protected ToDoItem createToDoItem(
- final String description,
- final Category category, final Subcategory subcategory,
- final LocalDate dueBy,
- final BigDecimal cost,
- final ExecutionContext executionContext) {
-
- // validate parameters
- final String ownedBy = executionContext.getParameter("ownedBy");
- if(ownedBy == null) {
- throw new IllegalArgumentException("'ownedBy' must be specified");
- }
-
- // execute
- ToDoItem newToDo = toDoItems.newToDo(
- description, category, subcategory, ownedBy, dueBy, cost);
- return executionContext.addResult(this, newToDo);
- }
-
- protected LocalDate nowPlusDays(int days) {
- return clockService.now().plusDays(days);
- }
-
- protected BigDecimal BD(String str) {
- return new BigDecimal(str);
- }
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItems toDoItems;
-
- @javax.inject.Inject
- protected ClockService clockService;
- //endregion
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
deleted file mode 100644
index 0bcde45..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForBuyBread extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Buy bread",
- Category.Domestic, Subcategory.Shopping,
- nowPlusDays(0),
- BD("1.75"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
deleted file mode 100644
index da6d25e..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForBuyMilk extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Buy milk",
- Category.Domestic, Subcategory.Shopping,
- nowPlusDays(0),
- BD("0.75"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
deleted file mode 100644
index 4c6fb70..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
+++ /dev/null
@@ -1,39 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForBuyStamps extends ToDoItemAbstract {
-
- public static final String DESCRIPTION = "Buy stamps";
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- DESCRIPTION,
- Category.Domestic, Subcategory.Shopping,
- nowPlusDays(0),
- BD("10.00"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
deleted file mode 100644
index daf4e2e..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForMowLawn extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Mow lawn",
- Category.Domestic, Subcategory.Garden,
- nowPlusDays(6),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
deleted file mode 100644
index d4c01a7..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForOrganizeBrownBag extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Organize brown bag",
- Category.Professional, Subcategory.Consulting,
- nowPlusDays(14),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
deleted file mode 100644
index 5d9a309..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForPickUpLaundry extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Pick up laundry",
- Category.Domestic, Subcategory.Chores,
- nowPlusDays(6),
- BD("7.50"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
deleted file mode 100644
index c850993..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForSharpenKnives extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Sharpen knives",
- Category.Domestic, Subcategory.Chores,
- nowPlusDays(14),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
deleted file mode 100644
index d9544ab..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForStageIsisRelease extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Stage Isis release",
- Category.Professional, Subcategory.OpenSource,
- null,
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
deleted file mode 100644
index 86e7177..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForSubmitConferenceSession extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Submit conference session",
- Category.Professional, Subcategory.Education,
- nowPlusDays(21),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
deleted file mode 100644
index 64f4ab4..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForVacuumHouse extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Vacuum house",
- Category.Domestic, Subcategory.Housework,
- nowPlusDays(3),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
deleted file mode 100644
index 8d912ad..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
+++ /dev/null
@@ -1,39 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForWriteBlogPost extends ToDoItemAbstract {
-
- public static final String DESCRIPTION = "Write blog post";
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- DESCRIPTION,
- Category.Professional, Subcategory.Marketing,
- nowPlusDays(7),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
deleted file mode 100644
index eb495a2..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
+++ /dev/null
@@ -1,37 +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 fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForWriteToPenPal extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Write to penpal",
- Category.Other, Subcategory.Other,
- null,
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
deleted file mode 100644
index 3ac08bc..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
+++ /dev/null
@@ -1,38 +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 fixture.todo.items.delete;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
-
-public class ToDoItemsDelete extends FixtureScript {
-
- //region > execute
- protected void execute(ExecutionContext executionContext) {
- final String ownedBy = executionContext.getParameter("ownedBy");
- isisJdoSupport.executeUpdate("delete from \"ToDoItem\" where \"ownedBy\" = '" + ownedBy + "'");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private IsisJdoSupport isisJdoSupport;
- //endregion
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
deleted file mode 100644
index 5e61cc2..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
+++ /dev/null
@@ -1,81 +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 fixture.todo.scenarios;
-
-import fixture.todo.items.delete.ToDoItemsDelete;
-import fixture.todo.items.create.ToDoItemForBuyBread;
-import fixture.todo.items.create.ToDoItemForBuyMilk;
-import fixture.todo.items.create.ToDoItemForBuyStamps;
-import fixture.todo.items.create.ToDoItemForMowLawn;
-import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
-import fixture.todo.items.create.ToDoItemForPickUpLaundry;
-import fixture.todo.items.create.ToDoItemForSharpenKnives;
-import fixture.todo.items.create.ToDoItemForStageIsisRelease;
-import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
-import fixture.todo.items.create.ToDoItemForVacuumHouse;
-import fixture.todo.items.create.ToDoItemForWriteBlogPost;
-import fixture.todo.items.create.ToDoItemForWriteToPenPal;
-import fixture.todo.util.Util;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-public class ToDoItemsRecreate extends FixtureScript {
-
- public ToDoItemsRecreate() {
- withDiscoverability(Discoverability.DISCOVERABLE);
- }
-
- //region > ownedBy (optional)
- private String ownedBy;
-
- public String getOwnedBy() {
- return ownedBy;
- }
-
- public void setOwnedBy(String ownedBy) {
- this.ownedBy = ownedBy;
- }
- //endregion
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- // defaults
- executionContext.setParameterIfNotPresent(
- "ownedBy",
- Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
-
- // prereqs
- executionContext.executeChild(this, new ToDoItemsDelete());
-
- // create items
- executionContext.executeChild(this, new ToDoItemForBuyMilk());
- executionContext.executeChild(this, new ToDoItemForBuyBread());
- executionContext.executeChild(this, new ToDoItemForBuyStamps());
- executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
- executionContext.executeChild(this, new ToDoItemForMowLawn());
- executionContext.executeChild(this, new ToDoItemForVacuumHouse());
- executionContext.executeChild(this, new ToDoItemForSharpenKnives());
- executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
- executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
- executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
- executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
- executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
deleted file mode 100644
index d0645a2..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
+++ /dev/null
@@ -1,86 +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 fixture.todo.scenarios;
-
-import fixture.todo.items.actions.complete.ToDoItemCompleteForBuyStamps;
-import fixture.todo.items.actions.complete.ToDoItemCompleteForWriteBlogPost;
-import fixture.todo.items.create.ToDoItemForBuyBread;
-import fixture.todo.items.create.ToDoItemForBuyMilk;
-import fixture.todo.items.create.ToDoItemForBuyStamps;
-import fixture.todo.items.create.ToDoItemForMowLawn;
-import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
-import fixture.todo.items.create.ToDoItemForPickUpLaundry;
-import fixture.todo.items.create.ToDoItemForSharpenKnives;
-import fixture.todo.items.create.ToDoItemForStageIsisRelease;
-import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
-import fixture.todo.items.create.ToDoItemForVacuumHouse;
-import fixture.todo.items.create.ToDoItemForWriteBlogPost;
-import fixture.todo.items.create.ToDoItemForWriteToPenPal;
-import fixture.todo.items.delete.ToDoItemsDelete;
-import fixture.todo.util.Util;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-public class ToDoItemsRecreateAndCompleteSeveral extends FixtureScript {
-
- public ToDoItemsRecreateAndCompleteSeveral() {
- withDiscoverability(Discoverability.DISCOVERABLE);
- }
-
- //region > ownedBy (optional)
- private String ownedBy;
-
- public String getOwnedBy() {
- return ownedBy;
- }
-
- public void setOwnedBy(String ownedBy) {
- this.ownedBy = ownedBy;
- }
- //endregion
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- // defaults
- executionContext.setParameterIfNotPresent(
- "ownedBy",
- Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
-
- executionContext.executeChild(this, new ToDoItemsDelete());
-
- // create items
- executionContext.executeChild(this, new ToDoItemForBuyMilk());
- executionContext.executeChild(this, new ToDoItemForBuyBread());
- executionContext.executeChild(this, new ToDoItemForBuyStamps());
- executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
- executionContext.executeChild(this, new ToDoItemForMowLawn());
- executionContext.executeChild(this, new ToDoItemForVacuumHouse());
- executionContext.executeChild(this, new ToDoItemForSharpenKnives());
- executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
- executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
- executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
- executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
- executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
-
- // this fixture
- executionContext.executeChild(this, new ToDoItemCompleteForBuyStamps());
- executionContext.executeChild(this, new ToDoItemCompleteForWriteBlogPost());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
deleted file mode 100644
index 60d5a10..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
+++ /dev/null
@@ -1,28 +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 fixture.todo.scenarios;
-
-public final class ToDoItemsRecreateAndCompleteSeveralForDick extends ToDoItemsRecreateAndCompleteSeveral {
-
- public ToDoItemsRecreateAndCompleteSeveralForDick() {
- withDiscoverability(Discoverability.DISCOVERABLE);
-
- setOwnedBy("dick");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
deleted file mode 100644
index b324f34..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
+++ /dev/null
@@ -1,28 +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 fixture.todo.scenarios;
-
-public final class ToDoItemsRecreateAndCompleteSeveralForJoe extends ToDoItemsRecreateAndCompleteSeveral {
-
- public ToDoItemsRecreateAndCompleteSeveralForJoe() {
- withDiscoverability(Discoverability.DISCOVERABLE);
-
- setOwnedBy("joe");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
deleted file mode 100644
index 16db8a7..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
+++ /dev/null
@@ -1,29 +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 fixture.todo.scenarios;
-
-public final class ToDoItemsRecreateForSven extends ToDoItemsRecreate {
-
- public ToDoItemsRecreateForSven() {
- withDiscoverability(Discoverability.DISCOVERABLE);
-
- setOwnedBy("sven");
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java b/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java
deleted file mode 100644
index a385588..0000000
--- a/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java
+++ /dev/null
@@ -1,32 +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 fixture.todo.util;
-
-public final class Util {
-
- private Util(){}
-
- public static String coalesce(final String... strings) {
- for (String str : strings) {
- if(str != null) { return str; }
- }
- return null;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/logging.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/logging.properties b/example/application/todoapp/integtests/logging.properties
deleted file mode 100644
index 1e4d987..0000000
--- a/example/application/todoapp/integtests/logging.properties
+++ /dev/null
@@ -1,101 +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.
-
-
-#
-# Isis uses log4j is used to provide system logging
-#
-log4j.rootCategory=INFO, Console
-
-# The console appender
-log4j.appender.Console=org.apache.log4j.ConsoleAppender
-log4j.appender.Console.target=System.out
-log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
-
-log4j.appender.File=org.apache.log4j.RollingFileAppender
-log4j.appender.File.file=isis.log
-log4j.appender.File.append=false
-log4j.appender.File.layout=org.apache.log4j.PatternLayout
-log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
-
-! turn on the internal log4j debugging flag so we can see what it is doing
-#log4j.debug=true
-
-# DataNucleus
-# the first two log the DML and DDL (if set to DEBUG)
-log4j.logger.DataNucleus.Datastore.Native=WARN, Console
-log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
-# the remainder can probably be left to WARN
-log4j.logger.DataNucleus.Persistence=WARN, Console
-log4j.logger.DataNucleus.Transaction=WARN, Console
-log4j.logger.DataNucleus.Connection=WARN, Console
-log4j.logger.DataNucleus.Query=WARN, Console
-log4j.logger.DataNucleus.Cache=WARN, Console
-log4j.logger.DataNucleus.MetaData=WARN, Console
-log4j.logger.DataNucleus.Datastore=WARN, Console
-log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
-log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
-log4j.logger.DataNucleus.General=WARN, Console
-log4j.logger.DataNucleus.Lifecycle=WARN, Console
-log4j.logger.DataNucleus.ValueGeneration=WARN, Console
-log4j.logger.DataNucleus.Enhancer=WARN, Console
-log4j.logger.DataNucleus.SchemaTool=ERROR, Console
-log4j.logger.DataNucleus.JDO=WARN, Console
-log4j.logger.DataNucleus.JPA=ERROR, Console
-log4j.logger.DataNucleus.JCA=WARN, Console
-log4j.logger.DataNucleus.IDE=ERROR, Console
-
-log4j.additivity.DataNucleus.Datastore.Native=false
-log4j.additivity.DataNucleus.Datastore.Schema=false
-log4j.additivity.DataNucleus.Datastore.Persistence=false
-log4j.additivity.DataNucleus.Datastore.Transaction=false
-log4j.additivity.DataNucleus.Datastore.Connection=false
-log4j.additivity.DataNucleus.Datastore.Query=false
-log4j.additivity.DataNucleus.Datastore.Cache=false
-log4j.additivity.DataNucleus.Datastore.MetaData=false
-log4j.additivity.DataNucleus.Datastore.Datastore=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
-log4j.additivity.DataNucleus.Datastore.General=false
-log4j.additivity.DataNucleus.Datastore.Lifecycle=false
-log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
-log4j.additivity.DataNucleus.Datastore.Enhancer=false
-log4j.additivity.DataNucleus.Datastore.SchemaTool=false
-log4j.additivity.DataNucleus.Datastore.JDO=false
-log4j.additivity.DataNucleus.Datastore.JPA=false
-log4j.additivity.DataNucleus.Datastore.JCA=false
-log4j.additivity.DataNucleus.Datastore.IDE=false
-
-
-
-
-# if using log4jdbc-remix as JDBC driver
-#log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
-#log4j.additivity.jdbc.sqlonly=false
-#log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
-#log4j.additivity.jdbc.resultsettable=false
-
-#log4j.logger.jdbc.audit=WARN,jdbc, Console
-#log4j.additivity.jdbc.audit=false
-#log4j.logger.jdbc.resultset=WARN,jdbc
-#log4j.additivity.jdbc.resultset=false
-#log4j.logger.jdbc.sqltiming=WARN,sqltiming
-#log4j.additivity.jdbc.sqltiming=false
-#log4j.logger.jdbc.connection=FATAL,connection
-#log4j.additivity.jdbc.connection=false
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/pom.xml b/example/application/todoapp/integtests/pom.xml
deleted file mode 100644
index 3186102..0000000
--- a/example/application/todoapp/integtests/pom.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?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.example.application</groupId>
- <artifactId>todoapp</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>todoapp-integtests</artifactId>
- <name>ToDo App Integration Tests</name>
-
- <build>
- <testResources>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/resources</directory>
- </testResource>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- <plugins>
- <!--
- uncomment for enhanced cucumber-jvm reporting
- http://www.masterthought.net/section/cucumber-reporting
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <testfailureignore>true</testfailureignore>
- </configuration>
- </plugin>
- <plugin>
- <groupId>net.masterthought</groupId>
- <artifactId>maven-cucumber-reporting</artifactId>
- <version>0.0.3</version>
- <executions>
- <execution>
- <id>execution</id>
- <phase>verify</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- <configuration>
- <projectname>cucumber-jvm-example</projectname>
- <outputdirectory>${project.build.directory}/cucumber-reports</outputdirectory>
- <cucumberoutput>${project.build.directory}/cucumber.json</cucumberoutput>
- <enableflashcharts>false</enableflashcharts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- -->
- </plugins>
- </build>
- <dependencies>
-
- <!-- other modules in this project -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>todoapp-fixture</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-unittestsupport</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-integtestsupport</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-specsupport</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </dependency>
-
- <!--
- uncomment to enable enhanced cucumber-jvm reporting
- http://www.masterthought.net/section/cucumber-reporting
- <dependency>
- <groupId>com.googlecode.totallylazy</groupId>
- <artifactId>totallylazy</artifactId>
- <version>991</version>
- </dependency>
-
- <dependency>
- <groupId>net.masterthought</groupId>
- <artifactId>cucumber-reporting</artifactId>
- <version>0.0.21</version>
- </dependency>
- <dependency>
- <groupId>net.masterthought</groupId>
- <artifactId>maven-cucumber-reporting</artifactId>
- <version>0.0.4</version>
- </dependency>
- -->
- </dependencies>
-
- <!--
- uncomment for enhanced cucumber-jvm reporting
- http://www.masterthought.net/section/cucumber-reporting
- <repositories>
- <repository>
- <id>repo.bodar.com</id>
- <url>http://repo.bodar.com</url>
- </repository>
- </repositories>
- -->
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java b/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
deleted file mode 100644
index 3e21d50..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
+++ /dev/null
@@ -1,77 +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 integration;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.core.runtime.persistence.PersistenceConstants;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
-import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
-
-/**
- * Holds an instance of an {@link IsisSystemForTest} as a {@link ThreadLocal} on the current thread,
- * initialized with ToDo app's domain services.
- */
-public class ToDoAppSystemInitializer {
-
- private ToDoAppSystemInitializer(){}
-
- public static IsisSystemForTest initIsft() {
- IsisSystemForTest isft = IsisSystemForTest.getElseNull();
- if(isft == null) {
- isft = new ToDoSystemBuilder().build().setUpSystem();
- IsisSystemForTest.set(isft);
- }
- return isft;
- }
-
- private static class ToDoSystemBuilder extends IsisSystemForTest.Builder {
-
- public ToDoSystemBuilder() {
- withLoggingAt(org.apache.log4j.Level.INFO);
- with(testConfiguration());
- with(new DataNucleusPersistenceMechanismInstaller());
-
- // services annotated with @DomainService
- withServicesIn("app"
- ,"dom.todo"
- ,"fixture.todo"
- ,"webapp.admin"
- ,"webapp.prototyping"
- ,"org.apache.isis.core.wrapper"
- ,"org.apache.isis.applib"
- ,"org.apache.isis.core.metamodel.services"
- ,"org.apache.isis.core.runtime.services"
- ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
- ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
- );
- }
-
- private static IsisConfiguration testConfiguration() {
- final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests();
- testConfiguration.addRegisterEntitiesPackagePrefix("dom");
-
- // enable stricter checking
- //
- // the consequence of this is having to call 'nextTransaction()' between most of the given/when/then's
- // because the command2 only ever refers to the event of the originating action.
- testConfiguration.put(PersistenceConstants.ENFORCE_SAFE_SEMANTICS, "true");
-
- return testConfiguration;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java b/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java
deleted file mode 100644
index 9aae79c..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java
+++ /dev/null
@@ -1,53 +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 integration.glue;
-
-import cucumber.api.java.After;
-import cucumber.api.java.Before;
-import integration.ToDoAppSystemInitializer;
-
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionScope;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-public class BootstrappingGlue extends CukeGlueAbstract {
-
- // //////////////////////////////////////
-
- @Before(value={"@unit"}, order=100)
- public void beforeScenarioUnitScope() {
- before(ScenarioExecutionScope.UNIT);
- }
-
- @Before(value={"@integration"}, order=100)
- public void beforeScenarioIntegrationScope() {
- org.apache.log4j.PropertyConfigurator.configure("logging.properties");
- ToDoAppSystemInitializer.initIsft();
-
- before(ScenarioExecutionScope.INTEGRATION);
- }
-
- @After
- public void afterScenario(cucumber.api.Scenario sc) {
- assertMocksSatisfied();
- after(sc);
- }
-
- // //////////////////////////////////////
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java b/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
deleted file mode 100644
index 01e5776..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
+++ /dev/null
@@ -1,47 +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 integration.glue;
-
-import cucumber.api.java.Before;
-import dom.todo.ToDoItem;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-public class CatalogOfFixturesGlue extends CukeGlueAbstract {
-
-
- @Before(value={"@unit", "@ToDoItemsFixture"}, order=20000)
- public void unitFixtures() throws Throwable {
- final InMemoryDB inMemoryDB = new InMemoryDBForToDoApp(this.scenarioExecution());
- inMemoryDB.getElseCreate(ToDoItem.class, "Write blog post");
- inMemoryDB.getElseCreate(ToDoItem.class, "Pick up bread");
- final ToDoItem t3 = inMemoryDB.getElseCreate(ToDoItem.class, "Pick up butter");
- t3.setComplete(true);
- putVar("isis", "in-memory-db", inMemoryDB);
- }
-
- // //////////////////////////////////////
-
- @Before(value={"@integration", "@ToDoItemsFixture"}, order=20000)
- public void integrationFixtures() throws Throwable {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java b/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
deleted file mode 100644
index 04dcfb6..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
+++ /dev/null
@@ -1,40 +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 integration.glue;
-
-import dom.todo.ToDoItem;
-
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
-
-public class InMemoryDBForToDoApp extends InMemoryDB {
-
- public InMemoryDBForToDoApp(ScenarioExecution scenarioExecution) {
- super(scenarioExecution);
- }
-
- /**
- * Hook to initialize if possible.
- */
- @Override
- protected void init(Object obj, String str) {
- if(obj instanceof ToDoItem) {
- ToDoItem toDoItem = (ToDoItem) obj;
- toDoItem.setDescription(str);
- }
- }
-}
\ No newline at end of file
[04/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
new file mode 100644
index 0000000..1ec97ae
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
@@ -0,0 +1,122 @@
+<?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>${groupId}</groupId>
+ <artifactId>${rootArtifactId}</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <artifactId>${artifactId}</artifactId>
+ <name>ToDo App Integration Tests</name>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ </build>
+ <dependencies>
+
+ <!-- other modules in this project -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-fixture</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-unittestsupport</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-integtestsupport</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-specsupport</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-wrapper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-runtime</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+
+ <!--
+ uncomment to enable enhanced cucumber-jvm reporting
+ http://www.masterthought.net/section/cucumber-reporting
+ <dependency>
+ <groupId>com.googlecode.totallylazy</groupId>
+ <artifactId>totallylazy</artifactId>
+ <version>991</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.masterthought</groupId>
+ <artifactId>cucumber-reporting</artifactId>
+ <version>0.0.21</version>
+ </dependency>
+ <dependency>
+ <groupId>net.masterthought</groupId>
+ <artifactId>maven-cucumber-reporting</artifactId>
+ <version>0.0.4</version>
+ </dependency>
+ -->
+ </dependencies>
+
+ <!--
+ uncomment for enhanced cucumber-jvm reporting
+ http://www.masterthought.net/section/cucumber-reporting
+ <repositories>
+ <repository>
+ <id>repo.bodar.com</id>
+ <url>http://repo.bodar.com</url>
+ </repository>
+ </repositories>
+ -->
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
new file mode 100644
index 0000000..9e0e408
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
@@ -0,0 +1,80 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package integration;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.integtestsupport.IsisSystemForTest;
+import org.apache.isis.core.runtime.persistence.PersistenceConstants;
+import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
+import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
+
+/**
+ * Holds an instance of an {@link IsisSystemForTest} as a {@link ThreadLocal} on the current thread,
+ * initialized with ToDo app's domain services.
+ */
+public class ToDoAppSystemInitializer {
+
+ private ToDoAppSystemInitializer(){}
+
+ public static IsisSystemForTest initIsft() {
+ IsisSystemForTest isft = IsisSystemForTest.getElseNull();
+ if(isft == null) {
+ isft = new ToDoSystemBuilder().build().setUpSystem();
+ IsisSystemForTest.set(isft);
+ }
+ return isft;
+ }
+
+ private static class ToDoSystemBuilder extends IsisSystemForTest.Builder {
+
+ public ToDoSystemBuilder() {
+ withLoggingAt(org.apache.log4j.Level.INFO);
+ with(testConfiguration());
+ with(new DataNucleusPersistenceMechanismInstaller());
+
+ // services annotated with @DomainService
+ withServicesIn("app"
+ ,"dom.todo"
+ ,"fixture.todo"
+ ,"webapp.admin"
+ ,"webapp.prototyping"
+ ,"org.apache.isis.core.wrapper"
+ ,"org.apache.isis.applib"
+ ,"org.apache.isis.core.metamodel.services"
+ ,"org.apache.isis.core.runtime.services"
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
+ );
+ }
+
+ private static IsisConfiguration testConfiguration() {
+ final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests();
+ testConfiguration.addRegisterEntitiesPackagePrefix("dom");
+
+ // enable stricter checking
+ //
+ // the consequence of this is having to call 'nextTransaction()' between most of the given/when/then's
+ // because the command2 only ever refers to the event of the originating action.
+ testConfiguration.put(PersistenceConstants.ENFORCE_SAFE_SEMANTICS, "true");
+
+ return testConfiguration;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
new file mode 100644
index 0000000..250c0d5
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
@@ -0,0 +1,56 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package integration.glue;
+
+import cucumber.api.java.After;
+import cucumber.api.java.Before;
+import integration.ToDoAppSystemInitializer;
+
+import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionScope;
+import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
+
+public class BootstrappingGlue extends CukeGlueAbstract {
+
+ // //////////////////////////////////////
+
+ @Before(value={"@unit"}, order=100)
+ public void beforeScenarioUnitScope() {
+ before(ScenarioExecutionScope.UNIT);
+ }
+
+ @Before(value={"@integration"}, order=100)
+ public void beforeScenarioIntegrationScope() {
+ org.apache.log4j.PropertyConfigurator.configure("logging.properties");
+ ToDoAppSystemInitializer.initIsft();
+
+ before(ScenarioExecutionScope.INTEGRATION);
+ }
+
+ @After
+ public void afterScenario(cucumber.api.Scenario sc) {
+ assertMocksSatisfied();
+ after(sc);
+ }
+
+ // //////////////////////////////////////
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
new file mode 100644
index 0000000..ca6d940
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
@@ -0,0 +1,50 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package integration.glue;
+
+import cucumber.api.java.Before;
+import dom.todo.ToDoItem;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+
+import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
+import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
+
+public class CatalogOfFixturesGlue extends CukeGlueAbstract {
+
+
+ @Before(value={"@unit", "@ToDoItemsFixture"}, order=20000)
+ public void unitFixtures() throws Throwable {
+ final InMemoryDB inMemoryDB = new InMemoryDBForToDoApp(this.scenarioExecution());
+ inMemoryDB.getElseCreate(ToDoItem.class, "Write blog post");
+ inMemoryDB.getElseCreate(ToDoItem.class, "Pick up bread");
+ final ToDoItem t3 = inMemoryDB.getElseCreate(ToDoItem.class, "Pick up butter");
+ t3.setComplete(true);
+ putVar("isis", "in-memory-db", inMemoryDB);
+ }
+
+ // //////////////////////////////////////
+
+ @Before(value={"@integration", "@ToDoItemsFixture"}, order=20000)
+ public void integrationFixtures() throws Throwable {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
new file mode 100644
index 0000000..4d8af87
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
@@ -0,0 +1,43 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package integration.glue;
+
+import dom.todo.ToDoItem;
+
+import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
+import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
+
+public class InMemoryDBForToDoApp extends InMemoryDB {
+
+ public InMemoryDBForToDoApp(ScenarioExecution scenarioExecution) {
+ super(scenarioExecution);
+ }
+
+ /**
+ * Hook to initialize if possible.
+ */
+ @Override
+ protected void init(Object obj, String str) {
+ if(obj instanceof ToDoItem) {
+ ToDoItem toDoItem = (ToDoItem) obj;
+ toDoItem.setDescription(str);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
new file mode 100644
index 0000000..3db7fa1
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
@@ -0,0 +1,168 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package integration.glue.todoitem;
+
+import cucumber.api.java.en.Given;
+import cucumber.api.java.en.Then;
+import cucumber.api.java.en.When;
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+
+import java.util.List;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.jmock.Expectations;
+import org.junit.Assert;
+import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
+import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemGlue extends CukeGlueAbstract {
+
+ @Given("^there are a number of incomplete ToDo items${symbol_dollar}")
+ public void there_are_a_number_of_incomplete_ToDo_items() throws Throwable {
+ if(supportsMocks()) {
+ checking(new Expectations() {
+ {
+ allowing(service(ToDoItems.class)).notYetComplete();
+ will(returnValue(notYetCompleteItems()));
+ }
+ });
+ }
+ try {
+ final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
+ assertThat(notYetComplete.isEmpty(), is(false));
+ putVar("list", "notYetCompleteItems", notYetComplete);
+
+ } finally {
+ assertMocksSatisfied();
+ }
+ }
+
+ @When("^I choose the first of the incomplete items${symbol_dollar}")
+ public void I_choose_the_first_one() throws Throwable {
+ @SuppressWarnings("unchecked")
+ List<ToDoItem> notYetComplete = getVar(null, "notYetCompleteItems", List.class);
+ assertThat(notYetComplete.isEmpty(), is(false));
+
+ putVar("todo", "toDoItem", notYetComplete.get(0));
+ }
+
+ @When("^mark the item as complete${symbol_dollar}")
+ public void mark_it_as_complete() throws Throwable {
+ final ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ if(supportsMocks()) {
+ final ActionInvocationContext actionInvocationContext = service(ActionInvocationContext.class);
+ final EventBusService eventBusService = service(EventBusService.class);
+ checking(new Expectations() {
+ {
+ allowing(actionInvocationContext);
+ allowing(eventBusService);
+ }
+ });
+ toDoItem.actionInvocationContext = actionInvocationContext;
+ toDoItem.eventBusService = eventBusService;
+ }
+ wrap(toDoItem).completed();
+ }
+
+ @Then("^the item is no longer listed as incomplete${symbol_dollar}")
+ public void the_item_is_no_longer_listed_as_incomplete() throws Throwable {
+ ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ whetherNotYetCompletedContains(toDoItem, false);
+ }
+
+ @Given("^.*completed .*item${symbol_dollar}")
+ public void a_completed_ToDo_item() throws Throwable {
+ if(supportsMocks()) {
+ checking(new Expectations(){{
+ allowing(service(ToDoItems.class)).allToDos();
+ will(returnValue(findItems(Predicates.<ToDoItem>alwaysTrue()) ));
+ }});
+ }
+ try {
+ final List<ToDoItem> allToDos = service(ToDoItems.class).allToDos();
+ for (ToDoItem toDoItem : allToDos) {
+ if(toDoItem.isComplete()) {
+ putVar("todo", "toDoItem", toDoItem);
+ return;
+ }
+ }
+ Assert.fail("could not locate any completed ToDo items");
+ } finally {
+ assertMocksSatisfied();
+ }
+ }
+
+ @When("^I mark the .*item as not yet complete${symbol_dollar}")
+ public void I_mark_it_as_not_yet_complete() throws Throwable {
+ ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ assertThat(toDoItem.isComplete(), is(true));
+
+ toDoItem.setComplete(false);
+ }
+
+ @Then("^the .*item is listed as incomplete${symbol_dollar}")
+ public void the_item_is_listed_as_incomplete() throws Throwable {
+ ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
+ whetherNotYetCompletedContains(toDoItem, true);
+ }
+
+ private void whetherNotYetCompletedContains(ToDoItem toDoItem, final boolean whetherContained) {
+ if(supportsMocks()) {
+ final List<ToDoItem> notYetCompleteItems = notYetCompleteItems();
+ checking(new Expectations() {
+ {
+ oneOf(service(ToDoItems.class)).notYetComplete();
+ will(returnValue(notYetCompleteItems));
+ }
+ });
+ }
+ try {
+ final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
+ assertThat(notYetComplete.contains(toDoItem), is(whetherContained));
+ } finally {
+ assertMocksSatisfied();
+ }
+ }
+
+
+ // helper
+ private List<ToDoItem> notYetCompleteItems() {
+ return findItems(new Predicate<ToDoItem>(){
+ @Override
+ public boolean apply(ToDoItem input) {
+ return !input.isComplete();
+ }
+ });
+ }
+
+ private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
+ final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
+ final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
+ return Lists.newArrayList(Iterables.filter(items, predicate));
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
new file mode 100644
index 0000000..a0d30e2
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
@@ -0,0 +1,41 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package integration.specs.todoitem;
+
+import cucumber.api.junit.Cucumber;
+
+import org.junit.runner.RunWith;
+
+
+/**
+ * Runs scenarios in all <tt>.feature</tt> files (this package and any subpackages).
+ */
+@RunWith(Cucumber.class)
+@Cucumber.Options(
+ format = {
+ "html:target/cucumber-html-report"
+ ,"json:target/cucumber.json"
+ },
+ glue={"classpath:integration.glue"},
+ strict = true,
+ tags = { "~@backlog", "~@ignore" })
+public class RunSpecs {
+ // intentionally empty
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
new file mode 100644
index 0000000..9fc1596
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
@@ -0,0 +1,39 @@
+#
+# 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.
+#
+@ToDoItemsFixture
+Feature: Find And Complete ToDo Items
+
+ # the scenario is listed twice here just to demonstrate that it
+ # can be run either at @unit-level scope (using mocks) or
+ # at @integration-level scope (against the running system).
+
+ @unit
+ Scenario: Todo items once completed are no longer listed
+ Given there are a number of incomplete ToDo items
+ When I choose the first of the incomplete items
+ And mark the item as complete
+ Then the item is no longer listed as incomplete
+
+
+ @integration
+ Scenario: Todo items once completed are no longer listed
+ Given there are a number of incomplete ToDo items
+ When I choose the first of the incomplete items
+ And mark the item as complete
+ Then the item is no longer listed as incomplete
+
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
new file mode 100644
index 0000000..1f5f73e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
@@ -0,0 +1,35 @@
+#
+# 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.
+#
+@ToDoItemsFixture
+Feature: Find completed ToDoItem and mark as not yet complete
+
+ # the scenario is listed twice here just to demonstrate that it
+ # can be run either at @unit-level scope (using mocks) or
+ # at @integration-level scope (against the running system).
+
+ @integration
+ Scenario: Todo items can be uncompleted
+ Given a completed item
+ When I mark the item as not yet complete
+ Then the item is listed as incomplete
+
+
+ @unit
+ Scenario: Todo items can be uncompleted
+ Given a completed ToDo item
+ When I mark the item as not yet complete
+ Then the item is listed as incomplete
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
new file mode 100644
index 0000000..6776992
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
@@ -0,0 +1,41 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests;
+
+import integration.ToDoAppSystemInitializer;
+
+import org.junit.BeforeClass;
+import org.apache.isis.core.integtestsupport.IntegrationTestAbstract;
+import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForIntegration;
+
+public abstract class AbstractToDoIntegTest extends IntegrationTestAbstract {
+
+ @BeforeClass
+ public static void initClass() {
+ org.apache.log4j.PropertyConfigurator.configure("logging.properties");
+ ToDoAppSystemInitializer.initIsft();
+
+ // instantiating will install onto ThreadLocal
+ new ScenarioExecutionForIntegration();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
new file mode 100644
index 0000000..7440088
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
@@ -0,0 +1,161 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemContributions;
+import dom.todo.ToDoItems;
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public abstract class ToDoItemContributionsIntegTest extends AbstractToDoIntegTest {
+
+ ToDoItemsRecreateAndCompleteSeveral fixtureScript;
+
+ @Before
+ public void setUpData() throws Exception {
+ fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
+ fixtureScripts.runFixtureScript(fixtureScript, null);
+ }
+
+ @Inject
+ FixtureScripts fixtureScripts;
+ @Inject
+ ToDoItems toDoItems;
+ @Inject
+ ToDoItemContributions toDoItemContributions;
+
+ ToDoItemContributions toDoItemContributionsWrapped;
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+
+ toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-complete-for-buy-stamps/item-1", ToDoItem.class));
+ assertThat(toDoItem, is(not(nullValue())));
+
+ toDoItemContributionsWrapped = wrap(toDoItemContributions);
+ }
+
+ public static class Actions {
+ public static class UpdateCategory extends ToDoItemContributionsIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Consulting);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Professional));
+ assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Consulting));
+
+ // when
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Domestic, ToDoItem.Subcategory.Chores);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Domestic));
+ assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Chores));
+ }
+
+
+ @Test
+ public void categoryCannotBeNull() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("'Category' is mandatory");
+ toDoItemContributionsWrapped.updateCategory(toDoItem, null, ToDoItem.Subcategory.Chores);
+ }
+
+ @Test
+ public void subcategoryCanBeNull() throws Exception {
+
+ // when, then
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, null);
+ }
+
+ @Test
+ public void subcategoryMustBelongToCategory() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Invalid subcategory"));
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Chores);
+ }
+ }
+
+ public static class SimilarTo extends ToDoItemContributionsIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ List<ToDoItem> similarItems = toDoItemContributionsWrapped.similarTo(toDoItem);
+
+ // then
+ assertThat(similarItems.size(), is(6));
+ }
+
+ }
+ }
+
+ public static class Properties {
+ public static class Priority extends ToDoItemContributionsIntegTest {
+
+ private List<ToDoItem> notYetComplete;
+
+ @Before
+ public void setUp() throws Exception {
+ notYetComplete = wrap(toDoItems).notYetComplete();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+ assertPriority(0, 1);
+ assertPriority(1, 2);
+ assertPriority(2, 4);
+ assertPriority(3, 6);
+ assertPriority(4, 5);
+ assertPriority(5, 7);
+ assertPriority(6, 9);
+ assertPriority(7, 8);
+ assertPriority(8, 3);
+ assertPriority(9, 10);
+ }
+
+ private void assertPriority(final int n, final int priority) {
+ assertThat(toDoItemContributions.relativePriority(notYetComplete.get(n)), is(Integer.valueOf(priority)));
+ }
+ }
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
new file mode 100644
index 0000000..84d3d16
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
@@ -0,0 +1,1060 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemSubscriptions;
+import dom.todo.ToDoItems;
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import java.math.BigDecimal;
+import java.nio.charset.Charset;
+import java.util.EventObject;
+import java.util.List;
+import javax.activation.MimeType;
+import javax.inject.Inject;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+import org.jmock.Expectations;
+import org.jmock.Sequence;
+import org.jmock.auto.Mock;
+import org.joda.time.LocalDate;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.services.clock.ClockService;
+import org.apache.isis.applib.services.eventbus.AbstractInteractionEvent;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
+import org.apache.isis.applib.value.Blob;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemIntegTest extends AbstractToDoIntegTest {
+
+ ToDoItemsRecreateAndCompleteSeveral fixtureScript;
+
+ @Before
+ public void setUpData() throws Exception {
+ fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
+ fixtureScripts.runFixtureScript(fixtureScript, null);
+ }
+
+ @Inject
+ FixtureScripts fixtureScripts;
+ @Inject
+ ToDoItems toDoItems;
+ @Inject
+ ToDoItemSubscriptions toDoItemSubscriptions;
+
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = toDoItems.notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ toDoItemSubscriptions.reset();
+ }
+
+
+ public static class Title extends ToDoItemIntegTest {
+
+ private LocalDate dueBy;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+
+ toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-for-buy-bread/item-1", ToDoItem.class));
+ assertThat(toDoItem, is(not(nullValue())));
+
+ nextTransaction();
+
+ dueBy = toDoItem.getDueBy();
+ }
+
+
+ @Test
+ public void includesDescription() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread due by"));
+
+ // when
+ unwrap(toDoItem).setDescription("Buy bread and butter");
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread and butter due by"));
+ }
+
+ @Test
+ public void includesDueDateIfAny() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("due by " + dueBy.toString("yyyy-MM-dd")));
+
+ // when
+ final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
+ unwrap(toDoItem).setDueBy(fiveDaysFromNow);
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
+ }
+
+
+ @Test
+ public void ignoresDueDateIfNone() throws Exception {
+
+ // when
+ // (since wrapped, will call clearDueBy)
+ toDoItem.setDueBy(null);
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ }
+
+ @Test
+ public void usesWhetherCompleted() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), not(containsString("Completed!")));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread - Completed!"));
+ }
+ }
+
+ public static class Actions {
+
+ public static class Completed extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.isComplete(), is(false));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(true));
+ }
+
+ @Test
+ public void cannotCompleteIfAlreadyCompleted() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Already completed");
+ toDoItem.completed();
+
+ // and then
+ final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
+ assertThat(ev, is(nullValue()));
+ }
+
+
+ @Test
+ public void cannotSetPropertyDirectly() throws Exception {
+
+ // given
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Always disabled");
+ toDoItem.setComplete(true);
+
+ // and then
+ final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
+ assertThat(ev, is(nullValue()));
+ }
+
+ @Test
+ public void subscriberReceivesEvents() throws Exception {
+
+ // given
+ toDoItemSubscriptions.reset();
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ assertThat(unwrap(toDoItem).isComplete(), is(false));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(unwrap(toDoItem).isComplete(), is(true));
+
+ // and then
+ final List<ToDoItem.CompletedEvent> receivedEvents = toDoItemSubscriptions.receivedEvents(ToDoItem.CompletedEvent.class);
+
+ // hide, disable, validate, executing, executed
+ // sent to both the general on(ActionInteractionEvent ev)
+ // and also the specific on(final ToDoItem.CompletedEvent ev)
+ assertThat(receivedEvents.size(), is(5*2));
+ final ToDoItem.CompletedEvent ev = receivedEvents.get(0);
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("completed"));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ }
+
+ /**
+ * This test demonstrates how a single service can be replaced, eg to use a mock.
+ */
+ public static class Completed_withMockService extends ToDoItemIntegTest {
+
+ private EventBusService originalEventBusService;
+ @Mock
+ private EventBusService mockEventBusService;
+
+ @Before
+ public void setUpMockEventBusService() throws Exception {
+ originalEventBusService = scenarioExecution().service(EventBusService.class);
+
+ context.checking(new Expectations() {{
+ ignoring(mockEventBusService).register(with(any(Object.class)));
+ ignoring(mockEventBusService).unregister(with(any(Object.class)));
+ }});
+
+ scenarioExecution().replaceService(originalEventBusService, mockEventBusService);
+ scenarioExecution().closeSession();
+ scenarioExecution().openSession();
+
+ final List<ToDoItem> all = toDoItems.notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+
+ @After
+ public void reinstateOriginalEventBusService() throws Exception {
+ scenarioExecution().replaceService(mockEventBusService, originalEventBusService);
+ }
+
+ @Test
+ public void raisesEvent() throws Exception {
+
+ final Sequence busRulesThenExec = context.sequence("busRulesThenExec");
+ // then
+ context.checking(new Expectations() {{
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.HIDE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.DISABLE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.VALIDATE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTING)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTED)));
+ inSequence(busRulesThenExec);
+ }});
+
+ // when
+ toDoItem.completed();
+ }
+
+ private Matcher<Object> completedEvent(final AbstractInteractionEvent.Phase phase) {
+ return new TypeSafeMatcher<Object>() {
+ @Override
+ protected boolean matchesSafely(Object item) {
+ if (!(item instanceof ToDoItem.CompletedEvent)) {
+ return false;
+ }
+
+ final ToDoItem.CompletedEvent completedEvent = (ToDoItem.CompletedEvent) item;
+ return completedEvent.getPhase() == phase;
+
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText(" instance of a ToDoItem.CompletedEvent, " + phase);
+ }
+ };
+ }
+ }
+
+
+ public static class Duplicate extends ToDoItemIntegTest {
+
+ ToDoItem duplicateToDoItem;
+
+ @Inject
+ private ClockService clockService;
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ final LocalDate todaysDate = clockService.now();
+ toDoItem.setDueBy(todaysDate);
+ toDoItem.updateCost(new BigDecimal("123.45"));
+
+ duplicateToDoItem = toDoItem.duplicate(
+ unwrap(toDoItem).default0Duplicate(),
+ unwrap(toDoItem).default1Duplicate(),
+ unwrap(toDoItem).default2Duplicate(),
+ unwrap(toDoItem).default3Duplicate(),
+ new BigDecimal("987.65"));
+
+ // then
+ assertThat(duplicateToDoItem.getDescription(), is(toDoItem.getDescription() + " - Copy"));
+ assertThat(duplicateToDoItem.getCategory(), is(toDoItem.getCategory()));
+ assertThat(duplicateToDoItem.getDueBy(), is(todaysDate));
+ assertThat(duplicateToDoItem.getCost(), is(new BigDecimal("987.65")));
+ }
+ }
+
+ public static class NotYetCompleted extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(false));
+ }
+
+ @Test
+ public void cannotUndoIfNotYetCompleted() throws Exception {
+
+ // given
+ assertThat(toDoItem.isComplete(), is(false));
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Not yet completed");
+ toDoItem.notYetCompleted();
+ }
+
+ /**
+ * Even though {@link dom.todo.ToDoItem${symbol_pound}notYetCompleted()} is not annotated with
+ * {@link org.apache.isis.applib.annotation.ActionInteraction}, an event is still raised.
+ */
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ unwrap(toDoItem).setComplete(true);
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(unwrap(toDoItem).isComplete(), is(false));
+
+ // and then
+ final ActionDomainEvent<ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
+ assertThat(ev, is(not(nullValue())));
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("notYetCompleted"));
+ }
+ }
+ }
+
+ public static class Collections {
+
+ public static class Dependencies {
+ public static class Add extends ToDoItemIntegTest {
+
+ private ToDoItem otherToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ otherToDoItem = wrap(items.get(1));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ super.tearDown();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDependencies().size(), is(0));
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then
+ assertThat(toDoItem.getDependencies().size(), is(1));
+ assertThat(toDoItem.getDependencies().iterator().next(), is(unwrap(otherToDoItem)));
+ }
+
+
+ @Test
+ public void cannotDependOnSelf() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("Can't set up a dependency to self");
+
+ // when
+ toDoItem.add(toDoItem);
+ }
+
+ @Test
+ public void cannotAddIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ toDoItemSubscriptions.reset();
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then received events
+ @SuppressWarnings("unchecked")
+ final List<EventObject> receivedEvents = toDoItemSubscriptions.receivedEvents();
+
+ assertThat(receivedEvents.size(), is(7));
+ assertThat(receivedEvents.get(0) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add() executed
+ assertThat(receivedEvents.get(1) instanceof CollectionDomainEvent, is(true)); // ToDoItem${symbol_pound}dependencies add, executed
+ assertThat(receivedEvents.get(2) instanceof CollectionDomainEvent, is(true)); // ToDoItem${symbol_pound}dependencies add, executing
+ assertThat(receivedEvents.get(3) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add executing
+ assertThat(receivedEvents.get(4) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add validate
+ assertThat(receivedEvents.get(5) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add disable
+ assertThat(receivedEvents.get(6) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add hide
+
+ // inspect the collection interaction (posted programmatically in ToDoItem${symbol_pound}add)
+ final CollectionDomainEvent<ToDoItem,ToDoItem> ciEv = (CollectionDomainEvent<ToDoItem, ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionDomainEvent.class);
+ assertThat(ciEv, is(notNullValue()));
+
+ assertThat(ciEv.getSource(), is(equalTo(unwrap(toDoItem))));
+ assertThat(ciEv.getIdentifier().getMemberName(), is("dependencies"));
+ assertThat(ciEv.getOf(), is(CollectionDomainEvent.Of.ADD_TO));
+ assertThat(ciEv.getValue(), is(unwrap(otherToDoItem)));
+
+ // inspect the action interaction (posted declaratively by framework)
+ final ActionDomainEvent<ToDoItem> aiEv = (ActionDomainEvent<ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
+ assertThat(aiEv, is(notNullValue()));
+
+ assertThat(aiEv.getSource(), is(equalTo(unwrap(toDoItem))));
+ assertThat(aiEv.getIdentifier().getMemberName(), is("add"));
+ assertThat(aiEv.getArguments().size(), is(1));
+ assertThat(aiEv.getArguments().get(0), is(unwrap((Object)otherToDoItem)));
+ assertThat(aiEv.getCommand(), is(notNullValue()));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+ }
+ public static class Remove extends ToDoItemIntegTest {
+
+ private ToDoItem otherToDoItem;
+ private ToDoItem yetAnotherToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ otherToDoItem = wrap(items.get(1));
+ yetAnotherToDoItem = wrap(items.get(2));
+
+ toDoItem.add(otherToDoItem);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ super.tearDown();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDependencies().size(), is(1));
+
+ // when
+ toDoItem.remove(otherToDoItem);
+
+ // then
+ assertThat(toDoItem.getDependencies().size(), is(0));
+ }
+
+
+ @Test
+ public void cannotRemoveItemIfNotADependency() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("Not a dependency");
+
+ // when
+ toDoItem.remove(yetAnotherToDoItem);
+ }
+
+ @Test
+ public void cannotRemoveDependencyIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+ }
+ }
+
+ }
+
+ public static class Properties {
+
+ public static class Attachment extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ byte[] bytes = "{${symbol_escape}"foo${symbol_escape}": ${symbol_escape}"bar${symbol_escape}"}".getBytes(Charset.forName("UTF-8"));
+ final Blob newAttachment = new Blob("myfile.json", new MimeType("application/json"), bytes);
+
+ // when
+ toDoItem.setAttachment(newAttachment);
+
+ // then
+ assertThat(toDoItem.getAttachment(), is(newAttachment));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setAttachment((Blob)null);
+
+ // then
+ assertThat(toDoItem.getAttachment(), is((Blob)null));
+ }
+ }
+
+ public static class Category extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setCategory(ToDoItem.Category.Professional);
+ }
+ }
+
+ public static class Cost extends ToDoItemIntegTest {
+
+ private BigDecimal cost;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ cost = toDoItem.getCost();
+ }
+
+ @Test
+ public void happyCaseUsingProperty() throws Exception {
+
+ final BigDecimal newCost = new BigDecimal("123.45");
+
+ // when
+ toDoItem.updateCost(newCost);
+
+ // then
+ assertThat(toDoItem.getCost(), is(newCost));
+ }
+
+ @Test
+ public void happyCaseUsingAction() throws Exception {
+
+ final BigDecimal newCost = new BigDecimal("123.45");
+
+ // when
+ toDoItem.updateCost(newCost);
+
+ // then
+ assertThat(toDoItem.getCost(), is(newCost));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.updateCost((BigDecimal)null);
+
+ // then
+ assertThat(toDoItem.getCost(), is((BigDecimal)null));
+ }
+
+ @Test
+ public void defaultForAction() throws Exception {
+
+ // then
+ assertThat(unwrap(toDoItem).default0UpdateCost(), is(cost));
+ }
+
+ }
+
+ public static class Description extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread and butter"));
+ }
+
+
+ @Test
+ public void failsRegex() throws Exception {
+
+ // when
+ expectedExceptions.expectMessage("Doesn't match pattern");
+ toDoItem.setDescription("exclamation marks are not allowed!!!");
+ }
+
+ @Test
+ public void cannotBeNull() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Mandatory");
+ toDoItem.setDescription(null);
+ }
+
+ @Test
+ public void cannotUseModify() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.modifyDescription("Buy bread and butter");
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+ @Test
+ public void cannotUseClear() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.clearDescription();
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+
+ @Test
+ public void onlyJustShortEnough() throws Exception {
+
+ // when, then
+ toDoItem.setDescription(characters(100));
+ }
+
+ @Test
+ public void tooLong() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
+
+ // when
+ toDoItem.setDescription(characters(101));
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then published and received
+ @SuppressWarnings("unchecked")
+ final PropertyDomainEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.class);
+ assertThat(ev, is(not(nullValue())));
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("description"));
+ assertThat(ev.getOldValue(), is("Buy bread"));
+ assertThat(ev.getNewValue(), is("Buy bread and butter"));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberVetoesEventWithAnyOtherException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // then
+ expectedExceptions.expect(RuntimeException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ private static String characters(final int n) {
+ StringBuffer buf = new StringBuffer();
+ for(int i=0; i<n; i++) {
+ buf.append("a");
+ }
+ return buf.toString();
+ }
+ }
+
+ public static class DueBy extends ToDoItemIntegTest {
+
+ @Inject
+ private ClockService clockService;
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ final LocalDate fiveDaysFromNow = clockService.now().plusDays(5);
+ toDoItem.setDueBy(fiveDaysFromNow);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is(fiveDaysFromNow));
+ }
+
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setDueBy((LocalDate)null);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is((LocalDate)null));
+ }
+
+ @Test
+ public void canBeUpToSixDaysInPast() throws Exception {
+
+ final LocalDate nowAsLocalDate = clockService.now();
+ final LocalDate sixDaysAgo = nowAsLocalDate.plusDays(-5);
+
+ // when
+ toDoItem.setDueBy(sixDaysAgo);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is(sixDaysAgo));
+ }
+
+
+ @Test
+ public void cannotBeMoreThanSixDaysInPast() throws Exception {
+
+ final LocalDate sevenDaysAgo = Clock.getTimeAsLocalDate().plusDays(-7);
+
+ // when, then
+ expectedExceptions.expectMessage("Due by date cannot be more than one week old");
+ toDoItem.setDueBy(sevenDaysAgo);
+ }
+ }
+
+ public static class Notes extends ToDoItemIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ final String newNotes = "Lorem ipsum yada yada";
+
+ // when
+ toDoItem.setNotes(newNotes);
+
+ // then
+ assertThat(toDoItem.getNotes(), is(newNotes));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setNotes((String)null);
+
+ // then
+ assertThat(toDoItem.getNotes(), is((String)null));
+ }
+
+ @Test
+ public void suscriberReceivedDefaultEvent() throws Exception {
+
+ final String newNotes = "Lorem ipsum yada yada";
+
+ // when
+ toDoItem.setNotes(newNotes);
+
+ // then
+ assertThat(unwrap(toDoItem).getNotes(), is(newNotes));
+
+ // and then receive the default event.
+ @SuppressWarnings("unchecked")
+ final PropertyDomainEvent.Default ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.Default.class);
+ assertThat(ev, is(notNullValue()));
+
+ assertThat(ev.getSource(), is((Object)unwrap(toDoItem)));
+ assertThat(ev.getNewValue(), is((Object)newNotes));
+ }
+
+
+ }
+
+ public static class OwnedBy extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Reason: Hidden on Everywhere. Identifier: dom.todo.ToDoItem${symbol_pound}ownedBy()");
+ toDoItem.setOwnedBy("other");
+ }
+
+
+ }
+
+ public static class Subcategory extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setSubcategory(ToDoItem.Subcategory.Chores);
+ }
+ }
+
+ }
+
+
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
new file mode 100644
index 0000000..203cdfe
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
@@ -0,0 +1,135 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemsIntegTest extends AbstractToDoIntegTest {
+
+ @Inject
+ FixtureScripts fixtureScripts;
+ @Inject
+ ToDoItems toDoItems;
+
+ public static class Finders extends ToDoItemsIntegTest {
+
+ ToDoItemsIntegTestFixture fixture;
+
+ @Before
+ public void setUpData() throws Exception {
+ // executing the fixtures directly allows us to look up the results later.
+ fixtureScripts.runFixtureScript(fixture = new ToDoItemsIntegTestFixture(), null);
+ }
+
+ private int notYetCompletedSize;
+ private int completedSize;
+
+ @Before
+ public void setUp() throws Exception {
+
+ // could use fixture${symbol_pound}lookup(...), but can also just search directly.
+ final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
+ final List<ToDoItem> completedItems = wrap(toDoItems).complete();
+
+ notYetCompletedSize = notYetCompleteItems.size();
+ completedSize = completedItems.size();
+
+ assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
+ }
+
+ @Test
+ public void complete_and_notYetComplete() throws Exception {
+
+ // given
+ List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
+ final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
+ nextTransaction();
+
+ // when
+ toDoItem.completed();
+ nextTransaction();
+
+ // then
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize-1));
+ assertThat(wrap(toDoItems).complete().size(), is(completedSize+1));
+ nextTransaction();
+
+ // and when
+ toDoItem.notYetCompleted();
+ nextTransaction();
+
+ // then
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize));
+ assertThat(wrap(toDoItems).complete().size(), is(completedSize));
+ }
+ }
+
+ public static class NewToDo_and_Delete extends ToDoItemsIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ // none
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ int size = wrap(toDoItems).notYetComplete().size();
+ nextTransaction();
+
+ // when
+ final ToDoItem newToDo = toDoItems.newToDo("new todo", ToDoItem.Category.Professional, ToDoItem.Subcategory.OpenSource, null, null);
+ nextTransaction();
+
+ // then
+ assertThat(newToDo.getDescription(), is("new todo"));
+ assertThat(newToDo.getCategory(), is(ToDoItem.Category.Professional));
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(size+1));
+ assertThat(container().isPersistent(newToDo), is(true));
+ assertThat(container().isPersistent(wrap(newToDo)), is(true));
+
+ nextTransaction();
+
+ // when
+ newToDo.delete();
+ nextTransaction();
+
+ // then
+ assertThat(wrap(toDoItems).notYetComplete().size(), is(size));
+ }
+
+ }
+
+}
\ No newline at end of file
[12/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
deleted file mode 100644
index 2a425e5..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
+++ /dev/null
@@ -1,178 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<!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™ TodoApp</title>
-
- <style type="text/css">
-body {
- background-color: ${symbol_pound}1A467B;
- font-family: Verdana, Helvetica, Arial;
- 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;
-}
-${symbol_pound}wrapper {
- background-color: ${symbol_pound}ffffff;
- width: 900px;
- margin: 8px auto;
- padding: 12px;
-}
- </style>
- </head>
- <body>
- <div id="wrapper">
- <img alt="Isis Logo" src="about/images/isis-logo.png" />
-
- <p>
- <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a framework to let you rapidly develop
- domain-driven apps in Java. This app has been generated using Isis'
- <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
- which configures Isis to run a (quite feature rich) "todo" app.
-
- <p>
- The app itself consists of a single domain class, <tt>ToDoItem</tt>, along with a number of supporting
- services.
- </p>
-
- <p>To access the app:</p>
- <ul>
- <li>
- <p>
- <b><a href="wicket/">wicket/</a></b>
- </p>
- <p>
- provides accesses to a generic UI for end-users,
- Isis' <a href="http://isis.apache.org/components/viewers/wicket/about.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="restful/">restful/</a>
- </b>
- </p>
- <p>
- provides access to a RESTful API conformant with the
- <a href="http://restfulobjects.org">Restful Objects</a> spec</td>. This is part of Isis Core. The
- implementation technology is JBoss RestEasy.
- </p>
- </li>
- </ul>
-
- <p>
- The default user/password is <b><i>sven/pass</i></b> (as configured in the
- <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">shiro.ini</a> file).
- </p>
-
- <p>
- To build your own app, while you could start with this todo app and remove/rename as required, you are
- probably better off using the extremely minimal
- <a href="http://isis.apache.org/intro/getting-started/simpleapp-archetype.html" target="_blank">SimpleApp</a> archetype.
- </p>
-
- <h2>App contents</h2>
- <p>The key files in this "todo" app are:</p>
- <!-- the hrefs below are partially URL encoded to prevent them from being modified when the archetype is created -->
- <ul>
- <li>Domain classes (todo functionality) (in <tt>dom</tt> module)
- <ul>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank"><tt>ToDoItem</tt></a> domain entity
- </li>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItems.java" target="_blank"><tt>ToDoItems</tt></a> domain service (repository/factory)
- </li>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoItemAnalysis.java" target="_blank"><tt>ToDoItemAnalysis</tt></a> application service analysing todo items
- </li>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoAppDashboard.java" target="_blank"><tt>ToDoAppDashboard</tt></a> dashboard application service
- </li>
- </ul>
- </li>
- <li>Fixture scripts (in <tt>fixture</tt> module)
- <ul>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java" target="_blank"><tt>ToDoItemsFixtureService</tt></a> domain service to install fixtures at run-time
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml" target="_blank">WEB-INF/web.xml</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L98" target="_blank">ResourceCachingFilter</a></tt> and <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L134" target="_blank">ResourceServlet</a></tt> - filter and servlet for serving up static resources.
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L174" target="_blank">WicketFilter</a></tt> - filter for the wicket application, mapped to <tt>/wicket/*</tt>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L223" target="_blank">ResteasyBootstrap</a></tt>,
- <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L240" target="_blank">IsisSessionFilterForRestfulObjects</a></tt>,
- <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L271" target="_blank">RestfulObjectsRestEasyDispatcher</a></tt> - listeners, filters and servlets to bootstrap and map restful objects viewer to <tt>/restful/*</tt>.
- </li>
- <li>commented out <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L208" target="_blank">IsisWebAppBootstrapper</a></tt> listener; this is NOT required unless wicket viewer config is removed
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/isis.properties" target="_blank">WEB-INF/isis.properties</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li><tt>isis.services</tt> - explicitly loaded framework-provide domain services. Other services (including <tt>ToDoItems</tt> and <tt>ToDoItemsFixtureService</tt> described above),
- are loaded automatically from the classpath.
- </li>
- <li><tt>isis.persistor</tt> - specifies to use Isis' integration with <a href="http://datanucleus.org">DataNucleus</a> for (JDO-based) persistence.
- </li>
- <li><tt>isis.authentication</tt> and <tt>isis.authorization</tt> - specifies to use Isis' integration with <a href="http://shiro.apache.org">Apache Shiro</a> for security.
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties" target="_blank">WEB-INF/persistor_datanucleus.properties</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li>configuration for the DataNucleus (JDO) object store
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor.properties" target="_blank">WEB-INF/persistor.properties</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li>JDBC URL for DataNucleus (JDO) object store
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">WEB-INF/shiro.ini</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li>configuration for Shiro security
- </li>
- </ul>
- </li>
- </ul>
- </div>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
deleted file mode 100644
index e4aed6e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
+++ /dev/null
@@ -1,35 +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.
- */
-
-.navbar-brand img {
- margin-top: -5px;
- margin-left: 5px;
-}
-
-.x-key label.scalarName {
- color: red;
-}
-
-tr.todo {
-}
-
-tr.done {
- text-decoration: line-through;
- color: #d3d3d3;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn
deleted file mode 100644
index 016c9b8..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png
deleted file mode 100644
index 2c417fb..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-header.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
deleted file mode 100644
index 7a164e1..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png
deleted file mode 100644
index ee2feb4..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo-signin.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn
deleted file mode 100644
index 4983ca9..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/images/todoapp-logo.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js
deleted file mode 100644
index d8cf6fe..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/scripts/application.js
+++ /dev/null
@@ -1,3 +0,0 @@
-$(document).ready(function() {
- /// here...
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index 465d32c..0000000
--- a/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Tue Feb 03 23:39:52 GMT 2015
-package=it.pkg
-version=0.1-SNAPSHOT
-groupId=archetype.it
-artifactId=basic
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/test/resources/projects/basic/goal.txt b/example/archetype/todoapp/src/test/resources/projects/basic/goal.txt
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/.gitattributes
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/.gitattributes b/mothballed/example/application/todoapp/.gitattributes
new file mode 100644
index 0000000..b1eafb6
--- /dev/null
+++ b/mothballed/example/application/todoapp/.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
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/.gitignore
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/.gitignore b/mothballed/example/application/todoapp/.gitignore
new file mode 100644
index 0000000..ad3f5e2
--- /dev/null
+++ b/mothballed/example/application/todoapp/.gitignore
@@ -0,0 +1,40 @@
+*~
+*.swp
+*.class
+bin/
+target/
+target-ide/
+logs/
+.settings/
+.project
+.classpath
+.idea
+*.iml
+
+JArchitectOut/
+*.jdproj
+
+neo4j_DB/
+
+# log files
+datanucleus.log
+isis.log
+hs_err_pid*.log
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+dependency-reduced-pom.xml
+pom.xml.tag
+pom.xml.next
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+
+.clover/
+*.jdproj
+JArchitectOut/
+
+
+rebel.xml
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/log4j.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/log4j.properties b/mothballed/example/application/todoapp/dom/log4j.properties
new file mode 100644
index 0000000..ca165ac
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/log4j.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
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/pom.xml b/mothballed/example/application/todoapp/dom/pom.xml
new file mode 100644
index 0000000..09f46d9
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/pom.xml
@@ -0,0 +1,172 @@
+<?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.example.application</groupId>
+ <artifactId>todoapp</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>todoapp-dom</artifactId>
+ <name>ToDo App DOM</name>
+
+ <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>
+ <plugins>
+ <plugin>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-maven-plugin</artifactId>
+ <version>${datanucleus-maven-plugin.version}</version>
+ <configuration>
+ <fork>false</fork>
+ <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
+ <verbose>true</verbose>
+ <props>${basedir}/datanucleus.properties</props>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>enhance</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.datanucleus
+ </groupId>
+ <artifactId>
+ datanucleus-maven-plugin
+ </artifactId>
+ <versionRange>
+ [3.2.0-release,)
+ </versionRange>
+ <goals>
+ <goal>enhance</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-applib</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-unittestsupport</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Bytecode libraries (for mocking) -->
+ <dependency>
+ <groupId>org.objenesis</groupId>
+ <artifactId>objenesis</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>isis-validate</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.isis.tool</groupId>
+ <artifactId>isis-maven-plugin</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ <configuration>
+ <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.isis.example.application</groupId>
+ <artifactId>todoapp-dom</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </dependency>
+ <!--
+ ... workaround to avoid conflict with plexus-default
+ (not sure why exclusions in the isis-maven-plugin aren't sufficient, though ...
+ -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>16.0.1</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>validate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/META-INF/persistence.xml b/mothballed/example/application/todoapp/dom/src/main/java/META-INF/persistence.xml
new file mode 100644
index 0000000..9b38012
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/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="quickstart">
+ </persistence-unit>
+</persistence>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.java b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.java
new file mode 100644
index 0000000..e3a3723
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.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 app;
+
+import java.util.List;
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.applib.annotation.CollectionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.RenderType;
+
+@DomainObject(nature = Nature.VIEW_MODEL)
+public class ToDoAppDashboard {
+
+ //region > identification in the UI
+ public String title() {
+ return "Dashboard";
+ }
+ //endregion
+
+ //region > getAnalysisByCategory (collection)
+ @CollectionLayout(
+ named="By Category",
+ render = RenderType.EAGERLY
+ )
+ @Collection(
+ editing = Editing.DISABLED
+ )
+ public List<ToDoItemsByCategoryViewModel> getAnalysisByCategory() {
+ return toDoItemAnalysis.toDoItemsByCategory();
+ }
+ //endregion
+
+ //region > getAnalysisByDateRange (collection)
+ @CollectionLayout(
+ named="By Date Range",
+ render = RenderType.EAGERLY
+ )
+ @Collection(
+ editing = Editing.DISABLED
+ )
+ public List<ToDoItemsByDateRangeViewModel> getAnalysisByDateRange() {
+ return toDoItemAnalysis.toDoItemsByDateRange();
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItemAnalysis toDoItemAnalysis;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json
new file mode 100644
index 0000000..3421543
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.layout.json
@@ -0,0 +1,26 @@
+{
+ "columns": [
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 12,
+ "collections": {
+ "analysisByCategory": {}
+ }
+ }
+ ],
+ "actions": {
+ "downloadLayout": {},
+ "refreshLayout": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png
new file mode 100644
index 0000000..fe6e6a1
Binary files /dev/null and b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboard.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java
new file mode 100644
index 0000000..3bc371c
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoAppDashboardService.java
@@ -0,0 +1,44 @@
+/*
+ * 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 app;
+
+import javax.inject.Inject;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.HomePage;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService(nature = NatureOfService.DOMAIN)
+public class ToDoAppDashboardService {
+
+ @Action(
+ semantics = SemanticsOf.SAFE
+ //hidden = Where.EVERYWHERE
+ )
+ @HomePage
+ public ToDoAppDashboard lookup() {
+ return container.injectServicesInto(new ToDoAppDashboard());
+ }
+
+ @Inject
+ private DomainObjectContainer container;
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java
new file mode 100644
index 0000000..4c7d157
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysis.java
@@ -0,0 +1,126 @@
+/*
+ * 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 app;
+
+import dom.todo.ToDoItem.Category;
+
+import java.util.Arrays;
+import java.util.List;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainServiceLayout(
+ named="Analysis",
+ menuOrder = "20")
+@DomainService
+public class ToDoItemAnalysis {
+
+
+ //region > identification in the UI
+ public String getId() {
+ return "analysis";
+ }
+
+ public String iconName() {
+ return "ToDoItem";
+ }
+ //endregion
+
+
+ //region > byCategory (action)
+ @ActionLayout(
+ cssClassFa="fa fa-pie-chart",
+ named="By Category",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ @MemberOrder(sequence = "1")
+ public List<ToDoItemsByCategoryViewModel> toDoItemsByCategory() {
+ final List<Category> categories = Arrays.asList(Category.values());
+ return Lists.newArrayList(Iterables.transform(categories, byCategory()));
+ }
+
+ private Function<Category, ToDoItemsByCategoryViewModel> byCategory() {
+ return new Function<Category, ToDoItemsByCategoryViewModel>(){
+ @Override
+ public ToDoItemsByCategoryViewModel apply(final Category category) {
+ return new ToDoItemsByCategoryViewModel(category);
+ }
+ };
+ }
+ //endregion
+
+ //region > byDateRange (action)
+
+ public enum DateRange {
+ OverDue,
+ Today,
+ Tomorrow,
+ ThisWeek,
+ Later,
+ Unknown,
+ }
+
+ @ActionLayout(
+ cssClassFa="fa fa-calendar",
+ named="By Date Range",
+ bookmarking = BookmarkPolicy.AS_ROOT
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ @MemberOrder(sequence = "1")
+ public List<ToDoItemsByDateRangeViewModel> toDoItemsByDateRange() {
+ final List<DateRange> dateRanges = Arrays.asList(DateRange.values());
+ return Lists.newArrayList(Iterables.transform(dateRanges, byDateRange()));
+ }
+
+ private static Function<DateRange, ToDoItemsByDateRangeViewModel> byDateRange() {
+ return new Function<DateRange, ToDoItemsByDateRangeViewModel>(){
+ @Override
+ public ToDoItemsByDateRangeViewModel apply(final DateRange dateRange) {
+ return new ToDoItemsByDateRangeViewModel(dateRange);
+ }
+ };
+ }
+ //endregion
+
+ //region > forCategory (programmatic)
+ @Programmatic
+ public ToDoItemsByCategoryViewModel toDoItemsForCategory(final Category category) {
+ return byCategory().apply(category);
+ }
+
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java
new file mode 100644
index 0000000..baf4b00
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemAnalysisContributions.java
@@ -0,0 +1,50 @@
+/*
+ * 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 app;
+
+import dom.todo.ToDoItem;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Contributed;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
+public class ToDoItemAnalysisContributions {
+
+
+ //region > analyseCategory (action)
+ @ActionLayout(contributed = Contributed.AS_ACTION)
+ @Action(
+ semantics = SemanticsOf.SAFE
+ )
+ public ToDoItemsByCategoryViewModel analyseCategory(final ToDoItem item) {
+ return toDoAppAnalysis.toDoItemsForCategory(item.getCategory());
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItemAnalysis toDoAppAnalysis;
+
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
new file mode 100644
index 0000000..8ebae61
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
@@ -0,0 +1,168 @@
+/*
+ * 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 app;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItems;
+
+import java.util.Arrays;
+import java.util.List;
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.CollectionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.RenderType;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.util.ObjectContracts;
+
+@DomainObjectLayout(
+ named="By Category",
+ bookmarking = BookmarkPolicy.AS_ROOT
+)
+@DomainObject(
+ nature = Nature.VIEW_MODEL
+)
+public class ToDoItemsByCategoryViewModel
+ implements Comparable<ToDoItemsByCategoryViewModel> {
+
+ //region > constructors
+ public ToDoItemsByCategoryViewModel() {
+ }
+ public ToDoItemsByCategoryViewModel(final Category category) {
+ setCategory(category);
+ }
+ //endregion
+
+
+ //region > category (property)
+ private Category category;
+
+ @Title
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(final Category category) {
+ this.category = category;
+ }
+ //endregion
+
+ //region > notYetComplete (property), complete (property)
+ @PropertyLayout(
+ multiLine=5
+ )
+ public String getNotYetComplete() {
+ final List<ToDoItem> notYetComplete = getItemsNotYetComplete();
+ return Joiner.on(", ").join(
+ Iterables.transform(subcategories(), summarizeBySubcategory(notYetComplete)));
+ }
+
+ @PropertyLayout(
+ multiLine=5
+ )
+ public String getComplete() {
+ final List<ToDoItem> completeInCategory = getItemsComplete();
+ return Joiner.on(", ").join(
+ Iterables.transform(subcategories(), summarizeBySubcategory(completeInCategory)));
+ }
+
+ // //////////////////////////////////////
+
+ private Iterable<ToDoItem.Subcategory> subcategories() {
+ return Iterables.filter(Arrays.asList(ToDoItem.Subcategory.values()), ToDoItem.Subcategory.thoseFor(getCategory()));
+ }
+
+ private Function<ToDoItem.Subcategory, String> summarizeBySubcategory(final Iterable<ToDoItem> itemsInCategory) {
+ return new Function<ToDoItem.Subcategory, String>() {
+ @Override
+ public String apply(final ToDoItem.Subcategory subcategory) {
+ return subcategory + ": " + countIn(itemsInCategory, subcategory);
+ }
+ };
+ }
+
+ private static int countIn(final Iterable<ToDoItem> items, final ToDoItem.Subcategory subcategory) {
+ return Iterables.size(Iterables.filter(items,
+ ToDoItem.Predicates.thoseSubcategorised(subcategory)));
+ }
+ //endregion
+
+ //region > getItemsNotYetComplete (collection), getItemsComplete (collection)
+ /**
+ * All those items {@link ToDoItems#notYetComplete() not yet complete}, for this {@link #getCategory() category}.
+ */
+ @CollectionLayout(
+ render = RenderType.EAGERLY
+ )
+ public List<ToDoItem> getItemsNotYetComplete() {
+ final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
+ return Lists.newArrayList(Iterables.filter(notYetComplete, ToDoItem.Predicates.thoseCategorised(getCategory())));
+ }
+
+ /**
+ * All those items {@link ToDoItems#complete() complete}, for this {@link #getCategory() category}.
+ */
+ @CollectionLayout(
+ render = RenderType.EAGERLY
+ )
+ public List<ToDoItem> getItemsComplete() {
+ final List<ToDoItem> complete = toDoItems.completeNoUi();
+ return Lists.newArrayList(Iterables.filter(complete, ToDoItem.Predicates.thoseCategorised(getCategory())));
+ }
+
+ //endregion
+
+ //region > deleteCompleted (action)
+ @ActionLayout(
+ named="Delete"
+ )
+ public ToDoItemsByCategoryViewModel deleteCompleted() {
+ for (final ToDoItem item : getItemsComplete()) {
+ container.removeIfNotAlready(item);
+ }
+ // force reload of page
+ return this;
+ }
+
+ //endregion
+
+ //region > compareTo
+ @Override
+ public int compareTo(final ToDoItemsByCategoryViewModel other) {
+ return ObjectContracts.compare(this, other, "category");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
new file mode 100644
index 0000000..c87b554
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
@@ -0,0 +1,43 @@
+{
+ "columns": [
+ {
+ "span": 4,
+ "memberGroups": {
+ "General": {
+ "members": {
+ "category": {}
+ }
+ },
+ "Analysis": {
+ "members": {
+ "notYetComplete": {},
+ "complete": {}
+ }
+ }
+ }
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 8,
+ "collections": {
+ "itemsNotYetComplete": {},
+ "itemsComplete": {
+ "actions": {
+ "deleteCompleted": {}
+ }
+ }
+ }
+ }
+ ],
+ "actions": {
+ "downloadLayout": {},
+ "refreshLayout": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
new file mode 100644
index 0000000..c22ab2b
Binary files /dev/null and b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
new file mode 100644
index 0000000..baf5bac
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
@@ -0,0 +1,137 @@
+/*
+ * 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 app;
+
+import app.ToDoItemAnalysis.DateRange;
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+
+import java.util.List;
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.joda.time.DateTime;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.CollectionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.RenderType;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.services.clock.ClockService;
+import org.apache.isis.applib.util.ObjectContracts;
+
+@DomainObjectLayout(
+ named="By Date Range",
+ bookmarking = BookmarkPolicy.AS_ROOT
+)
+@DomainObject(
+ nature = Nature.VIEW_MODEL
+)
+public class ToDoItemsByDateRangeViewModel
+ implements Comparable<ToDoItemsByDateRangeViewModel> {
+
+ //region > constructors
+ public ToDoItemsByDateRangeViewModel() {
+ }
+ public ToDoItemsByDateRangeViewModel(final DateRange dateRange) {
+ setDateRange(dateRange);
+ }
+ //endregion
+
+ //region > dateRange (property)
+ private DateRange dateRange;
+
+ @Title
+ public DateRange getDateRange() {
+ return dateRange;
+ }
+
+ public void setDateRange(final DateRange dateRange) {
+ this.dateRange = dateRange;
+ }
+ //endregion
+
+ //region > count (derived property)
+ public int getCount() {
+ return getItemsNotYetComplete().size();
+ }
+ //endregion
+
+ //region > getItemsNotYetComplete (collection)
+ /**
+ * All those items {@link ToDoItems#notYetComplete() not yet complete}, for this {@link #getDateRange() date range}.
+ */
+ @CollectionLayout(
+ render = RenderType.EAGERLY
+ )
+ public List<ToDoItem> getItemsNotYetComplete() {
+ final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
+ return Lists.newArrayList(Iterables.filter(notYetComplete, thoseInDateRange()));
+ }
+
+ private Predicate<ToDoItem> thoseInDateRange() {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return Objects.equal(dateRangeFor(t), getDateRange());
+ }
+ };
+ }
+
+ private DateRange dateRangeFor(final ToDoItem t) {
+ if(t.getDueBy() == null) {
+ return DateRange.Unknown;
+ }
+ final DateTime dueBy = t.getDueBy().toDateTimeAtStartOfDay();
+ final DateTime today = clockService.now().toDateTimeAtStartOfDay();
+
+ if(dueBy.isBefore(today)) {
+ return DateRange.OverDue;
+ }
+ if(dueBy.isBefore(today.plusDays(1))) {
+ return DateRange.Today;
+ }
+ if(dueBy.isBefore(today.plusDays(2))) {
+ return DateRange.Tomorrow;
+ }
+ if(dueBy.isBefore(today.plusDays(7))) {
+ return DateRange.ThisWeek;
+ }
+ return DateRange.Later;
+ }
+ //endregion
+
+ //region > compareTo
+ @Override
+ public int compareTo(final ToDoItemsByDateRangeViewModel other) {
+ return ObjectContracts.compare(this, other, "dateRange");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ private ClockService clockService;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
new file mode 100644
index 0000000..648e146
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
@@ -0,0 +1,33 @@
+{
+ "columns": [
+ {
+ "span": 4,
+ "memberGroups": {
+ "General": {
+ "members": {
+ "dateRange": {},
+ "count": {}
+ }
+ }
+ }
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 8,
+ "collections": {
+ "itemsNotYetComplete": {}
+ }
+ }
+ ],
+ "actions": {
+ "downloadLayout": {},
+ "refreshLayout": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
new file mode 100644
index 0000000..034a1f9
Binary files /dev/null and b/mothballed/example/application/todoapp/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java
new file mode 100644
index 0000000..fabbc9b
--- /dev/null
+++ b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/Categorized.java
@@ -0,0 +1,32 @@
+/*
+ * 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 dom.todo;
+
+/**
+ * Enables {@link dom.todo.ToDoItemContributions#updateCategory(dom.todo.Categorized, dom.todo.ToDoItem.Category, dom.todo.ToDoItem.Subcategory)} to be contributed to
+ * both the {@link dom.todo.ToDoItem} (entity) and also the {@link app.ToDoItemWizard} (wizard).
+ */
+public interface Categorized {
+
+ ToDoItem.Category getCategory();
+ void setCategory(ToDoItem.Category category);
+
+ ToDoItem.Subcategory getSubcategory();
+ void setSubcategory(ToDoItem.Subcategory subcategory);
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png
new file mode 100644
index 0000000..b0fc6e8
Binary files /dev/null and b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-done.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png
new file mode 100644
index 0000000..99a9fed
Binary files /dev/null and b/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem-todo.png differ
[06/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
new file mode 100644
index 0000000..7c528ac
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
@@ -0,0 +1,140 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package app;
+
+import app.ToDoItemAnalysis.DateRange;
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+
+import java.util.List;
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import org.joda.time.DateTime;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.CollectionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.RenderType;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.services.clock.ClockService;
+import org.apache.isis.applib.util.ObjectContracts;
+
+@DomainObjectLayout(
+ named="By Date Range",
+ bookmarking = BookmarkPolicy.AS_ROOT
+)
+@DomainObject(
+ nature = Nature.VIEW_MODEL
+)
+public class ToDoItemsByDateRangeViewModel
+ implements Comparable<ToDoItemsByDateRangeViewModel> {
+
+ //region > constructors
+ public ToDoItemsByDateRangeViewModel() {
+ }
+ public ToDoItemsByDateRangeViewModel(final DateRange dateRange) {
+ setDateRange(dateRange);
+ }
+ //endregion
+
+ //region > dateRange (property)
+ private DateRange dateRange;
+
+ @Title
+ public DateRange getDateRange() {
+ return dateRange;
+ }
+
+ public void setDateRange(final DateRange dateRange) {
+ this.dateRange = dateRange;
+ }
+ //endregion
+
+ //region > count (derived property)
+ public int getCount() {
+ return getItemsNotYetComplete().size();
+ }
+ //endregion
+
+ //region > getItemsNotYetComplete (collection)
+ /**
+ * All those items {@link ToDoItems${symbol_pound}notYetComplete() not yet complete}, for this {@link ${symbol_pound}getDateRange() date range}.
+ */
+ @CollectionLayout(
+ render = RenderType.EAGERLY
+ )
+ public List<ToDoItem> getItemsNotYetComplete() {
+ final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
+ return Lists.newArrayList(Iterables.filter(notYetComplete, thoseInDateRange()));
+ }
+
+ private Predicate<ToDoItem> thoseInDateRange() {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return Objects.equal(dateRangeFor(t), getDateRange());
+ }
+ };
+ }
+
+ private DateRange dateRangeFor(final ToDoItem t) {
+ if(t.getDueBy() == null) {
+ return DateRange.Unknown;
+ }
+ final DateTime dueBy = t.getDueBy().toDateTimeAtStartOfDay();
+ final DateTime today = clockService.now().toDateTimeAtStartOfDay();
+
+ if(dueBy.isBefore(today)) {
+ return DateRange.OverDue;
+ }
+ if(dueBy.isBefore(today.plusDays(1))) {
+ return DateRange.Today;
+ }
+ if(dueBy.isBefore(today.plusDays(2))) {
+ return DateRange.Tomorrow;
+ }
+ if(dueBy.isBefore(today.plusDays(7))) {
+ return DateRange.ThisWeek;
+ }
+ return DateRange.Later;
+ }
+ //endregion
+
+ //region > compareTo
+ @Override
+ public int compareTo(final ToDoItemsByDateRangeViewModel other) {
+ return ObjectContracts.compare(this, other, "dateRange");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ private ClockService clockService;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
new file mode 100644
index 0000000..648e146
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.layout.json
@@ -0,0 +1,33 @@
+{
+ "columns": [
+ {
+ "span": 4,
+ "memberGroups": {
+ "General": {
+ "members": {
+ "dateRange": {},
+ "count": {}
+ }
+ }
+ }
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 0,
+ "memberGroups": {}
+ },
+ {
+ "span": 8,
+ "collections": {
+ "itemsNotYetComplete": {}
+ }
+ }
+ ],
+ "actions": {
+ "downloadLayout": {},
+ "refreshLayout": {}
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png
new file mode 100644
index 0000000..034a1f9
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
new file mode 100644
index 0000000..9bb6bad
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
@@ -0,0 +1,35 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dom.todo;
+
+/**
+ * Enables {@link dom.todo.ToDoItemContributions${symbol_pound}updateCategory(dom.todo.Categorized, dom.todo.ToDoItem.Category, dom.todo.ToDoItem.Subcategory)} to be contributed to
+ * both the {@link dom.todo.ToDoItem} (entity) and also the {@link app.ToDoItemWizard} (wizard).
+ */
+public interface Categorized {
+
+ ToDoItem.Category getCategory();
+ void setCategory(ToDoItem.Category category);
+
+ ToDoItem.Subcategory getSubcategory();
+ void setSubcategory(ToDoItem.Subcategory subcategory);
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png
new file mode 100644
index 0000000..b0fc6e8
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-done.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png
new file mode 100644
index 0000000..99a9fed
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem-todo.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
new file mode 100644
index 0000000..cadc117
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
@@ -0,0 +1,982 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dom.todo;
+
+import java.math.BigDecimal;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import javax.jdo.JDOHelper;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.VersionStrategy;
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Ordering;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.applib.annotation.CollectionLayout;
+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.RestrictTo;
+import org.apache.isis.applib.annotation.InvokeOn;
+import org.apache.isis.applib.annotation.InvokedOn;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.security.UserMemento;
+import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.applib.services.scratchpad.Scratchpad;
+import org.apache.isis.applib.services.wrapper.HiddenException;
+import org.apache.isis.applib.services.wrapper.WrapperFactory;
+import org.apache.isis.applib.util.ObjectContracts;
+import org.apache.isis.applib.util.TitleBuffer;
+import org.apache.isis.applib.value.Blob;
+import org.apache.isis.applib.value.Clob;
+
+@javax.jdo.annotations.PersistenceCapable(identityType=IdentityType.DATASTORE)
+@javax.jdo.annotations.DatastoreIdentity(
+ strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
+ column="id")
+@javax.jdo.annotations.Version(
+ strategy=VersionStrategy.VERSION_NUMBER,
+ column="version")
+@javax.jdo.annotations.Uniques({
+ @javax.jdo.annotations.Unique(
+ name="ToDoItem_description_must_be_unique",
+ members={"ownedBy","description"})
+})
+@javax.jdo.annotations.Queries( {
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedBy", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndCompleteIsFalse", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy "
+ + " && complete == false"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndCompleteIsTrue", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy "
+ + "&& complete == true"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndCategory", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy "
+ + "&& category == :category"),
+ @javax.jdo.annotations.Query(
+ name = "findByOwnedByAndDescriptionContains", language = "JDOQL",
+ value = "SELECT "
+ + "FROM dom.todo.ToDoItem "
+ + "WHERE ownedBy == :ownedBy && "
+ + "description.indexOf(:description) >= 0")
+})
+@DomainObject(
+ autoCompleteRepository = ToDoItems.class, // for drop-downs, unless autoCompleteNXxx() is present
+ autoCompleteAction = "autoComplete",
+ // bounded = true, // for drop-downs if only a small number of instances only (overrides autoComplete)
+ objectType = "TODO"
+)
+@DomainObjectLayout(
+ bookmarking = BookmarkPolicy.AS_ROOT
+)
+public class ToDoItem implements Categorized, Comparable<ToDoItem> {
+
+ //region > LOG
+ /**
+ * It isn't common for entities to log, but they can if required.
+ * Isis uses slf4j API internally (with log4j as implementation), and is the recommended API to use.
+ */
+ private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItem.class);
+ //endregion
+
+ // region > title, icon
+ public String title() {
+ final TitleBuffer buf = new TitleBuffer();
+ buf.append(getDescription());
+ if (isComplete()) {
+ buf.append("- Completed!");
+ } else {
+ try {
+ final LocalDate dueBy = wrapperFactory.wrap(this).getDueBy();
+ if (dueBy != null) {
+ buf.append(" due by", dueBy);
+ }
+ } catch(final HiddenException ignored) {
+ }
+ }
+ return buf.toString();
+ }
+
+ public String iconName() {
+ return !isComplete() ? "todo" : "done";
+ }
+
+ public String cssClass() { return iconName(); }
+
+ //endregion
+
+ //region > description (property)
+ private String description;
+
+ @javax.jdo.annotations.Column(allowsNull="false", length=100)
+ @Property(
+ regexPattern = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*"
+ )
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(final String description) {
+ this.description = description;
+ }
+ public void modifyDescription(final String description) {
+ setDescription(description);
+ }
+ public void clearDescription() {
+ setDescription(null);
+ }
+ //endregion
+
+ //region > dueBy (property)
+ @javax.jdo.annotations.Persistent(defaultFetchGroup="true")
+ private LocalDate dueBy;
+
+ @javax.jdo.annotations.Column(allowsNull="true")
+ public LocalDate getDueBy() {
+ 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");
+ }
+
+ public void setDueBy(final LocalDate dueBy) {
+ this.dueBy = dueBy;
+ }
+ public void clearDueBy() {
+ setDueBy(null);
+ }
+ // proposed new value is validated before setting
+ public String validateDueBy(final LocalDate dueBy) {
+ if (dueBy == null) {
+ return null;
+ }
+ return toDoItems.validateDueBy(dueBy);
+ }
+ //endregion
+
+ //region > category and subcategory (property)
+
+ public static enum Category {
+ Professional {
+ @Override
+ public List<Subcategory> subcategories() {
+ return Arrays.asList(null, Subcategory.OpenSource, Subcategory.Consulting, Subcategory.Education, Subcategory.Marketing);
+ }
+ }, Domestic {
+ @Override
+ public List<Subcategory> subcategories() {
+ return Arrays.asList(null, Subcategory.Shopping, Subcategory.Housework, Subcategory.Garden, Subcategory.Chores);
+ }
+ }, Other {
+ @Override
+ public List<Subcategory> subcategories() {
+ return Arrays.asList(null, Subcategory.Other);
+ }
+ };
+
+ public abstract List<Subcategory> subcategories();
+ }
+
+ public static enum Subcategory {
+ // professional
+ OpenSource, Consulting, Education, Marketing,
+ // domestic
+ Shopping, Housework, Garden, Chores,
+ // other
+ Other;
+
+ public static List<Subcategory> listFor(final Category category) {
+ return category != null? category.subcategories(): Collections.<Subcategory>emptyList();
+ }
+
+ static String validate(final Category category, final Subcategory subcategory) {
+ if(category == null) {
+ return "Enter category first";
+ }
+ return !category.subcategories().contains(subcategory)
+ ? "Invalid subcategory for category '" + category + "'"
+ : null;
+ }
+
+ public static Predicate<Subcategory> thoseFor(final Category category) {
+ return new Predicate<Subcategory>() {
+
+ @Override
+ public boolean apply(final Subcategory subcategory) {
+ return category.subcategories().contains(subcategory);
+ }
+ };
+ }
+ }
+
+ // //////////////////////////////////////
+
+ private Category category;
+
+ @javax.jdo.annotations.Column(allowsNull="false")
+ @Property(
+ editing = Editing.DISABLED,
+ editingDisabledReason = "Use action to update both category and subcategory"
+ )
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(final Category category) {
+ this.category = category;
+ }
+
+ // //////////////////////////////////////
+
+ private Subcategory subcategory;
+
+ @javax.jdo.annotations.Column(allowsNull="true")
+ @Property(
+ editing = Editing.DISABLED,
+ editingDisabledReason = "Use action to update both category and subcategory"
+ )
+ public Subcategory getSubcategory() {
+ return subcategory;
+ }
+ public void setSubcategory(final Subcategory subcategory) {
+ this.subcategory = subcategory;
+ }
+ //endregion
+
+ //region > ownedBy (property)
+
+ private String ownedBy;
+
+ @javax.jdo.annotations.Column(allowsNull="false")
+ public String getOwnedBy() {
+ return ownedBy;
+ }
+
+ public void setOwnedBy(final String ownedBy) {
+ this.ownedBy = ownedBy;
+ }
+ //endregion
+
+ //region > complete (property), completed (action), notYetCompleted (action)
+
+ private boolean complete;
+
+ @Property(
+ editing = Editing.DISABLED
+ )
+ public boolean isComplete() {
+ return complete;
+ }
+
+ public void setComplete(final boolean complete) {
+ this.complete = complete;
+ }
+
+ @Action(
+ domainEvent =CompletedEvent.class,
+ invokeOn = InvokeOn.OBJECT_AND_COLLECTION
+ )
+ public ToDoItem completed() {
+ setComplete(true);
+
+ //
+ // remainder of method just demonstrates the use of the Bulk.InteractionContext service
+ //
+ @SuppressWarnings("unused")
+ final List<Object> allObjects = actionInvocationContext.getDomainObjects();
+
+ LOG.debug("completed: "
+ + actionInvocationContext.getIndex() +
+ " [" + actionInvocationContext.getSize() + "]"
+ + (actionInvocationContext.isFirst() ? " (first)" : "")
+ + (actionInvocationContext.isLast() ? " (last)" : ""));
+
+ // if invoked as a regular action, return this object;
+ // otherwise (if invoked as bulk), return null (so go back to the list)
+ return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT? this: null;
+ }
+ // disable action dependent on state of object
+ public String disableCompleted() {
+ return isComplete() ? "Already completed" : null;
+ }
+
+ @Action(
+ invokeOn = InvokeOn.OBJECT_AND_COLLECTION
+ )
+ public ToDoItem notYetCompleted() {
+ setComplete(false);
+
+ // if invoked as a regular action, return this object;
+ // otherwise (if invoked as bulk), return null (so go back to the list)
+ return actionInvocationContext.getInvokedOn() == InvokedOn.OBJECT ? this: null;
+ }
+ // disable action dependent on state of object
+ public String disableNotYetCompleted() {
+ return !complete ? "Not yet completed" : null;
+ }
+ //endregion
+
+ //region > completeSlowly (property)
+ // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ @Action(
+ hidden = Where.EVERYWHERE
+ )
+ public void completeSlowly(final int millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (final InterruptedException ignored) {
+ }
+ setComplete(true);
+ }
+ //endregion
+
+ //region > cost (property), updateCost (action)
+ private BigDecimal cost;
+
+ @javax.jdo.annotations.Column(allowsNull="true", scale=2)
+ @javax.validation.constraints.Digits(integer=10, fraction=2)
+ @Property(
+ editing = Editing.DISABLED,
+ editingDisabledReason = "Update using action"
+ )
+ public BigDecimal getCost() {
+ return cost;
+ }
+
+ public void setCost(final BigDecimal cost) {
+ this.cost = cost!=null?cost.setScale(2, BigDecimal.ROUND_HALF_EVEN):null;
+ }
+
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT
+ )
+ public ToDoItem updateCost(
+ @Parameter(optional = Optionality.TRUE)
+ @ParameterLayout(named = "New cost")
+ @javax.validation.constraints.Digits(integer=10, fraction=2)
+ final BigDecimal cost) {
+ LOG.debug("%s: cost updated: %s -> %s", container.titleOf(this), getCost(), cost);
+
+ // just to simulate a long-running action
+ try {
+ Thread.sleep(3000);
+ } catch (final InterruptedException ignored) {
+ }
+
+ setCost(cost);
+ return this;
+ }
+
+ // provide a default value for argument ${symbol_pound}0
+ public BigDecimal default0UpdateCost() {
+ return getCost();
+ }
+
+ // validate action arguments
+ public String validateUpdateCost(final BigDecimal proposedCost) {
+ if(proposedCost == null) { return null; }
+ return proposedCost.compareTo(BigDecimal.ZERO) < 0? "Cost must be positive": null;
+ }
+ //endregion
+
+ //region > notes (property)
+ private String notes;
+
+ @javax.jdo.annotations.Column(allowsNull="true", length=400)
+ public String getNotes() {
+ return notes;
+ }
+
+ public void setNotes(final String notes) {
+ this.notes = notes;
+ }
+ //endregion
+
+ //region > attachment (property)
+ private Blob attachment;
+ @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
+ @javax.jdo.annotations.Column(name = "attachment_name"),
+ @javax.jdo.annotations.Column(name = "attachment_mimetype"),
+ @javax.jdo.annotations.Column(name = "attachment_bytes", jdbcType = "BLOB", sqlType = "BLOB")
+ })
+ @Property(
+ optional = Optionality.TRUE
+ )
+ public Blob getAttachment() {
+ return attachment;
+ }
+
+ public void setAttachment(final Blob attachment) {
+ this.attachment = attachment;
+ }
+ //endregion
+
+ //region > doc (property)
+ private Clob doc;
+ @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
+ @javax.jdo.annotations.Column(name = "doc_name"),
+ @javax.jdo.annotations.Column(name = "doc_mimetype"),
+ @javax.jdo.annotations.Column(name = "doc_chars", jdbcType = "CLOB", sqlType = "CLOB")
+ })
+ @Property(
+ optional = Optionality.TRUE
+ )
+ public Clob getDoc() {
+ return doc;
+ }
+
+ public void setDoc(final Clob doc) {
+ this.doc = doc;
+ }
+ //endregion
+
+ //region > version (derived property)
+ public Long getVersionSequence() {
+ if(!(this instanceof javax.jdo.spi.PersistenceCapable)) {
+ return null;
+ }
+ return (Long) JDOHelper.getVersion((javax.jdo.spi.PersistenceCapable) this);
+ }
+ // hide property (imperatively, based on state of object)
+ public boolean hideVersionSequence() {
+ return !(this instanceof javax.jdo.spi.PersistenceCapable);
+ }
+ //endregion
+
+ //region > dependencies (property), add (action), remove (action)
+
+ // overrides the natural ordering
+ public static class DependenciesComparator implements Comparator<ToDoItem> {
+ @Override
+ public int compare(final ToDoItem p, final ToDoItem q) {
+ final Ordering<ToDoItem> byDescription = new Ordering<ToDoItem>() {
+ public int compare(final ToDoItem p, final ToDoItem q) {
+ return Ordering.natural().nullsFirst().compare(p.getDescription(), q.getDescription());
+ }
+ };
+ return byDescription
+ .compound(Ordering.<ToDoItem>natural())
+ .compare(p, q);
+ }
+ }
+
+ @javax.jdo.annotations.Persistent(table="ToDoItemDependencies")
+ @javax.jdo.annotations.Join(column="dependingId")
+ @javax.jdo.annotations.Element(column="dependentId")
+
+ private Set<ToDoItem> dependencies = new TreeSet<>();
+ //private SortedSet<ToDoItem> dependencies = new TreeSet<>(); // not compatible with neo4j (as of DN v3.2.3)
+
+ @Collection()
+ @CollectionLayout(/*sortedBy = DependenciesComparator.class*/) // not compatible with neo4j (as of DN v3.2.3)
+ public Set<ToDoItem> getDependencies() {
+ return dependencies;
+ }
+
+ public void setDependencies(final Set<ToDoItem> dependencies) {
+ this.dependencies = dependencies;
+ }
+
+ public void addToDependencies(final ToDoItem toDoItem) {
+ getDependencies().add(toDoItem);
+ }
+ public void removeFromDependencies(final ToDoItem toDoItem) {
+ getDependencies().remove(toDoItem);
+ }
+
+ public ToDoItem add(
+ @ParameterLayout(typicalLength = 20)
+ final ToDoItem toDoItem) {
+ // By wrapping the call, Isis will detect that the collection is modified
+ // and it will automatically send CollectionInteractionEvents to the Event Bus.
+ // ToDoItemSubscriptions is a demo subscriber to this event
+ wrapperFactory.wrapSkipRules(this).addToDependencies(toDoItem);
+ return this;
+ }
+ public List<ToDoItem> autoComplete0Add(
+ @Parameter(minLength = 2)
+ final String search) {
+ final List<ToDoItem> list = toDoItems.autoComplete(search);
+ list.removeAll(getDependencies());
+ list.remove(this);
+ return list;
+ }
+
+ public String disableAdd(final ToDoItem toDoItem) {
+ if(isComplete()) {
+ return "Cannot add dependencies for items that are complete";
+ }
+ return null;
+ }
+ // validate the provided argument prior to invoking action
+ public String validateAdd(final ToDoItem toDoItem) {
+ if(getDependencies().contains(toDoItem)) {
+ return "Already a dependency";
+ }
+ if(toDoItem == this) {
+ return "Can't set up a dependency to self";
+ }
+ return null;
+ }
+
+ public ToDoItem remove(
+ @ParameterLayout(typicalLength = 20)
+ final ToDoItem toDoItem) {
+ // By wrapping the call, Isis will detect that the collection is modified
+ // and it will automatically send a CollectionInteractionEvent to the Event Bus.
+ // ToDoItemSubscriptions is a demo subscriber to this event
+ wrapperFactory.wrapSkipRules(this).removeFromDependencies(toDoItem);
+ return this;
+ }
+ // disable action dependent on state of object
+ public String disableRemove(final ToDoItem toDoItem) {
+ if(isComplete()) {
+ return "Cannot remove dependencies for items that are complete";
+ }
+ return getDependencies().isEmpty()? "No dependencies to remove": null;
+ }
+ // validate the provided argument prior to invoking action
+ public String validateRemove(final ToDoItem toDoItem) {
+ if(!getDependencies().contains(toDoItem)) {
+ return "Not a dependency";
+ }
+ return null;
+ }
+ // provide a drop-down
+ public java.util.Collection<ToDoItem> choices0Remove() {
+ return getDependencies();
+ }
+ //endregion
+
+ //region > clone (action)
+
+ // the name of the action in the UI
+ // nb: method is not called "clone()" is inherited by java.lang.Object and
+ // (a) has different semantics and (b) is in any case automatically ignored
+ // by the framework
+ public ToDoItem duplicate(
+ @Parameter(regexPattern = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*" )
+ @ParameterLayout(named="Description")
+ final String description,
+ @ParameterLayout(named="Category")
+ final Category category,
+ @ParameterLayout(named="Subcategory")
+ final Subcategory subcategory,
+ @Parameter(optional = Optionality.TRUE)
+ @ParameterLayout(named="Due by")
+ final LocalDate dueBy,
+ @Parameter(optional = Optionality.TRUE)
+ @ParameterLayout(named="Cost")
+ final BigDecimal cost) {
+ return toDoItems.newToDo(description, category, subcategory, dueBy, cost);
+ }
+ public String default0Duplicate() {
+ return getDescription() + " - Copy";
+ }
+ public Category default1Duplicate() {
+ return getCategory();
+ }
+ public Subcategory default2Duplicate() {
+ return getSubcategory();
+ }
+ public LocalDate default3Duplicate() {
+ return getDueBy();
+ }
+ public List<Subcategory> choices2Duplicate(
+ final String description, final Category category) {
+ return toDoItems.choices2NewToDo(description, category);
+ }
+ public String validateDuplicate(
+ final String description,
+ final Category category, final Subcategory subcategory,
+ final LocalDate dueBy, final BigDecimal cost) {
+ return toDoItems.validateNewToDo(description, category, subcategory, dueBy, cost);
+ }
+ //endregion
+
+ //region > delete (action)
+ @Action(
+ domainEvent =DeletedEvent.class,
+ invokeOn = InvokeOn.OBJECT_AND_COLLECTION
+ )
+ public List<ToDoItem> delete() {
+
+ container.removeIfNotAlready(this);
+
+ container.informUser("Deleted " + container.titleOf(this));
+
+ // invalid to return 'this' (cannot render a deleted object)
+ return toDoItems.notYetComplete();
+ }
+ //endregion
+
+ //region > totalCost (property)
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ invokeOn = InvokeOn.COLLECTION_ONLY
+ )
+ public BigDecimal totalCost() {
+ BigDecimal total = (BigDecimal) scratchpad.get("runningTotal");
+ if(getCost() != null) {
+ total = total != null ? total.add(getCost()) : getCost();
+ scratchpad.put("runningTotal", total);
+ }
+ return total.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ }
+ //endregion
+
+ //region > openSourceCodeOnGithub (action)
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ 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");
+ }
+ //endregion
+
+ //region > demoException (action)
+
+ static enum DemoExceptionType {
+ RecoverableException,
+ RecoverableExceptionAutoEscalated,
+ NonRecoverableException;
+ }
+
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ public void demoException(
+ @ParameterLayout(named="Type")
+ final DemoExceptionType type) {
+ switch(type) {
+ case NonRecoverableException:
+ throw new NonRecoverableException("Demo throwing " + type.name());
+ case RecoverableException:
+ throw new RecoverableException("Demo throwing " + type.name());
+ case RecoverableExceptionAutoEscalated:
+ try {
+ // this will trigger an exception (because category cannot be null), causing the xactn to be aborted
+ setCategory(null);
+ container.flush();
+ } catch(Exception e) {
+ // it's a programming mistake to throw only a recoverable exception here, because of the xactn's state.
+ // the framework should instead auto-escalate this to a non-recoverable exception
+ throw new RecoverableException("Demo throwing " + type.name(), e);
+ }
+ }
+ }
+ //endregion
+
+ //region > lifecycle callbacks
+
+ public void created() {
+ LOG.debug("lifecycle callback: created: " + this.toString());
+ }
+ public void loaded() {
+ LOG.debug("lifecycle callback: loaded: " + this.toString());
+ }
+ public void persisting() {
+ LOG.debug("lifecycle callback: persisting: " + this.toString());
+ }
+ public void persisted() {
+ LOG.debug("lifecycle callback: persisted: " + this.toString());
+ }
+ public void updating() {
+ LOG.debug("lifecycle callback: updating: " + this.toString());
+ }
+ public void updated() {
+ LOG.debug("lifecycle callback: updated: " + this.toString());
+ }
+ public void removing() {
+ LOG.debug("lifecycle callback: removing: " + this.toString());
+ }
+ public void removed() {
+ LOG.debug("lifecycle callback: removed: " + this.toString());
+ }
+ //endregion
+
+ //region > object-level validation
+
+ /**
+ * Prevent user from viewing another user's data.
+ */
+ public boolean hidden() {
+ // uncomment to enable. As things stand, the disabled() method below instead will make object "read-only".
+ //return !Objects.equal(getOwnedBy(), container.getUser().getName());
+ return false;
+ }
+
+ /**
+ * Prevent user from modifying any other user's data.
+ */
+ public String disabled(final Identifier.Type identifierType){
+ final UserMemento currentUser = container.getUser();
+ final String currentUserName = currentUser.getName();
+ if(Objects.equal(getOwnedBy(), currentUserName)) { return null; }
+ return "This object is owned by '" + getOwnedBy() + "' and cannot be modified by you";
+ }
+
+ /**
+ * In a real app, if this were actually a rule, then we'd expect that
+ * invoking the {@link ${symbol_pound}completed() done} action would clear the {@link ${symbol_pound}getDueBy() dueBy}
+ * property (rather than require the user to have to clear manually).
+ */
+ public String validate() {
+ if(isComplete() && getDueBy() != null) {
+ return "Due by date must be set to null if item has been completed";
+ }
+ return null;
+ }
+
+
+ //endregion
+
+
+ //region > programmatic helpers
+ @Programmatic // excluded from the framework's metamodel
+ public boolean isDue() {
+ if (getDueBy() == null) {
+ return false;
+ }
+ return !toDoItems.isMoreThanOneWeekInPast(getDueBy());
+ }
+ //endregion
+
+ //region > events
+
+ public static abstract class AbstractActionDomainEvent extends ActionDomainEvent<ToDoItem> {
+ private static final long serialVersionUID = 1L;
+ private final String description;
+ public AbstractActionDomainEvent(
+ final String description,
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super(source, identifier, arguments);
+ this.description = description;
+ }
+ public String getEventDescription() {
+ return description;
+ }
+ }
+
+ public static class CompletedEvent extends AbstractActionDomainEvent {
+ private static final long serialVersionUID = 1L;
+ public CompletedEvent(
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super("completed", source, identifier, arguments);
+ }
+ }
+
+ public static class NoLongerCompletedEvent extends AbstractActionDomainEvent {
+ private static final long serialVersionUID = 1L;
+ public NoLongerCompletedEvent(
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super("no longer completed", source, identifier, arguments);
+ }
+ }
+
+ public static class DeletedEvent extends AbstractActionDomainEvent {
+ private static final long serialVersionUID = 1L;
+ public DeletedEvent(
+ final ToDoItem source,
+ final Identifier identifier,
+ final Object... arguments) {
+ super("deleted", source, identifier, arguments);
+ }
+ }
+
+ //endregion
+
+ //region > predicates
+
+ public static class Predicates {
+
+ public static Predicate<ToDoItem> thoseOwnedBy(final String currentUser) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem toDoItem) {
+ return Objects.equal(toDoItem.getOwnedBy(), currentUser);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseCompleted(
+ final boolean completed) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return Objects.equal(t.isComplete(), completed);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseWithSimilarDescription(final String description) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return t.getDescription().contains(description);
+ }
+ };
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Predicate<ToDoItem> thoseSimilarTo(final ToDoItem toDoItem) {
+ return com.google.common.base.Predicates.and(
+ thoseNot(toDoItem),
+ thoseOwnedBy(toDoItem.getOwnedBy()),
+ thoseCategorised(toDoItem.getCategory()));
+ }
+
+ public static Predicate<ToDoItem> thoseNot(final ToDoItem toDoItem) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return t != toDoItem;
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseCategorised(final Category category) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem toDoItem) {
+ return Objects.equal(toDoItem.getCategory(), category);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseSubcategorised(
+ final Subcategory subcategory) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(final ToDoItem t) {
+ return Objects.equal(t.getSubcategory(), subcategory);
+ }
+ };
+ }
+
+ public static Predicate<ToDoItem> thoseCategorised(
+ final Category category, final Subcategory subcategory) {
+ return com.google.common.base.Predicates.and(
+ thoseCategorised(category),
+ thoseSubcategorised(subcategory));
+ }
+
+ }
+
+ //endregion
+
+ //region > toString, compareTo
+ @Override
+ public String toString() {
+ return ObjectContracts.toString(this, "description,complete,dueBy,ownedBy");
+ }
+
+ /**
+ * Required so can store in {@link SortedSet sorted set}s (eg {@link ${symbol_pound}getDependencies()}).
+ */
+ @Override
+ public int compareTo(final ToDoItem other) {
+ return ObjectContracts.compare(this, other, "complete,dueBy,description");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ DomainObjectContainer container;
+
+ @javax.inject.Inject
+ ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ Scratchpad scratchpad;
+
+ /**
+ * public only so can be injected from integ tests
+ */
+ @javax.inject.Inject
+ public ActionInvocationContext actionInvocationContext;
+
+ /**
+ * public only so can be injected from integ tests
+ */
+ @javax.inject.Inject
+ public EventBusService eventBusService;
+
+ @javax.inject.Inject
+ WrapperFactory wrapperFactory;
+
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
new file mode 100644
index 0000000..cda5fdc
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
@@ -0,0 +1,222 @@
+/**
+ * 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.
+ */
+{
+ "columns": [
+ {
+ "span": 6,
+ "memberGroups": {
+ "General": {
+ "members": {
+ "description": {
+ "propertyLayout": {
+ "cssClass": "x-key",
+ "labelPosition": "TOP"
+ }
+ },
+ "category": {
+ "propertyLayout": {
+ "labelPosition": "TOP"
+ }
+ },
+ "subcategory": {
+ "propertyLayout": {
+ "labelPosition": "NONE"
+ },
+ "actions": {
+ "updateCategory": {
+ "actionLayout": {
+ "named": "Update"
+ }
+ },
+ "analyseCategory": {
+ "actionLayout": {
+ "cssClass": "btn-default",
+ "cssClassFa": "fa fa-pie-chart"
+ }
+ }
+ }
+ },
+ "ownedBy": {
+ "propertyLayout": {
+ "hidden": "EVERYWHERE"
+ }
+ },
+ "complete": {
+ "propertyLayout": {
+ "named": "Whether this todo item has been <i>completed</i> or not.",
+ "namedEscaped": false,
+ "describedAs": "Whether this todo item has been completed, or not.",
+ "labelPosition": "LEFT"
+ },
+ "actions": {
+ "completed": {
+ "actionLayout": {
+ "named": "Done",
+ "describedAs": "Update this todo item as complete",
+ "cssClass": "btn-success",
+ "cssClassFa": "fa fa-thumbs-up"
+ }
+ },
+ "notYetCompleted": {
+ "actionLayout": {
+ "named": "Not done",
+ "describedAs": "Update this todo item as not yet complete",
+ "cssClass": "btn-info",
+ "cssClassFa": "fa fa-thumbs-down"
+ }
+ },
+ "scheduleExplicitly": {
+ },
+ "scheduleImplicitly": {
+ }
+ }
+ }
+ }
+ },
+ "Misc": {
+ "members": {
+ "versionSequence": {
+ "propertyLayout": {
+ "named": "Version",
+ "hidden": "ALL_TABLES"
+ },
+ "disabled": {}
+ }
+ }
+ }
+ }
+ },
+ {
+ "span": 6,
+ "memberGroups": {
+ "Priority": {
+ "members": {
+ "relativePriority": {
+ "actions": {
+ "previous": {
+ "actionLayout": {
+ "cssClassFa": "fa fa-step-backward"
+ }
+ },
+ "next": {
+ "actionLayout": {
+ "cssClassFa": "fa fa-step-forward",
+ "cssClassFaPosition": "right"
+ }
+ }
+ }
+ },
+ "dueBy": {
+ "propertyLayout": {
+ "renderedAsDayBefore": "false"
+ }
+ }
+ }
+ },
+ "Other": {
+ "members": {
+ "cost": {
+ "actions": {
+ "updateCost":{
+ "actionLayout": {
+ "named": "Update",
+ "cssClassFa": "fa fa-dollar"
+ }
+ }
+ }
+ },
+ "notes": {
+ "propertyLayout": {
+ "hidden": "ALL_TABLES",
+ "labelPosition": "TOP",
+ "multiLine": 5
+ }
+ },
+ "attachment": {
+ "propertyLayout": {
+ "hidden": "STANDALONE_TABLES"
+ }
+ },
+ "doc": {
+ "propertyLayout": {
+ "hidden": "STANDALONE_TABLES"
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "span": 0
+ },
+ {
+ "span": 6,
+ "collections": {
+ "dependencies": {
+ "collectionLayout": {
+ "named": "Todo items that are <i>dependencies</i> of this item.",
+ "namedEscaped": false,
+ "describedAs": "Todo items that must be completed before this one",
+ "paged": 5,
+ "render": "EAGERLY"
+ },
+ "disabled": {},
+ "actions": {
+ "add":{
+ "actionLayout": {
+ "cssClass": "btn-default",
+ "cssClassFa": "fa fa-plus-square"
+ }
+ },
+ "remove": {
+ "actionLayout": {
+ "cssClass": "x-caution btn-default",
+ "cssClassFa": "fa fa-minus-square"
+ }
+ }
+ }
+ },
+ "similarTo": {
+ "collectionLayout": {
+ "named": "Todo items that are <i>similar to</i> this one",
+ "namedEscaped": false,
+ "paged": 3,
+ "render": "LAZILY"
+ },
+ "disabled": {}
+ }
+ }
+ }
+ ],
+ "actions": {
+ "totalCost": {},
+ "delete": {
+ "actionLayout": {
+ "cssClass": "btn btn-danger",
+ "cssClassFa": "fa fa-trash fa-lg"
+ }
+ },
+ "duplicate": {
+ "actionLayout": {
+ "named": "Clone",
+ "describedAs": "Create a new todo item from this one",
+ "cssClass": "btn-warn",
+ "cssClassFa": "fa fa-copy fa-lg"
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png
new file mode 100644
index 0000000..99a9fed
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
new file mode 100644
index 0000000..1d3b870
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
@@ -0,0 +1,51 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dom.todo;
+
+import org.apache.isis.applib.annotation.PublishingChangeKind;
+import org.apache.isis.applib.annotation.PublishingPayloadFactoryForObject;
+import org.apache.isis.applib.services.publish.EventPayload;
+import org.apache.isis.applib.services.publish.EventPayloadForObjectChanged;
+
+public class ToDoItemChangedPayloadFactory implements PublishingPayloadFactoryForObject {
+
+ public static class ToDoItemPayload extends EventPayloadForObjectChanged<ToDoItem> {
+
+ public ToDoItemPayload(ToDoItem changed) {
+ super(changed);
+ }
+
+ /**
+ * Expose the item's {@link ToDoItem${symbol_pound}getDescription() description} more explicitly
+ * in the payload.
+ */
+ public String getDescription() {
+ return getChanged().getDescription();
+ }
+ }
+
+ @Override
+ public EventPayload payloadFor(final Object changedObject, final PublishingChangeKind publishingChangeKind) {
+ return new ToDoItemPayload((ToDoItem) changedObject);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
new file mode 100644
index 0000000..c33097e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
@@ -0,0 +1,274 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dom.todo;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+import java.util.List;
+import java.util.concurrent.Callable;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Ordering;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.AbstractFactoryAndRepository;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Contributed;
+import org.apache.isis.applib.annotation.Disabled;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.Optional;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.query.QueryDefault;
+import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
+import org.apache.isis.applib.value.Clob;
+
+@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
+public class ToDoItemContributions extends AbstractFactoryAndRepository {
+
+ //region > priority (contributed property)
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ hidden = Where.ALL_TABLES
+ )
+ @ActionLayout(
+ describedAs = "The relative priority of this item compared to others not yet complete (using 'due by' date)",
+ contributed = Contributed.AS_ASSOCIATION
+ )
+ @Disabled(reason="Relative priority, derived from due date")
+ public Integer relativePriority(final ToDoItem toDoItem) {
+ return queryResultsCache.execute(new Callable<Integer>(){
+ @Override
+ public Integer call() throws Exception {
+ if(toDoItem.isComplete()) {
+ return null;
+ }
+
+ // sort items, then locate this one
+ int i=1;
+ for (final ToDoItem each : sortedNotYetComplete()) {
+ if(each == toDoItem) {
+ return i;
+ }
+ i++;
+ }
+ return null;
+ }}, ToDoItemContributions.class, "relativePriority", toDoItem);
+ }
+
+ private List<ToDoItem> sortedNotYetComplete() {
+ return ORDERING_DUE_BY
+ .compound(ORDERING_DESCRIPTION)
+ .sortedCopy(toDoItems.notYetComplete());
+ }
+
+ private static final Ordering<ToDoItem> ORDERING_DUE_BY =
+ Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, LocalDate>(){
+ @Override
+ public LocalDate apply(final ToDoItem input) {
+ return input.getDueBy();
+ }
+ });
+
+ private static final Ordering<ToDoItem> ORDERING_DESCRIPTION =
+ Ordering.natural().nullsLast().onResultOf(new Function<ToDoItem, String>(){
+ @Override
+ public String apply(final ToDoItem input) {
+ return input.getDescription();
+ }
+ });
+
+
+ //endregion
+
+ //region > next, previous (contributed actions)
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(
+ describedAs = "The next item not yet completed",
+ contributed = Contributed.AS_ACTION
+ )
+ public ToDoItem next(final ToDoItem item) {
+ final Integer priority = relativePriority(item);
+ if(priority == null) {
+ return item;
+ }
+ int priorityOfNext = priority != null ? priority + 1 : 0;
+ return itemWithPriorityElse(priorityOfNext, item);
+ }
+ public String disableNext(final ToDoItem toDoItem) {
+ if (toDoItem.isComplete()) {
+ return "Completed";
+ }
+ if(next(toDoItem) == null) {
+ return "No next item";
+ }
+ return null;
+ }
+
+ // //////////////////////////////////////
+
+ @ActionLayout(
+ describedAs = "The previous item not yet completed",
+ contributed = Contributed.AS_ACTION
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ public ToDoItem previous(final ToDoItem item) {
+ final Integer priority = relativePriority(item);
+ if(priority == null) {
+ return item;
+ }
+ int priorityOfPrevious = priority != null? priority - 1 : 0;
+ return itemWithPriorityElse(priorityOfPrevious, item);
+ }
+ public String disablePrevious(final ToDoItem toDoItem) {
+ if (toDoItem.isComplete()) {
+ return "Completed";
+ }
+ if(previous(toDoItem) == null) {
+ return "No previous item";
+ }
+ return null;
+ }
+
+ // //////////////////////////////////////
+
+ /**
+ * @param priority : 1-based priority
+ */
+ private ToDoItem itemWithPriorityElse(int priority, final ToDoItem itemElse) {
+ if(priority < 1) {
+ return null;
+ }
+ final List<ToDoItem> items = sortedNotYetComplete();
+ if(priority > items.size()) {
+ return null;
+ }
+ return priority>=0 && items.size()>=priority? items.get(priority-1): itemElse;
+ }
+ //endregion
+
+ //region > similarTo (contributed collection)
+ @ActionLayout(
+ contributed = Contributed.AS_ASSOCIATION
+ )
+ @Action(semantics = SemanticsOf.SAFE)
+ public List<ToDoItem> similarTo(final ToDoItem toDoItem) {
+ final List<ToDoItem> similarToDoItems = allMatches(
+ new QueryDefault<ToDoItem>(ToDoItem.class,
+ "findByOwnedByAndCategory",
+ "ownedBy", currentUserName(),
+ "category", toDoItem.getCategory()));
+ return Lists.newArrayList(Iterables.filter(similarToDoItems, excluding(toDoItem)));
+ }
+
+
+ private static Predicate<ToDoItem> excluding(final ToDoItem toDoItem) {
+ return new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(ToDoItem input) {
+ return input != toDoItem;
+ }
+ };
+ }
+ //endregion
+
+ //region > updateCategory (contributed action)
+
+ @ActionLayout(
+ describedAs = "Update category and subcategory"
+ )
+ @Action(semantics = SemanticsOf.IDEMPOTENT)
+ public Categorized updateCategory(
+ final Categorized item,
+ final @ParameterLayout(named="Category") Category category,
+ final @Optional @ParameterLayout(named="Subcategory") Subcategory subcategory) {
+ item.setCategory(category);
+ item.setSubcategory(subcategory);
+ return item;
+ }
+ public Category default1UpdateCategory(
+ final Categorized item) {
+ return item != null? item.getCategory(): null;
+ }
+ public Subcategory default2UpdateCategory(
+ final Categorized item) {
+ return item != null? item.getSubcategory(): null;
+ }
+
+ public List<Subcategory> choices2UpdateCategory(
+ final Categorized item, final Category category) {
+ return Subcategory.listFor(category);
+ }
+
+ public String validateUpdateCategory(
+ final Categorized item, final Category category, final Subcategory subcategory) {
+ return Subcategory.validate(category, subcategory);
+ }
+ //endregion
+
+ // region > exportAsJson (action)
+ /**
+ * Demonstrates functionality of streaming back Clob/Blob result within an action with a prompt, i.e. Ajax request
+ */
+ @Action(semantics = SemanticsOf.SAFE)
+ public Clob exportAsJson(
+ final ToDoItem toDoItem,
+ @ParameterLayout(named = "File name") String fileName
+ ) {
+ if(!fileName.endsWith(".json")) {
+ fileName += ".json";
+ }
+ return new Clob(
+ fileName,
+ "application/json",
+ "{" +
+ "${symbol_escape}"description${symbol_escape}": ${symbol_escape}"" + toDoItem.getDescription()+"${symbol_escape}"" +
+ ",${symbol_escape}"complete${symbol_escape}": " + ""+toDoItem.isComplete() +
+ "}");
+ }
+
+ public String default1ExportAsJson() {
+ return "todo";
+ }
+ //endregion
+
+
+ //region > helpers
+ protected String currentUserName() {
+ return getContainer().getUser().getName();
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ private QueryResultsCache queryResultsCache;
+ //endregion
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
new file mode 100644
index 0000000..ea76566
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
@@ -0,0 +1,402 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dom.todo;
+
+import java.util.EventObject;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Lists;
+import com.google.common.eventbus.Subscribe;
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
+
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.transform;
+import static com.google.common.collect.Lists.newArrayList;
+
+/**
+ * Subscribes to changes made to the {@link dom.todo.ToDoItem} entity.
+ *
+ * <p>
+ * (For demo purposes) the behaviour can be influenced using {@link ${symbol_pound}subscriberBehaviour(dom.todo.ToDoItemSubscriptions.Behaviour)}.
+ * In particular, the subscriber can be used to hide/disable/validate actions, or just to perform pre- or post-execute
+ * tasks. This also includes being set to throw an exception during the execution of the action (also in effect
+ * vetoing the change).
+ * </p>
+ */
+@DomainService(nature = NatureOfService.VIEW_MENU_ONLY)
+@DomainServiceLayout(menuBar = DomainServiceLayout.MenuBar.SECONDARY, menuOrder = "30")
+public class ToDoItemSubscriptions {
+
+ //region > LOG
+ private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItemSubscriptions.class);
+ //endregion
+
+ //region > postConstruct, preDestroy
+
+ /**
+ * Registers this service with the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
+ *
+ * <p>
+ * Because this service is a singleton, this is called during initial bootstrap.
+ * </p>
+ */
+ @Programmatic
+ @PostConstruct
+ public void postConstruct() {
+ LOG.info("postConstruct: registering to event bus");
+ eventBusService.register(this);
+ }
+
+ /**
+ * Unregisters this service from the {@link org.apache.isis.applib.services.eventbus.EventBusService}.
+ *
+ * <p>
+ * Because this service is a singleton, this is only done when the system is shutdown.
+ * </p>
+ */
+ @Programmatic
+ @PreDestroy
+ public void preDestroy() {
+ LOG.info("preDestroy: unregistering from event bus");
+ eventBusService.unregister(this);
+ }
+ //endregion
+
+
+ //region > on(Event)...
+
+ public static enum Behaviour {
+ AnyExecuteAccept,
+ AnyExecuteVetoWithRecoverableException,
+ AnyExecuteVetoWithNonRecoverableException,
+ AnyExecuteVetoWithOtherException,
+ UpdateCostActionHide,
+ UpdateCostActionDisable,
+ UpdateCostActionInvalidate,
+ DescriptionPropertyHide,
+ DescriptionPropertyDisable,
+ DescriptionPropertyInvalidate,
+ DependenciesCollectionHide,
+ // not implemented in Wicket viewer, but supported in wrapped objects
+ DependenciesCollectionDisable,
+ // not implemented in Wicket viewer, but supported in wrapped objects
+ DependenciesCollectionInvalidateAdd,
+ DependenciesCollectionInvalidateRemove,
+ SimilarToCollectionHide
+ }
+
+ /**
+ * The desired behaviour of this service.
+ */
+ private Behaviour behaviour = Behaviour.AnyExecuteAccept;
+
+ /**
+ * To demo/test what occurs if a subscriber that might veto an event.
+ */
+ @MemberOrder(name = "Prototyping", sequence = "80")
+ @ActionLayout(
+ named="Set subscriber behaviour"
+ )
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ public void subscriberBehaviour(
+ @ParameterLayout(
+ named="Behaviour"
+ )
+ final Behaviour behaviour) {
+ this.behaviour = behaviour;
+ container.informUser("Subscriber behaviour set to: " + behaviour);
+ }
+ public Behaviour default0SubscriberBehaviour() {
+ return this.behaviour;
+ }
+
+ @Programmatic
+ public Behaviour getSubscriberBehaviour() {
+ return behaviour;
+ }
+
+
+ private void onExecutedThrowExceptionIfSet(final ActionDomainEvent<?> ev) {
+ if(ev != null && ev.getSemantics().isSafe()) {
+ return;
+ }
+ onExecutedThrowExceptionIfSet();
+ }
+ private void onExecutedThrowExceptionIfSet(final PropertyDomainEvent<?, ?> ev) {
+ onExecutedThrowExceptionIfSet();
+ }
+ private void onExecutedThrowExceptionIfSet(final CollectionDomainEvent<?, ?> ev) {
+ onExecutedThrowExceptionIfSet();
+ }
+
+
+ private void onExecutedThrowExceptionIfSet() {
+ if(behaviour == Behaviour.AnyExecuteVetoWithRecoverableException) {
+ throw new RecoverableException("Rejecting event (recoverable exception thrown)");
+ }
+ if(behaviour == Behaviour.AnyExecuteVetoWithNonRecoverableException) {
+ throw new NonRecoverableException("Rejecting event (non-recoverable exception thrown)");
+ }
+ if(behaviour == Behaviour.AnyExecuteVetoWithOtherException) {
+ throw new RuntimeException("Throwing some other exception");
+ }
+ }
+ //endregion
+
+ //region > on(Event) for ToDoItem-specific events
+ @Programmatic
+ @Subscribe
+ public void on(final ToDoItem.CompletedEvent ev) {
+ recordEvent(ev);
+ switch(ev.getEventPhase()) {
+ case HIDE:
+ break;
+ case DISABLE:
+ break;
+ case VALIDATE:
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received ToDoItem.CompletedEvent for : " + ev.getSource().toString());
+ break;
+ }
+ }
+ //endregion
+
+ //region > on(Event) ... general purpose
+
+ @Programmatic
+ @Subscribe
+ public void on(final ActionDomainEvent<?> ev) {
+ recordEvent(ev);
+ switch(ev.getEventPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionHide) {
+ if(ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.hide();
+ }
+ }
+ break;
+ case DISABLE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionDisable) {
+ if(ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.disable("ToDoItemSubscriptions says: updateCost action disabled!");
+ }
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionInvalidate &&
+ ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.invalidate("ToDoItemSubscriptions says: can't invoke updateCost action with these args!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received ActionDomainEvent, " + ev.getSource().toString() + ", invoked " + ev.getIdentifier().getMemberName());
+ onExecutedThrowExceptionIfSet(ev);
+ break;
+ }
+ }
+
+ @Programmatic
+ @Subscribe
+ public void on(PropertyDomainEvent<?,?> ev) {
+ recordEvent(ev);
+ switch(ev.getEventPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyHide &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.veto("");
+ }
+ break;
+ case DISABLE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyDisable &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.veto("ToDoItemSubscriptions says: description property disabled!");
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyInvalidate &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.veto("ToDoItemSubscriptions says: can't change description property to this value!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received PropertyDomainEvent, " + ev.getSource().toString() + ", changed " + ev.getIdentifier().getMemberName() + " : " + ev.getOldValue() + " -> " + ev.getNewValue());
+ onExecutedThrowExceptionIfSet(ev);
+
+ if(ev.getIdentifier().getMemberName().contains("description")) {
+ String newValue = (String) ev.getNewValue();
+ if(newValue.matches(".*demo veto.*")) {
+ throw new RecoverableException("oh no you don't! " + ev.getNewValue());
+ }
+ }
+ break;
+ }
+ }
+
+ @Programmatic
+ @Subscribe
+ public void on(CollectionDomainEvent<?,?> ev) {
+ recordEvent(ev);
+ switch (ev.getEventPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionHide &&
+ ev.getIdentifier().getMemberName().equals("dependencies")) {
+ ev.veto("");
+ }
+ if (getSubscriberBehaviour() == Behaviour.SimilarToCollectionHide &&
+ ev.getIdentifier().getMemberName().equals("similarTo")) {
+ ev.veto("");
+ }
+ break;
+ case DISABLE:
+ if (getSubscriberBehaviour() == Behaviour.DependenciesCollectionDisable &&
+ ev.getIdentifier().getMemberName().equals("dependencies")) {
+ ev.veto("ToDoItemSubscriptions says: dependencies collection disabled!");
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateAdd &&
+ ev.getIdentifier().getMemberName().equals("dependencies") &&
+ ev.getOf() == CollectionDomainEvent.Of.ADD_TO ) {
+ ev.veto("ToDoItemSubscriptions says: can't add this object to dependencies collection!");
+ }
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateRemove &&
+ ev.getIdentifier().getMemberName().equals("dependencies") &&
+ ev.getOf() == CollectionDomainEvent.Of.REMOVE_FROM ) {
+ ev.veto("ToDoItemSubscriptions says: can't remove this object from dependencies collection!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ if(ev.getOf() == CollectionDomainEvent.Of.ADD_TO) {
+ LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", added to " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
+ } else {
+ LOG.info("Received CollectionDomainEvent, " + ev.getSource().toString() + ", removed from " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
+ }
+ onExecutedThrowExceptionIfSet(ev);
+ break;
+ }
+
+ }
+
+ //endregion
+
+ //region > receivedEvents
+ private final List<java.util.EventObject> receivedEvents = Lists.newLinkedList();
+
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public List<java.util.EventObject> receivedEvents() {
+ return receivedEvents;
+ }
+
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public <T extends java.util.EventObject> List<T> receivedEvents(final Class<T> expectedType) {
+ return newArrayList(
+ transform(
+ filter(receivedEvents, instanceOf(expectedType)),
+ castTo(expectedType)));
+ }
+
+ private static <T extends EventObject> Function<EventObject, T> castTo(Class<T> expectedType) {
+ return new Function<EventObject, T>() {
+ @Override
+ public T apply(EventObject input) {
+ return (T) input;
+ }
+ };
+ }
+
+ private static <T extends EventObject> Predicate<EventObject> instanceOf(final Class<T> expectedType) {
+ return new Predicate<EventObject>() {
+ @Override
+ public boolean apply(EventObject input) {
+ return expectedType.isInstance(input);
+ }
+ };
+ }
+
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public <T extends java.util.EventObject> T mostRecentlyReceivedEvent(Class<T> expectedType) {
+ final List<T> receivedEvents = receivedEvents(expectedType);
+ return !receivedEvents.isEmpty() ? receivedEvents.get(0) : null;
+ }
+ private void recordEvent(final java.util.EventObject ev) {
+ receivedEvents.add(0, ev);
+ }
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public void reset() {
+ receivedEvents.clear();
+ subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept);
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+
+ @javax.inject.Inject
+ private EventBusService eventBusService;
+ //endregion
+
+
+}
[19/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch b/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
deleted file mode 100644
index 5870cb4..0000000
--- a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
-<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 --type SERVER_PROTOTYPE"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch b/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
deleted file mode 100644
index a4ad877..0000000
--- a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
-<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 --type SERVER"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/ide/intellij/launch/README.txt
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/ide/intellij/launch/README.txt b/example/application/todoapp/webapp/ide/intellij/launch/README.txt
deleted file mode 100644
index 16391ab..0000000
--- a/example/application/todoapp/webapp/ide/intellij/launch/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Copy into workspace\.idea\runConfigurations directory, and adjust file paths for Maven tasks.
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml b/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
deleted file mode 100644
index d6d7e5f..0000000
--- a/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="TodoApp-PROTOTYPE" type="Application" factoryName="Application" singleton="true">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <option name="MAIN_CLASS_NAME" value="org.apache.isis.WebServer" />
- <option name="VM_PARAMETERS" value="" />
- <option name="PROGRAM_PARAMETERS" value="--type SERVER_PROTOTYPE --port 8080" />
- <option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" value="" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <module name="todoapp-webapp" />
- <envs />
- <RunnerSettings RunnerId="Debug">
- <option name="DEBUG_PORT" value="" />
- <option name="TRANSPORT" value="0" />
- <option name="LOCAL" value="true" />
- </RunnerSettings>
- <RunnerSettings RunnerId="Run" />
- <ConfigurationWrapper RunnerId="Debug" />
- <ConfigurationWrapper RunnerId="Run" />
- <method>
- <option name="Make" enabled="false" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/todoapp/dom/pom.xml" goal="datanucleus:enhance -o" />
- </method>
- </configuration>
-</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml b/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
deleted file mode 100644
index e74845c..0000000
--- a/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="TodoApp (enhance only)" type="Application" factoryName="Application">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <option name="MAIN_CLASS_NAME" value="org.apache.isis.Dummy" />
- <option name="VM_PARAMETERS" value="" />
- <option name="PROGRAM_PARAMETERS" value="" />
- <option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" value="" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <module name="todoapp-webapp" />
- <envs />
- <RunnerSettings RunnerId="Run" />
- <ConfigurationWrapper RunnerId="Run" />
- <method>
- <option name="Make" enabled="false" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/todoapp/dom/pom.xml" goal="datanucleus:enhance -o" />
- </method>
- </configuration>
-</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/lib/.gitignore
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/lib/.gitignore b/example/application/todoapp/webapp/lib/.gitignore
deleted file mode 100644
index 70eee7e..0000000
--- a/example/application/todoapp/webapp/lib/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# explicitly ignoring Microsoft JDBC4 jar
-# (cannot redistribute, licensing)
-#
-sqljdbc4.jar
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/pom.xml b/example/application/todoapp/webapp/pom.xml
deleted file mode 100644
index 40ca5ae..0000000
--- a/example/application/todoapp/webapp/pom.xml
+++ /dev/null
@@ -1,352 +0,0 @@
-<?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.example.application</groupId>
- <artifactId>todoapp</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>todoapp-webapp</artifactId>
- <name>ToDo App Webapp</name>
-
- <description>This module runs both the Wicket viewer and the Restfulobjects viewer in a single webapp configured to run using the datanucleus object store.</description>
-
- <packaging>war</packaging>
-
- <properties>
- <siteBaseDir>..</siteBaseDir>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- </plugin>
-
- <!-- mvn package -->
- <plugin>
- <groupId>org.simplericity.jettyconsole</groupId>
- <artifactId>jetty-console-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>createconsole</goal>
- </goals>
- <configuration>
- <backgroundImage>${basedir}/src/main/jettyconsole/isis-banner.png</backgroundImage>
- <destinationFile>${project.build.directory}/${project.build.finalName}-jetty-console.jar</destinationFile>
- </configuration>
- <phase>package</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>maven-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <warName>todoapp</warName>
- <archive>
- <manifest>
- <addClasspath>false</addClasspath>
- </manifest>
- <manifestEntries>
- <Build-Time>${maven.build.timestamp}</Build-Time>
- <Build-Host>${agent.name}</Build-Host>
- <Build-User>${user.name}</Build-User>
- <Build-Maven>Maven ${maven.version}</Build-Maven>
- <Build-Java>${java.version}</Build-Java>
- <Build-OS>${os.name}</Build-OS>
- <Build-Label>${project.version}</Build-Label>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.codehaus.mojo
- </groupId>
- <artifactId>
- build-helper-maven-plugin
- </artifactId>
- <versionRange>
- [1.5,)
- </versionRange>
- <goals>
- <goal>maven-version</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
-
- <!-- other modules in this project -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>todoapp-dom</artifactId>
- <exclusions>
- <exclusion>
- <!-- so don't pick up transitive dependency to asm 4.0.0 -->
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-enhancer</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>todoapp-fixture</artifactId>
- <exclusions>
- <exclusion>
- <!-- so don't pick up transitive dependency to asm 4.0.0 -->
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-enhancer</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- other isis components -->
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-viewer-restfulobjects-server</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-security-shiro</artifactId>
- </dependency>
-
-
- <!-- isis core -->
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-security</artifactId>
- </dependency>
-
-
- <!-- to run using WebServer (optional) -->
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-webserver</artifactId>
- <scope>runtime</scope>
- <optional>true</optional>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-servlet_2.5_spec</artifactId>
- <!--
- removed so can run o.a.i.WebServer from within IntelliJ;
- can rely on servlet container to ignore this in war file
- <scope>provided</scope>
- -->
- </dependency>
-
- <!--
- JDBC drivers
- (for jdo objectstore)
- -->
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </dependency>
-
- <!--
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>9.1-901.jdbc4</version>
- </dependency>
- -->
-
- <!--
- mvn install:install-file -Dfile=sqljdbc4.jar \
- -DgroupId=com.microsoft.sqlserver \
- -DartifactId=jdbc \
- -Dversion=4.0 \
- -Dpackaging=jar
- -->
- <!--
- <dependency>
- <groupId>com.microsoft.sqlserver</groupId>
- <artifactId>sqljdbc4</artifactId>
- <version>4.0</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.lazyluke</groupId>
- <artifactId>log4jdbc-remix</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>self-host</id>
- <build>
- <plugins>
- <!--
- mvn -P self-host antrun:run
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <configuration>
- <tasks>
- <exec executable="java" failonerror="true">
- <arg value="-jar" />
- <arg value="${project.build.directory}/${project.build.finalName}-jetty-console.jar" />
- </exec>
- </tasks>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>jrebel</id>
- <properties>
- <!-- as used in the rebel.xml in the dom project -->
- <target.dir>target</target.dir>
- <isis-jrebel-plugin.packagePrefix>dom.todo,org.apache.isis.objectstore.jdo.applib</isis-jrebel-plugin.packagePrefix>
- <isis-jrebel-plugin.loggingLevel>warn</isis-jrebel-plugin.loggingLevel>
- </properties>
- <build>
- <plugins>
- <!--
- mvn -P jrebel antrun:run \
- -Djrebel.jar="C:/Users/Dan/.IdeaIC13/config/plugins/jr-ide-idea/lib/jrebel/jrebel.jar" \
- -Disis_jrebel_plugin.jar="C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar"
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <configuration>
- <target>
- <property name="compile_classpath" refid="maven.compile.classpath"/>
- <property name="runtime_classpath" refid="maven.runtime.classpath"/>
- <property name="test_classpath" refid="maven.test.classpath"/>
- <property name="plugin_classpath" refid="maven.plugin.classpath"/>
-
- <echo message=""/>
- <echo message=""/>
- <echo message="jrebel.jar = ${jrebel.jar}"/>
- <echo message="isis_jrebel_plugin.jar = ${isis_jrebel_plugin.jar}"/>
- <echo message="target.dir = ${target.dir}"/>
- <echo message=""/>
- <echo message=""/>
-
- <exec executable="java" failonerror="true">
- <arg value="-javaagent:${jrebel.jar}"/>
- <arg value="-Drebel.log=false"/>
- <arg value="-Drebel.check_class_hash=true"/>
- <arg value="-Drebel.packages_exclude=org.apache.isis"/>
-
- <!-- as used in the rebel.xml in the dom project -->
- <arg value="-Dproject.root=${project.basedir}/.."/>
- <arg value="-Dtarget.dir=${target.dir}"/>
-
- <arg value="-Drebel.plugins=${isis_jrebel_plugin.jar}"/>
- <arg value="-Disis-jrebel-plugin.packagePrefix=${isis-jrebel-plugin.packagePrefix}"/>
- <arg value="-Disis-jrebel-plugin.loggingLevel=${isis-jrebel-plugin.loggingLevel}"/>
- <arg value="-XX:MaxPermSize=128m"/>
- <arg value="-classpath"/>
- <arg value="${runtime_classpath}"/>
- <arg value="org.apache.isis.WebServer"/>
- </exec>
- </target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>neo4j</id>
- <dependencies>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-neo4j</artifactId>
- <version>3.2.3</version>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java b/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java
deleted file mode 100644
index 82a8a18..0000000
--- a/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java
+++ /dev/null
@@ -1,61 +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 webapp;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.core.runtime.services.memento.MementoServiceDefault;
-
-
-/**
- * Demonstrates how to register a replacement for one of the default framework-provided services.
- *
- * <p>
- * In <code>isis.properties</code>, is registered using:
- * </p>
- *
- * <pre>
- * isis.services = \
- * ...,
- * 1:webapp.CustomMementoService,
- * ...,
- * </pre>
- * <p>
- * that is, with a menuOrder of 1.
- * </p>
- */
-public class CustomMementoService extends MementoServiceDefault {
-
- @Programmatic
- @Override
- public Memento create() {
- return super.create();
- }
-
- @Programmatic
- @Override
- public Memento parse(String str) {
- return super.parse(str);
- }
-
- @Programmatic
- @Override
- public boolean canSet(Object input) {
- return super.canSet(input);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java b/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java
deleted file mode 100644
index 9cf70af..0000000
--- a/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java
+++ /dev/null
@@ -1,32 +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 webapp;
-
-import javax.ws.rs.core.Response;
-import org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceForRestfulObjects;
-
-public class CustomRepresentationService extends RepresentationServiceForRestfulObjects {
-
- @Override
- protected Response buildResponse(Response.ResponseBuilder responseBuilder) {
- responseBuilder.header("X-ResponseGeneratedBy", getClass().getCanonicalName());
- return super.buildResponse(responseBuilder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java b/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java
deleted file mode 100644
index 4f795b8..0000000
--- a/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java
+++ /dev/null
@@ -1,150 +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 webapp;
-
-import de.agilecoders.wicket.core.Bootstrap;
-import de.agilecoders.wicket.core.settings.IBootstrapSettings;
-import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
-import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import com.google.common.base.Joiner;
-import com.google.common.io.Resources;
-import com.google.inject.AbstractModule;
-import com.google.inject.Module;
-import com.google.inject.name.Names;
-import com.google.inject.util.Modules;
-import com.google.inject.util.Providers;
-import org.apache.wicket.Session;
-import org.apache.wicket.request.Request;
-import org.apache.wicket.request.Response;
-import org.apache.wicket.request.http.WebRequest;
-import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
-import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis;
-
-
-/**
- * As specified in <tt>web.xml</tt>.
- *
- * <p>
- * See:
- * <pre>
- * <filter>
- * <filter-name>wicket</filter-name>
- * <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
- * <init-param>
- * <param-name>applicationClassName</param-name>
- * <param-value>webapp.ToDoApplication</param-value>
- * </init-param>
- * </filter>
- * </pre>
- *
- */
-public class ToDoApplication extends IsisWicketApplication {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * set to true for a (slightly hacky) way of allowing logins using query args, eg:
- *
- * <tt>?user=sven&pass=pass</tt>
- *
- * <p>
- * for demos only, obviously.
- */
- private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false;
-
- @Override
- protected void init() {
- super.init();
-
- final IBootstrapSettings settings = Bootstrap.getSettings();
- settings.setThemeProvider(new BootswatchThemeProvider(BootswatchTheme.Flatly));
- }
-
- @Override
- public Session newSession(final Request request, final Response response) {
- if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
- return super.newSession(request, response);
- }
-
- // else demo mode
- final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
- final org.apache.wicket.util.string.StringValue user = request.getRequestParameters().getParameterValue("user");
- final org.apache.wicket.util.string.StringValue password = request.getRequestParameters().getParameterValue("pass");
- s.signIn(user.toString(), password.toString());
- return s;
- }
-
- @Override
- public WebRequest newWebRequest(final HttpServletRequest servletRequest, final String filterPath) {
- if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
- return super.newWebRequest(servletRequest, filterPath);
- }
-
- // else demo mode
- try {
- final String uname = servletRequest.getParameter("user");
- if (uname != null) {
- servletRequest.getSession().invalidate();
- }
- } catch (Exception ignored) {
- }
-
- return super.newWebRequest(servletRequest, filterPath);
- }
-
- @Override
- protected Module newIsisWicketModule() {
- final Module isisDefaults = super.newIsisWicketModule();
-
- final Module overrides = new AbstractModule() {
- @Override
- protected void configure() {
-
- bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ToDo App");
- bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
- bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
- bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/images/todo%61pp-logo-header.png");
- bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/images/todo%61pp-logo-signin.png");
- bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines(getClass(), "welcome.html"));
- bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("ToDo App");
- bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
- }
- };
-
- return Modules.override(isisDefaults).with(overrides);
- }
-
- private static String readLines(final Class<?> contextClass, final String resourceName) {
- try {
- final List<String> readLines = Resources.readLines(
- Resources.getResource(contextClass, resourceName), Charset.defaultCharset());
- final String aboutText = Joiner.on("\n").join(readLines);
- return aboutText;
- } catch (final IOException e) {
- return "This is a Todo app";
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java b/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
deleted file mode 100644
index a3c92b6..0000000
--- a/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
+++ /dev/null
@@ -1,71 +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 webapp.prototyping;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService
-@DomainServiceLayout(
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- menuOrder = "20"
-)
-public class ExternalLinksService {
-
- public static enum ExternalLink {
- ISIS_DOCUMENTATION("Apache Isis docs", "http://isis.apache.org/documentation.html"),
- PROJECT_ON_GITHUB("Project source code on Github", "https://github.com/apache/isis/tree/master/example/application/todoapp/");
-
- private final String title;
- private final String url;
-
- private ExternalLink(final String title, final String url) {
- this.title = title;
- this.url = url;
- }
-
- public URL open() throws MalformedURLException {
- return new URL(url);
- }
-
- public String toString() {
- return title;
- }
- }
-
- @ActionLayout(
- cssClassFa = "fa-external-link"
- )
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- @MemberOrder(name="Prototyping", sequence="91.1")
- public URL goToDocs(@ParameterLayout(named="Link") ExternalLink link) throws MalformedURLException {
- return link.open();
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java b/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
deleted file mode 100644
index 67425af..0000000
--- a/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
+++ /dev/null
@@ -1,44 +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 webapp.prototyping;
-
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.viewer.wicket.viewer.applib.WicketDeveloperUtilitiesService;
-
-/**
- * These overrides are simply to 'move' the action underneath the
- * 'Prototyping' menu.
- */
-@DomainService
-@DomainServiceLayout(
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- named = "Prototyping",
- menuOrder = "40")
-public class WicketDeveloperUtilities extends WicketDeveloperUtilitiesService {
-
- @ActionLayout(named="Clear i18n Cache")
- @MemberOrder(sequence="90.3")
- @Override
- public void resetI18nCache() {
- super.resetI18nCache();
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java b/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
deleted file mode 100644
index 62ac918..0000000
--- a/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
+++ /dev/null
@@ -1,43 +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 webapp.userprof;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.userprof.UserProfileService;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-
-/**
- * Demonstrates how to provide a custom implementation of the {@link org.apache.isis.applib.services.userprof.UserProfileService}.
- */
-@DomainService
-public class CustomUserProfileService implements UserProfileService {
-
- @Override
- @Programmatic
- public String userProfileName() {
- return "Hi " + getAuthenticationSession().getUserName() + "!";
- }
-
- protected AuthenticationSession getAuthenticationSession() {
- return IsisContext.getAuthenticationSession();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn b/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn
deleted file mode 100644
index 37543c9..0000000
Binary files a/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png b/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png
deleted file mode 100644
index cd9ecfe..0000000
Binary files a/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties b/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties
deleted file mode 100644
index 4335021..0000000
--- a/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties
+++ /dev/null
@@ -1,52 +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.
-#
-
-
-# override WicketSignInPage.properties
-loginHeader=Login
-registerHeader=Register
-
-# override PageAbstract.properties
-aboutLabel=About
-logoutLabel=Logout
-
-# override EntityPropertiesForm.properties and also
-# override ActionParametersFormPanel.properties
-okLabel=OK
-cancelLabel=Cancel
-editLabel=Edit
-
-
-
-
-#
-# 3rd-party components
-#
-
-# Select2Choice
-
-#noMatches=...
-#inputTooShortSingular=...
-#inputTooShortPlural=...
-#loadMore=...
-#searching=...
-
-# datatables
-#no-records-found=...
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini b/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini
deleted file mode 100644
index 1473390..0000000
--- a/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini
+++ /dev/null
@@ -1,105 +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.
-#
-
-
-# -----------------------------------------------------------------------------
-# 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, ...
-
-#
-# realm1 configures sven, dick and bob only. Additional logins are configured in realm2
-#
-
-sven = pass, admin_role
-dick = pass, readwrite_role, dashboard_role, analysis_role, self-install_role
-bob = pass, readwrite_role, dashboard_role, self-install_role
-joe = pass, readwrite_role, self-install_role, noDueBy_role
-guest = guest, readonly_role
-
-
-
-#
-# some additional users/roles
-# require IsisPermissionResolver to be configured in shiro.ini, and
-# require additional role/perms to be configured below in [roles]
-#
-
-# # fred should have access to everything except the analysis features
-# fred = pass,isisperms_all_but_analysis_role
-# # bill should have access to everything (the admin role 'trumps' the vetos)
-# bill = pass,isisperms_all_but_analysis_role,isisperms_admin_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
-
-#
-# If using the IsisLdapRealm, it could be pointed at an ini file such as this in
-# order to share role/perm mappings.
-#
-
-
-# configuring iniRealm to use Shiro's built-in WildcardPermissions
-
-readwrite_role = *:ToDoItems:*:*,\
- *:ToDoItem:*:*
-
-readonly_role = *:ToDoItems:notYetComplete:*,\
- *:ToDoItems:complete:*,\
- *:ToDoItems:allToDos:*,\
- *:ToDoItem:*:r
-
-dashboard_role = *:ToDoAppDashboardService:*:*,\
- *:ToDoAppDashboard:*:*
-
-analysis_role = *:ToDoItemAnalysis:*:*,\
- *:ToDoItemsByCategoryViewModel:*:*,\
- *:ToDoItemsByDateRangeViewModel:*:*
-
-self-install_role = *:ToDoItemsFixturesService:*:*
-
-admin_role = *
-
-
-
-#
-# some additional role/perms
-# require IsisPermissionResolver to be configured in shiro.ini
-#
-
-# isisperms_all_but_analysis_role = aba/*,\
-# !aba/*:ToDoItemAnalysis:*,\
-# !aba/*:ToDoItemsByCategoryViewModel:*:*,\
-# !aba/*:ToDoItemsByDateRangeViewModel:*:*
-# isisperms_admin_role = adm/*
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html b/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html
deleted file mode 100644
index 97b389c..0000000
--- a/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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.
--->
-<p class="intro">
- <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a platform to let you rapidly develop
- domain-driven apps in Java.
- <br/>
- <br/>
- This app has been generated using Isis'
- <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
- which configures Isis' most commonly used components in a straightforward "todo" app.
- <br/>
- <br/>
- The core functionality of the app is provided by the
- <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank">ToDoItem</a> domain class.
- Supporting services provide additional capabilities.
- <br/>
- <br/>
- For more details, see the <a href="http://isis.apache.org/documentation.html" target="_blank">Isis website</a>.
-</p>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
deleted file mode 100644
index f3366a7..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ /dev/null
@@ -1,290 +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.
-
-
-#################################################################################
-#
-# specify system components.
-#
-# The values correspond to the named components in the installer-registry.properties file
-# in the org.apache.isis.core:isis-core-runtime JAR (in the org.apache.isis.core.runtime package)
-#
-# Although all configuration could reside in isis.properties, the recommendation is
-# to split out into component specific files:
-#
-# xxx_yyy.properties files
-#
-# where
-# * xxx is the component type, and
-# * yyy is the component name.
-#
-# For example, viewer_wicket.properties holds configuration information specific to the Wicket viewer.
-#
-#################################################################################
-
-
-#
-# configure the persistor (object store) to use
-#
-
-# JDO/DataNucleus objectstore
-isis.persistor=datanucleus
-
-
-
-#
-# configure authentication mechanism to use (to logon to the system)
-#
-
-#isis.authentication=bypass
-isis.authentication=shiro
-
-
-#
-# configure authorization mechanism to use
-#
-
-#isis.authorization=bypass
-isis.authorization=shiro
-
-
-
-
-
-#################################################################################
-#
-# MetaModel
-#
-# The metamodel typically does not require additional configuration, although
-# the system components (defined above) may refine the metamodel for their needs.
-#
-#################################################################################
-
-
-#
-# Additional programming model facet factories, or remove standard facet factories.
-# Comma separated list of fully qualified class names.
-#
-#isis.reflector.facets.include=
-#isis.reflector.facets.exclude=
-
-
-#
-# Metamodel validation (in addition to that automatically performed by the programming model facet factories)
-# Default implementation does nothing.
-#
-# Use a custom implementation to enforce additional constraints specific to your app/project/company.
-#
-#isis.reflector.validator=org.apache.isis.core.metamodel.metamodelvalidator.dflt.MetaModelValidatorDefault
-
-
-
-#
-# Whether to allow deprecated annotations/method prefixes (otherwise raise metamodel validation errors).
-# If not specified, default is to allow.
-#
-#isis.reflector.validator.allowDeprecated=false
-
-
-
-#
-# Implementation to use for reading dynamic layout. Default implementation reads Xxx.layout.json files from classpath.
-#
-#isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson
-
-
-
-#
-# patterns for applying CssClassFa facet (font-awesome icons), matching on action names
-#
-isis.reflector.facet.cssClassFa.patterns=\
- new.*:fa-plus,\
- add.*:fa-plus-square,\
- create.*:fa-plus,\
- update.*:fa-edit,\
- change.*:fa-edit,\
- remove.*:fa-minus-square,\
- move.*:fa-exchange,\
- first.*:fa-star,\
- find.*:fa-search,\
- lookup.*:fa-search,\
- clear.*:fa-remove,\
- previous.*:fa-step-backward,\
- next.*:fa-step-forward,\
- list.*:fa-list, \
- all.*:fa-list, \
- download.*:fa-download, \
- upload.*:fa-upload, \
- execute.*:fa-bolt, \
- run.*:fa-bolt, \
- calculate.*:fa-calculator, \
- verify.*:fa-check-circle, \
- refresh.*:fa-refresh, \
- install.*:fa-wrench
-
-
-#
-# patterns for applying CssClass facet (CSS styles), matching on member names
-#
-isis.reflector.facet.cssClass.patterns=\
- delete.*:btn-warning,\
- .*:btn-default
-
-
-#################################################################################
-#
-# Value facet defaults
-#
-# (see also viewer-specific config files, eg viewer_wicket.properties)
-#
-#################################################################################
-
-# as used by @Title of a date
-isis.value.format.date=dd-MM-yyyy
-
-
-
-#################################################################################
-#
-# Facet Decorators
-#
-#################################################################################
-
-#
-# Providing such capabilities as i18n
-#
-
-isis.reflector.facet-decorators=org.apache.isis.core.metamodel.facetdecorator.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
-
-
-#################################################################################
-#
-# Application Services and fixtures
-#
-#################################################################################
-
-#
-# Specify the domain services.
-#
-# These are the most important configuration properties in the system, as they define
-# the set of the classes for Isis to instantiate as domain service singletons.
-# From these domain service instances the rest of the metamodel is discovered, while the
-# end-user gains access to other domain objects by invoking the actions of the domain services.
-#
-isis.services-installer=configuration-and-annotation
-isis.services.ServicesInstallerFromAnnotation.packagePrefix=app,\
- dom.todo,\
- fixture.todo,\
- webapp.userprof,\
- webapp.prototyping
-
-isis.services = \
- org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,\
- \
- # customizable exception handling, \
- org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,\
- #,\
- 1:webapp.CustomMementoService,\
- 1:webapp.CustomRepresentationService
-
-
-# Specify the (optional) test fixtures
-#
-# Fixtures are used to seed the object store with an initial set of data. For the
-# in-memory object store, the fixtures are installed on every run. For other
-# object stores, they are used only when the object store is first initialized.
-#
-#isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven
-
-
-#
-# required by EmailServiceDefault
-#
-#isis.service.email.sender.address=some.valid@email.address
-#isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
-
-
-#
-# whether ExceptionRecognizers should also log any recognized exceptions
-# (default false; enable for diagnostics/debugging)
-#
-#isis.services.exceprecog.logRecognizedExceptions=true
-
-
-################################################################################
-#
-# Auditing, Publishing, Command
-#
-################################################################################
-
-#
-# Whether changes to objects should be audited; if not set, defaults to "none"
-# - if not set or set to "none", can explicitly enable using @DomainObject(auditing=Auditing.ENABLED)
-# - if set to "all", can explicitly disable using @Object(auditing=Auditing.DISABLED)
-#
-#isis.services.audit.objects=all|none
-
-#
-# Whether changes to objects should be published; if not set, defaults to "none"
-# - if not set or set to "none", can explicitly enable using @DomainObject(publishing=Publishing.ENABLED)
-# - if set to "all", can explicitly disable using @Object(publishing=Publishing.DISABLED)
-#
-#isis.services.publish.objects=all|none
-
-#
-# Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
-# - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
-# - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
-#
-#isis.services.publish.actions=all|none|ignoreQueryOnly
-
-
-#
-# Whether all (or all non-query only) actions should be reified as commands; if not set, defaults to "none"
-# - if not set or set to "none", can explicitly enable using @Action(command=CommandReification.ENABLED)
-# - if set to "all", can explicitly disable using @Action(command=CommandReification.DISABLED)
-#
-#isis.services.command.actions=all|none|ignoreQueryOnly
-
-
-
-################################################################################
-#
-# Policies
-#
-#################################################################################
-
-#
-# Whether editing of object properties is allowed; if not set, defaults to "true"
-# - if not set or set to "true", can explicitly disable using @DomainObject(editing=Editing.DISABLED)
-# - if set to "false", can explicitly enable using @DomainObject(editing=Editing.ENABLED)
-#
-#isis.objects.editing=true|false
-
-
-
-################################################################################
-#
-# Viewer defaults
-#
-#################################################################################
-
-#isis.viewers.paged.standalone=30
-#isis.viewers.paged.parented=10
-
-#isis.viewers.propertyLayout.labelPosition=LEFT
-#isis.viewers.parameterLayout.labelPosition=LEFT
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties
deleted file mode 100644
index 2eeda2c..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties
+++ /dev/null
@@ -1,220 +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.
-
-
-#
-# Isis uses log4j is used to provide system logging
-#
-log4j.rootCategory=INFO, Console
-#log4j.rootCategory=DEBUG, Console
-
-
-# The console appender
-log4j.appender.Console=org.apache.log4j.ConsoleAppender
-log4j.appender.Console.target=System.out
-log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
-
-
-# The stderr appender
-log4j.appender.Stderr=org.apache.log4j.ConsoleAppender
-log4j.appender.Stderr.target=System.err
-log4j.appender.Stderr.layout=org.apache.log4j.PatternLayout
-log4j.appender.Stderr.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
-
-
-# other appenders
-log4j.appender.File=org.apache.log4j.RollingFileAppender
-log4j.appender.File.file=isis.log
-log4j.appender.File.append=false
-log4j.appender.File.layout=org.apache.log4j.PatternLayout
-log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
-
-log4j.appender.sql=org.apache.log4j.FileAppender
-log4j.appender.sql.File=./logs/sql.log
-log4j.appender.sql.Append=false
-log4j.appender.sql.layout=org.apache.log4j.PatternLayout
-log4j.appender.sql.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
-
-log4j.appender.sqltiming=org.apache.log4j.FileAppender
-log4j.appender.sqltiming.File=./logs/sqltiming.log
-log4j.appender.sqltiming.Append=false
-log4j.appender.sqltiming.layout=org.apache.log4j.PatternLayout
-log4j.appender.sqltiming.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
-
-log4j.appender.jdbc=org.apache.log4j.FileAppender
-log4j.appender.jdbc.File=./logs/jdbc.log
-log4j.appender.jdbc.Append=false
-log4j.appender.jdbc.layout=org.apache.log4j.PatternLayout
-log4j.appender.jdbc.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
-
-log4j.appender.connection=org.apache.log4j.FileAppender
-log4j.appender.connection.File=./logs/connection.log
-log4j.appender.connection.Append=false
-log4j.appender.connection.layout=org.apache.log4j.PatternLayout
-log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
-
-log4j.appender.wicket.i18n=org.apache.log4j.RollingFileAppender
-log4j.appender.wicket.i18n.file=./logs/wicket-i18n.log
-log4j.appender.wicket.i18n.append=false
-log4j.appender.wicket.i18n.layout=org.apache.log4j.PatternLayout
-log4j.appender.wicket.i18n.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
-
-
-
-
-
-! turn on the internal log4j debugging flag so we can see what it is doing
-#log4j.debug=true
-
-
-# DataNucleus
-# the first two log the DML and DDL (if set to DEBUG)
-log4j.logger.DataNucleus.Datastore.Native=WARN, Console
-log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
-# the remainder can probably be left to WARN
-log4j.logger.DataNucleus.Persistence=WARN, Console
-log4j.logger.DataNucleus.Transaction=WARN, Console
-log4j.logger.DataNucleus.Connection=WARN, Console
-log4j.logger.DataNucleus.Query=WARN, Console
-log4j.logger.DataNucleus.Cache=WARN, Console
-log4j.logger.DataNucleus.MetaData=WARN, Console
-log4j.logger.DataNucleus.Datastore=WARN, Console
-log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
-log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
-log4j.logger.DataNucleus.General=WARN, Console
-log4j.logger.DataNucleus.Lifecycle=WARN, Console
-log4j.logger.DataNucleus.ValueGeneration=WARN, Console
-log4j.logger.DataNucleus.Enhancer=WARN, Console
-log4j.logger.DataNucleus.SchemaTool=ERROR, Console
-log4j.logger.DataNucleus.JDO=WARN, Console
-log4j.logger.DataNucleus.JPA=ERROR, Console
-log4j.logger.DataNucleus.JCA=WARN, Console
-log4j.logger.DataNucleus.IDE=ERROR, Console
-
-log4j.additivity.DataNucleus.Datastore.Native=false
-log4j.additivity.DataNucleus.Datastore.Schema=false
-log4j.additivity.DataNucleus.Datastore.Persistence=false
-log4j.additivity.DataNucleus.Datastore.Transaction=false
-log4j.additivity.DataNucleus.Datastore.Connection=false
-log4j.additivity.DataNucleus.Datastore.Query=false
-log4j.additivity.DataNucleus.Datastore.Cache=false
-log4j.additivity.DataNucleus.Datastore.MetaData=false
-log4j.additivity.DataNucleus.Datastore.Datastore=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
-log4j.additivity.DataNucleus.Datastore.General=false
-log4j.additivity.DataNucleus.Datastore.Lifecycle=false
-log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
-log4j.additivity.DataNucleus.Datastore.Enhancer=false
-log4j.additivity.DataNucleus.Datastore.SchemaTool=false
-log4j.additivity.DataNucleus.Datastore.JDO=false
-log4j.additivity.DataNucleus.Datastore.JPA=false
-log4j.additivity.DataNucleus.Datastore.JCA=false
-log4j.additivity.DataNucleus.Datastore.IDE=false
-
-
-# if using log4jdbc-remix as JDBC driver
-#log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
-#log4j.additivity.jdbc.sqlonly=false
-#log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
-#log4j.additivity.jdbc.resultsettable=false
-
-#log4j.logger.jdbc.audit=WARN,jdbc, Console
-#log4j.additivity.jdbc.audit=false
-#log4j.logger.jdbc.resultset=WARN,jdbc
-#log4j.additivity.jdbc.resultset=false
-#log4j.logger.jdbc.sqltiming=WARN,sqltiming
-#log4j.additivity.jdbc.sqltiming=false
-#log4j.logger.jdbc.connection=FATAL,connection
-#log4j.additivity.jdbc.connection=false
-
-
-
-# track Isis/JDO lifecycle integration
-
-#log4j.logger.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=DEBUG, Console
-#log4j.additivity.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=false
-
-#log4j.logger.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=DEBUG,Console
-#log4j.additivity.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=false
-
-
-
-
-# track Isis/Wicket lifecycle integration
-
-#log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=DEBUG, Console
-#log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=false
-
-#log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=INFO,Console
-#log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=false
-
-
-
-# to track Wicket i18n
-log4j.logger.org.apache.wicket.Localizer=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.Localizer=false
-
-log4j.logger.org.apache.wicket.resource.loader.ClassStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.ClassStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.ComponentStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.ComponentStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.PackageStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.PackageStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.BundleStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.BundleStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.InitializerStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.InitializerStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=false
-
-log4j.logger.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=WARN,Console,wicket.i18n
-log4j.additivity.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=false
-
-
-
-# quieten some of the noisier classes in Isis' bootstrapping
-log4j.logger.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=WARN,Console
-log4j.additivity.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=false
-
-log4j.logger.org.apache.isis.core.metamodel.specloader.ServiceInitializer=WARN,Console
-log4j.additivity.org.apache.isis.core.metamodel.specloader.ServiceInitializer=false
-
-log4j.logger.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=WARN,Console
-log4j.additivity.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=false
-
-log4j.logger.org.apache.isis.core.commons.config.IsisConfigurationDefault=WARN,Console
-log4j.additivity.org.apache.isis.core.commons.config.IsisConfigurationDefault=false
-
-log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN,Console
-log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false
-
-
-
-
-# Application-specific logging
-log4j.logger.dom.todo.ToDoItem=DEBUG, Stderr
-log4j.additivity.dom.todo.ToDoItem=false
-
-log4j.logger.dom.todo.ToDoItemSubscriptions=DEBUG, Stderr
-log4j.additivity.dom.todo.ToDoItemSubscriptions=false
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties
deleted file mode 100644
index bcb9348..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties
+++ /dev/null
@@ -1,129 +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.
-
-
-#################################################################################
-#
-# Persistor
-#
-#################################################################################
-
-
-
-# generally speaking this should not be enabled
-isis.persistor.disableConcurrencyChecking=false
-
-
-
-
-#################################################################################
-#
-# JDBC configuration
-#
-#################################################################################
-
-
-
-#
-# configuration file holding the JDO objectstore's JDBC configuration
-# (this is a bit of a hack... just exploiting fact that Isis also loads this file)
-#
-
-
-#
-# JDBC connection details
-# (also update the pom.xml to reference the appropriate JDBC driver)
-#
-
-
-#
-# HSQLDB in-memory
-#
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-#
-# HSQLDB in-memory (using log4jdbc-remix)
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-
-
-#
-# HSQLDB to file
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-#
-# HSQLDB to file (using log4jdbc-remix)
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
-
-
-
-#
-# PostgreSQL Server
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.postgresql.Driver
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:postgresql://localhost:5432/isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-#
-# PostgreSQL Server (using log4jdbc-remix)
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:postgresql://localhost:5432/isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-
-
-#
-# MS SQL Server
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-#
-# MS SQL Server (using log4jdbc-remix)
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
-
-
-
-#
-# neo4j
-# (experimental; run with '-P neo4j' profile in webapp project)
-#
-#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=neo4j:neo4j_DB
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
deleted file mode 100644
index a60a733..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
+++ /dev/null
@@ -1,88 +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.
-
-#
-# configuration file for the JDO/DataNucleus objectstore
-#
-
-# identifies @PersistenceCapable entities to be eagerly registered
-# if move class to other package (eg com.mycompany.myapp.dom) then update
-isis.persistor.datanucleus.RegisterEntities.packagePrefix=dom
-
-# whether to persist the event data as a "clob" or as a "zipped" byte[]
-# default is "zipped"
-#isis.persistor.datanucleus.PublishingService.serializedForm=zipped
-
-
-
-#####################################################################
-#
-# DataNucleus' configuration
-#
-# The 'isis.persistor.datanucleus.impl' prefix is stripped off,
-# remainder is passed through to DataNucleus
-#
-#####################################################################
-
-isis.persistor.datanucleus.impl.datanucleus.autoCreateSchema=true
-isis.persistor.datanucleus.impl.datanucleus.validateTables=true
-isis.persistor.datanucleus.impl.datanucleus.validateConstraints=true
-
-
-#
-# Require explicit persistence (since entities are Comparable and using ObjectContracts#compareTo).
-# see http://www.datanucleus.org/products/accessplatform_3_0/jdo/transaction_types.html
-#
-isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false
-
-
-#
-# How column names are identified
-# (http://www.datanucleus.org/products/datanucleus/jdo/orm/datastore_identifiers.html)
-#
-isis.persistor.datanucleus.impl.datanucleus.identifier.case=PreserveCase
-
-
-#
-# L2 cache
-# off except if explicitly marked as cacheable
-# http://www.datanucleus.org/products/datanucleus/jdo/cache.html
-#
-isis.persistor.datanucleus.impl.datanucleus.cache.level2.type=none
-isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode=ENABLE_SELECTIVE
-
-
-
-#
-# uncomment to use JNDI rather than direct JDBC
-#
-#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart
-
-#
-# uncomment to use JTA resource
-#
-#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactory2Name=java:comp/env/jdbc/quickstart-nontx
-#isis.persistor.datanucleus.impl.javax.jdo.option.TransactionType=JTA
-
-
-
-#
-#
-# JDBC connection details
-# ... are in persistor.properties
-#
-#
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini
deleted file mode 100644
index 07ea04f..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini
+++ /dev/null
@@ -1,103 +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.
-#
-
-[main]
-
-#######
-# configure a couple of iniRealms
-# (nb: not possible for their .ini files to live in WEB-INF, because Shiro does not
-# provide a mechanism to load resources from that location)
-#######
-
-realm1 = org.apache.shiro.realm.text.IniRealm
-realm1.resourcePath=classpath:webapp/realm1.ini
-
-
-
-
-#######
-# configure an ldap-based realm
-#######
-
-contextFactory = org.apache.isis.security.shiro.IsisLdapContextFactory
-contextFactory.url = ldap://localhost:10389
-contextFactory.authenticationMechanism = CRAM-MD5
-contextFactory.systemAuthenticationMechanism = simple
-contextFactory.systemUsername = uid=admin,ou=system
-contextFactory.systemPassword = secret
-
-ldapRealm = org.apache.isis.security.shiro.IsisLdapRealm
-ldapRealm.contextFactory = $contextFactory
-
-ldapRealm.searchBase = ou=groups,o=mojo
-ldapRealm.groupObjectClass = groupOfUniqueNames
-ldapRealm.uniqueMemberAttribute = uniqueMember
-ldapRealm.uniqueMemberAttributeValueTemplate = uid={0}
-
-# optional mapping from physical groups to logical application roles
-#ldapRealm.rolesByGroup = \
-# LDN_USERS: user_role,\
-# NYK_USERS: user_role,\
-# HKG_USERS: user_role,\
-# GLOBAL_ADMIN: admin_role,\
-# DEMOS: self-install_role
-
-# configuring ldapRealm role/perm mappings
-# (use same as realm1)
-ldapRealm.resourcePath=classpath:webapp/realm1.ini
-
-
-#######
-# configure security manager to use realm(s)
-#######
-
-# authenticate/authorize using realm1
-securityManager.realms = $realm1
-
-
-# or to use ldap with realm1 as a backup...
-# (see docs for details of how to setup users/groups in Apache Directory Studio).
-#securityManager.realms = $ldapRealm,$realm1
-
-
-# or to just use this .ini file...
-# (would require [users] and [roles] to be set up)
-#securityManager.realms = $iniRealm
-
-
-
-#######
-# optional, configure realm(s) to use Isis' extended permission syntax
-# (see webapp/realm1.ini for usage)
-#######
-
-# permissionResolver = org.apache.isis.security.shiro.authorization.IsisPermissionResolver
-# realm1.permissionResolver = $permissionResolver
-# realm2.permissionResolver = $permissionResolver
-
-
-# -----------------------------------------------------------------------------
-# Users and their assigned roles
-# -----------------------------------------------------------------------------
-
-[users]
-# unused (assuming not configured $iniRealm)
-
-[roles]
-# unused (assuming not configured $iniRealm)
[08/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
new file mode 100644
index 0000000..5870cb4
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 --type SERVER_PROTOTYPE"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
new file mode 100644
index 0000000..a4ad877
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 --type SERVER"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/ide/intellij/launch/README.txt
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/ide/intellij/launch/README.txt b/mothballed/example/application/todoapp/webapp/ide/intellij/launch/README.txt
new file mode 100644
index 0000000..16391ab
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/ide/intellij/launch/README.txt
@@ -0,0 +1,3 @@
+Copy into workspace\.idea\runConfigurations directory, and adjust file paths for Maven tasks.
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml b/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
new file mode 100644
index 0000000..d6d7e5f
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
@@ -0,0 +1,29 @@
+<component name="ProjectRunConfigurationManager">
+ <configuration default="false" name="TodoApp-PROTOTYPE" type="Application" factoryName="Application" singleton="true">
+ <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
+ <option name="MAIN_CLASS_NAME" value="org.apache.isis.WebServer" />
+ <option name="VM_PARAMETERS" value="" />
+ <option name="PROGRAM_PARAMETERS" value="--type SERVER_PROTOTYPE --port 8080" />
+ <option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" value="" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <option name="ENV_VARIABLES" />
+ <option name="PASS_PARENT_ENVS" value="true" />
+ <module name="todoapp-webapp" />
+ <envs />
+ <RunnerSettings RunnerId="Debug">
+ <option name="DEBUG_PORT" value="" />
+ <option name="TRANSPORT" value="0" />
+ <option name="LOCAL" value="true" />
+ </RunnerSettings>
+ <RunnerSettings RunnerId="Run" />
+ <ConfigurationWrapper RunnerId="Debug" />
+ <ConfigurationWrapper RunnerId="Run" />
+ <method>
+ <option name="Make" enabled="false" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/todoapp/dom/pom.xml" goal="datanucleus:enhance -o" />
+ </method>
+ </configuration>
+</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml b/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
new file mode 100644
index 0000000..e74845c
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
@@ -0,0 +1,23 @@
+<component name="ProjectRunConfigurationManager">
+ <configuration default="false" name="TodoApp (enhance only)" type="Application" factoryName="Application">
+ <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
+ <option name="MAIN_CLASS_NAME" value="org.apache.isis.Dummy" />
+ <option name="VM_PARAMETERS" value="" />
+ <option name="PROGRAM_PARAMETERS" value="" />
+ <option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" value="" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <option name="ENV_VARIABLES" />
+ <option name="PASS_PARENT_ENVS" value="true" />
+ <module name="todoapp-webapp" />
+ <envs />
+ <RunnerSettings RunnerId="Run" />
+ <ConfigurationWrapper RunnerId="Run" />
+ <method>
+ <option name="Make" enabled="false" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/todoapp/dom/pom.xml" goal="datanucleus:enhance -o" />
+ </method>
+ </configuration>
+</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/lib/.gitignore
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/lib/.gitignore b/mothballed/example/application/todoapp/webapp/lib/.gitignore
new file mode 100644
index 0000000..70eee7e
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/lib/.gitignore
@@ -0,0 +1,5 @@
+#
+# explicitly ignoring Microsoft JDBC4 jar
+# (cannot redistribute, licensing)
+#
+sqljdbc4.jar
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/pom.xml b/mothballed/example/application/todoapp/webapp/pom.xml
new file mode 100644
index 0000000..40ca5ae
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/pom.xml
@@ -0,0 +1,352 @@
+<?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.example.application</groupId>
+ <artifactId>todoapp</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>todoapp-webapp</artifactId>
+ <name>ToDo App Webapp</name>
+
+ <description>This module runs both the Wicket viewer and the Restfulobjects viewer in a single webapp configured to run using the datanucleus object store.</description>
+
+ <packaging>war</packaging>
+
+ <properties>
+ <siteBaseDir>..</siteBaseDir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ </plugin>
+
+ <!-- mvn package -->
+ <plugin>
+ <groupId>org.simplericity.jettyconsole</groupId>
+ <artifactId>jetty-console-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>createconsole</goal>
+ </goals>
+ <configuration>
+ <backgroundImage>${basedir}/src/main/jettyconsole/isis-banner.png</backgroundImage>
+ <destinationFile>${project.build.directory}/${project.build.finalName}-jetty-console.jar</destinationFile>
+ </configuration>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>maven-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <warName>todoapp</warName>
+ <archive>
+ <manifest>
+ <addClasspath>false</addClasspath>
+ </manifest>
+ <manifestEntries>
+ <Build-Time>${maven.build.timestamp}</Build-Time>
+ <Build-Host>${agent.name}</Build-Host>
+ <Build-User>${user.name}</Build-User>
+ <Build-Maven>Maven ${maven.version}</Build-Maven>
+ <Build-Java>${java.version}</Build-Java>
+ <Build-OS>${os.name}</Build-OS>
+ <Build-Label>${project.version}</Build-Label>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.codehaus.mojo
+ </groupId>
+ <artifactId>
+ build-helper-maven-plugin
+ </artifactId>
+ <versionRange>
+ [1.5,)
+ </versionRange>
+ <goals>
+ <goal>maven-version</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <dependencies>
+
+ <!-- other modules in this project -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>todoapp-dom</artifactId>
+ <exclusions>
+ <exclusion>
+ <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-enhancer</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>todoapp-fixture</artifactId>
+ <exclusions>
+ <exclusion>
+ <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-enhancer</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- other isis components -->
+ <dependency>
+ <groupId>org.apache.isis.viewer</groupId>
+ <artifactId>isis-viewer-wicket-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-viewer-restfulobjects-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-security-shiro</artifactId>
+ </dependency>
+
+
+ <!-- isis core -->
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-wrapper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-security</artifactId>
+ </dependency>
+
+
+ <!-- to run using WebServer (optional) -->
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-webserver</artifactId>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ <!--
+ removed so can run o.a.i.WebServer from within IntelliJ;
+ can rely on servlet container to ignore this in war file
+ <scope>provided</scope>
+ -->
+ </dependency>
+
+ <!--
+ JDBC drivers
+ (for jdo objectstore)
+ -->
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>9.1-901.jdbc4</version>
+ </dependency>
+ -->
+
+ <!--
+ mvn install:install-file -Dfile=sqljdbc4.jar \
+ -DgroupId=com.microsoft.sqlserver \
+ -DartifactId=jdbc \
+ -Dversion=4.0 \
+ -Dpackaging=jar
+ -->
+ <!--
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>sqljdbc4</artifactId>
+ <version>4.0</version>
+ </dependency>
+ -->
+
+ <dependency>
+ <groupId>org.lazyluke</groupId>
+ <artifactId>log4jdbc-remix</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>self-host</id>
+ <build>
+ <plugins>
+ <!--
+ mvn -P self-host antrun:run
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+ <exec executable="java" failonerror="true">
+ <arg value="-jar" />
+ <arg value="${project.build.directory}/${project.build.finalName}-jetty-console.jar" />
+ </exec>
+ </tasks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>jrebel</id>
+ <properties>
+ <!-- as used in the rebel.xml in the dom project -->
+ <target.dir>target</target.dir>
+ <isis-jrebel-plugin.packagePrefix>dom.todo,org.apache.isis.objectstore.jdo.applib</isis-jrebel-plugin.packagePrefix>
+ <isis-jrebel-plugin.loggingLevel>warn</isis-jrebel-plugin.loggingLevel>
+ </properties>
+ <build>
+ <plugins>
+ <!--
+ mvn -P jrebel antrun:run \
+ -Djrebel.jar="C:/Users/Dan/.IdeaIC13/config/plugins/jr-ide-idea/lib/jrebel/jrebel.jar" \
+ -Disis_jrebel_plugin.jar="C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar"
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <target>
+ <property name="compile_classpath" refid="maven.compile.classpath"/>
+ <property name="runtime_classpath" refid="maven.runtime.classpath"/>
+ <property name="test_classpath" refid="maven.test.classpath"/>
+ <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+
+ <echo message=""/>
+ <echo message=""/>
+ <echo message="jrebel.jar = ${jrebel.jar}"/>
+ <echo message="isis_jrebel_plugin.jar = ${isis_jrebel_plugin.jar}"/>
+ <echo message="target.dir = ${target.dir}"/>
+ <echo message=""/>
+ <echo message=""/>
+
+ <exec executable="java" failonerror="true">
+ <arg value="-javaagent:${jrebel.jar}"/>
+ <arg value="-Drebel.log=false"/>
+ <arg value="-Drebel.check_class_hash=true"/>
+ <arg value="-Drebel.packages_exclude=org.apache.isis"/>
+
+ <!-- as used in the rebel.xml in the dom project -->
+ <arg value="-Dproject.root=${project.basedir}/.."/>
+ <arg value="-Dtarget.dir=${target.dir}"/>
+
+ <arg value="-Drebel.plugins=${isis_jrebel_plugin.jar}"/>
+ <arg value="-Disis-jrebel-plugin.packagePrefix=${isis-jrebel-plugin.packagePrefix}"/>
+ <arg value="-Disis-jrebel-plugin.loggingLevel=${isis-jrebel-plugin.loggingLevel}"/>
+ <arg value="-XX:MaxPermSize=128m"/>
+ <arg value="-classpath"/>
+ <arg value="${runtime_classpath}"/>
+ <arg value="org.apache.isis.WebServer"/>
+ </exec>
+ </target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>neo4j</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-neo4j</artifactId>
+ <version>3.2.3</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java
new file mode 100644
index 0000000..82a8a18
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomMementoService.java
@@ -0,0 +1,61 @@
+/*
+ * 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 webapp;
+
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.core.runtime.services.memento.MementoServiceDefault;
+
+
+/**
+ * Demonstrates how to register a replacement for one of the default framework-provided services.
+ *
+ * <p>
+ * In <code>isis.properties</code>, is registered using:
+ * </p>
+ *
+ * <pre>
+ * isis.services = \
+ * ...,
+ * 1:webapp.CustomMementoService,
+ * ...,
+ * </pre>
+ * <p>
+ * that is, with a menuOrder of 1.
+ * </p>
+ */
+public class CustomMementoService extends MementoServiceDefault {
+
+ @Programmatic
+ @Override
+ public Memento create() {
+ return super.create();
+ }
+
+ @Programmatic
+ @Override
+ public Memento parse(String str) {
+ return super.parse(str);
+ }
+
+ @Programmatic
+ @Override
+ public boolean canSet(Object input) {
+ return super.canSet(input);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java
new file mode 100644
index 0000000..9cf70af
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/CustomRepresentationService.java
@@ -0,0 +1,32 @@
+/*
+ * 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 webapp;
+
+import javax.ws.rs.core.Response;
+import org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceForRestfulObjects;
+
+public class CustomRepresentationService extends RepresentationServiceForRestfulObjects {
+
+ @Override
+ protected Response buildResponse(Response.ResponseBuilder responseBuilder) {
+ responseBuilder.header("X-ResponseGeneratedBy", getClass().getCanonicalName());
+ return super.buildResponse(responseBuilder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java
new file mode 100644
index 0000000..4f795b8
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/ToDoApplication.java
@@ -0,0 +1,150 @@
+/*
+ * 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 webapp;
+
+import de.agilecoders.wicket.core.Bootstrap;
+import de.agilecoders.wicket.core.settings.IBootstrapSettings;
+import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
+import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import com.google.common.base.Joiner;
+import com.google.common.io.Resources;
+import com.google.inject.AbstractModule;
+import com.google.inject.Module;
+import com.google.inject.name.Names;
+import com.google.inject.util.Modules;
+import com.google.inject.util.Providers;
+import org.apache.wicket.Session;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.request.http.WebRequest;
+import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
+import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis;
+
+
+/**
+ * As specified in <tt>web.xml</tt>.
+ *
+ * <p>
+ * See:
+ * <pre>
+ * <filter>
+ * <filter-name>wicket</filter-name>
+ * <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ * <init-param>
+ * <param-name>applicationClassName</param-name>
+ * <param-value>webapp.ToDoApplication</param-value>
+ * </init-param>
+ * </filter>
+ * </pre>
+ *
+ */
+public class ToDoApplication extends IsisWicketApplication {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * set to true for a (slightly hacky) way of allowing logins using query args, eg:
+ *
+ * <tt>?user=sven&pass=pass</tt>
+ *
+ * <p>
+ * for demos only, obviously.
+ */
+ private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false;
+
+ @Override
+ protected void init() {
+ super.init();
+
+ final IBootstrapSettings settings = Bootstrap.getSettings();
+ settings.setThemeProvider(new BootswatchThemeProvider(BootswatchTheme.Flatly));
+ }
+
+ @Override
+ public Session newSession(final Request request, final Response response) {
+ if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
+ return super.newSession(request, response);
+ }
+
+ // else demo mode
+ final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
+ final org.apache.wicket.util.string.StringValue user = request.getRequestParameters().getParameterValue("user");
+ final org.apache.wicket.util.string.StringValue password = request.getRequestParameters().getParameterValue("pass");
+ s.signIn(user.toString(), password.toString());
+ return s;
+ }
+
+ @Override
+ public WebRequest newWebRequest(final HttpServletRequest servletRequest, final String filterPath) {
+ if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
+ return super.newWebRequest(servletRequest, filterPath);
+ }
+
+ // else demo mode
+ try {
+ final String uname = servletRequest.getParameter("user");
+ if (uname != null) {
+ servletRequest.getSession().invalidate();
+ }
+ } catch (Exception ignored) {
+ }
+
+ return super.newWebRequest(servletRequest, filterPath);
+ }
+
+ @Override
+ protected Module newIsisWicketModule() {
+ final Module isisDefaults = super.newIsisWicketModule();
+
+ final Module overrides = new AbstractModule() {
+ @Override
+ protected void configure() {
+
+ bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ToDo App");
+ bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
+ bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
+ bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/images/todo%61pp-logo-header.png");
+ bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/images/todo%61pp-logo-signin.png");
+ bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines(getClass(), "welcome.html"));
+ bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("ToDo App");
+ bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
+ }
+ };
+
+ return Modules.override(isisDefaults).with(overrides);
+ }
+
+ private static String readLines(final Class<?> contextClass, final String resourceName) {
+ try {
+ final List<String> readLines = Resources.readLines(
+ Resources.getResource(contextClass, resourceName), Charset.defaultCharset());
+ final String aboutText = Joiner.on("\n").join(readLines);
+ return aboutText;
+ } catch (final IOException e) {
+ return "This is a Todo app";
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
new file mode 100644
index 0000000..a3c92b6
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
@@ -0,0 +1,71 @@
+/**
+ * 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 webapp.prototyping;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService
+@DomainServiceLayout(
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ menuOrder = "20"
+)
+public class ExternalLinksService {
+
+ public static enum ExternalLink {
+ ISIS_DOCUMENTATION("Apache Isis docs", "http://isis.apache.org/documentation.html"),
+ PROJECT_ON_GITHUB("Project source code on Github", "https://github.com/apache/isis/tree/master/example/application/todoapp/");
+
+ private final String title;
+ private final String url;
+
+ private ExternalLink(final String title, final String url) {
+ this.title = title;
+ this.url = url;
+ }
+
+ public URL open() throws MalformedURLException {
+ return new URL(url);
+ }
+
+ public String toString() {
+ return title;
+ }
+ }
+
+ @ActionLayout(
+ cssClassFa = "fa-external-link"
+ )
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @MemberOrder(name="Prototyping", sequence="91.1")
+ public URL goToDocs(@ParameterLayout(named="Link") ExternalLink link) throws MalformedURLException {
+ return link.open();
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
new file mode 100644
index 0000000..67425af
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
@@ -0,0 +1,44 @@
+/**
+ * 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 webapp.prototyping;
+
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.viewer.wicket.viewer.applib.WicketDeveloperUtilitiesService;
+
+/**
+ * These overrides are simply to 'move' the action underneath the
+ * 'Prototyping' menu.
+ */
+@DomainService
+@DomainServiceLayout(
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ named = "Prototyping",
+ menuOrder = "40")
+public class WicketDeveloperUtilities extends WicketDeveloperUtilitiesService {
+
+ @ActionLayout(named="Clear i18n Cache")
+ @MemberOrder(sequence="90.3")
+ @Override
+ public void resetI18nCache() {
+ super.resetI18nCache();
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
new file mode 100644
index 0000000..62ac918
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
@@ -0,0 +1,43 @@
+/*
+ * 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 webapp.userprof;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.services.userprof.UserProfileService;
+import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
+/**
+ * Demonstrates how to provide a custom implementation of the {@link org.apache.isis.applib.services.userprof.UserProfileService}.
+ */
+@DomainService
+public class CustomUserProfileService implements UserProfileService {
+
+ @Override
+ @Programmatic
+ public String userProfileName() {
+ return "Hi " + getAuthenticationSession().getUserName() + "!";
+ }
+
+ protected AuthenticationSession getAuthenticationSession() {
+ return IsisContext.getAuthenticationSession();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn b/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn
new file mode 100644
index 0000000..37543c9
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png b/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png
new file mode 100644
index 0000000..cd9ecfe
Binary files /dev/null and b/mothballed/example/application/todoapp/webapp/src/main/jettyconsole/isis-banner.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties b/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties
new file mode 100644
index 0000000..4335021
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/ToDoApplication_en.properties
@@ -0,0 +1,52 @@
+#
+# 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.
+#
+
+
+# override WicketSignInPage.properties
+loginHeader=Login
+registerHeader=Register
+
+# override PageAbstract.properties
+aboutLabel=About
+logoutLabel=Logout
+
+# override EntityPropertiesForm.properties and also
+# override ActionParametersFormPanel.properties
+okLabel=OK
+cancelLabel=Cancel
+editLabel=Edit
+
+
+
+
+#
+# 3rd-party components
+#
+
+# Select2Choice
+
+#noMatches=...
+#inputTooShortSingular=...
+#inputTooShortPlural=...
+#loadMore=...
+#searching=...
+
+# datatables
+#no-records-found=...
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini b/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini
new file mode 100644
index 0000000..1473390
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/realm1.ini
@@ -0,0 +1,105 @@
+#
+# 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.
+#
+
+
+# -----------------------------------------------------------------------------
+# 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, ...
+
+#
+# realm1 configures sven, dick and bob only. Additional logins are configured in realm2
+#
+
+sven = pass, admin_role
+dick = pass, readwrite_role, dashboard_role, analysis_role, self-install_role
+bob = pass, readwrite_role, dashboard_role, self-install_role
+joe = pass, readwrite_role, self-install_role, noDueBy_role
+guest = guest, readonly_role
+
+
+
+#
+# some additional users/roles
+# require IsisPermissionResolver to be configured in shiro.ini, and
+# require additional role/perms to be configured below in [roles]
+#
+
+# # fred should have access to everything except the analysis features
+# fred = pass,isisperms_all_but_analysis_role
+# # bill should have access to everything (the admin role 'trumps' the vetos)
+# bill = pass,isisperms_all_but_analysis_role,isisperms_admin_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
+
+#
+# If using the IsisLdapRealm, it could be pointed at an ini file such as this in
+# order to share role/perm mappings.
+#
+
+
+# configuring iniRealm to use Shiro's built-in WildcardPermissions
+
+readwrite_role = *:ToDoItems:*:*,\
+ *:ToDoItem:*:*
+
+readonly_role = *:ToDoItems:notYetComplete:*,\
+ *:ToDoItems:complete:*,\
+ *:ToDoItems:allToDos:*,\
+ *:ToDoItem:*:r
+
+dashboard_role = *:ToDoAppDashboardService:*:*,\
+ *:ToDoAppDashboard:*:*
+
+analysis_role = *:ToDoItemAnalysis:*:*,\
+ *:ToDoItemsByCategoryViewModel:*:*,\
+ *:ToDoItemsByDateRangeViewModel:*:*
+
+self-install_role = *:ToDoItemsFixturesService:*:*
+
+admin_role = *
+
+
+
+#
+# some additional role/perms
+# require IsisPermissionResolver to be configured in shiro.ini
+#
+
+# isisperms_all_but_analysis_role = aba/*,\
+# !aba/*:ToDoItemAnalysis:*,\
+# !aba/*:ToDoItemsByCategoryViewModel:*:*,\
+# !aba/*:ToDoItemsByDateRangeViewModel:*:*
+# isisperms_admin_role = adm/*
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html b/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html
new file mode 100644
index 0000000..97b389c
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/resources/webapp/welcome.html
@@ -0,0 +1,36 @@
+<?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.
+-->
+<p class="intro">
+ <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a platform to let you rapidly develop
+ domain-driven apps in Java.
+ <br/>
+ <br/>
+ This app has been generated using Isis'
+ <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
+ which configures Isis' most commonly used components in a straightforward "todo" app.
+ <br/>
+ <br/>
+ The core functionality of the app is provided by the
+ <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank">ToDoItem</a> domain class.
+ Supporting services provide additional capabilities.
+ <br/>
+ <br/>
+ For more details, see the <a href="http://isis.apache.org/documentation.html" target="_blank">Isis website</a>.
+</p>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
new file mode 100644
index 0000000..f3366a7
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -0,0 +1,290 @@
+# 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.
+
+
+#################################################################################
+#
+# specify system components.
+#
+# The values correspond to the named components in the installer-registry.properties file
+# in the org.apache.isis.core:isis-core-runtime JAR (in the org.apache.isis.core.runtime package)
+#
+# Although all configuration could reside in isis.properties, the recommendation is
+# to split out into component specific files:
+#
+# xxx_yyy.properties files
+#
+# where
+# * xxx is the component type, and
+# * yyy is the component name.
+#
+# For example, viewer_wicket.properties holds configuration information specific to the Wicket viewer.
+#
+#################################################################################
+
+
+#
+# configure the persistor (object store) to use
+#
+
+# JDO/DataNucleus objectstore
+isis.persistor=datanucleus
+
+
+
+#
+# configure authentication mechanism to use (to logon to the system)
+#
+
+#isis.authentication=bypass
+isis.authentication=shiro
+
+
+#
+# configure authorization mechanism to use
+#
+
+#isis.authorization=bypass
+isis.authorization=shiro
+
+
+
+
+
+#################################################################################
+#
+# MetaModel
+#
+# The metamodel typically does not require additional configuration, although
+# the system components (defined above) may refine the metamodel for their needs.
+#
+#################################################################################
+
+
+#
+# Additional programming model facet factories, or remove standard facet factories.
+# Comma separated list of fully qualified class names.
+#
+#isis.reflector.facets.include=
+#isis.reflector.facets.exclude=
+
+
+#
+# Metamodel validation (in addition to that automatically performed by the programming model facet factories)
+# Default implementation does nothing.
+#
+# Use a custom implementation to enforce additional constraints specific to your app/project/company.
+#
+#isis.reflector.validator=org.apache.isis.core.metamodel.metamodelvalidator.dflt.MetaModelValidatorDefault
+
+
+
+#
+# Whether to allow deprecated annotations/method prefixes (otherwise raise metamodel validation errors).
+# If not specified, default is to allow.
+#
+#isis.reflector.validator.allowDeprecated=false
+
+
+
+#
+# Implementation to use for reading dynamic layout. Default implementation reads Xxx.layout.json files from classpath.
+#
+#isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson
+
+
+
+#
+# patterns for applying CssClassFa facet (font-awesome icons), matching on action names
+#
+isis.reflector.facet.cssClassFa.patterns=\
+ new.*:fa-plus,\
+ add.*:fa-plus-square,\
+ create.*:fa-plus,\
+ update.*:fa-edit,\
+ change.*:fa-edit,\
+ remove.*:fa-minus-square,\
+ move.*:fa-exchange,\
+ first.*:fa-star,\
+ find.*:fa-search,\
+ lookup.*:fa-search,\
+ clear.*:fa-remove,\
+ previous.*:fa-step-backward,\
+ next.*:fa-step-forward,\
+ list.*:fa-list, \
+ all.*:fa-list, \
+ download.*:fa-download, \
+ upload.*:fa-upload, \
+ execute.*:fa-bolt, \
+ run.*:fa-bolt, \
+ calculate.*:fa-calculator, \
+ verify.*:fa-check-circle, \
+ refresh.*:fa-refresh, \
+ install.*:fa-wrench
+
+
+#
+# patterns for applying CssClass facet (CSS styles), matching on member names
+#
+isis.reflector.facet.cssClass.patterns=\
+ delete.*:btn-warning,\
+ .*:btn-default
+
+
+#################################################################################
+#
+# Value facet defaults
+#
+# (see also viewer-specific config files, eg viewer_wicket.properties)
+#
+#################################################################################
+
+# as used by @Title of a date
+isis.value.format.date=dd-MM-yyyy
+
+
+
+#################################################################################
+#
+# Facet Decorators
+#
+#################################################################################
+
+#
+# Providing such capabilities as i18n
+#
+
+isis.reflector.facet-decorators=org.apache.isis.core.metamodel.facetdecorator.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
+
+
+#################################################################################
+#
+# Application Services and fixtures
+#
+#################################################################################
+
+#
+# Specify the domain services.
+#
+# These are the most important configuration properties in the system, as they define
+# the set of the classes for Isis to instantiate as domain service singletons.
+# From these domain service instances the rest of the metamodel is discovered, while the
+# end-user gains access to other domain objects by invoking the actions of the domain services.
+#
+isis.services-installer=configuration-and-annotation
+isis.services.ServicesInstallerFromAnnotation.packagePrefix=app,\
+ dom.todo,\
+ fixture.todo,\
+ webapp.userprof,\
+ webapp.prototyping
+
+isis.services = \
+ org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,\
+ \
+ # customizable exception handling, \
+ org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,\
+ #,\
+ 1:webapp.CustomMementoService,\
+ 1:webapp.CustomRepresentationService
+
+
+# Specify the (optional) test fixtures
+#
+# Fixtures are used to seed the object store with an initial set of data. For the
+# in-memory object store, the fixtures are installed on every run. For other
+# object stores, they are used only when the object store is first initialized.
+#
+#isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven
+
+
+#
+# required by EmailServiceDefault
+#
+#isis.service.email.sender.address=some.valid@email.address
+#isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
+
+
+#
+# whether ExceptionRecognizers should also log any recognized exceptions
+# (default false; enable for diagnostics/debugging)
+#
+#isis.services.exceprecog.logRecognizedExceptions=true
+
+
+################################################################################
+#
+# Auditing, Publishing, Command
+#
+################################################################################
+
+#
+# Whether changes to objects should be audited; if not set, defaults to "none"
+# - if not set or set to "none", can explicitly enable using @DomainObject(auditing=Auditing.ENABLED)
+# - if set to "all", can explicitly disable using @Object(auditing=Auditing.DISABLED)
+#
+#isis.services.audit.objects=all|none
+
+#
+# Whether changes to objects should be published; if not set, defaults to "none"
+# - if not set or set to "none", can explicitly enable using @DomainObject(publishing=Publishing.ENABLED)
+# - if set to "all", can explicitly disable using @Object(publishing=Publishing.DISABLED)
+#
+#isis.services.publish.objects=all|none
+
+#
+# Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
+# - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
+# - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
+#
+#isis.services.publish.actions=all|none|ignoreQueryOnly
+
+
+#
+# Whether all (or all non-query only) actions should be reified as commands; if not set, defaults to "none"
+# - if not set or set to "none", can explicitly enable using @Action(command=CommandReification.ENABLED)
+# - if set to "all", can explicitly disable using @Action(command=CommandReification.DISABLED)
+#
+#isis.services.command.actions=all|none|ignoreQueryOnly
+
+
+
+################################################################################
+#
+# Policies
+#
+#################################################################################
+
+#
+# Whether editing of object properties is allowed; if not set, defaults to "true"
+# - if not set or set to "true", can explicitly disable using @DomainObject(editing=Editing.DISABLED)
+# - if set to "false", can explicitly enable using @DomainObject(editing=Editing.ENABLED)
+#
+#isis.objects.editing=true|false
+
+
+
+################################################################################
+#
+# Viewer defaults
+#
+#################################################################################
+
+#isis.viewers.paged.standalone=30
+#isis.viewers.paged.parented=10
+
+#isis.viewers.propertyLayout.labelPosition=LEFT
+#isis.viewers.parameterLayout.labelPosition=LEFT
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties
new file mode 100644
index 0000000..2eeda2c
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/logging.properties
@@ -0,0 +1,220 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+#
+# Isis uses log4j is used to provide system logging
+#
+log4j.rootCategory=INFO, Console
+#log4j.rootCategory=DEBUG, Console
+
+
+# The console appender
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.target=System.out
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
+
+
+# The stderr appender
+log4j.appender.Stderr=org.apache.log4j.ConsoleAppender
+log4j.appender.Stderr.target=System.err
+log4j.appender.Stderr.layout=org.apache.log4j.PatternLayout
+log4j.appender.Stderr.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
+
+
+# other appenders
+log4j.appender.File=org.apache.log4j.RollingFileAppender
+log4j.appender.File.file=isis.log
+log4j.appender.File.append=false
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+
+log4j.appender.sql=org.apache.log4j.FileAppender
+log4j.appender.sql.File=./logs/sql.log
+log4j.appender.sql.Append=false
+log4j.appender.sql.layout=org.apache.log4j.PatternLayout
+log4j.appender.sql.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
+
+log4j.appender.sqltiming=org.apache.log4j.FileAppender
+log4j.appender.sqltiming.File=./logs/sqltiming.log
+log4j.appender.sqltiming.Append=false
+log4j.appender.sqltiming.layout=org.apache.log4j.PatternLayout
+log4j.appender.sqltiming.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
+
+log4j.appender.jdbc=org.apache.log4j.FileAppender
+log4j.appender.jdbc.File=./logs/jdbc.log
+log4j.appender.jdbc.Append=false
+log4j.appender.jdbc.layout=org.apache.log4j.PatternLayout
+log4j.appender.jdbc.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+
+log4j.appender.connection=org.apache.log4j.FileAppender
+log4j.appender.connection.File=./logs/connection.log
+log4j.appender.connection.Append=false
+log4j.appender.connection.layout=org.apache.log4j.PatternLayout
+log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+
+log4j.appender.wicket.i18n=org.apache.log4j.RollingFileAppender
+log4j.appender.wicket.i18n.file=./logs/wicket-i18n.log
+log4j.appender.wicket.i18n.append=false
+log4j.appender.wicket.i18n.layout=org.apache.log4j.PatternLayout
+log4j.appender.wicket.i18n.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+
+
+
+
+
+! turn on the internal log4j debugging flag so we can see what it is doing
+#log4j.debug=true
+
+
+# DataNucleus
+# the first two log the DML and DDL (if set to DEBUG)
+log4j.logger.DataNucleus.Datastore.Native=WARN, Console
+log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
+# the remainder can probably be left to WARN
+log4j.logger.DataNucleus.Persistence=WARN, Console
+log4j.logger.DataNucleus.Transaction=WARN, Console
+log4j.logger.DataNucleus.Connection=WARN, Console
+log4j.logger.DataNucleus.Query=WARN, Console
+log4j.logger.DataNucleus.Cache=WARN, Console
+log4j.logger.DataNucleus.MetaData=WARN, Console
+log4j.logger.DataNucleus.Datastore=WARN, Console
+log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
+log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
+log4j.logger.DataNucleus.General=WARN, Console
+log4j.logger.DataNucleus.Lifecycle=WARN, Console
+log4j.logger.DataNucleus.ValueGeneration=WARN, Console
+log4j.logger.DataNucleus.Enhancer=WARN, Console
+log4j.logger.DataNucleus.SchemaTool=ERROR, Console
+log4j.logger.DataNucleus.JDO=WARN, Console
+log4j.logger.DataNucleus.JPA=ERROR, Console
+log4j.logger.DataNucleus.JCA=WARN, Console
+log4j.logger.DataNucleus.IDE=ERROR, Console
+
+log4j.additivity.DataNucleus.Datastore.Native=false
+log4j.additivity.DataNucleus.Datastore.Schema=false
+log4j.additivity.DataNucleus.Datastore.Persistence=false
+log4j.additivity.DataNucleus.Datastore.Transaction=false
+log4j.additivity.DataNucleus.Datastore.Connection=false
+log4j.additivity.DataNucleus.Datastore.Query=false
+log4j.additivity.DataNucleus.Datastore.Cache=false
+log4j.additivity.DataNucleus.Datastore.MetaData=false
+log4j.additivity.DataNucleus.Datastore.Datastore=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
+log4j.additivity.DataNucleus.Datastore.General=false
+log4j.additivity.DataNucleus.Datastore.Lifecycle=false
+log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
+log4j.additivity.DataNucleus.Datastore.Enhancer=false
+log4j.additivity.DataNucleus.Datastore.SchemaTool=false
+log4j.additivity.DataNucleus.Datastore.JDO=false
+log4j.additivity.DataNucleus.Datastore.JPA=false
+log4j.additivity.DataNucleus.Datastore.JCA=false
+log4j.additivity.DataNucleus.Datastore.IDE=false
+
+
+# if using log4jdbc-remix as JDBC driver
+#log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
+#log4j.additivity.jdbc.sqlonly=false
+#log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
+#log4j.additivity.jdbc.resultsettable=false
+
+#log4j.logger.jdbc.audit=WARN,jdbc, Console
+#log4j.additivity.jdbc.audit=false
+#log4j.logger.jdbc.resultset=WARN,jdbc
+#log4j.additivity.jdbc.resultset=false
+#log4j.logger.jdbc.sqltiming=WARN,sqltiming
+#log4j.additivity.jdbc.sqltiming=false
+#log4j.logger.jdbc.connection=FATAL,connection
+#log4j.additivity.jdbc.connection=false
+
+
+
+# track Isis/JDO lifecycle integration
+
+#log4j.logger.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=DEBUG, Console
+#log4j.additivity.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=false
+
+#log4j.logger.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=DEBUG,Console
+#log4j.additivity.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=false
+
+
+
+
+# track Isis/Wicket lifecycle integration
+
+#log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=DEBUG, Console
+#log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=false
+
+#log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=INFO,Console
+#log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=false
+
+
+
+# to track Wicket i18n
+log4j.logger.org.apache.wicket.Localizer=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.Localizer=false
+
+log4j.logger.org.apache.wicket.resource.loader.ClassStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ClassStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.ComponentStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ComponentStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.PackageStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.PackageStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.BundleStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.BundleStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.InitializerStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.InitializerStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=false
+
+
+
+# quieten some of the noisier classes in Isis' bootstrapping
+log4j.logger.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=WARN,Console
+log4j.additivity.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=false
+
+log4j.logger.org.apache.isis.core.metamodel.specloader.ServiceInitializer=WARN,Console
+log4j.additivity.org.apache.isis.core.metamodel.specloader.ServiceInitializer=false
+
+log4j.logger.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=WARN,Console
+log4j.additivity.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=false
+
+log4j.logger.org.apache.isis.core.commons.config.IsisConfigurationDefault=WARN,Console
+log4j.additivity.org.apache.isis.core.commons.config.IsisConfigurationDefault=false
+
+log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN,Console
+log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false
+
+
+
+
+# Application-specific logging
+log4j.logger.dom.todo.ToDoItem=DEBUG, Stderr
+log4j.additivity.dom.todo.ToDoItem=false
+
+log4j.logger.dom.todo.ToDoItemSubscriptions=DEBUG, Stderr
+log4j.additivity.dom.todo.ToDoItemSubscriptions=false
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties
new file mode 100644
index 0000000..bcb9348
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor.properties
@@ -0,0 +1,129 @@
+# 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.
+
+
+#################################################################################
+#
+# Persistor
+#
+#################################################################################
+
+
+
+# generally speaking this should not be enabled
+isis.persistor.disableConcurrencyChecking=false
+
+
+
+
+#################################################################################
+#
+# JDBC configuration
+#
+#################################################################################
+
+
+
+#
+# configuration file holding the JDO objectstore's JDBC configuration
+# (this is a bit of a hack... just exploiting fact that Isis also loads this file)
+#
+
+
+#
+# JDBC connection details
+# (also update the pom.xml to reference the appropriate JDBC driver)
+#
+
+
+#
+# HSQLDB in-memory
+#
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+#
+# HSQLDB in-memory (using log4jdbc-remix)
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+
+
+#
+# HSQLDB to file
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+#
+# HSQLDB to file (using log4jdbc-remix)
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+
+
+#
+# PostgreSQL Server
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.postgresql.Driver
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:postgresql://localhost:5432/isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+#
+# PostgreSQL Server (using log4jdbc-remix)
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:postgresql://localhost:5432/isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+
+
+#
+# MS SQL Server
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+#
+# MS SQL Server (using log4jdbc-remix)
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+
+
+#
+# neo4j
+# (experimental; run with '-P neo4j' profile in webapp project)
+#
+#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=neo4j:neo4j_DB
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
new file mode 100644
index 0000000..a60a733
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
@@ -0,0 +1,88 @@
+# 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.
+
+#
+# configuration file for the JDO/DataNucleus objectstore
+#
+
+# identifies @PersistenceCapable entities to be eagerly registered
+# if move class to other package (eg com.mycompany.myapp.dom) then update
+isis.persistor.datanucleus.RegisterEntities.packagePrefix=dom
+
+# whether to persist the event data as a "clob" or as a "zipped" byte[]
+# default is "zipped"
+#isis.persistor.datanucleus.PublishingService.serializedForm=zipped
+
+
+
+#####################################################################
+#
+# DataNucleus' configuration
+#
+# The 'isis.persistor.datanucleus.impl' prefix is stripped off,
+# remainder is passed through to DataNucleus
+#
+#####################################################################
+
+isis.persistor.datanucleus.impl.datanucleus.autoCreateSchema=true
+isis.persistor.datanucleus.impl.datanucleus.validateTables=true
+isis.persistor.datanucleus.impl.datanucleus.validateConstraints=true
+
+
+#
+# Require explicit persistence (since entities are Comparable and using ObjectContracts#compareTo).
+# see http://www.datanucleus.org/products/accessplatform_3_0/jdo/transaction_types.html
+#
+isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false
+
+
+#
+# How column names are identified
+# (http://www.datanucleus.org/products/datanucleus/jdo/orm/datastore_identifiers.html)
+#
+isis.persistor.datanucleus.impl.datanucleus.identifier.case=PreserveCase
+
+
+#
+# L2 cache
+# off except if explicitly marked as cacheable
+# http://www.datanucleus.org/products/datanucleus/jdo/cache.html
+#
+isis.persistor.datanucleus.impl.datanucleus.cache.level2.type=none
+isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode=ENABLE_SELECTIVE
+
+
+
+#
+# uncomment to use JNDI rather than direct JDBC
+#
+#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart
+
+#
+# uncomment to use JTA resource
+#
+#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactory2Name=java:comp/env/jdbc/quickstart-nontx
+#isis.persistor.datanucleus.impl.javax.jdo.option.TransactionType=JTA
+
+
+
+#
+#
+# JDBC connection details
+# ... are in persistor.properties
+#
+#
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini
new file mode 100644
index 0000000..07ea04f
--- /dev/null
+++ b/mothballed/example/application/todoapp/webapp/src/main/webapp/WEB-INF/shiro.ini
@@ -0,0 +1,103 @@
+#
+# 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]
+
+#######
+# configure a couple of iniRealms
+# (nb: not possible for their .ini files to live in WEB-INF, because Shiro does not
+# provide a mechanism to load resources from that location)
+#######
+
+realm1 = org.apache.shiro.realm.text.IniRealm
+realm1.resourcePath=classpath:webapp/realm1.ini
+
+
+
+
+#######
+# configure an ldap-based realm
+#######
+
+contextFactory = org.apache.isis.security.shiro.IsisLdapContextFactory
+contextFactory.url = ldap://localhost:10389
+contextFactory.authenticationMechanism = CRAM-MD5
+contextFactory.systemAuthenticationMechanism = simple
+contextFactory.systemUsername = uid=admin,ou=system
+contextFactory.systemPassword = secret
+
+ldapRealm = org.apache.isis.security.shiro.IsisLdapRealm
+ldapRealm.contextFactory = $contextFactory
+
+ldapRealm.searchBase = ou=groups,o=mojo
+ldapRealm.groupObjectClass = groupOfUniqueNames
+ldapRealm.uniqueMemberAttribute = uniqueMember
+ldapRealm.uniqueMemberAttributeValueTemplate = uid={0}
+
+# optional mapping from physical groups to logical application roles
+#ldapRealm.rolesByGroup = \
+# LDN_USERS: user_role,\
+# NYK_USERS: user_role,\
+# HKG_USERS: user_role,\
+# GLOBAL_ADMIN: admin_role,\
+# DEMOS: self-install_role
+
+# configuring ldapRealm role/perm mappings
+# (use same as realm1)
+ldapRealm.resourcePath=classpath:webapp/realm1.ini
+
+
+#######
+# configure security manager to use realm(s)
+#######
+
+# authenticate/authorize using realm1
+securityManager.realms = $realm1
+
+
+# or to use ldap with realm1 as a backup...
+# (see docs for details of how to setup users/groups in Apache Directory Studio).
+#securityManager.realms = $ldapRealm,$realm1
+
+
+# or to just use this .ini file...
+# (would require [users] and [roles] to be set up)
+#securityManager.realms = $iniRealm
+
+
+
+#######
+# optional, configure realm(s) to use Isis' extended permission syntax
+# (see webapp/realm1.ini for usage)
+#######
+
+# permissionResolver = org.apache.isis.security.shiro.authorization.IsisPermissionResolver
+# realm1.permissionResolver = $permissionResolver
+# realm2.permissionResolver = $permissionResolver
+
+
+# -----------------------------------------------------------------------------
+# Users and their assigned roles
+# -----------------------------------------------------------------------------
+
+[users]
+# unused (assuming not configured $iniRealm)
+
+[roles]
+# unused (assuming not configured $iniRealm)
[24/29] isis git commit: ISIS-903: TranslationService, LocaleProvider,
TrString class,
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
index 0643ace..5a6e10c 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
@@ -20,6 +20,8 @@
package org.apache.isis.progmodels.dflt;
import org.apache.isis.core.metamodel.facets.actions.action.ActionAnnotationFacetFactory;
+import org.apache.isis.core.metamodel.facets.actions.contributing.maxlenannot.MaxLengthFacetOnActionAnnotationFactory;
+import org.apache.isis.core.metamodel.facets.actions.contributing.paged.PagedFacetOnActionFactory;
import org.apache.isis.core.metamodel.facets.actions.debug.annotation.DebugFacetAnnotationFactory;
import org.apache.isis.core.metamodel.facets.actions.defaults.method.ActionDefaultsFacetViaMethodFactory;
import org.apache.isis.core.metamodel.facets.actions.exploration.annotation.ExplorationFacetAnnotationFactory;
@@ -31,9 +33,8 @@ import org.apache.isis.core.metamodel.facets.actions.notcontributed.derived.NotC
import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.annotation.NotInServiceMenuFacetAnnotationFactory;
import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.derived.NotInServiceMenuFacetDerivedFromDomainServiceFacetFactory;
import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.method.NotInServiceMenuFacetViaMethodFactory;
-import org.apache.isis.core.metamodel.facets.actions.contributing.paged.PagedFacetOnActionFactory;
import org.apache.isis.core.metamodel.facets.actions.validate.method.ActionValidationFacetViaMethodFactory;
-import org.apache.isis.core.metamodel.facets.actions.contributing.maxlenannot.MaxLengthFacetOnActionAnnotationFactory;
+import org.apache.isis.core.metamodel.facets.all.i18n.I18nFacetFactory;
import org.apache.isis.core.metamodel.facets.collections.accessor.CollectionAccessorFacetViaAccessorFactory;
import org.apache.isis.core.metamodel.facets.collections.clear.CollectionClearFacetFactory;
import org.apache.isis.core.metamodel.facets.collections.collection.CollectionAnnotationFacetFactory;
@@ -50,12 +51,12 @@ import org.apache.isis.core.metamodel.facets.members.cssclass.annotprop.CssClass
import org.apache.isis.core.metamodel.facets.members.cssclassfa.annotprop.CssClassFaFacetOnMemberFactory;
import org.apache.isis.core.metamodel.facets.members.describedas.annotprop.DescribedAsFacetOnMemberFactory;
import org.apache.isis.core.metamodel.facets.members.describedas.staticmethod.DescribedAsFacetStaticMethodFactory;
-import org.apache.isis.core.metamodel.facets.members.disabled.layout.DisabledFacetOnMemberFromPropertiesFactory;
import org.apache.isis.core.metamodel.facets.members.disabled.forsession.DisableForSessionFacetViaMethodFactory;
+import org.apache.isis.core.metamodel.facets.members.disabled.layout.DisabledFacetOnMemberFromPropertiesFactory;
import org.apache.isis.core.metamodel.facets.members.disabled.method.DisableForContextFacetViaMethodFactory;
import org.apache.isis.core.metamodel.facets.members.disabled.staticmethod.DisabledFacetStaticMethodFacetFactory;
-import org.apache.isis.core.metamodel.facets.members.hidden.layout.HiddenFacetOnMemberFromPropertiesFactory;
import org.apache.isis.core.metamodel.facets.members.hidden.forsession.HideForSessionFacetViaMethodFactory;
+import org.apache.isis.core.metamodel.facets.members.hidden.layout.HiddenFacetOnMemberFromPropertiesFactory;
import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethodFactory;
import org.apache.isis.core.metamodel.facets.members.hidden.staticmethod.HiddenFacetStaticMethodFactory;
import org.apache.isis.core.metamodel.facets.members.named.annotprop.NamedFacetOnMemberFactory;
@@ -493,11 +494,13 @@ public final class ProgrammingModelFacetsJava5 extends ProgrammingModelAbstract
// should come near the end, after any facets that install PropertySetterFacet have run.
addFactory(DisabledFacetOnPropertyInferredFactory.class);
-
addFactory(AuditableFacetMarkerInterfaceFactory.class);
addFactory(FacetsFacetAnnotationFactory.class);
+ // must be after all named facets and description facets have been installed
+ addFactory(I18nFacetFactory.class);
+
addFactory(ViewModelSemanticCheckingFacetFactory.class);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java
new file mode 100644
index 0000000..dcf4ed0
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java
@@ -0,0 +1,52 @@
+/*
+ * 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.core.runtime.services;
+
+import java.util.List;
+import com.google.common.collect.Lists;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.isis.core.commons.config.InstallerAbstract;
+import org.apache.isis.core.metamodel.services.i18n.LocaleProviderDefault;
+import org.apache.isis.core.metamodel.services.i18n.TranslationServiceLogging;
+import org.apache.isis.core.runtime.system.DeploymentType;
+
+public class ServicesInstallerFallback extends InstallerAbstract implements ServicesInstaller {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ServicesInstallerFallback.class);
+
+ public ServicesInstallerFallback() {
+ super(ServicesInstaller.TYPE, "fallback");
+ }
+
+ @Override
+ public List<Object> getServices(final DeploymentType deploymentType) {
+ return Lists.newArrayList(new TranslationServiceLogging(), new LocaleProviderDefault());
+ }
+
+ @Override
+ public void setIgnoreFailures(final boolean ignoreFailures) {
+ }
+
+ @Override
+ public List<Class<?>> getTypes() {
+ return listOf(List.class); // ie List<Object.class>, of services
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
index 44dbd52..9ae9429 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
@@ -38,6 +38,7 @@ public class ServicesInstallerFromConfigurationAndAnnotation extends InstallerAb
private final ServiceInstantiator serviceInstantiator;
private final ServicesInstallerFromConfiguration servicesInstallerFromConfiguration;
private final ServicesInstallerFromAnnotation servicesInstallerFromAnnotation;
+ private final ServicesInstallerFallback servicesInstallerDefaults;
public ServicesInstallerFromConfigurationAndAnnotation() {
@@ -50,6 +51,7 @@ public class ServicesInstallerFromConfigurationAndAnnotation extends InstallerAb
this.serviceInstantiator = serviceInstantiator;
servicesInstallerFromConfiguration = new ServicesInstallerFromConfiguration(serviceInstantiator);
servicesInstallerFromAnnotation = new ServicesInstallerFromAnnotation(serviceInstantiator);
+ servicesInstallerDefaults = new ServicesInstallerFallback();
}
public void setIgnoreFailures(boolean ignoreFailures) {
@@ -60,22 +62,26 @@ public class ServicesInstallerFromConfigurationAndAnnotation extends InstallerAb
public void setConfigurationBuilder(IsisConfigurationBuilder isisConfigurationBuilder) {
servicesInstallerFromConfiguration.setConfigurationBuilder(isisConfigurationBuilder);
servicesInstallerFromAnnotation.setConfigurationBuilder(isisConfigurationBuilder);
+ servicesInstallerDefaults.setConfigurationBuilder(isisConfigurationBuilder);
}
@Override
public void setConfiguration(IsisConfiguration configuration) {
servicesInstallerFromConfiguration.setConfiguration(configuration);
servicesInstallerFromAnnotation.setConfiguration(configuration);
+ servicesInstallerDefaults.setConfiguration(configuration);
}
public void init() {
servicesInstallerFromConfiguration.init();
servicesInstallerFromAnnotation.init();
+ servicesInstallerDefaults.init();
}
public void shutdown() {
servicesInstallerFromConfiguration.shutdown();
servicesInstallerFromAnnotation.shutdown();
+ servicesInstallerDefaults.shutdown();
}
// //////////////////////////////////////
@@ -96,6 +102,10 @@ public class ServicesInstallerFromConfigurationAndAnnotation extends InstallerAb
serviceList = ServicesInstallerUtils.instantiateServicesFrom(positionedServices, serviceInstantiator);
+ // add defaults to the end
+ final List<Object> defaultServices = servicesInstallerDefaults.getServices(deploymentType);
+ serviceList.addAll(defaultServices);
+
servicesByDeploymentType.put(deploymentType, serviceList);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index 9a57b37..3cafcdd 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -160,19 +160,6 @@ isis.value.format.date=dd-MM-yyyy
#################################################################################
#
-# Facet Decorators
-#
-#################################################################################
-
-#
-# Providing such capabilities as i18n
-#
-
-isis.reflector.facet-decorators=org.apache.isis.core.metamodel.facetdecorator.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
-
-
-#################################################################################
-#
# Application Services and fixtures
#
#################################################################################
[03/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..35a765e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,365 @@
+<?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>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+
+ <name>ToDo App</name>
+
+ <packaging>pom</packaging>
+
+ <prerequisites>
+ <maven>3.0.4</maven>
+ </prerequisites>
+
+ <properties>
+ <isis.version>1.8.0-SNAPSHOT</isis.version>
+ <isis-viewer-wicket.version>1.8.0-SNAPSHOT</isis-viewer-wicket.version>
+
+ <!-- must be consistent with the versions defined by the JDO Objectstore -->
+ <datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
+ <datanucleus-maven-plugin.version>3.3.2</datanucleus-maven-plugin.version>
+
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshots</name>
+ <url>https://repository.apache.org/content/repositories/snapshots/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>Cloudbees snapshots</id>
+ <url>http://repository-estatio.forge.cloudbees.com/snapshot/</url>
+ <snapshots>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ <executions>
+ <execution>
+ <id>source</id>
+ <phase>compile</phase>
+ </execution>
+ <execution>
+ <id>test</id>
+ <phase>test-compile</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ <include>**/*Test$*.java</include>
+ <include>**/*Test_*.java</include>
+ <include>**/*Spec*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Test*.java</exclude>
+ <exclude>**/*ForTesting.java</exclude>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ <useFile>true</useFile>
+ <printSummary>true</printSummary>
+ <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ <include>**/*Test$*.java</include>
+ <include>**/*Test_*.java</include>
+ <include>**/*Spec*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Test*.java</exclude>
+ <exclude>**/*ForTesting.java</exclude>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ <showSuccess>false</showSuccess>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.5.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.3</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.26</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- http://simplericity.com/2009/11/10/1257880778509.html -->
+ <plugin>
+ <groupId>org.simplericity.jettyconsole</groupId>
+ <artifactId>jetty-console-maven-plugin</artifactId>
+ <!-- update to 1.54 reversed,since seems compiled against 1.7 (major.minor version 51.0) -->
+ <version>1.43</version>
+ </plugin>
+
+ <!-- Apache Release Audit Tool -->
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.10</version>
+ <configuration>
+ <addDefaultLicenseMatchers>true</addDefaultLicenseMatchers>
+ <excludeSubProjects>true</excludeSubProjects>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ <exclude>**/target-ide/**</exclude>
+
+ <exclude>**/*.project</exclude>
+ <exclude>**/.classpath</exclude>
+ <exclude>**/.settings/**</exclude>
+ <exclude>**/*.launch</exclude>
+ <exclude>**/ide/eclipse/launch/**</exclude>
+ <exclude>**/ide/intellij/launch/**</exclude>
+ <exclude>src/site/resources/ide/eclipse/**</exclude>
+
+ <exclude>**/rebel.xml</exclude>
+ <exclude>**/*.gitignore</exclude>
+ <exclude>**/*.log</exclude>
+ <exclude>**/*.pdn</exclude>
+ <exclude>**/*.svg</exclude>
+ <exclude>**/*.json</exclude>
+ <exclude>**/*.min.js</exclude>
+ <exclude>**/*.js</exclude>
+ </excludes>
+ <licenses>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>AL2</licenseFamilyCategory>
+ <licenseFamilyName>Apache License 2.0</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Licensed to the Apache Software Foundation (ASF) under one</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>JQRY</licenseFamilyCategory>
+ <licenseFamilyName>MIT</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Dual licensed under the MIT or GPL Version 2 licenses.</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>JMOCK</licenseFamilyCategory>
+ <licenseFamilyName>JMock</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Copyright (c) 2000-2007, jMock.org</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>DOCBK</licenseFamilyCategory>
+ <licenseFamilyName>DocBook 4.5</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Permission to copy in any form is granted for use</pattern>
+ <pattern>Permission to use, copy, modify and distribute the DocBook DTD</pattern>
+ <pattern>is hereby granted in perpetuity, provided that the above copyright</pattern>
+ <pattern>This is the catalog data file for DocBook XML V4.5. It is provided as</pattern>
+ <pattern>XML Catalog data for DocBook XML V4.5</pattern>
+ <pattern>DocBook additional general entities V4.5</pattern>
+ <pattern>XML EXCHANGE TABLE MODEL DECLARATION MODULE</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>W3C</licenseFamilyCategory>
+ <licenseFamilyName>XHTML</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),</pattern>
+ </patterns>
+ </license>
+ </licenses>
+ <licenseFamilies>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>Apache License 2.0</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>MIT</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>JMock</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>DocBook 4.5</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>XHTML</familyName>
+ </licenseFamily>
+ </licenseFamilies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis</artifactId>
+ <version>${isis.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.viewer</groupId>
+ <artifactId>isis-viewer-wicket</artifactId>
+ <version>${isis-viewer-wicket.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+
+ <!-- this project's own modules -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-dom</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-fixture</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-webapp</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+
+ </dependencies>
+ </dependencyManagement>
+
+
+ <profiles>
+ <profile>
+ <id>m2e</id>
+ <activation>
+ <property>
+ <name>m2e.version</name>
+ </property>
+ </activation>
+ <build>
+ <directory>target-ide</directory>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
new file mode 100644
index 0000000..358e3d9
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
@@ -0,0 +1,26 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
+ </mapAttribute>
+ <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
+ <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+ <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+ </listAttribute>
+ <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
+ <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
+ <stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
+ <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
+ <stringAttribute value="${jrebel_args} -Drebel.log=false -Drebel.check_class_hash=true -Drebel.packages_exclude=org.apache.isis -Dproject.root=${project_loc}/.. -Dtarget.dir=target-ide -Drebel.plugins=C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar -Disis-jrebel-plugin.packagePrefix=dom.todo,org.apache.isis.objectstore.jdo.applib -Disis-jrebel-plugin.loggingLevel=warn -XX:MaxPermSize=128m" key="org.eclipse.jdt.launching.VM_ARGUMENTS"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
new file mode 100644
index 0000000..3376620
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
@@ -0,0 +1,22 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
+ </mapAttribute>
+ <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
+ <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
+ <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
+ <stringAttribute value="--port 8080 -D isis.persistor.datanucleus.install-fixtures=true --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
+ <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
new file mode 100644
index 0000000..4fd7be2
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
@@ -0,0 +1,25 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
+ </mapAttribute>
+ <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
+ <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+ <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+ </listAttribute>
+ <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
+ <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
+ <stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
+ <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
new file mode 100644
index 0000000..2e2e0ea
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
@@ -0,0 +1,25 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
+ </mapAttribute>
+ <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
+ <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+ <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+ </listAttribute>
+ <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
+ <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
+ <stringAttribute value="--port 8080 --type SERVER" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
+ <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt
new file mode 100644
index 0000000..4160805
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt
@@ -0,0 +1,6 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+Copy into workspace${symbol_escape}.idea${symbol_escape}runConfigurations directory, and adjust file paths for Maven tasks.
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
new file mode 100644
index 0000000..a1e657d
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
@@ -0,0 +1,32 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<component name="ProjectRunConfigurationManager">
+ <configuration default="false" name="TodoApp-PROTOTYPE" type="Application" factoryName="Application" singleton="true">
+ <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
+ <option name="MAIN_CLASS_NAME" value="org.apache.isis.WebServer" />
+ <option name="VM_PARAMETERS" value="" />
+ <option name="PROGRAM_PARAMETERS" value="--type SERVER_PROTOTYPE --port 8080" />
+ <option name="WORKING_DIRECTORY" value="file://${symbol_dollar}MODULE_DIR${symbol_dollar}" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" value="" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <option name="ENV_VARIABLES" />
+ <option name="PASS_PARENT_ENVS" value="true" />
+ <module name="${parentArtifactId}-webapp" />
+ <envs />
+ <RunnerSettings RunnerId="Debug">
+ <option name="DEBUG_PORT" value="" />
+ <option name="TRANSPORT" value="0" />
+ <option name="LOCAL" value="true" />
+ </RunnerSettings>
+ <RunnerSettings RunnerId="Run" />
+ <ConfigurationWrapper RunnerId="Debug" />
+ <ConfigurationWrapper RunnerId="Run" />
+ <method>
+ <option name="Make" enabled="false" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/${parentArtifactId}/dom/pom.xml" goal="datanucleus:enhance -o" />
+ </method>
+ </configuration>
+</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
new file mode 100644
index 0000000..536351b
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
@@ -0,0 +1,26 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<component name="ProjectRunConfigurationManager">
+ <configuration default="false" name="TodoApp (enhance only)" type="Application" factoryName="Application">
+ <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
+ <option name="MAIN_CLASS_NAME" value="org.apache.isis.Dummy" />
+ <option name="VM_PARAMETERS" value="" />
+ <option name="PROGRAM_PARAMETERS" value="" />
+ <option name="WORKING_DIRECTORY" value="file://${symbol_dollar}MODULE_DIR${symbol_dollar}" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" value="" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <option name="ENV_VARIABLES" />
+ <option name="PASS_PARENT_ENVS" value="true" />
+ <module name="${parentArtifactId}-webapp" />
+ <envs />
+ <RunnerSettings RunnerId="Run" />
+ <ConfigurationWrapper RunnerId="Run" />
+ <method>
+ <option name="Make" enabled="false" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
+ <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/${parentArtifactId}/dom/pom.xml" goal="datanucleus:enhance -o" />
+ </method>
+ </configuration>
+</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore
new file mode 100644
index 0000000..70eee7e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore
@@ -0,0 +1,5 @@
+#
+# explicitly ignoring Microsoft JDBC4 jar
+# (cannot redistribute, licensing)
+#
+sqljdbc4.jar
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
new file mode 100644
index 0000000..37f8549
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
@@ -0,0 +1,346 @@
+<?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>${groupId}</groupId>
+ <artifactId>${rootArtifactId}</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <artifactId>${artifactId}</artifactId>
+ <name>ToDo App Webapp</name>
+
+ <description>This module runs both the Wicket viewer and the Restfulobjects viewer in a single webapp configured to run using the datanucleus object store.</description>
+
+ <packaging>war</packaging>
+
+ <properties>
+ <siteBaseDir>..</siteBaseDir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ </plugin>
+
+ <!-- mvn package -->
+ <plugin>
+ <groupId>org.simplericity.jettyconsole</groupId>
+ <artifactId>jetty-console-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>createconsole</goal>
+ </goals>
+ <configuration>
+ <backgroundImage>${basedir}/src/main/jettyconsole/isis-banner.png</backgroundImage>
+ <destinationFile>${project.build.directory}/${project.build.finalName}-jetty-console.jar</destinationFile>
+ </configuration>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>maven-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <warName>todoapp</warName>
+ <archive>
+ <manifest>
+ <addClasspath>false</addClasspath>
+ </manifest>
+ <manifestEntries>
+ <Build-Time>${maven.build.timestamp}</Build-Time>
+ <Build-Host>${agent.name}</Build-Host>
+ <Build-User>${user.name}</Build-User>
+ <Build-Maven>Maven ${maven.version}</Build-Maven>
+ <Build-Java>${java.version}</Build-Java>
+ <Build-OS>${os.name}</Build-OS>
+ <Build-Label>${project.version}</Build-Label>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <versionRange>[1.5,)</versionRange>
+ <goals>
+ <goal>maven-version</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <dependencies>
+
+ <!-- other modules in this project -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-dom</artifactId>
+ <exclusions>
+ <exclusion>
+ <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-enhancer</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-fixture</artifactId>
+ <exclusions>
+ <exclusion>
+ <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-enhancer</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- other isis components -->
+ <dependency>
+ <groupId>org.apache.isis.viewer</groupId>
+ <artifactId>isis-viewer-wicket-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-viewer-restfulobjects-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-security-shiro</artifactId>
+ </dependency>
+
+
+ <!-- isis core -->
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-wrapper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-security</artifactId>
+ </dependency>
+
+
+ <!-- to run using WebServer (optional) -->
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-webserver</artifactId>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ <!--
+ removed so can run o.a.i.WebServer from within IntelliJ;
+ can rely on servlet container to ignore this in war file
+ <scope>provided</scope>
+ -->
+ </dependency>
+
+ <!--
+ JDBC drivers
+ (for jdo objectstore)
+ -->
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>9.1-901.jdbc4</version>
+ </dependency>
+ -->
+
+ <!--
+ mvn install:install-file -Dfile=sqljdbc4.jar \
+ -DgroupId=com.microsoft.sqlserver \
+ -DartifactId=jdbc \
+ -Dversion=4.0 \
+ -Dpackaging=jar
+ -->
+ <!--
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>sqljdbc4</artifactId>
+ <version>4.0</version>
+ </dependency>
+ -->
+
+ <dependency>
+ <groupId>org.lazyluke</groupId>
+ <artifactId>log4jdbc-remix</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>self-host</id>
+ <build>
+ <plugins>
+ <!--
+ mvn -P self-host antrun:run
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+ <exec executable="java" failonerror="true">
+ <arg value="-jar" />
+ <arg value="${project.build.directory}/${project.build.finalName}-jetty-console.jar" />
+ </exec>
+ </tasks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>jrebel</id>
+ <properties>
+ <!-- as used in the rebel.xml in the dom project -->
+ <target.dir>target</target.dir>
+ <isis-jrebel-plugin.packagePrefix>dom.todo,org.apache.isis.objectstore.jdo.applib</isis-jrebel-plugin.packagePrefix>
+ <isis-jrebel-plugin.loggingLevel>warn</isis-jrebel-plugin.loggingLevel>
+ </properties>
+ <build>
+ <plugins>
+ <!--
+ mvn -P jrebel antrun:run \
+ -Djrebel.jar="C:/Users/Dan/.IdeaIC13/config/plugins/jr-ide-idea/lib/jrebel/jrebel.jar" \
+ -Disis_jrebel_plugin.jar="C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar"
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <target>
+ <property name="compile_classpath" refid="maven.compile.classpath" />
+ <property name="runtime_classpath" refid="maven.runtime.classpath" />
+ <property name="test_classpath" refid="maven.test.classpath" />
+ <property name="plugin_classpath" refid="maven.plugin.classpath" />
+
+ <echo message="" />
+ <echo message="" />
+ <echo message="jrebel.jar = ${jrebel.jar}" />
+ <echo message="isis_jrebel_plugin.jar = ${isis_jrebel_plugin.jar}" />
+ <echo message="target.dir = ${target.dir}" />
+ <echo message="" />
+ <echo message="" />
+
+ <exec executable="java" failonerror="true">
+ <arg value="-javaagent:${jrebel.jar}" />
+ <arg value="-Drebel.log=false" />
+ <arg value="-Drebel.check_class_hash=true" />
+ <arg value="-Drebel.packages_exclude=org.apache.isis" />
+
+ <!-- as used in the rebel.xml in the dom project -->
+ <arg value="-Dproject.root=${project.basedir}/.." />
+ <arg value="-Dtarget.dir=${target.dir}" />
+
+ <arg value="-Drebel.plugins=${isis_jrebel_plugin.jar}" />
+ <arg value="-Disis-jrebel-plugin.packagePrefix=${isis-jrebel-plugin.packagePrefix}" />
+ <arg value="-Disis-jrebel-plugin.loggingLevel=${isis-jrebel-plugin.loggingLevel}" />
+ <arg value="-XX:MaxPermSize=128m" />
+ <arg value="-classpath" />
+ <arg value="${runtime_classpath}" />
+ <arg value="org.apache.isis.WebServer" />
+ </exec>
+ </target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>neo4j</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-neo4j</artifactId>
+ <version>3.2.3</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java
new file mode 100644
index 0000000..dc619cd
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java
@@ -0,0 +1,64 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package webapp;
+
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.core.runtime.services.memento.MementoServiceDefault;
+
+
+/**
+ * Demonstrates how to register a replacement for one of the default framework-provided services.
+ *
+ * <p>
+ * In <code>isis.properties</code>, is registered using:
+ * </p>
+ *
+ * <pre>
+ * isis.services = ${symbol_escape}
+ * ...,
+ * 1:webapp.CustomMementoService,
+ * ...,
+ * </pre>
+ * <p>
+ * that is, with a menuOrder of 1.
+ * </p>
+ */
+public class CustomMementoService extends MementoServiceDefault {
+
+ @Programmatic
+ @Override
+ public Memento create() {
+ return super.create();
+ }
+
+ @Programmatic
+ @Override
+ public Memento parse(String str) {
+ return super.parse(str);
+ }
+
+ @Programmatic
+ @Override
+ public boolean canSet(Object input) {
+ return super.canSet(input);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java
new file mode 100644
index 0000000..08c2339
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java
@@ -0,0 +1,35 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package webapp;
+
+import javax.ws.rs.core.Response;
+import org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceForRestfulObjects;
+
+public class CustomRepresentationService extends RepresentationServiceForRestfulObjects {
+
+ @Override
+ protected Response buildResponse(Response.ResponseBuilder responseBuilder) {
+ responseBuilder.header("X-ResponseGeneratedBy", getClass().getCanonicalName());
+ return super.buildResponse(responseBuilder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java
new file mode 100644
index 0000000..236db03
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java
@@ -0,0 +1,153 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package webapp;
+
+import de.agilecoders.wicket.core.Bootstrap;
+import de.agilecoders.wicket.core.settings.IBootstrapSettings;
+import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
+import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import com.google.common.base.Joiner;
+import com.google.common.io.Resources;
+import com.google.inject.AbstractModule;
+import com.google.inject.Module;
+import com.google.inject.name.Names;
+import com.google.inject.util.Modules;
+import com.google.inject.util.Providers;
+import org.apache.wicket.Session;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.request.http.WebRequest;
+import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
+import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis;
+
+
+/**
+ * As specified in <tt>web.xml</tt>.
+ *
+ * <p>
+ * See:
+ * <pre>
+ * <filter>
+ * <filter-name>wicket</filter-name>
+ * <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ * <init-param>
+ * <param-name>applicationClassName</param-name>
+ * <param-value>webapp.ToDoApplication</param-value>
+ * </init-param>
+ * </filter>
+ * </pre>
+ *
+ */
+public class ToDoApplication extends IsisWicketApplication {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * set to true for a (slightly hacky) way of allowing logins using query args, eg:
+ *
+ * <tt>?user=sven&pass=pass</tt>
+ *
+ * <p>
+ * for demos only, obviously.
+ */
+ private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false;
+
+ @Override
+ protected void init() {
+ super.init();
+
+ final IBootstrapSettings settings = Bootstrap.getSettings();
+ settings.setThemeProvider(new BootswatchThemeProvider(BootswatchTheme.Flatly));
+ }
+
+ @Override
+ public Session newSession(final Request request, final Response response) {
+ if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
+ return super.newSession(request, response);
+ }
+
+ // else demo mode
+ final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
+ final org.apache.wicket.util.string.StringValue user = request.getRequestParameters().getParameterValue("user");
+ final org.apache.wicket.util.string.StringValue password = request.getRequestParameters().getParameterValue("pass");
+ s.signIn(user.toString(), password.toString());
+ return s;
+ }
+
+ @Override
+ public WebRequest newWebRequest(final HttpServletRequest servletRequest, final String filterPath) {
+ if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
+ return super.newWebRequest(servletRequest, filterPath);
+ }
+
+ // else demo mode
+ try {
+ final String uname = servletRequest.getParameter("user");
+ if (uname != null) {
+ servletRequest.getSession().invalidate();
+ }
+ } catch (Exception ignored) {
+ }
+
+ return super.newWebRequest(servletRequest, filterPath);
+ }
+
+ @Override
+ protected Module newIsisWicketModule() {
+ final Module isisDefaults = super.newIsisWicketModule();
+
+ final Module overrides = new AbstractModule() {
+ @Override
+ protected void configure() {
+
+ bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ToDo App");
+ bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
+ bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
+ bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/images/todo%61pp-logo-header.png");
+ bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/images/todo%61pp-logo-signin.png");
+ bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines(getClass(), "welcome.html"));
+ bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("ToDo App");
+ bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
+ }
+ };
+
+ return Modules.override(isisDefaults).with(overrides);
+ }
+
+ private static String readLines(final Class<?> contextClass, final String resourceName) {
+ try {
+ final List<String> readLines = Resources.readLines(
+ Resources.getResource(contextClass, resourceName), Charset.defaultCharset());
+ final String aboutText = Joiner.on("${symbol_escape}n").join(readLines);
+ return aboutText;
+ } catch (final IOException e) {
+ return "This is a Todo app";
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
new file mode 100644
index 0000000..4686948
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
@@ -0,0 +1,74 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package webapp.prototyping;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService
+@DomainServiceLayout(
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ menuOrder = "20"
+)
+public class ExternalLinksService {
+
+ public static enum ExternalLink {
+ ISIS_DOCUMENTATION("Apache Isis docs", "http://isis.apache.org/documentation.html"),
+ PROJECT_ON_GITHUB("Project source code on Github", "https://github.com/apache/isis/tree/master/example/application/${parentArtifactId}/");
+
+ private final String title;
+ private final String url;
+
+ private ExternalLink(final String title, final String url) {
+ this.title = title;
+ this.url = url;
+ }
+
+ public URL open() throws MalformedURLException {
+ return new URL(url);
+ }
+
+ public String toString() {
+ return title;
+ }
+ }
+
+ @ActionLayout(
+ cssClassFa = "fa-external-link"
+ )
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @MemberOrder(name="Prototyping", sequence="91.1")
+ public URL goToDocs(@ParameterLayout(named="Link") ExternalLink link) throws MalformedURLException {
+ return link.open();
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
new file mode 100644
index 0000000..16709fd
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
@@ -0,0 +1,47 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package webapp.prototyping;
+
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.viewer.wicket.viewer.applib.WicketDeveloperUtilitiesService;
+
+/**
+ * These overrides are simply to 'move' the action underneath the
+ * 'Prototyping' menu.
+ */
+@DomainService
+@DomainServiceLayout(
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ named = "Prototyping",
+ menuOrder = "40")
+public class WicketDeveloperUtilities extends WicketDeveloperUtilitiesService {
+
+ @ActionLayout(named="Clear i18n Cache")
+ @MemberOrder(sequence="90.3")
+ @Override
+ public void resetI18nCache() {
+ super.resetI18nCache();
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
new file mode 100644
index 0000000..68eebec
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
@@ -0,0 +1,46 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package webapp.userprof;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.services.userprof.UserProfileService;
+import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
+/**
+ * Demonstrates how to provide a custom implementation of the {@link org.apache.isis.applib.services.userprof.UserProfileService}.
+ */
+@DomainService
+public class CustomUserProfileService implements UserProfileService {
+
+ @Override
+ @Programmatic
+ public String userProfileName() {
+ return "Hi " + getAuthenticationSession().getUserName() + "!";
+ }
+
+ protected AuthenticationSession getAuthenticationSession() {
+ return IsisContext.getAuthenticationSession();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn
new file mode 100644
index 0000000..37543c9
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png
new file mode 100644
index 0000000..cd9ecfe
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
new file mode 100644
index 0000000..0e1dd47
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
@@ -0,0 +1,55 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound}
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+${symbol_pound}
+
+
+${symbol_pound} override WicketSignInPage.properties
+loginHeader=Login
+registerHeader=Register
+
+${symbol_pound} override PageAbstract.properties
+aboutLabel=About
+logoutLabel=Logout
+
+${symbol_pound} override EntityPropertiesForm.properties and also
+${symbol_pound} override ActionParametersFormPanel.properties
+okLabel=OK
+cancelLabel=Cancel
+editLabel=Edit
+
+
+
+
+${symbol_pound}
+${symbol_pound} 3rd-party components
+${symbol_pound}
+
+${symbol_pound} Select2Choice
+
+${symbol_pound}noMatches=...
+${symbol_pound}inputTooShortSingular=...
+${symbol_pound}inputTooShortPlural=...
+${symbol_pound}loadMore=...
+${symbol_pound}searching=...
+
+${symbol_pound} datatables
+${symbol_pound}no-records-found=...
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
new file mode 100644
index 0000000..1473390
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
@@ -0,0 +1,105 @@
+#
+# 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.
+#
+
+
+# -----------------------------------------------------------------------------
+# 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, ...
+
+#
+# realm1 configures sven, dick and bob only. Additional logins are configured in realm2
+#
+
+sven = pass, admin_role
+dick = pass, readwrite_role, dashboard_role, analysis_role, self-install_role
+bob = pass, readwrite_role, dashboard_role, self-install_role
+joe = pass, readwrite_role, self-install_role, noDueBy_role
+guest = guest, readonly_role
+
+
+
+#
+# some additional users/roles
+# require IsisPermissionResolver to be configured in shiro.ini, and
+# require additional role/perms to be configured below in [roles]
+#
+
+# # fred should have access to everything except the analysis features
+# fred = pass,isisperms_all_but_analysis_role
+# # bill should have access to everything (the admin role 'trumps' the vetos)
+# bill = pass,isisperms_all_but_analysis_role,isisperms_admin_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
+
+#
+# If using the IsisLdapRealm, it could be pointed at an ini file such as this in
+# order to share role/perm mappings.
+#
+
+
+# configuring iniRealm to use Shiro's built-in WildcardPermissions
+
+readwrite_role = *:ToDoItems:*:*,\
+ *:ToDoItem:*:*
+
+readonly_role = *:ToDoItems:notYetComplete:*,\
+ *:ToDoItems:complete:*,\
+ *:ToDoItems:allToDos:*,\
+ *:ToDoItem:*:r
+
+dashboard_role = *:ToDoAppDashboardService:*:*,\
+ *:ToDoAppDashboard:*:*
+
+analysis_role = *:ToDoItemAnalysis:*:*,\
+ *:ToDoItemsByCategoryViewModel:*:*,\
+ *:ToDoItemsByDateRangeViewModel:*:*
+
+self-install_role = *:ToDoItemsFixturesService:*:*
+
+admin_role = *
+
+
+
+#
+# some additional role/perms
+# require IsisPermissionResolver to be configured in shiro.ini
+#
+
+# isisperms_all_but_analysis_role = aba/*,\
+# !aba/*:ToDoItemAnalysis:*,\
+# !aba/*:ToDoItemsByCategoryViewModel:*:*,\
+# !aba/*:ToDoItemsByDateRangeViewModel:*:*
+# isisperms_admin_role = adm/*
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
new file mode 100644
index 0000000..dda189b
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
@@ -0,0 +1,39 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?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.
+-->
+<p class="intro">
+ <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a platform to let you rapidly develop
+ domain-driven apps in Java.
+ <br/>
+ <br/>
+ This app has been generated using Isis'
+ <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
+ which configures Isis' most commonly used components in a straightforward "todo" app.
+ <br/>
+ <br/>
+ The core functionality of the app is provided by the
+ <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank">ToDoItem</a> domain class.
+ Supporting services provide additional capabilities.
+ <br/>
+ <br/>
+ For more details, see the <a href="http://isis.apache.org/documentation.html" target="_blank">Isis website</a>.
+</p>
[02/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
new file mode 100644
index 0000000..54f35cd
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -0,0 +1,280 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} specify system components.
+${symbol_pound}
+${symbol_pound} The values correspond to the named components in the installer-registry.properties file
+${symbol_pound} in the org.apache.isis.core:isis-core-runtime JAR (in the org.apache.isis.core.runtime package)
+${symbol_pound}
+${symbol_pound} Although all configuration could reside in isis.properties, the recommendation is
+${symbol_pound} to split out into component specific files:
+${symbol_pound}
+${symbol_pound} xxx_yyy.properties files
+${symbol_pound}
+${symbol_pound} where
+${symbol_pound} * xxx is the component type, and
+${symbol_pound} * yyy is the component name.
+${symbol_pound}
+${symbol_pound} For example, viewer_wicket.properties holds configuration information specific to the Wicket viewer.
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+
+${symbol_pound}
+${symbol_pound} configure the persistor (object store) to use
+${symbol_pound}
+
+${symbol_pound} JDO/DataNucleus objectstore
+isis.persistor=datanucleus
+
+
+
+${symbol_pound}
+${symbol_pound} configure authentication mechanism to use (to logon to the system)
+${symbol_pound}
+
+${symbol_pound}isis.authentication=bypass
+isis.authentication=shiro
+
+
+${symbol_pound}
+${symbol_pound} configure authorization mechanism to use
+${symbol_pound}
+
+${symbol_pound}isis.authorization=bypass
+isis.authorization=shiro
+
+
+
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} MetaModel
+${symbol_pound}
+${symbol_pound} The metamodel typically does not require additional configuration, although
+${symbol_pound} the system components (defined above) may refine the metamodel for their needs.
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+
+${symbol_pound}
+${symbol_pound} additional programming model facets
+${symbol_pound}
+
+${symbol_pound}isis.reflector.facets.include=
+${symbol_pound}isis.reflector.facets.exclude=
+
+
+${symbol_pound}
+${symbol_pound} metamodel validator
+${symbol_pound}
+
+${symbol_pound}isis.reflector.validator=
+
+
+
+${symbol_pound}
+${symbol_pound} layoutMetadataReader(s)
+${symbol_pound}
+
+${symbol_pound} isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson
+
+
+
+${symbol_pound}
+${symbol_pound} patterns for applying CssClassFa facet (font-awesome icons) to member names
+${symbol_pound}
+isis.reflector.facet.cssClassFa.patterns=${symbol_escape}
+ new.*:fa-plus,${symbol_escape}
+ add.*:fa-plus-square,${symbol_escape}
+ create.*:fa-plus,${symbol_escape}
+ update.*:fa-edit,${symbol_escape}
+ change.*:fa-edit,${symbol_escape}
+ remove.*:fa-minus-square,${symbol_escape}
+ move.*:fa-exchange,${symbol_escape}
+ first.*:fa-star,${symbol_escape}
+ find.*:fa-search,${symbol_escape}
+ lookup.*:fa-search,${symbol_escape}
+ clear.*:fa-remove,${symbol_escape}
+ previous.*:fa-step-backward,${symbol_escape}
+ next.*:fa-step-forward,${symbol_escape}
+ list.*:fa-list, ${symbol_escape}
+ all.*:fa-list, ${symbol_escape}
+ download.*:fa-download, ${symbol_escape}
+ upload.*:fa-upload, ${symbol_escape}
+ execute.*:fa-bolt, ${symbol_escape}
+ run.*:fa-bolt, ${symbol_escape}
+ calculate.*:fa-calculator, ${symbol_escape}
+ verify.*:fa-check-circle, ${symbol_escape}
+ refresh.*:fa-refresh, ${symbol_escape}
+ install.*:fa-wrench
+
+isis.reflector.facet.cssClass.patterns=${symbol_escape}
+ delete.*:btn-warning,${symbol_escape}
+ .*:btn-default
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Value facet defaults
+${symbol_pound}
+${symbol_pound} (see also viewer-specific config files, eg viewer_wicket.properties)
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound} as used by @Title of a date
+isis.value.format.date=dd-MM-yyyy
+
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Facet Decorators
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound}
+${symbol_pound} Providing such capabilities as i18n
+${symbol_pound}
+
+isis.reflector.facet-decorators=org.apache.isis.core.metamodel.facetdecorator.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Application Services and fixtures
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound}
+${symbol_pound} Specify the domain services.
+${symbol_pound}
+${symbol_pound} These are the most important configuration properties in the system, as they define
+${symbol_pound} the set of the classes for Isis to instantiate as domain service singletons.
+${symbol_pound} From these domain service instances the rest of the metamodel is discovered, while the
+${symbol_pound} end-user gains access to other domain objects by invoking the actions of the domain services.
+${symbol_pound}
+isis.services-installer=configuration-and-annotation
+isis.services.ServicesInstallerFromAnnotation.packagePrefix=app,${symbol_escape}
+ dom.todo,${symbol_escape}
+ fixture.todo,${symbol_escape}
+ webapp.userprof,${symbol_escape}
+ webapp.prototyping
+
+isis.services = ${symbol_escape}
+ org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,${symbol_escape}
+ ${symbol_escape}
+ ${symbol_pound} customizable exception handling, ${symbol_escape}
+ org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,${symbol_escape}
+ ${symbol_pound},${symbol_escape}
+ 1:webapp.CustomMementoService,${symbol_escape}
+ 1:webapp.CustomRepresentationService
+
+
+${symbol_pound} Specify the (optional) test fixtures
+${symbol_pound}
+${symbol_pound} Fixtures are used to seed the object store with an initial set of data. For the
+${symbol_pound} in-memory object store, the fixtures are installed on every run. For other
+${symbol_pound} object stores, they are used only when the object store is first initialized.
+${symbol_pound}
+${symbol_pound}isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven
+
+
+${symbol_pound}
+${symbol_pound} required by EmailServiceDefault
+${symbol_pound}
+${symbol_pound}isis.service.email.sender.address=some.valid@email.address
+${symbol_pound}isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
+
+
+${symbol_pound}
+${symbol_pound} whether ExceptionRecognizers should also log any recognized exceptions
+${symbol_pound} (default false; enable for diagnostics/debugging)
+${symbol_pound}
+${symbol_pound}isis.services.exceprecog.logRecognizedExceptions=true
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Auditing, Publishing, Command
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound}
+${symbol_pound} Whether changes to objects should be audited; if not set, defaults to "none"
+${symbol_pound} - if not set or set to "none", can explicitly enable using @DomainObject(auditing=Auditing.ENABLED)
+${symbol_pound} - if set to "all", can explicitly disable using @Object(auditing=Auditing.DISABLED)
+${symbol_pound}
+${symbol_pound}isis.services.audit.objects=all|none
+
+${symbol_pound}
+${symbol_pound} Whether changes to objects should be published; if not set, defaults to "none"
+${symbol_pound} - if not set or set to "none", can explicitly enable using @DomainObject(publishing=Publishing.ENABLED)
+${symbol_pound} - if set to "all", can explicitly disable using @Object(publishing=Publishing.DISABLED)
+${symbol_pound}
+${symbol_pound}isis.services.publish.objects=all|none
+
+${symbol_pound}
+${symbol_pound} Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
+${symbol_pound} - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
+${symbol_pound} - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
+${symbol_pound}
+${symbol_pound}isis.services.publish.actions=all|none|ignoreQueryOnly
+
+
+${symbol_pound}
+${symbol_pound} Whether all (or all non-query only) actions should be reified as commands; if not set, defaults to "none"
+${symbol_pound} - if not set or set to "none", can explicitly enable using @Action(command=CommandReification.ENABLED)
+${symbol_pound} - if set to "all", can explicitly disable using @Action(command=CommandReification.DISABLED)
+${symbol_pound}
+${symbol_pound}isis.services.command.actions=all|none|ignoreQueryOnly
+
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Policies
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound}
+${symbol_pound} Whether editing of object properties is allowed; if not set, defaults to "true"
+${symbol_pound} - if not set or set to "true", can explicitly disable using @DomainObject(editing=Editing.DISABLED)
+${symbol_pound} - if set to "false", can explicitly enable using @DomainObject(editing=Editing.ENABLED)
+${symbol_pound}
+${symbol_pound}isis.objects.editing=true|false
+
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Viewer defaults
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound}isis.viewers.paged.standalone=30
+${symbol_pound}isis.viewers.paged.parented=10
+
+${symbol_pound}isis.viewers.propertyLayout.labelPosition=LEFT
+${symbol_pound}isis.viewers.parameterLayout.labelPosition=LEFT
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
new file mode 100644
index 0000000..9720880
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
@@ -0,0 +1,223 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+
+${symbol_pound}
+${symbol_pound} Isis uses log4j is used to provide system logging
+${symbol_pound}
+log4j.rootCategory=INFO, Console
+${symbol_pound}log4j.rootCategory=DEBUG, Console
+
+
+${symbol_pound} The console appender
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.target=System.out
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
+
+
+${symbol_pound} The stderr appender
+log4j.appender.Stderr=org.apache.log4j.ConsoleAppender
+log4j.appender.Stderr.target=System.err
+log4j.appender.Stderr.layout=org.apache.log4j.PatternLayout
+log4j.appender.Stderr.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
+
+
+${symbol_pound} other appenders
+log4j.appender.File=org.apache.log4j.RollingFileAppender
+log4j.appender.File.file=isis.log
+log4j.appender.File.append=false
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+
+log4j.appender.sql=org.apache.log4j.FileAppender
+log4j.appender.sql.File=./logs/sql.log
+log4j.appender.sql.Append=false
+log4j.appender.sql.layout=org.apache.log4j.PatternLayout
+log4j.appender.sql.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
+
+log4j.appender.sqltiming=org.apache.log4j.FileAppender
+log4j.appender.sqltiming.File=./logs/sqltiming.log
+log4j.appender.sqltiming.Append=false
+log4j.appender.sqltiming.layout=org.apache.log4j.PatternLayout
+log4j.appender.sqltiming.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
+
+log4j.appender.jdbc=org.apache.log4j.FileAppender
+log4j.appender.jdbc.File=./logs/jdbc.log
+log4j.appender.jdbc.Append=false
+log4j.appender.jdbc.layout=org.apache.log4j.PatternLayout
+log4j.appender.jdbc.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+
+log4j.appender.connection=org.apache.log4j.FileAppender
+log4j.appender.connection.File=./logs/connection.log
+log4j.appender.connection.Append=false
+log4j.appender.connection.layout=org.apache.log4j.PatternLayout
+log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+
+log4j.appender.wicket.i18n=org.apache.log4j.RollingFileAppender
+log4j.appender.wicket.i18n.file=./logs/wicket-i18n.log
+log4j.appender.wicket.i18n.append=false
+log4j.appender.wicket.i18n.layout=org.apache.log4j.PatternLayout
+log4j.appender.wicket.i18n.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+
+
+
+
+
+! turn on the internal log4j debugging flag so we can see what it is doing
+${symbol_pound}log4j.debug=true
+
+
+${symbol_pound} DataNucleus
+${symbol_pound} the first two log the DML and DDL (if set to DEBUG)
+log4j.logger.DataNucleus.Datastore.Native=WARN, Console
+log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
+${symbol_pound} the remainder can probably be left to WARN
+log4j.logger.DataNucleus.Persistence=WARN, Console
+log4j.logger.DataNucleus.Transaction=WARN, Console
+log4j.logger.DataNucleus.Connection=WARN, Console
+log4j.logger.DataNucleus.Query=WARN, Console
+log4j.logger.DataNucleus.Cache=WARN, Console
+log4j.logger.DataNucleus.MetaData=WARN, Console
+log4j.logger.DataNucleus.Datastore=WARN, Console
+log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
+log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
+log4j.logger.DataNucleus.General=WARN, Console
+log4j.logger.DataNucleus.Lifecycle=WARN, Console
+log4j.logger.DataNucleus.ValueGeneration=WARN, Console
+log4j.logger.DataNucleus.Enhancer=WARN, Console
+log4j.logger.DataNucleus.SchemaTool=ERROR, Console
+log4j.logger.DataNucleus.JDO=WARN, Console
+log4j.logger.DataNucleus.JPA=ERROR, Console
+log4j.logger.DataNucleus.JCA=WARN, Console
+log4j.logger.DataNucleus.IDE=ERROR, Console
+
+log4j.additivity.DataNucleus.Datastore.Native=false
+log4j.additivity.DataNucleus.Datastore.Schema=false
+log4j.additivity.DataNucleus.Datastore.Persistence=false
+log4j.additivity.DataNucleus.Datastore.Transaction=false
+log4j.additivity.DataNucleus.Datastore.Connection=false
+log4j.additivity.DataNucleus.Datastore.Query=false
+log4j.additivity.DataNucleus.Datastore.Cache=false
+log4j.additivity.DataNucleus.Datastore.MetaData=false
+log4j.additivity.DataNucleus.Datastore.Datastore=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
+log4j.additivity.DataNucleus.Datastore.General=false
+log4j.additivity.DataNucleus.Datastore.Lifecycle=false
+log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
+log4j.additivity.DataNucleus.Datastore.Enhancer=false
+log4j.additivity.DataNucleus.Datastore.SchemaTool=false
+log4j.additivity.DataNucleus.Datastore.JDO=false
+log4j.additivity.DataNucleus.Datastore.JPA=false
+log4j.additivity.DataNucleus.Datastore.JCA=false
+log4j.additivity.DataNucleus.Datastore.IDE=false
+
+
+${symbol_pound} if using log4jdbc-remix as JDBC driver
+${symbol_pound}log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
+${symbol_pound}log4j.additivity.jdbc.sqlonly=false
+${symbol_pound}log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
+${symbol_pound}log4j.additivity.jdbc.resultsettable=false
+
+${symbol_pound}log4j.logger.jdbc.audit=WARN,jdbc, Console
+${symbol_pound}log4j.additivity.jdbc.audit=false
+${symbol_pound}log4j.logger.jdbc.resultset=WARN,jdbc
+${symbol_pound}log4j.additivity.jdbc.resultset=false
+${symbol_pound}log4j.logger.jdbc.sqltiming=WARN,sqltiming
+${symbol_pound}log4j.additivity.jdbc.sqltiming=false
+${symbol_pound}log4j.logger.jdbc.connection=FATAL,connection
+${symbol_pound}log4j.additivity.jdbc.connection=false
+
+
+
+${symbol_pound} track Isis/JDO lifecycle integration
+
+${symbol_pound}log4j.logger.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=DEBUG, Console
+${symbol_pound}log4j.additivity.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=false
+
+${symbol_pound}log4j.logger.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=DEBUG,Console
+${symbol_pound}log4j.additivity.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=false
+
+
+
+
+${symbol_pound} track Isis/Wicket lifecycle integration
+
+${symbol_pound}log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=DEBUG, Console
+${symbol_pound}log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=false
+
+${symbol_pound}log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=INFO,Console
+${symbol_pound}log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=false
+
+
+
+${symbol_pound} to track Wicket i18n
+log4j.logger.org.apache.wicket.Localizer=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.Localizer=false
+
+log4j.logger.org.apache.wicket.resource.loader.ClassStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ClassStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.ComponentStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ComponentStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.PackageStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.PackageStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.BundleStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.BundleStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.InitializerStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.InitializerStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=false
+
+
+
+${symbol_pound} quieten some of the noisier classes in Isis' bootstrapping
+log4j.logger.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=WARN,Console
+log4j.additivity.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=false
+
+log4j.logger.org.apache.isis.core.metamodel.specloader.ServiceInitializer=WARN,Console
+log4j.additivity.org.apache.isis.core.metamodel.specloader.ServiceInitializer=false
+
+log4j.logger.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=WARN,Console
+log4j.additivity.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=false
+
+log4j.logger.org.apache.isis.core.commons.config.IsisConfigurationDefault=WARN,Console
+log4j.additivity.org.apache.isis.core.commons.config.IsisConfigurationDefault=false
+
+log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN,Console
+log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false
+
+
+
+
+${symbol_pound} Application-specific logging
+log4j.logger.dom.todo.ToDoItem=DEBUG, Stderr
+log4j.additivity.dom.todo.ToDoItem=false
+
+log4j.logger.dom.todo.ToDoItemSubscriptions=DEBUG, Stderr
+log4j.additivity.dom.todo.ToDoItemSubscriptions=false
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
new file mode 100644
index 0000000..7f0a4f2
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
@@ -0,0 +1,132 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Persistor
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+
+
+${symbol_pound} generally speaking this should not be enabled
+isis.persistor.disableConcurrencyChecking=false
+
+
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} JDBC configuration
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+
+
+${symbol_pound}
+${symbol_pound} configuration file holding the JDO objectstore's JDBC configuration
+${symbol_pound} (this is a bit of a hack... just exploiting fact that Isis also loads this file)
+${symbol_pound}
+
+
+${symbol_pound}
+${symbol_pound} JDBC connection details
+${symbol_pound} (also update the pom.xml to reference the appropriate JDBC driver)
+${symbol_pound}
+
+
+${symbol_pound}
+${symbol_pound} HSQLDB in-memory
+${symbol_pound}
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+${symbol_pound}
+${symbol_pound} HSQLDB in-memory (using log4jdbc-remix)
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+
+
+${symbol_pound}
+${symbol_pound} HSQLDB to file
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+${symbol_pound}
+${symbol_pound} HSQLDB to file (using log4jdbc-remix)
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:file:/tmp/isis-todo-app/hsql-db;hsqldb.write_delay=false;shutdown=true
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+
+
+
+${symbol_pound}
+${symbol_pound} PostgreSQL Server
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.postgresql.Driver
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:postgresql://localhost:5432/isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+${symbol_pound}
+${symbol_pound} PostgreSQL Server (using log4jdbc-remix)
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:postgresql://localhost:5432/isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+
+
+${symbol_pound}
+${symbol_pound} MS SQL Server
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+${symbol_pound}
+${symbol_pound} MS SQL Server (using log4jdbc-remix)
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
+
+
+
+${symbol_pound}
+${symbol_pound} neo4j
+${symbol_pound} (experimental; run with '-P neo4j' profile in webapp project)
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=neo4j:neo4j_DB
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
new file mode 100644
index 0000000..b979a9d
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
@@ -0,0 +1,91 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+${symbol_pound}
+${symbol_pound} configuration file for the JDO/DataNucleus objectstore
+${symbol_pound}
+
+${symbol_pound} identifies @PersistenceCapable entities to be eagerly registered
+${symbol_pound} if move class to other package (eg com.mycompany.myapp.dom) then update
+isis.persistor.datanucleus.RegisterEntities.packagePrefix=dom
+
+${symbol_pound} whether to persist the event data as a "clob" or as a "zipped" byte[]
+${symbol_pound} default is "zipped"
+${symbol_pound}isis.persistor.datanucleus.PublishingService.serializedForm=zipped
+
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} DataNucleus' configuration
+${symbol_pound}
+${symbol_pound} The 'isis.persistor.datanucleus.impl' prefix is stripped off,
+${symbol_pound} remainder is passed through to DataNucleus
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}
+
+isis.persistor.datanucleus.impl.datanucleus.autoCreateSchema=true
+isis.persistor.datanucleus.impl.datanucleus.validateTables=true
+isis.persistor.datanucleus.impl.datanucleus.validateConstraints=true
+
+
+${symbol_pound}
+${symbol_pound} Require explicit persistence (since entities are Comparable and using ObjectContracts${symbol_pound}compareTo).
+${symbol_pound} see http://www.datanucleus.org/products/accessplatform_3_0/jdo/transaction_types.html
+${symbol_pound}
+isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false
+
+
+${symbol_pound}
+${symbol_pound} How column names are identified
+${symbol_pound} (http://www.datanucleus.org/products/datanucleus/jdo/orm/datastore_identifiers.html)
+${symbol_pound}
+isis.persistor.datanucleus.impl.datanucleus.identifier.case=PreserveCase
+
+
+${symbol_pound}
+${symbol_pound} L2 cache
+${symbol_pound} off except if explicitly marked as cacheable
+${symbol_pound} http://www.datanucleus.org/products/datanucleus/jdo/cache.html
+${symbol_pound}
+isis.persistor.datanucleus.impl.datanucleus.cache.level2.type=none
+isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode=ENABLE_SELECTIVE
+
+
+
+${symbol_pound}
+${symbol_pound} uncomment to use JNDI rather than direct JDBC
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart
+
+${symbol_pound}
+${symbol_pound} uncomment to use JTA resource
+${symbol_pound}
+${symbol_pound}isis.persistor.datanucleus.impl.datanucleus.ConnectionFactory2Name=java:comp/env/jdbc/quickstart-nontx
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.TransactionType=JTA
+
+
+
+${symbol_pound}
+${symbol_pound}
+${symbol_pound} JDBC connection details
+${symbol_pound} ... are in persistor.properties
+${symbol_pound}
+${symbol_pound}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
new file mode 100644
index 0000000..07ea04f
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
@@ -0,0 +1,103 @@
+#
+# 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]
+
+#######
+# configure a couple of iniRealms
+# (nb: not possible for their .ini files to live in WEB-INF, because Shiro does not
+# provide a mechanism to load resources from that location)
+#######
+
+realm1 = org.apache.shiro.realm.text.IniRealm
+realm1.resourcePath=classpath:webapp/realm1.ini
+
+
+
+
+#######
+# configure an ldap-based realm
+#######
+
+contextFactory = org.apache.isis.security.shiro.IsisLdapContextFactory
+contextFactory.url = ldap://localhost:10389
+contextFactory.authenticationMechanism = CRAM-MD5
+contextFactory.systemAuthenticationMechanism = simple
+contextFactory.systemUsername = uid=admin,ou=system
+contextFactory.systemPassword = secret
+
+ldapRealm = org.apache.isis.security.shiro.IsisLdapRealm
+ldapRealm.contextFactory = $contextFactory
+
+ldapRealm.searchBase = ou=groups,o=mojo
+ldapRealm.groupObjectClass = groupOfUniqueNames
+ldapRealm.uniqueMemberAttribute = uniqueMember
+ldapRealm.uniqueMemberAttributeValueTemplate = uid={0}
+
+# optional mapping from physical groups to logical application roles
+#ldapRealm.rolesByGroup = \
+# LDN_USERS: user_role,\
+# NYK_USERS: user_role,\
+# HKG_USERS: user_role,\
+# GLOBAL_ADMIN: admin_role,\
+# DEMOS: self-install_role
+
+# configuring ldapRealm role/perm mappings
+# (use same as realm1)
+ldapRealm.resourcePath=classpath:webapp/realm1.ini
+
+
+#######
+# configure security manager to use realm(s)
+#######
+
+# authenticate/authorize using realm1
+securityManager.realms = $realm1
+
+
+# or to use ldap with realm1 as a backup...
+# (see docs for details of how to setup users/groups in Apache Directory Studio).
+#securityManager.realms = $ldapRealm,$realm1
+
+
+# or to just use this .ini file...
+# (would require [users] and [roles] to be set up)
+#securityManager.realms = $iniRealm
+
+
+
+#######
+# optional, configure realm(s) to use Isis' extended permission syntax
+# (see webapp/realm1.ini for usage)
+#######
+
+# permissionResolver = org.apache.isis.security.shiro.authorization.IsisPermissionResolver
+# realm1.permissionResolver = $permissionResolver
+# realm2.permissionResolver = $permissionResolver
+
+
+# -----------------------------------------------------------------------------
+# Users and their assigned roles
+# -----------------------------------------------------------------------------
+
+[users]
+# unused (assuming not configured $iniRealm)
+
+[roles]
+# unused (assuming not configured $iniRealm)
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
new file mode 100644
index 0000000..85e658a
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
@@ -0,0 +1,69 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+${symbol_pound}
+${symbol_pound} configuration file for the Restful Objects viewer
+${symbol_pound}
+
+${symbol_pound} the baseUrl for hrefs in the events generated by the RO EventSerializer
+isis.viewer.restfulobjects.RestfulObjectsSpecEventSerializer.baseUrl=http://localhost:8080/restful/
+
+${symbol_pound} renders param details in the (incorrect) form that they were for GSOC2013 viewers
+${symbol_pound} isis.viewer.restfulobjects.gsoc2013.legacyParamDetails=true
+
+${symbol_pound} whether to honor UI hints, in particular Render(EAGERLY). Defaults to false.
+${symbol_pound}isis.viewer.restfulobjects.honorUiHints=false
+
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound} Non-standard configuration settings.
+${symbol_pound}
+${symbol_pound} If enabled of the following are enabled then the viewer is deviating from the
+${symbol_pound} RO spec standard; compatibility may be compromised with RO clients.
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound} whether to show only object properties for object members
+${symbol_pound} (on the object representation only)
+${symbol_pound} Takes precedence over the other 'suppress' below.
+${symbol_pound}isis.viewer.restfulobjects.objectPropertyValuesOnly=true
+
+${symbol_pound} whether to suppress "describedby" links. Defaults to false.
+${symbol_pound}isis.viewer.restfulobjects.suppressDescribedByLinks=true
+
+${symbol_pound} whether to suppress "update" links. Defaults to false.
+${symbol_pound}isis.viewer.restfulobjects.suppressUpdateLink=true
+
+${symbol_pound} whether to suppress "id" json-prop for object members. Defaults to false.
+${symbol_pound}isis.viewer.restfulobjects.suppressMemberId=true
+
+${symbol_pound} whether to suppress "links" json-prop for object members
+${symbol_pound} (on the object representation only). Defaults to false.
+${symbol_pound}isis.viewer.restfulobjects.suppressMemberLinks=true
+
+${symbol_pound} whether to suppress "extensions" json-prop for object members
+${symbol_pound} (on the object representation only). Defaults to false.
+${symbol_pound}isis.viewer.restfulobjects.suppressMemberExtensions=true
+
+${symbol_pound} whether to suppress "disabledReason" json-prop for object members
+${symbol_pound} (on the object representation only). Defaults to false.
+${symbol_pound}isis.viewer.restfulobjects.suppressMemberDisabledReason=true
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
new file mode 100644
index 0000000..9644f0e
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
@@ -0,0 +1,90 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+
+${symbol_pound}
+${symbol_pound} configuration file for the Wicket viewer
+${symbol_pound}
+
+${symbol_pound}
+${symbol_pound} The maximum length of titles to display in standalone or parented tables.
+${symbol_pound} Titles longer than this length will be truncated with trailing ellipses (...)
+${symbol_pound}
+${symbol_pound} For example, if set to 12, the title
+${symbol_pound} "Buy milk on 15-Feb-13" will be truncated to "Buy milk ..."
+${symbol_pound}
+${symbol_pound} If set to 0, then only the icon will be shown.
+${symbol_pound}
+isis.viewer.wicket.maxTitleLengthInStandaloneTables=0
+isis.viewer.wicket.maxTitleLengthInParentedTables=0
+
+
+${symbol_pound}isis.viewer.wicket.datePattern=dd-MM-yyyy
+${symbol_pound}isis.viewer.wicket.dateTimePattern=dd-MM-yyyy HH:mm
+${symbol_pound}isis.viewer.wicket.datePickerPattern=DD-MM-YYYY
+
+${symbol_pound}isis.viewer.wicket.datePattern=dd/MM/yy
+${symbol_pound}isis.viewer.wicket.dateTimePattern=dd/MM/yy HH:mm
+${symbol_pound}isis.viewer.wicket.datePickerPattern=DD/MM/YY
+
+
+
+${symbol_pound}
+${symbol_pound} whether to strip wicket tags from markup (default is true, as they may break some CSS rules)
+${symbol_pound}
+${symbol_pound}isis.viewer.wicket.stripWicketTags=false
+
+
+${symbol_pound}
+${symbol_pound} whether to suppress the 'rememberMe' checkbox on the login page (default is false)
+${symbol_pound}
+${symbol_pound}isis.viewer.wicket.suppressRememberMe=false
+
+${symbol_pound}
+${symbol_pound} if user attempts to access a protected URL before signing in, then as a convenience the viewer will continue
+${symbol_pound} through to that destination after successful login. If you consider this to be a security risk then this flag
+${symbol_pound} disables that behaviour (default is false).
+${symbol_pound}
+${symbol_pound}isis.viewer.wicket.clearOriginalDestination=true
+
+
+${symbol_pound}
+${symbol_pound} whether to show action dialogs on their own page rather than as a modal dialog (default is false)
+${symbol_pound}
+${symbol_pound}isis.viewer.wicket.disableModalDialogs=false
+
+
+${symbol_pound}
+${symbol_pound} the maximum number of pages to list in bookmark (default is 15)
+${symbol_pound}
+${symbol_pound}isis.viewer.wicket.bookmarkedPages.maxSize=15
+
+
+${symbol_pound}
+${symbol_pound} whether to show the bootstrap theme chooser (defaults false)
+${symbol_pound}
+${symbol_pound}isis.viewer.wicket.themes.showChooser=false
+isis.viewer.wicket.themes.showChooser=true
+
+${symbol_pound}
+${symbol_pound} comma-separated list of themes to choose from (default is to show all themes from bootswatch.com).
+${symbol_pound}
+${symbol_pound}isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
+isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..be328e1
--- /dev/null
+++ b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,311 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?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 id="WebApp_ID" version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Todo app</display-name>
+
+ <welcome-file-list>
+ <welcome-file>about/index.html</welcome-file>
+ </welcome-file-list>
+
+ <!-- shiro security configuration -->
+ <listener>
+ <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>ShiroFilter</filter-name>
+ <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ShiroFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+
+
+ <!-- which configuration directory to read overloaded property files from -->
+ <!--
+ Normally configuration like this should be done from outside your web
+ application. Especially if your configuration is not know in advance or
+ if it can change depending on where the application gets deployed.
+
+ For instance to configure this in Tomcat outside the application WAR add
+ the following line to your application context ( For more detail see:
+ http://tomcat.apache.org/tomcat-7.0-doc/config/context.html${symbol_pound}Context_Parameters )
+
+ <Parameter name="isis.config.dir" value="/usr/local/tomcat/conf/"
+ override="true"/>
+
+ If your configuration directory is fixed you can enable the following
+ context parameter in here and forget about the outside part.
+
+ <context-param>
+ <param-name>isis.config.dir</param-name>
+ <param-value>location of your config directory if fixed</param-value>
+ </context-param>
+ -->
+
+
+ <!--
+ determines which additional configuration files to search for
+ -->
+ <context-param>
+ <param-name>isis.viewers</param-name>
+ <param-value>wicket,restfulobjects</param-value>
+ </context-param>
+
+
+ <!--
+ for diagnostics
+ -->
+ <filter>
+ <filter-name>IsisLogOnExceptionFilter</filter-name>
+ <filter-class>org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>IsisLogOnExceptionFilter</filter-name>
+ <url-pattern>/wicket/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>IsisLogOnExceptionFilter</filter-name>
+ <url-pattern>/restful/*</url-pattern>
+ </filter-mapping>
+
+
+ <!-- cache static resources for 1 day -->
+ <filter>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
+ <init-param>
+ <param-name>CacheTime</param-name>
+ <param-value>86400</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.js</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.jpg</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.html</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.swf</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Resource</servlet-name>
+ <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.css</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.png</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.jpg</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.gif</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.js</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.html</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.swf</url-pattern>
+ </servlet-mapping>
+
+
+
+ <!--
+ -
+ - config specific to the wicket-viewer
+ -
+ -->
+ <filter>
+ <filter-name>WicketFilter</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>webapp.ToDoApplication</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>WicketFilter</filter-name>
+ <url-pattern>/wicket/*</url-pattern>
+ </filter-mapping>
+
+
+ <context-param>
+ <param-name>configuration</param-name>
+ <!--
+ <param-value>deployment</param-value>
+ -->
+ <param-value>development</param-value>
+ </context-param>
+
+
+ <!--
+ -
+ - config specific to the restfulobjects-viewer
+ -
+ -->
+
+ <!--
+ THE FOLLOWING CONFIGURATION IS NOT REQUIRED IF THE WICKET VIEWER IS IN USE.
+ IF THE WICKET VIEWER CONFIGURATION IS REMOVED, THEN UNCOMMENT
+
+ <listener>
+ <listener-class>org.apache.isis.core.webapp.IsisWebAppBootstrapper</listener-class>
+ </listener>
+
+ <context-param>
+ <param-name>deploymentType</param-name>
+ <param-value>SERVER_EXPLORATION</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>isis.viewers</param-name>
+ <param-value>restfulobjects</param-value>
+ </context-param>
+ -->
+
+ <!-- bootstrap the RestEasy framework -->
+ <listener>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+ </listener>
+
+ <!-- used by RestEasy to determine the JAX-RS resources and other related configuration -->
+ <context-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.apache.isis.viewer.restfulobjects.server.RestfulObjectsApplication</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>resteasy.servlet.mapping.prefix</param-name>
+ <param-value>/restful/</param-value>
+ </context-param>
+
+
+ <!-- authenticate user, set up an Isis session -->
+ <filter>
+ <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
+ <filter-class>org.apache.isis.core.webapp.IsisSessionFilter</filter-class>
+ <!-- authentication required for REST -->
+ <init-param>
+ <param-name>authenticationSessionStrategy</param-name>
+ <param-value>org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyBasicAuth</param-value>
+ </init-param>
+ <init-param>
+ <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
+ <param-name>whenNoSession</param-name>
+ <param-value>basicAuthChallenge</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <!-- this is mapped to the entire app; however the IsisSessionFilter will "notice" if the session filter has already been
+ executed for the request pipeline, and if so will do nothing -->
+ <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ </filter-mapping>
+
+ <filter>
+ <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
+ <filter-class>org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ </filter-mapping>
+
+
+ <servlet>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
+ <url-pattern>/restful/*</url-pattern>
+ </servlet-mapping>
+
+
+ <!--
+ uncomment to use container-managed datasource;
+ for both container-managed (JTA) and non-container-managed transactions
+ -->
+ <!--
+ <resource-ref>
+ <description>db</description>
+ <res-ref-name>jdbc/quickstart</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ -->
+
+ <!--
+ uncomment to use container-managed datasource
+ with container-managed transactions (JTA).
+ -->
+ <!--
+ <resource-ref>
+ <description>db</description>
+ <res-ref-name>jdbc/quickstart-nontx</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ -->
+
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png
----------------------------------------------------------------------
diff --git a/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png
new file mode 100644
index 0000000..5284fe7
Binary files /dev/null and b/mothballed/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/images/isis-logo.png differ
[15/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
deleted file mode 100644
index 1ec97ae..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?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>${groupId}</groupId>
- <artifactId>${rootArtifactId}</artifactId>
- <version>${version}</version>
- </parent>
-
- <artifactId>${artifactId}</artifactId>
- <name>ToDo App Integration Tests</name>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- </testResource>
- <testResource>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- </build>
- <dependencies>
-
- <!-- other modules in this project -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-fixture</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-unittestsupport</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-integtestsupport</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-specsupport</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </dependency>
-
- <!--
- uncomment to enable enhanced cucumber-jvm reporting
- http://www.masterthought.net/section/cucumber-reporting
- <dependency>
- <groupId>com.googlecode.totallylazy</groupId>
- <artifactId>totallylazy</artifactId>
- <version>991</version>
- </dependency>
-
- <dependency>
- <groupId>net.masterthought</groupId>
- <artifactId>cucumber-reporting</artifactId>
- <version>0.0.21</version>
- </dependency>
- <dependency>
- <groupId>net.masterthought</groupId>
- <artifactId>maven-cucumber-reporting</artifactId>
- <version>0.0.4</version>
- </dependency>
- -->
- </dependencies>
-
- <!--
- uncomment for enhanced cucumber-jvm reporting
- http://www.masterthought.net/section/cucumber-reporting
- <repositories>
- <repository>
- <id>repo.bodar.com</id>
- <url>http://repo.bodar.com</url>
- </repository>
- </repositories>
- -->
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
deleted file mode 100644
index 9e0e408..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
+++ /dev/null
@@ -1,80 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.core.runtime.persistence.PersistenceConstants;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
-import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
-
-/**
- * Holds an instance of an {@link IsisSystemForTest} as a {@link ThreadLocal} on the current thread,
- * initialized with ToDo app's domain services.
- */
-public class ToDoAppSystemInitializer {
-
- private ToDoAppSystemInitializer(){}
-
- public static IsisSystemForTest initIsft() {
- IsisSystemForTest isft = IsisSystemForTest.getElseNull();
- if(isft == null) {
- isft = new ToDoSystemBuilder().build().setUpSystem();
- IsisSystemForTest.set(isft);
- }
- return isft;
- }
-
- private static class ToDoSystemBuilder extends IsisSystemForTest.Builder {
-
- public ToDoSystemBuilder() {
- withLoggingAt(org.apache.log4j.Level.INFO);
- with(testConfiguration());
- with(new DataNucleusPersistenceMechanismInstaller());
-
- // services annotated with @DomainService
- withServicesIn("app"
- ,"dom.todo"
- ,"fixture.todo"
- ,"webapp.admin"
- ,"webapp.prototyping"
- ,"org.apache.isis.core.wrapper"
- ,"org.apache.isis.applib"
- ,"org.apache.isis.core.metamodel.services"
- ,"org.apache.isis.core.runtime.services"
- ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
- ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
- );
- }
-
- private static IsisConfiguration testConfiguration() {
- final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests();
- testConfiguration.addRegisterEntitiesPackagePrefix("dom");
-
- // enable stricter checking
- //
- // the consequence of this is having to call 'nextTransaction()' between most of the given/when/then's
- // because the command2 only ever refers to the event of the originating action.
- testConfiguration.put(PersistenceConstants.ENFORCE_SAFE_SEMANTICS, "true");
-
- return testConfiguration;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
deleted file mode 100644
index 250c0d5..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
+++ /dev/null
@@ -1,56 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue;
-
-import cucumber.api.java.After;
-import cucumber.api.java.Before;
-import integration.ToDoAppSystemInitializer;
-
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionScope;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-public class BootstrappingGlue extends CukeGlueAbstract {
-
- // //////////////////////////////////////
-
- @Before(value={"@unit"}, order=100)
- public void beforeScenarioUnitScope() {
- before(ScenarioExecutionScope.UNIT);
- }
-
- @Before(value={"@integration"}, order=100)
- public void beforeScenarioIntegrationScope() {
- org.apache.log4j.PropertyConfigurator.configure("logging.properties");
- ToDoAppSystemInitializer.initIsft();
-
- before(ScenarioExecutionScope.INTEGRATION);
- }
-
- @After
- public void afterScenario(cucumber.api.Scenario sc) {
- assertMocksSatisfied();
- after(sc);
- }
-
- // //////////////////////////////////////
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
deleted file mode 100644
index ca6d940..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
+++ /dev/null
@@ -1,50 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue;
-
-import cucumber.api.java.Before;
-import dom.todo.ToDoItem;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-public class CatalogOfFixturesGlue extends CukeGlueAbstract {
-
-
- @Before(value={"@unit", "@ToDoItemsFixture"}, order=20000)
- public void unitFixtures() throws Throwable {
- final InMemoryDB inMemoryDB = new InMemoryDBForToDoApp(this.scenarioExecution());
- inMemoryDB.getElseCreate(ToDoItem.class, "Write blog post");
- inMemoryDB.getElseCreate(ToDoItem.class, "Pick up bread");
- final ToDoItem t3 = inMemoryDB.getElseCreate(ToDoItem.class, "Pick up butter");
- t3.setComplete(true);
- putVar("isis", "in-memory-db", inMemoryDB);
- }
-
- // //////////////////////////////////////
-
- @Before(value={"@integration", "@ToDoItemsFixture"}, order=20000)
- public void integrationFixtures() throws Throwable {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
deleted file mode 100644
index 4d8af87..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue;
-
-import dom.todo.ToDoItem;
-
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
-
-public class InMemoryDBForToDoApp extends InMemoryDB {
-
- public InMemoryDBForToDoApp(ScenarioExecution scenarioExecution) {
- super(scenarioExecution);
- }
-
- /**
- * Hook to initialize if possible.
- */
- @Override
- protected void init(Object obj, String str) {
- if(obj instanceof ToDoItem) {
- ToDoItem toDoItem = (ToDoItem) obj;
- toDoItem.setDescription(str);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index 3db7fa1..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
+++ /dev/null
@@ -1,168 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue.todoitem;
-
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-
-import java.util.List;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.jmock.Expectations;
-import org.junit.Assert;
-import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemGlue extends CukeGlueAbstract {
-
- @Given("^there are a number of incomplete ToDo items${symbol_dollar}")
- public void there_are_a_number_of_incomplete_ToDo_items() throws Throwable {
- if(supportsMocks()) {
- checking(new Expectations() {
- {
- allowing(service(ToDoItems.class)).notYetComplete();
- will(returnValue(notYetCompleteItems()));
- }
- });
- }
- try {
- final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
- assertThat(notYetComplete.isEmpty(), is(false));
- putVar("list", "notYetCompleteItems", notYetComplete);
-
- } finally {
- assertMocksSatisfied();
- }
- }
-
- @When("^I choose the first of the incomplete items${symbol_dollar}")
- public void I_choose_the_first_one() throws Throwable {
- @SuppressWarnings("unchecked")
- List<ToDoItem> notYetComplete = getVar(null, "notYetCompleteItems", List.class);
- assertThat(notYetComplete.isEmpty(), is(false));
-
- putVar("todo", "toDoItem", notYetComplete.get(0));
- }
-
- @When("^mark the item as complete${symbol_dollar}")
- public void mark_it_as_complete() throws Throwable {
- final ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- if(supportsMocks()) {
- final ActionInvocationContext actionInvocationContext = service(ActionInvocationContext.class);
- final EventBusService eventBusService = service(EventBusService.class);
- checking(new Expectations() {
- {
- allowing(actionInvocationContext);
- allowing(eventBusService);
- }
- });
- toDoItem.actionInvocationContext = actionInvocationContext;
- toDoItem.eventBusService = eventBusService;
- }
- wrap(toDoItem).completed();
- }
-
- @Then("^the item is no longer listed as incomplete${symbol_dollar}")
- public void the_item_is_no_longer_listed_as_incomplete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- whetherNotYetCompletedContains(toDoItem, false);
- }
-
- @Given("^.*completed .*item${symbol_dollar}")
- public void a_completed_ToDo_item() throws Throwable {
- if(supportsMocks()) {
- checking(new Expectations(){{
- allowing(service(ToDoItems.class)).allToDos();
- will(returnValue(findItems(Predicates.<ToDoItem>alwaysTrue()) ));
- }});
- }
- try {
- final List<ToDoItem> allToDos = service(ToDoItems.class).allToDos();
- for (ToDoItem toDoItem : allToDos) {
- if(toDoItem.isComplete()) {
- putVar("todo", "toDoItem", toDoItem);
- return;
- }
- }
- Assert.fail("could not locate any completed ToDo items");
- } finally {
- assertMocksSatisfied();
- }
- }
-
- @When("^I mark the .*item as not yet complete${symbol_dollar}")
- public void I_mark_it_as_not_yet_complete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- assertThat(toDoItem.isComplete(), is(true));
-
- toDoItem.setComplete(false);
- }
-
- @Then("^the .*item is listed as incomplete${symbol_dollar}")
- public void the_item_is_listed_as_incomplete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- whetherNotYetCompletedContains(toDoItem, true);
- }
-
- private void whetherNotYetCompletedContains(ToDoItem toDoItem, final boolean whetherContained) {
- if(supportsMocks()) {
- final List<ToDoItem> notYetCompleteItems = notYetCompleteItems();
- checking(new Expectations() {
- {
- oneOf(service(ToDoItems.class)).notYetComplete();
- will(returnValue(notYetCompleteItems));
- }
- });
- }
- try {
- final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
- assertThat(notYetComplete.contains(toDoItem), is(whetherContained));
- } finally {
- assertMocksSatisfied();
- }
- }
-
-
- // helper
- private List<ToDoItem> notYetCompleteItems() {
- return findItems(new Predicate<ToDoItem>(){
- @Override
- public boolean apply(ToDoItem input) {
- return !input.isComplete();
- }
- });
- }
-
- private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
- final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
- final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
- return Lists.newArrayList(Iterables.filter(items, predicate));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
deleted file mode 100644
index a0d30e2..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
+++ /dev/null
@@ -1,41 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.specs.todoitem;
-
-import cucumber.api.junit.Cucumber;
-
-import org.junit.runner.RunWith;
-
-
-/**
- * Runs scenarios in all <tt>.feature</tt> files (this package and any subpackages).
- */
-@RunWith(Cucumber.class)
-@Cucumber.Options(
- format = {
- "html:target/cucumber-html-report"
- ,"json:target/cucumber.json"
- },
- glue={"classpath:integration.glue"},
- strict = true,
- tags = { "~@backlog", "~@ignore" })
-public class RunSpecs {
- // intentionally empty
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
deleted file mode 100644
index 9fc1596..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
+++ /dev/null
@@ -1,39 +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.
-#
-@ToDoItemsFixture
-Feature: Find And Complete ToDo Items
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @unit
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
- @integration
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
deleted file mode 100644
index 1f5f73e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
+++ /dev/null
@@ -1,35 +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.
-#
-@ToDoItemsFixture
-Feature: Find completed ToDoItem and mark as not yet complete
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @integration
- Scenario: Todo items can be uncompleted
- Given a completed item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
-
-
- @unit
- Scenario: Todo items can be uncompleted
- Given a completed ToDo item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
deleted file mode 100644
index 6776992..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests;
-
-import integration.ToDoAppSystemInitializer;
-
-import org.junit.BeforeClass;
-import org.apache.isis.core.integtestsupport.IntegrationTestAbstract;
-import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForIntegration;
-
-public abstract class AbstractToDoIntegTest extends IntegrationTestAbstract {
-
- @BeforeClass
- public static void initClass() {
- org.apache.log4j.PropertyConfigurator.configure("logging.properties");
- ToDoAppSystemInitializer.initIsft();
-
- // instantiating will install onto ThreadLocal
- new ScenarioExecutionForIntegration();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
deleted file mode 100644
index 7440088..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
+++ /dev/null
@@ -1,161 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public abstract class ToDoItemContributionsIntegTest extends AbstractToDoIntegTest {
-
- ToDoItemsRecreateAndCompleteSeveral fixtureScript;
-
- @Before
- public void setUpData() throws Exception {
- fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
- fixtureScripts.runFixtureScript(fixtureScript, null);
- }
-
- @Inject
- FixtureScripts fixtureScripts;
- @Inject
- ToDoItems toDoItems;
- @Inject
- ToDoItemContributions toDoItemContributions;
-
- ToDoItemContributions toDoItemContributionsWrapped;
- ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
-
- toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-complete-for-buy-stamps/item-1", ToDoItem.class));
- assertThat(toDoItem, is(not(nullValue())));
-
- toDoItemContributionsWrapped = wrap(toDoItemContributions);
- }
-
- public static class Actions {
- public static class UpdateCategory extends ToDoItemContributionsIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Consulting);
-
- // then
- assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Professional));
- assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Consulting));
-
- // when
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Domestic, ToDoItem.Subcategory.Chores);
-
- // then
- assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Domestic));
- assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Chores));
- }
-
-
- @Test
- public void categoryCannotBeNull() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("'Category' is mandatory");
- toDoItemContributionsWrapped.updateCategory(toDoItem, null, ToDoItem.Subcategory.Chores);
- }
-
- @Test
- public void subcategoryCanBeNull() throws Exception {
-
- // when, then
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, null);
- }
-
- @Test
- public void subcategoryMustBelongToCategory() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Invalid subcategory"));
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Chores);
- }
- }
-
- public static class SimilarTo extends ToDoItemContributionsIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- List<ToDoItem> similarItems = toDoItemContributionsWrapped.similarTo(toDoItem);
-
- // then
- assertThat(similarItems.size(), is(6));
- }
-
- }
- }
-
- public static class Properties {
- public static class Priority extends ToDoItemContributionsIntegTest {
-
- private List<ToDoItem> notYetComplete;
-
- @Before
- public void setUp() throws Exception {
- notYetComplete = wrap(toDoItems).notYetComplete();
- }
-
- @Test
- public void happyCase() throws Exception {
- assertPriority(0, 1);
- assertPriority(1, 2);
- assertPriority(2, 4);
- assertPriority(3, 6);
- assertPriority(4, 5);
- assertPriority(5, 7);
- assertPriority(6, 9);
- assertPriority(7, 8);
- assertPriority(8, 3);
- assertPriority(9, 10);
- }
-
- private void assertPriority(final int n, final int priority) {
- assertThat(toDoItemContributions.relativePriority(notYetComplete.get(n)), is(Integer.valueOf(priority)));
- }
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
deleted file mode 100644
index 84d3d16..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
+++ /dev/null
@@ -1,1060 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import java.math.BigDecimal;
-import java.nio.charset.Charset;
-import java.util.EventObject;
-import java.util.List;
-import javax.activation.MimeType;
-import javax.inject.Inject;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.hamcrest.TypeSafeMatcher;
-import org.jmock.Expectations;
-import org.jmock.Sequence;
-import org.jmock.auto.Mock;
-import org.joda.time.LocalDate;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-import org.apache.isis.applib.services.clock.ClockService;
-import org.apache.isis.applib.services.eventbus.AbstractInteractionEvent;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
-import org.apache.isis.applib.value.Blob;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemIntegTest extends AbstractToDoIntegTest {
-
- ToDoItemsRecreateAndCompleteSeveral fixtureScript;
-
- @Before
- public void setUpData() throws Exception {
- fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
- fixtureScripts.runFixtureScript(fixtureScript, null);
- }
-
- @Inject
- FixtureScripts fixtureScripts;
- @Inject
- ToDoItems toDoItems;
- @Inject
- ToDoItemSubscriptions toDoItemSubscriptions;
-
- ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @After
- public void tearDown() throws Exception {
- toDoItemSubscriptions.reset();
- }
-
-
- public static class Title extends ToDoItemIntegTest {
-
- private LocalDate dueBy;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(all.get(0));
-
- toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-for-buy-bread/item-1", ToDoItem.class));
- assertThat(toDoItem, is(not(nullValue())));
-
- nextTransaction();
-
- dueBy = toDoItem.getDueBy();
- }
-
-
- @Test
- public void includesDescription() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), containsString("Buy bread due by"));
-
- // when
- unwrap(toDoItem).setDescription("Buy bread and butter");
-
- // then
- assertThat(container().titleOf(toDoItem), containsString("Buy bread and butter due by"));
- }
-
- @Test
- public void includesDueDateIfAny() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), containsString("due by " + dueBy.toString("yyyy-MM-dd")));
-
- // when
- final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
- unwrap(toDoItem).setDueBy(fiveDaysFromNow);
-
- // then
- assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
- }
-
-
- @Test
- public void ignoresDueDateIfNone() throws Exception {
-
- // when
- // (since wrapped, will call clearDueBy)
- toDoItem.setDueBy(null);
-
- // then
- assertThat(container().titleOf(toDoItem), not(containsString("due by")));
- }
-
- @Test
- public void usesWhetherCompleted() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), not(containsString("Completed!")));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(container().titleOf(toDoItem), not(containsString("due by")));
- assertThat(container().titleOf(toDoItem), containsString("Buy bread - Completed!"));
- }
- }
-
- public static class Actions {
-
- public static class Completed extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
- }
-
- @Test
- public void cannotCompleteIfAlreadyCompleted() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then should fail
- expectedExceptions.expectMessage("Already completed");
- toDoItem.completed();
-
- // and then
- final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
- assertThat(ev, is(nullValue()));
- }
-
-
- @Test
- public void cannotSetPropertyDirectly() throws Exception {
-
- // given
-
- // when, then should fail
- expectedExceptions.expectMessage("Always disabled");
- toDoItem.setComplete(true);
-
- // and then
- final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
- assertThat(ev, is(nullValue()));
- }
-
- @Test
- public void subscriberReceivesEvents() throws Exception {
-
- // given
- toDoItemSubscriptions.reset();
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
- assertThat(unwrap(toDoItem).isComplete(), is(false));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(unwrap(toDoItem).isComplete(), is(true));
-
- // and then
- final List<ToDoItem.CompletedEvent> receivedEvents = toDoItemSubscriptions.receivedEvents(ToDoItem.CompletedEvent.class);
-
- // hide, disable, validate, executing, executed
- // sent to both the general on(ActionInteractionEvent ev)
- // and also the specific on(final ToDoItem.CompletedEvent ev)
- assertThat(receivedEvents.size(), is(5*2));
- final ToDoItem.CompletedEvent ev = receivedEvents.get(0);
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("completed"));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.completed();
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.completed();
- }
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.completed();
- }
-
- }
-
- /**
- * This test demonstrates how a single service can be replaced, eg to use a mock.
- */
- public static class Completed_withMockService extends ToDoItemIntegTest {
-
- private EventBusService originalEventBusService;
- @Mock
- private EventBusService mockEventBusService;
-
- @Before
- public void setUpMockEventBusService() throws Exception {
- originalEventBusService = scenarioExecution().service(EventBusService.class);
-
- context.checking(new Expectations() {{
- ignoring(mockEventBusService).register(with(any(Object.class)));
- ignoring(mockEventBusService).unregister(with(any(Object.class)));
- }});
-
- scenarioExecution().replaceService(originalEventBusService, mockEventBusService);
- scenarioExecution().closeSession();
- scenarioExecution().openSession();
-
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
-
- @After
- public void reinstateOriginalEventBusService() throws Exception {
- scenarioExecution().replaceService(mockEventBusService, originalEventBusService);
- }
-
- @Test
- public void raisesEvent() throws Exception {
-
- final Sequence busRulesThenExec = context.sequence("busRulesThenExec");
- // then
- context.checking(new Expectations() {{
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.HIDE)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.DISABLE)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.VALIDATE)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTING)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTED)));
- inSequence(busRulesThenExec);
- }});
-
- // when
- toDoItem.completed();
- }
-
- private Matcher<Object> completedEvent(final AbstractInteractionEvent.Phase phase) {
- return new TypeSafeMatcher<Object>() {
- @Override
- protected boolean matchesSafely(Object item) {
- if (!(item instanceof ToDoItem.CompletedEvent)) {
- return false;
- }
-
- final ToDoItem.CompletedEvent completedEvent = (ToDoItem.CompletedEvent) item;
- return completedEvent.getPhase() == phase;
-
- }
-
- @Override
- public void describeTo(Description description) {
- description.appendText(" instance of a ToDoItem.CompletedEvent, " + phase);
- }
- };
- }
- }
-
-
- public static class Duplicate extends ToDoItemIntegTest {
-
- ToDoItem duplicateToDoItem;
-
- @Inject
- private ClockService clockService;
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- final LocalDate todaysDate = clockService.now();
- toDoItem.setDueBy(todaysDate);
- toDoItem.updateCost(new BigDecimal("123.45"));
-
- duplicateToDoItem = toDoItem.duplicate(
- unwrap(toDoItem).default0Duplicate(),
- unwrap(toDoItem).default1Duplicate(),
- unwrap(toDoItem).default2Duplicate(),
- unwrap(toDoItem).default3Duplicate(),
- new BigDecimal("987.65"));
-
- // then
- assertThat(duplicateToDoItem.getDescription(), is(toDoItem.getDescription() + " - Copy"));
- assertThat(duplicateToDoItem.getCategory(), is(toDoItem.getCategory()));
- assertThat(duplicateToDoItem.getDueBy(), is(todaysDate));
- assertThat(duplicateToDoItem.getCost(), is(new BigDecimal("987.65")));
- }
- }
-
- public static class NotYetCompleted extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(toDoItem.isComplete(), is(false));
- }
-
- @Test
- public void cannotUndoIfNotYetCompleted() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when, then should fail
- expectedExceptions.expectMessage("Not yet completed");
- toDoItem.notYetCompleted();
- }
-
- /**
- * Even though {@link dom.todo.ToDoItem${symbol_pound}notYetCompleted()} is not annotated with
- * {@link org.apache.isis.applib.annotation.ActionInteraction}, an event is still raised.
- */
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
- unwrap(toDoItem).setComplete(true);
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(unwrap(toDoItem).isComplete(), is(false));
-
- // and then
- final ActionDomainEvent<ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("notYetCompleted"));
- }
- }
- }
-
- public static class Collections {
-
- public static class Dependencies {
- public static class Add extends ToDoItemIntegTest {
-
- private ToDoItem otherToDoItem;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
- otherToDoItem = wrap(items.get(1));
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- super.tearDown();
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDependencies().size(), is(0));
-
- // when
- toDoItem.add(otherToDoItem);
-
- // then
- assertThat(toDoItem.getDependencies().size(), is(1));
- assertThat(toDoItem.getDependencies().iterator().next(), is(unwrap(otherToDoItem)));
- }
-
-
- @Test
- public void cannotDependOnSelf() throws Exception {
-
- // then
- expectedExceptions.expectMessage("Can't set up a dependency to self");
-
- // when
- toDoItem.add(toDoItem);
- }
-
- @Test
- public void cannotAddIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // then
- expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- toDoItemSubscriptions.reset();
-
- // when
- toDoItem.add(otherToDoItem);
-
- // then received events
- @SuppressWarnings("unchecked")
- final List<EventObject> receivedEvents = toDoItemSubscriptions.receivedEvents();
-
- assertThat(receivedEvents.size(), is(7));
- assertThat(receivedEvents.get(0) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add() executed
- assertThat(receivedEvents.get(1) instanceof CollectionDomainEvent, is(true)); // ToDoItem${symbol_pound}dependencies add, executed
- assertThat(receivedEvents.get(2) instanceof CollectionDomainEvent, is(true)); // ToDoItem${symbol_pound}dependencies add, executing
- assertThat(receivedEvents.get(3) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add executing
- assertThat(receivedEvents.get(4) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add validate
- assertThat(receivedEvents.get(5) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add disable
- assertThat(receivedEvents.get(6) instanceof ActionDomainEvent, is(true)); // ToDoItem${symbol_pound}add hide
-
- // inspect the collection interaction (posted programmatically in ToDoItem${symbol_pound}add)
- final CollectionDomainEvent<ToDoItem,ToDoItem> ciEv = (CollectionDomainEvent<ToDoItem, ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionDomainEvent.class);
- assertThat(ciEv, is(notNullValue()));
-
- assertThat(ciEv.getSource(), is(equalTo(unwrap(toDoItem))));
- assertThat(ciEv.getIdentifier().getMemberName(), is("dependencies"));
- assertThat(ciEv.getOf(), is(CollectionDomainEvent.Of.ADD_TO));
- assertThat(ciEv.getValue(), is(unwrap(otherToDoItem)));
-
- // inspect the action interaction (posted declaratively by framework)
- final ActionDomainEvent<ToDoItem> aiEv = (ActionDomainEvent<ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
- assertThat(aiEv, is(notNullValue()));
-
- assertThat(aiEv.getSource(), is(equalTo(unwrap(toDoItem))));
- assertThat(aiEv.getIdentifier().getMemberName(), is("add"));
- assertThat(aiEv.getArguments().size(), is(1));
- assertThat(aiEv.getArguments().get(0), is(unwrap((Object)otherToDoItem)));
- assertThat(aiEv.getCommand(), is(notNullValue()));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
- }
- public static class Remove extends ToDoItemIntegTest {
-
- private ToDoItem otherToDoItem;
- private ToDoItem yetAnotherToDoItem;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
- otherToDoItem = wrap(items.get(1));
- yetAnotherToDoItem = wrap(items.get(2));
-
- toDoItem.add(otherToDoItem);
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- super.tearDown();
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDependencies().size(), is(1));
-
- // when
- toDoItem.remove(otherToDoItem);
-
- // then
- assertThat(toDoItem.getDependencies().size(), is(0));
- }
-
-
- @Test
- public void cannotRemoveItemIfNotADependency() throws Exception {
-
- // then
- expectedExceptions.expectMessage("Not a dependency");
-
- // when
- toDoItem.remove(yetAnotherToDoItem);
- }
-
- @Test
- public void cannotRemoveDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // then
- expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
- }
- }
-
- }
-
- public static class Properties {
-
- public static class Attachment extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- byte[] bytes = "{${symbol_escape}"foo${symbol_escape}": ${symbol_escape}"bar${symbol_escape}"}".getBytes(Charset.forName("UTF-8"));
- final Blob newAttachment = new Blob("myfile.json", new MimeType("application/json"), bytes);
-
- // when
- toDoItem.setAttachment(newAttachment);
-
- // then
- assertThat(toDoItem.getAttachment(), is(newAttachment));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setAttachment((Blob)null);
-
- // then
- assertThat(toDoItem.getAttachment(), is((Blob)null));
- }
- }
-
- public static class Category extends ToDoItemIntegTest {
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
- toDoItem.setCategory(ToDoItem.Category.Professional);
- }
- }
-
- public static class Cost extends ToDoItemIntegTest {
-
- private BigDecimal cost;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- cost = toDoItem.getCost();
- }
-
- @Test
- public void happyCaseUsingProperty() throws Exception {
-
- final BigDecimal newCost = new BigDecimal("123.45");
-
- // when
- toDoItem.updateCost(newCost);
-
- // then
- assertThat(toDoItem.getCost(), is(newCost));
- }
-
- @Test
- public void happyCaseUsingAction() throws Exception {
-
- final BigDecimal newCost = new BigDecimal("123.45");
-
- // when
- toDoItem.updateCost(newCost);
-
- // then
- assertThat(toDoItem.getCost(), is(newCost));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.updateCost((BigDecimal)null);
-
- // then
- assertThat(toDoItem.getCost(), is((BigDecimal)null));
- }
-
- @Test
- public void defaultForAction() throws Exception {
-
- // then
- assertThat(unwrap(toDoItem).default0UpdateCost(), is(cost));
- }
-
- }
-
- public static class Description extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.setDescription("Buy bread and butter");
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread and butter"));
- }
-
-
- @Test
- public void failsRegex() throws Exception {
-
- // when
- expectedExceptions.expectMessage("Doesn't match pattern");
- toDoItem.setDescription("exclamation marks are not allowed!!!");
- }
-
- @Test
- public void cannotBeNull() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Mandatory");
- toDoItem.setDescription(null);
- }
-
- @Test
- public void cannotUseModify() throws Exception {
-
- expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.modifyDescription("Buy bread and butter");
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread"));
- }
-
- @Test
- public void cannotUseClear() throws Exception {
-
- expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.clearDescription();
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread"));
- }
-
-
- @Test
- public void onlyJustShortEnough() throws Exception {
-
- // when, then
- toDoItem.setDescription(characters(100));
- }
-
- @Test
- public void tooLong() throws Exception {
-
- // then
- expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
-
- // when
- toDoItem.setDescription(characters(101));
- }
-
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.setDescription("Buy bread and butter");
-
- // then published and received
- @SuppressWarnings("unchecked")
- final PropertyDomainEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("description"));
- assertThat(ev.getOldValue(), is("Buy bread"));
- assertThat(ev.getNewValue(), is("Buy bread and butter"));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- private static String characters(final int n) {
- StringBuffer buf = new StringBuffer();
- for(int i=0; i<n; i++) {
- buf.append("a");
- }
- return buf.toString();
- }
- }
-
- public static class DueBy extends ToDoItemIntegTest {
-
- @Inject
- private ClockService clockService;
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- final LocalDate fiveDaysFromNow = clockService.now().plusDays(5);
- toDoItem.setDueBy(fiveDaysFromNow);
-
- // then
- assertThat(toDoItem.getDueBy(), is(fiveDaysFromNow));
- }
-
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setDueBy((LocalDate)null);
-
- // then
- assertThat(toDoItem.getDueBy(), is((LocalDate)null));
- }
-
- @Test
- public void canBeUpToSixDaysInPast() throws Exception {
-
- final LocalDate nowAsLocalDate = clockService.now();
- final LocalDate sixDaysAgo = nowAsLocalDate.plusDays(-5);
-
- // when
- toDoItem.setDueBy(sixDaysAgo);
-
- // then
- assertThat(toDoItem.getDueBy(), is(sixDaysAgo));
- }
-
-
- @Test
- public void cannotBeMoreThanSixDaysInPast() throws Exception {
-
- final LocalDate sevenDaysAgo = Clock.getTimeAsLocalDate().plusDays(-7);
-
- // when, then
- expectedExceptions.expectMessage("Due by date cannot be more than one week old");
- toDoItem.setDueBy(sevenDaysAgo);
- }
- }
-
- public static class Notes extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- final String newNotes = "Lorem ipsum yada yada";
-
- // when
- toDoItem.setNotes(newNotes);
-
- // then
- assertThat(toDoItem.getNotes(), is(newNotes));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setNotes((String)null);
-
- // then
- assertThat(toDoItem.getNotes(), is((String)null));
- }
-
- @Test
- public void suscriberReceivedDefaultEvent() throws Exception {
-
- final String newNotes = "Lorem ipsum yada yada";
-
- // when
- toDoItem.setNotes(newNotes);
-
- // then
- assertThat(unwrap(toDoItem).getNotes(), is(newNotes));
-
- // and then receive the default event.
- @SuppressWarnings("unchecked")
- final PropertyDomainEvent.Default ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.Default.class);
- assertThat(ev, is(notNullValue()));
-
- assertThat(ev.getSource(), is((Object)unwrap(toDoItem)));
- assertThat(ev.getNewValue(), is((Object)newNotes));
- }
-
-
- }
-
- public static class OwnedBy extends ToDoItemIntegTest {
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Reason: Hidden on Everywhere. Identifier: dom.todo.ToDoItem${symbol_pound}ownedBy()");
- toDoItem.setOwnedBy("other");
- }
-
-
- }
-
- public static class Subcategory extends ToDoItemIntegTest {
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
- toDoItem.setSubcategory(ToDoItem.Subcategory.Chores);
- }
- }
-
- }
-
-
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
deleted file mode 100644
index 203cdfe..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemsIntegTest extends AbstractToDoIntegTest {
-
- @Inject
- FixtureScripts fixtureScripts;
- @Inject
- ToDoItems toDoItems;
-
- public static class Finders extends ToDoItemsIntegTest {
-
- ToDoItemsIntegTestFixture fixture;
-
- @Before
- public void setUpData() throws Exception {
- // executing the fixtures directly allows us to look up the results later.
- fixtureScripts.runFixtureScript(fixture = new ToDoItemsIntegTestFixture(), null);
- }
-
- private int notYetCompletedSize;
- private int completedSize;
-
- @Before
- public void setUp() throws Exception {
-
- // could use fixture${symbol_pound}lookup(...), but can also just search directly.
- final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
- final List<ToDoItem> completedItems = wrap(toDoItems).complete();
-
- notYetCompletedSize = notYetCompleteItems.size();
- completedSize = completedItems.size();
-
- assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
- }
-
- @Test
- public void complete_and_notYetComplete() throws Exception {
-
- // given
- List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
- final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
- nextTransaction();
-
- // when
- toDoItem.completed();
- nextTransaction();
-
- // then
- assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize-1));
- assertThat(wrap(toDoItems).complete().size(), is(completedSize+1));
- nextTransaction();
-
- // and when
- toDoItem.notYetCompleted();
- nextTransaction();
-
- // then
- assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize));
- assertThat(wrap(toDoItems).complete().size(), is(completedSize));
- }
- }
-
- public static class NewToDo_and_Delete extends ToDoItemsIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- // none
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- int size = wrap(toDoItems).notYetComplete().size();
- nextTransaction();
-
- // when
- final ToDoItem newToDo = toDoItems.newToDo("new todo", ToDoItem.Category.Professional, ToDoItem.Subcategory.OpenSource, null, null);
- nextTransaction();
-
- // then
- assertThat(newToDo.getDescription(), is("new todo"));
- assertThat(newToDo.getCategory(), is(ToDoItem.Category.Professional));
- assertThat(wrap(toDoItems).notYetComplete().size(), is(size+1));
- assertThat(container().isPersistent(newToDo), is(true));
- assertThat(container().isPersistent(wrap(newToDo)), is(true));
-
- nextTransaction();
-
- // when
- newToDo.delete();
- nextTransaction();
-
- // then
- assertThat(wrap(toDoItems).notYetComplete().size(), is(size));
- }
-
- }
-
-}
\ No newline at end of file
[25/29] isis git commit: ISIS-903: TranslationService, LocaleProvider,
TrString class,
Posted by da...@apache.org.
ISIS-903: TranslationService, LocaleProvider, TrString class,
also:
- deprecated a bunch of old *Event files in the applib, for wrapper factory only.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/6a516c2d
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/6a516c2d
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/6a516c2d
Branch: refs/heads/ISIS-903
Commit: 6a516c2d0feec254454c7d8bf69ccb2b901354f2
Parents: a4ec0b7
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Feb 13 16:51:44 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Feb 14 09:07:33 2015 +0000
----------------------------------------------------------------------
.../apache/isis/applib/events/AccessEvent.java | 5 +-
.../isis/applib/events/ActionArgumentEvent.java | 5 +-
.../applib/events/ActionInvocationEvent.java | 5 +-
.../applib/events/ActionUsabilityEvent.java | 5 +-
.../applib/events/ActionVisibilityEvent.java | 5 +-
.../applib/events/CollectionAccessEvent.java | 5 +-
.../applib/events/CollectionAddToEvent.java | 5 +-
.../applib/events/CollectionMethodEvent.java | 6 +-
.../events/CollectionRemoveFromEvent.java | 5 +-
.../applib/events/CollectionUsabilityEvent.java | 5 +-
.../events/CollectionVisibilityEvent.java | 5 +-
.../isis/applib/events/InteractionEvent.java | 5 +-
.../isis/applib/events/ObjectTitleEvent.java | 5 +-
.../isis/applib/events/ObjectValidityEvent.java | 5 +-
.../applib/events/ObjectVisibilityEvent.java | 5 +-
.../isis/applib/events/ParseValueEvent.java | 5 +-
.../isis/applib/events/PropertyAccessEvent.java | 5 +-
.../isis/applib/events/PropertyModifyEvent.java | 5 +-
.../applib/events/PropertyUsabilityEvent.java | 5 +-
.../applib/events/PropertyVisibilityEvent.java | 5 +-
.../isis/applib/events/ProposedHolderEvent.java | 5 +-
.../isis/applib/events/UsabilityEvent.java | 5 +-
.../isis/applib/events/ValidityEvent.java | 5 +-
.../isis/applib/events/VisibilityEvent.java | 5 +-
.../i18n/TranslatableMessagesService.java | 96 ++++++++
.../services/i18n/TranslatableString.java | 240 +++++++++++++++++++
.../services/i18n/TranslationService.java | 44 ++++
.../applib/services/locale/LocaleProvider.java | 29 +++
.../isis/applib/services/i18n/TrStringTest.java | 123 ++++++++++
.../facets/all/i18n/I18nFacetFactory.java | 167 +++++++++++++
.../cssclassfa/CssClassFaFacetAbstract.java | 16 +-
.../services/ServicesInjectorDefault.java | 36 +--
.../services/i18n/LocaleProviderDefault.java | 36 +++
.../i18n/TranslationServiceLogging.java | 72 ++++++
.../specloader/ObjectReflectorDefault.java | 28 ++-
.../dflt/ProgrammingModelFacetsJava5.java | 13 +-
.../services/ServicesInstallerFallback.java | 52 ++++
...InstallerFromConfigurationAndAnnotation.java | 10 +
.../src/main/webapp/WEB-INF/isis.properties | 13 -
39 files changed, 1017 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/AccessEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/AccessEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/AccessEvent.java
index dd0f168..c4034ab 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/AccessEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/AccessEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents an access (reading) of a property, collection or title.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents an access (reading) of a property, collection or title.
*
* <p>
* Analogous to {@link ValidityEvent} (which corresponds to modifying a property
@@ -33,7 +33,10 @@ import org.apache.isis.applib.Identifier;
* @see UsabilityEvent
* @see VisibilityEvent
* @see ValidityEvent
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public abstract class AccessEvent extends InteractionEvent {
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ActionArgumentEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ActionArgumentEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ActionArgumentEvent.java
index 7f1f5b0..e497e8d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ActionArgumentEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ActionArgumentEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a particular argument for an action is valid
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a particular argument for an action is valid
* or not.
*
* <p>
@@ -31,7 +31,10 @@ import org.apache.isis.applib.Identifier;
*
* <p>
* Called once per argument, and before {@link ActionInvocationEvent}.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ActionArgumentEvent extends ValidityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ActionInvocationEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ActionInvocationEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ActionInvocationEvent.java
index 6b97f95..d23022b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ActionInvocationEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ActionInvocationEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a particular argument for an action is valid
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a particular argument for an action is valid
* or not.
*
* <p>
@@ -31,7 +31,10 @@ import org.apache.isis.applib.Identifier;
*
* <p>
* Called after each of the {@link ActionArgumentEvent}s.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ActionInvocationEvent extends ValidityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ActionUsabilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ActionUsabilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ActionUsabilityEvent.java
index 0e51e6c..772ab3e 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ActionUsabilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ActionUsabilityEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether an action is usable or has been disabled.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether an action is usable or has been disabled.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* action is disabled; otherwise action is enabled.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ActionUsabilityEvent extends UsabilityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ActionVisibilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ActionVisibilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ActionVisibilityEvent.java
index 1307f38..9e1199a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ActionVisibilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ActionVisibilityEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether an action is visible or has been hidden.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether an action is visible or has been hidden.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* action is invisible; otherwise action is visible.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ActionVisibilityEvent extends VisibilityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAccessEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAccessEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAccessEvent.java
index e182e49..f3e5aab 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAccessEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAccessEvent.java
@@ -22,14 +22,17 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents an access (reading) of a collection.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents an access (reading) of a collection.
*
* <p>
* Analogous to {@link CollectionAddToEvent} or
* {@link CollectionRemoveFromEvent}, however the {@link #getReason()} will
* always be <tt>null</tt>. (If access is not allowed then a vetoing
* {@link CollectionVisibilityEvent} would have been fired).
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class CollectionAccessEvent extends AccessEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAddToEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAddToEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAddToEvent.java
index a940bc4..3de08ce 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAddToEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionAddToEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a particular object to be added to a
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a particular object to be added to a
* collection is valid or not.
*
* <p>
@@ -30,7 +30,10 @@ import org.apache.isis.applib.Identifier;
* object is invalid; otherwise the object is valid.
*
* @see CollectionRemoveFromEvent
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class CollectionAddToEvent extends ValidityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/CollectionMethodEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionMethodEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionMethodEvent.java
index 93d50eb..be57bb1 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionMethodEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionMethodEvent.java
@@ -22,9 +22,11 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents an interaction with a collection object itself.
- *
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents an interaction with a collection object itself.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class CollectionMethodEvent extends AccessEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/CollectionRemoveFromEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionRemoveFromEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionRemoveFromEvent.java
index 909227c..d1372aa 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionRemoveFromEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionRemoveFromEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a particular object to be removed from a
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a particular object to be removed from a
* collection is valid or not.
*
* <p>
@@ -30,7 +30,10 @@ import org.apache.isis.applib.Identifier;
* object is invalid; otherwise the object is valid.
*
* @see CollectionAddToEvent
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class CollectionRemoveFromEvent extends ValidityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/CollectionUsabilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionUsabilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionUsabilityEvent.java
index cff56b7..1b0fe6d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionUsabilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionUsabilityEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a collection is usable or has been disabled.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a collection is usable or has been disabled.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* collection is disabled; otherwise collection is enabled.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class CollectionUsabilityEvent extends UsabilityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/CollectionVisibilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionVisibilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionVisibilityEvent.java
index f7965ae..cb0dabc 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/CollectionVisibilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/CollectionVisibilityEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a collection is visible or has been hidden.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a collection is visible or has been hidden.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* collection is invisible; otherwise collection is visible.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class CollectionVisibilityEvent extends VisibilityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/InteractionEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/InteractionEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/InteractionEvent.java
index 7b2b4c5..7905d6d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/InteractionEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/InteractionEvent.java
@@ -25,13 +25,16 @@ import java.util.List;
import org.apache.isis.applib.Identifier;
/**
- * Represents an interaction with a domain object or a particular feature
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents an interaction with a domain object or a particular feature
* (property, collection, action) of a domain object.
*
* <p>
* Many of the interactions are checks for {@link VisibilityEvent visibility},
* {@link UsabilityEvent usability} and {@link ValidityEvent validity}.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public abstract class InteractionEvent extends EventObject {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ObjectTitleEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ObjectTitleEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ObjectTitleEvent.java
index c4e19c2..b25f855 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ObjectTitleEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ObjectTitleEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents an access (reading) of an object's title.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents an access (reading) of an object's title.
*
* <p>
* The {@link #getReason()} will always be <tt>null</tt>; access is always
* allowed.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ObjectTitleEvent extends AccessEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ObjectValidityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ObjectValidityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ObjectValidityEvent.java
index 0266196..0068b1c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ObjectValidityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ObjectValidityEvent.java
@@ -22,14 +22,17 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether the current values of the
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether the current values of the
* properties/collections of an object are valid (for example, prior to saving
* that object).
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* object is invalid, otherwise ok.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ObjectValidityEvent extends ValidityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ObjectVisibilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ObjectVisibilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ObjectVisibilityEvent.java
index 883b968..59ca9db 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ObjectVisibilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ObjectVisibilityEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether an object is visible or has been hidden.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether an object is visible or has been hidden.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* object is invisible; otherwise action is visible.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ObjectVisibilityEvent extends VisibilityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ParseValueEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ParseValueEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ParseValueEvent.java
index 36566b1..3bafcaa 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ParseValueEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ParseValueEvent.java
@@ -22,13 +22,16 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether the proposed values of the value type is
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether the proposed values of the value type is
* valid.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* proposed value is invalid, otherwise the new value is acceptable.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class ParseValueEvent extends ValidityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/PropertyAccessEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyAccessEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyAccessEvent.java
index 090f949..06d9f8c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyAccessEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyAccessEvent.java
@@ -22,13 +22,16 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents an access (reading) of a property.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents an access (reading) of a property.
*
* <p>
* Analogous to {@link PropertyModifyEvent}, however the {@link #getReason()}
* will always be <tt>null</tt>. (If access is not allowed then a
* {@link PropertyVisibilityEvent} would have been fired).
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class PropertyAccessEvent extends AccessEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/PropertyModifyEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyModifyEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyModifyEvent.java
index 33be17e..51ef377 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyModifyEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyModifyEvent.java
@@ -22,13 +22,16 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a particular value for a property is valid
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a particular value for a property is valid
* or not.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* value is invalid; otherwise the value is valid.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class PropertyModifyEvent extends ValidityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/PropertyUsabilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyUsabilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyUsabilityEvent.java
index a4a94d2..f4a8593 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyUsabilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyUsabilityEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a property is usable or has been disabled.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a property is usable or has been disabled.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* property is disabled; otherwise property is enabled.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class PropertyUsabilityEvent extends UsabilityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/PropertyVisibilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyVisibilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyVisibilityEvent.java
index c8b72e4..a0b538d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/PropertyVisibilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/PropertyVisibilityEvent.java
@@ -22,12 +22,15 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check as to whether a property is visible or has been hidden.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check as to whether a property is visible or has been hidden.
*
* <p>
* If {@link #getReason()} is not <tt>null</tt> then provides the reason why the
* property is invisible; otherwise property is visible.
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public class PropertyVisibilityEvent extends VisibilityEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ProposedHolderEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ProposedHolderEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ProposedHolderEvent.java
index 5358bbb..292cc72 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ProposedHolderEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ProposedHolderEvent.java
@@ -20,10 +20,13 @@
package org.apache.isis.applib.events;
/**
- * Makes it easier to process different events that hold a single proposed
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> makes it easier to process different events that hold a single proposed
* argument (such as {@link CollectionAddToEvent} and
* {@link PropertyModifyEvent}).
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public interface ProposedHolderEvent {
Object getProposed();
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/UsabilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/UsabilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/UsabilityEvent.java
index 7792bdd..0e6e6b6 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/UsabilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/UsabilityEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check to determine whether a member of an object is usable or
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check to determine whether a member of an object is usable or
* has been disabled.
*
* <p>
@@ -32,7 +32,10 @@ import org.apache.isis.applib.Identifier;
* @see AccessEvent
* @see VisibilityEvent
* @see ValidityEvent
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public abstract class UsabilityEvent extends InteractionEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/ValidityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/ValidityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/ValidityEvent.java
index d452400..a50ad88 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/ValidityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/ValidityEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check to determine whether a proposed change is valid.
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check to determine whether a proposed change is valid.
*
* <p>
* Multiple subclasses, including:
@@ -41,7 +41,10 @@ import org.apache.isis.applib.Identifier;
* @see AccessEvent
* @see VisibilityEvent
* @see UsabilityEvent
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public abstract class ValidityEvent extends InteractionEvent implements ProposedHolderEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/events/VisibilityEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/events/VisibilityEvent.java b/core/applib/src/main/java/org/apache/isis/applib/events/VisibilityEvent.java
index a306b02..06908e6 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/events/VisibilityEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/events/VisibilityEvent.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.events;
import org.apache.isis.applib.Identifier;
/**
- * Represents a check to determine whether a member of an object is visible or
+ * <i>Supported only by {@link org.apache.isis.applib.services.wrapper.WrapperFactory} service, </i> represents a check to determine whether a member of an object is visible or
* has been hidden.
*
* <p>
@@ -32,7 +32,10 @@ import org.apache.isis.applib.Identifier;
* @see AccessEvent
* @see UsabilityEvent
* @see ValidityEvent
+ *
+ * @deprecated - superceded by <code>domainEvent</code> support ({@link org.apache.isis.applib.services.eventbus.PropertyDomainEvent}, {@link org.apache.isis.applib.IsisApplibModule.CollectionDomainEvent}, {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}).
*/
+@Deprecated
public abstract class VisibilityEvent extends InteractionEvent {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java
new file mode 100644
index 0000000..63b6fad
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java
@@ -0,0 +1,96 @@
+/*
+ * 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.applib.services.i18n;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.value.Clob;
+
+@DomainService(
+ nature = NatureOfService.VIEW_MENU_ONLY
+)
+@DomainServiceLayout(
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ named = "Prototyping"
+)
+public class TranslatableMessagesService {
+
+ @Programmatic
+ @PostConstruct
+ public void init(final Map<String,String> config) {
+ final Properties props = new Properties();
+ for (final String key : config.keySet()) {
+ props.put(key, config.get(key));
+ }
+ props.list(System.out);
+ }
+
+ @Programmatic
+ @PreDestroy
+ public void shutdown() {
+
+ }
+
+
+ @Action(
+ semantics = SemanticsOf.SAFE
+ )
+ @ActionLayout(
+ cssClassFa = "fa-download"
+ )
+ public Clob downloadPotFile(
+ @ParameterLayout(named = ".pot file name")
+ final String potFileName) {
+ final Map<String, Collection<String>> messages = translationService.messages();
+ final StringBuilder buf = new StringBuilder();
+ for (String message : messages.keySet()) {
+ final Collection<String> contexts = messages.get(message);
+ for (String context : contexts) {
+ buf.append("#: ").append(context).append("\n");
+ }
+ buf.append("msgid: \"").append(message).append("\"\n");
+ buf.append("msgstr: \"\"\n");
+ buf.append("\n\n\n");
+ }
+ return new Clob(potFileName, "text/plain", buf.toString());
+ }
+
+ public String default0DownloadPotFile() {
+ return "myapp.pot";
+ }
+
+ // //////////////////////////////////////
+
+
+ @Inject
+ private TranslationService translationService;
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java
new file mode 100644
index 0000000..75b1a6e
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java
@@ -0,0 +1,240 @@
+/*
+ * 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.applib.services.i18n;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import com.google.common.collect.Lists;
+
+public final class TranslatableString {
+
+ //region > tr, trn (factory methods)
+
+ /**
+ * A translatable string supporting both singular and plural forms.
+ *
+ * @param pattern - pattern for all (singular and plural) form, with <code>${xxx}</code> placeholders
+ * @param paramArgs - parameter/argument pairs (string and object, string and object, ...)
+ */
+ public static TranslatableString tr(
+ final String pattern,
+ final Object... paramArgs) {
+ return new TranslatableString(Type.TR, pattern, null, 1, asMap(paramArgs));
+ }
+
+ /**
+ * A translatable string supporting both singular and plural forms.
+ *
+ * @param singularPattern - pattern for the singular form, with <code>${xxx}</code> placeholders
+ * @param pluralPattern - pattern for the singular form, with <code>${xxx}</code> placeholders
+ * @param number - whether to use singular or plural form when rendering
+ * @param paramArgs - parameter/argument pairs (string and object, string and object, ...)
+ */
+ public static TranslatableString trn(
+ final String singularPattern,
+ final String pluralPattern,
+ final int number,
+ final Object... paramArgs) {
+ return new TranslatableString(Type.TRN, singularPattern, pluralPattern, number, asMap(paramArgs));
+ }
+
+ /**
+ * Converts a list of objects [a, 1, b, 2] into a map {a -> 1; b -> 2}
+ */
+ private static Map<String, Object> asMap(final Object[] paramArgs) {
+ final HashMap<String, Object> map = new HashMap<String, Object>();
+ boolean param = true;
+ String paramStr = null;
+ for (final Object paramArg : paramArgs) {
+ if (param) {
+ if (paramArg instanceof String) {
+ paramStr = (String) paramArg;
+ } else {
+ throw new IllegalArgumentException("Parameter must be a string");
+ }
+ } else {
+ final Object arg = paramArg;
+ map.put(paramStr, arg);
+ paramStr = null;
+ }
+ param = !param;
+ }
+ if (paramStr != null) {
+ throw new IllegalArgumentException("Must have equal number of parameters and arguments");
+ }
+ return map;
+ }
+ //endregion
+
+
+ private final Type type;
+ private final String singularPattern;
+ private final String pluralPattern;
+ private final int number;
+ private final Map<String, Object> argumentsByParameterName;
+
+ private enum Type {
+ /**
+ * No plurals
+ */
+ TR {
+ @Override
+ public String toString(final TranslatableString trString) {
+ return "tr: " + trString.singularPattern;
+ }
+ },
+ /**
+ * With plurals
+ */
+ TRN {
+ @Override
+ public String toString(final TranslatableString trString) {
+ return "trn: " + trString.pluralPattern;
+ }
+ };
+
+ public abstract String toString(final TranslatableString trString);
+ }
+
+ private TranslatableString(
+ final Type type,
+ final String singularPattern,
+ final String pluralPattern,
+ final int number,
+ final Map<String, Object> argumentsByParameterName) {
+
+ this.type = type;
+ this.singularPattern = singularPattern;
+ this.pluralPattern = pluralPattern;
+ this.number = number;
+ this.argumentsByParameterName = argumentsByParameterName;
+ }
+
+ /**
+ * The pattern (or the singular pattern if {@link #isPluralForm()} is <code>true</code>).
+ */
+ String getSingularPattern() {
+ return singularPattern;
+ }
+
+ /**
+ * The plural pattern (but will be <code>null</code> if {@link #isPluralForm()} is <code>false</code>).
+ */
+ String getPluralPattern() {
+ return pluralPattern;
+ }
+
+ boolean isPluralForm() {
+ return type == Type.TRN;
+ }
+
+ /**
+ * The arguments; excluded from {@link #equals(Object)} comparison.
+ */
+ Map<String, Object> getArgumentsByParameterName() {
+ return argumentsByParameterName;
+ }
+
+ //region > equals, hashCode
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ final TranslatableString that = (TranslatableString) o;
+
+ if (pluralPattern != null ? !pluralPattern.equals(that.pluralPattern) : that.pluralPattern != null)
+ return false;
+ if (singularPattern != null ? !singularPattern.equals(that.singularPattern) : that.singularPattern != null)
+ return false;
+ if (type != that.type) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = type != null ? type.hashCode() : 0;
+ result = 31 * result + (singularPattern != null ? singularPattern.hashCode() : 0);
+ result = 31 * result + (pluralPattern != null ? pluralPattern.hashCode() : 0);
+ return result;
+ }
+
+ //endregion
+
+
+ //region > translate
+
+ public String translate(final TranslationService translationService, final String context, final Locale locale) {
+ final String translatedText = translationService.translate(context, getText(), locale);
+ return translated(translatedText);
+ }
+
+ /**
+ * The text to be translated; depends on whether {@link #isPluralForm()} and whether to be translated.
+ *
+ * <p>
+ * May or may not hold placeholders.
+ * </p>
+ */
+ String getText() {
+ return !isPluralForm() || number == 1 ? getSingularPattern() : getPluralPattern();
+ }
+
+ String translated(final String translatedText) {
+ return format(translatedText, argumentsByParameterName);
+ }
+
+ static String format(String format, Map<String, Object> values)
+ {
+ StringBuilder formatter = new StringBuilder(format);
+ List<Object> valueList = Lists.newArrayList();
+
+ Matcher matcher = Pattern.compile("\\{(\\w+)}").matcher(format);
+
+ while (matcher.find())
+ {
+ String key = matcher.group(1);
+
+ String formatKey = String.format("{%s}", key);
+ int index = formatter.indexOf(formatKey);
+
+ if (index != -1)
+ {
+ formatter.replace(index, index + formatKey.length(), "%s");
+ valueList.add(values.get(key));
+ }
+ }
+
+ return String.format(formatter.toString(), valueList.toArray());
+ }
+
+ //endregion
+
+
+ @Override
+ public String toString() {
+ return type.toString(this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java
new file mode 100644
index 0000000..6204cdd
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java
@@ -0,0 +1,44 @@
+/*
+ * 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.applib.services.i18n;
+
+import java.util.Collection;
+import java.util.Locale;
+import java.util.Map;
+import org.apache.isis.applib.annotation.Programmatic;
+
+public interface TranslationService {
+
+ @Programmatic
+ public String translate(final String context, final String originalText, final Locale targetLocale);
+
+ /**
+ * Returns the set of messages encountered and cached by the service (the key of the map) along with a set of
+ * context strings (the value of the map)
+ *
+ * <p>
+ * The intention is that an implementation running in prototype mode should retain all requests to
+ * {@link #translate(String, String, java.util.Locale)}, such that they can be translated and used by the
+ * same implementation in non-prototype mode.
+ * </p>
+ */
+ @Programmatic
+ public Map<String, Collection<String>> messages();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/main/java/org/apache/isis/applib/services/locale/LocaleProvider.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/locale/LocaleProvider.java b/core/applib/src/main/java/org/apache/isis/applib/services/locale/LocaleProvider.java
new file mode 100644
index 0000000..5a34285
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/locale/LocaleProvider.java
@@ -0,0 +1,29 @@
+/*
+ * 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.applib.services.locale;
+
+import java.util.Locale;
+import org.apache.isis.applib.annotation.Programmatic;
+
+public interface LocaleProvider {
+
+ @Programmatic
+ Locale getLocale();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
----------------------------------------------------------------------
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java b/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
new file mode 100644
index 0000000..552f9e1
--- /dev/null
+++ b/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
@@ -0,0 +1,123 @@
+package org.apache.isis.applib.services.i18n;
+
+import java.util.Collection;
+import java.util.Locale;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class TrStringTest {
+
+ public static class GetText extends TrStringTest {
+
+ @Test
+ public void singularForm() throws Exception {
+ final TranslatableString ts = TranslatableString.tr("No, you can't do that!");
+
+ assertThat(ts.getText(), is("No, you can't do that!"));
+ }
+
+ @Test
+ public void pluralFormOne() throws Exception {
+ final TranslatableString ts = TranslatableString.trn("You can't do that because there is a dependent object", "You can't do that because there are dependent objects", 1);
+
+ assertThat(ts.getText(), is("You can't do that because there is a dependent object"));
+ }
+
+ @Test
+ public void pluralFormTwo() throws Exception {
+ final TranslatableString ts = TranslatableString.trn("You can't do that because there is a dependent object", "You can't do that because there are dependent objects", 2);
+
+ assertThat(ts.getText(), is("You can't do that because there are dependent objects"));
+ }
+
+ }
+
+ public static class Translated extends TrStringTest {
+
+ @Test
+ public void singularForm() throws Exception {
+ final TranslatableString ts = TranslatableString.tr("My name is {lastName}, {firstName} {lastName}.", "lastName", "Bond", "firstName", "James");
+
+ assertThat(ts.translated("Iche heisse {lastName}, {firstName} {lastName}."), is("Iche heisse Bond, James Bond."));
+ }
+
+ @Test
+ public void pluralFormOne() throws Exception {
+ final TranslatableString ts = TranslatableString.trn(
+ "My name is {lastName}, {firstName} {lastName}.",
+ "My name is {firstName} {lastName}.",
+ 1,
+ "lastName", "Bond", "firstName", "James");
+
+ assertThat(ts.translated("Iche heisse {lastName}, {firstName} {lastName}."), is("Iche heisse Bond, James Bond."));
+ }
+ }
+
+ public static class Translate extends TrStringTest {
+
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(JUnitRuleMockery2.Mode.INTERFACES_AND_CLASSES);
+
+ private TranslationService echoTranslationService;
+
+ private String originalTextToTranslate;
+
+ @Before
+ public void setUp() throws Exception {
+ echoTranslationService = new TranslationService() {
+ @Override
+ public String translate(final String context, final String originalText, final Locale targetLocale) {
+ originalTextToTranslate = originalText;
+ return originalText;
+ }
+ @Override
+ public Map<String, Collection<String>> messages() {
+ return null;
+ }
+ };
+ }
+
+ @Test
+ public void singularForm() throws Exception {
+ final TranslatableString ts = TranslatableString.tr("My name is {lastName}, {firstName} {lastName}.", "lastName", "Bond", "firstName", "James");
+
+ assertThat(ts.translate(echoTranslationService, null, null), is("My name is Bond, James Bond."));
+ assertThat(originalTextToTranslate, is("My name is {lastName}, {firstName} {lastName}."));
+ }
+
+ @Test
+ public void pluralFormOne() throws Exception {
+ final TranslatableString ts = TranslatableString.trn(
+ "My name is {lastName}, {firstName} {lastName}.",
+ "My name is {firstName} {lastName}.",
+ 1,
+ "lastName", "Bond", "firstName", "James");
+
+ assertThat(ts.translate(echoTranslationService, null, null), is("My name is Bond, James Bond."));
+ assertThat(originalTextToTranslate, is("My name is {lastName}, {firstName} {lastName}."));
+ }
+
+ @Test
+ public void pluralFormTwo() throws Exception {
+ final TranslatableString ts = TranslatableString.trn(
+ "My name is {lastName}, {firstName} {lastName}.",
+ "My name is {firstName} {lastName}.",
+ 2,
+ "lastName", "Bond", "firstName", "James");
+
+ assertThat(ts.translate(echoTranslationService, null, null), is("My name is James Bond."));
+ assertThat(originalTextToTranslate, is("My name is {firstName} {lastName}."));
+ }
+
+ }
+
+
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java
new file mode 100644
index 0000000..6761b04
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java
@@ -0,0 +1,167 @@
+/*
+ * 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.core.metamodel.facets.all.i18n;
+
+
+import java.util.Locale;
+import java.util.Objects;
+import com.google.common.base.Strings;
+import org.apache.isis.applib.services.i18n.TranslationService;
+import org.apache.isis.applib.services.locale.LocaleProvider;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facetapi.IdentifiedHolder;
+import org.apache.isis.core.metamodel.facetdecorator.i18n.internal.DescribedAsFacetWrapI18n;
+import org.apache.isis.core.metamodel.facetdecorator.i18n.internal.NamedFacetWrapI18n;
+import org.apache.isis.core.metamodel.facets.ContributeeMemberFacetFactory;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjectorAware;
+
+public class I18nFacetFactory extends FacetFactoryAbstract implements ContributeeMemberFacetFactory, ServicesInjectorAware {
+
+ private ServicesInjector servicesInjector;
+
+ private TranslationService translationService;
+ private LocaleProvider localeProvider;
+
+ public I18nFacetFactory() {
+ super(FeatureType.EVERYTHING);
+ }
+
+ @Override
+ public void process(final ProcessClassContext processClassContext) {
+ final FacetHolder facetHolder = processClassContext.getFacetHolder();
+ if(facetHolder instanceof IdentifiedHolder) {
+ final IdentifiedHolder holder = (IdentifiedHolder) facetHolder;
+ final String context = holder.getIdentifier().toClassIdentityString();
+ translateName(holder, context);
+ translateDescription(holder, context);
+ }
+ }
+
+ @Override
+ public void process(final ProcessMethodContext processMethodContext) {
+ final IdentifiedHolder holder = processMethodContext.getFacetHolder();
+
+ final String context = holder.getIdentifier().toClassAndNameIdentityString();
+ translateName(holder, context);
+ translateDescription(holder, context);
+ }
+
+ @Override
+ public void processParams(final ProcessParameterContext processParameterContext) {
+ final IdentifiedHolder holder = processParameterContext.getFacetHolder();
+
+ final String context = holder.getIdentifier().toFullIdentityString();
+ translateName(holder, context);
+ translateDescription(holder, context);
+ }
+
+ @Override
+ public void process(final ProcessContributeeMemberContext processMemberContext) {
+ final IdentifiedHolder holder = processMemberContext.getFacetHolder();
+
+ final String context = holder.getIdentifier().toClassAndNameIdentityString();
+ translateName(holder, context);
+ translateDescription(holder, context);
+ }
+
+ // //////////////////////////////////////
+
+ void translateName(final IdentifiedHolder facetHolder, final String context) {
+ final NamedFacet facet = facetHolder.getFacet(NamedFacet.class);
+ if(facet == null) {
+ // not expected...
+ return;
+ }
+ final String originalText = facet.value();
+ if (isNullOrEmptyWhenTrimmed(originalText)) {
+ // not expected...
+ return;
+ }
+
+ final TranslationService translationService = lookupTranslationService();
+ final LocaleProvider localeProvider = lookupLocaleProvider();
+
+ final Locale locale = localeProvider.getLocale();
+ final String translatedText = translationService.translate(context, originalText, locale);
+ if(!Objects.equals(originalText, translatedText)) {
+ FacetUtil.addFacet(new NamedFacetWrapI18n(translatedText, facetHolder));
+ }
+ }
+
+ void translateDescription(final FacetHolder facetHolder, final String context) {
+
+ final IdentifiedHolder holder = (IdentifiedHolder) facetHolder;
+ final DescribedAsFacet facet = facetHolder.getFacet(DescribedAsFacet.class);
+ if(facet == null) {
+ return;
+ }
+ final String originalText = facet.value();
+ if (isNullOrEmptyWhenTrimmed(originalText)) {
+ return;
+ }
+
+ final TranslationService translationService = lookupTranslationService();
+ final LocaleProvider localeProvider = lookupLocaleProvider();
+
+ final Locale locale = localeProvider.getLocale();
+ final String translatedText = translationService.translate(context, originalText, locale);
+ if(!Objects.equals(originalText, translatedText)) {
+ FacetUtil.addFacet(new DescribedAsFacetWrapI18n(translatedText, holder));
+ }
+ }
+
+ private boolean isNullOrEmptyWhenTrimmed(final String originalText) {
+ return originalText == null || Strings.isNullOrEmpty(originalText.trim());
+ }
+
+ // //////////////////////////////////////
+
+ /**
+ * Looks up from {@link org.apache.isis.core.metamodel.runtimecontext.ServicesInjector}, otherwise defaults to
+ * {@link org.apache.isis.core.metamodel.services.i18n.LocaleProviderDefault}.
+ */
+ LocaleProvider lookupLocaleProvider() {
+ if(localeProvider == null) {
+ localeProvider = servicesInjector.lookupService(LocaleProvider.class);
+ }
+ return localeProvider;
+ }
+
+ /**
+ * Looks up from {@link org.apache.isis.core.metamodel.runtimecontext.ServicesInjector}, otherwise defaults to
+ * {@link org.apache.isis.core.metamodel.services.i18n.TranslationServiceLogging}.
+ */
+ TranslationService lookupTranslationService() {
+ if(translationService == null) {
+ translationService = servicesInjector.lookupService(TranslationService.class);
+ }
+ return translationService;
+ }
+
+ @Override
+ public void setServicesInjector(final ServicesInjector servicesInjector) {
+ this.servicesInjector = servicesInjector;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
index 99fba5f..963b860 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/cssclassfa/CssClassFaFacetAbstract.java
@@ -51,17 +51,23 @@ public class CssClassFaFacetAbstract extends SingleStringValueFacetAbstract impl
* @param value The original CSS classes defined with {@literal @}{@link org.apache.isis.applib.annotation.CssClassFa CssClassFa}
* @return The original CSS classes plus <em>fa</em> and <em>fa-fw</em> if not already provided
*/
- static String sanitize(String value) {
- Iterable<String> classes = Splitter.on(WHITESPACE).split(value);
- Set<String> cssClassesSet = Sets.newLinkedHashSet();
+ static String sanitize(final String value) {
+ final Iterable<String> classes = Splitter.on(WHITESPACE).split(value);
+ final Set<String> cssClassesSet = Sets.newLinkedHashSet();
cssClassesSet.add("fa");
cssClassesSet.add("fa-fw");
- for (String cssClass : classes) {
- cssClassesSet.add(cssClass);
+ for (final String cssClass : classes) {
+ cssClassesSet.add(faPrefix(cssClass));
}
return Joiner.on(' ').join(cssClassesSet).trim();
}
+ private static String faPrefix(final String cssClass) {
+ return cssClass.startsWith("fa-")
+ ? cssClass
+ : "fa-" + cssClass;
+ }
+
public static Class<? extends Facet> type() {
return CssClassFaFacet.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
index da67329..409f8c5 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
@@ -71,7 +71,7 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
* </p>
* @param injectorMethodEvaluator
*/
- public ServicesInjectorDefault(InjectorMethodEvaluator injectorMethodEvaluator) {
+ public ServicesInjectorDefault(final InjectorMethodEvaluator injectorMethodEvaluator) {
this.injectorMethodEvaluator = injectorMethodEvaluator != null ? injectorMethodEvaluator : new InjectorMethodEvaluatorDefault();
}
@@ -187,7 +187,7 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
final List<Field> fields = Arrays.asList(cls.getDeclaredFields());
final Iterable<Field> injectFields = Iterables.filter(fields, new Predicate<Field>() {
@Override
- public boolean apply(Field input) {
+ public boolean apply(final Field input) {
final Inject annotation = input.getAnnotation(javax.inject.Inject.class);
return annotation != null;
}
@@ -204,10 +204,10 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
}
}
- private void autowire(Object object, Field field, List<Object> services) {
+ private void autowire(final Object object, final Field field, final List<Object> services) {
for (final Object service : services) {
final Class<?> serviceClass = service.getClass();
- boolean canInject = isInjectorFieldFor(field, serviceClass);
+ final boolean canInject = isInjectorFieldFor(field, serviceClass);
if(canInject) {
field.setAccessible(true);
invokeInjectorField(field, object, service);
@@ -219,7 +219,7 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
private void autowireViaPrefixedMethods(final Object object, final List<Object> services, final Class<?> cls, final String prefix) {
final List<Method> methods = Arrays.asList(cls.getMethods());
final Iterable<Method> prefixedMethods = Iterables.filter(methods, new Predicate<Method>(){
- public boolean apply(Method method) {
+ public boolean apply(final Method method) {
final String methodName = method.getName();
return methodName.startsWith(prefix);
}
@@ -230,10 +230,10 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
}
}
- private void autowire(Object object, Method prefixedMethod, List<Object> services) {
+ private void autowire(final Object object, final Method prefixedMethod, final List<Object> services) {
for (final Object service : services) {
final Class<?> serviceClass = service.getClass();
- boolean isInjectorMethod = injectorMethodEvaluator.isInjectorMethodFor(prefixedMethod, serviceClass);
+ final boolean isInjectorMethod = injectorMethodEvaluator.isInjectorMethodFor(prefixedMethod, serviceClass);
if(isInjectorMethod) {
prefixedMethod.setAccessible(true);
invokeInjectorMethod(prefixedMethod, object, service);
@@ -271,9 +271,9 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
private static void invokeInjectorField(final Field field, final Object target, final Object parameter) {
try {
field.set(target, parameter);
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
throw new MetaModelException(e);
- } catch (IllegalAccessException e) {
+ } catch (final IllegalAccessException e) {
throw new MetaModelException(String.format("Cannot access the %s field in %s", field.getName(), target.getClass().getName()));
}
if (LOG.isDebugEnabled()) {
@@ -299,38 +299,38 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
//region > lookupService, lookupServices
@Override
- public <T> T lookupService(Class<T> serviceClass) {
- List<T> services = lookupServices(serviceClass);
+ public <T> T lookupService(final Class<T> serviceClass) {
+ final List<T> services = lookupServices(serviceClass);
return !services.isEmpty() ? services.get(0) : null;
}
@SuppressWarnings("unchecked")
@Override
- public <T> List<T> lookupServices(Class<T> serviceClass) {
+ public <T> List<T> lookupServices(final Class<T> serviceClass) {
locateAndCache(serviceClass);
return (List<T>) servicesByType.get(serviceClass);
};
- private void locateAndCache(Class<?> serviceClass) {
+ private void locateAndCache(final Class<?> serviceClass) {
if(servicesByType.containsKey(serviceClass)) {
return;
}
- List<Object> matchingServices = Lists.newArrayList();
+ final List<Object> matchingServices = Lists.newArrayList();
addAssignableTo(serviceClass, services, matchingServices);
servicesByType.put(serviceClass, matchingServices);
}
- private static void addAssignableTo(Class<?> type, List<Object> candidates, List<Object> filteredServicesAndContainer) {
- Iterable<Object> filteredServices = Iterables.filter(candidates, ofType(type));
+ private static void addAssignableTo(final Class<?> type, final List<Object> candidates, final List<Object> filteredServicesAndContainer) {
+ final Iterable<Object> filteredServices = Iterables.filter(candidates, ofType(type));
filteredServicesAndContainer.addAll(Lists.newArrayList(filteredServices));
}
private static final Predicate<Object> ofType(final Class<?> cls) {
return new Predicate<Object>() {
@Override
- public boolean apply(Object input) {
+ public boolean apply(final Object input) {
return cls.isAssignableFrom(input.getClass());
}
};
@@ -343,7 +343,7 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi, Specificati
private InjectorMethodEvaluator injectorMethodEvaluator;
@Override
- public void setSpecificationLookup(SpecificationLoader specificationLookup) {
+ public void setSpecificationLookup(final SpecificationLoader specificationLookup) {
injectorMethodEvaluator = specificationLookup;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/LocaleProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/LocaleProviderDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/LocaleProviderDefault.java
new file mode 100644
index 0000000..4b7ec49
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/LocaleProviderDefault.java
@@ -0,0 +1,36 @@
+/*
+ * 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.core.metamodel.services.i18n;
+
+
+import java.util.Locale;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.services.locale.LocaleProvider;
+
+/**
+ * Not annotated with @DomainService, but is registered as a fallback by <tt>ServicesInstallerFallback</tt>.
+ */
+public class LocaleProviderDefault implements LocaleProvider {
+
+ @Programmatic
+ @Override
+ public Locale getLocale() {
+ return Locale.getDefault();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java
new file mode 100644
index 0000000..e4f8467
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java
@@ -0,0 +1,72 @@
+/*
+ * 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.core.metamodel.services.i18n;
+
+import java.util.Collection;
+import java.util.Locale;
+import java.util.Map;
+import java.util.NavigableSet;
+import com.google.common.collect.TreeMultimap;
+import org.joda.time.LocalDateTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.services.i18n.TranslationService;
+
+/**
+ * Not annotated with @DomainService, but is registered as a fallback by <tt>ServicesInstallerFallback</tt>.
+ */
+public class TranslationServiceLogging implements TranslationService {
+
+ public static Logger LOG = LoggerFactory.getLogger(TranslationServiceLogging.class);
+
+ private final TreeMultimap<String, String> messages = TreeMultimap.create();
+
+ public TranslationServiceLogging() {
+
+ LOG.info("");
+ LOG.info("");
+ LOG.info("");
+ LOG.info("################################################################################");
+ LOG.info("#");
+ LOG.info("# " + LocalDateTime.now().toString("yyyy-MM-dd HH:mm:ss"));
+ LOG.info("#");
+ LOG.info("################################################################################");
+ LOG.info("");
+ LOG.info("");
+
+ }
+
+ @Override
+ @Programmatic
+ public String translate(final String context, final String originalText, final Locale targetLocale) {
+
+ final NavigableSet<String> contexts = messages.get(originalText);
+ final boolean added = contexts.add(context);
+ if(added) {
+ LOG.info(String.format("%s_%s: %s", targetLocale.getISO3Country(), targetLocale.getISO3Language(), originalText));
+ }
+ return originalText;
+ }
+
+ @Programmatic
+ public Map<String, Collection<String>> messages() {
+ return messages.asMap();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/6a516c2d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
index ce25255..a27a1bf 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
@@ -490,25 +490,19 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
}
public ObjectSpecification introspectIfRequired(final ObjectSpecification spec) {
+
final ObjectSpecificationAbstract specSpi = (ObjectSpecificationAbstract)spec;
final IntrospectionState introspectionState = specSpi.getIntrospectionState();
+ // REVIEW: can't remember why this is done in multiple passes, could it be simplified?
if (introspectionState == IntrospectionState.NOT_INTROSPECTED) {
+
specSpi.setIntrospectionState(IntrospectionState.BEING_INTROSPECTED);
-
- specSpi.introspectTypeHierarchyAndMembers();
- facetDecoratorSet.decorate(spec);
- specSpi.updateFromFacetValues();
-
- specSpi.setIntrospectionState(IntrospectionState.INTROSPECTED);
+ introspect(specSpi);
+
} else if (introspectionState == IntrospectionState.BEING_INTROSPECTED) {
- // nothing to do
- specSpi.introspectTypeHierarchyAndMembers();
- facetDecoratorSet.decorate(spec);
- specSpi.updateFromFacetValues();
-
- specSpi.setIntrospectionState(IntrospectionState.INTROSPECTED);
+ introspect(specSpi);
} else if (introspectionState == IntrospectionState.INTROSPECTED) {
// nothing to do
@@ -516,6 +510,13 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
return spec;
}
+ private void introspect(final ObjectSpecificationAbstract specSpi) {
+ specSpi.introspectTypeHierarchyAndMembers();
+ facetDecoratorSet.decorate(specSpi);
+ specSpi.updateFromFacetValues();
+ specSpi.setIntrospectionState(IntrospectionState.INTROSPECTED);
+ }
+
@Override
public ObjectSpecification lookupBySpecId(ObjectSpecId objectSpecId) {
return getCache().getByObjectType(objectSpecId);
@@ -628,7 +629,8 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
return o.getClass();
}
});
- return Collections.unmodifiableList(serviceClasses);
+ // take a copy, to allow eg I18nFacetFactory to add in default implementations of missing services.
+ return Collections.unmodifiableList(Lists.newArrayList(serviceClasses));
}
@Override
[26/29] isis git commit: ISIS-903: refactoring in the direction of
also reading .po files
Posted by da...@apache.org.
ISIS-903: refactoring in the direction of also reading .po files
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/226ef624
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/226ef624
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/226ef624
Branch: refs/heads/ISIS-903
Commit: 226ef6246ea6c827f7e1964537aca8864c8d7152
Parents: 6a516c2
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Feb 13 18:57:49 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Feb 14 09:07:35 2015 +0000
----------------------------------------------------------------------
.../i18n/TranslatableMessagesService.java | 96 -----------------
.../services/i18n/TranslationService.java | 14 ---
.../isis/applib/services/i18n/TrStringTest.java | 6 --
.../facets/all/i18n/I18nFacetFactory.java | 2 +-
.../i18n/TranslationServiceLogging.java | 72 -------------
.../services/i18n/TranslationServicePoMenu.java | 71 +++++++++++++
.../services/i18n/po/MsgIdAndContext.java | 70 +++++++++++++
.../metamodel/services/i18n/po/PoAbstract.java | 39 +++++++
.../metamodel/services/i18n/po/PoReader.java | 70 +++++++++++++
.../metamodel/services/i18n/po/PotWriter.java | 102 +++++++++++++++++++
.../services/ServicesInstallerFallback.java | 4 +-
11 files changed, 355 insertions(+), 191 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java
deleted file mode 100644
index 63b6fad..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableMessagesService.java
+++ /dev/null
@@ -1,96 +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.applib.services.i18n;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Properties;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.value.Clob;
-
-@DomainService(
- nature = NatureOfService.VIEW_MENU_ONLY
-)
-@DomainServiceLayout(
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- named = "Prototyping"
-)
-public class TranslatableMessagesService {
-
- @Programmatic
- @PostConstruct
- public void init(final Map<String,String> config) {
- final Properties props = new Properties();
- for (final String key : config.keySet()) {
- props.put(key, config.get(key));
- }
- props.list(System.out);
- }
-
- @Programmatic
- @PreDestroy
- public void shutdown() {
-
- }
-
-
- @Action(
- semantics = SemanticsOf.SAFE
- )
- @ActionLayout(
- cssClassFa = "fa-download"
- )
- public Clob downloadPotFile(
- @ParameterLayout(named = ".pot file name")
- final String potFileName) {
- final Map<String, Collection<String>> messages = translationService.messages();
- final StringBuilder buf = new StringBuilder();
- for (String message : messages.keySet()) {
- final Collection<String> contexts = messages.get(message);
- for (String context : contexts) {
- buf.append("#: ").append(context).append("\n");
- }
- buf.append("msgid: \"").append(message).append("\"\n");
- buf.append("msgstr: \"\"\n");
- buf.append("\n\n\n");
- }
- return new Clob(potFileName, "text/plain", buf.toString());
- }
-
- public String default0DownloadPotFile() {
- return "myapp.pot";
- }
-
- // //////////////////////////////////////
-
-
- @Inject
- private TranslationService translationService;
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java
index 6204cdd..df182ad 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslationService.java
@@ -18,9 +18,7 @@
*/
package org.apache.isis.applib.services.i18n;
-import java.util.Collection;
import java.util.Locale;
-import java.util.Map;
import org.apache.isis.applib.annotation.Programmatic;
public interface TranslationService {
@@ -28,17 +26,5 @@ public interface TranslationService {
@Programmatic
public String translate(final String context, final String originalText, final Locale targetLocale);
- /**
- * Returns the set of messages encountered and cached by the service (the key of the map) along with a set of
- * context strings (the value of the map)
- *
- * <p>
- * The intention is that an implementation running in prototype mode should retain all requests to
- * {@link #translate(String, String, java.util.Locale)}, such that they can be translated and used by the
- * same implementation in non-prototype mode.
- * </p>
- */
- @Programmatic
- public Map<String, Collection<String>> messages();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
----------------------------------------------------------------------
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java b/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
index 552f9e1..7399a2d 100644
--- a/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
+++ b/core/applib/src/test/java/org/apache/isis/applib/services/i18n/TrStringTest.java
@@ -1,8 +1,6 @@
package org.apache.isis.applib.services.i18n;
-import java.util.Collection;
import java.util.Locale;
-import java.util.Map;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -76,10 +74,6 @@ public class TrStringTest {
originalTextToTranslate = originalText;
return originalText;
}
- @Override
- public Map<String, Collection<String>> messages() {
- return null;
- }
};
}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java
index 6761b04..f866f94 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/all/i18n/I18nFacetFactory.java
@@ -151,7 +151,7 @@ public class I18nFacetFactory extends FacetFactoryAbstract implements Contribute
/**
* Looks up from {@link org.apache.isis.core.metamodel.runtimecontext.ServicesInjector}, otherwise defaults to
- * {@link org.apache.isis.core.metamodel.services.i18n.TranslationServiceLogging}.
+ * {@link org.apache.isis.core.metamodel.services.i18n.po.TranslationServicePo}.
*/
TranslationService lookupTranslationService() {
if(translationService == null) {
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java
deleted file mode 100644
index e4f8467..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServiceLogging.java
+++ /dev/null
@@ -1,72 +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.core.metamodel.services.i18n;
-
-import java.util.Collection;
-import java.util.Locale;
-import java.util.Map;
-import java.util.NavigableSet;
-import com.google.common.collect.TreeMultimap;
-import org.joda.time.LocalDateTime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.i18n.TranslationService;
-
-/**
- * Not annotated with @DomainService, but is registered as a fallback by <tt>ServicesInstallerFallback</tt>.
- */
-public class TranslationServiceLogging implements TranslationService {
-
- public static Logger LOG = LoggerFactory.getLogger(TranslationServiceLogging.class);
-
- private final TreeMultimap<String, String> messages = TreeMultimap.create();
-
- public TranslationServiceLogging() {
-
- LOG.info("");
- LOG.info("");
- LOG.info("");
- LOG.info("################################################################################");
- LOG.info("#");
- LOG.info("# " + LocalDateTime.now().toString("yyyy-MM-dd HH:mm:ss"));
- LOG.info("#");
- LOG.info("################################################################################");
- LOG.info("");
- LOG.info("");
-
- }
-
- @Override
- @Programmatic
- public String translate(final String context, final String originalText, final Locale targetLocale) {
-
- final NavigableSet<String> contexts = messages.get(originalText);
- final boolean added = contexts.add(context);
- if(added) {
- LOG.info(String.format("%s_%s: %s", targetLocale.getISO3Country(), targetLocale.getISO3Language(), originalText));
- }
- return originalText;
- }
-
- @Programmatic
- public Map<String, Collection<String>> messages() {
- return messages.asMap();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServicePoMenu.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServicePoMenu.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServicePoMenu.java
new file mode 100644
index 0000000..1e38bc5
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/TranslationServicePoMenu.java
@@ -0,0 +1,71 @@
+/*
+ * 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.core.metamodel.services.i18n;
+
+import javax.inject.Inject;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.value.Clob;
+import org.apache.isis.core.metamodel.services.i18n.po.TranslationServicePo;
+
+@DomainService(
+ nature = NatureOfService.VIEW_MENU_ONLY
+)
+@DomainServiceLayout(
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ named = "Prototyping"
+)
+public class TranslationServicePoMenu {
+
+ private boolean prototype;
+
+ @Action(
+ semantics = SemanticsOf.SAFE,
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @ActionLayout(
+ cssClassFa = "fa-download"
+ )
+ public Clob downloadPotFile(
+ @ParameterLayout(named = ".pot file name")
+ final String potFileName) {
+ final String chars = translationService.toPo();
+ return new Clob(potFileName, "text/plain", chars);
+ }
+
+ public String default0DownloadPotFile() {
+ return "myapp.pot";
+ }
+ public boolean hideDownloadPotFile() {
+ return translationService == null;
+ }
+
+ // //////////////////////////////////////
+
+
+ @Inject
+ private TranslationServicePo translationService;
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/MsgIdAndContext.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/MsgIdAndContext.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/MsgIdAndContext.java
new file mode 100644
index 0000000..f7fbd65
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/MsgIdAndContext.java
@@ -0,0 +1,70 @@
+package org.apache.isis.core.metamodel.services.i18n.po;
+
+/**
+ * The combination of a <tt>msgId</tt> and context (optionally null) that represents a key to a translatable resource.
+ *
+ * <p>
+ * For example, with this <i>.pot</i> file:
+ * </p>
+ * <pre>
+ * #: org.isisaddons.module.sessionlogger.dom.SessionLoggingServiceMenu#activeSessions()
+ msgid: "Active Sessions"
+
+ #: org.isisaddons.module.audit.dom.AuditingServiceMenu
+ #: org.isisaddons.module.command.dom.CommandServiceMenu
+ #: org.isisaddons.module.publishing.dom.PublishingServiceMenu
+ msgid: "Activity"
+
+ * </pre>
+ *
+ * <p>
+ * the combination of <code>{org.isisaddons.module.sessionlogger.dom.SessionLoggingServiceMenu#activeSessions(), "Active Sessions"}</code> represents such a key, as does <code>{org.isisaddons.module.audit.dom.AuditingServiceMenu, "Activity"}</code>
+ * </p>
+ */
+public class MsgIdAndContext implements Comparable<MsgIdAndContext> {
+
+ private final String context;
+ private final String msgId;
+
+ public MsgIdAndContext(final String msgId, final String context) {
+ this.msgId = msgId;
+ this.context = context == null? "": context;
+ }
+
+ public String getMsgId() {
+ return msgId;
+ }
+
+ public String getContext() {
+ return context;
+ }
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ final MsgIdAndContext that = (MsgIdAndContext) o;
+
+ if (context != null ? !context.equals(that.context) : that.context != null) return false;
+ if (msgId != null ? !msgId.equals(that.msgId) : that.msgId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = context != null ? context.hashCode() : 0;
+ result = 31 * result + (msgId != null ? msgId.hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public int compareTo(final MsgIdAndContext o) {
+ final int i = msgId.compareTo(o.msgId);
+ if(i != 0) {
+ return i;
+ }
+ return context.compareTo(o.context);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoAbstract.java
new file mode 100644
index 0000000..b910984
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoAbstract.java
@@ -0,0 +1,39 @@
+/*
+ * 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.core.metamodel.services.i18n.po;
+
+import java.util.Locale;
+import java.util.Map;
+
+abstract class PoAbstract {
+
+ protected final TranslationServicePo translationServicePo;
+
+ PoAbstract(final TranslationServicePo translationServicePo) {
+ this.translationServicePo = translationServicePo;
+ }
+
+
+ abstract void init(final Map<String,String> config);
+
+ abstract void shutdown();
+
+ abstract String translate(final String context, final String msgId, final Locale targetLocale);
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java
new file mode 100644
index 0000000..293488f
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PoReader.java
@@ -0,0 +1,70 @@
+/*
+ * 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.core.metamodel.services.i18n.po;
+
+import java.util.Locale;
+import java.util.Map;
+import com.google.common.collect.Maps;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+class PoReader extends PoAbstract {
+
+ public static Logger LOG = LoggerFactory.getLogger(PoReader.class);
+
+ private final Map<Locale, Map<MsgIdAndContext, String>> translationByKeyByLocale = Maps.newHashMap();
+
+ public PoReader(final TranslationServicePo translationServicePo) {
+ super(translationServicePo);
+ }
+
+ //region > init, shutdown
+ void init(final Map<String,String> config) {
+ }
+
+ void shutdown() {
+ }
+ //endregion
+
+
+ public String translate(final String context, final String msgId, final Locale targetLocale) {
+
+ Map<MsgIdAndContext, String> translationByKey = translationByKeyByLocale.get(targetLocale);
+ if(translationByKey == null) {
+ translationByKey = Maps.newTreeMap();
+ translationByKeyByLocale.put(targetLocale, translationByKey);
+ }
+
+ final MsgIdAndContext key = new MsgIdAndContext(msgId, context);
+ String translation = translationByKey.get(key);
+ if (translation == null) {
+ translation = translate(targetLocale, key);
+ translationByKey.put(key, translation);
+ }
+
+ return translation;
+ }
+
+ private String translate(final Locale locale, final MsgIdAndContext key) {
+ // TODO
+ return key.getMsgId();
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java
new file mode 100644
index 0000000..6247c86
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/PotWriter.java
@@ -0,0 +1,102 @@
+/*
+ * 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.core.metamodel.services.i18n.po;
+
+import java.util.Collection;
+import java.util.Locale;
+import java.util.Map;
+import java.util.NavigableSet;
+import com.google.common.collect.TreeMultimap;
+import org.joda.time.LocalDateTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+class PotWriter extends PoAbstract {
+
+ public static Logger LOG = LoggerFactory.getLogger(PotWriter.class);
+
+ private final TreeMultimap<String, String> contextsByMsgId = TreeMultimap.create();
+
+ public PotWriter(final TranslationServicePo translationServicePo) {
+ super(translationServicePo);
+ }
+
+
+ //region > init, shutdown
+ void init(final Map<String,String> config) {
+ }
+
+ void shutdown() {
+ LOG.info("");
+ LOG.info("");
+ LOG.info("################################################################################");
+ LOG.info("#");
+ LOG.info("# " + LocalDateTime.now().toString("yyyy-MM-dd HH:mm:ss"));
+ LOG.info("#");
+ LOG.info("################################################################################");
+ LOG.info("");
+ LOG.info("");
+ LOG.info("");
+ LOG.info(toPo());
+ LOG.info("");
+ LOG.info("");
+ LOG.info("");
+ }
+ //endregion
+
+
+ public String translate(final String context, final String originalText, final Locale targetLocale) {
+ final NavigableSet<String> contexts = contextsByMsgId.get(originalText);
+ contexts.add(context);
+ return originalText;
+ }
+
+ /**
+ * Not API
+ */
+ String toPo() {
+ final Map<String, Collection<String>> messages = messagesWithContext();
+ final StringBuilder buf = new StringBuilder();
+ for (String message : messages.keySet()) {
+ final Collection<String> contexts = messages.get(message);
+ for (String context : contexts) {
+ buf.append("#: ").append(context).append("\n");
+ }
+ buf.append("msgid: \"").append(message).append("\"\n");
+ buf.append("msgstr: \"\"\n");
+ buf.append("\n\n\n");
+ }
+ return buf.toString();
+ }
+
+ /**
+ * Returns the set of messages encountered and cached by the service (the key of the map) along with a set of
+ * context strings (the value of the map)
+ *
+ * <p>
+ * The intention is that an implementation running in prototype mode should retain all requests to
+ * {@link #translate(String, String, java.util.Locale)}, such that they can be translated and used by the
+ * same implementation in non-prototype mode.
+ * </p>
+ */
+ Map<String, Collection<String>> messagesWithContext() {
+ return contextsByMsgId.asMap();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/226ef624/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java
index dcf4ed0..9f560ce 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFallback.java
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.isis.core.commons.config.InstallerAbstract;
import org.apache.isis.core.metamodel.services.i18n.LocaleProviderDefault;
-import org.apache.isis.core.metamodel.services.i18n.TranslationServiceLogging;
+import org.apache.isis.core.metamodel.services.i18n.po.TranslationServicePo;
import org.apache.isis.core.runtime.system.DeploymentType;
public class ServicesInstallerFallback extends InstallerAbstract implements ServicesInstaller {
@@ -38,7 +38,7 @@ public class ServicesInstallerFallback extends InstallerAbstract implements Serv
@Override
public List<Object> getServices(final DeploymentType deploymentType) {
- return Lists.newArrayList(new TranslationServiceLogging(), new LocaleProviderDefault());
+ return Lists.newArrayList(new TranslationServicePo(), new LocaleProviderDefault());
}
@Override
[18/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
deleted file mode 100644
index 0a85fb6..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties
+++ /dev/null
@@ -1,66 +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.
-
-#
-# configuration file for the Restful Objects viewer
-#
-
-# the baseUrl for hrefs in the events generated by the RO EventSerializer
-isis.viewer.restfulobjects.RestfulObjectsSpecEventSerializer.baseUrl=http://localhost:8080/restful/
-
-# renders param details in the (incorrect) form that they were for GSOC2013 viewers
-# isis.viewer.restfulobjects.gsoc2013.legacyParamDetails=true
-
-# whether to honor UI hints, in particular Render(EAGERLY). Defaults to false.
-#isis.viewer.restfulobjects.honorUiHints=false
-
-
-
-###############################################################################
-# Non-standard configuration settings.
-#
-# If enabled of the following are enabled then the viewer is deviating from the
-# RO spec standard; compatibility may be compromised with RO clients.
-###############################################################################
-
-# whether to show only object properties for object members
-# (on the object representation only)
-# Takes precedence over the other 'suppress' below.
-#isis.viewer.restfulobjects.objectPropertyValuesOnly=true
-
-# whether to suppress "describedby" links. Defaults to false.
-#isis.viewer.restfulobjects.suppressDescribedByLinks=true
-
-# whether to suppress "update" links. Defaults to false.
-#isis.viewer.restfulobjects.suppressUpdateLink=true
-
-# whether to suppress "id" json-prop for object members. Defaults to false.
-#isis.viewer.restfulobjects.suppressMemberId=true
-
-# whether to suppress "links" json-prop for object members
-# (on the object representation only). Defaults to false.
-#isis.viewer.restfulobjects.suppressMemberLinks=true
-
-# whether to suppress "extensions" json-prop for object members
-# (on the object representation only). Defaults to false.
-#isis.viewer.restfulobjects.suppressMemberExtensions=true
-
-# whether to suppress "disabledReason" json-prop for object members
-# (on the object representation only). Defaults to false.
-#isis.viewer.restfulobjects.suppressMemberDisabledReason=true
-
-###############################################################################
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
deleted file mode 100644
index 41bd21b..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties
+++ /dev/null
@@ -1,87 +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.
-
-#
-# configuration file for the Wicket viewer
-#
-
-#
-# The maximum length of titles to display in standalone or parented tables.
-# Titles longer than this length will be truncated with trailing ellipses (...)
-#
-# For example, if set to 12, the title
-# "Buy milk on 15-Feb-13" will be truncated to "Buy milk ..."
-#
-# If set to 0, then only the icon will be shown.
-#
-isis.viewer.wicket.maxTitleLengthInStandaloneTables=0
-isis.viewer.wicket.maxTitleLengthInParentedTables=0
-
-
-#isis.viewer.wicket.datePattern=dd-MM-yyyy
-#isis.viewer.wicket.dateTimePattern=dd-MM-yyyy HH:mm
-#isis.viewer.wicket.datePickerPattern=DD-MM-YYYY
-
-#isis.viewer.wicket.datePattern=dd/MM/yy
-#isis.viewer.wicket.dateTimePattern=dd/MM/yy HH:mm
-#isis.viewer.wicket.datePickerPattern=DD/MM/YY
-
-
-
-#
-# whether to strip wicket tags from markup (default is true, as they may break some CSS rules)
-#
-#isis.viewer.wicket.stripWicketTags=false
-
-
-#
-# whether to suppress the 'rememberMe' checkbox on the login page (default is false)
-#
-#isis.viewer.wicket.suppressRememberMe=false
-
-#
-# if user attempts to access a protected URL before signing in, then as a convenience the viewer will continue
-# through to that destination after successful login. If you consider this to be a security risk then this flag
-# disables that behaviour (default is false).
-#
-#isis.viewer.wicket.clearOriginalDestination=true
-
-
-#
-# whether to show action dialogs on their own page rather than as a modal dialog (default is false)
-#
-#isis.viewer.wicket.disableModalDialogs=false
-
-
-#
-# the maximum number of pages to list in bookmark (default is 15)
-#
-#isis.viewer.wicket.bookmarkedPages.maxSize=15
-
-
-#
-# whether to show the bootstrap theme chooser (defaults false)
-#
-#isis.viewer.wicket.themes.showChooser=false
-isis.viewer.wicket.themes.showChooser=true
-
-#
-# comma-separated list of themes to choose from (default is to show all themes from bootswatch.com).
-#
-#isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
-isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 5cc79b5..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,308 +0,0 @@
-<?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 id="WebApp_ID" version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>Todo app</display-name>
-
- <welcome-file-list>
- <welcome-file>about/index.html</welcome-file>
- </welcome-file-list>
-
- <!-- shiro security configuration -->
- <listener>
- <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
- </listener>
-
- <filter>
- <filter-name>ShiroFilter</filter-name>
- <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>ShiroFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-
-
- <!-- which configuration directory to read overloaded property files from -->
- <!--
- Normally configuration like this should be done from outside your web
- application. Especially if your configuration is not know in advance or
- if it can change depending on where the application gets deployed.
-
- For instance to configure this in Tomcat outside the application WAR add
- the following line to your application context ( For more detail see:
- http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Context_Parameters )
-
- <Parameter name="isis.config.dir" value="/usr/local/tomcat/conf/"
- override="true"/>
-
- If your configuration directory is fixed you can enable the following
- context parameter in here and forget about the outside part.
-
- <context-param>
- <param-name>isis.config.dir</param-name>
- <param-value>location of your config directory if fixed</param-value>
- </context-param>
- -->
-
-
- <!--
- determines which additional configuration files to search for
- -->
- <context-param>
- <param-name>isis.viewers</param-name>
- <param-value>wicket,restfulobjects</param-value>
- </context-param>
-
-
- <!--
- for diagnostics
- -->
- <filter>
- <filter-name>IsisLogOnExceptionFilter</filter-name>
- <filter-class>org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>IsisLogOnExceptionFilter</filter-name>
- <url-pattern>/wicket/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>IsisLogOnExceptionFilter</filter-name>
- <url-pattern>/restful/*</url-pattern>
- </filter-mapping>
-
-
- <!-- cache static resources for 1 day -->
- <filter>
- <filter-name>ResourceCachingFilter</filter-name>
- <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
- <init-param>
- <param-name>CacheTime</param-name>
- <param-value>86400</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.js</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.css</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.png</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.jpg</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.gif</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.html</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.swf</url-pattern>
- </filter-mapping>
-
- <servlet>
- <servlet-name>Resource</servlet-name>
- <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.css</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.png</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.jpg</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.gif</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.js</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.html</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.swf</url-pattern>
- </servlet-mapping>
-
-
-
- <!--
- -
- - config specific to the wicket-viewer
- -
- -->
- <filter>
- <filter-name>WicketFilter</filter-name>
- <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
- <init-param>
- <param-name>applicationClassName</param-name>
- <param-value>webapp.ToDoApplication</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>WicketFilter</filter-name>
- <url-pattern>/wicket/*</url-pattern>
- </filter-mapping>
-
-
- <context-param>
- <param-name>configuration</param-name>
- <!--
- <param-value>deployment</param-value>
- -->
- <param-value>development</param-value>
- </context-param>
-
-
- <!--
- -
- - config specific to the restfulobjects-viewer
- -
- -->
-
- <!--
- THE FOLLOWING CONFIGURATION IS NOT REQUIRED IF THE WICKET VIEWER IS IN USE.
- IF THE WICKET VIEWER CONFIGURATION IS REMOVED, THEN UNCOMMENT
-
- <listener>
- <listener-class>org.apache.isis.core.webapp.IsisWebAppBootstrapper</listener-class>
- </listener>
-
- <context-param>
- <param-name>deploymentType</param-name>
- <param-value>SERVER_EXPLORATION</param-value>
- </context-param>
-
- <context-param>
- <param-name>isis.viewers</param-name>
- <param-value>restfulobjects</param-value>
- </context-param>
- -->
-
- <!-- bootstrap the RestEasy framework -->
- <listener>
- <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
- </listener>
-
- <!-- used by RestEasy to determine the JAX-RS resources and other related configuration -->
- <context-param>
- <param-name>javax.ws.rs.Application</param-name>
- <param-value>org.apache.isis.viewer.restfulobjects.server.RestfulObjectsApplication</param-value>
- </context-param>
-
- <context-param>
- <param-name>resteasy.servlet.mapping.prefix</param-name>
- <param-value>/restful/</param-value>
- </context-param>
-
-
- <!-- authenticate user, set up an Isis session -->
- <filter>
- <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
- <filter-class>org.apache.isis.core.webapp.IsisSessionFilter</filter-class>
- <!-- authentication required for REST -->
- <init-param>
- <param-name>authenticationSessionStrategy</param-name>
- <param-value>org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyBasicAuth</param-value>
- </init-param>
- <init-param>
- <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
- <param-name>whenNoSession</param-name>
- <param-value>basicAuthChallenge</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <!-- this is mapped to the entire app; however the IsisSessionFilter will "notice" if the session filter has already been
- executed for the request pipeline, and if so will do nothing -->
- <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- </filter-mapping>
-
- <filter>
- <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
- <filter-class>org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>IsisTransactionFilterForRestfulObjects</filter-name>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- </filter-mapping>
-
-
- <servlet>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>RestfulObjectsRestEasyDispatcher</servlet-name>
- <url-pattern>/restful/*</url-pattern>
- </servlet-mapping>
-
-
- <!--
- uncomment to use container-managed datasource;
- for both container-managed (JTA) and non-container-managed transactions
- -->
- <!--
- <resource-ref>
- <description>db</description>
- <res-ref-name>jdbc/quickstart</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- </resource-ref>
- -->
-
- <!--
- uncomment to use container-managed datasource
- with container-managed transactions (JTA).
- -->
- <!--
- <resource-ref>
- <description>db</description>
- <res-ref-name>jdbc/quickstart-nontx</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- </resource-ref>
- -->
-
-
-</web-app>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png b/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png
deleted file mode 100644
index 5284fe7..0000000
Binary files a/example/application/todoapp/webapp/src/main/webapp/about/images/isis-logo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/about/index.html b/example/application/todoapp/webapp/src/main/webapp/about/index.html
deleted file mode 100644
index 5762e8f..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/about/index.html
+++ /dev/null
@@ -1,175 +0,0 @@
-<!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™ TodoApp</title>
-
- <style type="text/css">
-body {
- background-color: #1A467B;
- font-family: Verdana, Helvetica, Arial;
- 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="about/images/isis-logo.png" />
-
- <p>
- <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a framework to let you rapidly develop
- domain-driven apps in Java. This app has been generated using Isis'
- <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
- which configures Isis to run a (quite feature rich) "todo" app.
-
- <p>
- The app itself consists of a single domain class, <tt>ToDoItem</tt>, along with a number of supporting
- services.
- </p>
-
- <p>To access the app:</p>
- <ul>
- <li>
- <p>
- <b><a href="wicket/">wicket/</a></b>
- </p>
- <p>
- provides accesses to a generic UI for end-users,
- Isis' <a href="http://isis.apache.org/components/viewers/wicket/about.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="restful/">restful/</a>
- </b>
- </p>
- <p>
- provides access to a RESTful API conformant with the
- <a href="http://restfulobjects.org">Restful Objects</a> spec</td>. This is part of Isis Core. The
- implementation technology is JBoss RestEasy.
- </p>
- </li>
- </ul>
-
- <p>
- The default user/password is <b><i>sven/pass</i></b> (as configured in the
- <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">shiro.ini</a> file).
- </p>
-
- <p>
- To build your own app, while you could start with this todo app and remove/rename as required, you are
- probably better off using the extremely minimal
- <a href="http://isis.apache.org/intro/getting-started/simpleapp-archetype.html" target="_blank">SimpleApp</a> archetype.
- </p>
-
- <h2>App contents</h2>
- <p>The key files in this "todo" app are:</p>
- <!-- the hrefs below are partially URL encoded to prevent them from being modified when the archetype is created -->
- <ul>
- <li>Domain classes (todo functionality) (in <tt>dom</tt> module)
- <ul>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank"><tt>ToDoItem</tt></a> domain entity
- </li>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItems.java" target="_blank"><tt>ToDoItems</tt></a> domain service (repository/factory)
- </li>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoItemAnalysis.java" target="_blank"><tt>ToDoItemAnalysis</tt></a> application service analysing todo items
- </li>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/app/ToDoAppDashboard.java" target="_blank"><tt>ToDoAppDashboard</tt></a> dashboard application service
- </li>
- </ul>
- </li>
- <li>Fixture scripts (in <tt>fixture</tt> module)
- <ul>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java" target="_blank"><tt>ToDoItemsFixtureService</tt></a> domain service to install fixtures at run-time
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml" target="_blank">WEB-INF/web.xml</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L98" target="_blank">ResourceCachingFilter</a></tt> and <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L134" target="_blank">ResourceServlet</a></tt> - filter and servlet for serving up static resources.
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L174" target="_blank">WicketFilter</a></tt> - filter for the wicket application, mapped to <tt>/wicket/*</tt>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L223" target="_blank">ResteasyBootstrap</a></tt>,
- <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L240" target="_blank">IsisSessionFilterForRestfulObjects</a></tt>,
- <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L271" target="_blank">RestfulObjectsRestEasyDispatcher</a></tt> - listeners, filters and servlets to bootstrap and map restful objects viewer to <tt>/restful/*</tt>.
- </li>
- <li>commented out <tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/web.xml#L208" target="_blank">IsisWebAppBootstrapper</a></tt> listener; this is NOT required unless wicket viewer config is removed
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/isis.properties" target="_blank">WEB-INF/isis.properties</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li><tt>isis.services</tt> - explicitly loaded framework-provide domain services. Other services (including <tt>ToDoItems</tt> and <tt>ToDoItemsFixtureService</tt> described above),
- are loaded automatically from the classpath.
- </li>
- <li><tt>isis.persistor</tt> - specifies to use Isis' integration with <a href="http://datanucleus.org">DataNucleus</a> for (JDO-based) persistence.
- </li>
- <li><tt>isis.authentication</tt> and <tt>isis.authorization</tt> - specifies to use Isis' integration with <a href="http://shiro.apache.org">Apache Shiro</a> for security.
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties" target="_blank">WEB-INF/persistor_datanucleus.properties</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li>configuration for the DataNucleus (JDO) object store
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/persistor.properties" target="_blank">WEB-INF/persistor.properties</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li>JDBC URL for DataNucleus (JDO) object store
- </li>
- </ul>
- </li>
- <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/webapp/src/main/webapp/WEB-INF/shiro.ini" target="_blank">WEB-INF/shiro.ini</a></tt> (in <tt>webapp</tt> module)
- <ul>
- <li>configuration for Shiro security
- </li>
- </ul>
- </li>
- </ul>
- </div>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/css/application.css
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/css/application.css b/example/application/todoapp/webapp/src/main/webapp/css/application.css
deleted file mode 100644
index 7cc31cf..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/css/application.css
+++ /dev/null
@@ -1,35 +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.
- */
-
-.navbar-brand img {
- margin-top: -7px;
- margin-left: 5px;
-}
-
-.x-key label.scalarName {
- color: red;
-}
-
-tr.todo {
-}
-
-tr.done {
- text-decoration: line-through;
- color: #d3d3d3;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn b/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn
deleted file mode 100644
index 016c9b8..0000000
Binary files a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png b/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png
deleted file mode 100644
index 2c417fb..0000000
Binary files a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-header.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn b/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn
deleted file mode 100644
index 7a164e1..0000000
Binary files a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png b/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png
deleted file mode 100644
index ee2feb4..0000000
Binary files a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo-signin.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn b/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn
deleted file mode 100644
index 4983ca9..0000000
Binary files a/example/application/todoapp/webapp/src/main/webapp/images/todoapp-logo.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/src/main/webapp/scripts/application.js
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/scripts/application.js b/example/application/todoapp/webapp/src/main/webapp/scripts/application.js
deleted file mode 100644
index d8cf6fe..0000000
--- a/example/application/todoapp/webapp/src/main/webapp/scripts/application.js
+++ /dev/null
@@ -1,3 +0,0 @@
-$(document).ready(function() {
- /// here...
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/pom.xml b/example/archetype/todoapp/pom.xml
deleted file mode 100644
index dfc82e5..0000000
--- a/example/archetype/todoapp/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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" 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>
- <version>1.8.0-SNAPSHOT</version>
- <relativePath>../../../core/pom.xml</relativePath>
- </parent>
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/appended-resources/supplemental-models.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/appended-resources/supplemental-models.xml b/example/archetype/todoapp/src/main/appended-resources/supplemental-models.xml
deleted file mode 100644
index 01c58d8..0000000
--- a/example/archetype/todoapp/src/main/appended-resources/supplemental-models.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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.
--->
-<supplementalDataModels
- xmlns="http://maven.apache.org/supplemental-model/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/supplemental-model/1.0.0
- http://maven.apache.org/xsd/supplemental-model-1.0.0.xsd">
-
-</supplementalDataModels>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index fbe878e..0000000
--- a/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?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.
--->
-<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">
- <fileSets>
- <fileSet encoding="UTF-8">
- <directory/>
- <includes>
- <include>.gitattributes</include>
- <include>.gitignore</include>
- </includes>
- </fileSet>
- </fileSets>
- <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>
- </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>**/*.pdn</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/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/.gitattributes
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/.gitattributes b/example/archetype/todoapp/src/main/resources/archetype-resources/.gitattributes
deleted file mode 100644
index b1eafb6..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/.gitattributes
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-#
-# 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
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore b/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore
deleted file mode 100644
index ad3f5e2..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/.gitignore
+++ /dev/null
@@ -1,40 +0,0 @@
-*~
-*.swp
-*.class
-bin/
-target/
-target-ide/
-logs/
-.settings/
-.project
-.classpath
-.idea
-*.iml
-
-JArchitectOut/
-*.jdproj
-
-neo4j_DB/
-
-# log files
-datanucleus.log
-isis.log
-hs_err_pid*.log
-
-# Package Files #
-*.jar
-*.war
-*.ear
-
-dependency-reduced-pom.xml
-pom.xml.tag
-pom.xml.next
-pom.xml.releaseBackup
-pom.xml.versionsBackup
-
-.clover/
-*.jdproj
-JArchitectOut/
-
-
-rebel.xml
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties
deleted file mode 100644
index 2040d89..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/log4j.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-${symbol_pound} LOG4J Configuration
-${symbol_pound} ===================
-
-${symbol_pound} 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
-${symbol_pound}log4j.appender.A1.Threshold=INFO
-
-${symbol_pound} Categories
-${symbol_pound} Each category can be set to a "level", and to direct to an appender
-
-${symbol_pound} 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
-
-
-${symbol_pound} Hbase libs logging
-log4j.category.org.apache.hadoop=INFO,A1
-log4j.category.org.apache.zookeeper=INFO,A1
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index 38e5063..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?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>${groupId}</groupId>
- <artifactId>${rootArtifactId}</artifactId>
- <version>${version}</version>
- </parent>
-
- <artifactId>${artifactId}</artifactId>
- <name>ToDo App DOM</name>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-maven-plugin</artifactId>
- <version>${datanucleus-maven-plugin.version}</version>
- <configuration>
- <fork>false</fork>
- <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
- <verbose>true</verbose>
- <props>${basedir}/datanucleus.properties</props>
- </configuration>
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>enhance</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-maven-plugin</artifactId>
- <versionRange>[3.2.0-release,)</versionRange>
- <goals>
- <goal>enhance</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-applib</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-unittestsupport</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- Bytecode libraries (for mocking) -->
- <dependency>
- <groupId>org.objenesis</groupId>
- <artifactId>objenesis</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>isis-validate</id>
- <activation>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.isis.tool</groupId>
- <artifactId>isis-maven-plugin</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <configuration>
- <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.apache.isis.example.application</groupId>
- <artifactId>todoapp-dom</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </dependency>
- <!--
- ... workaround to avoid conflict with plexus-default
- (not sure why exclusions in the isis-maven-plugin aren't sufficient, though ...
- -->
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>16.0.1</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <phase>test</phase>
- <goals>
- <goal>validate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml
deleted file mode 100644
index 020d759..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/META-INF/persistence.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?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="quickstart">
- </persistence-unit>
-</persistence>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
deleted file mode 100644
index 2686139..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
+++ /dev/null
@@ -1,86 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package app;
-
-import java.util.List;
-import org.apache.isis.applib.AbstractViewModel;
-import org.apache.isis.applib.annotation.Collection;
-import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.applib.annotation.Editing;
-import org.apache.isis.applib.annotation.RenderType;
-
-public class ToDoAppDashboard extends AbstractViewModel {
-
- //region > identification in the UI
- public String title() {
- return "Dashboard";
- }
- //endregion
-
- //region > ViewModel contract
- private String memento;
-
- @Override
- public String viewModelMemento() {
- return memento;
- }
-
- @Override
- public void viewModelInit(final String memento) {
- this.memento = memento;
- }
-
- //endregion
-
- //region > getAnalysisByCategory (collection)
- @CollectionLayout(
- named="By Category",
- render = RenderType.EAGERLY
- )
- @Collection(
- editing = Editing.DISABLED
- )
- public List<ToDoItemsByCategoryViewModel> getAnalysisByCategory() {
- return toDoItemAnalysis.toDoItemsByCategory();
- }
- //endregion
-
- //region > getAnalysisByDateRange (collection)
- @CollectionLayout(
- named="By Date Range",
- render = RenderType.EAGERLY
- )
- @Collection(
- editing = Editing.DISABLED
- )
- public List<ToDoItemsByDateRangeViewModel> getAnalysisByDateRange() {
- return toDoItemAnalysis.toDoItemsByDateRange();
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItemAnalysis toDoItemAnalysis;
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json
deleted file mode 100644
index 3421543..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.layout.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "columns": [
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 12,
- "collections": {
- "analysisByCategory": {}
- }
- }
- ],
- "actions": {
- "downloadLayout": {},
- "refreshLayout": {}
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png
deleted file mode 100644
index fe6e6a1..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
deleted file mode 100644
index 190c7ba..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package app;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.services.homepage.AbstractHomePageDashboardService;
-
-@DomainService(nature = NatureOfService.DOMAIN)
-public class ToDoAppDashboardService extends AbstractHomePageDashboardService<ToDoAppDashboard> {
-
- public ToDoAppDashboardService() {
- super(ToDoAppDashboard.class);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
deleted file mode 100644
index f5ff7f9..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
+++ /dev/null
@@ -1,129 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package app;
-
-import dom.todo.ToDoItem.Category;
-
-import java.util.Arrays;
-import java.util.List;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainServiceLayout(
- named="Analysis",
- menuOrder = "20")
-@DomainService
-public class ToDoItemAnalysis {
-
-
- //region > identification in the UI
- public String getId() {
- return "analysis";
- }
-
- public String iconName() {
- return "ToDoItem";
- }
- //endregion
-
-
- //region > byCategory (action)
- @ActionLayout(
- cssClassFa="fa fa-pie-chart",
- named="By Category",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @Action(semantics = SemanticsOf.SAFE)
- @MemberOrder(sequence = "1")
- public List<ToDoItemsByCategoryViewModel> toDoItemsByCategory() {
- final List<Category> categories = Arrays.asList(Category.values());
- return Lists.newArrayList(Iterables.transform(categories, byCategory()));
- }
-
- private Function<Category, ToDoItemsByCategoryViewModel> byCategory() {
- return new Function<Category, ToDoItemsByCategoryViewModel>(){
- @Override
- public ToDoItemsByCategoryViewModel apply(final Category category) {
- return new ToDoItemsByCategoryViewModel(category);
- }
- };
- }
- //endregion
-
- //region > byDateRange (action)
-
- public enum DateRange {
- OverDue,
- Today,
- Tomorrow,
- ThisWeek,
- Later,
- Unknown,
- }
-
- @ActionLayout(
- cssClassFa="fa fa-calendar",
- named="By Date Range",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @Action(semantics = SemanticsOf.SAFE)
- @MemberOrder(sequence = "1")
- public List<ToDoItemsByDateRangeViewModel> toDoItemsByDateRange() {
- final List<DateRange> dateRanges = Arrays.asList(DateRange.values());
- return Lists.newArrayList(Iterables.transform(dateRanges, byDateRange()));
- }
-
- private static Function<DateRange, ToDoItemsByDateRangeViewModel> byDateRange() {
- return new Function<DateRange, ToDoItemsByDateRangeViewModel>(){
- @Override
- public ToDoItemsByDateRangeViewModel apply(final DateRange dateRange) {
- return new ToDoItemsByDateRangeViewModel(dateRange);
- }
- };
- }
- //endregion
-
- //region > forCategory (programmatic)
- @Programmatic
- public ToDoItemsByCategoryViewModel toDoItemsForCategory(final Category category) {
- return byCategory().apply(category);
- }
-
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
deleted file mode 100644
index f40e14d..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
+++ /dev/null
@@ -1,53 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package app;
-
-import dom.todo.ToDoItem;
-
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.Contributed;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
-public class ToDoItemAnalysisContributions {
-
-
- //region > analyseCategory (action)
- @ActionLayout(contributed = Contributed.AS_ACTION)
- @Action(
- semantics = SemanticsOf.SAFE
- )
- public ToDoItemsByCategoryViewModel analyseCategory(final ToDoItem item) {
- return toDoAppAnalysis.toDoItemsForCategory(item.getCategory());
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItemAnalysis toDoAppAnalysis;
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
deleted file mode 100644
index 9226e54..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
+++ /dev/null
@@ -1,171 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package app;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItems;
-
-import java.util.Arrays;
-import java.util.List;
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.DomainObjectLayout;
-import org.apache.isis.applib.annotation.Nature;
-import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.util.ObjectContracts;
-
-@DomainObjectLayout(
- named="By Category",
- bookmarking = BookmarkPolicy.AS_ROOT
-)
-@DomainObject(
- nature = Nature.VIEW_MODEL
-)
-public class ToDoItemsByCategoryViewModel
- implements Comparable<ToDoItemsByCategoryViewModel> {
-
- //region > constructors
- public ToDoItemsByCategoryViewModel() {
- }
- public ToDoItemsByCategoryViewModel(final Category category) {
- setCategory(category);
- }
- //endregion
-
-
- //region > category (property)
- private Category category;
-
- @Title
- public Category getCategory() {
- return category;
- }
-
- public void setCategory(final Category category) {
- this.category = category;
- }
- //endregion
-
- //region > notYetComplete (property), complete (property)
- @PropertyLayout(
- multiLine=5
- )
- public String getNotYetComplete() {
- final List<ToDoItem> notYetComplete = getItemsNotYetComplete();
- return Joiner.on(", ").join(
- Iterables.transform(subcategories(), summarizeBySubcategory(notYetComplete)));
- }
-
- @PropertyLayout(
- multiLine=5
- )
- public String getComplete() {
- final List<ToDoItem> completeInCategory = getItemsComplete();
- return Joiner.on(", ").join(
- Iterables.transform(subcategories(), summarizeBySubcategory(completeInCategory)));
- }
-
- // //////////////////////////////////////
-
- private Iterable<ToDoItem.Subcategory> subcategories() {
- return Iterables.filter(Arrays.asList(ToDoItem.Subcategory.values()), ToDoItem.Subcategory.thoseFor(getCategory()));
- }
-
- private Function<ToDoItem.Subcategory, String> summarizeBySubcategory(final Iterable<ToDoItem> itemsInCategory) {
- return new Function<ToDoItem.Subcategory, String>() {
- @Override
- public String apply(final ToDoItem.Subcategory subcategory) {
- return subcategory + ": " + countIn(itemsInCategory, subcategory);
- }
- };
- }
-
- private static int countIn(final Iterable<ToDoItem> items, final ToDoItem.Subcategory subcategory) {
- return Iterables.size(Iterables.filter(items,
- ToDoItem.Predicates.thoseSubcategorised(subcategory)));
- }
- //endregion
-
- //region > getItemsNotYetComplete (collection), getItemsComplete (collection)
- /**
- * All those items {@link ToDoItems${symbol_pound}notYetComplete() not yet complete}, for this {@link ${symbol_pound}getCategory() category}.
- */
- @CollectionLayout(
- render = RenderType.EAGERLY
- )
- public List<ToDoItem> getItemsNotYetComplete() {
- final List<ToDoItem> notYetComplete = toDoItems.notYetCompleteNoUi();
- return Lists.newArrayList(Iterables.filter(notYetComplete, ToDoItem.Predicates.thoseCategorised(getCategory())));
- }
-
- /**
- * All those items {@link ToDoItems${symbol_pound}complete() complete}, for this {@link ${symbol_pound}getCategory() category}.
- */
- @CollectionLayout(
- render = RenderType.EAGERLY
- )
- public List<ToDoItem> getItemsComplete() {
- final List<ToDoItem> complete = toDoItems.completeNoUi();
- return Lists.newArrayList(Iterables.filter(complete, ToDoItem.Predicates.thoseCategorised(getCategory())));
- }
-
- //endregion
-
- //region > deleteCompleted (action)
- @ActionLayout(
- named="Delete"
- )
- public ToDoItemsByCategoryViewModel deleteCompleted() {
- for (final ToDoItem item : getItemsComplete()) {
- container.removeIfNotAlready(item);
- }
- // force reload of page
- return this;
- }
-
- //endregion
-
- //region > compareTo
- @Override
- public int compareTo(final ToDoItemsByCategoryViewModel other) {
- return ObjectContracts.compare(this, other, "category");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
- @javax.inject.Inject
- private ToDoItems toDoItems;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
deleted file mode 100644
index c87b554..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.layout.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "columns": [
- {
- "span": 4,
- "memberGroups": {
- "General": {
- "members": {
- "category": {}
- }
- },
- "Analysis": {
- "members": {
- "notYetComplete": {},
- "complete": {}
- }
- }
- }
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 0,
- "memberGroups": {}
- },
- {
- "span": 8,
- "collections": {
- "itemsNotYetComplete": {},
- "itemsComplete": {
- "actions": {
- "deleteCompleted": {}
- }
- }
- }
- }
- ],
- "actions": {
- "downloadLayout": {},
- "refreshLayout": {}
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png
deleted file mode 100644
index c22ab2b..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.png and /dev/null differ
[14/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
deleted file mode 100644
index 35a765e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
+++ /dev/null
@@ -1,365 +0,0 @@
-<?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>
-
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <version>${version}</version>
-
- <name>ToDo App</name>
-
- <packaging>pom</packaging>
-
- <prerequisites>
- <maven>3.0.4</maven>
- </prerequisites>
-
- <properties>
- <isis.version>1.8.0-SNAPSHOT</isis.version>
- <isis-viewer-wicket.version>1.8.0-SNAPSHOT</isis-viewer-wicket.version>
-
- <!-- must be consistent with the versions defined by the JDO Objectstore -->
- <datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
- <datanucleus-maven-plugin.version>3.3.2</datanucleus-maven-plugin.version>
-
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- </properties>
-
- <repositories>
- <repository>
- <id>apache.snapshots</id>
- <name>Apache Snapshots</name>
- <url>https://repository.apache.org/content/repositories/snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- </snapshots>
- </repository>
- <repository>
- <id>Cloudbees snapshots</id>
- <url>http://repository-estatio.forge.cloudbees.com/snapshot/</url>
- <snapshots>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- <executions>
- <execution>
- <id>source</id>
- <phase>compile</phase>
- </execution>
- <execution>
- <id>test</id>
- <phase>test-compile</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- <include>**/*Test$*.java</include>
- <include>**/*Test_*.java</include>
- <include>**/*Spec*.java</include>
- </includes>
- <excludes>
- <exclude>**/Test*.java</exclude>
- <exclude>**/*ForTesting.java</exclude>
- <exclude>**/*Abstract*.java</exclude>
- </excludes>
- <useFile>true</useFile>
- <printSummary>true</printSummary>
- <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- <include>**/*Test$*.java</include>
- <include>**/*Test_*.java</include>
- <include>**/*Spec*.java</include>
- </includes>
- <excludes>
- <exclude>**/Test*.java</exclude>
- <exclude>**/*ForTesting.java</exclude>
- <exclude>**/*Abstract*.java</exclude>
- </excludes>
- <showSuccess>false</showSuccess>
- </configuration>
- <executions>
- <execution>
- <phase>test</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.5</version>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.4</version>
- </plugin>
- <plugin>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.5.1</version>
- </plugin>
- <plugin>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8.1</version>
- </plugin>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.3</version>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.4</version>
- </plugin>
-
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.26</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>2.2</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <!-- http://simplericity.com/2009/11/10/1257880778509.html -->
- <plugin>
- <groupId>org.simplericity.jettyconsole</groupId>
- <artifactId>jetty-console-maven-plugin</artifactId>
- <!-- update to 1.54 reversed,since seems compiled against 1.7 (major.minor version 51.0) -->
- <version>1.43</version>
- </plugin>
-
- <!-- Apache Release Audit Tool -->
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.10</version>
- <configuration>
- <addDefaultLicenseMatchers>true</addDefaultLicenseMatchers>
- <excludeSubProjects>true</excludeSubProjects>
- <excludes>
- <exclude>**/target/**</exclude>
- <exclude>**/target-ide/**</exclude>
-
- <exclude>**/*.project</exclude>
- <exclude>**/.classpath</exclude>
- <exclude>**/.settings/**</exclude>
- <exclude>**/*.launch</exclude>
- <exclude>**/ide/eclipse/launch/**</exclude>
- <exclude>**/ide/intellij/launch/**</exclude>
- <exclude>src/site/resources/ide/eclipse/**</exclude>
-
- <exclude>**/rebel.xml</exclude>
- <exclude>**/*.gitignore</exclude>
- <exclude>**/*.log</exclude>
- <exclude>**/*.pdn</exclude>
- <exclude>**/*.svg</exclude>
- <exclude>**/*.json</exclude>
- <exclude>**/*.min.js</exclude>
- <exclude>**/*.js</exclude>
- </excludes>
- <licenses>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>AL2</licenseFamilyCategory>
- <licenseFamilyName>Apache License 2.0</licenseFamilyName>
- <notes />
- <patterns>
- <pattern>Licensed to the Apache Software Foundation (ASF) under one</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>JQRY</licenseFamilyCategory>
- <licenseFamilyName>MIT</licenseFamilyName>
- <notes />
- <patterns>
- <pattern>Dual licensed under the MIT or GPL Version 2 licenses.</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>JMOCK</licenseFamilyCategory>
- <licenseFamilyName>JMock</licenseFamilyName>
- <notes />
- <patterns>
- <pattern>Copyright (c) 2000-2007, jMock.org</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>DOCBK</licenseFamilyCategory>
- <licenseFamilyName>DocBook 4.5</licenseFamilyName>
- <notes />
- <patterns>
- <pattern>Permission to copy in any form is granted for use</pattern>
- <pattern>Permission to use, copy, modify and distribute the DocBook DTD</pattern>
- <pattern>is hereby granted in perpetuity, provided that the above copyright</pattern>
- <pattern>This is the catalog data file for DocBook XML V4.5. It is provided as</pattern>
- <pattern>XML Catalog data for DocBook XML V4.5</pattern>
- <pattern>DocBook additional general entities V4.5</pattern>
- <pattern>XML EXCHANGE TABLE MODEL DECLARATION MODULE</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>W3C</licenseFamilyCategory>
- <licenseFamilyName>XHTML</licenseFamilyName>
- <notes />
- <patterns>
- <pattern>Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),</pattern>
- </patterns>
- </license>
- </licenses>
- <licenseFamilies>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>Apache License 2.0</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>MIT</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>JMock</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>DocBook 4.5</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>XHTML</familyName>
- </licenseFamily>
- </licenseFamilies>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <dependencyManagement>
- <dependencies>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis</artifactId>
- <version>${isis.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket</artifactId>
- <version>${isis-viewer-wicket.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
-
- <!-- this project's own modules -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-dom</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-fixture</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-webapp</artifactId>
- <version>${version}</version>
- </dependency>
-
-
- </dependencies>
- </dependencyManagement>
-
-
- <profiles>
- <profile>
- <id>m2e</id>
- <activation>
- <property>
- <name>m2e.version</name>
- </property>
- </activation>
- <build>
- <directory>target-ide</directory>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
deleted file mode 100644
index 358e3d9..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
+++ /dev/null
@@ -1,26 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
- <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
- </listAttribute>
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
- <listEntry value="1"/>
- </listAttribute>
- <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
- </mapAttribute>
- <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
- <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
- <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
- </listAttribute>
- <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
- <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
- <stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
- <stringAttribute value="${jrebel_args} -Drebel.log=false -Drebel.check_class_hash=true -Drebel.packages_exclude=org.apache.isis -Dproject.root=${project_loc}/.. -Dtarget.dir=target-ide -Drebel.plugins=C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar -Disis-jrebel-plugin.packagePrefix=dom.todo,org.apache.isis.objectstore.jdo.applib -Disis-jrebel-plugin.loggingLevel=warn -XX:MaxPermSize=128m" key="org.eclipse.jdt.launching.VM_ARGUMENTS"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
deleted file mode 100644
index 3376620..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
+++ /dev/null
@@ -1,22 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
- <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
- </listAttribute>
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
- <listEntry value="1"/>
- </listAttribute>
- <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
- </mapAttribute>
- <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
- <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
- <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
- <stringAttribute value="--port 8080 -D isis.persistor.datanucleus.install-fixtures=true --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
deleted file mode 100644
index 4fd7be2..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
+++ /dev/null
@@ -1,25 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
- <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
- </listAttribute>
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
- <listEntry value="1"/>
- </listAttribute>
- <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
- </mapAttribute>
- <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
- <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
- <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
- </listAttribute>
- <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
- <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
- <stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
deleted file mode 100644
index 2e2e0ea..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
+++ /dev/null
@@ -1,25 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
- <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
- </listAttribute>
- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
- <listEntry value="1"/>
- </listAttribute>
- <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
- <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
- </mapAttribute>
- <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
- <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
- <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
- </listAttribute>
- <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
- <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
- <stringAttribute value="--port 8080 --type SERVER" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
- <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt
deleted file mode 100644
index 4160805..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-Copy into workspace${symbol_escape}.idea${symbol_escape}runConfigurations directory, and adjust file paths for Maven tasks.
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
deleted file mode 100644
index a1e657d..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp_PROTOTYPE.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="TodoApp-PROTOTYPE" type="Application" factoryName="Application" singleton="true">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <option name="MAIN_CLASS_NAME" value="org.apache.isis.WebServer" />
- <option name="VM_PARAMETERS" value="" />
- <option name="PROGRAM_PARAMETERS" value="--type SERVER_PROTOTYPE --port 8080" />
- <option name="WORKING_DIRECTORY" value="file://${symbol_dollar}MODULE_DIR${symbol_dollar}" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" value="" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <module name="${parentArtifactId}-webapp" />
- <envs />
- <RunnerSettings RunnerId="Debug">
- <option name="DEBUG_PORT" value="" />
- <option name="TRANSPORT" value="0" />
- <option name="LOCAL" value="true" />
- </RunnerSettings>
- <RunnerSettings RunnerId="Run" />
- <ConfigurationWrapper RunnerId="Debug" />
- <ConfigurationWrapper RunnerId="Run" />
- <method>
- <option name="Make" enabled="false" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/${parentArtifactId}/dom/pom.xml" goal="datanucleus:enhance -o" />
- </method>
- </configuration>
-</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
deleted file mode 100644
index 536351b..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/intellij/launch/TodoApp__enhance_only_.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="TodoApp (enhance only)" type="Application" factoryName="Application">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <option name="MAIN_CLASS_NAME" value="org.apache.isis.Dummy" />
- <option name="VM_PARAMETERS" value="" />
- <option name="PROGRAM_PARAMETERS" value="" />
- <option name="WORKING_DIRECTORY" value="file://${symbol_dollar}MODULE_DIR${symbol_dollar}" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" value="" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <module name="${parentArtifactId}-webapp" />
- <envs />
- <RunnerSettings RunnerId="Run" />
- <ConfigurationWrapper RunnerId="Run" />
- <method>
- <option name="Make" enabled="false" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/core/pom.xml" goal="-f pom-jdo-enhance-all.xml datanucleus:enhance -o" />
- <option name="Maven.BeforeRunTask" enabled="true" file="C:/Apache/Isis/example/application/${parentArtifactId}/dom/pom.xml" goal="datanucleus:enhance -o" />
- </method>
- </configuration>
-</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore
deleted file mode 100644
index 70eee7e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/lib/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# explicitly ignoring Microsoft JDBC4 jar
-# (cannot redistribute, licensing)
-#
-sqljdbc4.jar
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index 37f8549..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
+++ /dev/null
@@ -1,346 +0,0 @@
-<?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>${groupId}</groupId>
- <artifactId>${rootArtifactId}</artifactId>
- <version>${version}</version>
- </parent>
-
- <artifactId>${artifactId}</artifactId>
- <name>ToDo App Webapp</name>
-
- <description>This module runs both the Wicket viewer and the Restfulobjects viewer in a single webapp configured to run using the datanucleus object store.</description>
-
- <packaging>war</packaging>
-
- <properties>
- <siteBaseDir>..</siteBaseDir>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- </plugin>
-
- <!-- mvn package -->
- <plugin>
- <groupId>org.simplericity.jettyconsole</groupId>
- <artifactId>jetty-console-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>createconsole</goal>
- </goals>
- <configuration>
- <backgroundImage>${basedir}/src/main/jettyconsole/isis-banner.png</backgroundImage>
- <destinationFile>${project.build.directory}/${project.build.finalName}-jetty-console.jar</destinationFile>
- </configuration>
- <phase>package</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>maven-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <warName>todoapp</warName>
- <archive>
- <manifest>
- <addClasspath>false</addClasspath>
- </manifest>
- <manifestEntries>
- <Build-Time>${maven.build.timestamp}</Build-Time>
- <Build-Host>${agent.name}</Build-Host>
- <Build-User>${user.name}</Build-User>
- <Build-Maven>Maven ${maven.version}</Build-Maven>
- <Build-Java>${java.version}</Build-Java>
- <Build-OS>${os.name}</Build-OS>
- <Build-Label>${project.version}</Build-Label>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <versionRange>[1.5,)</versionRange>
- <goals>
- <goal>maven-version</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
-
- <!-- other modules in this project -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-dom</artifactId>
- <exclusions>
- <exclusion>
- <!-- so don't pick up transitive dependency to asm 4.0.0 -->
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-enhancer</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-fixture</artifactId>
- <exclusions>
- <exclusion>
- <!-- so don't pick up transitive dependency to asm 4.0.0 -->
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-enhancer</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- other isis components -->
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-viewer-restfulobjects-server</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-security-shiro</artifactId>
- </dependency>
-
-
- <!-- isis core -->
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-security</artifactId>
- </dependency>
-
-
- <!-- to run using WebServer (optional) -->
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-webserver</artifactId>
- <scope>runtime</scope>
- <optional>true</optional>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-servlet_2.5_spec</artifactId>
- <!--
- removed so can run o.a.i.WebServer from within IntelliJ;
- can rely on servlet container to ignore this in war file
- <scope>provided</scope>
- -->
- </dependency>
-
- <!--
- JDBC drivers
- (for jdo objectstore)
- -->
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </dependency>
-
- <!--
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>9.1-901.jdbc4</version>
- </dependency>
- -->
-
- <!--
- mvn install:install-file -Dfile=sqljdbc4.jar \
- -DgroupId=com.microsoft.sqlserver \
- -DartifactId=jdbc \
- -Dversion=4.0 \
- -Dpackaging=jar
- -->
- <!--
- <dependency>
- <groupId>com.microsoft.sqlserver</groupId>
- <artifactId>sqljdbc4</artifactId>
- <version>4.0</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.lazyluke</groupId>
- <artifactId>log4jdbc-remix</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>self-host</id>
- <build>
- <plugins>
- <!--
- mvn -P self-host antrun:run
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <configuration>
- <tasks>
- <exec executable="java" failonerror="true">
- <arg value="-jar" />
- <arg value="${project.build.directory}/${project.build.finalName}-jetty-console.jar" />
- </exec>
- </tasks>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>jrebel</id>
- <properties>
- <!-- as used in the rebel.xml in the dom project -->
- <target.dir>target</target.dir>
- <isis-jrebel-plugin.packagePrefix>dom.todo,org.apache.isis.objectstore.jdo.applib</isis-jrebel-plugin.packagePrefix>
- <isis-jrebel-plugin.loggingLevel>warn</isis-jrebel-plugin.loggingLevel>
- </properties>
- <build>
- <plugins>
- <!--
- mvn -P jrebel antrun:run \
- -Djrebel.jar="C:/Users/Dan/.IdeaIC13/config/plugins/jr-ide-idea/lib/jrebel/jrebel.jar" \
- -Disis_jrebel_plugin.jar="C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar"
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <configuration>
- <target>
- <property name="compile_classpath" refid="maven.compile.classpath" />
- <property name="runtime_classpath" refid="maven.runtime.classpath" />
- <property name="test_classpath" refid="maven.test.classpath" />
- <property name="plugin_classpath" refid="maven.plugin.classpath" />
-
- <echo message="" />
- <echo message="" />
- <echo message="jrebel.jar = ${jrebel.jar}" />
- <echo message="isis_jrebel_plugin.jar = ${isis_jrebel_plugin.jar}" />
- <echo message="target.dir = ${target.dir}" />
- <echo message="" />
- <echo message="" />
-
- <exec executable="java" failonerror="true">
- <arg value="-javaagent:${jrebel.jar}" />
- <arg value="-Drebel.log=false" />
- <arg value="-Drebel.check_class_hash=true" />
- <arg value="-Drebel.packages_exclude=org.apache.isis" />
-
- <!-- as used in the rebel.xml in the dom project -->
- <arg value="-Dproject.root=${project.basedir}/.." />
- <arg value="-Dtarget.dir=${target.dir}" />
-
- <arg value="-Drebel.plugins=${isis_jrebel_plugin.jar}" />
- <arg value="-Disis-jrebel-plugin.packagePrefix=${isis-jrebel-plugin.packagePrefix}" />
- <arg value="-Disis-jrebel-plugin.loggingLevel=${isis-jrebel-plugin.loggingLevel}" />
- <arg value="-XX:MaxPermSize=128m" />
- <arg value="-classpath" />
- <arg value="${runtime_classpath}" />
- <arg value="org.apache.isis.WebServer" />
- </exec>
- </target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>neo4j</id>
- <dependencies>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-neo4j</artifactId>
- <version>3.2.3</version>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java
deleted file mode 100644
index dc619cd..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomMementoService.java
+++ /dev/null
@@ -1,64 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package webapp;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.core.runtime.services.memento.MementoServiceDefault;
-
-
-/**
- * Demonstrates how to register a replacement for one of the default framework-provided services.
- *
- * <p>
- * In <code>isis.properties</code>, is registered using:
- * </p>
- *
- * <pre>
- * isis.services = ${symbol_escape}
- * ...,
- * 1:webapp.CustomMementoService,
- * ...,
- * </pre>
- * <p>
- * that is, with a menuOrder of 1.
- * </p>
- */
-public class CustomMementoService extends MementoServiceDefault {
-
- @Programmatic
- @Override
- public Memento create() {
- return super.create();
- }
-
- @Programmatic
- @Override
- public Memento parse(String str) {
- return super.parse(str);
- }
-
- @Programmatic
- @Override
- public boolean canSet(Object input) {
- return super.canSet(input);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java
deleted file mode 100644
index 08c2339..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/CustomRepresentationService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package webapp;
-
-import javax.ws.rs.core.Response;
-import org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceForRestfulObjects;
-
-public class CustomRepresentationService extends RepresentationServiceForRestfulObjects {
-
- @Override
- protected Response buildResponse(Response.ResponseBuilder responseBuilder) {
- responseBuilder.header("X-ResponseGeneratedBy", getClass().getCanonicalName());
- return super.buildResponse(responseBuilder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java
deleted file mode 100644
index 236db03..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/ToDoApplication.java
+++ /dev/null
@@ -1,153 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package webapp;
-
-import de.agilecoders.wicket.core.Bootstrap;
-import de.agilecoders.wicket.core.settings.IBootstrapSettings;
-import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
-import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import com.google.common.base.Joiner;
-import com.google.common.io.Resources;
-import com.google.inject.AbstractModule;
-import com.google.inject.Module;
-import com.google.inject.name.Names;
-import com.google.inject.util.Modules;
-import com.google.inject.util.Providers;
-import org.apache.wicket.Session;
-import org.apache.wicket.request.Request;
-import org.apache.wicket.request.Response;
-import org.apache.wicket.request.http.WebRequest;
-import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
-import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis;
-
-
-/**
- * As specified in <tt>web.xml</tt>.
- *
- * <p>
- * See:
- * <pre>
- * <filter>
- * <filter-name>wicket</filter-name>
- * <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
- * <init-param>
- * <param-name>applicationClassName</param-name>
- * <param-value>webapp.ToDoApplication</param-value>
- * </init-param>
- * </filter>
- * </pre>
- *
- */
-public class ToDoApplication extends IsisWicketApplication {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * set to true for a (slightly hacky) way of allowing logins using query args, eg:
- *
- * <tt>?user=sven&pass=pass</tt>
- *
- * <p>
- * for demos only, obviously.
- */
- private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false;
-
- @Override
- protected void init() {
- super.init();
-
- final IBootstrapSettings settings = Bootstrap.getSettings();
- settings.setThemeProvider(new BootswatchThemeProvider(BootswatchTheme.Flatly));
- }
-
- @Override
- public Session newSession(final Request request, final Response response) {
- if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
- return super.newSession(request, response);
- }
-
- // else demo mode
- final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
- final org.apache.wicket.util.string.StringValue user = request.getRequestParameters().getParameterValue("user");
- final org.apache.wicket.util.string.StringValue password = request.getRequestParameters().getParameterValue("pass");
- s.signIn(user.toString(), password.toString());
- return s;
- }
-
- @Override
- public WebRequest newWebRequest(final HttpServletRequest servletRequest, final String filterPath) {
- if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
- return super.newWebRequest(servletRequest, filterPath);
- }
-
- // else demo mode
- try {
- final String uname = servletRequest.getParameter("user");
- if (uname != null) {
- servletRequest.getSession().invalidate();
- }
- } catch (Exception ignored) {
- }
-
- return super.newWebRequest(servletRequest, filterPath);
- }
-
- @Override
- protected Module newIsisWicketModule() {
- final Module isisDefaults = super.newIsisWicketModule();
-
- final Module overrides = new AbstractModule() {
- @Override
- protected void configure() {
-
- bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ToDo App");
- bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
- bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
- bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/images/todo%61pp-logo-header.png");
- bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/images/todo%61pp-logo-signin.png");
- bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines(getClass(), "welcome.html"));
- bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("ToDo App");
- bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
- }
- };
-
- return Modules.override(isisDefaults).with(overrides);
- }
-
- private static String readLines(final Class<?> contextClass, final String resourceName) {
- try {
- final List<String> readLines = Resources.readLines(
- Resources.getResource(contextClass, resourceName), Charset.defaultCharset());
- final String aboutText = Joiner.on("${symbol_escape}n").join(readLines);
- return aboutText;
- } catch (final IOException e) {
- return "This is a Todo app";
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
deleted file mode 100644
index 4686948..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
+++ /dev/null
@@ -1,74 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package webapp.prototyping;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService
-@DomainServiceLayout(
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- menuOrder = "20"
-)
-public class ExternalLinksService {
-
- public static enum ExternalLink {
- ISIS_DOCUMENTATION("Apache Isis docs", "http://isis.apache.org/documentation.html"),
- PROJECT_ON_GITHUB("Project source code on Github", "https://github.com/apache/isis/tree/master/example/application/${parentArtifactId}/");
-
- private final String title;
- private final String url;
-
- private ExternalLink(final String title, final String url) {
- this.title = title;
- this.url = url;
- }
-
- public URL open() throws MalformedURLException {
- return new URL(url);
- }
-
- public String toString() {
- return title;
- }
- }
-
- @ActionLayout(
- cssClassFa = "fa-external-link"
- )
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- @MemberOrder(name="Prototyping", sequence="91.1")
- public URL goToDocs(@ParameterLayout(named="Link") ExternalLink link) throws MalformedURLException {
- return link.open();
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
deleted file mode 100644
index 16709fd..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
+++ /dev/null
@@ -1,47 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package webapp.prototyping;
-
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.viewer.wicket.viewer.applib.WicketDeveloperUtilitiesService;
-
-/**
- * These overrides are simply to 'move' the action underneath the
- * 'Prototyping' menu.
- */
-@DomainService
-@DomainServiceLayout(
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- named = "Prototyping",
- menuOrder = "40")
-public class WicketDeveloperUtilities extends WicketDeveloperUtilitiesService {
-
- @ActionLayout(named="Clear i18n Cache")
- @MemberOrder(sequence="90.3")
- @Override
- public void resetI18nCache() {
- super.resetI18nCache();
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
deleted file mode 100644
index 68eebec..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/userprof/CustomUserProfileService.java
+++ /dev/null
@@ -1,46 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package webapp.userprof;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.userprof.UserProfileService;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-
-/**
- * Demonstrates how to provide a custom implementation of the {@link org.apache.isis.applib.services.userprof.UserProfileService}.
- */
-@DomainService
-public class CustomUserProfileService implements UserProfileService {
-
- @Override
- @Programmatic
- public String userProfileName() {
- return "Hi " + getAuthenticationSession().getUserName() + "!";
- }
-
- protected AuthenticationSession getAuthenticationSession() {
- return IsisContext.getAuthenticationSession();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn
deleted file mode 100644
index 37543c9..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.pdn and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png
deleted file mode 100644
index cd9ecfe..0000000
Binary files a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/jettyconsole/isis-banner.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
deleted file mode 100644
index 0e1dd47..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
+++ /dev/null
@@ -1,55 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound}
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-${symbol_pound}
-
-
-${symbol_pound} override WicketSignInPage.properties
-loginHeader=Login
-registerHeader=Register
-
-${symbol_pound} override PageAbstract.properties
-aboutLabel=About
-logoutLabel=Logout
-
-${symbol_pound} override EntityPropertiesForm.properties and also
-${symbol_pound} override ActionParametersFormPanel.properties
-okLabel=OK
-cancelLabel=Cancel
-editLabel=Edit
-
-
-
-
-${symbol_pound}
-${symbol_pound} 3rd-party components
-${symbol_pound}
-
-${symbol_pound} Select2Choice
-
-${symbol_pound}noMatches=...
-${symbol_pound}inputTooShortSingular=...
-${symbol_pound}inputTooShortPlural=...
-${symbol_pound}loadMore=...
-${symbol_pound}searching=...
-
-${symbol_pound} datatables
-${symbol_pound}no-records-found=...
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
deleted file mode 100644
index 1473390..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
+++ /dev/null
@@ -1,105 +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.
-#
-
-
-# -----------------------------------------------------------------------------
-# 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, ...
-
-#
-# realm1 configures sven, dick and bob only. Additional logins are configured in realm2
-#
-
-sven = pass, admin_role
-dick = pass, readwrite_role, dashboard_role, analysis_role, self-install_role
-bob = pass, readwrite_role, dashboard_role, self-install_role
-joe = pass, readwrite_role, self-install_role, noDueBy_role
-guest = guest, readonly_role
-
-
-
-#
-# some additional users/roles
-# require IsisPermissionResolver to be configured in shiro.ini, and
-# require additional role/perms to be configured below in [roles]
-#
-
-# # fred should have access to everything except the analysis features
-# fred = pass,isisperms_all_but_analysis_role
-# # bill should have access to everything (the admin role 'trumps' the vetos)
-# bill = pass,isisperms_all_but_analysis_role,isisperms_admin_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
-
-#
-# If using the IsisLdapRealm, it could be pointed at an ini file such as this in
-# order to share role/perm mappings.
-#
-
-
-# configuring iniRealm to use Shiro's built-in WildcardPermissions
-
-readwrite_role = *:ToDoItems:*:*,\
- *:ToDoItem:*:*
-
-readonly_role = *:ToDoItems:notYetComplete:*,\
- *:ToDoItems:complete:*,\
- *:ToDoItems:allToDos:*,\
- *:ToDoItem:*:r
-
-dashboard_role = *:ToDoAppDashboardService:*:*,\
- *:ToDoAppDashboard:*:*
-
-analysis_role = *:ToDoItemAnalysis:*:*,\
- *:ToDoItemsByCategoryViewModel:*:*,\
- *:ToDoItemsByDateRangeViewModel:*:*
-
-self-install_role = *:ToDoItemsFixturesService:*:*
-
-admin_role = *
-
-
-
-#
-# some additional role/perms
-# require IsisPermissionResolver to be configured in shiro.ini
-#
-
-# isisperms_all_but_analysis_role = aba/*,\
-# !aba/*:ToDoItemAnalysis:*,\
-# !aba/*:ToDoItemsByCategoryViewModel:*:*,\
-# !aba/*:ToDoItemsByDateRangeViewModel:*:*
-# isisperms_admin_role = adm/*
-
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
deleted file mode 100644
index dda189b..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
+++ /dev/null
@@ -1,39 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?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.
--->
-<p class="intro">
- <a href="http://isis.apache.org" target="_blank">Apache Isis</a>™ is a platform to let you rapidly develop
- domain-driven apps in Java.
- <br/>
- <br/>
- This app has been generated using Isis'
- <a href="http://isis.apache.org/intro/getting-started/todo%61pp-archetype.html" target="_blank">TodoApp</a> archetype,
- which configures Isis' most commonly used components in a straightforward "todo" app.
- <br/>
- <br/>
- The core functionality of the app is provided by the
- <a href="https://github.com/apache/isis/blob/master/example/application/todo%61pp/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank">ToDoItem</a> domain class.
- Supporting services provide additional capabilities.
- <br/>
- <br/>
- For more details, see the <a href="http://isis.apache.org/documentation.html" target="_blank">Isis website</a>.
-</p>
[20/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index c859340..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
+++ /dev/null
@@ -1,165 +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 integration.glue.todoitem;
-
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-
-import java.util.List;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.jmock.Expectations;
-import org.junit.Assert;
-import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemGlue extends CukeGlueAbstract {
-
- @Given("^there are a number of incomplete ToDo items$")
- public void there_are_a_number_of_incomplete_ToDo_items() throws Throwable {
- if(supportsMocks()) {
- checking(new Expectations() {
- {
- allowing(service(ToDoItems.class)).notYetComplete();
- will(returnValue(notYetCompleteItems()));
- }
- });
- }
- try {
- final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
- assertThat(notYetComplete.isEmpty(), is(false));
- putVar("list", "notYetCompleteItems", notYetComplete);
-
- } finally {
- assertMocksSatisfied();
- }
- }
-
- @When("^I choose the first of the incomplete items$")
- public void I_choose_the_first_one() throws Throwable {
- @SuppressWarnings("unchecked")
- List<ToDoItem> notYetComplete = getVar(null, "notYetCompleteItems", List.class);
- assertThat(notYetComplete.isEmpty(), is(false));
-
- putVar("todo", "toDoItem", notYetComplete.get(0));
- }
-
- @When("^mark the item as complete$")
- public void mark_it_as_complete() throws Throwable {
- final ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- if(supportsMocks()) {
- final ActionInvocationContext actionInvocationContext = service(ActionInvocationContext.class);
- final EventBusService eventBusService = service(EventBusService.class);
- checking(new Expectations() {
- {
- allowing(actionInvocationContext);
- allowing(eventBusService);
- }
- });
- toDoItem.actionInvocationContext = actionInvocationContext;
- toDoItem.eventBusService = eventBusService;
- }
- wrap(toDoItem).completed();
- }
-
- @Then("^the item is no longer listed as incomplete$")
- public void the_item_is_no_longer_listed_as_incomplete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- whetherNotYetCompletedContains(toDoItem, false);
- }
-
- @Given("^.*completed .*item$")
- public void a_completed_ToDo_item() throws Throwable {
- if(supportsMocks()) {
- checking(new Expectations(){{
- allowing(service(ToDoItems.class)).allToDos();
- will(returnValue(findItems(Predicates.<ToDoItem>alwaysTrue()) ));
- }});
- }
- try {
- final List<ToDoItem> allToDos = service(ToDoItems.class).allToDos();
- for (ToDoItem toDoItem : allToDos) {
- if(toDoItem.isComplete()) {
- putVar("todo", "toDoItem", toDoItem);
- return;
- }
- }
- Assert.fail("could not locate any completed ToDo items");
- } finally {
- assertMocksSatisfied();
- }
- }
-
- @When("^I mark the .*item as not yet complete$")
- public void I_mark_it_as_not_yet_complete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- assertThat(toDoItem.isComplete(), is(true));
-
- toDoItem.setComplete(false);
- }
-
- @Then("^the .*item is listed as incomplete$")
- public void the_item_is_listed_as_incomplete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- whetherNotYetCompletedContains(toDoItem, true);
- }
-
- private void whetherNotYetCompletedContains(ToDoItem toDoItem, final boolean whetherContained) {
- if(supportsMocks()) {
- final List<ToDoItem> notYetCompleteItems = notYetCompleteItems();
- checking(new Expectations() {
- {
- oneOf(service(ToDoItems.class)).notYetComplete();
- will(returnValue(notYetCompleteItems));
- }
- });
- }
- try {
- final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
- assertThat(notYetComplete.contains(toDoItem), is(whetherContained));
- } finally {
- assertMocksSatisfied();
- }
- }
-
-
- // helper
- private List<ToDoItem> notYetCompleteItems() {
- return findItems(new Predicate<ToDoItem>(){
- @Override
- public boolean apply(ToDoItem input) {
- return !input.isComplete();
- }
- });
- }
-
- private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
- final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
- final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
- return Lists.newArrayList(Iterables.filter(items, predicate));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java b/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
deleted file mode 100644
index dcb56ad..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
+++ /dev/null
@@ -1,38 +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 integration.specs.todoitem;
-
-import cucumber.api.junit.Cucumber;
-
-import org.junit.runner.RunWith;
-
-
-/**
- * Runs scenarios in all <tt>.feature</tt> files (this package and any subpackages).
- */
-@RunWith(Cucumber.class)
-@Cucumber.Options(
- format = {
- "html:target/cucumber-html-report"
- ,"json:target/cucumber.json"
- },
- glue={"classpath:integration.glue"},
- strict = true,
- tags = { "~@backlog", "~@ignore" })
-public class RunSpecs {
- // intentionally empty
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature b/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
deleted file mode 100644
index 9fc1596..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
+++ /dev/null
@@ -1,39 +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.
-#
-@ToDoItemsFixture
-Feature: Find And Complete ToDo Items
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @unit
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
- @integration
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature b/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
deleted file mode 100644
index 1f5f73e..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
+++ /dev/null
@@ -1,35 +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.
-#
-@ToDoItemsFixture
-Feature: Find completed ToDoItem and mark as not yet complete
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @integration
- Scenario: Todo items can be uncompleted
- Given a completed item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
-
-
- @unit
- Scenario: Todo items can be uncompleted
- Given a completed ToDo item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java b/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
deleted file mode 100644
index ab15a30..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
+++ /dev/null
@@ -1,38 +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 integration.tests;
-
-import integration.ToDoAppSystemInitializer;
-
-import org.junit.BeforeClass;
-import org.apache.isis.core.integtestsupport.IntegrationTestAbstract;
-import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForIntegration;
-
-public abstract class AbstractToDoIntegTest extends IntegrationTestAbstract {
-
- @BeforeClass
- public static void initClass() {
- org.apache.log4j.PropertyConfigurator.configure("logging.properties");
- ToDoAppSystemInitializer.initIsft();
-
- // instantiating will install onto ThreadLocal
- new ScenarioExecutionForIntegration();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java b/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
deleted file mode 100644
index f377f52..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
+++ /dev/null
@@ -1,158 +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 integration.tests;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public abstract class ToDoItemContributionsIntegTest extends AbstractToDoIntegTest {
-
- ToDoItemsRecreateAndCompleteSeveral fixtureScript;
-
- @Before
- public void setUpData() throws Exception {
- fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
- fixtureScripts.runFixtureScript(fixtureScript, null);
- }
-
- @Inject
- FixtureScripts fixtureScripts;
- @Inject
- ToDoItems toDoItems;
- @Inject
- ToDoItemContributions toDoItemContributions;
-
- ToDoItemContributions toDoItemContributionsWrapped;
- ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
-
- toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-complete-for-buy-stamps/item-1", ToDoItem.class));
- assertThat(toDoItem, is(not(nullValue())));
-
- toDoItemContributionsWrapped = wrap(toDoItemContributions);
- }
-
- public static class Actions {
- public static class UpdateCategory extends ToDoItemContributionsIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Consulting);
-
- // then
- assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Professional));
- assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Consulting));
-
- // when
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Domestic, ToDoItem.Subcategory.Chores);
-
- // then
- assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Domestic));
- assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Chores));
- }
-
-
- @Test
- public void categoryCannotBeNull() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("'Category' is mandatory");
- toDoItemContributionsWrapped.updateCategory(toDoItem, null, ToDoItem.Subcategory.Chores);
- }
-
- @Test
- public void subcategoryCanBeNull() throws Exception {
-
- // when, then
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, null);
- }
-
- @Test
- public void subcategoryMustBelongToCategory() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Invalid subcategory"));
- toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Chores);
- }
- }
-
- public static class SimilarTo extends ToDoItemContributionsIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- List<ToDoItem> similarItems = toDoItemContributionsWrapped.similarTo(toDoItem);
-
- // then
- assertThat(similarItems.size(), is(6));
- }
-
- }
- }
-
- public static class Properties {
- public static class Priority extends ToDoItemContributionsIntegTest {
-
- private List<ToDoItem> notYetComplete;
-
- @Before
- public void setUp() throws Exception {
- notYetComplete = wrap(toDoItems).notYetComplete();
- }
-
- @Test
- public void happyCase() throws Exception {
- assertPriority(0, 1);
- assertPriority(1, 2);
- assertPriority(2, 4);
- assertPriority(3, 6);
- assertPriority(4, 5);
- assertPriority(5, 7);
- assertPriority(6, 9);
- assertPriority(7, 8);
- assertPriority(8, 3);
- assertPriority(9, 10);
- }
-
- private void assertPriority(final int n, final int priority) {
- assertThat(toDoItemContributions.relativePriority(notYetComplete.get(n)), is(Integer.valueOf(priority)));
- }
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java b/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
deleted file mode 100644
index 5bb2f0f..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
+++ /dev/null
@@ -1,1057 +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 integration.tests;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import java.math.BigDecimal;
-import java.nio.charset.Charset;
-import java.util.EventObject;
-import java.util.List;
-import javax.activation.MimeType;
-import javax.inject.Inject;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.hamcrest.TypeSafeMatcher;
-import org.jmock.Expectations;
-import org.jmock.Sequence;
-import org.jmock.auto.Mock;
-import org.joda.time.LocalDate;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-import org.apache.isis.applib.services.clock.ClockService;
-import org.apache.isis.applib.services.eventbus.AbstractInteractionEvent;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
-import org.apache.isis.applib.value.Blob;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemIntegTest extends AbstractToDoIntegTest {
-
- ToDoItemsRecreateAndCompleteSeveral fixtureScript;
-
- @Before
- public void setUpData() throws Exception {
- fixtureScript = new ToDoItemsRecreateAndCompleteSeveral();
- fixtureScripts.runFixtureScript(fixtureScript, null);
- }
-
- @Inject
- FixtureScripts fixtureScripts;
- @Inject
- ToDoItems toDoItems;
- @Inject
- ToDoItemSubscriptions toDoItemSubscriptions;
-
- ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @After
- public void tearDown() throws Exception {
- toDoItemSubscriptions.reset();
- }
-
-
- public static class Title extends ToDoItemIntegTest {
-
- private LocalDate dueBy;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(all.get(0));
-
- toDoItem = wrap(fixtureScript.lookup("to-do-items-recreate-and-complete-several/to-do-item-for-buy-bread/item-1", ToDoItem.class));
- assertThat(toDoItem, is(not(nullValue())));
-
- nextTransaction();
-
- dueBy = toDoItem.getDueBy();
- }
-
-
- @Test
- public void includesDescription() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), containsString("Buy bread due by"));
-
- // when
- unwrap(toDoItem).setDescription("Buy bread and butter");
-
- // then
- assertThat(container().titleOf(toDoItem), containsString("Buy bread and butter due by"));
- }
-
- @Test
- public void includesDueDateIfAny() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), containsString("due by " + dueBy.toString("yyyy-MM-dd")));
-
- // when
- final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
- unwrap(toDoItem).setDueBy(fiveDaysFromNow);
-
- // then
- assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
- }
-
-
- @Test
- public void ignoresDueDateIfNone() throws Exception {
-
- // when
- // (since wrapped, will call clearDueBy)
- toDoItem.setDueBy(null);
-
- // then
- assertThat(container().titleOf(toDoItem), not(containsString("due by")));
- }
-
- @Test
- public void usesWhetherCompleted() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), not(containsString("Completed!")));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(container().titleOf(toDoItem), not(containsString("due by")));
- assertThat(container().titleOf(toDoItem), containsString("Buy bread - Completed!"));
- }
- }
-
- public static class Actions {
-
- public static class Completed extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
- }
-
- @Test
- public void cannotCompleteIfAlreadyCompleted() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then should fail
- expectedExceptions.expectMessage("Already completed");
- toDoItem.completed();
-
- // and then
- final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
- assertThat(ev, is(nullValue()));
- }
-
-
- @Test
- public void cannotSetPropertyDirectly() throws Exception {
-
- // given
-
- // when, then should fail
- expectedExceptions.expectMessage("Always disabled");
- toDoItem.setComplete(true);
-
- // and then
- final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
- assertThat(ev, is(nullValue()));
- }
-
- @Test
- public void subscriberReceivesEvents() throws Exception {
-
- // given
- toDoItemSubscriptions.reset();
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
- assertThat(unwrap(toDoItem).isComplete(), is(false));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(unwrap(toDoItem).isComplete(), is(true));
-
- // and then
- final List<ToDoItem.CompletedEvent> receivedEvents = toDoItemSubscriptions.receivedEvents(ToDoItem.CompletedEvent.class);
-
- // hide, disable, validate, executing, executed
- // sent to both the general on(ActionInteractionEvent ev)
- // and also the specific on(final ToDoItem.CompletedEvent ev)
- assertThat(receivedEvents.size(), is(5*2));
- final ToDoItem.CompletedEvent ev = receivedEvents.get(0);
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("completed"));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.completed();
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.completed();
- }
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.completed();
- }
-
- }
-
- /**
- * This test demonstrates how a single service can be replaced, eg to use a mock.
- */
- public static class Completed_withMockService extends ToDoItemIntegTest {
-
- private EventBusService originalEventBusService;
- @Mock
- private EventBusService mockEventBusService;
-
- @Before
- public void setUpMockEventBusService() throws Exception {
- originalEventBusService = scenarioExecution().service(EventBusService.class);
-
- context.checking(new Expectations() {{
- ignoring(mockEventBusService).register(with(any(Object.class)));
- ignoring(mockEventBusService).unregister(with(any(Object.class)));
- }});
-
- scenarioExecution().replaceService(originalEventBusService, mockEventBusService);
- scenarioExecution().closeSession();
- scenarioExecution().openSession();
-
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
-
- @After
- public void reinstateOriginalEventBusService() throws Exception {
- scenarioExecution().replaceService(mockEventBusService, originalEventBusService);
- }
-
- @Test
- public void raisesEvent() throws Exception {
-
- final Sequence busRulesThenExec = context.sequence("busRulesThenExec");
- // then
- context.checking(new Expectations() {{
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.HIDE)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.DISABLE)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.VALIDATE)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTING)));
- inSequence(busRulesThenExec);
- oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTED)));
- inSequence(busRulesThenExec);
- }});
-
- // when
- toDoItem.completed();
- }
-
- private Matcher<Object> completedEvent(final AbstractInteractionEvent.Phase phase) {
- return new TypeSafeMatcher<Object>() {
- @Override
- protected boolean matchesSafely(Object item) {
- if (!(item instanceof ToDoItem.CompletedEvent)) {
- return false;
- }
-
- final ToDoItem.CompletedEvent completedEvent = (ToDoItem.CompletedEvent) item;
- return completedEvent.getPhase() == phase;
-
- }
-
- @Override
- public void describeTo(Description description) {
- description.appendText(" instance of a ToDoItem.CompletedEvent, " + phase);
- }
- };
- }
- }
-
-
- public static class Duplicate extends ToDoItemIntegTest {
-
- ToDoItem duplicateToDoItem;
-
- @Inject
- private ClockService clockService;
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- final LocalDate todaysDate = clockService.now();
- toDoItem.setDueBy(todaysDate);
- toDoItem.updateCost(new BigDecimal("123.45"));
-
- duplicateToDoItem = toDoItem.duplicate(
- unwrap(toDoItem).default0Duplicate(),
- unwrap(toDoItem).default1Duplicate(),
- unwrap(toDoItem).default2Duplicate(),
- unwrap(toDoItem).default3Duplicate(),
- new BigDecimal("987.65"));
-
- // then
- assertThat(duplicateToDoItem.getDescription(), is(toDoItem.getDescription() + " - Copy"));
- assertThat(duplicateToDoItem.getCategory(), is(toDoItem.getCategory()));
- assertThat(duplicateToDoItem.getDueBy(), is(todaysDate));
- assertThat(duplicateToDoItem.getCost(), is(new BigDecimal("987.65")));
- }
- }
-
- public static class NotYetCompleted extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(toDoItem.isComplete(), is(false));
- }
-
- @Test
- public void cannotUndoIfNotYetCompleted() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when, then should fail
- expectedExceptions.expectMessage("Not yet completed");
- toDoItem.notYetCompleted();
- }
-
- /**
- * Even though {@link dom.todo.ToDoItem#notYetCompleted()} is not annotated with
- * {@link org.apache.isis.applib.annotation.ActionInteraction}, an event is still raised.
- */
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
- unwrap(toDoItem).setComplete(true);
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(unwrap(toDoItem).isComplete(), is(false));
-
- // and then
- final ActionDomainEvent<ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("notYetCompleted"));
- }
- }
- }
-
- public static class Collections {
-
- public static class Dependencies {
- public static class Add extends ToDoItemIntegTest {
-
- private ToDoItem otherToDoItem;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
- otherToDoItem = wrap(items.get(1));
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- super.tearDown();
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDependencies().size(), is(0));
-
- // when
- toDoItem.add(otherToDoItem);
-
- // then
- assertThat(toDoItem.getDependencies().size(), is(1));
- assertThat(toDoItem.getDependencies().iterator().next(), is(unwrap(otherToDoItem)));
- }
-
-
- @Test
- public void cannotDependOnSelf() throws Exception {
-
- // then
- expectedExceptions.expectMessage("Can't set up a dependency to self");
-
- // when
- toDoItem.add(toDoItem);
- }
-
- @Test
- public void cannotAddIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // then
- expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- toDoItemSubscriptions.reset();
-
- // when
- toDoItem.add(otherToDoItem);
-
- // then received events
- @SuppressWarnings("unchecked")
- final List<EventObject> receivedEvents = toDoItemSubscriptions.receivedEvents();
-
- assertThat(receivedEvents.size(), is(7));
- assertThat(receivedEvents.get(0) instanceof ActionDomainEvent, is(true)); // ToDoItem#add() executed
- assertThat(receivedEvents.get(1) instanceof CollectionDomainEvent, is(true)); // ToDoItem#dependencies add, executed
- assertThat(receivedEvents.get(2) instanceof CollectionDomainEvent, is(true)); // ToDoItem#dependencies add, executing
- assertThat(receivedEvents.get(3) instanceof ActionDomainEvent, is(true)); // ToDoItem#add executing
- assertThat(receivedEvents.get(4) instanceof ActionDomainEvent, is(true)); // ToDoItem#add validate
- assertThat(receivedEvents.get(5) instanceof ActionDomainEvent, is(true)); // ToDoItem#add disable
- assertThat(receivedEvents.get(6) instanceof ActionDomainEvent, is(true)); // ToDoItem#add hide
-
- // inspect the collection interaction (posted programmatically in ToDoItem#add)
- final CollectionDomainEvent<ToDoItem,ToDoItem> ciEv = (CollectionDomainEvent<ToDoItem, ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionDomainEvent.class);
- assertThat(ciEv, is(notNullValue()));
-
- assertThat(ciEv.getSource(), is(equalTo(unwrap(toDoItem))));
- assertThat(ciEv.getIdentifier().getMemberName(), is("dependencies"));
- assertThat(ciEv.getOf(), is(CollectionDomainEvent.Of.ADD_TO));
- assertThat(ciEv.getValue(), is(unwrap(otherToDoItem)));
-
- // inspect the action interaction (posted declaratively by framework)
- final ActionDomainEvent<ToDoItem> aiEv = (ActionDomainEvent<ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionDomainEvent.class);
- assertThat(aiEv, is(notNullValue()));
-
- assertThat(aiEv.getSource(), is(equalTo(unwrap(toDoItem))));
- assertThat(aiEv.getIdentifier().getMemberName(), is("add"));
- assertThat(aiEv.getArguments().size(), is(1));
- assertThat(aiEv.getArguments().get(0), is(unwrap((Object)otherToDoItem)));
- assertThat(aiEv.getCommand(), is(notNullValue()));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
- }
- public static class Remove extends ToDoItemIntegTest {
-
- private ToDoItem otherToDoItem;
- private ToDoItem yetAnotherToDoItem;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
- otherToDoItem = wrap(items.get(1));
- yetAnotherToDoItem = wrap(items.get(2));
-
- toDoItem.add(otherToDoItem);
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- super.tearDown();
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDependencies().size(), is(1));
-
- // when
- toDoItem.remove(otherToDoItem);
-
- // then
- assertThat(toDoItem.getDependencies().size(), is(0));
- }
-
-
- @Test
- public void cannotRemoveItemIfNotADependency() throws Exception {
-
- // then
- expectedExceptions.expectMessage("Not a dependency");
-
- // when
- toDoItem.remove(yetAnotherToDoItem);
- }
-
- @Test
- public void cannotRemoveDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // then
- expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
- }
- }
-
- }
-
- public static class Properties {
-
- public static class Attachment extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- byte[] bytes = "{\"foo\": \"bar\"}".getBytes(Charset.forName("UTF-8"));
- final Blob newAttachment = new Blob("myfile.json", new MimeType("application/json"), bytes);
-
- // when
- toDoItem.setAttachment(newAttachment);
-
- // then
- assertThat(toDoItem.getAttachment(), is(newAttachment));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setAttachment((Blob)null);
-
- // then
- assertThat(toDoItem.getAttachment(), is((Blob)null));
- }
- }
-
- public static class Category extends ToDoItemIntegTest {
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
- toDoItem.setCategory(ToDoItem.Category.Professional);
- }
- }
-
- public static class Cost extends ToDoItemIntegTest {
-
- private BigDecimal cost;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- cost = toDoItem.getCost();
- }
-
- @Test
- public void happyCaseUsingProperty() throws Exception {
-
- final BigDecimal newCost = new BigDecimal("123.45");
-
- // when
- toDoItem.updateCost(newCost);
-
- // then
- assertThat(toDoItem.getCost(), is(newCost));
- }
-
- @Test
- public void happyCaseUsingAction() throws Exception {
-
- final BigDecimal newCost = new BigDecimal("123.45");
-
- // when
- toDoItem.updateCost(newCost);
-
- // then
- assertThat(toDoItem.getCost(), is(newCost));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.updateCost((BigDecimal)null);
-
- // then
- assertThat(toDoItem.getCost(), is((BigDecimal)null));
- }
-
- @Test
- public void defaultForAction() throws Exception {
-
- // then
- assertThat(unwrap(toDoItem).default0UpdateCost(), is(cost));
- }
-
- }
-
- public static class Description extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.setDescription("Buy bread and butter");
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread and butter"));
- }
-
-
- @Test
- public void failsRegex() throws Exception {
-
- // when
- expectedExceptions.expectMessage("Doesn't match pattern");
- toDoItem.setDescription("exclamation marks are not allowed!!!");
- }
-
- @Test
- public void cannotBeNull() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Mandatory");
- toDoItem.setDescription(null);
- }
-
- @Test
- public void cannotUseModify() throws Exception {
-
- expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.modifyDescription("Buy bread and butter");
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread"));
- }
-
- @Test
- public void cannotUseClear() throws Exception {
-
- expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.clearDescription();
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread"));
- }
-
-
- @Test
- public void onlyJustShortEnough() throws Exception {
-
- // when, then
- toDoItem.setDescription(characters(100));
- }
-
- @Test
- public void tooLong() throws Exception {
-
- // then
- expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
-
- // when
- toDoItem.setDescription(characters(101));
- }
-
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.setDescription("Buy bread and butter");
-
- // then published and received
- @SuppressWarnings("unchecked")
- final PropertyDomainEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("description"));
- assertThat(ev.getOldValue(), is("Buy bread"));
- assertThat(ev.getNewValue(), is("Buy bread and butter"));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- @Test
- public void subscriberVetoesEventWithAnyOtherException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
-
- // then
- expectedExceptions.expect(RuntimeException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- private static String characters(final int n) {
- StringBuffer buf = new StringBuffer();
- for(int i=0; i<n; i++) {
- buf.append("a");
- }
- return buf.toString();
- }
- }
-
- public static class DueBy extends ToDoItemIntegTest {
-
- @Inject
- private ClockService clockService;
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- final LocalDate fiveDaysFromNow = clockService.now().plusDays(5);
- toDoItem.setDueBy(fiveDaysFromNow);
-
- // then
- assertThat(toDoItem.getDueBy(), is(fiveDaysFromNow));
- }
-
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setDueBy((LocalDate)null);
-
- // then
- assertThat(toDoItem.getDueBy(), is((LocalDate)null));
- }
-
- @Test
- public void canBeUpToSixDaysInPast() throws Exception {
-
- final LocalDate nowAsLocalDate = clockService.now();
- final LocalDate sixDaysAgo = nowAsLocalDate.plusDays(-5);
-
- // when
- toDoItem.setDueBy(sixDaysAgo);
-
- // then
- assertThat(toDoItem.getDueBy(), is(sixDaysAgo));
- }
-
-
- @Test
- public void cannotBeMoreThanSixDaysInPast() throws Exception {
-
- final LocalDate sevenDaysAgo = Clock.getTimeAsLocalDate().plusDays(-7);
-
- // when, then
- expectedExceptions.expectMessage("Due by date cannot be more than one week old");
- toDoItem.setDueBy(sevenDaysAgo);
- }
- }
-
- public static class Notes extends ToDoItemIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- final String newNotes = "Lorem ipsum yada yada";
-
- // when
- toDoItem.setNotes(newNotes);
-
- // then
- assertThat(toDoItem.getNotes(), is(newNotes));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setNotes((String)null);
-
- // then
- assertThat(toDoItem.getNotes(), is((String)null));
- }
-
- @Test
- public void suscriberReceivedDefaultEvent() throws Exception {
-
- final String newNotes = "Lorem ipsum yada yada";
-
- // when
- toDoItem.setNotes(newNotes);
-
- // then
- assertThat(unwrap(toDoItem).getNotes(), is(newNotes));
-
- // and then receive the default event.
- @SuppressWarnings("unchecked")
- final PropertyDomainEvent.Default ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyDomainEvent.Default.class);
- assertThat(ev, is(notNullValue()));
-
- assertThat(ev.getSource(), is((Object)unwrap(toDoItem)));
- assertThat(ev.getNewValue(), is((Object)newNotes));
- }
-
-
- }
-
- public static class OwnedBy extends ToDoItemIntegTest {
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Reason: Hidden on Everywhere. Identifier: dom.todo.ToDoItem#ownedBy()");
- toDoItem.setOwnedBy("other");
- }
-
-
- }
-
- public static class Subcategory extends ToDoItemIntegTest {
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
- toDoItem.setSubcategory(ToDoItem.Subcategory.Chores);
- }
- }
-
- }
-
-
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java b/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
deleted file mode 100644
index 2c06dc0..0000000
--- a/example/application/todoapp/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
+++ /dev/null
@@ -1,132 +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 integration.tests;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemsIntegTest extends AbstractToDoIntegTest {
-
- @Inject
- FixtureScripts fixtureScripts;
- @Inject
- ToDoItems toDoItems;
-
- public static class Finders extends ToDoItemsIntegTest {
-
- ToDoItemsIntegTestFixture fixture;
-
- @Before
- public void setUpData() throws Exception {
- // executing the fixtures directly allows us to look up the results later.
- fixtureScripts.runFixtureScript(fixture = new ToDoItemsIntegTestFixture(), null);
- }
-
- private int notYetCompletedSize;
- private int completedSize;
-
- @Before
- public void setUp() throws Exception {
-
- // could use fixture#lookup(...), but can also just search directly.
- final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
- final List<ToDoItem> completedItems = wrap(toDoItems).complete();
-
- notYetCompletedSize = notYetCompleteItems.size();
- completedSize = completedItems.size();
-
- assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
- }
-
- @Test
- public void complete_and_notYetComplete() throws Exception {
-
- // given
- List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
- final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
- nextTransaction();
-
- // when
- toDoItem.completed();
- nextTransaction();
-
- // then
- assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize-1));
- assertThat(wrap(toDoItems).complete().size(), is(completedSize+1));
- nextTransaction();
-
- // and when
- toDoItem.notYetCompleted();
- nextTransaction();
-
- // then
- assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize));
- assertThat(wrap(toDoItems).complete().size(), is(completedSize));
- }
- }
-
- public static class NewToDo_and_Delete extends ToDoItemsIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- // none
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- int size = wrap(toDoItems).notYetComplete().size();
- nextTransaction();
-
- // when
- final ToDoItem newToDo = toDoItems.newToDo("new todo", ToDoItem.Category.Professional, ToDoItem.Subcategory.OpenSource, null, null);
- nextTransaction();
-
- // then
- assertThat(newToDo.getDescription(), is("new todo"));
- assertThat(newToDo.getCategory(), is(ToDoItem.Category.Professional));
- assertThat(wrap(toDoItems).notYetComplete().size(), is(size+1));
- assertThat(container().isPersistent(newToDo), is(true));
- assertThat(container().isPersistent(wrap(newToDo)), is(true));
-
- nextTransaction();
-
- // when
- newToDo.delete();
- nextTransaction();
-
- // then
- assertThat(wrap(toDoItems).notYetComplete().size(), is(size));
- }
-
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/pom.xml b/example/application/todoapp/pom.xml
deleted file mode 100644
index c47dc8e..0000000
--- a/example/application/todoapp/pom.xml
+++ /dev/null
@@ -1,378 +0,0 @@
-<?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>
-
- <groupId>org.apache.isis.example.application</groupId>
- <artifactId>todoapp</artifactId>
- <version>1.8.0-SNAPSHOT</version>
-
- <name>ToDo App</name>
-
- <packaging>pom</packaging>
-
- <prerequisites>
- <maven>3.0.4</maven>
- </prerequisites>
-
- <properties>
- <isis.version>1.8.0-SNAPSHOT</isis.version>
- <isis-viewer-wicket.version>1.8.0-SNAPSHOT</isis-viewer-wicket.version>
-
- <!-- must be consistent with the versions defined by the JDO Objectstore -->
- <datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
- <datanucleus-maven-plugin.version>3.3.2</datanucleus-maven-plugin.version>
-
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- </properties>
-
- <repositories>
- <repository>
- <id>apache.snapshots</id>
- <name>Apache Snapshots</name>
- <url>https://repository.apache.org/content/repositories/snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>Cloudbees snapshots</id>
- <url>http://repository-estatio.forge.cloudbees.com/snapshot/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- <executions>
- <execution>
- <id>source</id>
- <phase>compile</phase>
- </execution>
- <execution>
- <id>test</id>
- <phase>test-compile</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- <include>**/*Test$*.java</include>
- <include>**/*Test_*.java</include>
- <include>**/*Spec*.java</include>
- </includes>
- <excludes>
- <exclude>**/Test*.java</exclude>
- <exclude>**/*ForTesting.java</exclude>
- <exclude>**/*Abstract*.java</exclude>
- </excludes>
- <useFile>true</useFile>
- <printSummary>true</printSummary>
- <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- <include>**/*Test$*.java</include>
- <include>**/*Test_*.java</include>
- <include>**/*Spec*.java</include>
- </includes>
- <excludes>
- <exclude>**/Test*.java</exclude>
- <exclude>**/*ForTesting.java</exclude>
- <exclude>**/*Abstract*.java</exclude>
- </excludes>
- <showSuccess>false</showSuccess>
- </configuration>
- <executions>
- <execution>
- <phase>test</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.5</version>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.4</version>
- </plugin>
- <plugin>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.5.1</version>
- </plugin>
- <plugin>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8.1</version>
- </plugin>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.3</version>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.4</version>
- </plugin>
-
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.26</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>2.2</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <!-- http://simplericity.com/2009/11/10/1257880778509.html -->
- <plugin>
- <groupId>org.simplericity.jettyconsole</groupId>
- <artifactId>jetty-console-maven-plugin</artifactId>
- <!-- update to 1.54 reversed,since seems compiled against 1.7 (major.minor version 51.0) -->
- <version>1.43</version>
- </plugin>
-
- <!-- Apache Release Audit Tool -->
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.10</version>
- <configuration>
- <addDefaultLicenseMatchers>true</addDefaultLicenseMatchers>
- <excludeSubProjects>true</excludeSubProjects>
- <excludes>
- <exclude>**/target/**</exclude>
- <exclude>**/target-ide/**</exclude>
-
- <exclude>**/*.project</exclude>
- <exclude>**/.classpath</exclude>
- <exclude>**/.settings/**</exclude>
- <exclude>**/*.launch</exclude>
- <exclude>**/ide/eclipse/launch/**</exclude>
- <exclude>**/ide/intellij/launch/**</exclude>
- <exclude>src/site/resources/ide/eclipse/**</exclude>
-
- <exclude>**/rebel.xml</exclude>
- <exclude>**/*.gitignore</exclude>
- <exclude>**/*.log</exclude>
- <exclude>**/*.pdn</exclude>
- <exclude>**/*.svg</exclude>
- <exclude>**/*.json</exclude>
- <exclude>**/*.min.js</exclude>
- <exclude>**/*.js</exclude>
- </excludes>
- <licenses>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>AL2</licenseFamilyCategory>
- <licenseFamilyName>Apache License 2.0</licenseFamilyName>
- <notes/>
- <patterns>
- <pattern>Licensed to the Apache Software Foundation (ASF) under one</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>JQRY</licenseFamilyCategory>
- <licenseFamilyName>MIT</licenseFamilyName>
- <notes/>
- <patterns>
- <pattern>Dual licensed under the MIT or GPL Version 2 licenses.</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>JMOCK</licenseFamilyCategory>
- <licenseFamilyName>JMock</licenseFamilyName>
- <notes/>
- <patterns>
- <pattern>Copyright (c) 2000-2007, jMock.org</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>DOCBK</licenseFamilyCategory>
- <licenseFamilyName>DocBook 4.5</licenseFamilyName>
- <notes/>
- <patterns>
- <pattern>Permission to copy in any form is granted for use</pattern>
- <pattern>Permission to use, copy, modify and distribute the DocBook DTD</pattern>
- <pattern>is hereby granted in perpetuity, provided that the above copyright
- </pattern>
- <pattern>This is the catalog data file for DocBook XML V4.5. It is provided as
- </pattern>
- <pattern>XML Catalog data for DocBook XML V4.5</pattern>
- <pattern>DocBook additional general entities V4.5</pattern>
- <pattern>XML EXCHANGE TABLE MODEL DECLARATION MODULE</pattern>
- </patterns>
- </license>
- <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
- <licenseFamilyCategory>W3C</licenseFamilyCategory>
- <licenseFamilyName>XHTML</licenseFamilyName>
- <notes/>
- <patterns>
- <pattern>Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),</pattern>
- </patterns>
- </license>
- </licenses>
- <licenseFamilies>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>Apache License 2.0</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>MIT</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>JMock</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>DocBook 4.5</familyName>
- </licenseFamily>
- <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
- <familyName>XHTML</familyName>
- </licenseFamily>
- </licenseFamilies>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <modules>
- <module>dom</module>
- <module>fixture</module>
- <module>integtests</module>
- <module>webapp</module>
- </modules>
-
- <dependencyManagement>
- <dependencies>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis</artifactId>
- <version>${isis.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket</artifactId>
- <version>${isis-viewer-wicket.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
-
- <!-- this project's own modules -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>todoapp-dom</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>todoapp-fixture</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>todoapp-webapp</artifactId>
- <version>${project.version}</version>
- </dependency>
-
-
- </dependencies>
- </dependencyManagement>
-
-
- <profiles>
- <profile>
- <id>m2e</id>
- <activation>
- <property>
- <name>m2e.version</name>
- </property>
- </activation>
- <build>
- <directory>target-ide</directory>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch b/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
deleted file mode 100644
index 14ac1bf..0000000
--- a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
-<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 --type SERVER_PROTOTYPE"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="${jrebel_args} -Drebel.log=false -Drebel.check_class_hash=true -Drebel.packages_exclude=org.apache.isis -Dproject.root=${project_loc}/.. -Dtarget.dir=target-ide -Drebel.plugins=C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar -Disis-jrebel-plugin.packagePrefix=dom.todo,org.apache.isis.objectstore.jdo.applib -Disis-jrebel-plugin.loggingLevel=warn -XX:MaxPermSize=128m"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch b/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
deleted file mode 100644
index 2e272aa..0000000
--- a/example/application/todoapp/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
-<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--port 8080 -D isis.persistor.datanucleus.install-fixtures=true --type SERVER_PROTOTYPE"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="todoapp-webapp"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-</launchConfiguration>
[10/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/pom.xml b/mothballed/example/application/todoapp/fixture/pom.xml
new file mode 100644
index 0000000..8881b6e
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/pom.xml
@@ -0,0 +1,40 @@
+<?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.example.application</groupId>
+ <artifactId>todoapp</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>todoapp-fixture</artifactId>
+ <name>ToDo App Fixtures</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>todoapp-dom</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
new file mode 100644
index 0000000..15bc3a9
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
@@ -0,0 +1,97 @@
+/*
+ * 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 fixture.todo;
+
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import java.util.List;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.fixturescripts.FixtureResult;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+
+/**
+ * Enables fixtures to be installed from the application.
+ */
+@DomainService
+@DomainServiceLayout(
+ named = "Prototyping",
+ menuBar = DomainServiceLayout.MenuBar.SECONDARY,
+ menuOrder = "10")
+public class ToDoItemsFixturesService extends FixtureScripts {
+
+ public ToDoItemsFixturesService() {
+ super("fixture.todo");
+ }
+
+ @ActionLayout(
+ cssClassFa="fa fa-bolt"
+ )
+ @Action(
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @Override
+ public List<FixtureResult> runFixtureScript(
+ final FixtureScript fixtureScript,
+ @ParameterLayout(
+ named="Parameters",
+ describedAs = "Script-specific parameters (key=value) ",
+ multiLine = 10)
+ @Parameter(optionality = Optionality.OPTIONAL)
+ final String parameters) {
+ return super.runFixtureScript(fixtureScript, parameters);
+ }
+
+ @Override
+ public FixtureScript default0RunFixtureScript() {
+ return findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class);
+ }
+
+ /**
+ * Raising visibility to <tt>public</tt> so that choices are available for first param
+ * of {@link #runFixtureScript(FixtureScript, String)}.
+ */
+ @Override
+ public List<FixtureScript> choices0RunFixtureScript() {
+ return super.choices0RunFixtureScript();
+ }
+
+ // //////////////////////////////////////
+
+
+ @ActionLayout(
+ cssClassFa="fa fa-list"
+ )
+ @Action(
+ restrictTo = RestrictTo.PROTOTYPING
+ )
+ @MemberOrder(sequence="20")
+ public Object recreateToDoItemsReturnFirst() {
+ final List<FixtureResult> run = findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class).run(null);
+ return run.get(0).getObject();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
new file mode 100644
index 0000000..2634839
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.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 fixture.todo.integtests;
+
+import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Refactored to reuse the newer {@link FixtureScript} API.
+ */
+public class ToDoItemsIntegTestFixture extends FixtureScript {
+
+ public ToDoItemsIntegTestFixture() {
+ super(null, "integ-test");
+ }
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ executionContext.executeChild(this, new ToDoItemsRecreateAndCompleteSeveral());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
new file mode 100644
index 0000000..3e009fe
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
@@ -0,0 +1,52 @@
+/*
+ * 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 fixture.todo.items.actions.complete;
+
+import dom.todo.ToDoItem;
+
+import java.util.Collection;
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+public abstract class ToDoItemCompleteAbstract extends FixtureScript {
+
+ /**
+ * Looks up item from repository, and completes.
+ */
+ protected void complete(final String description, final ExecutionContext executionContext) {
+ String ownedBy = executionContext.getParameter("ownedBy");
+ final ToDoItem toDoItem = findToDoItem(description, ownedBy);
+ toDoItem.setComplete(true);
+ executionContext.addResult(this, toDoItem);
+ }
+
+ private ToDoItem findToDoItem(final String description, final String ownedBy) {
+ final Collection<ToDoItem> filtered = Collections2.filter(getContainer().allInstances(ToDoItem.class), new Predicate<ToDoItem>() {
+ @Override
+ public boolean apply(ToDoItem input) {
+ return Objects.equal(description, input.getDescription()) &&
+ Objects.equal(ownedBy, input.getOwnedBy());
+ }
+ });
+ return filtered.isEmpty()? null: filtered.iterator().next();
+ }
+ //endregion
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
new file mode 100644
index 0000000..b05bf36
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
@@ -0,0 +1,30 @@
+/*
+ * 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 fixture.todo.items.actions.complete;
+
+import fixture.todo.items.create.ToDoItemForBuyStamps;
+
+public class ToDoItemCompleteForBuyStamps extends ToDoItemCompleteAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ complete(ToDoItemForBuyStamps.DESCRIPTION, executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
new file mode 100644
index 0000000..4b620f4
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
@@ -0,0 +1,31 @@
+/*
+ * 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 fixture.todo.items.actions.complete;
+
+import fixture.todo.items.create.ToDoItemForWriteBlogPost;
+
+public class ToDoItemCompleteForWriteBlogPost extends ToDoItemCompleteAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ complete(ToDoItemForWriteBlogPost.DESCRIPTION, executionContext);
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
new file mode 100644
index 0000000..3586c86
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+import dom.todo.ToDoItems;
+
+import java.math.BigDecimal;
+import org.joda.time.LocalDate;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.services.clock.ClockService;
+
+public abstract class ToDoItemAbstract extends FixtureScript {
+
+ protected ToDoItem createToDoItem(
+ final String description,
+ final Category category, final Subcategory subcategory,
+ final LocalDate dueBy,
+ final BigDecimal cost,
+ final ExecutionContext executionContext) {
+
+ // validate parameters
+ final String ownedBy = executionContext.getParameter("ownedBy");
+ if(ownedBy == null) {
+ throw new IllegalArgumentException("'ownedBy' must be specified");
+ }
+
+ // execute
+ ToDoItem newToDo = toDoItems.newToDo(
+ description, category, subcategory, ownedBy, dueBy, cost);
+ return executionContext.addResult(this, newToDo);
+ }
+
+ protected LocalDate nowPlusDays(int days) {
+ return clockService.now().plusDays(days);
+ }
+
+ protected BigDecimal BD(String str) {
+ return new BigDecimal(str);
+ }
+
+ //region > injected services
+ @javax.inject.Inject
+ private ToDoItems toDoItems;
+
+ @javax.inject.Inject
+ protected ClockService clockService;
+ //endregion
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
new file mode 100644
index 0000000..0bcde45
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForBuyBread extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Buy bread",
+ Category.Domestic, Subcategory.Shopping,
+ nowPlusDays(0),
+ BD("1.75"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
new file mode 100644
index 0000000..da6d25e
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForBuyMilk extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Buy milk",
+ Category.Domestic, Subcategory.Shopping,
+ nowPlusDays(0),
+ BD("0.75"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
new file mode 100644
index 0000000..4c6fb70
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
@@ -0,0 +1,39 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForBuyStamps extends ToDoItemAbstract {
+
+ public static final String DESCRIPTION = "Buy stamps";
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ DESCRIPTION,
+ Category.Domestic, Subcategory.Shopping,
+ nowPlusDays(0),
+ BD("10.00"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
new file mode 100644
index 0000000..daf4e2e
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForMowLawn extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Mow lawn",
+ Category.Domestic, Subcategory.Garden,
+ nowPlusDays(6),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
new file mode 100644
index 0000000..d4c01a7
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForOrganizeBrownBag extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Organize brown bag",
+ Category.Professional, Subcategory.Consulting,
+ nowPlusDays(14),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
new file mode 100644
index 0000000..5d9a309
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForPickUpLaundry extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Pick up laundry",
+ Category.Domestic, Subcategory.Chores,
+ nowPlusDays(6),
+ BD("7.50"),
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
new file mode 100644
index 0000000..c850993
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForSharpenKnives extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Sharpen knives",
+ Category.Domestic, Subcategory.Chores,
+ nowPlusDays(14),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
new file mode 100644
index 0000000..d9544ab
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForStageIsisRelease extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Stage Isis release",
+ Category.Professional, Subcategory.OpenSource,
+ null,
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
new file mode 100644
index 0000000..86e7177
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForSubmitConferenceSession extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Submit conference session",
+ Category.Professional, Subcategory.Education,
+ nowPlusDays(21),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
new file mode 100644
index 0000000..64f4ab4
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForVacuumHouse extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Vacuum house",
+ Category.Domestic, Subcategory.Housework,
+ nowPlusDays(3),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
new file mode 100644
index 0000000..8d912ad
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
@@ -0,0 +1,39 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForWriteBlogPost extends ToDoItemAbstract {
+
+ public static final String DESCRIPTION = "Write blog post";
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ DESCRIPTION,
+ Category.Professional, Subcategory.Marketing,
+ nowPlusDays(7),
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
new file mode 100644
index 0000000..eb495a2
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
@@ -0,0 +1,37 @@
+/*
+ * 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 fixture.todo.items.create;
+
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+
+public class ToDoItemForWriteToPenPal extends ToDoItemAbstract {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ createToDoItem(
+ "Write to penpal",
+ Category.Other, Subcategory.Other,
+ null,
+ null,
+ executionContext);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
new file mode 100644
index 0000000..3ac08bc
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
@@ -0,0 +1,38 @@
+/*
+ * 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 fixture.todo.items.delete;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
+
+public class ToDoItemsDelete extends FixtureScript {
+
+ //region > execute
+ protected void execute(ExecutionContext executionContext) {
+ final String ownedBy = executionContext.getParameter("ownedBy");
+ isisJdoSupport.executeUpdate("delete from \"ToDoItem\" where \"ownedBy\" = '" + ownedBy + "'");
+ }
+ //endregion
+
+ //region > injected services
+ @javax.inject.Inject
+ private IsisJdoSupport isisJdoSupport;
+ //endregion
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
new file mode 100644
index 0000000..5e61cc2
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
@@ -0,0 +1,81 @@
+/*
+ * 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 fixture.todo.scenarios;
+
+import fixture.todo.items.delete.ToDoItemsDelete;
+import fixture.todo.items.create.ToDoItemForBuyBread;
+import fixture.todo.items.create.ToDoItemForBuyMilk;
+import fixture.todo.items.create.ToDoItemForBuyStamps;
+import fixture.todo.items.create.ToDoItemForMowLawn;
+import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
+import fixture.todo.items.create.ToDoItemForPickUpLaundry;
+import fixture.todo.items.create.ToDoItemForSharpenKnives;
+import fixture.todo.items.create.ToDoItemForStageIsisRelease;
+import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
+import fixture.todo.items.create.ToDoItemForVacuumHouse;
+import fixture.todo.items.create.ToDoItemForWriteBlogPost;
+import fixture.todo.items.create.ToDoItemForWriteToPenPal;
+import fixture.todo.util.Util;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+public class ToDoItemsRecreate extends FixtureScript {
+
+ public ToDoItemsRecreate() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+ }
+
+ //region > ownedBy (optional)
+ private String ownedBy;
+
+ public String getOwnedBy() {
+ return ownedBy;
+ }
+
+ public void setOwnedBy(String ownedBy) {
+ this.ownedBy = ownedBy;
+ }
+ //endregion
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ // defaults
+ executionContext.setParameterIfNotPresent(
+ "ownedBy",
+ Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
+
+ // prereqs
+ executionContext.executeChild(this, new ToDoItemsDelete());
+
+ // create items
+ executionContext.executeChild(this, new ToDoItemForBuyMilk());
+ executionContext.executeChild(this, new ToDoItemForBuyBread());
+ executionContext.executeChild(this, new ToDoItemForBuyStamps());
+ executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
+ executionContext.executeChild(this, new ToDoItemForMowLawn());
+ executionContext.executeChild(this, new ToDoItemForVacuumHouse());
+ executionContext.executeChild(this, new ToDoItemForSharpenKnives());
+ executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
+ executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
+ executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
+ executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
+ executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
new file mode 100644
index 0000000..d0645a2
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
@@ -0,0 +1,86 @@
+/*
+ * 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 fixture.todo.scenarios;
+
+import fixture.todo.items.actions.complete.ToDoItemCompleteForBuyStamps;
+import fixture.todo.items.actions.complete.ToDoItemCompleteForWriteBlogPost;
+import fixture.todo.items.create.ToDoItemForBuyBread;
+import fixture.todo.items.create.ToDoItemForBuyMilk;
+import fixture.todo.items.create.ToDoItemForBuyStamps;
+import fixture.todo.items.create.ToDoItemForMowLawn;
+import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
+import fixture.todo.items.create.ToDoItemForPickUpLaundry;
+import fixture.todo.items.create.ToDoItemForSharpenKnives;
+import fixture.todo.items.create.ToDoItemForStageIsisRelease;
+import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
+import fixture.todo.items.create.ToDoItemForVacuumHouse;
+import fixture.todo.items.create.ToDoItemForWriteBlogPost;
+import fixture.todo.items.create.ToDoItemForWriteToPenPal;
+import fixture.todo.items.delete.ToDoItemsDelete;
+import fixture.todo.util.Util;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+public class ToDoItemsRecreateAndCompleteSeveral extends FixtureScript {
+
+ public ToDoItemsRecreateAndCompleteSeveral() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+ }
+
+ //region > ownedBy (optional)
+ private String ownedBy;
+
+ public String getOwnedBy() {
+ return ownedBy;
+ }
+
+ public void setOwnedBy(String ownedBy) {
+ this.ownedBy = ownedBy;
+ }
+ //endregion
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+
+ // defaults
+ executionContext.setParameterIfNotPresent(
+ "ownedBy",
+ Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
+
+ executionContext.executeChild(this, new ToDoItemsDelete());
+
+ // create items
+ executionContext.executeChild(this, new ToDoItemForBuyMilk());
+ executionContext.executeChild(this, new ToDoItemForBuyBread());
+ executionContext.executeChild(this, new ToDoItemForBuyStamps());
+ executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
+ executionContext.executeChild(this, new ToDoItemForMowLawn());
+ executionContext.executeChild(this, new ToDoItemForVacuumHouse());
+ executionContext.executeChild(this, new ToDoItemForSharpenKnives());
+ executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
+ executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
+ executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
+ executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
+ executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
+
+ // this fixture
+ executionContext.executeChild(this, new ToDoItemCompleteForBuyStamps());
+ executionContext.executeChild(this, new ToDoItemCompleteForWriteBlogPost());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
new file mode 100644
index 0000000..60d5a10
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.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 fixture.todo.scenarios;
+
+public final class ToDoItemsRecreateAndCompleteSeveralForDick extends ToDoItemsRecreateAndCompleteSeveral {
+
+ public ToDoItemsRecreateAndCompleteSeveralForDick() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+
+ setOwnedBy("dick");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
new file mode 100644
index 0000000..b324f34
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.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 fixture.todo.scenarios;
+
+public final class ToDoItemsRecreateAndCompleteSeveralForJoe extends ToDoItemsRecreateAndCompleteSeveral {
+
+ public ToDoItemsRecreateAndCompleteSeveralForJoe() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+
+ setOwnedBy("joe");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
new file mode 100644
index 0000000..16db8a7
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
@@ -0,0 +1,29 @@
+/*
+ * 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 fixture.todo.scenarios;
+
+public final class ToDoItemsRecreateForSven extends ToDoItemsRecreate {
+
+ public ToDoItemsRecreateForSven() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+
+ setOwnedBy("sven");
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java
new file mode 100644
index 0000000..a385588
--- /dev/null
+++ b/mothballed/example/application/todoapp/fixture/src/main/java/fixture/todo/util/Util.java
@@ -0,0 +1,32 @@
+/*
+ * 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 fixture.todo.util;
+
+public final class Util {
+
+ private Util(){}
+
+ public static String coalesce(final String... strings) {
+ for (String str : strings) {
+ if(str != null) { return str; }
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/logging.properties
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/logging.properties b/mothballed/example/application/todoapp/integtests/logging.properties
new file mode 100644
index 0000000..1e4d987
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/logging.properties
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+#
+# Isis uses log4j is used to provide system logging
+#
+log4j.rootCategory=INFO, Console
+
+# The console appender
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.target=System.out
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
+
+log4j.appender.File=org.apache.log4j.RollingFileAppender
+log4j.appender.File.file=isis.log
+log4j.appender.File.append=false
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+
+! turn on the internal log4j debugging flag so we can see what it is doing
+#log4j.debug=true
+
+# DataNucleus
+# the first two log the DML and DDL (if set to DEBUG)
+log4j.logger.DataNucleus.Datastore.Native=WARN, Console
+log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
+# the remainder can probably be left to WARN
+log4j.logger.DataNucleus.Persistence=WARN, Console
+log4j.logger.DataNucleus.Transaction=WARN, Console
+log4j.logger.DataNucleus.Connection=WARN, Console
+log4j.logger.DataNucleus.Query=WARN, Console
+log4j.logger.DataNucleus.Cache=WARN, Console
+log4j.logger.DataNucleus.MetaData=WARN, Console
+log4j.logger.DataNucleus.Datastore=WARN, Console
+log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
+log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
+log4j.logger.DataNucleus.General=WARN, Console
+log4j.logger.DataNucleus.Lifecycle=WARN, Console
+log4j.logger.DataNucleus.ValueGeneration=WARN, Console
+log4j.logger.DataNucleus.Enhancer=WARN, Console
+log4j.logger.DataNucleus.SchemaTool=ERROR, Console
+log4j.logger.DataNucleus.JDO=WARN, Console
+log4j.logger.DataNucleus.JPA=ERROR, Console
+log4j.logger.DataNucleus.JCA=WARN, Console
+log4j.logger.DataNucleus.IDE=ERROR, Console
+
+log4j.additivity.DataNucleus.Datastore.Native=false
+log4j.additivity.DataNucleus.Datastore.Schema=false
+log4j.additivity.DataNucleus.Datastore.Persistence=false
+log4j.additivity.DataNucleus.Datastore.Transaction=false
+log4j.additivity.DataNucleus.Datastore.Connection=false
+log4j.additivity.DataNucleus.Datastore.Query=false
+log4j.additivity.DataNucleus.Datastore.Cache=false
+log4j.additivity.DataNucleus.Datastore.MetaData=false
+log4j.additivity.DataNucleus.Datastore.Datastore=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
+log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
+log4j.additivity.DataNucleus.Datastore.General=false
+log4j.additivity.DataNucleus.Datastore.Lifecycle=false
+log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
+log4j.additivity.DataNucleus.Datastore.Enhancer=false
+log4j.additivity.DataNucleus.Datastore.SchemaTool=false
+log4j.additivity.DataNucleus.Datastore.JDO=false
+log4j.additivity.DataNucleus.Datastore.JPA=false
+log4j.additivity.DataNucleus.Datastore.JCA=false
+log4j.additivity.DataNucleus.Datastore.IDE=false
+
+
+
+
+# if using log4jdbc-remix as JDBC driver
+#log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
+#log4j.additivity.jdbc.sqlonly=false
+#log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
+#log4j.additivity.jdbc.resultsettable=false
+
+#log4j.logger.jdbc.audit=WARN,jdbc, Console
+#log4j.additivity.jdbc.audit=false
+#log4j.logger.jdbc.resultset=WARN,jdbc
+#log4j.additivity.jdbc.resultset=false
+#log4j.logger.jdbc.sqltiming=WARN,sqltiming
+#log4j.additivity.jdbc.sqltiming=false
+#log4j.logger.jdbc.connection=FATAL,connection
+#log4j.additivity.jdbc.connection=false
+
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/pom.xml b/mothballed/example/application/todoapp/integtests/pom.xml
new file mode 100644
index 0000000..3186102
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/pom.xml
@@ -0,0 +1,159 @@
+<?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.example.application</groupId>
+ <artifactId>todoapp</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>todoapp-integtests</artifactId>
+ <name>ToDo App Integration Tests</name>
+
+ <build>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <!--
+ uncomment for enhanced cucumber-jvm reporting
+ http://www.masterthought.net/section/cucumber-reporting
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <testfailureignore>true</testfailureignore>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>net.masterthought</groupId>
+ <artifactId>maven-cucumber-reporting</artifactId>
+ <version>0.0.3</version>
+ <executions>
+ <execution>
+ <id>execution</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <projectname>cucumber-jvm-example</projectname>
+ <outputdirectory>${project.build.directory}/cucumber-reports</outputdirectory>
+ <cucumberoutput>${project.build.directory}/cucumber.json</cucumberoutput>
+ <enableflashcharts>false</enableflashcharts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ </plugins>
+ </build>
+ <dependencies>
+
+ <!-- other modules in this project -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>todoapp-fixture</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-unittestsupport</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-integtestsupport</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-specsupport</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-wrapper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-runtime</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+
+ <!--
+ uncomment to enable enhanced cucumber-jvm reporting
+ http://www.masterthought.net/section/cucumber-reporting
+ <dependency>
+ <groupId>com.googlecode.totallylazy</groupId>
+ <artifactId>totallylazy</artifactId>
+ <version>991</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.masterthought</groupId>
+ <artifactId>cucumber-reporting</artifactId>
+ <version>0.0.21</version>
+ </dependency>
+ <dependency>
+ <groupId>net.masterthought</groupId>
+ <artifactId>maven-cucumber-reporting</artifactId>
+ <version>0.0.4</version>
+ </dependency>
+ -->
+ </dependencies>
+
+ <!--
+ uncomment for enhanced cucumber-jvm reporting
+ http://www.masterthought.net/section/cucumber-reporting
+ <repositories>
+ <repository>
+ <id>repo.bodar.com</id>
+ <url>http://repo.bodar.com</url>
+ </repository>
+ </repositories>
+ -->
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
new file mode 100644
index 0000000..3e21d50
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/ToDoAppSystemInitializer.java
@@ -0,0 +1,77 @@
+/**
+ * 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 integration;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.integtestsupport.IsisSystemForTest;
+import org.apache.isis.core.runtime.persistence.PersistenceConstants;
+import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
+import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
+
+/**
+ * Holds an instance of an {@link IsisSystemForTest} as a {@link ThreadLocal} on the current thread,
+ * initialized with ToDo app's domain services.
+ */
+public class ToDoAppSystemInitializer {
+
+ private ToDoAppSystemInitializer(){}
+
+ public static IsisSystemForTest initIsft() {
+ IsisSystemForTest isft = IsisSystemForTest.getElseNull();
+ if(isft == null) {
+ isft = new ToDoSystemBuilder().build().setUpSystem();
+ IsisSystemForTest.set(isft);
+ }
+ return isft;
+ }
+
+ private static class ToDoSystemBuilder extends IsisSystemForTest.Builder {
+
+ public ToDoSystemBuilder() {
+ withLoggingAt(org.apache.log4j.Level.INFO);
+ with(testConfiguration());
+ with(new DataNucleusPersistenceMechanismInstaller());
+
+ // services annotated with @DomainService
+ withServicesIn("app"
+ ,"dom.todo"
+ ,"fixture.todo"
+ ,"webapp.admin"
+ ,"webapp.prototyping"
+ ,"org.apache.isis.core.wrapper"
+ ,"org.apache.isis.applib"
+ ,"org.apache.isis.core.metamodel.services"
+ ,"org.apache.isis.core.runtime.services"
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
+ );
+ }
+
+ private static IsisConfiguration testConfiguration() {
+ final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests();
+ testConfiguration.addRegisterEntitiesPackagePrefix("dom");
+
+ // enable stricter checking
+ //
+ // the consequence of this is having to call 'nextTransaction()' between most of the given/when/then's
+ // because the command2 only ever refers to the event of the originating action.
+ testConfiguration.put(PersistenceConstants.ENFORCE_SAFE_SEMANTICS, "true");
+
+ return testConfiguration;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java
new file mode 100644
index 0000000..9aae79c
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/BootstrappingGlue.java
@@ -0,0 +1,53 @@
+/**
+ * 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 integration.glue;
+
+import cucumber.api.java.After;
+import cucumber.api.java.Before;
+import integration.ToDoAppSystemInitializer;
+
+import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionScope;
+import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
+
+public class BootstrappingGlue extends CukeGlueAbstract {
+
+ // //////////////////////////////////////
+
+ @Before(value={"@unit"}, order=100)
+ public void beforeScenarioUnitScope() {
+ before(ScenarioExecutionScope.UNIT);
+ }
+
+ @Before(value={"@integration"}, order=100)
+ public void beforeScenarioIntegrationScope() {
+ org.apache.log4j.PropertyConfigurator.configure("logging.properties");
+ ToDoAppSystemInitializer.initIsft();
+
+ before(ScenarioExecutionScope.INTEGRATION);
+ }
+
+ @After
+ public void afterScenario(cucumber.api.Scenario sc) {
+ assertMocksSatisfied();
+ after(sc);
+ }
+
+ // //////////////////////////////////////
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
new file mode 100644
index 0000000..01e5776
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
@@ -0,0 +1,47 @@
+/**
+ * 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 integration.glue;
+
+import cucumber.api.java.Before;
+import dom.todo.ToDoItem;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+
+import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
+import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
+
+public class CatalogOfFixturesGlue extends CukeGlueAbstract {
+
+
+ @Before(value={"@unit", "@ToDoItemsFixture"}, order=20000)
+ public void unitFixtures() throws Throwable {
+ final InMemoryDB inMemoryDB = new InMemoryDBForToDoApp(this.scenarioExecution());
+ inMemoryDB.getElseCreate(ToDoItem.class, "Write blog post");
+ inMemoryDB.getElseCreate(ToDoItem.class, "Pick up bread");
+ final ToDoItem t3 = inMemoryDB.getElseCreate(ToDoItem.class, "Pick up butter");
+ t3.setComplete(true);
+ putVar("isis", "in-memory-db", inMemoryDB);
+ }
+
+ // //////////////////////////////////////
+
+ @Before(value={"@integration", "@ToDoItemsFixture"}, order=20000)
+ public void integrationFixtures() throws Throwable {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
----------------------------------------------------------------------
diff --git a/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
new file mode 100644
index 0000000..04dcfb6
--- /dev/null
+++ b/mothballed/example/application/todoapp/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.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 integration.glue;
+
+import dom.todo.ToDoItem;
+
+import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
+import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
+
+public class InMemoryDBForToDoApp extends InMemoryDB {
+
+ public InMemoryDBForToDoApp(ScenarioExecution scenarioExecution) {
+ super(scenarioExecution);
+ }
+
+ /**
+ * Hook to initialize if possible.
+ */
+ @Override
+ protected void init(Object obj, String str) {
+ if(obj instanceof ToDoItem) {
+ ToDoItem toDoItem = (ToDoItem) obj;
+ toDoItem.setDescription(str);
+ }
+ }
+}
\ No newline at end of file
[16/29] isis git commit: ISIS-928: mothballing the todoapp (example
app and archetype)
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
deleted file mode 100644
index 0c2b1c8..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
+++ /dev/null
@@ -1,260 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package dom.todo;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-import java.math.BigDecimal;
-import java.util.List;
-import com.google.common.base.Predicates;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Optionality;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.clock.ClockService;
-
-@DomainServiceLayout(named="ToDos", menuOrder = "10")
-@DomainService(repositoryFor = ToDoItem.class)
-public class ToDoItems {
-
- //region > notYetComplete (action)
- @Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(
- cssClassFa = "fa fa-thumbs-down",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @MemberOrder(sequence = "10")
- public List<ToDoItem> notYetComplete() {
- final List<ToDoItem> items = notYetCompleteNoUi();
- if(items.isEmpty()) {
- container.informUser("All to-do items have been completed :-)");
- }
- return items;
- }
-
- @Programmatic
- public List<ToDoItem> notYetCompleteNoUi() {
- return container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedByAndCompleteIsFalse",
- "ownedBy", currentUserName()));
- }
- //endregion
-
- //region > complete (action)
- @ActionLayout(
- cssClassFa = "fa fa-thumbs-up"
- )
- @Action(semantics = SemanticsOf.SAFE)
- @MemberOrder(sequence = "20")
- public List<ToDoItem> complete() {
- final List<ToDoItem> items = completeNoUi();
- if(items.isEmpty()) {
- container.informUser("No to-do items have yet been completed :-(");
- }
- return items;
- }
-
- @Programmatic
- public List<ToDoItem> completeNoUi() {
- return container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedByAndCompleteIsTrue",
- "ownedBy", currentUserName()));
- }
- //endregion
-
- //region > categorized (action)
- @SuppressWarnings("unchecked")
- @Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(
- cssClassFa = "fa fa-question",
- bookmarking = BookmarkPolicy.AS_ROOT
- )
- @MemberOrder(sequence = "40")
- public List<ToDoItem> categorized(
- @ParameterLayout(named="Category") final Category category,
- @ParameterLayout(named="Subcategory") final Subcategory subcategory,
- @ParameterLayout(named="Completed?") final boolean completed) {
- // an example "naive" implementation (filtered in Java code, not DBMS)
- return container.allMatches(ToDoItem.class,
- Predicates.and(
- ToDoItem.Predicates.thoseOwnedBy(currentUserName()),
- ToDoItem.Predicates.thoseCompleted(completed),
- ToDoItem.Predicates.thoseCategorised(category, subcategory)));
- }
- public Category default0Categorized() {
- return Category.Professional;
- }
- public Subcategory default1Categorized() {
- return default0Categorized().subcategories().get(0);
- }
- public boolean default2Categorized() {
- return false;
- }
- public List<Subcategory> choices1Categorized(
- final Category category) {
- return Subcategory.listFor(category);
- }
- public String validateCategorized(
- final Category category,
- final Subcategory subcategory,
- final boolean completed) {
- return Subcategory.validate(category, subcategory);
- }
- //endregion
-
- //region > newToDo (action)
- @ActionLayout(cssClassFa = "fa fa-plus")
- @MemberOrder(sequence = "5")
- public ToDoItem newToDo(
- @Parameter(regexPattern = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*")
- @ParameterLayout(named="Description")
- final String description,
- @ParameterLayout(named="Category")
- final Category category,
- @Parameter(optional = Optionality.TRUE)
- @ParameterLayout(named="Subcategory")
- final Subcategory subcategory,
- @Parameter(optional = Optionality.TRUE)
- @ParameterLayout(named="Due by")
- final LocalDate dueBy,
- @Parameter(optional = Optionality.TRUE)
- @ParameterLayout(named="Cost")
- final BigDecimal cost) {
- return newToDo(description, category, subcategory, currentUserName(), dueBy, cost);
- }
- public Category default1NewToDo() {
- return Category.Professional;
- }
- public Subcategory default2NewToDo() {
- return Category.Professional.subcategories().get(0);
- }
- public LocalDate default3NewToDo() {
- return clockService.now().plusDays(14);
- }
- public List<Subcategory> choices2NewToDo(
- final String description, final Category category) {
- return Subcategory.listFor(category);
- }
- public String validateNewToDo(
- final String description,
- final Category category, final Subcategory subcategory,
- final LocalDate dueBy, final BigDecimal cost) {
- return Subcategory.validate(category, subcategory);
- }
- //endregion
-
- //region > allToDos (action)
- @ActionLayout(
- cssClassFa = "fa fa-globe"
- )
- @Action(
- semantics = SemanticsOf.SAFE,
- restrictTo = RestrictTo.PROTOTYPING
- )
- @MemberOrder(sequence = "50")
- public List<ToDoItem> allToDos() {
- final List<ToDoItem> items = container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedBy",
- "ownedBy", currentUserName()));
- if(items.isEmpty()) {
- container.warnUser("No to-do items found.");
- }
- return items;
- }
- //endregion
-
- //region > autoComplete (programmatic)
- @Programmatic // not part of metamodel
- public List<ToDoItem> autoComplete(final String description) {
- return container.allMatches(
- new QueryDefault<>(ToDoItem.class,
- "findByOwnedByAndDescriptionContains",
- "ownedBy", currentUserName(),
- "description", description));
- }
- //endregion
-
- //region > helpers
- @Programmatic // for use by fixtures
- public ToDoItem newToDo(
- final String description,
- final Category category,
- final Subcategory subcategory,
- final String userName,
- final LocalDate dueBy, final BigDecimal cost) {
- final ToDoItem toDoItem = container.newTransientInstance(ToDoItem.class);
- toDoItem.setDescription(description);
- toDoItem.setCategory(category);
- toDoItem.setSubcategory(subcategory);
- toDoItem.setOwnedBy(userName);
- toDoItem.setDueBy(dueBy);
- toDoItem.setCost(cost);
-
- container.persist(toDoItem);
- container.flush();
-
- return toDoItem;
- }
-
- private String currentUserName() {
- return container.getUser().getName();
- }
-
- //endregion
-
- //region > common validation
- private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
-
- @Programmatic
- public String validateDueBy(final LocalDate dueBy) {
- return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
- }
- @Programmatic
- boolean isMoreThanOneWeekInPast(final LocalDate dueBy) {
- return dueBy.toDateTimeAtStartOfDay().getMillis() < clockService.nowAsMillis() - ONE_WEEK_IN_MILLIS;
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private DomainObjectContainer container;
-
- @javax.inject.Inject
- private ClockService clockService;
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/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
deleted file mode 100644
index cd23b44..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package 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.services.actinvoc.ActionInvocationContext;
-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;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public abstract class ToDoItemTest {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
- @Mock
- EventBusService eventBusService;
-
- ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- toDoItem = new ToDoItem();
-
- toDoItem.actionInvocationContext = ActionInvocationContext.onObject(toDoItem);
- toDoItem.eventBusService = eventBusService;
-
- context.ignoring(eventBusService);
- }
-
- public static class Properties 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 {
-
- // given
- toDoItem.setComplete(false);
- assertThat(toDoItem.disableCompleted(), is(nullValue()));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
- assertThat(toDoItem.disableCompleted(), is(not(nullValue())));
- }
- }
-
- public static class NotYetCompleted extends Actions {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- toDoItem.setComplete(true);
- assertThat(toDoItem.disableNotYetCompleted(), is(nullValue()));
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(toDoItem.isComplete(), is(false));
- assertThat(toDoItem.disableNotYetCompleted(), is(not(nullValue())));
- }
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
deleted file mode 100644
index 478ac42..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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>${groupId}</groupId>
- <artifactId>${rootArtifactId}</artifactId>
- <version>${version}</version>
- </parent>
-
- <artifactId>${artifactId}</artifactId>
- <name>ToDo App Fixtures</name>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-dom</artifactId>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
deleted file mode 100644
index d56a515..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
+++ /dev/null
@@ -1,100 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo;
-
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import java.util.List;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Optionality;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.fixturescripts.FixtureResult;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-
-/**
- * Enables fixtures to be installed from the application.
- */
-@DomainService
-@DomainServiceLayout(
- named = "Prototyping",
- menuBar = DomainServiceLayout.MenuBar.SECONDARY,
- menuOrder = "10")
-public class ToDoItemsFixturesService extends FixtureScripts {
-
- public ToDoItemsFixturesService() {
- super("fixture.todo");
- }
-
- @ActionLayout(
- cssClassFa="fa fa-bolt"
- )
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @Override
- public List<FixtureResult> runFixtureScript(
- final FixtureScript fixtureScript,
- @ParameterLayout(
- named="Parameters",
- describedAs = "Script-specific parameters (key=value) ",
- multiLine = 10)
- @Parameter(optional = Optionality.TRUE)
- final String parameters) {
- return super.runFixtureScript(fixtureScript, parameters);
- }
-
- @Override
- public FixtureScript default0RunFixtureScript() {
- return findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class);
- }
-
- /**
- * Raising visibility to <tt>public</tt> so that choices are available for first param
- * of {@link ${symbol_pound}runFixtureScript(FixtureScript, String)}.
- */
- @Override
- public List<FixtureScript> choices0RunFixtureScript() {
- return super.choices0RunFixtureScript();
- }
-
- // //////////////////////////////////////
-
-
- @ActionLayout(
- cssClassFa="fa fa-list"
- )
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @MemberOrder(sequence="20")
- public Object recreateToDoItemsReturnFirst() {
- final List<FixtureResult> run = findFixtureScriptFor(ToDoItemsRecreateAndCompleteSeveral.class).run(null);
- return run.get(0).getObject();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
deleted file mode 100644
index eb2c28f..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/integtests/ToDoItemsIntegTestFixture.java
+++ /dev/null
@@ -1,43 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package fixture.todo.integtests;
-
-import fixture.todo.scenarios.ToDoItemsRecreateAndCompleteSeveral;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-/**
- * Refactored to reuse the newer {@link FixtureScript} API.
- */
-public class ToDoItemsIntegTestFixture extends FixtureScript {
-
- public ToDoItemsIntegTestFixture() {
- super(null, "integ-test");
- }
-
- @Override
- protected void execute(ExecutionContext executionContext) {
- executionContext.executeChild(this, new ToDoItemsRecreateAndCompleteSeveral());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
deleted file mode 100644
index b1ffcd1..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteAbstract.java
+++ /dev/null
@@ -1,55 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.actions.complete;
-
-import dom.todo.ToDoItem;
-
-import java.util.Collection;
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-public abstract class ToDoItemCompleteAbstract extends FixtureScript {
-
- /**
- * Looks up item from repository, and completes.
- */
- protected void complete(final String description, final ExecutionContext executionContext) {
- String ownedBy = executionContext.getParameter("ownedBy");
- final ToDoItem toDoItem = findToDoItem(description, ownedBy);
- toDoItem.setComplete(true);
- executionContext.addResult(this, toDoItem);
- }
-
- private ToDoItem findToDoItem(final String description, final String ownedBy) {
- final Collection<ToDoItem> filtered = Collections2.filter(getContainer().allInstances(ToDoItem.class), new Predicate<ToDoItem>() {
- @Override
- public boolean apply(ToDoItem input) {
- return Objects.equal(description, input.getDescription()) &&
- Objects.equal(ownedBy, input.getOwnedBy());
- }
- });
- return filtered.isEmpty()? null: filtered.iterator().next();
- }
- //endregion
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
deleted file mode 100644
index 3a5d149..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForBuyStamps.java
+++ /dev/null
@@ -1,33 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.actions.complete;
-
-import fixture.todo.items.create.ToDoItemForBuyStamps;
-
-public class ToDoItemCompleteForBuyStamps extends ToDoItemCompleteAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
- complete(ToDoItemForBuyStamps.DESCRIPTION, executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
deleted file mode 100644
index 14e417f..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/actions/complete/ToDoItemCompleteForWriteBlogPost.java
+++ /dev/null
@@ -1,34 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.actions.complete;
-
-import fixture.todo.items.create.ToDoItemForWriteBlogPost;
-
-public class ToDoItemCompleteForWriteBlogPost extends ToDoItemCompleteAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
- complete(ToDoItemForWriteBlogPost.DESCRIPTION, executionContext);
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
deleted file mode 100644
index 305cef7..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemAbstract.java
+++ /dev/null
@@ -1,72 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-import dom.todo.ToDoItems;
-
-import java.math.BigDecimal;
-import org.joda.time.LocalDate;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.services.clock.ClockService;
-
-public abstract class ToDoItemAbstract extends FixtureScript {
-
- protected ToDoItem createToDoItem(
- final String description,
- final Category category, final Subcategory subcategory,
- final LocalDate dueBy,
- final BigDecimal cost,
- final ExecutionContext executionContext) {
-
- // validate parameters
- final String ownedBy = executionContext.getParameter("ownedBy");
- if(ownedBy == null) {
- throw new IllegalArgumentException("'ownedBy' must be specified");
- }
-
- // execute
- ToDoItem newToDo = toDoItems.newToDo(
- description, category, subcategory, ownedBy, dueBy, cost);
- return executionContext.addResult(this, newToDo);
- }
-
- protected LocalDate nowPlusDays(int days) {
- return clockService.now().plusDays(days);
- }
-
- protected BigDecimal BD(String str) {
- return new BigDecimal(str);
- }
-
- //region > injected services
- @javax.inject.Inject
- private ToDoItems toDoItems;
-
- @javax.inject.Inject
- protected ClockService clockService;
- //endregion
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
deleted file mode 100644
index f13fe6f..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyBread.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForBuyBread extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Buy bread",
- Category.Domestic, Subcategory.Shopping,
- nowPlusDays(0),
- BD("1.75"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
deleted file mode 100644
index d7140fb..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyMilk.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForBuyMilk extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Buy milk",
- Category.Domestic, Subcategory.Shopping,
- nowPlusDays(0),
- BD("0.75"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
deleted file mode 100644
index a5f760b..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForBuyStamps.java
+++ /dev/null
@@ -1,42 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForBuyStamps extends ToDoItemAbstract {
-
- public static final String DESCRIPTION = "Buy stamps";
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- DESCRIPTION,
- Category.Domestic, Subcategory.Shopping,
- nowPlusDays(0),
- BD("10.00"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
deleted file mode 100644
index c13606b..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForMowLawn.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForMowLawn extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Mow lawn",
- Category.Domestic, Subcategory.Garden,
- nowPlusDays(6),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
deleted file mode 100644
index 0df57a4..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForOrganizeBrownBag.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForOrganizeBrownBag extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Organize brown bag",
- Category.Professional, Subcategory.Consulting,
- nowPlusDays(14),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
deleted file mode 100644
index 74ba550..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForPickUpLaundry.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForPickUpLaundry extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Pick up laundry",
- Category.Domestic, Subcategory.Chores,
- nowPlusDays(6),
- BD("7.50"),
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
deleted file mode 100644
index 191d941..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSharpenKnives.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForSharpenKnives extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Sharpen knives",
- Category.Domestic, Subcategory.Chores,
- nowPlusDays(14),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
deleted file mode 100644
index c3a1633..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForStageIsisRelease.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForStageIsisRelease extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Stage Isis release",
- Category.Professional, Subcategory.OpenSource,
- null,
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
deleted file mode 100644
index 5c84305..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForSubmitConferenceSession.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForSubmitConferenceSession extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Submit conference session",
- Category.Professional, Subcategory.Education,
- nowPlusDays(21),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
deleted file mode 100644
index 87efcc0..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForVacuumHouse.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForVacuumHouse extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Vacuum house",
- Category.Domestic, Subcategory.Housework,
- nowPlusDays(3),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
deleted file mode 100644
index 48154e0..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteBlogPost.java
+++ /dev/null
@@ -1,42 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForWriteBlogPost extends ToDoItemAbstract {
-
- public static final String DESCRIPTION = "Write blog post";
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- DESCRIPTION,
- Category.Professional, Subcategory.Marketing,
- nowPlusDays(7),
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
deleted file mode 100644
index 96c5b53..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/create/ToDoItemForWriteToPenPal.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.create;
-
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-
-public class ToDoItemForWriteToPenPal extends ToDoItemAbstract {
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- createToDoItem(
- "Write to penpal",
- Category.Other, Subcategory.Other,
- null,
- null,
- executionContext);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
deleted file mode 100644
index 429d596..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/items/delete/ToDoItemsDelete.java
+++ /dev/null
@@ -1,41 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.items.delete;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
-
-public class ToDoItemsDelete extends FixtureScript {
-
- //region > execute
- protected void execute(ExecutionContext executionContext) {
- final String ownedBy = executionContext.getParameter("ownedBy");
- isisJdoSupport.executeUpdate("delete from ${symbol_escape}"ToDoItem${symbol_escape}" where ${symbol_escape}"ownedBy${symbol_escape}" = '" + ownedBy + "'");
- }
- //endregion
-
- //region > injected services
- @javax.inject.Inject
- private IsisJdoSupport isisJdoSupport;
- //endregion
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
deleted file mode 100644
index a1bb33f..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreate.java
+++ /dev/null
@@ -1,84 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.scenarios;
-
-import fixture.todo.items.delete.ToDoItemsDelete;
-import fixture.todo.items.create.ToDoItemForBuyBread;
-import fixture.todo.items.create.ToDoItemForBuyMilk;
-import fixture.todo.items.create.ToDoItemForBuyStamps;
-import fixture.todo.items.create.ToDoItemForMowLawn;
-import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
-import fixture.todo.items.create.ToDoItemForPickUpLaundry;
-import fixture.todo.items.create.ToDoItemForSharpenKnives;
-import fixture.todo.items.create.ToDoItemForStageIsisRelease;
-import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
-import fixture.todo.items.create.ToDoItemForVacuumHouse;
-import fixture.todo.items.create.ToDoItemForWriteBlogPost;
-import fixture.todo.items.create.ToDoItemForWriteToPenPal;
-import fixture.todo.util.Util;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-public class ToDoItemsRecreate extends FixtureScript {
-
- public ToDoItemsRecreate() {
- withDiscoverability(Discoverability.DISCOVERABLE);
- }
-
- //region > ownedBy (optional)
- private String ownedBy;
-
- public String getOwnedBy() {
- return ownedBy;
- }
-
- public void setOwnedBy(String ownedBy) {
- this.ownedBy = ownedBy;
- }
- //endregion
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- // defaults
- executionContext.setParameterIfNotPresent(
- "ownedBy",
- Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
-
- // prereqs
- executionContext.executeChild(this, new ToDoItemsDelete());
-
- // create items
- executionContext.executeChild(this, new ToDoItemForBuyMilk());
- executionContext.executeChild(this, new ToDoItemForBuyBread());
- executionContext.executeChild(this, new ToDoItemForBuyStamps());
- executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
- executionContext.executeChild(this, new ToDoItemForMowLawn());
- executionContext.executeChild(this, new ToDoItemForVacuumHouse());
- executionContext.executeChild(this, new ToDoItemForSharpenKnives());
- executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
- executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
- executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
- executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
- executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
deleted file mode 100644
index 3d790b7..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveral.java
+++ /dev/null
@@ -1,89 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.scenarios;
-
-import fixture.todo.items.actions.complete.ToDoItemCompleteForBuyStamps;
-import fixture.todo.items.actions.complete.ToDoItemCompleteForWriteBlogPost;
-import fixture.todo.items.create.ToDoItemForBuyBread;
-import fixture.todo.items.create.ToDoItemForBuyMilk;
-import fixture.todo.items.create.ToDoItemForBuyStamps;
-import fixture.todo.items.create.ToDoItemForMowLawn;
-import fixture.todo.items.create.ToDoItemForOrganizeBrownBag;
-import fixture.todo.items.create.ToDoItemForPickUpLaundry;
-import fixture.todo.items.create.ToDoItemForSharpenKnives;
-import fixture.todo.items.create.ToDoItemForStageIsisRelease;
-import fixture.todo.items.create.ToDoItemForSubmitConferenceSession;
-import fixture.todo.items.create.ToDoItemForVacuumHouse;
-import fixture.todo.items.create.ToDoItemForWriteBlogPost;
-import fixture.todo.items.create.ToDoItemForWriteToPenPal;
-import fixture.todo.items.delete.ToDoItemsDelete;
-import fixture.todo.util.Util;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-public class ToDoItemsRecreateAndCompleteSeveral extends FixtureScript {
-
- public ToDoItemsRecreateAndCompleteSeveral() {
- withDiscoverability(Discoverability.DISCOVERABLE);
- }
-
- //region > ownedBy (optional)
- private String ownedBy;
-
- public String getOwnedBy() {
- return ownedBy;
- }
-
- public void setOwnedBy(String ownedBy) {
- this.ownedBy = ownedBy;
- }
- //endregion
-
- @Override
- protected void execute(ExecutionContext executionContext) {
-
- // defaults
- executionContext.setParameterIfNotPresent(
- "ownedBy",
- Util.coalesce(getOwnedBy(), getContainer().getUser().getName()));
-
- executionContext.executeChild(this, new ToDoItemsDelete());
-
- // create items
- executionContext.executeChild(this, new ToDoItemForBuyMilk());
- executionContext.executeChild(this, new ToDoItemForBuyBread());
- executionContext.executeChild(this, new ToDoItemForBuyStamps());
- executionContext.executeChild(this, new ToDoItemForPickUpLaundry());
- executionContext.executeChild(this, new ToDoItemForMowLawn());
- executionContext.executeChild(this, new ToDoItemForVacuumHouse());
- executionContext.executeChild(this, new ToDoItemForSharpenKnives());
- executionContext.executeChild(this, new ToDoItemForWriteToPenPal());
- executionContext.executeChild(this, new ToDoItemForWriteBlogPost());
- executionContext.executeChild(this, new ToDoItemForOrganizeBrownBag());
- executionContext.executeChild(this, new ToDoItemForSubmitConferenceSession());
- executionContext.executeChild(this, new ToDoItemForStageIsisRelease());
-
- // this fixture
- executionContext.executeChild(this, new ToDoItemCompleteForBuyStamps());
- executionContext.executeChild(this, new ToDoItemCompleteForWriteBlogPost());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
deleted file mode 100644
index 82d1a4e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForDick.java
+++ /dev/null
@@ -1,31 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.scenarios;
-
-public final class ToDoItemsRecreateAndCompleteSeveralForDick extends ToDoItemsRecreateAndCompleteSeveral {
-
- public ToDoItemsRecreateAndCompleteSeveralForDick() {
- withDiscoverability(Discoverability.DISCOVERABLE);
-
- setOwnedBy("dick");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
deleted file mode 100644
index e2cfc0e..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateAndCompleteSeveralForJoe.java
+++ /dev/null
@@ -1,31 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.scenarios;
-
-public final class ToDoItemsRecreateAndCompleteSeveralForJoe extends ToDoItemsRecreateAndCompleteSeveral {
-
- public ToDoItemsRecreateAndCompleteSeveralForJoe() {
- withDiscoverability(Discoverability.DISCOVERABLE);
-
- setOwnedBy("joe");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
deleted file mode 100644
index bf58168..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/scenarios/ToDoItemsRecreateForSven.java
+++ /dev/null
@@ -1,32 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.scenarios;
-
-public final class ToDoItemsRecreateForSven extends ToDoItemsRecreate {
-
- public ToDoItemsRecreateForSven() {
- withDiscoverability(Discoverability.DISCOVERABLE);
-
- setOwnedBy("sven");
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java
deleted file mode 100644
index 7a0ae71..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/util/Util.java
+++ /dev/null
@@ -1,35 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package fixture.todo.util;
-
-public final class Util {
-
- private Util(){}
-
- public static String coalesce(final String... strings) {
- for (String str : strings) {
- if(str != null) { return str; }
- }
- return null;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/a4ec0b72/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties
deleted file mode 100644
index f49afbf..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/logging.properties
+++ /dev/null
@@ -1,104 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
-${symbol_pound} or more contributor license agreements. See the NOTICE file
-${symbol_pound} distributed with this work for additional information
-${symbol_pound} regarding copyright ownership. The ASF licenses this file
-${symbol_pound} to you under the Apache License, Version 2.0 (the
-${symbol_pound} "License"); you may not use this file except in compliance
-${symbol_pound} with the License. You may obtain a copy of the License at
-${symbol_pound}
-${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
-${symbol_pound}
-${symbol_pound} Unless required by applicable law or agreed to in writing,
-${symbol_pound} software distributed under the License is distributed on an
-${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-${symbol_pound} KIND, either express or implied. See the License for the
-${symbol_pound} specific language governing permissions and limitations
-${symbol_pound} under the License.
-
-
-${symbol_pound}
-${symbol_pound} Isis uses log4j is used to provide system logging
-${symbol_pound}
-log4j.rootCategory=INFO, Console
-
-${symbol_pound} The console appender
-log4j.appender.Console=org.apache.log4j.ConsoleAppender
-log4j.appender.Console.target=System.out
-log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
-
-log4j.appender.File=org.apache.log4j.RollingFileAppender
-log4j.appender.File.file=isis.log
-log4j.appender.File.append=false
-log4j.appender.File.layout=org.apache.log4j.PatternLayout
-log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
-
-! turn on the internal log4j debugging flag so we can see what it is doing
-${symbol_pound}log4j.debug=true
-
-${symbol_pound} DataNucleus
-${symbol_pound} the first two log the DML and DDL (if set to DEBUG)
-log4j.logger.DataNucleus.Datastore.Native=WARN, Console
-log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
-${symbol_pound} the remainder can probably be left to WARN
-log4j.logger.DataNucleus.Persistence=WARN, Console
-log4j.logger.DataNucleus.Transaction=WARN, Console
-log4j.logger.DataNucleus.Connection=WARN, Console
-log4j.logger.DataNucleus.Query=WARN, Console
-log4j.logger.DataNucleus.Cache=WARN, Console
-log4j.logger.DataNucleus.MetaData=WARN, Console
-log4j.logger.DataNucleus.Datastore=WARN, Console
-log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
-log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
-log4j.logger.DataNucleus.General=WARN, Console
-log4j.logger.DataNucleus.Lifecycle=WARN, Console
-log4j.logger.DataNucleus.ValueGeneration=WARN, Console
-log4j.logger.DataNucleus.Enhancer=WARN, Console
-log4j.logger.DataNucleus.SchemaTool=ERROR, Console
-log4j.logger.DataNucleus.JDO=WARN, Console
-log4j.logger.DataNucleus.JPA=ERROR, Console
-log4j.logger.DataNucleus.JCA=WARN, Console
-log4j.logger.DataNucleus.IDE=ERROR, Console
-
-log4j.additivity.DataNucleus.Datastore.Native=false
-log4j.additivity.DataNucleus.Datastore.Schema=false
-log4j.additivity.DataNucleus.Datastore.Persistence=false
-log4j.additivity.DataNucleus.Datastore.Transaction=false
-log4j.additivity.DataNucleus.Datastore.Connection=false
-log4j.additivity.DataNucleus.Datastore.Query=false
-log4j.additivity.DataNucleus.Datastore.Cache=false
-log4j.additivity.DataNucleus.Datastore.MetaData=false
-log4j.additivity.DataNucleus.Datastore.Datastore=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false
-log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false
-log4j.additivity.DataNucleus.Datastore.General=false
-log4j.additivity.DataNucleus.Datastore.Lifecycle=false
-log4j.additivity.DataNucleus.Datastore.ValueGeneration=false
-log4j.additivity.DataNucleus.Datastore.Enhancer=false
-log4j.additivity.DataNucleus.Datastore.SchemaTool=false
-log4j.additivity.DataNucleus.Datastore.JDO=false
-log4j.additivity.DataNucleus.Datastore.JPA=false
-log4j.additivity.DataNucleus.Datastore.JCA=false
-log4j.additivity.DataNucleus.Datastore.IDE=false
-
-
-
-
-${symbol_pound} if using log4jdbc-remix as JDBC driver
-${symbol_pound}log4j.logger.jdbc.sqlonly=DEBUG, sql, Console
-${symbol_pound}log4j.additivity.jdbc.sqlonly=false
-${symbol_pound}log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console
-${symbol_pound}log4j.additivity.jdbc.resultsettable=false
-
-${symbol_pound}log4j.logger.jdbc.audit=WARN,jdbc, Console
-${symbol_pound}log4j.additivity.jdbc.audit=false
-${symbol_pound}log4j.logger.jdbc.resultset=WARN,jdbc
-${symbol_pound}log4j.additivity.jdbc.resultset=false
-${symbol_pound}log4j.logger.jdbc.sqltiming=WARN,sqltiming
-${symbol_pound}log4j.additivity.jdbc.sqltiming=false
-${symbol_pound}log4j.logger.jdbc.connection=FATAL,connection
-${symbol_pound}log4j.additivity.jdbc.connection=false
-
[27/29] isis git commit: ISIS-903: refactoring in the direction of
also reading .po files
Posted by da...@apache.org.
ISIS-903: refactoring in the direction of also reading .po files
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/f23f4e7b
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/f23f4e7b
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/f23f4e7b
Branch: refs/heads/ISIS-903
Commit: f23f4e7bb8629c4ab51373679ef96419ff16cb3f
Parents: 226ef62
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Feb 13 18:58:05 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Feb 14 09:07:36 2015 +0000
----------------------------------------------------------------------
.../services/i18n/po/TranslationServicePo.java | 87 ++++++++++++++++++++
1 file changed, 87 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/f23f4e7b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java
new file mode 100644
index 0000000..a5b012d
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/i18n/po/TranslationServicePo.java
@@ -0,0 +1,87 @@
+/*
+ * 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.core.metamodel.services.i18n.po;
+
+import java.util.Locale;
+import java.util.Map;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.services.i18n.TranslationService;
+
+/**
+ * Not annotated with @DomainService, but is registered as a fallback by <tt>ServicesInstallerFallback</tt>.
+ */
+public class TranslationServicePo implements TranslationService {
+
+ public static Logger LOG = LoggerFactory.getLogger(TranslationServicePo.class);
+
+ private boolean prototype;
+
+ private PoAbstract po;
+
+ public TranslationServicePo() {
+ po = new PotWriter(this);
+ }
+
+ //region > init, shutdown
+
+ @Programmatic
+ @PostConstruct
+ public void init(final Map<String,String> config) {
+ final String deploymentType = config.get("isis.deploymentType");
+ prototype = deploymentType.toLowerCase().contains("prototype");
+
+ if (!prototype) {
+ po = new PoReader(this);
+ }
+ po.init(config);
+ }
+
+ @Programmatic
+ @PreDestroy
+ public void shutdown() {
+ po.shutdown();
+ }
+ //endregion
+
+ boolean isPrototype() {
+ return prototype;
+ }
+
+
+ @Override
+ @Programmatic
+ public String translate(final String context, final String originalText, final Locale targetLocale) {
+ return po.translate(context, originalText, targetLocale);
+ }
+
+ /**
+ * Not API
+ */
+ public String toPo() {
+ if (!prototype) {
+ throw new IllegalStateException("Not in prototype mode");
+ }
+ return ((PotWriter)po).toPo();
+ }
+
+}