You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/09/25 11:52:26 UTC
[7/7] git commit: ISIS-887: mothballed the core/module* modules,
moved to mothballed/core/module*
ISIS-887: mothballed the core/module* modules, moved to mothballed/core/module*
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/790e70df
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/790e70df
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/790e70df
Branch: refs/heads/master
Commit: 790e70df12920ddc52b08ceea3ebab3a190e3db1
Parents: fa1876c
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Sep 25 10:35:31 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Sep 25 10:35:31 2014 +0100
----------------------------------------------------------------------
core/module-audit-jdo/.gitignore | 1 -
core/module-audit-jdo/pom.xml | 149 ----
.../src/main/java/META-INF/persistence.xml | 26 -
.../jdo/applib/service/audit/AuditEntryJdo.java | 359 ---------
.../service/audit/AuditingServiceJdo.java | 56 --
.../audit/AuditingServiceJdoContributions.java | 55 --
.../audit/AuditingServiceJdoRepository.java | 129 ----
.../src/main/resources/images/AuditEntryJdo.png | Bin 477 -> 0 bytes
core/module-command-jdo/.gitignore | 1 -
core/module-command-jdo/pom.xml | 162 ----
.../src/main/java/META-INF/persistence.xml | 26 -
.../background/BackgroundCommandServiceJdo.java | 89 ---
...ackgroundCommandServiceJdoContributions.java | 73 --
.../BackgroundCommandServiceJdoRepository.java | 70 --
.../jdo/applib/service/command/CommandJdo.java | 740 -------------------
.../service/command/CommandServiceJdo.java | 119 ---
.../command/CommandServiceJdoContributions.java | 70 --
.../command/CommandServiceJdoRepository.java | 169 -----
...xecutionFromBackgroundCommandServiceJdo.java | 49 --
.../src/main/resources/images/CommandJdo.png | Bin 582 -> 0 bytes
.../service/command/CommandJdoTest_next.java | 43 --
core/module-devutils/.gitignore | 1 -
core/module-devutils/applib/.gitignore | 1 -
core/module-devutils/applib/pom.xml | 55 --
.../devutils/DeveloperUtilitiesService.java | 75 --
core/module-devutils/impl/.gitignore | 1 -
core/module-devutils/impl/pom.xml | 61 --
.../DeveloperUtilitiesServiceDefault.java | 223 ------
.../services/devutils/MetaModelRow.java | 234 ------
core/module-devutils/pom.xml | 94 ---
core/module-publishing-jdo/.gitignore | 1 -
core/module-publishing-jdo/pom.xml | 147 ----
.../src/main/java/META-INF/persistence.xml | 26 -
.../jdo/applib/service/publish/IoUtils.java | 126 ----
.../service/publish/PublishedEventJdo.java | 490 ------------
.../service/publish/PublishedEventJdoPK.java | 102 ---
.../service/publish/PublishingServiceJdo.java | 124 ----
.../PublishingServiceJdoContributions.java | 47 --
.../publish/PublishingServiceJdoRepository.java | 156 ----
.../main/resources/images/PublishedEventJdo.png | Bin 541 -> 0 bytes
.../jdo/applib/service/publish/IoUtilsTest.java | 36 -
.../module-publishingeventserializer-ro/pom.xml | 89 ---
.../EventSerializerRendererContext.java | 95 ---
.../RestfulObjectsSpecEventSerializer.java | 126 ----
.../main/resources/images/PublishedEventJdo.png | Bin 541 -> 0 bytes
core/module-settings/.gitignore | 1 -
core/module-settings/applib/.gitignore | 1 -
core/module-settings/applib/pom.xml | 55 --
.../services/settings/ApplicationSetting.java | 25 -
.../settings/ApplicationSettingsService.java | 34 -
.../settings/ApplicationSettingsServiceRW.java | 38 -
.../isis/applib/services/settings/Setting.java | 53 --
.../services/settings/SettingAbstract.java | 192 -----
.../applib/services/settings/SettingType.java | 28 -
.../applib/services/settings/UserSetting.java | 34 -
.../services/settings/UserSettingsService.java | 36 -
.../settings/UserSettingsServiceRW.java | 38 -
.../services/settings/SettingAbstractTest.java | 103 ---
core/module-settings/impl-jdo/.gitignore | 1 -
core/module-settings/impl-jdo/pom.xml | 146 ----
.../src/main/java/META-INF/persistence.xml | 26 -
.../service/settings/ApplicationSettingJdo.java | 96 ---
.../settings/ApplicationSettingsServiceJdo.java | 120 ---
.../ApplicationSettingsServiceJdoHidden.java | 81 --
.../service/settings/SettingAbstractJdo.java | 190 -----
.../applib/service/settings/UserSettingJdo.java | 129 ----
.../service/settings/UserSettingJdoPK.java | 90 ---
.../settings/UserSettingsServiceJdo.java | 170 -----
.../settings/UserSettingsServiceJdoHidden.java | 88 ---
core/module-settings/pom.xml | 94 ---
mothballed/core/module-audit-jdo/.gitignore | 1 +
mothballed/core/module-audit-jdo/pom.xml | 149 ++++
.../src/main/java/META-INF/persistence.xml | 26 +
.../jdo/applib/service/audit/AuditEntryJdo.java | 359 +++++++++
.../service/audit/AuditingServiceJdo.java | 56 ++
.../audit/AuditingServiceJdoContributions.java | 55 ++
.../audit/AuditingServiceJdoRepository.java | 129 ++++
.../src/main/resources/images/AuditEntryJdo.png | Bin 0 -> 477 bytes
mothballed/core/module-command-jdo/.gitignore | 1 +
mothballed/core/module-command-jdo/pom.xml | 162 ++++
.../src/main/java/META-INF/persistence.xml | 26 +
.../background/BackgroundCommandServiceJdo.java | 89 +++
...ackgroundCommandServiceJdoContributions.java | 73 ++
.../BackgroundCommandServiceJdoRepository.java | 70 ++
.../jdo/applib/service/command/CommandJdo.java | 740 +++++++++++++++++++
.../service/command/CommandServiceJdo.java | 119 +++
.../command/CommandServiceJdoContributions.java | 70 ++
.../command/CommandServiceJdoRepository.java | 169 +++++
...xecutionFromBackgroundCommandServiceJdo.java | 49 ++
.../src/main/resources/images/CommandJdo.png | Bin 0 -> 582 bytes
.../service/command/CommandJdoTest_next.java | 43 ++
mothballed/core/module-devutils/.gitignore | 1 +
.../core/module-devutils/applib/.gitignore | 1 +
mothballed/core/module-devutils/applib/pom.xml | 55 ++
.../devutils/DeveloperUtilitiesService.java | 75 ++
mothballed/core/module-devutils/impl/.gitignore | 1 +
mothballed/core/module-devutils/impl/pom.xml | 61 ++
.../DeveloperUtilitiesServiceDefault.java | 223 ++++++
.../services/devutils/MetaModelRow.java | 234 ++++++
mothballed/core/module-devutils/pom.xml | 94 +++
.../core/module-publishing-jdo/.gitignore | 1 +
mothballed/core/module-publishing-jdo/pom.xml | 147 ++++
.../src/main/java/META-INF/persistence.xml | 26 +
.../jdo/applib/service/publish/IoUtils.java | 126 ++++
.../service/publish/PublishedEventJdo.java | 490 ++++++++++++
.../service/publish/PublishedEventJdoPK.java | 102 +++
.../service/publish/PublishingServiceJdo.java | 124 ++++
.../PublishingServiceJdoContributions.java | 47 ++
.../publish/PublishingServiceJdoRepository.java | 156 ++++
.../main/resources/images/PublishedEventJdo.png | Bin 0 -> 541 bytes
.../jdo/applib/service/publish/IoUtilsTest.java | 36 +
.../module-publishingeventserializer-ro/pom.xml | 89 +++
.../EventSerializerRendererContext.java | 95 +++
.../RestfulObjectsSpecEventSerializer.java | 126 ++++
.../main/resources/images/PublishedEventJdo.png | Bin 0 -> 541 bytes
mothballed/core/module-settings/.gitignore | 1 +
.../core/module-settings/applib/.gitignore | 1 +
mothballed/core/module-settings/applib/pom.xml | 55 ++
.../services/settings/ApplicationSetting.java | 25 +
.../settings/ApplicationSettingsService.java | 34 +
.../settings/ApplicationSettingsServiceRW.java | 38 +
.../isis/applib/services/settings/Setting.java | 53 ++
.../services/settings/SettingAbstract.java | 192 +++++
.../applib/services/settings/SettingType.java | 28 +
.../applib/services/settings/UserSetting.java | 34 +
.../services/settings/UserSettingsService.java | 36 +
.../settings/UserSettingsServiceRW.java | 38 +
.../services/settings/SettingAbstractTest.java | 103 +++
.../core/module-settings/impl-jdo/.gitignore | 1 +
.../core/module-settings/impl-jdo/pom.xml | 146 ++++
.../src/main/java/META-INF/persistence.xml | 26 +
.../service/settings/ApplicationSettingJdo.java | 96 +++
.../settings/ApplicationSettingsServiceJdo.java | 120 +++
.../ApplicationSettingsServiceJdoHidden.java | 81 ++
.../service/settings/SettingAbstractJdo.java | 190 +++++
.../applib/service/settings/UserSettingJdo.java | 129 ++++
.../service/settings/UserSettingJdoPK.java | 90 +++
.../settings/UserSettingsServiceJdo.java | 170 +++++
.../settings/UserSettingsServiceJdoHidden.java | 88 +++
mothballed/core/module-settings/pom.xml | 94 +++
140 files changed, 6565 insertions(+), 6565 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/.gitignore
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/.gitignore b/core/module-audit-jdo/.gitignore
deleted file mode 100644
index a48e45b..0000000
--- a/core/module-audit-jdo/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target-ide
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/pom.xml
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/pom.xml b/core/module-audit-jdo/pom.xml
deleted file mode 100644
index cebf10c..0000000
--- a/core/module-audit-jdo/pom.xml
+++ /dev/null
@@ -1,149 +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.core</groupId>
- <artifactId>isis</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.apache.isis.module</groupId>
- <artifactId>isis-module-audit-jdo</artifactId>
-
- <name>Isis Module: Audit (JDO Implementation)</name>
- <description>
- AuditingService implementation that persists audit entries to
- database (via JDO objectstore).
- </description>
-
- <properties>
- <siteBaseDir>..</siteBaseDir>
- <relativeUrl>module-audit/</relativeUrl>
- </properties>
-
- <url>http://isis.apache.org/${relativeUrl}</url>
-
- <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>
- <verbose>true</verbose>
- </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 />
- </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>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <!-- DataNucleus (jdo-api, and for enhancer) -->
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-accessplatform-jdo-rdbms</artifactId>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-jodatime</artifactId>
- </dependency>
-
- </dependencies>
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/src/main/java/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/src/main/java/META-INF/persistence.xml b/core/module-audit-jdo/src/main/java/META-INF/persistence.xml
deleted file mode 100644
index ded7c39..0000000
--- a/core/module-audit-jdo/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="isis-module-audit-jdo">
- </persistence-unit>
-</persistence>
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java b/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
deleted file mode 100644
index 05592db..0000000
--- a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
+++ /dev/null
@@ -1,359 +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.objectstore.jdo.applib.service.audit;
-
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
-import java.util.UUID;
-
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.Index;
-import javax.jdo.annotations.Indices;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.ActionSemantics;
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.Disabled;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.Immutable;
-import org.apache.isis.applib.annotation.MemberGroupLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.ObjectType;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.TypicalLength;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.services.HasTransactionId;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.applib.util.TitleBuffer;
-import org.apache.isis.objectstore.jdo.applib.service.DomainChangeJdoAbstract;
-import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-import org.apache.isis.objectstore.jdo.applib.service.Util;
-
-@javax.jdo.annotations.PersistenceCapable(
- identityType=IdentityType.DATASTORE,
- table="IsisAuditEntry")
-@javax.jdo.annotations.DatastoreIdentity(
- strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
- column="id")
-@javax.jdo.annotations.Queries( {
- @javax.jdo.annotations.Query(
- name="findByTransactionId", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE transactionId == :transactionId"),
- @javax.jdo.annotations.Query(
- name="findByTargetAndTimestampBetween", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "&& timestamp >= :from "
- + "&& timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTargetAndTimestampAfter", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "&& timestamp >= :from "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTargetAndTimestampBefore", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "&& timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTarget", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTimestampBetween", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE timestamp >= :from "
- + "&& timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTimestampAfter", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE timestamp >= :from "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTimestampBefore", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="find", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "ORDER BY timestamp DESC")
-})
-@Indices({
- @Index(name="IsisAuditEntry_ak", unique="true",
- columns={
- @javax.jdo.annotations.Column(name="transactionId"),
- @javax.jdo.annotations.Column(name="target"),
- @javax.jdo.annotations.Column(name="propertyId")
- })
-})
-@Immutable
-@Named("Audit Entry")
-@ObjectType("IsisAuditEntry")
-@MemberGroupLayout(
- columnSpans={6,0,6},
- left={"Identifiers","Target"},
- right={"Detail"})
-public class AuditEntryJdo extends DomainChangeJdoAbstract implements HasTransactionId {
-
- public AuditEntryJdo() {
- super(ChangeType.AUDIT_ENTRY);
- }
-
- // //////////////////////////////////////
- // Identification
- // //////////////////////////////////////
-
- public String title() {
- final TitleBuffer buf = new TitleBuffer();
- buf.append(
- new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(getTimestamp()));
- buf.append(",", getUser());
- buf.append(":", getTargetStr());
- buf.append(" ", getMemberIdentifier());
- return buf.toString();
- }
-
-
- // //////////////////////////////////////
- // user (property)
- // //////////////////////////////////////
-
- private String user;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.USER_NAME)
- @Hidden(where=Where.PARENTED_TABLES)
- @MemberOrder(name="Identifiers",sequence = "10")
- public String getUser() {
- return user;
- }
-
- public void setUser(final String user) {
- this.user = user;
- }
-
-
- // //////////////////////////////////////
- // timestamp (property)
- // //////////////////////////////////////
-
- private Timestamp timestamp;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- @Hidden(where=Where.PARENTED_TABLES)
- @MemberOrder(name="Identifiers",sequence = "20")
- public Timestamp getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(final Timestamp timestamp) {
- this.timestamp = timestamp;
- }
-
-
-
-
- // //////////////////////////////////////
- // transactionId (property)
- // //////////////////////////////////////
-
- private UUID transactionId;
-
- /**
- * The unique identifier (a GUID) of the transaction in which this audit entry was persisted.
- *
- * <p>
- * The combination of ({@link #getTransactionId() transactionId}, {@link #getTargetStr() target}, {@link #getPropertyId() propertyId} ) makes up the
- * (non-enforced) alternative key.
- */
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
- @TypicalLength(36)
- @MemberOrder(name="Identifiers",sequence = "30")
- @Hidden(where=Where.PARENTED_TABLES)
- @Disabled
- @Override
- public UUID getTransactionId() {
- return transactionId;
- }
-
- @Override
- public void setTransactionId(final UUID transactionId) {
- this.transactionId = transactionId;
- }
-
-
- // //////////////////////////////////////
- // targetClass (property)
- // //////////////////////////////////////
-
- private String targetClass;
-
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.TARGET_CLASS)
- @TypicalLength(30)
- @MemberOrder(name="Target", sequence = "10")
- @Named("Class")
- public String getTargetClass() {
- return targetClass;
- }
-
- public void setTargetClass(final String targetClass) {
- this.targetClass = Util.abbreviated(targetClass, JdoColumnLength.TARGET_CLASS);
- }
-
-
- // //////////////////////////////////////
- // target (property)
- // openTargetObject (action)
- // //////////////////////////////////////
-
- private String targetStr;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.BOOKMARK, name="target")
- @Named("Object")
- @MemberOrder(name="Target", sequence="30")
- public String getTargetStr() {
- return targetStr;
- }
-
- public void setTargetStr(final String targetStr) {
- this.targetStr = targetStr;
- }
-
-
- // //////////////////////////////////////
- // memberIdentifier (property)
- // //////////////////////////////////////
-
- private String memberIdentifier;
-
- /**
- * This is the fully-qualified class and property Id, as per
- * {@link Identifier#toClassAndNameIdentityString()}.
- */
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.MEMBER_IDENTIFIER)
- @TypicalLength(60)
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Detail",sequence = "1")
- public String getMemberIdentifier() {
- return memberIdentifier;
- }
-
- public void setMemberIdentifier(final String memberIdentifier) {
- this.memberIdentifier = Util.abbreviated(memberIdentifier, JdoColumnLength.MEMBER_IDENTIFIER);
- }
-
-
- // //////////////////////////////////////
- // propertyId (property)
- // //////////////////////////////////////
-
- private String propertyId;
-
- /**
- * This is the property name (without the class).
- */
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.AuditEntry.PROPERTY_ID)
- @Hidden(where=Where.NOWHERE)
- @MemberOrder(name="Target",sequence = "20")
- public String getPropertyId() {
- return propertyId;
- }
-
- public void setPropertyId(final String propertyId) {
- this.propertyId = Util.abbreviated(propertyId, JdoColumnLength.AuditEntry.PROPERTY_ID);
- }
-
-
- // //////////////////////////////////////
- // preValue (property)
- // //////////////////////////////////////
-
- private String preValue;
-
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.AuditEntry.PROPERTY_VALUE)
- @Hidden(where=Where.NOWHERE)
- @MemberOrder(name="Detail",sequence = "6")
- public String getPreValue() {
- return preValue;
- }
-
- public void setPreValue(final String preValue) {
- this.preValue = Util.abbreviated(preValue, JdoColumnLength.AuditEntry.PROPERTY_VALUE);
- }
-
-
- // //////////////////////////////////////
- // postValue (property)
- // //////////////////////////////////////
-
- private String postValue;
-
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.AuditEntry.PROPERTY_VALUE)
- @Hidden(where=Where.NOWHERE)
- @MemberOrder(name="Detail",sequence = "7")
- public String getPostValue() {
- return postValue;
- }
-
- public void setPostValue(final String postValue) {
- this.postValue = Util.abbreviated(postValue, JdoColumnLength.AuditEntry.PROPERTY_VALUE);
- }
-
-
-
- // //////////////////////////////////////
- // toString
- // //////////////////////////////////////
-
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "timestamp,user,targetStr,memberIdentifier");
- }
-
-
- // //////////////////////////////////////
- // Injected services
- // //////////////////////////////////////
-
-
- @javax.inject.Inject
- private BookmarkService bookmarkService;
-
- @javax.inject.Inject
- private DomainObjectContainer container;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdo.java
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdo.java b/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdo.java
deleted file mode 100644
index 54a0211..0000000
--- a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdo.java
+++ /dev/null
@@ -1,56 +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.objectstore.jdo.applib.service.audit;
-
-import java.util.UUID;
-import org.apache.isis.applib.AbstractService;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.audit.AuditingService3;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-
-@DomainService
-public class AuditingServiceJdo extends AbstractService implements AuditingService3 {
-
- @Programmatic
- public void audit(
- final UUID transactionId, String targetClass, final Bookmark target,
- String memberIdentifier, final String propertyId,
- final String preValue, final String postValue,
- final String user, final java.sql.Timestamp timestamp) {
-
- final AuditEntryJdo auditEntry = newTransientInstance(AuditEntryJdo.class);
-
- auditEntry.setTimestamp(timestamp);
- auditEntry.setUser(user);
- auditEntry.setTransactionId(transactionId);
-
- auditEntry.setTargetClass(targetClass);
- auditEntry.setTarget(target);
-
- auditEntry.setMemberIdentifier(memberIdentifier);
- auditEntry.setPropertyId(propertyId);
-
- auditEntry.setPreValue(preValue);
- auditEntry.setPostValue(postValue);
-
- persistIfNotAlready(auditEntry);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoContributions.java
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoContributions.java b/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoContributions.java
deleted file mode 100644
index 9fca7d7..0000000
--- a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoContributions.java
+++ /dev/null
@@ -1,55 +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.objectstore.jdo.applib.service.audit;
-
-import java.util.List;
-
-import org.apache.isis.applib.AbstractService;
-import org.apache.isis.applib.annotation.ActionSemantics;
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.NotContributed;
-import org.apache.isis.applib.annotation.NotContributed.As;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.applib.annotation.Render;
-import org.apache.isis.applib.annotation.Render.Type;
-import org.apache.isis.applib.services.HasTransactionId;
-
-/**
- * This service contributes an <tt>auditEntries</tt> collection to any implementation of
- * {@link org.apache.isis.applib.services.HasTransactionId}, in other words commands, audit entries and published
- * events. This allows the user to navigate to other audited effects of the given command.
- *
- * <p>
- * Because this service influences the UI, it must be explicitly registered as a service
- * (eg using <tt>isis.properties</tt>).
- */
-public class AuditingServiceJdoContributions extends AbstractService {
-
- @ActionSemantics(Of.SAFE)
- @NotInServiceMenu
- @NotContributed(As.ACTION) // ie contribute as collection
- @Render(Type.EAGERLY)
- public List<AuditEntryJdo> auditEntries(final HasTransactionId hasTransactionId) {
- return auditEntryRepository.findByTransactionId(hasTransactionId.getTransactionId());
- }
-
- // //////////////////////////////////////
-
- @javax.inject.Inject
- private AuditingServiceJdoRepository auditEntryRepository;
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoRepository.java
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoRepository.java b/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoRepository.java
deleted file mode 100644
index 183628b..0000000
--- a/core/module-audit-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditingServiceJdoRepository.java
+++ /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.
- */
-package org.apache.isis.objectstore.jdo.applib.service.audit;
-
-import java.sql.Timestamp;
-import java.util.List;
-import java.util.UUID;
-
-import org.joda.time.LocalDate;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.query.Query;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-
-/**
- * Provides supporting functionality for querying
- * {@link org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo audit entry} entities.
- *
- * <p>
- * This supporting service with no UI and no side-effects, and is there are no other implementations of the service,
- * thus has been annotated with {@link org.apache.isis.applib.annotation.DomainService}. This means that there is no
- * need to explicitly register it as a service (eg in <tt>isis.properties</tt>).
- */
-@DomainService
-public class AuditingServiceJdoRepository extends AbstractFactoryAndRepository {
-
- @Programmatic
- public List<AuditEntryJdo> findByTransactionId(final UUID transactionId) {
- return allMatches(
- new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTransactionId",
- "transactionId", transactionId));
- }
-
- @Programmatic
- public List<AuditEntryJdo> findByTargetAndFromAndTo(
- final Bookmark target,
- final LocalDate from,
- final LocalDate to) {
- final String targetStr = target.toString();
- final Timestamp fromTs = toTimestampStartOfDayWithOffset(from, 0);
- final Timestamp toTs = toTimestampStartOfDayWithOffset(to, 1);
-
- final Query<AuditEntryJdo> query;
- if(from != null) {
- if(to != null) {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTargetAndTimestampBetween",
- "targetStr", targetStr,
- "from", fromTs,
- "to", toTs);
- } else {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTargetAndTimestampAfter",
- "targetStr", targetStr,
- "from", fromTs);
- }
- } else {
- if(to != null) {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTargetAndTimestampBefore",
- "targetStr", targetStr,
- "to", toTs);
- } else {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTarget",
- "targetStr", targetStr);
- }
- }
- return allMatches(query);
- }
-
- @Programmatic
- public List<AuditEntryJdo> findByFromAndTo(
- final LocalDate from,
- final LocalDate to) {
- final Timestamp fromTs = toTimestampStartOfDayWithOffset(from, 0);
- final Timestamp toTs = toTimestampStartOfDayWithOffset(to, 1);
-
- final Query<AuditEntryJdo> query;
- if(from != null) {
- if(to != null) {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTimestampBetween",
- "from", fromTs,
- "to", toTs);
- } else {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTimestampAfter",
- "from", fromTs);
- }
- } else {
- if(to != null) {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "findByTimestampBefore",
- "to", toTs);
- } else {
- query = new QueryDefault<AuditEntryJdo>(AuditEntryJdo.class,
- "find");
- }
- }
- return allMatches(query);
- }
-
- private static Timestamp toTimestampStartOfDayWithOffset(final LocalDate dt, int daysOffset) {
- return dt!=null
- ?new java.sql.Timestamp(dt.toDateTimeAtStartOfDay().plusDays(daysOffset).getMillis())
- :null;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-audit-jdo/src/main/resources/images/AuditEntryJdo.png
----------------------------------------------------------------------
diff --git a/core/module-audit-jdo/src/main/resources/images/AuditEntryJdo.png b/core/module-audit-jdo/src/main/resources/images/AuditEntryJdo.png
deleted file mode 100644
index 4e4352c..0000000
Binary files a/core/module-audit-jdo/src/main/resources/images/AuditEntryJdo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-command-jdo/.gitignore
----------------------------------------------------------------------
diff --git a/core/module-command-jdo/.gitignore b/core/module-command-jdo/.gitignore
deleted file mode 100644
index a48e45b..0000000
--- a/core/module-command-jdo/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target-ide
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-command-jdo/pom.xml
----------------------------------------------------------------------
diff --git a/core/module-command-jdo/pom.xml b/core/module-command-jdo/pom.xml
deleted file mode 100644
index 199308b..0000000
--- a/core/module-command-jdo/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>org.apache.isis.core</groupId>
- <artifactId>isis</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.apache.isis.module</groupId>
- <artifactId>isis-module-command-jdo</artifactId>
-
- <name>Isis Module: Command (JDO Implementation)</name>
- <description>
- CommandService and BackgroundCommandService implementations that
- persist commands to database (via JDO objectstore) for profiling and
- to support background command execution.
- </description>
-
- <properties>
- <siteBaseDir>..</siteBaseDir>
- <relativeUrl>module-command/</relativeUrl>
- </properties>
-
- <url>http://isis.apache.org/${relativeUrl}</url>
-
- <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>
- <verbose>true</verbose>
- </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 />
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-applib</artifactId>
- </dependency>
- <!-- required because provides subclass implementation of BackgroundCommandExecution -->
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-unittestsupport</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <!-- DataNucleus (jdo-api, and for enhancer) -->
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-accessplatform-jdo-rdbms</artifactId>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-jodatime</artifactId>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.isis.module</groupId>
- <artifactId>isis-module-background</artifactId>
- <!-- optional because may not want to use BackgroundCommandExecutionFromBackgroundCommandServiceJdo -->
- <optional>true</optional>
- </dependency>
-
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-command-jdo/src/main/java/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/core/module-command-jdo/src/main/java/META-INF/persistence.xml b/core/module-command-jdo/src/main/java/META-INF/persistence.xml
deleted file mode 100644
index e6b83a4..0000000
--- a/core/module-command-jdo/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="isis-module-command-jdo">
- </persistence-unit>
-</persistence>
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdo.java
----------------------------------------------------------------------
diff --git a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdo.java b/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdo.java
deleted file mode 100644
index eba9f0a..0000000
--- a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdo.java
+++ /dev/null
@@ -1,89 +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.objectstore.jdo.applib.service.background;
-
-import java.util.UUID;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.isis.applib.AbstractService;
-import org.apache.isis.applib.annotation.Command.ExecuteIn;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.services.background.ActionInvocationMemento;
-import org.apache.isis.applib.services.background.BackgroundCommandService;
-import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo;
-
-/**
- * Persists a {@link ActionInvocationMemento memento-ized} action such that it can be executed asynchronously,
- * for example through a Quartz scheduler (using
- * {@link org.apache.isis.objectstore.jdo.service.BackgroundCommandExecutionFromBackgroundCommandServiceJdo}).
- *
- * <p>
- * This implementation has no UI and there are no other implementations of the service API, and so it annotated
- * with {@link org.apache.isis.applib.annotation.DomainService}. This class is implemented in the
- * <tt>o.a.i.module:isis-module-command-jdo</tt> module. If that module is included in the classpath, it this means
- * that this service is automatically registered; no further configuration is required.
- *
- * <p>
- * (That said, do note that other services in the <tt>o.a.i.module:isis-module-command-jdo</tt> do require explicit
- * registration as services, eg in <tt>isis.properties</tt>).
- */
-@DomainService
-public class BackgroundCommandServiceJdo extends AbstractService implements BackgroundCommandService {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(BackgroundCommandServiceJdo.class);
-
- @Programmatic
- @Override
- public void schedule(
- final ActionInvocationMemento aim,
- final Command parentCommand,
- final String targetClassName,
- final String targetActionName,
- final String targetArgs) {
-
- final UUID transactionId = UUID.randomUUID();
- final String user = parentCommand.getUser();
-
- final CommandJdo backgroundCommand = newTransientInstance(CommandJdo.class);
-
- backgroundCommand.setParent(parentCommand);
-
- backgroundCommand.setTransactionId(transactionId);
-
- backgroundCommand.setUser(user);
- backgroundCommand.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());
-
- backgroundCommand.setExecuteIn(ExecuteIn.BACKGROUND);
-
- backgroundCommand.setTargetClass(targetClassName);
- backgroundCommand.setTargetAction(targetActionName);
- backgroundCommand.setTargetStr(aim.getTarget().toString());
- backgroundCommand.setMemberIdentifier(aim.getActionId());
-
- backgroundCommand.setArguments(targetArgs);
- backgroundCommand.setMemento(aim.asMementoString());
-
- parentCommand.setPersistHint(true);
-
- persist(backgroundCommand);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoContributions.java
----------------------------------------------------------------------
diff --git a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoContributions.java b/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoContributions.java
deleted file mode 100644
index 391975f..0000000
--- a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoContributions.java
+++ /dev/null
@@ -1,73 +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.objectstore.jdo.applib.service.background;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.annotation.ActionSemantics;
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.NotContributed;
-import org.apache.isis.applib.annotation.NotContributed.As;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.applib.annotation.Render;
-import org.apache.isis.applib.annotation.Render.Type;
-import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo;
-
-
-/**
- * This service contributes a <tt>childCommands</tt> collection and a <tt>sublingCommands</tt> collection to
- * any {@link CommandJdo} entity.
- *
- * <p>
- * Because this service influences the UI, it must be explicitly registered as a service
- * (eg using <tt>isis.properties</tt>).
- */
-public class BackgroundCommandServiceJdoContributions extends AbstractFactoryAndRepository {
-
- @ActionSemantics(Of.SAFE)
- @NotInServiceMenu
- @NotContributed(As.ACTION)
- @Render(Type.EAGERLY)
- public List<CommandJdo> childCommands(final CommandJdo parent) {
- return backgroundCommandRepository.findByParent(parent);
- }
-
- @ActionSemantics(Of.SAFE)
- @NotInServiceMenu
- @NotContributed(As.ACTION)
- @Render(Type.EAGERLY)
- public List<CommandJdo> siblingCommands(final CommandJdo siblingCommand) {
- final Command parent = siblingCommand.getParent();
- if(parent == null || !(parent instanceof CommandJdo)) {
- return Collections.emptyList();
- }
- final CommandJdo parentJdo = (CommandJdo) parent;
- final List<CommandJdo> siblingCommands = backgroundCommandRepository.findByParent(parentJdo);
- siblingCommands.remove(siblingCommand);
- return siblingCommands;
- }
-
-
- // //////////////////////////////////////
-
- @javax.inject.Inject
- private BackgroundCommandServiceJdoRepository backgroundCommandRepository;
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoRepository.java
----------------------------------------------------------------------
diff --git a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoRepository.java b/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoRepository.java
deleted file mode 100644
index e41753e..0000000
--- a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundCommandServiceJdoRepository.java
+++ /dev/null
@@ -1,70 +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.objectstore.jdo.applib.service.background;
-
-import java.util.List;
-import java.util.UUID;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo;
-
-/**
- * Provides supporting functionality for querying
- * {@link org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo command} entities that have been persisted
- * to execute in the background.
- *
- * <p>
- * This supporting service with no UI and no side-effects, and is there are no other implementations of the service,
- * thus has been annotated with {@link org.apache.isis.applib.annotation.DomainService}. This means that there is no
- * need to explicitly register it as a service (eg in <tt>isis.properties</tt>).
- */
-@DomainService
-public class BackgroundCommandServiceJdoRepository extends AbstractFactoryAndRepository {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(BackgroundCommandServiceJdoRepository.class);
-
- @Programmatic
- public List<CommandJdo> findByTransactionId(final UUID transactionId) {
- return allMatches(
- new QueryDefault<CommandJdo>(CommandJdo.class,
- "findBackgroundCommandByTransactionId",
- "transactionId", transactionId));
- }
-
- @Programmatic
- public List<CommandJdo> findByParent(CommandJdo parent) {
- return allMatches(
- new QueryDefault<CommandJdo>(CommandJdo.class,
- "findBackgroundCommandsByParent",
- "parent", parent));
- }
-
- @Programmatic
- public List<CommandJdo> findBackgroundCommandsNotYetStarted() {
- return allMatches(
- new QueryDefault<CommandJdo>(CommandJdo.class,
- "findBackgroundCommandsNotYetStarted"));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/790e70df/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdo.java
----------------------------------------------------------------------
diff --git a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdo.java b/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdo.java
deleted file mode 100644
index fb5fabc..0000000
--- a/core/module-command-jdo/src/main/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdo.java
+++ /dev/null
@@ -1,740 +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.objectstore.jdo.applib.service.command;
-
-import java.math.BigDecimal;
-import java.sql.Timestamp;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.NotPersistent;
-
-import com.google.common.collect.Maps;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.ActionSemantics;
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.annotation.Command.ExecuteIn;
-import org.apache.isis.applib.annotation.Command.Persistence;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.Immutable;
-import org.apache.isis.applib.annotation.Mandatory;
-import org.apache.isis.applib.annotation.MemberGroupLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MultiLine;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.ObjectType;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.TypicalLength;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.applib.util.TitleBuffer;
-import org.apache.isis.objectstore.jdo.applib.service.DomainChangeJdoAbstract;
-import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-import org.apache.isis.objectstore.jdo.applib.service.Util;
-import org.apache.isis.objectstore.jdo.applib.service.DomainChangeJdoAbstract.ChangeType;
-
-
-@javax.jdo.annotations.PersistenceCapable(
- identityType=IdentityType.APPLICATION,
- table="IsisCommand")
-@javax.jdo.annotations.Queries( {
- @javax.jdo.annotations.Query(
- name="findByTransactionId", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo "
- + "WHERE transactionId == :transactionId "),
- @javax.jdo.annotations.Query(
- name="findBackgroundCommandByTransactionId", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo "
- + "WHERE transactionId == :transactionId "
- + "&& executeIn == 'BACKGROUND'"),
- @javax.jdo.annotations.Query(
- name="findBackgroundCommandsByParent", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo "
- + "WHERE parent == :parent "
- + "&& executeIn == 'BACKGROUND'"),
- @javax.jdo.annotations.Query(
- name="findBackgroundCommandsNotYetStarted", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo "
- + "WHERE executeIn == 'BACKGROUND' "
- + "&& startedAt == null "
- + "ORDER BY timestamp ASC "
- ),
- @javax.jdo.annotations.Query(
- name="findCurrent", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo "
- + "WHERE completedAt == null "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findCompleted", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo "
- + "WHERE completedAt != null "
- + "&& executeIn == 'FOREGROUND' "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTargetAndTimestampBetween", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "&& timestamp >= :from "
- + "&& timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTargetAndTimestampAfter", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "&& timestamp >= :from "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTargetAndTimestampBefore", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "&& timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTarget", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE targetStr == :targetStr "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTimestampBetween", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE timestamp >= :from "
- + "&& timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTimestampAfter", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE timestamp >= :from "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findByTimestampBefore", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "WHERE timestamp <= :to "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="find", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo "
- + "ORDER BY timestamp DESC")
-})
-@ObjectType("IsisCommand")
-@MemberGroupLayout(
- columnSpans={6,0,6,12},
- left={"Identifiers","Target","Notes"},
- right={"Detail","Timings","Results"})
-@Named("Command")
-@Immutable
-public class CommandJdo extends DomainChangeJdoAbstract implements Command {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(CommandJdo.class);
-
- public CommandJdo() {
- super(ChangeType.COMMAND);
- }
-
-
-
- // //////////////////////////////////////
- // Identification
- // //////////////////////////////////////
-
- public String title() {
- final TitleBuffer buf = new TitleBuffer();
- buf.append(getTargetStr());
- buf.append(" ").append(getMemberIdentifier());
- return buf.toString();
- }
-
-
-
- // //////////////////////////////////////
- // user (property)
- // //////////////////////////////////////
-
- private String user;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.USER_NAME)
- @MemberOrder(name="Identifiers", sequence = "10")
- public String getUser() {
- return user;
- }
-
- public void setUser(final String user) {
- this.user = user;
- }
-
-
-
- // //////////////////////////////////////
- // timestamp (property)
- // //////////////////////////////////////
-
- private Timestamp timestamp;
-
- /**
- * The date/time at which this action was created.
- */
- @javax.jdo.annotations.Persistent
- @javax.jdo.annotations.Column(allowsNull="false")
- @MemberOrder(name="Identifiers", sequence = "20")
- public Timestamp getTimestamp() {
- return timestamp;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- public void setTimestamp(final Timestamp timestamp) {
- this.timestamp = timestamp;
- }
-
-
- // //////////////////////////////////////
- // executor (property)
- // //////////////////////////////////////
-
- private Executor executor;
-
- @Programmatic
- @javax.jdo.annotations.NotPersistent
- @Override
- public Executor getExecutor() {
- return executor;
- }
-
- @Override
- public void setExecutor(Executor nature) {
- this.executor = nature;
- }
-
- // //////////////////////////////////////
- // executeIn (property)
- // //////////////////////////////////////
-
- private ExecuteIn executeIn;
-
- /**
- * Whether the action was invoked explicitly by the user, or scheduled as a background
- * task, or as for some other reason, eg a side-effect of rendering an object due to
- * get-after-post).
- */
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Command.EXECUTE_IN)
- @MemberOrder(name="Identifiers", sequence = "32")
- @Override
- public ExecuteIn getExecuteIn() {
- return executeIn;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- @Override
- public void setExecuteIn(ExecuteIn nature) {
- this.executeIn = nature;
- }
-
-
- // //////////////////////////////////////
- // parent (property)
- // //////////////////////////////////////
-
- private Command parent;
-
- @Override
- @javax.jdo.annotations.Persistent
- @javax.jdo.annotations.Column(name="parentTransactionId", allowsNull="true")
- @Hidden(where=Where.PARENTED_TABLES)
- @MemberOrder(name="Identifiers",sequence = "40")
- public Command getParent() {
- return parent;
- }
-
- @Override
- public void setParent(Command parent) {
- this.parent = parent;
- }
-
-
- // //////////////////////////////////////
- // transactionId (property)
- // //////////////////////////////////////
-
-
- private UUID transactionId;
-
- /**
- * The unique identifier (a GUID) of the transaction in which this command occurred.
- */
- @javax.jdo.annotations.PrimaryKey
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
- @TypicalLength(JdoColumnLength.TRANSACTION_ID)
- @MemberOrder(name="Identifiers",sequence = "50")
- @Override
- public UUID getTransactionId() {
- return transactionId;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: copied over from the Isis transaction when the command is persisted.
- */
- @Override
- public void setTransactionId(final UUID transactionId) {
- this.transactionId = transactionId;
- }
-
-
- // //////////////////////////////////////
- // targetClass (property)
- // //////////////////////////////////////
-
- private String targetClass;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TARGET_CLASS)
- @TypicalLength(30)
- @MemberOrder(name="Target", sequence = "10")
- @Named("Class")
- public String getTargetClass() {
- return targetClass;
- }
-
- public void setTargetClass(final String targetClass) {
- this.targetClass = Util.abbreviated(targetClass, JdoColumnLength.TARGET_CLASS);
- }
-
-
- // //////////////////////////////////////
- // targetAction (property)
- // //////////////////////////////////////
-
- private String targetAction;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TARGET_ACTION)
- @Mandatory
- @Hidden(where=Where.NOWHERE)
- @TypicalLength(30)
- @MemberOrder(name="Target", sequence = "20")
- @Named("Action")
- public String getTargetAction() {
- return targetAction;
- }
-
- public void setTargetAction(final String targetAction) {
- this.targetAction = Util.abbreviated(targetAction, JdoColumnLength.TARGET_ACTION);
- }
-
-
- // //////////////////////////////////////
- // target (property)
- // openTargetObject (action)
- // //////////////////////////////////////
-
- private String targetStr;
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.BOOKMARK, name="target")
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Target", sequence="30")
- @Named("Object")
- public String getTargetStr() {
- return targetStr;
- }
-
- public void setTargetStr(final String targetStr) {
- this.targetStr = targetStr;
- }
-
- // //////////////////////////////////////
- // arguments (property)
- // //////////////////////////////////////
-
- private String arguments;
-
- @javax.jdo.annotations.Column(allowsNull="true", jdbcType="CLOB")
- @MultiLine(numberOfLines=7)
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Target",sequence = "40")
- public String getArguments() {
- return arguments;
- }
-
- public void setArguments(final String arguments) {
- this.arguments = arguments;
- }
-
-
-
- // //////////////////////////////////////
- // memberIdentifier (property)
- // //////////////////////////////////////
-
- private String memberIdentifier;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.MEMBER_IDENTIFIER)
- @TypicalLength(60)
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Detail",sequence = "1")
- public String getMemberIdentifier() {
- return memberIdentifier;
- }
-
- public void setMemberIdentifier(final String memberIdentifier) {
- this.memberIdentifier = Util.abbreviated(memberIdentifier, JdoColumnLength.MEMBER_IDENTIFIER);
- }
-
-
-
- // //////////////////////////////////////
- // memento (property)
- // //////////////////////////////////////
-
- private String memento;
-
- @javax.jdo.annotations.Column(allowsNull="true", jdbcType="CLOB")
- @MultiLine(numberOfLines=9)
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Detail",sequence = "30")
- public String getMemento() {
- return memento;
- }
-
- public void setMemento(final String memento) {
- this.memento = memento;
- }
-
-
-
- // //////////////////////////////////////
- // startedAt (derived property)
- // //////////////////////////////////////
-
- private Timestamp startedAt;
-
- @javax.jdo.annotations.Persistent
- @javax.jdo.annotations.Column(allowsNull="true")
- @MemberOrder(name="Timings", sequence = "3")
- public Timestamp getStartedAt() {
- return startedAt;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- public void setStartedAt(final Timestamp startedAt) {
- this.startedAt = startedAt;
- }
-
-
-
- // //////////////////////////////////////
- // completedAt (property)
- // //////////////////////////////////////
-
- private Timestamp completedAt;
-
- /**
- * The date/time at which this interaction completed.
- */
- @javax.jdo.annotations.Persistent
- @javax.jdo.annotations.Column(allowsNull="true")
- @MemberOrder(name="Timings", sequence = "4")
- @Override
- public Timestamp getCompletedAt() {
- return completedAt;
- }
-
- @Override
- public void setCompletedAt(final Timestamp completed) {
- this.completedAt = completed;
- }
-
-
- // //////////////////////////////////////
- // duration (derived property)
- // //////////////////////////////////////
-
- /**
- * The number of seconds (to 3 decimal places) that this interaction lasted.
- *
- * <p>
- * Populated only if it has {@link #getCompletedAt() completed}.
- */
- @javax.validation.constraints.Digits(integer=5, fraction=3)
- @Named("Duration")
- @MemberOrder(name="Timings", sequence = "7")
- public BigDecimal getDuration() {
- return Util.durationBetween(getStartedAt(), getCompletedAt());
- }
-
-
-
- // //////////////////////////////////////
- // complete (derived property)
- // //////////////////////////////////////
-
-
- @javax.jdo.annotations.NotPersistent
- @MemberOrder(name="Timings", sequence = "8")
- @Hidden(where=Where.OBJECT_FORMS)
- public boolean isComplete() {
- return getCompletedAt() != null;
- }
-
-
-
- // //////////////////////////////////////
- // state (derived property)
- // //////////////////////////////////////
-
- @javax.jdo.annotations.NotPersistent
- @MemberOrder(name="Results",sequence = "10")
- @Hidden(where=Where.OBJECT_FORMS)
- @Named("Result")
- public String getResultSummary() {
- if(getCompletedAt() == null) {
- return "";
- }
- if(getException() != null) {
- return "EXCEPTION";
- }
- if(getResultStr() != null) {
- return "OK";
- } else {
- return "OK (VOID)";
- }
- }
-
-
- // //////////////////////////////////////
- // result (property)
- // openResultObject (action)
- // //////////////////////////////////////
-
- @Programmatic
- @Override
- public Bookmark getResult() {
- return Util.bookmarkFor(getResultStr());
- }
-
- @Programmatic
- @Override
- public void setResult(Bookmark result) {
- setResultStr(Util.asString(result));
- }
-
- // //////////////////////////////////////
-
- private String resultStr;
-
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.BOOKMARK, name="result")
- @Hidden(where=Where.ALL_TABLES)
- @Named("Result Bookmark")
- @MemberOrder(name="Results", sequence="25")
- public String getResultStr() {
- return resultStr;
- }
-
- public void setResultStr(final String resultStr) {
- this.resultStr = resultStr;
- }
-
- // //////////////////////////////////////
-
- @ActionSemantics(Of.SAFE)
- @MemberOrder(name="ResultStr", sequence="1")
- @Named("Open")
- public Object openResultObject() {
- return Util.lookupBookmark(getResult(), bookmarkService, container);
- }
- public boolean hideOpenResultObject() {
- return getResult() == null;
- }
-
-
- // //////////////////////////////////////
- // exception (property)
- // causedException (derived property)
- // showException (associated action)
- // //////////////////////////////////////
-
- private String exception;
-
- /**
- * Stack trace of any exception that might have occurred if this interaction/transaction aborted.
- *
- * <p>
- * Not visible in the UI, but accessible
- * <p>
- * Not part of the applib API, because the default implementation is not persistent
- * and so there's no object that can be accessed to be annotated.
- */
- @javax.jdo.annotations.Column(allowsNull="true", jdbcType="CLOB")
- @Hidden
- @Override
- public String getException() {
- return exception;
- }
-
- @Override
- public void setException(final String exception) {
- this.exception = exception;
- }
-
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.NotPersistent
- @MemberOrder(name="Results",sequence = "30")
- @Hidden(where=Where.ALL_TABLES)
- public boolean isCausedException() {
- return getException() != null;
- }
-
-
- // //////////////////////////////////////
-
- @ActionSemantics(Of.SAFE)
- @MemberOrder(name="causedException", sequence = "1")
- public String showException() {
- return getException();
- }
- public boolean hideShowException() {
- return !isCausedException();
- }
-
-
- // //////////////////////////////////////
- // next(...) impl
- // //////////////////////////////////////
-
- private final Map<String, AtomicInteger> sequenceByName = Maps.newHashMap();
-
-
-
- @Programmatic
- @Override
- public int next(String sequenceName) {
- AtomicInteger next = sequenceByName.get(sequenceName);
- if(next == null) {
- next = new AtomicInteger(0);
- sequenceByName.put(sequenceName, next);
- } else {
- next.incrementAndGet();
- }
- return next.get();
- }
-
-
- // //////////////////////////////////////
- // persistence (programmatic)
- // //////////////////////////////////////
-
- private Persistence persistence;
-
- @javax.jdo.annotations.NotPersistent
- @Programmatic
- @Override
- public Persistence getPersistence() {
- return persistence;
- }
-
- @Override
- public void setPersistence(Persistence persistence) {
- this.persistence = persistence;
- }
-
-
- // //////////////////////////////////////
- // setPersistHint (SPI impl)
- // //////////////////////////////////////
-
- private boolean persistHint;
-
- @NotPersistent
- @Programmatic
- public boolean isPersistHint() {
- return persistHint;
- }
-
- @Programmatic
- @Override
- public void setPersistHint(boolean persistHint) {
- this.persistHint = persistHint;
- }
-
-
- // //////////////////////////////////////
-
- @Programmatic
- boolean shouldPersist() {
- if(Persistence.PERSISTED == getPersistence()) {
- return true;
- }
- if(Persistence.IF_HINTED == getPersistence()) {
- return isPersistHint();
- }
- return false;
- }
-
-
-
- // //////////////////////////////////////
- // toString
- // //////////////////////////////////////
-
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "targetStr,memberIdentifier,user,startedAt,completedAt,duration,transactionId");
- }
-
-
-
- // //////////////////////////////////////
- // dependencies
- // //////////////////////////////////////
-
-
- @javax.inject.Inject
- private BookmarkService bookmarkService;
-
- @javax.inject.Inject
- private DomainObjectContainer container;
-
-}