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/07/04 14:46:49 UTC
[07/12] ISIS-833: moved applib services into own modules,
rationalized most of the applib/runtime modules
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishingServiceJdoRepository.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishingServiceJdoRepository.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishingServiceJdoRepository.java
deleted file mode 100644
index 0f29741..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishingServiceJdoRepository.java
+++ /dev/null
@@ -1,154 +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.publish;
-
-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.ActionSemantics;
-import org.apache.isis.applib.annotation.NotContributed;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.NotContributed.As;
-import org.apache.isis.applib.query.Query;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.HasTransactionId;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo;
-
-public class PublishingServiceJdoRepository extends AbstractFactoryAndRepository {
-
- @Programmatic
- public List<PublishedEventJdo> findQueued() {
- return allMatches(
- new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByStateOrderByTimestamp",
- "state", PublishedEventJdo.State.QUEUED));
- }
-
- @Programmatic
- public List<PublishedEventJdo> findProcessed() {
- return allMatches(
- new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByStateOrderByTimestamp",
- "state", PublishedEventJdo.State.PROCESSED));
- }
-
- @Programmatic
- public List<PublishedEventJdo> findByTransactionId(final UUID transactionId) {
- return allMatches(
- new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTransactionId",
- "transactionId", transactionId));
- }
-
- @Programmatic
- public void purgeProcessed() {
- // REVIEW: this is not particularly performant.
- // much better would be to go direct to the JDO API.
- List<PublishedEventJdo> processedEvents = findProcessed();
- for (PublishedEventJdo publishedEvent : processedEvents) {
- publishedEvent.delete();
- }
- }
-
-
- @Programmatic
- public List<PublishedEventJdo> 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<PublishedEventJdo> query;
- if(from != null) {
- if(to != null) {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTargetAndTimestampBetween",
- "targetStr", targetStr,
- "from", fromTs,
- "to", toTs);
- } else {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTargetAndTimestampAfter",
- "targetStr", targetStr,
- "from", fromTs);
- }
- } else {
- if(to != null) {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTargetAndTimestampBefore",
- "targetStr", targetStr,
- "to", toTs);
- } else {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTarget",
- "targetStr", targetStr);
- }
- }
- return allMatches(query);
- }
-
- @Programmatic
- public List<PublishedEventJdo> findByFromAndTo(
- final LocalDate from,
- final LocalDate to) {
- final Timestamp fromTs = toTimestampStartOfDayWithOffset(from, 0);
- final Timestamp toTs = toTimestampStartOfDayWithOffset(to, 1);
-
- final Query<PublishedEventJdo> query;
- if(from != null) {
- if(to != null) {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTimestampBetween",
- "from", fromTs,
- "to", toTs);
- } else {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTimestampAfter",
- "from", fromTs);
- }
- } else {
- if(to != null) {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.class,
- "findByTimestampBefore",
- "to", toTs);
- } else {
- query = new QueryDefault<PublishedEventJdo>(PublishedEventJdo.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/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java
deleted file mode 100644
index 22d5e77..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.objectstore.jdo.applib.service.settings;
-
-import javax.jdo.annotations.IdentityType;
-
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.services.settings.ApplicationSetting;
-import org.apache.isis.applib.services.settings.SettingType;
-import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-
-@javax.jdo.annotations.PersistenceCapable(
- identityType = IdentityType.APPLICATION,
- table="IsisApplicationSetting")
-@javax.jdo.annotations.Queries({
- @javax.jdo.annotations.Query(
- name = "findByKey", language = "JDOQL",
- value = "SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingJdo "
- + "WHERE key == :key"),
- @javax.jdo.annotations.Query(
- name = "findAll", language = "JDOQL",
- value = "SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingJdo "
- + "ORDER BY key")
-})
-@Named("Application Setting")
-public class ApplicationSettingJdo extends SettingAbstractJdo implements ApplicationSetting {
-
-
- @javax.jdo.annotations.Column(length=JdoColumnLength.SettingAbstract.SETTING_KEY)
- @javax.jdo.annotations.PrimaryKey
- public String getKey() {
- return super.getKey();
- }
- @Override
- public void setKey(String key) {
- super.setKey(key);
- }
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.Column(length=JdoColumnLength.DESCRIPTION)
- @javax.jdo.annotations.Persistent
- @Override
- public String getDescription() {
- return super.getDescription();
- }
- @Override
- public void setDescription(String description) {
- super.setDescription(description);
- }
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.SettingAbstract.VALUE_RAW)
- @javax.jdo.annotations.Persistent
- @Override
- public String getValueRaw() {
- return super.getValueRaw();
- }
- @Override
- public void setValueRaw(String valueAsRaw) {
- super.setValueRaw(valueAsRaw);
- }
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.SettingAbstract.SETTING_TYPE)
- @javax.jdo.annotations.Persistent
- @Override
- public SettingType getType() {
- return super.getType();
- }
- @Override
- public void setType(SettingType type) {
- super.setType(type);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdo.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdo.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdo.java
deleted file mode 100644
index 014455a..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdo.java
+++ /dev/null
@@ -1,120 +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.settings;
-
-import java.util.List;
-
-import org.joda.time.LocalDate;
-
-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.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.settings.ApplicationSetting;
-import org.apache.isis.applib.services.settings.ApplicationSettingsService;
-import org.apache.isis.applib.services.settings.ApplicationSettingsServiceRW;
-import org.apache.isis.applib.services.settings.SettingAbstract;
-import org.apache.isis.applib.services.settings.SettingType;
-
-/**
- * An implementation of {@link ApplicationSettingsService} that persists settings
- * as entities into a JDO-backed database.
- */
-@Named("Application Settings")
-public class ApplicationSettingsServiceJdo extends AbstractService implements ApplicationSettingsServiceRW {
-
- @ActionSemantics(Of.SAFE)
- @Override
- public ApplicationSetting find(@Named("Key") String key) {
- return firstMatch(
- new QueryDefault<ApplicationSettingJdo>(ApplicationSettingJdo.class,
- "findByKey",
- "key", key));
- }
-
- // //////////////////////////////////////
-
- @ActionSemantics(Of.SAFE)
- @MemberOrder(sequence="1")
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public List<ApplicationSetting> listAll() {
- return (List)allMatches(
- new QueryDefault<ApplicationSettingJdo>(ApplicationSettingJdo.class,
- "findAll"));
- }
-
- // //////////////////////////////////////
-
- @MemberOrder(sequence="10")
- @Override
- public ApplicationSetting newString(
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") String value) {
- return newSetting(key, description, SettingType.STRING, value);
- }
- @MemberOrder(sequence="11")
- @Override
- public ApplicationSettingJdo newInt(
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") Integer value) {
- return newSetting(key, description, SettingType.INT, value.toString());
- }
- @MemberOrder(sequence="12")
- @Override
- public ApplicationSettingJdo newLong(
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") Long value) {
- return newSetting(key, description, SettingType.LONG, value.toString());
- }
- @MemberOrder(sequence="13")
- @Override
- public ApplicationSettingJdo newLocalDate(
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") LocalDate value) {
- return newSetting(key, description, SettingType.LOCAL_DATE, value.toString(SettingAbstract.DATE_FORMATTER));
- }
- @MemberOrder(sequence="14")
- @Override
- public ApplicationSettingJdo newBoolean(
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") @Optional Boolean value) {
- return newSetting(key, description, SettingType.BOOLEAN, new Boolean(value != null && value).toString());
- }
-
- private ApplicationSettingJdo newSetting(
- String key, String description, SettingType settingType, final String valueRaw) {
- final ApplicationSettingJdo setting = newTransientInstance(ApplicationSettingJdo.class);
- setting.setKey(key);
- setting.setDescription(description);
- setting.setValueRaw(valueRaw);
- setting.setType(settingType);
- persist(setting);
- return setting;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdoHidden.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdoHidden.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdoHidden.java
deleted file mode 100644
index 95512c0..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingsServiceJdoHidden.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.objectstore.jdo.applib.service.settings;
-
-import java.util.List;
-
-import org.joda.time.LocalDate;
-
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.services.settings.ApplicationSetting;
-
-/**
- * An implementation intended to be hidden in the UI, and delegated to by other services.
- */
-public class ApplicationSettingsServiceJdoHidden extends ApplicationSettingsServiceJdo {
-
- @Hidden
- @Override
- public ApplicationSetting find(@Named("Key") String key) {
- return super.find(key);
- }
-
- // //////////////////////////////////////
-
- @Hidden
- @Override
- public List<ApplicationSetting> listAll() {
- return super.listAll();
- }
-
- // //////////////////////////////////////
-
- @Hidden
- @Override
- public ApplicationSetting newString(String key, String description, String value) {
- return super.newString(key, description, value);
- }
-
- @Hidden
- @Override
- public ApplicationSettingJdo newInt(String key, String description, Integer value) {
- return super.newInt(key, description, value);
- }
-
- @Hidden
- @Override
- public ApplicationSettingJdo newLong(String key, String description, Long value) {
- return super.newLong(key, description, value);
- }
-
- @Hidden
- @Override
- public ApplicationSettingJdo newLocalDate(String key, String description, LocalDate value) {
- return super.newLocalDate(key, description, value);
- }
-
- @Hidden
- @Override
- public ApplicationSettingJdo newBoolean(String key, String description, Boolean value) {
- return super.newBoolean(key, description, value);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java
deleted file mode 100644
index 8e6f8da..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java
+++ /dev/null
@@ -1,190 +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.settings;
-
-import javax.jdo.annotations.PersistenceCapable;
-
-import org.joda.time.LocalDate;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.services.settings.SettingType;
-
-/**
- * Factors out common implementation; however this is annotated with {@link PersistenceCapable},
- * so that each subclass is its own root entity.
- */
-public abstract class SettingAbstractJdo extends org.apache.isis.applib.services.settings.SettingAbstract implements org.apache.isis.applib.services.settings.ApplicationSetting {
-
- private String key;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- public String getKey() {
- return key;
- }
-
- public void setKey(final String key) {
- this.key = key;
- }
-
- // //////////////////////////////////////
-
- private String description;
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
-
- @MemberOrder(name="Description", sequence="1")
- @Named("Update")
- public SettingAbstractJdo updateDescription(@Named("Description") @Optional String description) {
- setDescription(description);
- return this;
- }
- public String default0UpdateDescription() {
- return getDescription();
- }
-
- // //////////////////////////////////////
-
- private SettingType type;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- public SettingType getType() {
- return type;
- }
-
- public void setType(final SettingType type) {
- this.type = type;
- }
-
- // //////////////////////////////////////
-
- private String valueRaw;
-
- @javax.jdo.annotations.Column(allowsNull="false")
- public String getValueRaw() {
- return valueRaw;
- }
-
- public void setValueRaw(final String valueAsRaw) {
- this.valueRaw = valueAsRaw;
- }
-
- // //////////////////////////////////////
-
- @MemberOrder(name="ValueAsString", sequence="1")
- @Named("Update")
- public SettingAbstractJdo updateAsString(@Named("Value") String value) {
- setValueRaw(value);
- return this;
- }
- public String default0UpdateAsString() {
- return getValueAsString();
- }
- public boolean hideUpdateAsString() {
- return typeIsNot(SettingType.STRING);
- }
-
- @MemberOrder(name="ValueAsInt", sequence="1")
- @Named("Update")
- public SettingAbstractJdo updateAsInt(@Named("Value") Integer value) {
- setValueRaw(value.toString());
- return this;
- }
- public Integer default0UpdateAsInt() {
- return getValueAsInt();
- }
- public boolean hideUpdateAsInt() {
- return typeIsNot(SettingType.INT);
- }
-
- @MemberOrder(name="ValueAsLong", sequence="1")
- @Named("Update")
- public SettingAbstractJdo updateAsLong(@Named("Value") Long value) {
- setValueRaw(value.toString());
- return this;
- }
- public Long default0UpdateAsLong() {
- return getValueAsLong();
- }
- public boolean hideUpdateAsLong() {
- return typeIsNot(SettingType.LONG);
- }
-
- @MemberOrder(name="ValueAsLocalDate", sequence="1")
- @Named("Update")
- public SettingAbstractJdo updateAsLocalDate(@Named("Value") LocalDate value) {
- setValueRaw(value.toString(DATE_FORMATTER));
- return this;
- }
- public LocalDate default0UpdateAsLocalDate() {
- return getValueAsLocalDate();
- }
- public boolean hideUpdateAsLocalDate() {
- return typeIsNot(SettingType.LOCAL_DATE);
- }
-
- @MemberOrder(name="ValueAsBoolean", sequence="1")
- @Named("Update")
- public SettingAbstractJdo updateAsBoolean(@Named("Value") Boolean value) {
- setValueRaw(value.toString());
- return this;
- }
- public Boolean default0UpdateAsBoolean() {
- return getValueAsBoolean();
- }
- public boolean hideUpdateAsBoolean() {
- return typeIsNot(SettingType.BOOLEAN);
- }
-
- // //////////////////////////////////////
-
-
- public SettingAbstractJdo delete(
- @Named("Are you sure?") @Optional Boolean confirm) {
- if(confirm == null || !confirm) {
- container.informUser("Setting NOT deleted");
- return this;
- }
- container.remove(this);
- container.informUser("Setting deleted");
- return null;
- }
-
-
-
-
- // //////////////////////////////////////
-
- private DomainObjectContainer container;
-
- public void setDomainObjectContainer(final DomainObjectContainer container) {
- this.container = container;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java
deleted file mode 100644
index f1ff4b2..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.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.settings;
-
-
-import javax.jdo.annotations.IdentityType;
-
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.services.settings.SettingType;
-import org.apache.isis.applib.services.settings.UserSetting;
-import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-
-@javax.jdo.annotations.PersistenceCapable(
- identityType = IdentityType.APPLICATION,
- objectIdClass=UserSettingJdoPK.class,
- table="IsisUserSetting")
-@javax.jdo.annotations.Queries({
- @javax.jdo.annotations.Query(
- name = "findByUserAndKey", language = "JDOQL",
- value = "SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.settings.UserSettingJdo "
- + "WHERE user == :user "
- + "&& key == :key ")
- ,@javax.jdo.annotations.Query(
- name = "findByUser", language = "JDOQL",
- value = "SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.settings.UserSettingJdo "
- + "WHERE user == :user "
- + "ORDER BY key")
- ,@javax.jdo.annotations.Query(
- name = "findAll", language = "JDOQL",
- value = "SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.settings.UserSettingJdo "
- + "ORDER BY user, key")
-})
-// can't see how to specify this order in the primary key; however HSQLDB objects :-(
-//@javax.jdo.annotations.Unique(name="USER_KEY_IDX", members={"user","key"})
-@Named("User Setting")
-public class UserSettingJdo extends SettingAbstractJdo implements UserSetting {
-
-
- private String user;
-
- @javax.jdo.annotations.Column(length=JdoColumnLength.USER_NAME)
- @javax.jdo.annotations.PrimaryKey
- @Title(sequence="5", append=": ")
- @MemberOrder(sequence = "5")
- public String getUser() {
- return user;
- }
-
- public void setUser(final String user) {
- this.user = user;
- }
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.Column(length=JdoColumnLength.SettingAbstract.SETTING_KEY)
- @javax.jdo.annotations.PrimaryKey
- @Title(sequence="10")
- @Override
- public String getKey() {
- return super.getKey();
- }
- @Override
- public void setKey(String key) {
- super.setKey(key);
- }
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.Column(length=JdoColumnLength.DESCRIPTION)
- @javax.jdo.annotations.Persistent
- @Override
- public String getDescription() {
- return super.getDescription();
- }
- @Override
- public void setDescription(String description) {
- super.setDescription(description);
- }
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.SettingAbstract.VALUE_RAW)
- @javax.jdo.annotations.Persistent
- @Title(prepend=" = ", sequence="30")
- @Override
- public String getValueRaw() {
- return super.getValueRaw();
- }
- @Override
- public void setValueRaw(String valueAsRaw) {
- super.setValueRaw(valueAsRaw);
- }
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.SettingAbstract.SETTING_TYPE)
- @javax.jdo.annotations.Persistent
- @Override
- public SettingType getType() {
- return super.getType();
- }
- @Override
- public void setType(SettingType type) {
- super.setType(type);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdoPK.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdoPK.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdoPK.java
deleted file mode 100644
index 13a20ed..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdoPK.java
+++ /dev/null
@@ -1,90 +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.settings;
-
-import java.io.Serializable;
-import java.util.StringTokenizer;
-
-/**
- * @see http://www.datanucleus.org/products/datanucleus/jdo/primary_key.html
- */
-public class UserSettingJdoPK implements Serializable
-{
- private static final long serialVersionUID = 1L;
-
-
- public String user;
- public String key;
-
- public UserSettingJdoPK ()
- {
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getKey() {
- return key;
- }
- public void setKey(String key) {
- this.key = key;
- }
-
-
- /**
- * Constructor accepting same input as generated by toString().
- */
- public UserSettingJdoPK(String value)
- {
- StringTokenizer token = new StringTokenizer (value, ";;");
- token.nextToken(); // className
- this.setUser(token.nextToken()); // user
- this.setKey(token.nextToken()); // key
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (!(obj instanceof UserSettingJdoPK))
- {
- return false;
- }
- UserSettingJdoPK c = (UserSettingJdoPK)obj;
-
- return getUser().equals(c.getUser()) && getKey().equals(c.getKey());
- }
-
- public int hashCode ()
- {
- return this.getUser().hashCode() ^ this.getKey().hashCode();
- }
-
- public String toString ()
- {
- // Give output expected by String constructor
- return this.getClass().getName() + ";;" + this.getUser() + ";;" + this.getKey();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdo.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdo.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdo.java
deleted file mode 100644
index 21ba8b9..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdo.java
+++ /dev/null
@@ -1,170 +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.settings;
-
-import java.util.List;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import org.joda.time.LocalDate;
-
-import org.apache.isis.applib.AbstractService;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.settings.SettingAbstract;
-import org.apache.isis.applib.services.settings.SettingType;
-import org.apache.isis.applib.services.settings.UserSetting;
-import org.apache.isis.applib.services.settings.UserSettingsService;
-import org.apache.isis.applib.services.settings.UserSettingsServiceRW;
-
-/**
- * An implementation of {@link UserSettingsService} that persists settings
- * as entities into a JDO-backed database.
- */
-@Named("User Settings")
-public class UserSettingsServiceJdo extends AbstractService implements UserSettingsServiceRW {
-
- @Override
- public UserSetting find(
- @Named("User") String user,
- @Named("Key") String key) {
- return firstMatch(
- new QueryDefault<UserSettingJdo>(UserSettingJdo.class,
- "findByUserAndKey",
- "user",user,
- "key", key));
- }
-
-
- // //////////////////////////////////////
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public List<UserSetting> listAllFor(String user) {
- return (List)allMatches(
- new QueryDefault<UserSettingJdo>(UserSettingJdo.class,
- "findByUser",
- "user", user));
- }
- public List<String> choices0ListAllFor() {
- return existingUsers();
- }
-
- private List<String> existingUsers() {
- final List<UserSetting> listAll = listAll();
- return Lists.newArrayList(Sets.newTreeSet(Iterables.transform(listAll, GET_USER)));
- }
-
- private final static Function<UserSetting, String> GET_USER = new Function<UserSetting, String>() {
- public String apply(UserSetting input) {
- return input.getUser();
- }
- };
-
- // //////////////////////////////////////
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public List<UserSetting> listAll() {
- return (List)allMatches(
- new QueryDefault<UserSettingJdo>(UserSettingJdo.class,
- "findAll"));
- }
-
-
- // //////////////////////////////////////
-
- @MemberOrder(sequence="10")
- public UserSettingJdo newString(
- @Named("User") String user,
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") String value) {
- return newSetting(user, key, description, SettingType.STRING, value);
- }
- public String default0NewString() {
- return getContainer().getUser().getName();
- }
-
- @MemberOrder(sequence="11")
- public UserSettingJdo newInt(
- @Named("User") String user,
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") Integer value) {
- return newSetting(user, key, description, SettingType.INT, value.toString());
- }
- public String default0NewInt() {
- return getContainer().getUser().getName();
- }
-
- @MemberOrder(sequence="12")
- public UserSettingJdo newLong(
- @Named("User") String user,
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") Long value) {
- return newSetting(user, key, description, SettingType.LONG, value.toString());
- }
- public String default0NewLong() {
- return getContainer().getUser().getName();
- }
-
- @MemberOrder(sequence="13")
- public UserSettingJdo newLocalDate(
- @Named("User") String user,
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") LocalDate value) {
- return newSetting(user, key, description, SettingType.LOCAL_DATE, value.toString(SettingAbstract.DATE_FORMATTER));
- }
- public String default0NewLocalDate() {
- return getContainer().getUser().getName();
- }
-
- @MemberOrder(sequence="14")
- public UserSettingJdo newBoolean(
- @Named("User") String user,
- @Named("Key") String key,
- @Named("Description") @Optional String description,
- @Named("Value") @Optional Boolean value) {
- return newSetting(user, key, description, SettingType.BOOLEAN, new Boolean(value != null && value).toString());
- }
- public String default0NewBoolean() {
- return getContainer().getUser().getName();
- }
-
- private UserSettingJdo newSetting(
- String user, String key, String description, SettingType settingType, final String valueRaw) {
- final UserSettingJdo setting = newTransientInstance(UserSettingJdo.class);
- setting.setUser(user);
- setting.setKey(key);
- setting.setType(settingType);
- setting.setDescription(description);
- setting.setValueRaw(valueRaw);
- persist(setting);
- return setting;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdoHidden.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdoHidden.java b/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdoHidden.java
deleted file mode 100644
index a1f2595..0000000
--- a/core/objectstore-jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingsServiceJdoHidden.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.objectstore.jdo.applib.service.settings;
-
-import java.util.List;
-
-import org.joda.time.LocalDate;
-
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.services.settings.UserSetting;
-
-/**
- * An implementation intended to be hidden in the UI, and delegated to by other services.
- */
-public class UserSettingsServiceJdoHidden extends UserSettingsServiceJdo {
-
- @Hidden
- @Override
- public UserSetting find(String user, String key) {
- return super.find(user, key);
- }
-
- // //////////////////////////////////////
-
- @Hidden
- @Override
- public List<UserSetting> listAll() {
- return super.listAll();
- }
-
- @Hidden
- @Override
- public List<UserSetting> listAllFor(String user) {
- return super.listAllFor(user);
- }
-
- // //////////////////////////////////////
-
- @Hidden
- @Override
- public UserSettingJdo newString(String user, String key, String description, String value) {
- return super.newString(user, key, description, value);
- }
-
- @Hidden
- @Override
- public UserSettingJdo newInt(String user, String key, String description, Integer value) {
- return super.newInt(user, key, description, value);
- }
-
- @Hidden
- @Override
- public UserSettingJdo newLong(String user, String key, String description, Long value) {
- return super.newLong(user, key, description, value);
- }
-
- @Hidden
- @Override
- public UserSettingJdo newLocalDate(String user, String key, String description, LocalDate value) {
- return super.newLocalDate(user, key, description, value);
- }
-
- @Hidden
- @Override
- public UserSettingJdo newBoolean(String user, String key, String description, Boolean value) {
- return super.newBoolean(user, key, description, value);
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/resources/images/AuditEntryJdo.png
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/resources/images/AuditEntryJdo.png b/core/objectstore-jdo-applib/src/main/resources/images/AuditEntryJdo.png
deleted file mode 100644
index 4e4352c..0000000
Binary files a/core/objectstore-jdo-applib/src/main/resources/images/AuditEntryJdo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/resources/images/CommandJdo.png
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/resources/images/CommandJdo.png b/core/objectstore-jdo-applib/src/main/resources/images/CommandJdo.png
deleted file mode 100644
index 7545614..0000000
Binary files a/core/objectstore-jdo-applib/src/main/resources/images/CommandJdo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/main/resources/images/PublishedEventJdo.png
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/main/resources/images/PublishedEventJdo.png b/core/objectstore-jdo-applib/src/main/resources/images/PublishedEventJdo.png
deleted file mode 100644
index cb3a325..0000000
Binary files a/core/objectstore-jdo-applib/src/main/resources/images/PublishedEventJdo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdoTest_next.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdoTest_next.java b/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdoTest_next.java
deleted file mode 100644
index b5443e2..0000000
--- a/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/command/CommandJdoTest_next.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.objectstore.jdo.applib.service.command;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-import org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo;
-
-public class CommandJdoTest_next {
-
- @Test
- public void test() {
- CommandJdo raj = new CommandJdo();
- assertThat(raj.next("foo"), is(0));
- assertThat(raj.next("foo"), is(1));
- assertThat(raj.next("bar"), is(0));
- assertThat(raj.next("bar"), is(1));
- assertThat(raj.next("foo"), is(2));
- assertThat(raj.next("bar"), is(2));
- assertThat(raj.next("bar"), is(3));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/exceprecog/ExceptionRecognizerForSQLIntegrityConstraintViolationExceptionTest.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/exceprecog/ExceptionRecognizerForSQLIntegrityConstraintViolationExceptionTest.java b/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/exceprecog/ExceptionRecognizerForSQLIntegrityConstraintViolationExceptionTest.java
deleted file mode 100644
index 35d8f5c..0000000
--- a/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/exceprecog/ExceptionRecognizerForSQLIntegrityConstraintViolationExceptionTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.isis.objectstore.jdo.applib.service.exceprecog;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-
-import java.sql.SQLIntegrityConstraintViolationException;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ExceptionRecognizerForSQLIntegrityConstraintViolationExceptionTest {
-
- private ExceptionRecognizerForSQLIntegrityConstraintViolationUniqueOrIndexException exceptionRecognizer;
-
- @Before
- public void setUp() throws Exception {
- exceptionRecognizer = new ExceptionRecognizerForSQLIntegrityConstraintViolationUniqueOrIndexException();
- }
-
- @Test
- public void uniqueConstraintOrIndexViolation() throws Exception {
- final String msg = "initial gumph: unique constraint or index violation; further details";
- final SQLIntegrityConstraintViolationException ex = new SQLIntegrityConstraintViolationException(msg);
- String recognize = exceptionRecognizer.recognize(ex);
- assertThat(recognize, is("Data already exists<br/><br/>" + msg));
- }
-
- @Test
- public void notNullCheckConstraintViolation() throws Exception {
- final String msg = "initial gumph: NOT NULL check constraint; further details";
- final SQLIntegrityConstraintViolationException ex = new SQLIntegrityConstraintViolationException(msg);
- String recognize = exceptionRecognizer.recognize(ex);
- assertThat(recognize, is(nullValue()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/publish/IoUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/publish/IoUtilsTest.java b/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/publish/IoUtilsTest.java
deleted file mode 100644
index 32cfde0..0000000
--- a/core/objectstore-jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/publish/IoUtilsTest.java
+++ /dev/null
@@ -1,36 +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.publish;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class IoUtilsTest {
-
- @Test
- public void roundtrip() {
- final String str = "3784y5hrfbdgkjh3qyri f£$%$YTRGFDGER$£\"Eu098987u'!\"£%^&*IO(LUKJM)";
- final byte[] utf8ZippedBytes = IoUtils.toUtf8ZippedBytes("serializedForm", str);
-
- final String str2 = IoUtils.fromUtf8ZippedBytes("serializedForm", utf8ZippedBytes);
-
- assertThat(str, (is(str2)));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/eventbus/EventBusServiceJdo.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/eventbus/EventBusServiceJdo.java b/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/eventbus/EventBusServiceJdo.java
index de4f881..ba59510 100644
--- a/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/eventbus/EventBusServiceJdo.java
+++ b/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/eventbus/EventBusServiceJdo.java
@@ -31,9 +31,9 @@ import org.apache.isis.objectstore.jdo.datanucleus.JDOStateManagerForIsis.Hint;
* occur as a side-effect of the JDO load/detach lifecycle.
*
* <p>
- * Because this service is annotated with {@link org.apache.isis.applib.annotation.DomainService} and is
- * implemented in the core runtime, it is automatically registered and available for use; no configuration is required.
- * </p>
+ * This implementation has no UI and there are no other implementations of the service API, and so it is annotated
+ * with {@link org.apache.isis.applib.annotation.DomainService}. Because it is implemented in the core, this means
+ * that it is automatically registered and available for use; no further configuration is required.
*/
@DomainService
public class EventBusServiceJdo extends EventBusServiceDefault {
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java b/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
index 7f31fe1..c2bec85 100644
--- a/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
+++ b/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
@@ -50,9 +50,9 @@ import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore;
* This service provdes a number of utility methods to supplement/support the capabilities of the JDO Objectstore.
*
* <p>
- * Because this service is annotated with {@link org.apache.isis.applib.annotation.DomainService} and is
- * implemented in the core, it is automatically registered and available for use; no configuration is required.
- * </p>
+ * This implementation has no UI and there are no other implementations of the service API, and so it is annotated
+ * with {@link org.apache.isis.applib.annotation.DomainService}. Because it is implemented in the core, this means
+ * that it is automatically registered and available for use; no further configuration is required.
*/
@DomainService
@Hidden
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/service/BackgroundCommandExecutionFromBackgroundCommandServiceJdo.java
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/service/BackgroundCommandExecutionFromBackgroundCommandServiceJdo.java b/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/service/BackgroundCommandExecutionFromBackgroundCommandServiceJdo.java
deleted file mode 100644
index 0e1e42c..0000000
--- a/core/objectstore-jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/service/BackgroundCommandExecutionFromBackgroundCommandServiceJdo.java
+++ /dev/null
@@ -1,46 +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.service;
-
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.core.runtime.services.background.BackgroundCommandExecution;
-import org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdoRepository;
-import org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo;
-
-public final class BackgroundCommandExecutionFromBackgroundCommandServiceJdo extends BackgroundCommandExecution {
-
- @SuppressWarnings("unused")
- private final static Logger LOG = LoggerFactory.getLogger(BackgroundCommandExecutionFromBackgroundCommandServiceJdo.class);
-
- @Override
- protected List<? extends Command> findBackgroundCommandsToExecute() {
- final List<CommandJdo> commands = backgroundCommandRepository.findBackgroundCommandsNotYetStarted();
- return commands;
- }
-
- // //////////////////////////////////////
-
- @javax.inject.Inject
- private BackgroundCommandServiceJdoRepository backgroundCommandRepository;
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/objectstore-jdo-metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/core/objectstore-jdo-metamodel/pom.xml b/core/objectstore-jdo-metamodel/pom.xml
index f483dd9..4c4ca9d 100644
--- a/core/objectstore-jdo-metamodel/pom.xml
+++ b/core/objectstore-jdo-metamodel/pom.xml
@@ -40,7 +40,7 @@
<dependencies>
<dependency>
<groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-objectstore-jdo-applib</artifactId>
+ <artifactId>isis-core-applib</artifactId>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index c2d123f..f7f097f 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1076,13 +1076,6 @@ ${license.additional-notes}
<!-- not scope=test, because referenced by some sql-tests-common under compile scope -->
</dependency>
- <!-- wrapper service -->
- <dependency>
- <groupId>org.apache.isis.module</groupId>
- <artifactId>isis-module-wrapper</artifactId>
- <version>1.6.0-SNAPSHOT</version>
- </dependency>
-
<!-- default implementations of components -->
<dependency>
@@ -1442,18 +1435,6 @@ ${license.additional-notes}
<!-- for benefit of application developers, using scope=import -->
<dependency>
<groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-objectstore-jdo-applib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-objectstore-jdo-applib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
- <scope>test</scope>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-objectstore-jdo-metamodel</artifactId>
<version>1.6.0-SNAPSHOT</version>
</dependency>
@@ -1541,6 +1522,148 @@ ${license.additional-notes}
<version>1.1.2</version>
</dependency>
+
+ <!-- modules -->
+ <!-- (in future, these might be released separately from core -->
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-audit-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-audit-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-background</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-background</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-command-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-command-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <!--
+ declared as a convenience; alternative is for the domain application to
+ scope=import the o.a.i.module:isis-module-devutils in root pom.xml's dependencyManagement/dependencies
+ -->
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-applib</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-applib</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-impl</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-impl</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishing-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishing-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishingeventserializer-ro</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishingeventserializer-ro</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <!--
+ declared as a convenience; alternative is for the domain application to
+ scope=import the o.a.i.module:isis-module-devutils in root pom.xml's dependencyManagement/dependencies
+ -->
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-applib</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-applib</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-impl-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-impl-jdo</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-wrapper</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
@@ -1888,7 +2011,6 @@ ${license.additional-notes}
<module>bytecode-javassist</module>
<module>objectstore-inmemory</module>
- <module>objectstore-jdo-applib</module>
<module>objectstore-jdo-metamodel</module>
<module>objectstore-jdo-datanucleus</module>
@@ -1910,6 +2032,7 @@ ${license.additional-notes}
<module>module-command-jdo</module>
<module>module-devutils</module>
<module>module-publishing-jdo</module>
+ <module>module-publishingeventserializer-ro</module>
<module>module-settings</module>
<module>module-wrapper</module>
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/runtime/src/main/java/org/apache/isis/core/runtime/services/memento/MementoServiceDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/memento/MementoServiceDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/memento/MementoServiceDefault.java
index adbe436..06f955c 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/memento/MementoServiceDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/memento/MementoServiceDefault.java
@@ -33,14 +33,14 @@ import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.services.memento.MementoService;
- /**
+/**
* This service provides a mechanism by which a serializable memento of arbitrary state can be created. Most
* commonly this is in support of implementing the {@link org.apache.isis.applib.ViewModel} interface.
*
* <p>
- * Because this service is annotated with {@link org.apache.isis.applib.annotation.DomainService} and is
- * implemented in the core runtime, it is automatically registered and available for use; no configuration is required.
- * </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}. Because this class is implemented in core, this means
+ * that it is automatically registered and available for use; no further configuration is required.
*/
@DomainService
public class MementoServiceDefault implements MementoService {
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/runtime/src/main/java/org/apache/isis/core/runtime/services/xmlsnapshot/XmlSnapshotServiceDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/xmlsnapshot/XmlSnapshotServiceDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/xmlsnapshot/XmlSnapshotServiceDefault.java
index 4b615bf..ba5d6b7 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/xmlsnapshot/XmlSnapshotServiceDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/xmlsnapshot/XmlSnapshotServiceDefault.java
@@ -32,9 +32,9 @@ import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
* entities. This XML can be used for various purposes, such as mail merge/reporting, or adhoc auditing.
*
* <p>
- * Because this service is annotated with {@link org.apache.isis.applib.annotation.DomainService} and is
- * implemented in the core runtime, it is automatically registered and available for use; no configuration is required.
- * </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}. Because this class is implemented in core, this means
+ * that it is automatically registered and available for use; no further configuration is required.
*/
@DomainService
public class XmlSnapshotServiceDefault extends XmlSnapshotServiceAbstract {
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/runtime/src/main/java/org/apache/isis/core/runtime/sessiontemplate/AbstractIsisSessionTemplate.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/sessiontemplate/AbstractIsisSessionTemplate.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/sessiontemplate/AbstractIsisSessionTemplate.java
index f53910d..eba6543 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/sessiontemplate/AbstractIsisSessionTemplate.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/sessiontemplate/AbstractIsisSessionTemplate.java
@@ -27,13 +27,10 @@ import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
public abstract class AbstractIsisSessionTemplate {
-// public static boolean enabled = true;
/**
* Sets up an {@link IsisSession} then passes along any calling framework's context.
*/
public void execute(final AuthenticationSession authSession, final Object context) {
-// if(!enabled) return;
-// enabled = false;
try {
IsisContext.openSession(authSession);
PersistenceSession persistenceSession = getPersistenceSession();
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/EventSerializerRendererContext.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/EventSerializerRendererContext.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/EventSerializerRendererContext.java
deleted file mode 100644
index 14b61f6..0000000
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/EventSerializerRendererContext.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.viewer.restfulobjects.rendering.eventserializer;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.profiles.Localization;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.viewer.restfulobjects.rendering.RendererContext;
-
-public class EventSerializerRendererContext implements RendererContext {
-
- private final String baseUrl;
- private final Where where;
-
- public EventSerializerRendererContext(String baseUrl, Where where) {
- this.baseUrl = baseUrl;
- this.where = where;
- }
-
- @Override
- public String urlFor(String url) {
- return baseUrl + url;
- }
-
- @Override
- public AuthenticationSession getAuthenticationSession() {
- return IsisContext.getAuthenticationSession();
- }
-
- @Override
- public PersistenceSession getPersistenceSession() {
- return IsisContext.getPersistenceSession();
- }
-
- @Override
- public IsisConfiguration getConfiguration() {
- return IsisContext.getConfiguration();
- }
-
- @Override
- public AdapterManager getAdapterManager() {
- return getPersistenceSession().getAdapterManager();
- }
-
- @Override
- public List<List<String>> getFollowLinks() {
- return Collections.emptyList();
- }
-
- @Override
- public Where getWhere() {
- return where;
- }
-
- @Override
- public Localization getLocalization() {
- return IsisContext.getLocalization();
- }
-
- private Set<Oid> rendered = Sets.newHashSet();
- @Override
- public boolean canEagerlyRender(ObjectAdapter objectAdapter) {
- final Oid oid = objectAdapter.getOid();
- return rendered.add(oid);
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java
deleted file mode 100644
index 3b79e0f..0000000
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java
+++ /dev/null
@@ -1,119 +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.viewer.restfulobjects.rendering.eventserializer;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.map.JsonMappingException;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.publish.EventMetadata;
-import org.apache.isis.applib.services.publish.EventPayload;
-import org.apache.isis.applib.services.publish.EventSerializer;
-import org.apache.isis.core.commons.ensure.Ensure;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
-import org.apache.isis.viewer.restfulobjects.applib.util.JsonMapper;
-import org.apache.isis.viewer.restfulobjects.rendering.RendererContext;
-import org.apache.isis.viewer.restfulobjects.rendering.domainobjects.DomainObjectReprRenderer;
-
-@Hidden
-public class RestfulObjectsSpecEventSerializer implements EventSerializer {
-
- private final static JsonMapper jsonMapper = JsonMapper.instance();
-
- private final static String BASE_URL_KEY = "isis.viewer.restfulobjects.RestfulObjectsSpecEventSerializer.baseUrl";
- private static final String BASE_URL_DEFAULT = "http://localhost:8080/restful/";
-
- private String baseUrl;
-
- @PostConstruct
- public void init(Map<String,String> props) {
- final String baseUrlFromConfig = props.get(BASE_URL_KEY);
- baseUrl = baseUrlFromConfig != null? baseUrlFromConfig: BASE_URL_DEFAULT;
- }
-
- @PreDestroy
- public void shutdown() {
- }
-
- @Programmatic
- @Override
- public Object serialize(EventMetadata metadata, EventPayload payload) {
- final RendererContext rendererContext = new EventSerializerRendererContext(baseUrl, Where.OBJECT_FORMS);
-
- final JsonRepresentation payloadRepr = asPayloadRepr(rendererContext, payload);
- final JsonRepresentation eventRepr = asEventRepr(metadata, payloadRepr);
-
- return jsonFor(eventRepr);
- }
-
- JsonRepresentation asEventRepr(EventMetadata metadata, final JsonRepresentation payloadRepr) {
- final JsonRepresentation eventRepr = JsonRepresentation.newMap();
- final JsonRepresentation metadataRepr = JsonRepresentation.newMap();
- eventRepr.mapPut("metadata", metadataRepr);
- metadataRepr.mapPut("id", metadata.getId());
- metadataRepr.mapPut("transactionId", metadata.getTransactionId());
- metadataRepr.mapPut("sequence", metadata.getSequence());
- metadataRepr.mapPut("eventType", metadata.getEventType());
- metadataRepr.mapPut("user", metadata.getUser());
- metadataRepr.mapPut("timestamp", metadata.getTimestamp());
- eventRepr.mapPut("payload", payloadRepr);
- return eventRepr;
- }
-
- JsonRepresentation asPayloadRepr(final RendererContext rendererContext, EventPayload payload) {
- final DomainObjectReprRenderer renderer = new DomainObjectReprRenderer(rendererContext, null, JsonRepresentation.newMap());
- final ObjectAdapter objectAdapter = rendererContext.getAdapterManager().adapterFor(payload);
- renderer.with(objectAdapter).asEventSerialization();
- return renderer.render();
- }
-
- String jsonFor(final Object object) {
- try {
- return getJsonMapper().write(object);
- } catch (final JsonGenerationException e) {
- throw new RuntimeException(e);
- } catch (final JsonMappingException e) {
- throw new RuntimeException(e);
- } catch (final IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- JsonMapper getJsonMapper() {
- return jsonMapper;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/dom/pom.xml b/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
index 6ee7dc2..12edd88 100644
--- a/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
+++ b/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
@@ -110,11 +110,15 @@
<artifactId>isis-core-applib</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-objectstore-jdo-applib</artifactId>
- </dependency>
-
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-applib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-applib</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-unittestsupport</artifactId>
http://git-wip-us.apache.org/repos/asf/isis/blob/e3c20592/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/ToDoSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/ToDoSystemInitializer.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/ToDoSystemInitializer.java
index e991d3d..4fcf811 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/ToDoSystemInitializer.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/ToDoSystemInitializer.java
@@ -20,8 +20,6 @@ import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.integtestsupport.IsisSystemForTest;
import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
-import org.apache.isis.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo;
-import org.apache.isis.objectstore.jdo.datanucleus.service.support.IsisJdoSupportImpl;
/**
* Holds an instance of an {@link IsisSystemForTest} as a {@link ThreadLocal} on the current thread,
@@ -56,12 +54,10 @@ public class ToDoSystemInitializer {
,"org.apache.isis.core.wrapper"
,"org.apache.isis.applib"
,"org.apache.isis.core.metamodel.services"
- ,"org.apache.isis.core.runtime.services");
- // all other services
- withServices(
- new IsisJdoSupportImpl(),
- new EventBusServiceJdo()
- );
+ ,"org.apache.isis.core.runtime.services"
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
+ );
}
private static IsisConfiguration testConfiguration() {