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 16:53:43 UTC
[15/16] ISIS-833: completing the reorg of services into modules.
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-devutils/impl/src/main/java/org/apache/isis/core/metamodel/services/devutils/MetaModelRow.java
----------------------------------------------------------------------
diff --git a/core/module-devutils/impl/src/main/java/org/apache/isis/core/metamodel/services/devutils/MetaModelRow.java b/core/module-devutils/impl/src/main/java/org/apache/isis/core/metamodel/services/devutils/MetaModelRow.java
new file mode 100644
index 0000000..5af35fc
--- /dev/null
+++ b/core/module-devutils/impl/src/main/java/org/apache/isis/core/metamodel/services/devutils/MetaModelRow.java
@@ -0,0 +1,234 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.core.metamodel.services.devutils;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.SortedSet;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Strings;
+import com.google.common.collect.Sets;
+
+import org.apache.isis.applib.util.ObjectContracts;
+import org.apache.isis.core.commons.lang.StringExtensions;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.metamodel.facets.actions.choices.ActionChoicesFacet;
+import org.apache.isis.core.metamodel.facets.actions.defaults.ActionDefaultsFacet;
+import org.apache.isis.core.metamodel.facets.hide.HiddenFacet;
+import org.apache.isis.core.metamodel.facets.param.autocomplete.ActionParameterAutoCompleteFacet;
+import org.apache.isis.core.metamodel.facets.param.choices.ActionParameterChoicesFacet;
+import org.apache.isis.core.metamodel.facets.param.defaults.ActionParameterDefaultsFacet;
+import org.apache.isis.core.metamodel.facets.properties.autocomplete.PropertyAutoCompleteFacet;
+import org.apache.isis.core.metamodel.facets.properties.choices.PropertyChoicesFacet;
+import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
+import org.apache.isis.core.progmodel.facets.actions.validate.ActionValidationFacet;
+import org.apache.isis.core.progmodel.facets.collections.validate.CollectionValidateAddToFacet;
+import org.apache.isis.core.progmodel.facets.collections.validate.CollectionValidateRemoveFromFacet;
+import org.apache.isis.core.progmodel.facets.members.disabled.DisabledFacet;
+import org.apache.isis.core.progmodel.facets.properties.validate.PropertyValidateFacet;
+
+public class MetaModelRow implements Comparable<MetaModelRow>{
+
+ enum MemberType {
+ PROPERTY,
+ COLLECTION,
+ ACTION;
+ }
+
+ private final ObjectSpecification spec;
+ private final MemberType memberType;
+ private final ObjectMember member;
+ private ObjectAction action;
+
+ MetaModelRow(ObjectSpecification spec, OneToOneAssociation property) {
+ this.spec = spec;
+ this.member = property;
+ this.memberType = MemberType.PROPERTY;
+ }
+
+ MetaModelRow(ObjectSpecification spec, OneToManyAssociation collection) {
+ this.spec = spec;
+ this.member = collection;
+ this.memberType = MemberType.COLLECTION;
+ }
+
+ MetaModelRow(ObjectSpecification spec, ObjectAction action) {
+ this.spec = spec;
+ this.member = this.action = action;
+ this.memberType = MemberType.ACTION;
+ }
+
+ public String getClassType() {
+ boolean service = false;
+ for(ObjectSpecification subspecs: spec.subclasses()) {
+ service = service || subspecs.isService();
+ }
+ return service || spec.isService() ?"2 Service":spec.isValue()?"3 Value":spec.isParentedOrFreeCollection()?"4 Collection":"1 Object";
+ }
+ public String getClassName() {
+ final String fullIdentifier = spec.getFullIdentifier();
+ final int lastDot = fullIdentifier.lastIndexOf(".");
+ return lastDot>0 && lastDot < fullIdentifier.length()-1
+ ?fullIdentifier.substring(lastDot+1,fullIdentifier.length())
+ :fullIdentifier;
+ }
+ public String getPackageName() {
+ final String fullIdentifier = spec.getFullIdentifier();
+ final int lastDot = fullIdentifier.lastIndexOf(".");
+ return lastDot>0?fullIdentifier.substring(0,lastDot):fullIdentifier;
+ }
+ public String getType() {
+ return memberType.name().toLowerCase();
+ }
+ public String getMemberName() {
+ return member.getId();
+ }
+ public String getNumParams() {
+ return action!=null?""+action.getParameterCount():"";
+ }
+ String getHidden() {
+ return interpret(HiddenFacet.class);
+ }
+ String getDisabled() {
+ return interpret(DisabledFacet.class);
+ }
+ public String getChoices() {
+ if(memberType == MemberType.PROPERTY) {
+ return interpretRowAndFacet(PropertyChoicesFacet.class);
+ } else if(memberType == MemberType.COLLECTION) {
+ return "";
+ } else {
+ final List<ObjectActionParameter> parameters = this.action.getParameters();
+ final SortedSet<String> interpretations = Sets.newTreeSet();
+ for (ObjectActionParameter param : parameters) {
+ final ActionParameterChoicesFacet facet = param.getFacet(ActionParameterChoicesFacet.class);
+ addIfNotEmpty(interpretFacet(facet), interpretations);
+ }
+ return !interpretations.isEmpty()? Joiner.on(";").join(interpretations) : interpretRowAndFacet(ActionChoicesFacet.class);
+ }
+ }
+ public String getAutoComplete() {
+ if(memberType == MemberType.PROPERTY) {
+ return interpretRowAndFacet(PropertyAutoCompleteFacet.class);
+ } else if(memberType == MemberType.COLLECTION) {
+ return "";
+ } else {
+ final List<ObjectActionParameter> parameters = this.action.getParameters();
+ final SortedSet<String> interpretations = Sets.newTreeSet();
+ for (ObjectActionParameter param : parameters) {
+ final ActionParameterAutoCompleteFacet facet = param.getFacet(ActionParameterAutoCompleteFacet.class);
+ addIfNotEmpty(interpretFacet(facet), interpretations);
+ }
+ return !interpretations.isEmpty()? Joiner.on(";").join(interpretations) : "";
+ }
+ }
+ String getDefault() {
+ if(memberType == MemberType.PROPERTY) {
+ return interpretRowAndFacet(PropertyDefaultFacet.class);
+ } else if(memberType == MemberType.COLLECTION) {
+ return "";
+ } else {
+ final List<ObjectActionParameter> parameters = this.action.getParameters();
+ final SortedSet<String> interpretations = Sets.newTreeSet();
+ for (ObjectActionParameter param : parameters) {
+ final ActionParameterDefaultsFacet facet = param.getFacet(ActionParameterDefaultsFacet.class);
+ addIfNotEmpty(interpretFacet(facet), interpretations);
+ }
+ return !interpretations.isEmpty()? Joiner.on(";").join(interpretations) : interpretRowAndFacet(ActionDefaultsFacet.class);
+ }
+ }
+ String getValidate() {
+ if(memberType == MemberType.PROPERTY) {
+ return interpretRowAndFacet(PropertyValidateFacet.class);
+ } else if(memberType == MemberType.COLLECTION) {
+ final SortedSet<String> interpretations = Sets.newTreeSet();
+ addIfNotEmpty(interpretRowAndFacet(CollectionValidateAddToFacet.class), interpretations);
+ addIfNotEmpty(interpretRowAndFacet(CollectionValidateRemoveFromFacet.class), interpretations);
+ return !interpretations.isEmpty()? Joiner.on(";").join(interpretations) : "";
+ } else {
+ return interpretRowAndFacet(ActionValidationFacet.class);
+ }
+ }
+
+ static Object header() {
+ return "classType,packageName,className,memberType,memberName,numParams,hidden,disabled,choices,autoComplete,default,validate";
+ }
+
+ String asTextCsv() {
+ return Joiner.on(",").join(
+ getClassType(),
+ getPackageName(),
+ getClassName(),
+ getType(),
+ getMemberName(),
+ getNumParams(),
+ getHidden(),
+ getDisabled(),
+ getChoices(),
+ getAutoComplete(),
+ getDefault(),
+ getValidate());
+ }
+
+ private String interpretRowAndFacet(Class<? extends Facet> facetClass) {
+ final Facet facet = member.getFacet(facetClass);
+ return interpretFacet(facet);
+ }
+
+ private static void addIfNotEmpty(final String str, final SortedSet<String> set) {
+ if(!Strings.isNullOrEmpty(str)) {
+ set.add(str);
+ }
+ }
+
+ private String interpret(final Class<? extends Facet> cls) {
+ return interpretFacet(member.getFacet(cls));
+ }
+
+ private static String interpretFacet(final Facet facet) {
+ if (facet == null || facet.isNoop()) {
+ return "";
+ }
+ if (facet instanceof ImperativeFacet) {
+ ImperativeFacet imperativeFacet = (ImperativeFacet) facet;
+ return imperativeFacet.getMethods().get(0).getName();
+ }
+ final String name = facet.getClass().getSimpleName();
+ if (ignore(name)) {
+ return "";
+ }
+ final String abbr = StringExtensions.toAbbreviation(name);
+ return abbr.length()>0 ? abbr : name;
+ }
+
+ protected static boolean ignore(final String name) {
+ return Arrays.asList("PropertyValidateFacetDefault","PropertyDefaultFacetDerivedFromDefaultedFacet").contains(name);
+ }
+
+ @Override
+ public int compareTo(MetaModelRow o) {
+ return ObjectContracts.compare(this, o, "classType,className,type desc,memberName");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-publishingeventserializer-ro/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java
----------------------------------------------------------------------
diff --git a/core/module-publishingeventserializer-ro/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java b/core/module-publishingeventserializer-ro/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java
index a95a934..07c19c5 100644
--- a/core/module-publishingeventserializer-ro/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java
+++ b/core/module-publishingeventserializer-ro/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/eventserializer/RestfulObjectsSpecEventSerializer.java
@@ -56,12 +56,14 @@ public class RestfulObjectsSpecEventSerializer implements EventSerializer {
//region > init, shutdown
private String baseUrl;
+ @Programmatic
@PostConstruct
public void init(Map<String,String> props) {
final String baseUrlFromConfig = props.get(BASE_URL_KEY);
baseUrl = baseUrlFromConfig != null? baseUrlFromConfig: BASE_URL_DEFAULT;
}
+ @Programmatic
@PreDestroy
public void shutdown() {
}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/pom.xml
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/pom.xml b/core/module-settings/applib/pom.xml
index efa3099..cf236ac 100644
--- a/core/module-settings/applib/pom.xml
+++ b/core/module-settings/applib/pom.xml
@@ -28,7 +28,7 @@
<artifactId>isis-module-settings-applib</artifactId>
- <name>Isis Module: Application and User Settings applib</name>
+ <name>Isis Module: App and User Settings applib</name>
<description>
API for the application and user settings module.
</description>
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSetting.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSetting.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSetting.java
new file mode 100644
index 0000000..06d4ec1
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSetting.java
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+
+
+public interface ApplicationSetting extends Setting {
+
+ String getKey();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsService.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsService.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsService.java
new file mode 100644
index 0000000..d6ded31
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsService.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import java.util.List;
+
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Named;
+
+public interface ApplicationSettingsService {
+
+ @MemberOrder(sequence="1")
+ ApplicationSetting find(@Named("Key") String key);
+
+ @MemberOrder(sequence="2")
+ List<ApplicationSetting> listAll();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsServiceRW.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsServiceRW.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsServiceRW.java
new file mode 100644
index 0000000..ae680eb
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/ApplicationSettingsServiceRW.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import org.joda.time.LocalDate;
+
+import org.apache.isis.applib.annotation.MemberOrder;
+
+public interface ApplicationSettingsServiceRW extends ApplicationSettingsService {
+
+ @MemberOrder(sequence="11")
+ ApplicationSetting newBoolean(String name, String description, Boolean defaultValue);
+ @MemberOrder(sequence="12")
+ ApplicationSetting newString(String name, String description, String defaultValue);
+ @MemberOrder(sequence="13")
+ ApplicationSetting newLocalDate(String name, String description, LocalDate defaultValue);
+ @MemberOrder(sequence="14")
+ ApplicationSetting newInt(String name, String description, Integer defaultValue);
+ @MemberOrder(sequence="15")
+ ApplicationSetting newLong(String name, String description, Long defaultValue);
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/Setting.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/Setting.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/Setting.java
new file mode 100644
index 0000000..3999d4c
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/Setting.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import org.joda.time.LocalDate;
+
+import org.apache.isis.applib.annotation.MemberOrder;
+
+
+/**
+ * Common supertype for both {@link ApplicationSetting} and {@link UserSetting}.
+ *
+ * <p>
+ * The difference between the two is in the settings unique identifier;
+ * the former just is uniquely identified by a single key (defined in
+ * {@link #getKey() this interface}, whereas the latter is uniquely identified by
+ * the combination of the key plus an identifier of the user.
+ */
+public interface Setting {
+
+ /**
+ * In the case of {@link ApplicationSetting}, this constitutes the unique identifier;
+ * for a {@link UserSetting}, the unique identifier is both this key plus an identifier
+ * for the user.
+ */
+ String getKey();
+
+ SettingType getType();
+ String getDescription();
+
+ String getValueRaw();
+
+ String valueAsString();
+ LocalDate valueAsLocalDate();
+ Integer valueAsInt();
+ Long valueAsLong();
+ Boolean valueAsBoolean();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingAbstract.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingAbstract.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingAbstract.java
new file mode 100644
index 0000000..6eb39c8
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingAbstract.java
@@ -0,0 +1,192 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import org.joda.time.LocalDate;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import org.apache.isis.applib.annotation.Hidden;
+import org.apache.isis.applib.annotation.Immutable;
+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.annotation.Programmatic;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.annotation.Where;
+
+
+/**
+ * Convenience class to implement {@link Setting}.
+ */
+@Immutable
+public abstract class SettingAbstract implements Setting {
+
+ public final static DateTimeFormatter DATE_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
+
+ @Title(sequence="10")
+ @MemberOrder(sequence="10")
+ public abstract String getKey();
+
+ @Optional
+ @MemberOrder(sequence="80")
+ public abstract String getDescription();
+
+ @MemberOrder(sequence="90")
+ public abstract SettingType getType();
+
+ // //////////////////////////////////////
+
+ @Title(prepend=" = ", sequence="30")
+ @MemberOrder(sequence="30")
+ @Hidden(where=Where.OBJECT_FORMS)
+ public abstract String getValueRaw();
+
+ // //////////////////////////////////////
+
+ @Programmatic
+ public String valueAsString() {
+ ensure(SettingType.STRING);
+ return getValueRaw();
+ }
+
+ // //////////////////////////////////////
+
+ @Programmatic
+ public LocalDate valueAsLocalDate() {
+ ensure(SettingType.LOCAL_DATE);
+ return parseValueAsLocalDate();
+ }
+
+ protected LocalDate parseValueAsLocalDate() {
+ return LocalDate.parse(getValueRaw(), DATE_FORMATTER);
+ }
+
+ // //////////////////////////////////////
+
+ @Programmatic
+ public Integer valueAsInt() {
+ ensure(SettingType.INT);
+ return parseValueAsInt();
+ }
+
+ protected int parseValueAsInt() {
+ return Integer.parseInt(getValueRaw());
+ }
+
+ // //////////////////////////////////////
+
+ @Programmatic
+ public Long valueAsLong() {
+ ensure(SettingType.LONG);
+ return parseValueAsLong();
+ }
+
+ protected long parseValueAsLong() {
+ return Long.parseLong(getValueRaw());
+ }
+
+ // //////////////////////////////////////
+
+ @Programmatic
+ public Boolean valueAsBoolean() {
+ ensure(SettingType.BOOLEAN);
+ return parseValueAsBoolean();
+ }
+
+ protected boolean parseValueAsBoolean() {
+ return Boolean.parseBoolean(getValueRaw());
+ }
+
+ // //////////////////////////////////////
+
+ @MemberOrder(sequence="30")
+ @Hidden(where=Where.ALL_TABLES)
+ @Named("Value")
+ public String getValueAsString() {
+ return getValueRaw();
+ }
+ public boolean hideValueAsString() {
+ return typeIsNot(SettingType.STRING);
+ }
+
+ // //////////////////////////////////////
+
+ @MemberOrder(sequence="30")
+ @Hidden(where=Where.ALL_TABLES)
+ @Named("Value")
+ public LocalDate getValueAsLocalDate() {
+ return parseValueAsLocalDate();
+ }
+ public boolean hideValueAsLocalDate() {
+ return typeIsNot(SettingType.LOCAL_DATE);
+ }
+
+ // //////////////////////////////////////
+
+
+ @MemberOrder(sequence="30")
+ @Hidden(where=Where.ALL_TABLES)
+ @Named("Value")
+ public Integer getValueAsInt() {
+ return parseValueAsInt();
+ }
+ public boolean hideValueAsInt() {
+ return typeIsNot(SettingType.INT);
+ }
+
+ // //////////////////////////////////////
+
+
+
+ @MemberOrder(sequence="30")
+ @Hidden(where=Where.ALL_TABLES)
+ @Named("Value")
+ public Long getValueAsLong() {
+ return parseValueAsLong();
+ }
+ public boolean hideValueAsLong() {
+ return typeIsNot(SettingType.LONG);
+ }
+
+ // //////////////////////////////////////
+
+
+
+ @MemberOrder(sequence="30")
+ @Hidden(where=Where.ALL_TABLES)
+ @Named("Value")
+ public Boolean getValueAsBoolean() {
+ return parseValueAsBoolean();
+ }
+ public boolean hideValueAsBoolean() {
+ return typeIsNot(SettingType.BOOLEAN);
+ }
+
+ // //////////////////////////////////////
+
+ private void ensure(SettingType settingType) {
+ if(typeIsNot(settingType)) {
+ throw new IllegalStateException("Setting '" + getKey() + "' is of type " + getType() + ", not of type " + settingType);
+ }
+ }
+
+ protected boolean typeIsNot(SettingType settingType) {
+ return getType() != settingType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingType.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingType.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingType.java
new file mode 100644
index 0000000..a652bf3
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/SettingType.java
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+
+public enum SettingType {
+
+ BOOLEAN,
+ INT,
+ LONG,
+ STRING,
+ LOCAL_DATE
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSetting.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSetting.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSetting.java
new file mode 100644
index 0000000..24ccf65
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSetting.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.security.UserMemento;
+
+
+
+public interface UserSetting extends Setting {
+
+ String getKey();
+
+ /**
+ * Typically as obtained from the {@link UserMemento#getName() UserMemento} class
+ * (accessible in turn from the {@link DomainObjectContainer#getUser() DomainObjectContainer}).
+ */
+ String getUser();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsService.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsService.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsService.java
new file mode 100644
index 0000000..f798e62
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsService.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import java.util.List;
+
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Named;
+
+public interface UserSettingsService {
+
+ @MemberOrder(sequence="1")
+ UserSetting find(@Named("User") String user, @Named("Key") String key);
+
+ @MemberOrder(sequence="2")
+ List<UserSetting> listAll();
+
+ @MemberOrder(sequence="3")
+ List<UserSetting> listAllFor(@Named("User") String user);
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsServiceRW.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsServiceRW.java b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsServiceRW.java
new file mode 100644
index 0000000..8b048ea
--- /dev/null
+++ b/core/module-settings/applib/src/main/java/org/apache/isis/applib/services/settings/UserSettingsServiceRW.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import org.joda.time.LocalDate;
+
+import org.apache.isis.applib.annotation.MemberOrder;
+
+public interface UserSettingsServiceRW extends UserSettingsService {
+
+ @MemberOrder(sequence="11")
+ UserSetting newBoolean(String user, String name, String description, Boolean defaultValue);
+ @MemberOrder(sequence="12")
+ UserSetting newString(String user, String name, String description, String defaultValue);
+ @MemberOrder(sequence="13")
+ UserSetting newLocalDate(String user, String name, String description, LocalDate defaultValue);
+ @MemberOrder(sequence="14")
+ UserSetting newInt(String user, String name, String description, Integer defaultValue);
+ @MemberOrder(sequence="15")
+ UserSetting newLong(String user, String name, String description, Long defaultValue);
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/applib/src/test/java/org/apache/isis/applib/services/settings/SettingAbstractTest.java
----------------------------------------------------------------------
diff --git a/core/module-settings/applib/src/test/java/org/apache/isis/applib/services/settings/SettingAbstractTest.java b/core/module-settings/applib/src/test/java/org/apache/isis/applib/services/settings/SettingAbstractTest.java
new file mode 100644
index 0000000..bc3693d
--- /dev/null
+++ b/core/module-settings/applib/src/test/java/org/apache/isis/applib/services/settings/SettingAbstractTest.java
@@ -0,0 +1,103 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.isis.applib.services.settings;
+
+import org.joda.time.LocalDate;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class SettingAbstractTest {
+
+ @Rule
+ public ExpectedException expectedExceptions = ExpectedException.none();
+
+ private static final class SettingAbstractForTesting extends SettingAbstract {
+ private final String key;
+ private final String valueRaw;
+ private final SettingType type;
+
+ public SettingAbstractForTesting(String key, String valueRaw, SettingType type) {
+ this.key = key;
+ this.valueRaw = valueRaw;
+ this.type = type;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public String getValueRaw() {
+ return valueRaw;
+ }
+
+ public SettingType getType() {
+ return type;
+ }
+
+ public String getDescription() {
+ return null;
+ }
+ }
+
+ private SettingAbstract strSetting;
+ private SettingAbstract intSetting;
+ private SettingAbstract localDateSetting;
+ private SettingAbstract longSetting;
+ private SettingAbstract boolSetting;
+
+ private LocalDate someLocalDate;
+
+ @Before
+ public void setUp() throws Exception {
+ someLocalDate = new LocalDate(2012,4,1);
+
+ strSetting = new SettingAbstractForTesting("strSetting", "ABC", SettingType.STRING);
+ intSetting = new SettingAbstractForTesting("intSetting", "" + Integer.MAX_VALUE, SettingType.INT);
+ localDateSetting = new SettingAbstractForTesting("localDateSetting", someLocalDate.toString(SettingAbstract.DATE_FORMATTER), SettingType.LOCAL_DATE);
+ longSetting = new SettingAbstractForTesting("longSetting", ""+Long.MAX_VALUE, SettingType.LONG);
+ boolSetting = new SettingAbstractForTesting("boolSetting", Boolean.TRUE.toString(), SettingType.BOOLEAN);
+ }
+
+ @Test
+ public void happyCases() {
+ assertThat(strSetting.valueAsString(), is("ABC"));
+ assertThat(intSetting.valueAsInt(), is(Integer.MAX_VALUE));
+ assertThat(localDateSetting.valueAsLocalDate(), is(someLocalDate));
+ assertThat(longSetting.valueAsLong(), is(Long.MAX_VALUE));
+ assertThat(boolSetting.valueAsBoolean(), is(true));
+ }
+
+ @Test
+ public void sadCases() {
+ expectedExceptions.expectMessage("Setting 'strSetting' is of type STRING, not of type INT");
+ strSetting.valueAsInt();
+ expectedExceptions.expectMessage("Setting 'strSetting' is of type STRING, not of type LONG");
+ strSetting.valueAsLong();
+ expectedExceptions.expectMessage("Setting 'strSetting' is of type STRING, not of type LOCAL_DATE");
+ strSetting.valueAsLocalDate();
+ expectedExceptions.expectMessage("Setting 'strSetting' is of type STRING, not of type BOOLEAN");
+ strSetting.valueAsBoolean();
+ expectedExceptions.expectMessage("Setting 'intSetting' is of type INT, not of type STRING");
+ intSetting.valueAsString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/impl-jdo/pom.xml
----------------------------------------------------------------------
diff --git a/core/module-settings/impl-jdo/pom.xml b/core/module-settings/impl-jdo/pom.xml
index ff6b97f..3840664 100644
--- a/core/module-settings/impl-jdo/pom.xml
+++ b/core/module-settings/impl-jdo/pom.xml
@@ -28,7 +28,7 @@
<artifactId>isis-module-settings-impl-jdo</artifactId>
- <name>Isis Module: Application and User Settings (JDO implementation)</name>
+ <name>Isis Module: App and User Settings (JDO impl)</name>
<description>
Implementation of the application and user settings module, persisting
to database (using JDO Objectstore)
@@ -116,8 +116,8 @@
<dependencies>
<dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-applib</artifactId>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-applib</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/module-settings/pom.xml
----------------------------------------------------------------------
diff --git a/core/module-settings/pom.xml b/core/module-settings/pom.xml
index c5908dd..4c4cd00 100644
--- a/core/module-settings/pom.xml
+++ b/core/module-settings/pom.xml
@@ -30,7 +30,7 @@
<artifactId>isis-module-settings</artifactId>
<packaging>pom</packaging>
- <name>Isis Module: Application and User Settings</name>
+ <name>Isis Module: App and User Settings</name>
<description>
Application and user settings
</description>
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/pom-jdo-enhance-all.xml
----------------------------------------------------------------------
diff --git a/core/pom-jdo-enhance-all.xml b/core/pom-jdo-enhance-all.xml
new file mode 100644
index 0000000..e96b5c9
--- /dev/null
+++ b/core/pom-jdo-enhance-all.xml
@@ -0,0 +1,130 @@
+<?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</groupId>
+ <artifactId>apache</artifactId>
+ <version>13</version>
+ <relativePath />
+ </parent>
+
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-jdo-enhance-all</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+
+ <packaging>pom</packaging>
+
+ <name>Apache Isis JDO Enhance All</name>
+
+ <description>
+ Utility to enhance all JDO projects with a single command:
+
+ mvn -f pom-jdo-enhance-all.xml datanucleus:enhance -o
+ </description>
+
+ <properties>
+ <datanucleus-maven-plugin.version>3.3.2</datanucleus-maven-plugin.version>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <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>
+
+ <profiles>
+ <profile>
+ <id>core</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>module-audit-jdo</module>
+ <module>module-command-jdo</module>
+ <module>module-publishing-jdo</module>
+ <module>module-settings/impl-jdo</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
index bc70fc9..6e091f8 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
@@ -44,8 +44,24 @@ public class ServicesInstallerFromAnnotation extends InstallerAbstract implement
public final static String PACKAGE_PREFIX_KEY = "isis.services.ServicesInstallerFromAnnotation.packagePrefix";
- private final ServiceInstantiator serviceInstantiator;
+ /**
+ * These package prefixes (core and modules) are always included.
+ *
+ * <p>
+ * It's important that any services annotated {@link org.apache.isis.applib.annotation.DomainService} and residing
+ * in any of these packages must have no side-effects and must have only one implementation.
+ */
+ public final static String PACKAGE_PREFIX_STANDARD =
+ ",org.apache.isis.applib" +
+ ",org.apache.isis.core.wrapper" +
+ ",org.apache.isis.core.metamodel.services" +
+ ",org.apache.isis.core.runtime.services" +
+ ",org.apache.isis.objectstore.jdo.applib.service" +
+ ",org.apache.isis.viewer.restfulobjects.rendering.eventserializer" +
+ ",org.apache.isis.objectstore.jdo.datanucleus.service.support" +
+ ",org.apache.isis.objectstore.jdo.datanucleus.service.eventbus";
+ private final ServiceInstantiator serviceInstantiator;
public ServicesInstallerFromAnnotation() {
this(new ServiceInstantiator());
@@ -84,11 +100,13 @@ public class ServicesInstallerFromAnnotation extends InstallerAbstract implement
if(packagePrefixes != null) {
return;
}
+
try {
- packagePrefixes = getConfiguration().getString(PACKAGE_PREFIX_KEY);
+ String packagePrefixes = getConfiguration().getString(PACKAGE_PREFIX_KEY);
if(Strings.isNullOrEmpty(packagePrefixes)) {
throw new IllegalStateException("Could not locate '" + PACKAGE_PREFIX_KEY + "' key in property files - aborting");
}
+ this.packagePrefixes = packagePrefixes + PACKAGE_PREFIX_STANDARD;
} finally {
initialized = true;
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/ScenarioExecutionForUnit.java
----------------------------------------------------------------------
diff --git a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/ScenarioExecutionForUnit.java b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/ScenarioExecutionForUnit.java
index 1d2accd..9b336ee 100644
--- a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/ScenarioExecutionForUnit.java
+++ b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/ScenarioExecutionForUnit.java
@@ -21,17 +21,14 @@ import org.jmock.Sequence;
import org.jmock.States;
import org.jmock.internal.ExpectationBuilder;
-import org.apache.isis.applib.services.wrapper.WrapperFactory;
-import org.apache.isis.core.wrapper.WrapperFactoryDefault;
-
/**
* An implementation of {@link ScenarioExecution} with which uses JMock to provide
* all services.
*
* <p>
* Expectations can be {@link Mockery#checking(org.jmock.internal.ExpectationBuilder) set}
- * and interactions {@link Mockery#assertIsSatisfied() verified} by
- * {@link #mockery() accessing} the underlying {@link Mockery}.
+ * and interactions {@link Mockery#assertIsSatisfied() verified} by accessing
+ * the underlying {@link Mockery}.
*/
public class ScenarioExecutionForUnit extends ScenarioExecution {
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java b/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
index 5d75f2a..9677c7f 100644
--- a/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
+++ b/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
@@ -162,6 +162,7 @@ public class ToDoItemSubscriptions {
@SuppressWarnings("unused")
private EventBusService eventBusService;
+ @Programmatic
public final void injectEventBusService(EventBusService eventBusService) {
eventBusService.register(this);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/example/application/quickstart_wicket_restful_jdo/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/pom.xml b/example/application/quickstart_wicket_restful_jdo/webapp/pom.xml
index bc184a2..1c23ef7 100644
--- a/example/application/quickstart_wicket_restful_jdo/webapp/pom.xml
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/pom.xml
@@ -201,6 +201,10 @@
<!-- isis modules -->
<dependency>
<groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
<artifactId>isis-module-audit-jdo</artifactId>
</dependency>
<dependency>
@@ -219,10 +223,6 @@
<groupId>org.apache.isis.module</groupId>
<artifactId>isis-module-settings-impl-jdo</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.isis.module</groupId>
- <artifactId>isis-module-devutils-impl</artifactId>
- </dependency>
<!-- to run using WebServer (optional) -->
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
index 4a08b08..3a1c2d4 100644
--- a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -159,15 +159,11 @@ isis.services.ServicesInstallerFromAnnotation.packagePrefix=app,\
dom.todo,\
fixture.todo,\
webapp.admin,\
- webapp.prototyping,\
- org.apache.isis.core.wrapper,\
- org.apache.isis.applib,\
- org.apache.isis.core.metamodel.services,\
- org.apache.isis.core.runtime.services
+ webapp.prototyping
#isis.services.prefix =
isis.services = \
- org.apache.isis.services.bookmark.BookmarkHolderActionContributions,\
+ org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,\
\
# customizable exception handling for JDO objectstore, \
org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,\
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/example/application/simple_wicket_restful_jdo/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simple_wicket_restful_jdo/webapp/pom.xml b/example/application/simple_wicket_restful_jdo/webapp/pom.xml
index e0c45cb..8ce4397 100644
--- a/example/application/simple_wicket_restful_jdo/webapp/pom.xml
+++ b/example/application/simple_wicket_restful_jdo/webapp/pom.xml
@@ -199,7 +199,10 @@
<!-- isis modules -->
-
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-impl</artifactId>
+ </dependency>
<!--
uncomment to enable auditing (@Audited),
persisted to database
@@ -249,17 +252,6 @@
</dependency>
-->
- <!--
- uncomment to use the DeveloperUtilitiesService service
- (see also declaration of its applib in dom module)
- -->
- <!--
- <dependency>
- <groupId>org.apache.isis.module</groupId>
- <artifactId>isis-module-devutils-impl</artifactId>
- </dependency>
- -->
-
<!-- to run using WebServer (optional) -->
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/8b6cab67/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
index b40eb7b..3fad9fa 100644
--- a/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -157,15 +157,11 @@ isis.reflector.facet-decorators=org.apache.isis.core.progmodel.facetdecorators.i
isis.services-installer=configuration-and-annotation
isis.services.ServicesInstallerFromAnnotation.packagePrefix=dom.simple,\
fixture.simple,\
- webapp.prototyping,\
- org.apache.isis.core.wrapper,\
- org.apache.isis.applib,\
- org.apache.isis.core.metamodel.services,\
- org.apache.isis.core.runtime.services
+ webapp.prototyping
#isis.services.prefix =
isis.services = \
- org.apache.isis.services.bookmark.BookmarkHolderActionContributions,\
+ org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,\
\
# customizable exception handling for JDO objectstore, \
org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,\