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 2012/12/06 17:59:46 UTC
[3/52] [partial] ISIS-188: more reorganizing of artifacts into
physical directories.
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/domain-libs/email-service/pom.xml
----------------------------------------------------------------------
diff --git a/domain-libs/email-service/pom.xml b/domain-libs/email-service/pom.xml
deleted file mode 100644
index 665278f..0000000
--- a/domain-libs/email-service/pom.xml
+++ /dev/null
@@ -1,84 +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>
-
-
- <name>Email service</name>
- <groupId>org.apache.isis.service</groupId>
- <artifactId>email</artifactId>
- <version>0.3.0-incubating-SNAPSHOT</version>
-
-
- <parent>
- <groupId>org.apache.isis</groupId>
- <artifactId>service</artifactId>
- <version>0.3.0-incubating-SNAPSHOT</version>
- </parent>
-
- <properties>
- <siteBaseDir>../..</siteBaseDir>
- <relativeUrl>domain-libs/email-service/</relativeUrl>
- </properties>
-
- <!-- used in Site generation for relative references. -->
- <url>http://incubator.apache.org/isis/${relativeUrl}</url>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.isis</groupId>
- <artifactId>applib</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-email</artifactId>
- <version>1.1</version>
- </dependency>
-
- <dependency>
- <groupId>velocity</groupId>
- <artifactId>velocity</artifactId>
- <version>1.5</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Address.java
----------------------------------------------------------------------
diff --git a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Address.java b/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Address.java
deleted file mode 100644
index 9c01023..0000000
--- a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Address.java
+++ /dev/null
@@ -1,54 +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.service.email;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.Optional;
-
-public class Address extends AbstractDomainObject {
- private String emailAddress;
- private String name;
-
- public String title() {
- return name == null ? emailAddress : name;
- }
-
- public String getEmailAddress() {
- return emailAddress;
- }
-
- public void setEmailAddress(String emailAddress) {
- this.emailAddress = emailAddress;
- }
-
- @Optional
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-
-}
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Email.java
----------------------------------------------------------------------
diff --git a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Email.java b/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Email.java
deleted file mode 100644
index 93b9843..0000000
--- a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/Email.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 org.apache.isis.service.email;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MultiLine;
-
-public class Email extends AbstractDomainObject {
- private String subject;
- private String message;
- private Address from;
- private List<Address> to = new ArrayList<Address>();
-
- public String title() {
- return subject;
- }
-
- @MemberOrder(sequence="3")
- public String getSubject() {
- return subject;
- }
-
- public void setSubject(String subject) {
- this.subject = subject;
- }
-
- @MemberOrder(sequence="4")
- @MultiLine(numberOfLines=10)
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- @MemberOrder(sequence="1")
- public Address getFrom() {
- return from;
- }
-
- public void setFrom(Address from) {
- this.from = from;
- }
-
- @MemberOrder(sequence="2")
- public List<Address> getTo() {
- return to;
- }
-
- public void addToTo(Address address) {
- to.add(address);
- }
-
- public void removeFromTo(Address address) {
- to.remove(address);
- }
-
-
-
-
-}
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailException.java
----------------------------------------------------------------------
diff --git a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailException.java b/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailException.java
deleted file mode 100644
index 56f6b51..0000000
--- a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailException.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 org.apache.isis.service.email;
-
-import org.apache.isis.applib.ApplicationException;
-
-public class EmailException extends ApplicationException {
-
- public EmailException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- public EmailException(String msg) {
- super(msg);
- }
-
- public EmailException(Throwable cause) {
- super(cause);
- }
-
- private static final long serialVersionUID = 1L;
-
-}
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailService.java
----------------------------------------------------------------------
diff --git a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailService.java b/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailService.java
deleted file mode 100644
index 1e4f191..0000000
--- a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailService.java
+++ /dev/null
@@ -1,95 +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.service.email;
-
-import org.apache.commons.mail.EmailException;
-import org.apache.commons.mail.SimpleEmail;
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-
-
-public class EmailService extends AbstractFactoryAndRepository {
- private static final String PROPERTY_ROOT = "service.email.";
-
- /*
- protected void send(String smtpHost, int smtpPort, String from, String to, String subject, String content) {
- try {
- SimpleEmail email = new SimpleEmail();
- email.setHostName(smtpHost);
- email.addTo("rmatthews@isis.apache.org", "John Doe");
- email.setFrom("me@apache.org", "Me");
- email.setSubject(subject);
- email.setMsg(content);
- email.send();
- } catch (EmailException e) {
- throw new org.apache.isis.service.email.EmailException(e.getMessage(), e);
- }
- }
-*/
- public Email createAnEmailMessage() {
- return newTransientInstance(Email.class);
- }
-
- public Address createAnEmailAddress() {
- return newTransientInstance(Address.class);
- }
-
- public void send(Email emailObject) {
-
- String smtpHost = getContainer().getProperty(PROPERTY_ROOT + "host", "localhost");
- String portValue = getContainer().getProperty(PROPERTY_ROOT + "port", "25");
- int port = Integer.valueOf(portValue).intValue();
- String authenticationName = getContainer().getProperty(PROPERTY_ROOT + "authentication.name");
- String authenticationPassword = getContainer().getProperty(PROPERTY_ROOT + "authentication.password", "");
-
- String fromName = getContainer().getProperty(PROPERTY_ROOT + "from.name", "No reply");
- String fromEmailAddress = getContainer().getProperty(PROPERTY_ROOT + "from.address", "noreply@domain.com");
-
- try {
-
- SimpleEmail simpleEmail = new SimpleEmail();
- simpleEmail.setHostName(smtpHost);
- simpleEmail.setSmtpPort(port);
- if (authenticationName != null) {
- simpleEmail.setAuthentication(authenticationName, authenticationPassword);
- }
- for (Address address : emailObject.getTo()) {
- String name = address.getName();
- if (name == null) {
- simpleEmail.addTo(address.getEmailAddress());
- } else {
- simpleEmail.addTo(address.getEmailAddress(), name);
- }
- }
- Address from = emailObject.getFrom();
- if (from == null) {
- simpleEmail.setFrom(fromEmailAddress, fromName);
- } else {
- simpleEmail.setFrom(from.getEmailAddress(), from.getName());
- }
- simpleEmail.setSubject(emailObject.getSubject());
- simpleEmail.setMsg(emailObject.getMessage());
- simpleEmail.send();
- } catch (EmailException e) {
- throw new org.apache.isis.service.email.EmailException(e.getMessage(), e);
- }
- }
-}
-
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailTemplate.java
----------------------------------------------------------------------
diff --git a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailTemplate.java b/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailTemplate.java
deleted file mode 100644
index fe6696e..0000000
--- a/domain-libs/email-service/src/main/java/org/apache/isis/service/email/EmailTemplate.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 org.apache.isis.service.email;
-
-import java.io.StringWriter;
-
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.ApplicationException;
-
-
-public class EmailTemplate extends AbstractDomainObject {
- private VelocityContext context;
- private VelocityEngine ve;
- private boolean loadFromClassPath;
-
- private void init() {
- if (ve == null) {
- ve = new VelocityEngine();
- try {
- String root = getContainer().getProperty("webapp.dir");
- ve.setProperty("runtime.log", root + "/velocity.log");
- if (loadFromClassPath) {
- ve.setProperty("resource.loader", "class");
- ve.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
- }
- ve.init();
- context = new VelocityContext();
- } catch (Exception e) {
- throw new ApplicationException(e);
- }
- }
- }
-
- public void addContext(String name, Object object) {
- init();
- context.put(name, object);
- }
-
- public void setLoadFromClassPath(boolean loadFromClassPath) {
- this.loadFromClassPath = loadFromClassPath;
- }
-
- public Email createEmail(String templatePath, String subject, String emailAddress) {
- init();
- StringWriter writer = new StringWriter();
- try {
- Template t = ve.getTemplate(templatePath);
- t.merge(context, writer);
- } catch (Exception e) {
- throw new ApplicationException(e);
- }
-
- Email email = newTransientInstance(Email.class);
- email.setSubject(subject);
- email.setMessage(writer.toString());
-
- Address address = newTransientInstance(Address.class);
- address.setEmailAddress(emailAddress);
- email.addToTo(address);
-
- return email;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/domain-libs/pom.xml
----------------------------------------------------------------------
diff --git a/domain-libs/pom.xml b/domain-libs/pom.xml
deleted file mode 100644
index 7edb382..0000000
--- a/domain-libs/pom.xml
+++ /dev/null
@@ -1,72 +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>
-
- <name>Examples</name>
- <groupId>org.apache.isis</groupId>
- <artifactId>service</artifactId>
- <version>0.3.0-incubating-SNAPSHOT</version>
- <packaging>pom</packaging>
-
-
- <parent>
- <groupId>org.apache</groupId>
- <artifactId>apache</artifactId>
- <version>10</version>
- </parent>
-
- <properties>
- <siteBaseDir>..</siteBaseDir>
- <relativeUrl>domain-libs/</relativeUrl>
- </properties>
-
- <!-- used in Site generation for relative references. -->
- <url>http://incubator.apache.org/isis/${relativeUrl}</url>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-9</version>
- <configuration>
- <remoteTagging>true</remoteTagging>
- <preparationGoals>clean verify</preparationGoals>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- <tagBase>https://apache.isis.svn/svnroot/tags/distribution</tagBase>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <modules>
- <module>email-service</module>
- </modules>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/pom.xml
----------------------------------------------------------------------
diff --git a/examples/claims/dom/pom.xml b/examples/claims/dom/pom.xml
deleted file mode 100644
index eec4420..0000000
--- a/examples/claims/dom/pom.xml
+++ /dev/null
@@ -1,143 +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.examples.apps</groupId>
- <artifactId>claims</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>claims-dom</artifactId>
- <name>Example Claims App DOM</name>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.datanucleus</groupId>
- <artifactId>maven-datanucleus-plugin</artifactId>
- <version>3.1.1</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>
- maven-datanucleus-plugin
- </artifactId>
- <versionRange>
- [3.0.2,)
- </versionRange>
- <goals>
- <goal>enhance</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
-
- <dependencyManagement>
- <dependencies>
- <!-- for DataNucleus, see below -->
- <dependency>
- <groupId>org.apache.isis.runtimes.dflt.objectstores</groupId>
- <artifactId>jdo</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.isis</groupId>
- <artifactId>applib</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.runtimes.dflt.objectstores</groupId>
- <artifactId>jdo-applib</artifactId>
- </dependency>
-
- <!-- DataNucleus (horrid, but needed to run the enhancer)-->
- <dependency>
- <groupId>javax.jdo</groupId>
- <artifactId>jdo-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-enhancer</artifactId>
- <!--
- <exclusions>
- <exclusion>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- </exclusions>
- -->
- </dependency>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-api-jdo</artifactId>
- </dependency>
-
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Approver.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Approver.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Approver.java
deleted file mode 100644
index fb10f6f..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Approver.java
+++ /dev/null
@@ -1,24 +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.example.claims.dom.claim;
-
-public interface Approver {
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claim.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claim.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claim.java
deleted file mode 100644
index c227650..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claim.java
+++ /dev/null
@@ -1,323 +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.example.claims.dom.claim;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.Disabled;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.MaxLength;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MustSatisfy;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.spec.Specification;
-import org.apache.isis.applib.util.Reasons;
-import org.apache.isis.applib.value.Date;
-import org.apache.isis.applib.value.Money;
-
-/**
- * @author danhaywood
- */
-public class Claim extends AbstractDomainObject /* implements Calendarable */{
-
- // {{ Title
- public String title() {
- return getStatus() + " - " + getDate();
- }
-
- // }}
-
- // {{ Lifecycle
- public void created() {
- status = "New";
- date = new Date(); // applib date uses the Clock
- }
-
- // }}
-
- // {{ Rush
- private boolean rush;
-
- @Hidden
- @MemberOrder(sequence = "1.2")
- public boolean getRush() {
- return rush;
- }
-
- public void setRush(final boolean flag) {
- this.rush = flag;
- }
-
- // }}
-
- // {{ Description
- private String description;
-
- @MemberOrder(sequence = "1")
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
-
- public String defaultDescription() {
- return "enter a description here";
- }
-
- public String validateDescription(final String description) {
- if (description == null) {
- return null;
- }
- if (description.contains("foobar")) {
- return "can't contain foobar!";
- }
- return null;
- }
-
- // }}
-
- // {{ Date
- private Date date;
-
- @MemberOrder(sequence = "2")
- public Date getDate() {
- return date;
- }
-
- public void setDate(final Date date) {
- this.date = date;
- }
-
- // }}
-
- // {{ Status
- /**
- * @uml.property name="status"
- */
- private String status;
-
- /**
- * @return
- * @uml.property name="status"
- */
- @Disabled
- @MemberOrder(sequence = "3")
- @MaxLength(5)
- public String getStatus() {
- return status;
- }
-
- /**
- * @param status
- * @uml.property name="status"
- */
- public void setStatus(final String status) {
- this.status = status;
- }
-
- // }}
-
- // {{ changeStatus
- @MemberOrder(sequence = "1")
- public void changeStatus(@MustSatisfy(ClaimStatus.ChoicesSpecification.class) final String status) {
- setStatus(status);
- }
-
- public List<String> choices0ChangeStatus() {
- return ClaimStatus.ALL;
- }
-
- private String ifAlreadySubmitted() {
- return ClaimStatus.SUBMITTED.equals(getStatus()) ? "Already submitted" : null;
- }
-
- // }}
-
- // {{ Claimant
- /**
- * @uml.property name="claimant"
- * @uml.associationEnd
- */
- private Claimant claimant;
-
- /**
- * @return
- * @uml.property name="claimant"
- */
- @Disabled
- @MemberOrder(sequence = "4")
- public Claimant getClaimant() {
- return claimant;
- }
-
- /**
- * @param claimant
- * @uml.property name="claimant"
- */
- public void setClaimant(final Claimant claimant) {
- this.claimant = claimant;
- }
-
- // }}
-
- // {{ Approver
- private Approver approver;
-
- // @Disabled
- @MemberOrder(sequence = "5")
- @Optional
- public Approver getApprover() {
- return approver;
- }
-
- public void setApprover(final Approver approver) {
- this.approver = approver;
- }
-
- public String disableApprover() {
- return getDescription().contains("baz") ? "desc contains baz" : null;
- }
-
- public String validateApprover(final Approver approver) {
- if (approver == null) {
- return null;
- }
- return approver == getClaimant() ? "Can't approve own claims" : null;
- }
-
- // }}
-
- // {{ Items
- private final List<ClaimItem> items = new ArrayList<ClaimItem>();
-
- @MemberOrder(sequence = "6")
- public List<ClaimItem> getItems() {
- return items;
- }
-
- public void addToItems(final ClaimItem item) {
- items.add(item);
- }
-
- public void removeFromItems(final ClaimItem item) {
- items.remove(item);
- }
-
- // }}
-
- // {{ action: Submit
- public void submit(final Approver approver) {
- setStatus(ClaimStatus.SUBMITTED);
- setApprover(approver);
- }
-
- public String disableSubmit() {
- return !ClaimStatus.SUBMITTED.equals(getStatus()) ? null : "Claim has already been submitted";
- }
-
- public Approver default0Submit() {
- return getClaimant().getDefaultApprover();
- }
-
- // }}
-
- // {{ action: addItem
- @MemberOrder(sequence = "1")
- public void addItem(@Named("Days since") final int days, @Named("Amount") final double amount, @Named("Description") final String description) {
- final ClaimItem claimItem = newTransientInstance(ClaimItem.class);
- Date date = new Date();
- date = date.add(0, 0, days);
- claimItem.setDateIncurred(date);
- claimItem.setDescription(description);
- claimItem.setAmount(new Money(amount, "USD"));
- persist(claimItem);
- addToItems(claimItem);
- }
-
- public String disableAddItem() {
- return Reasons.coalesce(ifAlreadySubmitted());
- }
-
- // }}
-
- // {{ removeItem
- @MemberOrder(sequence = "2")
- public void removeItem(final ClaimItem claimItem) {
- removeFromItems(claimItem);
- }
-
- public String disableRemoveItem() {
- return Reasons.coalesce(ifAlreadySubmitted());
- }
-
- public ClaimItem default0RemoveItem() {
- if (getItems().size() > 0) {
- return getItems().get(getItems().size() - 1);
- } else {
- return null;
- }
- }
-
- public List<ClaimItem> choices0RemoveItem() {
- return Collections.unmodifiableList(getItems());
- }
-
- // }}
-
- public String validate() {
- if (ClaimStatus.INCOMPLETE.equals(getStatus())) {
- return "incomplete";
- }
- if (getDescription().contains("foobaz")) {
- return "no 'foobaz' allowed in description!";
- }
- return null;
- }
-
- public static class ClaimStatus {
-
- private static final String NEW = "New";
- private static final String INCOMPLETE = "Incomplete";
- private static final String SUBMITTED = "Submitted";
-
- public static final List<String> ALL = Collections.unmodifiableList(Arrays.asList(NEW, INCOMPLETE, SUBMITTED));
-
- public static class ChoicesSpecification implements Specification {
-
- @Override
- public String satisfies(final Object obj) {
- for (final String str : ALL) {
- if (str.equals(obj)) {
- return null;
- }
- }
- return "Must be one of " + ALL;
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimItem.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimItem.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimItem.java
deleted file mode 100644
index a93d620..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimItem.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 org.apache.isis.example.claims.dom.claim;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.value.Date;
-import org.apache.isis.applib.value.Money;
-
-public class ClaimItem extends AbstractDomainObject {
-
- // {{ Title
- public String title() {
- return getDescription();
- }
-
- // }}
-
- // {{ DateIncurred
- private Date dateIncurred;
-
- @MemberOrder(sequence = "1")
- public Date getDateIncurred() {
- return dateIncurred;
- }
-
- public void setDateIncurred(final Date dateIncurred) {
- this.dateIncurred = dateIncurred;
- }
-
- // }}
-
- // {{ Description
- private String description;
-
- @MemberOrder(sequence = "2")
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
-
- // }}
-
- // {{ Amount
- private Money amount;
-
- @MemberOrder(sequence = "3")
- public Money getAmount() {
- return amount;
- }
-
- public void setAmount(final Money price) {
- this.amount = price;
- }
- // }}
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimRepository.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimRepository.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimRepository.java
deleted file mode 100644
index 0c99c35..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/ClaimRepository.java
+++ /dev/null
@@ -1,51 +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.example.claims.dom.claim;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.NotContributed;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.applib.value.Date;
-
-@Named("Claims")
-public interface ClaimRepository {
-
- public List<Claim> allClaims();
-
- public List<Claim> findClaims(@Named("Description") String description);
-
- public List<Claim> claimsFor(Claimant claimant);
-
- @NotInServiceMenu
- public List<Claim> claimsSince(Claimant claimant, Date since);
-
- public Claim newClaim(Claimant claimant);
-
- @Named("New Claim")
- public Claim newClaimWithDescription(Claimant claimant, String description);
-
- @NotContributed
- int countClaimsFor(Claimant claimant);
-
- @NotContributed
- Claim mostRecentClaim(Claimant claimant);
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claimant.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claimant.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claimant.java
deleted file mode 100644
index 50d355a..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/claim/Claimant.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 org.apache.isis.example.claims.dom.claim;
-
-public interface Claimant {
-
- Approver getDefaultApprover();
-
- String title();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/Employee.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/Employee.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/Employee.java
deleted file mode 100644
index 2942d1b..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/Employee.java
+++ /dev/null
@@ -1,98 +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.example.claims.dom.employee;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.example.claims.dom.claim.Approver;
-import org.apache.isis.example.claims.dom.claim.Claimant;
-
-public class Employee extends AbstractDomainObject implements Claimant, Approver {
-
- // {{ Title
- @Override
- public String title() {
- return getName();
- }
-
- // }}
-
- // {{ Icon
- public String iconName() {
- return getName().replaceAll(" ", "");
- }
-
- // }}
-
- // {{ Name
- private String name;
-
- @MemberOrder(sequence = "1")
- public String getName() {
- return name;
- }
-
- public void setName(final String lastName) {
- this.name = lastName;
- }
-
- // }}
-
- // {{ Approver
- private Approver defaultApprover;
-
- @Override
- @MemberOrder(sequence = "2")
- public Approver getDefaultApprover() {
- return defaultApprover;
- }
-
- public void setDefaultApprover(final Approver approver) {
- this.defaultApprover = approver;
- }
-
- public String validateDefaultApprover(final Approver approver) {
- if (approver == null) {
- return null;
- }
- if (approver == this) {
- return "Cannot act as own approver";
- }
- return null;
- }
-
- // }}
-
- // {{ Limit
- private Integer limit;
-
- @Optional
- @MemberOrder(sequence = "1")
- public Integer getLimit() {
- return limit;
- }
-
- public void setLimit(final Integer limit) {
- this.limit = limit;
- }
- // }}
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeRepository.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeRepository.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeRepository.java
deleted file mode 100644
index da88ef8..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeRepository.java
+++ /dev/null
@@ -1,34 +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.example.claims.dom.employee;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.Named;
-
-@Named("Employees")
-public interface EmployeeRepository {
-
- public List<Employee> allEmployees();
-
- public List<Employee> findEmployees(@Named("Name") String name);
-
- public EmployeeTakeOn newEmployee();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeTakeOn.java
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeTakeOn.java b/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeTakeOn.java
deleted file mode 100644
index 8d90c75..0000000
--- a/examples/claims/dom/src/main/java/org/apache/isis/example/claims/dom/employee/EmployeeTakeOn.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 org.apache.isis.example.claims.dom.employee;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.example.claims.dom.claim.Approver;
-
-public class EmployeeTakeOn extends AbstractDomainObject {
-
- // {{ Lifecycle methods
- public void created() {
- state = "page1";
- }
-
- // }}
-
- // {{ Name
- private String name;
-
- @MemberOrder(sequence = "1")
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public boolean hideName() {
- return !state.equals("page1") && isNotLast();
- }
-
- public String disableName() {
- return disableToConfirmIfLast();
- }
-
- // }}
-
- // {{ Approver
- private Approver approver;
-
- @MemberOrder(sequence = "2")
- @Optional
- public Approver getApprover() {
- return approver;
- }
-
- public void setApprover(final Approver approver) {
- this.approver = approver;
- }
-
- public boolean hideApprover() {
- return !state.equals("page2") && isNotLast();
- }
-
- public String disableApprover() {
- return disableToConfirmIfLast();
- }
-
- // }}
-
- // {{ next
- @MemberOrder(sequence = "1")
- public EmployeeTakeOn next() {
- if (state.equals("page1")) {
- state = "page2";
- } else if (state.equals("page2")) {
- state = "page3";
- }
- return this;
- }
-
- public boolean hideNext() {
- return isLast();
- }
-
- // }}
-
- // {{ finish
- @MemberOrder(sequence = "2")
- public Employee finish() {
- final Employee employee = newTransientInstance(Employee.class);
- employee.setName(getName());
- employee.setDefaultApprover(approver);
- persist(employee);
- return employee;
- }
-
- public boolean hideFinish() {
- return isNotLast();
- }
-
- // }}
-
- // {{ State
- private String state;
-
- @MemberOrder(sequence = "1")
- @Hidden
- public String getState() {
- return state;
- }
-
- public void setState(final String state) {
- this.state = state;
- }
-
- // }}
-
- // {{ NotLast
- @MemberOrder(sequence = "1")
- @Hidden
- public boolean isNotLast() {
- return !isLast();
- }
-
- // }}
-
- // {{ Last
- @MemberOrder(sequence = "1")
- @Hidden
- public boolean isLast() {
- return state.equals("page3");
- }
-
- private String disableToConfirmIfLast() {
- return isLast() ? "confirm" : null;
- }
- // }}
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/Claim.gif
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/Claim.gif b/examples/claims/dom/src/main/resources/images/Claim.gif
deleted file mode 100644
index abe8c9c..0000000
Binary files a/examples/claims/dom/src/main/resources/images/Claim.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/ClaimItem.gif
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/ClaimItem.gif b/examples/claims/dom/src/main/resources/images/ClaimItem.gif
deleted file mode 100644
index 8ec80df..0000000
Binary files a/examples/claims/dom/src/main/resources/images/ClaimItem.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/ClaimRepository.gif
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/ClaimRepository.gif b/examples/claims/dom/src/main/resources/images/ClaimRepository.gif
deleted file mode 100644
index a5fc6ff..0000000
Binary files a/examples/claims/dom/src/main/resources/images/ClaimRepository.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/Employee.gif
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/Employee.gif b/examples/claims/dom/src/main/resources/images/Employee.gif
deleted file mode 100644
index b2015dc..0000000
Binary files a/examples/claims/dom/src/main/resources/images/Employee.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/EmployeeRepository.gif
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/EmployeeRepository.gif b/examples/claims/dom/src/main/resources/images/EmployeeRepository.gif
deleted file mode 100644
index dde9be8..0000000
Binary files a/examples/claims/dom/src/main/resources/images/EmployeeRepository.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/FredSmith.jpg
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/FredSmith.jpg b/examples/claims/dom/src/main/resources/images/FredSmith.jpg
deleted file mode 100644
index 1f5c7ea..0000000
Binary files a/examples/claims/dom/src/main/resources/images/FredSmith.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/SamJones.jpg
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/SamJones.jpg b/examples/claims/dom/src/main/resources/images/SamJones.jpg
deleted file mode 100644
index 6aeadde..0000000
Binary files a/examples/claims/dom/src/main/resources/images/SamJones.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/dom/src/main/resources/images/TomBrown.jpg
----------------------------------------------------------------------
diff --git a/examples/claims/dom/src/main/resources/images/TomBrown.jpg b/examples/claims/dom/src/main/resources/images/TomBrown.jpg
deleted file mode 100644
index e24f534..0000000
Binary files a/examples/claims/dom/src/main/resources/images/TomBrown.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/examples/claims/fixture/pom.xml b/examples/claims/fixture/pom.xml
deleted file mode 100644
index 68979b3..0000000
--- a/examples/claims/fixture/pom.xml
+++ /dev/null
@@ -1,39 +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.examples.apps</groupId>
- <artifactId>claims</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>claims-fixture</artifactId>
- <name>Example Claims App Fixtures</name>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>claims-objstore-dflt</artifactId>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsFixture.java
----------------------------------------------------------------------
diff --git a/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsFixture.java b/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsFixture.java
deleted file mode 100644
index 8ca0ece..0000000
--- a/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsFixture.java
+++ /dev/null
@@ -1,82 +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.example.claims.fixture;
-
-import org.apache.isis.applib.fixtures.AbstractFixture;
-import org.apache.isis.applib.value.Date;
-import org.apache.isis.applib.value.Money;
-import org.apache.isis.example.claims.dom.claim.Claim;
-import org.apache.isis.example.claims.dom.claim.ClaimItem;
-import org.apache.isis.example.claims.dom.employee.Employee;
-
-public class ClaimsFixture extends AbstractFixture {
-
- @Override
- public void install() {
- final Employee fred = createEmployee("Fred Smith", null);
- final Employee tom = createEmployee("Tom Brown", fred);
- createEmployee("Sam Jones", fred);
-
- Claim claim = createClaim(tom, -16, "Meeting with client");
- addItem(claim, -16, 38.50, "Lunch with client");
- addItem(claim, -16, 16.50, "Euston - Mayfair (return)");
-
- claim = createClaim(tom, -18, "Meeting in city office");
- addItem(claim, -16, 18.00, "Car parking");
- addItem(claim, -16, 26.50, "Reading - London (return)");
-
- claim = createClaim(fred, -14, "Meeting at clients");
- addItem(claim, -14, 18.00, "Car parking");
- addItem(claim, -14, 26.50, "Reading - London (return)");
-
- }
-
- private Employee createEmployee(final String name, final Employee approver) {
- Employee claimant;
- claimant = newTransientInstance(Employee.class);
- claimant.setName(name);
- claimant.setDefaultApprover(approver);
- persist(claimant);
- return claimant;
- }
-
- private Claim createClaim(final Employee claimant, final int days, final String description) {
- final Claim claim = newTransientInstance(Claim.class);
- claim.setClaimant(claimant);
- claim.setDescription(description);
- Date date = new Date();
- date = date.add(0, 0, days);
- claim.setDate(date);
- persist(claim);
- return claim;
- }
-
- private void addItem(final Claim claim, final int days, final double amount, final String description) {
- final ClaimItem claimItem = newTransientInstance(ClaimItem.class);
- Date date = new Date();
- date = date.add(0, 0, days);
- claimItem.setDateIncurred(date);
- claimItem.setDescription(description);
- claimItem.setAmount(new Money(amount, "USD"));
- persist(claimItem);
- claim.addToItems(claimItem);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsLogonFixture.java
----------------------------------------------------------------------
diff --git a/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsLogonFixture.java b/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsLogonFixture.java
deleted file mode 100644
index 6986be4..0000000
--- a/examples/claims/fixture/src/main/java/org/apache/isis/example/claims/fixture/ClaimsLogonFixture.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 org.apache.isis.example.claims.fixture;
-
-import org.apache.isis.applib.fixtures.LogonFixture;
-
-public class ClaimsLogonFixture extends LogonFixture {
-
- public ClaimsLogonFixture() {
- super("bill");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/objstore-default/pom.xml
----------------------------------------------------------------------
diff --git a/examples/claims/objstore-default/pom.xml b/examples/claims/objstore-default/pom.xml
deleted file mode 100644
index 471de3e..0000000
--- a/examples/claims/objstore-default/pom.xml
+++ /dev/null
@@ -1,42 +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.examples.apps</groupId>
- <artifactId>claims</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>claims-objstore-dflt</artifactId>
- <name>Example Claims App Repositories (for ObjectStore Default)</name>
-
- <dependencies>
-
- <!-- other modules in this project -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>claims-dom</artifactId>
- </dependency>
-
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java
----------------------------------------------------------------------
diff --git a/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java b/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java
deleted file mode 100644
index 3497cb0..0000000
--- a/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java
+++ /dev/null
@@ -1,136 +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.example.claims.objstore.dflt.claim;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.filter.Filter;
-import org.apache.isis.applib.value.Date;
-import org.apache.isis.example.claims.dom.claim.Claim;
-import org.apache.isis.example.claims.dom.claim.ClaimRepository;
-import org.apache.isis.example.claims.dom.claim.Claimant;
-
-public class ClaimRepositoryDefault extends AbstractFactoryAndRepository implements ClaimRepository {
-
- // {{ Id, iconName
- @Override
- public String getId() {
- return "claims";
- }
-
- public String iconName() {
- return "ClaimRepository";
- }
-
- // }}
-
- // {{ action: allClaims
- @Override
- public List<Claim> allClaims() {
- return allInstances(Claim.class);
- }
-
- // }}
-
- // {{ action: findClaims
- @Override
- public List<Claim> findClaims(final String description) {
- return allMatches(Claim.class, description);
- }
-
- // }}
-
- // {{ action: claimsFor
- @Override
- public List<Claim> claimsFor(final Claimant claimant) {
- final Claim pattern = newTransientInstance(Claim.class);
- pattern.setDescription(null);
- pattern.setApprover(null);
- pattern.setStatus(null);
- pattern.setDate(null);
- pattern.setClaimant(claimant);
- return allMatches(Claim.class, pattern);
- }
-
- // }}
-
- // {{ action: newClaim
- @Override
- public Claim newClaim(final Claimant claimant) {
- final Claim claim = newTransientInstance(Claim.class);
- if (claimant != null) {
- claim.setClaimant(claimant);
- claim.setApprover(claimant.getDefaultApprover());
- }
- return claim;
- }
-
- // }}
-
- // {{ action: newClaimWithDescription
- @Override
- public Claim newClaimWithDescription(final Claimant claimant, final String description) {
- final Claim claim = newClaim(claimant);
- claim.setDescription(description);
- return claim;
- }
-
- // }}
-
- // {{ action: claimsSince
- @Override
- public List<Claim> claimsSince(final Claimant claimant, final Date since) {
- return allMatches(Claim.class, new Filter<Claim>() {
-
- @Override
- public boolean accept(final Claim pojo) {
- return pojo.getClaimant() == claimant && pojo.getDate() != null && pojo.getDate().isGreaterThan(since);
- }
- });
- }
-
- public String validateClaimsSince(final Claimant claimant, final Date since) {
- final Date today = new Date();
- return since.isGreaterThan(today) ? "cannot be after today" : null;
- }
-
- // }}
-
- @Override
- public int countClaimsFor(final Claimant claimant) {
- return claimsFor(claimant).size();
- }
-
- @Override
- public Claim mostRecentClaim(final Claimant claimant) {
- final List<Claim> claims = claimsFor(claimant);
- Collections.sort(claims, new Comparator<Claim>() {
- @Override
- public int compare(final Claim o1, final Claim o2) {
- return o1.getDate().isLessThan(o2.getDate()) ? +1 : -1;
- }
- });
- return claims.size() > 0 ? claims.get(0) : null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java
----------------------------------------------------------------------
diff --git a/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java b/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java
deleted file mode 100644
index 2454157..0000000
--- a/examples/claims/objstore-default/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java
+++ /dev/null
@@ -1,62 +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.example.claims.objstore.dflt.employee;
-
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.example.claims.dom.employee.Employee;
-import org.apache.isis.example.claims.dom.employee.EmployeeRepository;
-import org.apache.isis.example.claims.dom.employee.EmployeeTakeOn;
-
-public class EmployeeRepositoryDefault extends AbstractFactoryAndRepository implements EmployeeRepository {
-
- // {{ Id, iconName
- @Override
- public String getId() {
- return "claimants";
- }
-
- public String iconName() {
- return "EmployeeRepository";
- }
-
- // }}
-
- // {{ action: allEmployees
- @Override
- public List<Employee> allEmployees() {
- return allInstances(Employee.class);
- }
-
- // }}
-
- // {{ action: findEmployees
- @Override
- public List<Employee> findEmployees(final String name) {
- return allMatches(Employee.class, name);
- }
-
- // }}
- @Override
- public EmployeeTakeOn newEmployee() {
- return newTransientInstance(EmployeeTakeOn.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/objstore-jdo/pom.xml
----------------------------------------------------------------------
diff --git a/examples/claims/objstore-jdo/pom.xml b/examples/claims/objstore-jdo/pom.xml
deleted file mode 100644
index e7ad3c9..0000000
--- a/examples/claims/objstore-jdo/pom.xml
+++ /dev/null
@@ -1,53 +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.examples.apps</groupId>
- <artifactId>claims</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>claims-objstore-jdo</artifactId>
- <name>Example Claims App Repositories (for JDO ObjectStore)</name>
-
- <dependencies>
-
- <!-- other modules in this project -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>claims-dom</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.runtimes.dflt.objectstores</groupId>
- <artifactId>jdo-datanucleus</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.6.4</version>
- </dependency>
-
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java
----------------------------------------------------------------------
diff --git a/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java b/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java
deleted file mode 100644
index 3497cb0..0000000
--- a/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/claim/ClaimRepositoryDefault.java
+++ /dev/null
@@ -1,136 +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.example.claims.objstore.dflt.claim;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.filter.Filter;
-import org.apache.isis.applib.value.Date;
-import org.apache.isis.example.claims.dom.claim.Claim;
-import org.apache.isis.example.claims.dom.claim.ClaimRepository;
-import org.apache.isis.example.claims.dom.claim.Claimant;
-
-public class ClaimRepositoryDefault extends AbstractFactoryAndRepository implements ClaimRepository {
-
- // {{ Id, iconName
- @Override
- public String getId() {
- return "claims";
- }
-
- public String iconName() {
- return "ClaimRepository";
- }
-
- // }}
-
- // {{ action: allClaims
- @Override
- public List<Claim> allClaims() {
- return allInstances(Claim.class);
- }
-
- // }}
-
- // {{ action: findClaims
- @Override
- public List<Claim> findClaims(final String description) {
- return allMatches(Claim.class, description);
- }
-
- // }}
-
- // {{ action: claimsFor
- @Override
- public List<Claim> claimsFor(final Claimant claimant) {
- final Claim pattern = newTransientInstance(Claim.class);
- pattern.setDescription(null);
- pattern.setApprover(null);
- pattern.setStatus(null);
- pattern.setDate(null);
- pattern.setClaimant(claimant);
- return allMatches(Claim.class, pattern);
- }
-
- // }}
-
- // {{ action: newClaim
- @Override
- public Claim newClaim(final Claimant claimant) {
- final Claim claim = newTransientInstance(Claim.class);
- if (claimant != null) {
- claim.setClaimant(claimant);
- claim.setApprover(claimant.getDefaultApprover());
- }
- return claim;
- }
-
- // }}
-
- // {{ action: newClaimWithDescription
- @Override
- public Claim newClaimWithDescription(final Claimant claimant, final String description) {
- final Claim claim = newClaim(claimant);
- claim.setDescription(description);
- return claim;
- }
-
- // }}
-
- // {{ action: claimsSince
- @Override
- public List<Claim> claimsSince(final Claimant claimant, final Date since) {
- return allMatches(Claim.class, new Filter<Claim>() {
-
- @Override
- public boolean accept(final Claim pojo) {
- return pojo.getClaimant() == claimant && pojo.getDate() != null && pojo.getDate().isGreaterThan(since);
- }
- });
- }
-
- public String validateClaimsSince(final Claimant claimant, final Date since) {
- final Date today = new Date();
- return since.isGreaterThan(today) ? "cannot be after today" : null;
- }
-
- // }}
-
- @Override
- public int countClaimsFor(final Claimant claimant) {
- return claimsFor(claimant).size();
- }
-
- @Override
- public Claim mostRecentClaim(final Claimant claimant) {
- final List<Claim> claims = claimsFor(claimant);
- Collections.sort(claims, new Comparator<Claim>() {
- @Override
- public int compare(final Claim o1, final Claim o2) {
- return o1.getDate().isLessThan(o2.getDate()) ? +1 : -1;
- }
- });
- return claims.size() > 0 ? claims.get(0) : null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java
----------------------------------------------------------------------
diff --git a/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java b/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java
deleted file mode 100644
index 2454157..0000000
--- a/examples/claims/objstore-jdo/src/main/java/org/apache/isis/example/claims/objstore/dflt/employee/EmployeeRepositoryDefault.java
+++ /dev/null
@@ -1,62 +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.example.claims.objstore.dflt.employee;
-
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.example.claims.dom.employee.Employee;
-import org.apache.isis.example.claims.dom.employee.EmployeeRepository;
-import org.apache.isis.example.claims.dom.employee.EmployeeTakeOn;
-
-public class EmployeeRepositoryDefault extends AbstractFactoryAndRepository implements EmployeeRepository {
-
- // {{ Id, iconName
- @Override
- public String getId() {
- return "claimants";
- }
-
- public String iconName() {
- return "EmployeeRepository";
- }
-
- // }}
-
- // {{ action: allEmployees
- @Override
- public List<Employee> allEmployees() {
- return allInstances(Employee.class);
- }
-
- // }}
-
- // {{ action: findEmployees
- @Override
- public List<Employee> findEmployees(final String name) {
- return allMatches(Employee.class, name);
- }
-
- // }}
- @Override
- public EmployeeTakeOn newEmployee() {
- return newTransientInstance(EmployeeTakeOn.class);
- }
-}