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/12/22 17:53:10 UTC
[1/5] isis git commit: ISIS-970: new annotations and deprecating old
Repository: isis
Updated Branches:
refs/heads/ISIS-970 [created] 0bdda6e67
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java
index 2f0aebd..0889c8b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java
@@ -45,7 +45,10 @@ import java.lang.annotation.Target;
* is unable to do so.
*
* @see Optional
+ *
+ * @deprecated - use {@link Property#cardinality()} and {@link Parameter#cardinality()} (with {@link org.apache.isis.applib.annotation.Cardinality#MANDATORY}) instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/MaxLength.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MaxLength.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MaxLength.java
index ccc5abe..0a17193 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MaxLength.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MaxLength.java
@@ -26,14 +26,17 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * The maximum entry length of a field.
- *
- * <p>
- * Can also be specified for types that are annotated as <tt>@Value</tt> types.
+ * @deprecated - use {@link Property#maxLength()} and {@link Parameter#maxLength()} instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface MaxLength {
+
+ /**
+ * @deprecated - use {@link Property#maxLength()} and {@link Parameter#maxLength()} instead.
+ */
+ @Deprecated
int value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
index 9434938..293608f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
@@ -31,11 +31,10 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
/**
- * A successor to {@link MemberGroups}, specifying the (groups of) members in a page,
- * column by column.
+ * Specifies the positioning of an entity's (groups of) properties and of its collections, on a page, column by column.
*
* <p>
- * The left column and middle column determine the ordering of the entity's properties. The
+ * The left column and middle column determine the ordering of the entity's (groups of) properties. The
* value of the {@link #left() left} list and {@link #middle() middle} list specify the order
* of the property groups (inferred from each property's {@link MemberOrder#name() MemberOrder.name} attribute.
*
@@ -46,6 +45,10 @@ import com.google.common.collect.Lists;
* <p>
* If both this annotation, {@link MemberGroupLayout}, and {@link MemberGroups} annotation
* are present on an entity, then this one takes precedence.
+ *
+ * <p>
+ * An alternative is to use the <code>Xxx.layout.json</code> file, where <code>Xxx</code> is the domain object name.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroups.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroups.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroups.java
index 92cc35e..9850cb1 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroups.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroups.java
@@ -26,21 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Names of groups of properties, as they appear as the <tt>name</tt> attribute
- * of the {@link MemberOrder} annotation.
- *
- * <p>
- * The order in this list determines the order that the property groups will be
- * rendered. By convention any {@link MemberOrder} that does not have a
- * {@link MemberOrder#name() name} is considered to be in the default group,
- * whose name is hard-coded as <i>General</i>.
- *
- * <p>
- * In the case of the Wicket viewer, these property groups are rendered down the
- * left hand side.
- *
- * @deprecated - use {@link MemberGroupLayout} instead. If both annotations are
- * present, then {@link MemberGroupLayout} takes precedence.
+ * @deprecated - use {@link MemberGroupLayout} instead. If both annotations are present, then {@link MemberGroupLayout} takes precedence.
*/
@Inherited
@Target({ ElementType.TYPE })
@@ -49,8 +35,9 @@ import java.lang.annotation.Target;
public @interface MemberGroups {
/**
- * Specifies the order of the member groups.
+ * @deprecated - use {@link org.apache.isis.applib.annotation.MemberGroupLayout#left()} instead.
*/
+ @Deprecated
String[] value() default {};
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
index a5b44ad..5b20a2a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
@@ -27,6 +27,10 @@ import java.lang.annotation.Target;
/**
* Indicates the position a method should be placed in.
+ *
+ * <p>
+ * An alternative is to use the <code>Xxx.layout.json</code> file, where <code>Xxx</code> is the domain object name.
+ * </p>
*/
@Inherited
@Target(ElementType.METHOD)
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/MinLength.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MinLength.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MinLength.java
index f24b39c..e7c256d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MinLength.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MinLength.java
@@ -26,11 +26,17 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * The minimum entry length of an autocomplete search argument.
+ * @deprecated - use {@link Parameter#minLength()} instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface MinLength {
+
+ /**
+ * @deprecated - use {@link Parameter#minLength()} instead.
+ */
+ @Deprecated
int value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/MultiLine.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MultiLine.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MultiLine.java
index 4235468..2bb4826 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MultiLine.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MultiLine.java
@@ -26,7 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * @deprecated - use instead {@link PropertyLayout#multiLine()} and {@link ParameterLayout#multiLine()}.
+ * @deprecated - use {@link PropertyLayout#multiLine()} and {@link ParameterLayout#multiLine()} instead .
*/
@Deprecated
@Inherited
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/MustSatisfy.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MustSatisfy.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MustSatisfy.java
index c139c3b..0494f50 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MustSatisfy.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MustSatisfy.java
@@ -28,8 +28,9 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.spec.Specification;
/**
- *
+ * @deprecated - use {@link Property#mustSatisfy()} or {@link Parameter#mustSatisfy()} instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@@ -40,6 +41,9 @@ public @interface MustSatisfy {
* <p>
* If more than one is provided, then all must be satisfied (in effect
* "AND"ed together).
+ *
+ * @deprecated - use {@link Property#mustSatisfy()} or {@link Parameter#mustSatisfy()} instead.
*/
+ @Deprecated
Class<? extends Specification>[] value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Named.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Named.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Named.java
index 09267fa..db864d9 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Named.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Named.java
@@ -33,5 +33,10 @@ import java.lang.annotation.Target;
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface Named {
+
+ /**
+ * @deprecated - use instead {@link DomainServiceLayout#named()}, {@link DomainObjectLayout#named()}, {@link PropertyLayout#named()}, {@link CollectionLayout#named()}, {@link ActionLayout#named()} and {@link ParameterLayout#named()}.
+ */
+ @Deprecated
String value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/NotPersistable.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/NotPersistable.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/NotPersistable.java
index 7bd25dc..65a9b35 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/NotPersistable.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/NotPersistable.java
@@ -32,6 +32,11 @@ import org.apache.isis.applib.util.Enums;
/**
* Indicates that an instance cannot be persisted by a user, but only
* programmatically.
+ *
+ * <p>
+ * This annotation is only partly supported by the framework, and may be deprecated
+ * in the future.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java
index 793c315..4bf9e6e 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java
@@ -26,15 +26,16 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Provides a unique abbreviation for the object type, eg "CUS" for Customer.
- *
- * <p>
- * This value, if specified, is used in the serialized form of the object's OID. An OID is
- * used by the framework to unique identify an object over time (same concept as a URN).
+ * @deprecated - use {@link DomainObject#objectType()} instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface ObjectType {
+ /**
+ * @deprecated - use {@link DomainObject#objectType()} instead.
+ */
+ @Deprecated
String value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
index 6abeead..27c535e 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
@@ -38,7 +38,10 @@ import java.lang.annotation.Target;
* rarely required; see the {@link Mandatory} annotation javadoc for further discussion.
*
* @see Mandatory
+ *
+ * @deprecated - use {@link Property#cardinality()} and {@link Parameter#cardinality()} (with {@link org.apache.isis.applib.annotation.Cardinality#OPTIONAL}) instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Paged.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Paged.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Paged.java
index 867c7fe..89e20f6 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Paged.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Paged.java
@@ -33,6 +33,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface Paged {
-
+
+ /**
+ * @deprecated - use instead {@link DomainObjectLayout#paged()} or {@link CollectionLayout#paged()}.
+ */
+ @Deprecated
int value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Parameter.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Parameter.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Parameter.java
new file mode 100644
index 0000000..a36f364
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Parameter.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import org.apache.isis.applib.spec.Specification;
+
+/**
+ * Domain semantics for domain object collection.
+ */
+@Inherited
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Parameter {
+
+ /**
+ * The minimum entry length of an autocomplete search argument.
+ *
+ * <p>
+ * The default value (<code>-1</code>) indicates that no minLength has been specified.
+ * </p>
+ */
+ int minLength() default -1;
+
+ // //////////////////////////////////////
+
+ /**
+ * The maximum entry length of a field.
+ *
+ * <p>
+ * The default value (<code>-1</code>) indicates that no maxLength has been specified.
+ * </p>
+ */
+ int maxLength() default -1;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Whether this parameter is mandatory or optional.
+ */
+ Cardinality cardinality() default Cardinality.DEFAULT;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * The {@link org.apache.isis.applib.spec.Specification}(s) to be satisfied by this parameter.
+ *
+ * <p>
+ * If more than one is provided, then all must be satisfied (in effect "AND"ed together).
+ * </p>
+ */
+ Class<? extends Specification>[] mustSatisfy();
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Regular expression pattern that a value should conform to, and can be formatted as.
+ */
+ String regexPattern() default "";
+
+ /**
+ * Pattern flags, as per {@link java.util.regex.Pattern#compile(String, int)} .
+ *
+ * <p>
+ * The default value, <code>0</code>, means that no flags have been specified.
+ * </p>
+ */
+ int regexPatternFlags() default 0;
+
+ /**
+ * Replacement text for the pattern in generated error message.
+ */
+ String regexPatternReplacement() default "";
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Parseable.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Parseable.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Parseable.java
index bc4e1db..e33ec4e 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Parseable.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Parseable.java
@@ -30,6 +30,10 @@ import org.apache.isis.applib.adapters.Parser;
/**
* Indicates that the class can be parsed either by delegating to an
* {@link Parser} or through some externally-configured mechanism.
+ *
+ * <p>
+ * Note: This annotation is only incompletely recognized by the framework, and may be deprecated in the future.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Plural.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Plural.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Plural.java
index 0b76c2e..f860839 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Plural.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Plural.java
@@ -33,5 +33,10 @@ import java.lang.annotation.Target;
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Plural {
+
+ /**
+ * @deprecated - use {@link DomainObjectLayout#plural()}.
+ */
+ @Deprecated
String value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java
index 5528691..7f749c0 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java
@@ -26,23 +26,7 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.eventbus.ActionInvokedEvent;
/**
- * Applies only to actions; any changes should be propagated as events to subscribers.
- * Only posted if no exception is thrown.
- *
- * <p>For example:
- * <pre>
- * public static class StartDateChangedEvent extends ActionInvokedEvent {}
- *
- * @PostsActionInvokedEvent(StartDateChangedEvent.class)
- * public void changeStartDate(final Date startDate) { ...}
- * </pre>
- *
- * <p>
- * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
- * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- *
- * @deprecated - use instead {@link ActionInteraction}.
+ * @deprecated - use instead {@link org.apache.isis.applib.annotation.Action#interaction()}.
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java
index 1ed3f62..4e673dc 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java
@@ -26,28 +26,7 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
/**
- * Applies only to collections; any changes should be propagated as events to subscribers.
- * Only posted after a successful validation.
- *
- * <p>For example:
- * <pre>
- * public class Order {
- * public static class OrderLineItemsAddedToEvent extends CollectionAddedToEvent {}
- *
- * @PostsCollectionAddedToEvent(OrderLineItemsAddedToEvent.class)
- * public SortedSet<OrderLine> getLineItems() { ...}
- * }
- * </pre>
- *
- * <p>
- * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
- * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- *
- * @see PostsCollectionRemovedFromEvent
- * @see CollectionInteraction
- *
- * @deprecated - use instead {@link CollectionInteraction}.
+ * @deprecated - use instead {@link Collection#interaction()}
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@@ -55,10 +34,8 @@ import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
public @interface PostsCollectionAddedToEvent {
/**
- * The subclass of {@link CollectionAddedToEvent} to be instantiated and posted.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * @deprecated - use {@link Collection#interaction()} instead.
*/
+ @Deprecated
Class<? extends CollectionAddedToEvent<?,?>> value() default CollectionAddedToEvent.Default.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java
index e369f8b..842d000 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java
@@ -27,28 +27,7 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.eventbus.CollectionRemovedFromEvent;
/**
- * Applies only to collections; any changes should be propagated as events to subscribers.
- * Only posted after a successful validation.
- *
- * <p>For example:
- * <pre>
- * public class Order {
- * public static class OrderLineItemsRemovedFromEvent extends CollectionRemovedFromEvent {}
- *
- * @PostsCollectionRemovedFromEvent(OrderLineItemsRemovedFromEvent.class)
- * public SortedSet<OrderLine> getLineItems() { ...}
- * }
- * </pre>
- *
- * <p>
- * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
- * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- *
- * @see PostsCollectionAddedToEvent
- * @see CollectionInteraction
- *
- * @deprecated - use instead {@link CollectionInteraction}.
+ * @deprecated - use instead {@link Collection#interaction()}
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@@ -56,11 +35,9 @@ import org.apache.isis.applib.services.eventbus.CollectionRemovedFromEvent;
public @interface PostsCollectionRemovedFromEvent {
/**
- * The subclass of {@link CollectionRemovedFromEvent} to be instantiated and posted.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * @deprecated - use {@link Collection#interaction()} instead.
*/
+ @Deprecated
Class<? extends CollectionRemovedFromEvent<?,?>> value() default CollectionRemovedFromEvent.Default.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsPropertyChangedEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsPropertyChangedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsPropertyChangedEvent.java
index 0bbb3a5..3af13b5 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsPropertyChangedEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsPropertyChangedEvent.java
@@ -27,23 +27,7 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.eventbus.PropertyChangedEvent;
/**
- * Applies only to properties; any changes should be propagated as events to subscribers.
- * Only posted after a successful validation.
- *
- * <p>For example:
- * <pre>
- * public static class StartDateChangedEvent extends PropertyChangedEvent {}
- *
- * @PostsPropertyChangedEvent(StartDateChangedEvent.class)
- * public LocalDate getStartDate() { ...}
- * </pre>
- *
- * <p>
- * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
- * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- *
- * @deprecated - use instead {@link PropertyInteraction}.
+ * @deprecated - use instead {@link org.apache.isis.applib.annotation.Property#interaction()}.
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@@ -51,11 +35,9 @@ import org.apache.isis.applib.services.eventbus.PropertyChangedEvent;
public @interface PostsPropertyChangedEvent {
/**
- * The subclass of {@link PropertyChangedEvent} to be instantiated and posted.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * @deprecated - use instead {@link org.apache.isis.applib.annotation.Property#interaction()}.
*/
+ @Deprecated
Class<? extends PropertyChangedEvent<?,?>> value() default PropertyChangedEvent.Default.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Property.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Property.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Property.java
new file mode 100644
index 0000000..c47e5fe
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Property.java
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import org.apache.isis.applib.services.eventbus.PropertyInteractionEvent;
+import org.apache.isis.applib.spec.Specification;
+
+/**
+ * Domain semantics for domain object property.
+ */
+@Inherited
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Property {
+
+ /**
+ * Indicates that changes to the property that should be posted to the
+ * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+ * {@link org.apache.isis.applib.services.eventbus.PropertyInteractionEvent}.
+ *
+ * <p>For example:
+ * </p>
+ *
+ * <pre>
+ * public static class StartDateChanged extends PropertyInteractionEvent {}
+ *
+ * @PropertyInteraction(StartDateChanged.class)
+ * public LocalDate getStartDate() { ...}
+ * </pre>
+ *
+ * <p>
+ * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated
+ * and resident in memory. The typical implementation of a domain service subscriber is to identify the impacted
+ * entities, load them using a repository, and then to delegate to the event to them.
+ * </p>
+ *
+ * <p>
+ * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * </p>
+ */
+ Class<? extends PropertyInteractionEvent<?,?>> interaction() default PropertyInteractionEvent.Default.class;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Indicates where the property is not visible to the user.
+ */
+ Where hidden() default Where.NOWHERE;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Indicates when the property is not editable by the user.
+ *
+ * <p>
+ * Note that if the owning domain object is {@link DomainObject#notEditable()}, then that will take precedence.
+ * </p>
+ */
+ Where disabled() default Where.NOWHERE;
+
+ /**
+ * If {@link #disabled()} (in any {@link org.apache.isis.applib.annotation.Where} context), then the reason
+ * to provide to the user as to why the property cannot be edited.
+ * @return
+ */
+ String disabledReason();
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * The maximum entry length of a field.
+ *
+ * <p>
+ * The default value (<code>-1</code>) indicates that no maxLength has been specified.
+ * </p>
+ */
+ int maxLength() default -1;
+
+ // //////////////////////////////////////
+
+
+ /**
+ * The {@link org.apache.isis.applib.spec.Specification}(s) to be satisfied by this property.
+ *
+ * <p>
+ * If more than one is provided, then all must be satisfied (in effect "AND"ed together).
+ * </p>
+ */
+ Class<? extends Specification>[] mustSatisfy();
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Indicates that the property should not be persisted.
+ */
+ boolean notPersisted() default false;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Whether this property is mandatory or optional.
+ */
+ Cardinality cardinality() default Cardinality.DEFAULT;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Regular expression pattern that a value should conform to, and can be formatted as.
+ */
+ String regexPattern() default "";
+
+ /**
+ * Pattern flags, as per {@link java.util.regex.Pattern#compile(String, int)} .
+ *
+ * <p>
+ * The default value, <code>0</code>, means that no flags have been specified.
+ * </p>
+ */
+ int regexPatternFlags() default 0;
+
+ /**
+ * Replacement text for the pattern in generated error message.
+ */
+ String regexPatternReplacement() default "";
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/PropertyInteraction.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PropertyInteraction.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PropertyInteraction.java
index d1a9b4d..80959da 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PropertyInteraction.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PropertyInteraction.java
@@ -26,39 +26,17 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.eventbus.PropertyInteractionEvent;
/**
- * Indicates that a member is (the accessor of) a property that should use a custom (subclass of)
- * {@link org.apache.isis.applib.services.eventbus.PropertyInteractionEvent} to propagate the phases of the
- * interaction with collaborators over the registered {@link org.apache.isis.applib.services.eventbus.EventBusService}.
-
- * Applies only to properties; any changes should be propagated as events to subscribers.
- * Only posted after a successful validation.
- *
- * <p>For example:
- * <pre>
- * public static class StartDateChanged extends PropertyInteractionEvent {}
- *
- * @PropertyInteraction(StartDateChanged.class)
- * public LocalDate getStartDate() { ...}
- * </pre>
- *
- * <p>
- * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
- * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- *
- * @see org.apache.isis.applib.annotation.PostsPropertyChangedEvent
- * @see com.google.common.eventbus.Subscribe
+ * @deprecated - use {@link Property#interaction()} instead.
*/
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface PropertyInteraction {
/**
- * The subclass of {@link org.apache.isis.applib.services.eventbus.PropertyInteractionEvent} to be instantiated and posted.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * @deprecated - use {@link Property#interaction()} instead.
*/
+ @Deprecated
Class<? extends PropertyInteractionEvent<?,?>> value() default PropertyInteractionEvent.Default.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedAction.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedAction.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedAction.java
index d51c48c..90b6967 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedAction.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedAction.java
@@ -25,26 +25,35 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;
-
import org.apache.isis.applib.Identifier;
import org.apache.isis.applib.services.publish.EventPayload;
-import org.apache.isis.applib.services.publish.PublishingService;
/**
- * Indicates that the action should be published.
- *
- * <p>
- * Requires that an implementation of the {@link PublishingService} is registered with the framework.
+ * @deprecated - use {@link Action#publishingPayloadFactory()} instead
*/
+@Deprecated
@Inherited
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface PublishedAction {
-
+
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Action.PublishingPayloadFactory} instead.
+ */
+ @Deprecated
public interface PayloadFactory {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Action.PublishingPayloadFactory#payloadFor(org.apache.isis.applib.Identifier, Object, java.util.List, Object)} instead.
+ */
+ @Deprecated
@Programmatic
public EventPayload payloadFor(Identifier actionIdentifier, Object target, List<Object> arguments, Object result);
}
+
+ /**
+ * @deprecated - use {@link Action#publishingPayloadFactory()} instead
+ */
+ @Deprecated
Class<? extends PayloadFactory> value() default PayloadFactory.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedObject.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedObject.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedObject.java
index 2d493b5..f24f5c1 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedObject.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PublishedObject.java
@@ -24,31 +24,55 @@ import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-
import org.apache.isis.applib.services.publish.EventPayload;
-import org.apache.isis.applib.services.publish.PublishingService;
/**
- * Indicates that changes to an object should be published.
- *
- * <p>
- * Requires that an implementation of the {@link PublishingService} is registered with the framework.
+ * @deprecated - use {@link org.apache.isis.applib.annotation.DomainObject#publishingPayloadFactory()} instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface PublishedObject {
-
+
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.DomainObject.PublishingChangeKind} instead.
+ */
+ @Deprecated
public enum ChangeKind {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.DomainObject.PublishingChangeKind#CREATE} instead.
+ */
+ @Deprecated
CREATE,
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.DomainObject.PublishingChangeKind#UPDATE} instead.
+ */
+ @Deprecated
UPDATE,
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.DomainObject.PublishingChangeKind#DELETE} instead.
+ */
+ @Deprecated
DELETE
}
-
+
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.DomainObject.PublishingPayloadFactory} instead.
+ */
+ @Deprecated
public interface PayloadFactory {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.DomainObject.PublishingPayloadFactory#payloadFor(Object, org.apache.isis.applib.annotation.DomainObject.PublishingChangeKind)} instead.
+ */
+ @Deprecated
@Programmatic
public EventPayload payloadFor(Object changedObject, ChangeKind changeKind);
}
-
+
+ /**
+ * @deprecated - use {@link DomainObject#publishingPayloadFactory()} instead.
+ */
+ @Deprecated
Class<? extends PayloadFactory> value() default PayloadFactory.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/QueryOnly.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/QueryOnly.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/QueryOnly.java
index ca187e4..4fbae07 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/QueryOnly.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/QueryOnly.java
@@ -26,11 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that an action is query only; invoking it will not modify any
- * domain object state.
- *
- * <p>
- * Deprecated - use <tt>@ActionSemantics(Of.SAFE)</tt> instead.
+ * @deprecated - use {@link Action#semantics()} instead.
*/
@Deprecated
@Inherited
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/RegEx.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/RegEx.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/RegEx.java
index 9d59ac0..8820570 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/RegEx.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/RegEx.java
@@ -26,20 +26,30 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Provides a regular expression that a value entry should conform to, and can
- * be formatted as.
- *
- * <p>
- * Can also be specified for types that are annotated as <tt>@Value</tt> types.
- * To apply, the value must have string semantics.
+ *
+ * @deprecated - use {@link Property#regexPattern()} or {@link Parameter#regexPattern()} instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface RegEx {
+
+ /**
+ * @deprecated - use {@link Property#regexPattern()} or {@link Parameter#regexPattern()} instead.
+ */
+ @Deprecated
String validation();
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Property#regexPatternReplacement()} or {@link Parameter#regexPatternReplacement()} instead.
+ */
String format() default "";
+ /**
+ /**
+ * @deprecated - use {@link Property#regexPatternFlags()} or {@link Parameter#regexPatternFlags()} instead.
+ */
+ @Deprecated
boolean caseSensitive() default true;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Render.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Render.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Render.java
index 01fad77..5e7e1da 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Render.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Render.java
@@ -34,13 +34,26 @@ import java.lang.annotation.Target;
@Deprecated
public @interface Render {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.CollectionLayout.RenderType} instead.
+ */
+ @Deprecated
public enum Type {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.CollectionLayout.RenderType#EAGERLY} instead.
+ */
+ @Deprecated
EAGERLY,
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.CollectionLayout.RenderType#LAZILY} instead.
+ */
+ @Deprecated
LAZILY
}
/**
* @deprecated - use instead {@link CollectionLayout#render()}
*/
+ @Deprecated
Type value() default Type.EAGERLY;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java
index 55a7cc0..16b6bb5 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java
@@ -26,7 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * @see Render - use instead
+ * @deprecated - use {@link CollectionLayout#render()} instead.
*/
@Deprecated
@Inherited
@@ -34,23 +34,37 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
public @interface Resolve {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.CollectionLayout.RenderType} instead.
+ */
+ @Deprecated
public enum Type {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.CollectionLayout.RenderType#EAGERLY} instead.
+ */
+ @Deprecated
EAGERLY(Render.Type.EAGERLY),
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.CollectionLayout.RenderType#LAZILY} instead.
+ */
+ @Deprecated
LAZILY(Render.Type.LAZILY);
-
+
private final org.apache.isis.applib.annotation.Render.Type renderType;
private Type(Render.Type renderType) {
this.renderType = renderType;
}
-
+
+ @Deprecated
public org.apache.isis.applib.annotation.Render.Type getRenderType() {
return renderType;
}
}
/**
- * How to resolve; by default {@value Type#EAGERLY}.
+ * @deprecated - use {@link CollectionLayout#render()} instead.
*/
+ @Deprecated
Type value() default Type.EAGERLY;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/SortedBy.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/SortedBy.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/SortedBy.java
index 5a58001..058ffa5 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/SortedBy.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/SortedBy.java
@@ -36,9 +36,9 @@ import java.util.Comparator;
public @interface SortedBy {
/**
- * The comparator to use to sort this collection; must be a {@link Comparator} able to
- * compare the types.
+ * @deprecated - use {@link CollectionLayout#sortedBy()} instead.
*/
+ @Deprecated
@SuppressWarnings("rawtypes")
Class value() default Comparator.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/TypeOf.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/TypeOf.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/TypeOf.java
index 46dc55e..03bb357 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/TypeOf.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/TypeOf.java
@@ -25,9 +25,18 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * @deprecated - use {@link Collection#typeOf()} instead.
+ */
+@Deprecated
@Inherited
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface TypeOf {
+
+ /**
+ * @deprecated - use {@link Collection#typeOf()} instead.
+ */
+ @Deprecated
Class<?> value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Value.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Value.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Value.java
index 28ef31e..4e46c5b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Value.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Value.java
@@ -54,6 +54,10 @@ import org.apache.isis.applib.adapters.ValueSemanticsProvider;
* @see Encodable
* @see Immutable
* @see EqualByContent
+ *
+ * <p>
+ * Note: This annotation is only incompletely recognized by the framework, and may be deprecated in the future.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/ViewModel.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ViewModel.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ViewModel.java
index b21ef20..388bf56 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ViewModel.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/ViewModel.java
@@ -22,14 +22,9 @@ package org.apache.isis.applib.annotation;
import java.lang.annotation.*;
/**
- * Indicates that an instance should be treated as a view model.
- *
- * <p>
- * All of its read/write and non-{@link Programmatic} properties (not collections) will be included in the
- * view model's memento; in other words as returned and marshalled by
- * {@link org.apache.isis.applib.ViewModel#viewModelMemento()}.
- * </p>
+ * @deprecated - use {@link DomainObject#viewModel()} instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/When.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/When.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/When.java
index e41e283..df7984b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/When.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/When.java
@@ -25,7 +25,12 @@ import org.apache.isis.applib.marker.ImmutableUntilPersisted;
import org.apache.isis.applib.marker.NeverImmutable;
import org.apache.isis.applib.util.Enums;
+/**
+ * @deprecated - the concept of evaluating whether a feature is hidden/disabled based on the object's persistence is deprecated and will (probably) be removed in a future version; use only {@link #ALWAYS}.
+ */
+@Deprecated
public enum When {
+
/**
* If annotated on a member, then that member should be disabled/hidden for persisted objects, but should be
* visible for transient objects.
@@ -33,7 +38,9 @@ public enum When {
* <p>
* If annotated on an class, then applies to all members of that class.
*/
+ @Deprecated
ONCE_PERSISTED,
+
/**
* If annotated on a member, then that member should be disabled/hidden for transient objects, but should be
* visible for persisted objects.
@@ -41,7 +48,9 @@ public enum When {
* <p>
* If annotated on an class, then applies to all members of that class.
*/
+ @Deprecated
UNTIL_PERSISTED,
+
/**
* If annotated on a member, then that member should be disabled/hidden both for objects that are persisted
* and for objects that are not persisted.
@@ -52,7 +61,9 @@ public enum When {
* <p>
* If annotated on an class, then applies to all members of that class.
*/
+ @Deprecated
ALWAYS,
+
/**
* If annotated on a member, then that member should not be disabled/hidden.
*
@@ -61,6 +72,7 @@ public enum When {
*/
NEVER;
+ @Deprecated
public String getFriendlyName() {
return Enums.getFriendlyNameOf(this);
}
@@ -69,6 +81,7 @@ public enum When {
* As an alternative to annotating an object with {@link Disabled}, can instead have the
* class implement a marker interface.
*/
+ @Deprecated
public static When lookupForMarkerInterface(final Class<?> cls) {
if (AlwaysImmutable.class.isAssignableFrom(cls)) {
return ALWAYS;
@@ -82,10 +95,12 @@ public enum When {
return null;
}
+ @Deprecated
public interface Persistable {
public boolean isTransient();
}
-
+
+ @Deprecated
public boolean appliesTo(final Persistable persistable) {
final boolean isTransient = persistable.isTransient();
return this == When.ALWAYS ||
[5/5] isis git commit: ISIS-970: adding null guards for enums.
Posted by da...@apache.org.
ISIS-970: adding null guards for enums.
Also: fixing a bit of javadoc.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0bdda6e6
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0bdda6e6
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0bdda6e6
Branch: refs/heads/ISIS-970
Commit: 0bdda6e67a3e115d3c4092cf65afec0c9e3eee95
Parents: 58f5540
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Dec 22 16:52:16 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Dec 22 16:52:16 2014 +0000
----------------------------------------------------------------------
.../java/org/apache/isis/applib/annotation/Action.java | 8 ++++++++
.../isis/applib/annotation/BulkInteractionContext.java | 2 ++
.../apache/isis/applib/annotation/CollectionLayout.java | 6 ++++--
.../org/apache/isis/applib/annotation/DomainObject.java | 2 ++
.../apache/isis/applib/annotation/MemberGroupLayout.java | 10 ++++------
5 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/0bdda6e6/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
index df52a3f..c498200 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
@@ -151,6 +151,7 @@ public @interface Action {
@Deprecated
public static ActionSemantics.Of from(final Semantics semantics) {
+ if(semantics == null) return null;
if(semantics == SAFE) return ActionSemantics.Of.SAFE;
if(semantics == IDEMPOTENT) return ActionSemantics.Of.IDEMPOTENT;
if(semantics == NON_IDEMPOTENT) return ActionSemantics.Of.NON_IDEMPOTENT;
@@ -160,6 +161,7 @@ public @interface Action {
@Deprecated
public static Semantics from(final ActionSemantics.Of semantics) {
+ if(semantics == null) return null;
if(semantics == ActionSemantics.Of.SAFE) return SAFE;
if(semantics == ActionSemantics.Of.IDEMPOTENT) return IDEMPOTENT;
if(semantics == ActionSemantics.Of.NON_IDEMPOTENT) return NON_IDEMPOTENT;
@@ -186,6 +188,7 @@ public @interface Action {
@Deprecated
public static Bulk.AppliesTo from(final BulkAppliesTo bulkAppliesTo) {
+ if(bulkAppliesTo == null) return null;
if(bulkAppliesTo == BULK_AND_REGULAR) return Bulk.AppliesTo.BULK_AND_REGULAR;
if(bulkAppliesTo == BULK_ONLY) return Bulk.AppliesTo.BULK_ONLY;
// shouldn't happen
@@ -194,6 +197,7 @@ public @interface Action {
@Deprecated
public static BulkAppliesTo from(final Bulk.AppliesTo appliesTo) {
+ if(appliesTo == null) return null;
if(appliesTo == Bulk.AppliesTo.BULK_AND_REGULAR) return BULK_AND_REGULAR;
if(appliesTo == Bulk.AppliesTo.BULK_ONLY) return BULK_ONLY;
// shouldn't happen
@@ -236,6 +240,7 @@ public @interface Action {
@Deprecated
public static CommandExecuteIn from(final Command.ExecuteIn executeIn) {
+ if(executeIn == null) return null;
if(executeIn == Command.ExecuteIn.FOREGROUND) return FOREGROUND;
if(executeIn == Command.ExecuteIn.BACKGROUND) return BACKGROUND;
// shouldn't happen
@@ -244,6 +249,7 @@ public @interface Action {
@Deprecated
public static Command.ExecuteIn from(final CommandExecuteIn commandExecuteIn) {
+ if(commandExecuteIn == null) return null;
if(commandExecuteIn == FOREGROUND) return Command.ExecuteIn.FOREGROUND;
if(commandExecuteIn == BACKGROUND) return Command.ExecuteIn.BACKGROUND;
// shouldn't happen
@@ -273,6 +279,7 @@ public @interface Action {
@Deprecated
public static CommandPersistence from(final Command.Persistence persistence) {
+ if(persistence == null) return null;
if(persistence == Command.Persistence.PERSISTED) return PERSISTED;
if(persistence == Command.Persistence.IF_HINTED) return IF_HINTED;
// shouldn't happen
@@ -281,6 +288,7 @@ public @interface Action {
@Deprecated
public static Command.Persistence from(final CommandPersistence commandPersistence) {
+ if(commandPersistence == null) return null;
if(commandPersistence == PERSISTED) return Command.Persistence.PERSISTED;
if(commandPersistence == IF_HINTED) return Command.Persistence.IF_HINTED;
// shouldn't happen
http://git-wip-us.apache.org/repos/asf/isis/blob/0bdda6e6/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
index 4ccb5c1..47c866e 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
@@ -47,6 +47,7 @@ public abstract class BulkInteractionContext {
@Deprecated
public static InvokedAs from(final Bulk.InteractionContext.InvokedAs invokedAs) {
+ if (invokedAs == null) return null;
if (invokedAs == Bulk.InteractionContext.InvokedAs.REGULAR) return REGULAR;
if (invokedAs == Bulk.InteractionContext.InvokedAs.BULK) return BULK;
// shouldn't happen
@@ -55,6 +56,7 @@ public abstract class BulkInteractionContext {
@Deprecated
public static Bulk.InteractionContext.InvokedAs from(final BulkInteractionContext.InvokedAs invokedAs) {
+ if (invokedAs == null) return null;
if (invokedAs == REGULAR) return Bulk.InteractionContext.InvokedAs.REGULAR;
if (invokedAs == BULK) return Bulk.InteractionContext.InvokedAs.BULK;
// shouldn't happen
http://git-wip-us.apache.org/repos/asf/isis/blob/0bdda6e6/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
index 1997937..f25753d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
@@ -95,14 +95,16 @@ public @interface CollectionLayout {
@Deprecated
public static Render.Type typeOf(final RenderType renderType) {
- if (renderType == EAGERLY) return Render.Type.EAGERLY;
- if (renderType == LAZILY) return Render.Type.LAZILY;
+ if(renderType == null) return null;
+ if(renderType == EAGERLY) return Render.Type.EAGERLY;
+ if(renderType == LAZILY) return Render.Type.LAZILY;
// shouldn't happen
throw new IllegalArgumentException("Unrecognized renderType: " + renderType);
}
@Deprecated
public static RenderType typeOf(final Render.Type renderType) {
+ if(renderType == null) return null;
if (renderType == Render.Type.EAGERLY) return RenderType.EAGERLY;
if (renderType == Render.Type.LAZILY) return RenderType.LAZILY;
// shouldn't happen
http://git-wip-us.apache.org/repos/asf/isis/blob/0bdda6e6/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
index c73f07f..d15ba81 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
@@ -74,6 +74,7 @@ public @interface DomainObject {
@Deprecated
public static PublishedObject.ChangeKind from(final PublishingChangeKind publishingChangeKind) {
+ if(publishingChangeKind == null) return null;
if(publishingChangeKind == CREATE) return PublishedObject.ChangeKind.CREATE;
if(publishingChangeKind == UPDATE) return PublishedObject.ChangeKind.UPDATE;
if(publishingChangeKind == DELETE) return PublishedObject.ChangeKind.DELETE;
@@ -82,6 +83,7 @@ public @interface DomainObject {
}
@Deprecated
public static PublishingChangeKind from(final PublishedObject.ChangeKind publishingChangeKind) {
+ if(publishingChangeKind == null) return null;
if(publishingChangeKind == PublishedObject.ChangeKind.CREATE) return CREATE;
if(publishingChangeKind == PublishedObject.ChangeKind.UPDATE) return UPDATE;
if(publishingChangeKind == PublishedObject.ChangeKind.DELETE) return DELETE;
http://git-wip-us.apache.org/repos/asf/isis/blob/0bdda6e6/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
index 293608f..e681a74 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/MemberGroupLayout.java
@@ -175,9 +175,8 @@ public @interface MemberGroupLayout {
* As {@link #left()}, but for the middle column in a page.
*
* <p>
- * If the value of this attribute is non-empty but the {@link #columnSpans()} specifies a zero size
- * (eg {@link ColumnSpans#_2_0_0_10}, then the framework will not boot and will instead indicate
- * a meta-model validation exception.
+ * If the value of this attribute is non-empty but the {@link #columnSpans()} specifies a zero size, then the
+ * framework will not boot and will instead indicate a meta-model validation exception.
*/
String[] middle() default {};
@@ -185,9 +184,8 @@ public @interface MemberGroupLayout {
* As {@link #right()}, but for the right column in a page.
*
* <p>
- * If the value of this attribute is non-empty but the {@link #columnSpans()} specifies a zero size
- * (eg {@link ColumnSpans#_2_0_0_10}, then the framework will not boot and will instead indicate
- * a meta-model validation exception.
+ * If the value of this attribute is non-empty but the {@link #columnSpans()} specifies a zero size, then the
+ * framework will not boot and will instead indicate a meta-model validation exception.
*/
String[] right() default {};
[4/5] isis git commit: ISIS-970: further fixes around
Bulk.InteractionContext.
Posted by da...@apache.org.
ISIS-970: further fixes around Bulk.InteractionContext.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/58f5540a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/58f5540a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/58f5540a
Branch: refs/heads/ISIS-970
Commit: 58f5540a73bb391f44cd03556ffbfa14c639b4f0
Parents: 0c89cc2
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Dec 22 16:12:24 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Dec 22 16:14:50 2014 +0000
----------------------------------------------------------------------
.../collection/bulk/BulkActionsLinkFactory.java | 2 +-
.../org/apache/isis/applib/annotation/Bulk.java | 35 +++++++++++++-
.../annotation/BulkInteractionContext.java | 49 ++++++++++++++++----
.../applib/annotation/CollectionLayout.java | 9 ++++
...onInvocationFacetForInteractionAbstract.java | 2 +-
.../specimpl/ObjectActionContributee.java | 2 +-
6 files changed, 86 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/58f5540a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
index ffbb76a..3f371e5 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
@@ -94,7 +94,7 @@ public final class BulkActionsLinkFactory implements ActionLinkFactory {
final BulkInteractionContext bulkInteractionContext = BulkInteractionContext.current.get();
if (bulkInteractionContext != null) {
- bulkInteractionContext.setInvokedAs(BulkInteractionContext.InvokedAs.BULK);
+ bulkInteractionContext.setActionInvokedAs(BulkInteractionContext.InvokedAs.BULK);
bulkInteractionContext.setDomainObjects(domainObjects);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/58f5540a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
index 08f0bc6..0db18f5 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
@@ -70,6 +70,28 @@ public @interface Bulk {
/**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.BulkInteractionContext.InvokedAs} instead.
+ */
+ @Deprecated
+ public static enum InvokedAs {
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.BulkInteractionContext.InvokedAs#BULK} instead.
+ */
+ @Deprecated
+ BULK,
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.BulkInteractionContext.InvokedAs#REGULAR} instead.
+ */
+ @Deprecated
+ REGULAR;
+ public boolean isRegular() { return this == REGULAR; }
+ public boolean isBulk() { return this == BULK; }
+
+
+ }
+
+
+ /**
* @deprecated - now a {@link RequestScoped} service
*/
@Deprecated
@@ -111,12 +133,23 @@ public @interface Bulk {
return new InteractionContext(InvokedAs.BULK, domainObjects);
}
+
+ // //////////////////////////////////////
+
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.BulkInteractionContext()}.
+ */
+ @Deprecated
+ public InteractionContext() {
+ super();
+ }
+
/**
* @deprecated - now a {@link RequestScoped} service
*/
@Deprecated
public InteractionContext(final InvokedAs invokedAs, final List<Object> domainObjects) {
- super(invokedAs, domainObjects);
+ super(BulkInteractionContext.InvokedAs.from(invokedAs), domainObjects);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/58f5540a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
index 15aca7d..4ccb5c1 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
@@ -44,6 +44,24 @@ public abstract class BulkInteractionContext {
REGULAR;
public boolean isRegular() { return this == REGULAR; }
public boolean isBulk() { return this == BULK; }
+
+ @Deprecated
+ public static InvokedAs from(final Bulk.InteractionContext.InvokedAs invokedAs) {
+ if (invokedAs == Bulk.InteractionContext.InvokedAs.REGULAR) return REGULAR;
+ if (invokedAs == Bulk.InteractionContext.InvokedAs.BULK) return BULK;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized bulk interactionContext invokedAs: " + invokedAs);
+ }
+
+ @Deprecated
+ public static Bulk.InteractionContext.InvokedAs from(final BulkInteractionContext.InvokedAs invokedAs) {
+ if (invokedAs == REGULAR) return Bulk.InteractionContext.InvokedAs.REGULAR;
+ if (invokedAs == BULK) return Bulk.InteractionContext.InvokedAs.BULK;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized bulk interactionContext invokedAs: " + invokedAs);
+ }
+
+
}
/**
@@ -75,7 +93,7 @@ public abstract class BulkInteractionContext {
// //////////////////////////////////////
- private InvokedAs invokedAs;
+ private InvokedAs actionInvokedAs;
private List<Object> domainObjects;
private int index;
@@ -90,16 +108,16 @@ public abstract class BulkInteractionContext {
* @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
*/
@Deprecated
- public BulkInteractionContext(final InvokedAs invokedAs, final Object... domainObjects) {
- this(invokedAs, Arrays.asList(domainObjects));
+ public BulkInteractionContext(final InvokedAs actionInvokedAs, final Object... domainObjects) {
+ this(actionInvokedAs, Arrays.asList(domainObjects));
}
/**
* @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
*/
@Deprecated
- public BulkInteractionContext(final InvokedAs invokedAs, final List<Object> domainObjects) {
- this.invokedAs = invokedAs;
+ public BulkInteractionContext(final InvokedAs actionInvokedAs, final List<Object> domainObjects) {
+ this.actionInvokedAs = actionInvokedAs;
this.domainObjects = domainObjects;
}
@@ -133,8 +151,8 @@ public abstract class BulkInteractionContext {
* <b>NOT API</b>: intended to be called only by the framework.
*/
@Programmatic
- public void setInvokedAs(InvokedAs invokedAs) {
- this.invokedAs = invokedAs;
+ public void setActionInvokedAs(InvokedAs actionInvokedAs) {
+ this.actionInvokedAs = actionInvokedAs;
}
/**
@@ -157,13 +175,26 @@ public abstract class BulkInteractionContext {
/**
+ * Whether this particular {@link org.apache.isis.applib.annotation.BulkInteractionContext} was applied as a {@link InvokedAs#BULK bulk} action
+ * (against each domain object in a list of domain objects) or as a {@link InvokedAs#REGULAR regular}
+ * action (against a single domain object).
+ */
+ @Programmatic
+ public BulkInteractionContext.InvokedAs getActionInvokedAs() {
+ return actionInvokedAs;
+ }
+
+ /**
* Whether this particular {@link org.apache.isis.applib.annotation.Bulk.InteractionContext} was applied as a {@link InvokedAs#BULK bulk} action
* (against each domain object in a list of domain objects) or as a {@link InvokedAs#REGULAR regular}
* action (against a single domain object).
+ *
+ * @deprecated - use {@link #getActionInvokedAs()} instead.
*/
+ @Deprecated
@Programmatic
- public InvokedAs getInvokedAs() {
- return invokedAs;
+ public Bulk.InteractionContext.InvokedAs getInvokedAs() {
+ return BulkInteractionContext.InvokedAs.from(actionInvokedAs);
}
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/58f5540a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
index 670d538..1997937 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
@@ -93,12 +93,21 @@ public @interface CollectionLayout {
EAGERLY,
LAZILY;
+ @Deprecated
public static Render.Type typeOf(final RenderType renderType) {
if (renderType == EAGERLY) return Render.Type.EAGERLY;
if (renderType == LAZILY) return Render.Type.LAZILY;
// shouldn't happen
throw new IllegalArgumentException("Unrecognized renderType: " + renderType);
}
+
+ @Deprecated
+ public static RenderType typeOf(final Render.Type renderType) {
+ if (renderType == Render.Type.EAGERLY) return RenderType.EAGERLY;
+ if (renderType == Render.Type.LAZILY) return RenderType.LAZILY;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized renderType: " + renderType);
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/58f5540a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
index 4e0ccaa..7c362c6 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
@@ -238,7 +238,7 @@ public abstract class ActionInvocationFacetForInteractionAbstract
bulkInteractionContext != null &&
bulkInteractionContext.getInvokedAs() == null) {
- bulkInteractionContext.setInvokedAs(BulkInteractionContext.InvokedAs.REGULAR);
+ bulkInteractionContext.setActionInvokedAs(BulkInteractionContext.InvokedAs.REGULAR);
bulkInteractionContext.setDomainObjects(Collections.singletonList(targetPojo));
}
http://git-wip-us.apache.org/repos/asf/isis/blob/58f5540a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
index 5a6fd61..dbcbbfc 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
@@ -188,7 +188,7 @@ public class ObjectActionContributee extends ObjectActionImpl implements Contrib
bulkInteractionContext != null &&
bulkInteractionContext.getInvokedAs() == null) {
- bulkInteractionContext.setInvokedAs(BulkInteractionContext.InvokedAs.REGULAR);
+ bulkInteractionContext.setActionInvokedAs(BulkInteractionContext.InvokedAs.REGULAR);
bulkInteractionContext.setDomainObjects(Collections.singletonList(contributee.getObject()));
}
[3/5] isis git commit: ISIS-970: fixing compile bugs with
Bulk.InteractionContext.
Posted by da...@apache.org.
ISIS-970: fixing compile bugs with Bulk.InteractionContext.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0c89cc29
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0c89cc29
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0c89cc29
Branch: refs/heads/ISIS-970
Commit: 0c89cc2959dd88c3fb422c8db0171d8f7c646e59
Parents: bad6d81
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Dec 22 15:38:36 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Dec 22 15:38:36 2014 +0000
----------------------------------------------------------------------
.../collection/bulk/BulkActionsLinkFactory.java | 7 +++--
.../annotation/BulkInteractionContext.java | 2 +-
...onInvocationFacetForInteractionAbstract.java | 6 ++---
.../specimpl/ObjectActionContributee.java | 15 +++++------
.../system/transaction/IsisTransaction.java | 28 +++++++++++++++-----
.../transaction/IsisTransactionManager.java | 6 ++---
.../system/transaction/IsisTransactionTest.java | 13 ++++++---
7 files changed, 47 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/0c89cc29/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
index 1ccbd22..ffbb76a 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
@@ -27,8 +27,7 @@ import org.apache.wicket.markup.html.link.AbstractLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.isis.applib.RecoverableException;
import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.annotation.Bulk.InteractionContext.InvokedAs;
+import org.apache.isis.applib.annotation.BulkInteractionContext;
import org.apache.isis.applib.services.command.Command;
import org.apache.isis.applib.services.command.Command.Executor;
import org.apache.isis.applib.services.command.CommandContext;
@@ -93,9 +92,9 @@ public final class BulkActionsLinkFactory implements ActionLinkFactory {
final List<Object> domainObjects = Lists.newArrayList(Iterables.transform(toggledAdapters, ObjectAdapter.Functions.getObject()));
- final Bulk.InteractionContext bulkInteractionContext = Bulk.InteractionContext.current.get();
+ final BulkInteractionContext bulkInteractionContext = BulkInteractionContext.current.get();
if (bulkInteractionContext != null) {
- bulkInteractionContext.setInvokedAs(InvokedAs.BULK);
+ bulkInteractionContext.setInvokedAs(BulkInteractionContext.InvokedAs.BULK);
bulkInteractionContext.setDomainObjects(domainObjects);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0c89cc29/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
index 7bd7410..15aca7d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
@@ -55,7 +55,7 @@ public abstract class BulkInteractionContext {
* @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
*/
@Deprecated
- public static final ThreadLocal<BulkInteractionContext> current = new ThreadLocal<BulkInteractionContext>();
+ public static final ThreadLocal<BulkInteractionContext> current = new ThreadLocal<>();
/**
* @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
http://git-wip-us.apache.org/repos/asf/isis/blob/0c89cc29/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
index 4855f98..4e0ccaa 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/interaction/ActionInvocationFacetForInteractionAbstract.java
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
import org.apache.isis.applib.NonRecoverableException;
import org.apache.isis.applib.RecoverableException;
import org.apache.isis.applib.ViewModel;
-import org.apache.isis.applib.annotation.Bulk;
+import org.apache.isis.applib.annotation.BulkInteractionContext;
import org.apache.isis.applib.clock.Clock;
import org.apache.isis.applib.services.background.ActionInvocationMemento;
import org.apache.isis.applib.services.background.BackgroundService;
@@ -223,7 +223,7 @@ public abstract class ActionInvocationFacetForInteractionAbstract
final ObjectAdapter targetAdapter,
final ObjectAdapter[] arguments) {
- final Bulk.InteractionContext bulkInteractionContext = getServicesInjector().lookupService(Bulk.InteractionContext.class);
+ final BulkInteractionContext bulkInteractionContext = getServicesInjector().lookupService(BulkInteractionContext.class);
try {
final Object[] executionParameters = new Object[arguments.length];
@@ -238,7 +238,7 @@ public abstract class ActionInvocationFacetForInteractionAbstract
bulkInteractionContext != null &&
bulkInteractionContext.getInvokedAs() == null) {
- bulkInteractionContext.setInvokedAs(Bulk.InteractionContext.InvokedAs.REGULAR);
+ bulkInteractionContext.setInvokedAs(BulkInteractionContext.InvokedAs.REGULAR);
bulkInteractionContext.setDomainObjects(Collections.singletonList(targetPojo));
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0c89cc29/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
index c50a9ca..5a6fd61 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionContributee.java
@@ -19,18 +19,15 @@ package org.apache.isis.core.metamodel.specloader.specimpl;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-
import com.google.common.collect.Lists;
-
import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.annotation.Bulk.InteractionContext.InvokedAs;
+import org.apache.isis.applib.annotation.BulkInteractionContext;
import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.filter.Filter;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.command.CommandContext;
import org.apache.isis.applib.services.command.Command.Executor;
+import org.apache.isis.applib.services.command.CommandContext;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.lang.ObjectExtensions;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -41,14 +38,14 @@ import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
import org.apache.isis.core.metamodel.facetapi.FacetUtil;
import org.apache.isis.core.metamodel.facetapi.MultiTypedFacet;
+import org.apache.isis.core.metamodel.facets.actions.bulk.BulkFacet;
+import org.apache.isis.core.metamodel.facets.actions.interaction.CommandUtil;
import org.apache.isis.core.metamodel.interactions.InteractionUtils;
import org.apache.isis.core.metamodel.interactions.UsabilityContext;
import org.apache.isis.core.metamodel.interactions.VisibilityContext;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
import org.apache.isis.core.metamodel.spec.feature.ObjectMemberContext;
-import org.apache.isis.core.metamodel.facets.actions.bulk.BulkFacet;
-import org.apache.isis.core.metamodel.facets.actions.interaction.CommandUtil;
public class ObjectActionContributee extends ObjectActionImpl implements ContributeeMember {
@@ -184,14 +181,14 @@ public class ObjectActionContributee extends ObjectActionImpl implements Contrib
// this code also exists in ActionInvocationFacetViaMethod
// we need to repeat it here because the target adapter should be the contributee, not the contributing service.
- final Bulk.InteractionContext bulkInteractionContext = getServicesProvider().lookupService(Bulk.InteractionContext.class);
+ final BulkInteractionContext bulkInteractionContext = getServicesProvider().lookupService(BulkInteractionContext.class);
final BulkFacet bulkFacet = getFacet(BulkFacet.class);
if (bulkFacet != null &&
bulkInteractionContext != null &&
bulkInteractionContext.getInvokedAs() == null) {
- bulkInteractionContext.setInvokedAs(InvokedAs.REGULAR);
+ bulkInteractionContext.setInvokedAs(BulkInteractionContext.InvokedAs.REGULAR);
bulkInteractionContext.setDomainObjects(Collections.singletonList(contributee.getObject()));
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0c89cc29/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
index aeea2db..cd72d5f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
@@ -20,8 +20,12 @@
package org.apache.isis.core.runtime.system.transaction;
import java.sql.Timestamp;
-import java.util.*;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
+import java.util.UUID;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
@@ -34,7 +38,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.isis.applib.Identifier;
import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.annotation.Bulk;
+import org.apache.isis.applib.annotation.BulkInteractionContext;
import org.apache.isis.applib.annotation.PublishedAction;
import org.apache.isis.applib.annotation.PublishedObject;
import org.apache.isis.applib.annotation.PublishedObject.ChangeKind;
@@ -46,7 +50,14 @@ import org.apache.isis.applib.services.command.Command2;
import org.apache.isis.applib.services.command.CommandContext;
import org.apache.isis.applib.services.command.spi.CommandService;
import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
-import org.apache.isis.applib.services.publish.*;
+import org.apache.isis.applib.services.publish.EventMetadata;
+import org.apache.isis.applib.services.publish.EventPayload;
+import org.apache.isis.applib.services.publish.EventPayloadForActionInvocation;
+import org.apache.isis.applib.services.publish.EventPayloadForObjectChanged;
+import org.apache.isis.applib.services.publish.EventSerializer;
+import org.apache.isis.applib.services.publish.EventType;
+import org.apache.isis.applib.services.publish.ObjectStringifier;
+import org.apache.isis.applib.services.publish.PublishingService;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.authentication.MessageBroker;
import org.apache.isis.core.commons.components.TransactionScopedComponent;
@@ -74,7 +85,12 @@ import org.apache.isis.core.metamodel.spec.feature.Contributed;
import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
import org.apache.isis.core.runtime.persistence.ObjectPersistenceException;
import org.apache.isis.core.runtime.persistence.PersistenceConstants;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.*;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.PersistenceCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.PublishingServiceWithDefaultPayloadFactories;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.SaveObjectCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.TransactionalResource;
import org.apache.isis.core.runtime.system.context.IsisContext;
import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
@@ -867,9 +883,9 @@ public class IsisTransaction implements TransactionScopedComponent {
}
private void closeOtherApplibServicesIfConfigured() {
- Bulk.InteractionContext bic = getServiceOrNull(Bulk.InteractionContext.class);
+ BulkInteractionContext bic = getServiceOrNull(BulkInteractionContext.class);
if(bic != null) {
- Bulk.InteractionContext.current.set(null);
+ BulkInteractionContext.current.set(null);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0c89cc29/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
index bdb56e8..54c6eb0 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
@@ -23,7 +23,7 @@ import java.util.List;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.isis.applib.annotation.Bulk;
+import org.apache.isis.applib.annotation.BulkInteractionContext;
import org.apache.isis.applib.clock.Clock;
import org.apache.isis.applib.services.command.Command;
import org.apache.isis.applib.services.command.CommandContext;
@@ -287,9 +287,9 @@ public class IsisTransactionManager implements SessionScopedComponent {
private void initOtherApplibServicesIfConfigured() {
- final Bulk.InteractionContext bic = getServiceOrNull(Bulk.InteractionContext.class);
+ final BulkInteractionContext bic = getServiceOrNull(BulkInteractionContext.class);
if(bic != null) {
- Bulk.InteractionContext.current.set(bic);
+ BulkInteractionContext.current.set(bic);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0c89cc29/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
index ed7c66a..e2c9e23 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
@@ -25,7 +25,7 @@ import org.jmock.auto.Mock;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.apache.isis.applib.annotation.Bulk;
+import org.apache.isis.applib.annotation.BulkInteractionContext;
import org.apache.isis.applib.annotation.PublishedAction;
import org.apache.isis.applib.annotation.PublishedObject;
import org.apache.isis.applib.services.audit.AuditingService3;
@@ -39,8 +39,13 @@ import org.apache.isis.core.commons.matchers.IsisMatchers;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
import org.apache.isis.core.runtime.persistence.ObjectPersistenceException;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.*;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.PersistenceCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.PersistenceCommandContext;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.PojoAdapterBuilder;
import org.apache.isis.core.runtime.persistence.objectstore.transaction.PojoAdapterBuilder.Persistence;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.SaveObjectCommand;
import org.apache.isis.core.runtime.services.eventbus.EventBusServiceDefault;
import org.apache.isis.core.runtime.system.persistence.ObjectStore;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
@@ -87,7 +92,7 @@ public class IsisTransactionTest {
@Mock
private PublishedAction.PayloadFactory mockPublishedActionPayloadFactory;
@Mock
- private Bulk.InteractionContext mockBulkInteractionContext;
+ private BulkInteractionContext mockBulkInteractionContext;
@Mock
private EventBusServiceDefault mockEventBusServiceDefault;
@@ -202,7 +207,7 @@ public class IsisTransactionTest {
allowing(mockServicesInjector).lookupService(PublishedAction.PayloadFactory.class);
will(returnValue(mockPublishedActionPayloadFactory));
- allowing(mockServicesInjector).lookupService(Bulk.InteractionContext.class);
+ allowing(mockServicesInjector).lookupService(BulkInteractionContext.class);
will(returnValue(mockBulkInteractionContext));
allowing(mockServicesInjector).lookupService(EventBusServiceDefault.class);
[2/5] isis git commit: ISIS-970: new annotations and deprecating old
Posted by da...@apache.org.
ISIS-970: new annotations and deprecating old
new annotations: @DomainObject, @Property, @Collection, @Action, @Parameter.
Other annotations have been deprecated.
Note that there are no new facet factories yet
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/bad6d813
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/bad6d813
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/bad6d813
Branch: refs/heads/ISIS-970
Commit: bad6d813ddd6adcffec9efe39aadb8b7ca819d67
Parents: de823cf
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Dec 22 15:08:40 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Dec 22 15:08:40 2014 +0000
----------------------------------------------------------------------
.../apache/isis/applib/annotation/Action.java | 350 +++++++++++++++++++
.../applib/annotation/ActionInteraction.java | 27 +-
.../isis/applib/annotation/ActionOrder.java | 11 +-
.../isis/applib/annotation/ActionSemantics.java | 56 +--
.../isis/applib/annotation/Aggregated.java | 11 +-
.../apache/isis/applib/annotation/Audited.java | 20 +-
.../isis/applib/annotation/AutoComplete.java | 26 +-
.../isis/applib/annotation/Bookmarkable.java | 10 +-
.../apache/isis/applib/annotation/Bounded.java | 3 +-
.../org/apache/isis/applib/annotation/Bulk.java | 191 ++--------
.../annotation/BulkInteractionContext.java | 212 +++++++++++
.../isis/applib/annotation/Cardinality.java | 35 ++
.../isis/applib/annotation/Collection.java | 100 ++++++
.../annotation/CollectionInteraction.java | 30 +-
.../applib/annotation/CollectionLayout.java | 30 +-
.../apache/isis/applib/annotation/Command.java | 56 ++-
.../apache/isis/applib/annotation/CssClass.java | 6 +
.../isis/applib/annotation/CssClassFa.java | 9 +
.../isis/applib/annotation/Defaulted.java | 4 +
.../isis/applib/annotation/DescribedAs.java | 7 +
.../apache/isis/applib/annotation/Disabled.java | 16 +-
.../isis/applib/annotation/DomainObject.java | 207 +++++++++++
.../applib/annotation/DomainObjectLayout.java | 18 +
.../isis/applib/annotation/Encodable.java | 5 +
.../isis/applib/annotation/EqualByContent.java | 4 +
.../isis/applib/annotation/FieldOrder.java | 4 +-
.../apache/isis/applib/annotation/Hidden.java | 26 +-
.../isis/applib/annotation/Idempotent.java | 11 +-
.../apache/isis/applib/annotation/Ignore.java | 11 +-
.../isis/applib/annotation/Immutable.java | 23 +-
.../isis/applib/annotation/Mandatory.java | 3 +
.../isis/applib/annotation/MaxLength.java | 11 +-
.../applib/annotation/MemberGroupLayout.java | 9 +-
.../isis/applib/annotation/MemberGroups.java | 19 +-
.../isis/applib/annotation/MemberOrder.java | 4 +
.../isis/applib/annotation/MinLength.java | 8 +-
.../isis/applib/annotation/MultiLine.java | 2 +-
.../isis/applib/annotation/MustSatisfy.java | 6 +-
.../apache/isis/applib/annotation/Named.java | 5 +
.../isis/applib/annotation/NotPersistable.java | 5 +
.../isis/applib/annotation/ObjectType.java | 11 +-
.../apache/isis/applib/annotation/Optional.java | 3 +
.../apache/isis/applib/annotation/Paged.java | 6 +-
.../isis/applib/annotation/Parameter.java | 99 ++++++
.../isis/applib/annotation/Parseable.java | 4 +
.../apache/isis/applib/annotation/Plural.java | 5 +
.../annotation/PostsActionInvokedEvent.java | 18 +-
.../annotation/PostsCollectionAddedToEvent.java | 29 +-
.../PostsCollectionRemovedFromEvent.java | 29 +-
.../annotation/PostsPropertyChangedEvent.java | 24 +-
.../apache/isis/applib/annotation/Property.java | 155 ++++++++
.../applib/annotation/PropertyInteraction.java | 30 +-
.../isis/applib/annotation/PublishedAction.java | 23 +-
.../isis/applib/annotation/PublishedObject.java | 42 ++-
.../isis/applib/annotation/QueryOnly.java | 6 +-
.../apache/isis/applib/annotation/RegEx.java | 22 +-
.../apache/isis/applib/annotation/Render.java | 13 +
.../apache/isis/applib/annotation/Resolve.java | 22 +-
.../apache/isis/applib/annotation/SortedBy.java | 4 +-
.../apache/isis/applib/annotation/TypeOf.java | 9 +
.../apache/isis/applib/annotation/Value.java | 4 +
.../isis/applib/annotation/ViewModel.java | 9 +-
.../org/apache/isis/applib/annotation/When.java | 17 +-
63 files changed, 1632 insertions(+), 543 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
new file mode 100644
index 0000000..df52a3f
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
@@ -0,0 +1,350 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.List;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
+import org.apache.isis.applib.services.publish.EventPayload;
+import org.apache.isis.applib.util.Enums;
+
+/**
+ * Domain semantics for domain object collection.
+ */
+@Inherited
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Action {
+
+
+ /**
+ * Indicates that an invocation of the action should be posted to the
+ * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+ * {@link org.apache.isis.applib.services.eventbus.ActionInteractionEvent}.
+ *
+ * <p>For example:
+ * </p>
+ *
+ * <pre>
+ * public static class StartDateChangedEvent extends ActionInvokedEvent {}
+ *
+ * @PostsActionInvokedEvent(StartDateChangedEvent.class)
+ * public void changeStartDate(final Date startDate) { ...}
+ * </pre>
+ *
+ * <p>
+ * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
+ * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
+ * load them using a repository, and then to delegate to the event to them.
+ * </p>
+ *
+ * <p>
+ * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * </p>
+ */
+ Class<? extends ActionInteractionEvent<?>> interaction() default ActionInteractionEvent.Default.class;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Indicates when the action is not visible to the user.
+ *
+ * <p>
+ * For a repository action, is equivalent to {@link NotContributed} and also
+ * {@link NotInServiceMenu}.
+ * </p>
+ *
+ * <p>
+ * If a repository action is contributed as a property, then the {@link Hidden#where() where}
+ * attribute can be used to optionally hide the contributed property in a table (using
+ * {@link Where#ALL_TABLES}, {@link Where#STANDALONE_TABLES}, {@link Where#PARENTED_TABLES}
+ * as appropriate).
+ * </p>
+ */
+ Where hidden() default Where.NOWHERE;
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * Indicates when an action is not invokable by the user.
+ */
+ Where disabled() default Where.NOWHERE;
+
+
+ /**
+ * If {@link #disabled()} (in any {@link org.apache.isis.applib.annotation.Where} context), then the reason to provide to the user as to why the
+ * collection cannot be edited.
+ * @return
+ */
+ String disabledReason();
+
+
+ // //////////////////////////////////////
+
+ enum Semantics {
+
+ /**
+ * Safe, with no side-effects.
+ *
+ * <p>
+ * In other words, a query-only action. By definition, is also idempotent.
+ */
+ SAFE,
+ /**
+ * Post-conditions are always the same, irrespective as to how many times called.
+ *
+ * <p>
+ * An example might be <tt>placeOrder()</tt>, that is a no-op if the order has already been placed.
+ */
+ IDEMPOTENT,
+ /**
+ * Neither safe nor idempotent; every invocation is likely to change the state of the object.
+ *
+ * <p>
+ * An example is increasing the quantity of a line item in an Order by 1.
+ */
+ NON_IDEMPOTENT;
+
+ public String getFriendlyName() {
+ return Enums.getFriendlyNameOf(this);
+ }
+
+ public String getCamelCaseName() {
+ return Enums.enumToCamelCase(this);
+ }
+
+ /**
+ * {@link #SAFE} is idempotent in nature, as well as, obviously, {@link #IDEMPOTENT}.
+ */
+ public boolean isIdempotentInNature() {
+ return this == SAFE || this == IDEMPOTENT;
+ }
+
+ public boolean isSafe() {
+ return this == SAFE;
+ }
+
+ @Deprecated
+ public static ActionSemantics.Of from(final Semantics semantics) {
+ if(semantics == SAFE) return ActionSemantics.Of.SAFE;
+ if(semantics == IDEMPOTENT) return ActionSemantics.Of.IDEMPOTENT;
+ if(semantics == NON_IDEMPOTENT) return ActionSemantics.Of.NON_IDEMPOTENT;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized of: " + semantics);
+ }
+
+ @Deprecated
+ public static Semantics from(final ActionSemantics.Of semantics) {
+ if(semantics == ActionSemantics.Of.SAFE) return SAFE;
+ if(semantics == ActionSemantics.Of.IDEMPOTENT) return IDEMPOTENT;
+ if(semantics == ActionSemantics.Of.NON_IDEMPOTENT) return NON_IDEMPOTENT;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized semantics: " + semantics);
+ }
+ }
+
+
+ /**
+ * The action semantics, either {@link org.apache.isis.applib.annotation.Action.Semantics#SAFE safe} (query-only),
+ * {@link org.apache.isis.applib.annotation.Action.Semantics#IDEMPOTENT idempotent} or
+ * {@link org.apache.isis.applib.annotation.Action.Semantics#NON_IDEMPOTENT non-idempotent}.
+ */
+ Semantics semantics() default Semantics.NON_IDEMPOTENT;
+
+
+ // //////////////////////////////////////
+
+
+ enum BulkAppliesTo {
+ BULK_AND_REGULAR,
+ BULK_ONLY;
+
+ @Deprecated
+ public static Bulk.AppliesTo from(final BulkAppliesTo bulkAppliesTo) {
+ if(bulkAppliesTo == BULK_AND_REGULAR) return Bulk.AppliesTo.BULK_AND_REGULAR;
+ if(bulkAppliesTo == BULK_ONLY) return Bulk.AppliesTo.BULK_ONLY;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized appliesTo: " + bulkAppliesTo);
+ }
+
+ @Deprecated
+ public static BulkAppliesTo from(final Bulk.AppliesTo appliesTo) {
+ if(appliesTo == Bulk.AppliesTo.BULK_AND_REGULAR) return BULK_AND_REGULAR;
+ if(appliesTo == Bulk.AppliesTo.BULK_ONLY) return BULK_ONLY;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized appliesTo: " + appliesTo);
+ }
+ }
+
+ /**
+ * Indicates the (entity) action should be used only against many objects in a collection.
+ *
+ * <p>
+ * Bulk actions have a number of constraints:
+ * <ul>
+ * <li>It must take no arguments
+ * <li>It cannot be hidden (any annotations or supporting methods to that effect will be
+ * ignored).
+ * <li>It cannot be disabled (any annotations or supporting methods to that effect will be
+ * ignored).
+ * </ul>
+ *
+ * <p>
+ * Has no meaning if annotated on an action of a domain service.
+ */
+ BulkAppliesTo bulk() default BulkAppliesTo.BULK_AND_REGULAR;
+
+
+ // //////////////////////////////////////
+
+ enum CommandExecuteIn {
+ /**
+ * Execute synchronously in the "foreground", wait for the results.
+ */
+ FOREGROUND,
+ /**
+ * Execute "asynchronously" through the {@link org.apache.isis.applib.services.background.BackgroundCommandService}, returning (if possible) the
+ * persisted {@link org.apache.isis.applib.services.command.Command command} object as a placeholder to the
+ * result.
+ */
+ BACKGROUND;
+
+ @Deprecated
+ public static CommandExecuteIn from(final Command.ExecuteIn executeIn) {
+ if(executeIn == Command.ExecuteIn.FOREGROUND) return FOREGROUND;
+ if(executeIn == Command.ExecuteIn.BACKGROUND) return BACKGROUND;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized : executeIn" + executeIn);
+ }
+
+ @Deprecated
+ public static Command.ExecuteIn from(final CommandExecuteIn commandExecuteIn) {
+ if(commandExecuteIn == FOREGROUND) return Command.ExecuteIn.FOREGROUND;
+ if(commandExecuteIn == BACKGROUND) return Command.ExecuteIn.BACKGROUND;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized : executeIn" + commandExecuteIn);
+ }
+
+ }
+
+ enum CommandPersistence {
+ /**
+ * (If the configured {@link org.apache.isis.applib.services.command.spi.CommandService} supports it), indicates that the
+ * {@link org.apache.isis.applib.services.command.Command Command} object should be persisted.
+ */
+ PERSISTED,
+ /**
+ * (If the configured {@link org.apache.isis.applib.services.command.spi.CommandService} supports it), indicates that the
+ * {@link org.apache.isis.applib.services.command.Command Command} object should only be persisted if
+ * another service, such as the {@link org.apache.isis.applib.services.background.BackgroundCommandService}, hints that it should.
+ */
+ IF_HINTED,
+ /**
+ * (Even if the configured {@link org.apache.isis.applib.services.command.spi.CommandService} supports it), indicates that the
+ * {@link org.apache.isis.applib.services.command.Command Command} object should <i>not</i> be persisted (even if
+ * another service, such as the {@link org.apache.isis.applib.services.background.BackgroundCommandService}, hints that it should).
+ */
+ NOT_PERSISTED;
+
+ @Deprecated
+ public static CommandPersistence from(final Command.Persistence persistence) {
+ if(persistence == Command.Persistence.PERSISTED) return PERSISTED;
+ if(persistence == Command.Persistence.IF_HINTED) return IF_HINTED;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized : persistence" + persistence);
+ }
+
+ @Deprecated
+ public static Command.Persistence from(final CommandPersistence commandPersistence) {
+ if(commandPersistence == PERSISTED) return Command.Persistence.PERSISTED;
+ if(commandPersistence == IF_HINTED) return Command.Persistence.IF_HINTED;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized : persistence" + commandPersistence);
+ }
+ }
+
+
+ boolean command() default false;
+
+ /**
+ * How the {@link org.apache.isis.applib.services.command.Command Command} object provided by the
+ * {@link org.apache.isis.applib.services.command.CommandContext CommandContext} domain service should be persisted.
+ */
+ CommandPersistence commandPersistence() default CommandPersistence.PERSISTED;
+
+ /**
+ * How the command/action should be executed.
+ *
+ * <p>
+ * If the corresponding {@link org.apache.isis.applib.services.command.Command Command} object is persisted,
+ * then its {@link org.apache.isis.applib.services.command.Command#getExecuteIn() invocationType} property
+ * will be set to this value.
+ * </p>
+ */
+ CommandExecuteIn commandExecuteIn() default CommandExecuteIn.FOREGROUND;
+
+ /**
+ * If set to <tt>true</tt>, acts as an override to <i>disable</i> command semantics for the action when it is
+ * otherwise (eg through configuration) configured as the default.
+ */
+ boolean commandDisabled() default false;
+
+
+ // //////////////////////////////////////
+
+ interface PublishingPayloadFactory {
+
+ @Programmatic
+ public EventPayload payloadFor(Identifier actionIdentifier, Object target, List<Object> arguments, Object result);
+
+ /**
+ * Adapter to subclass if have an existing {@link org.apache.isis.applib.annotation.PublishedObject.PayloadFactory}.
+ */
+ @Deprecated
+ public abstract class Adapter implements PublishingPayloadFactory {
+
+ private final PublishedAction.PayloadFactory payloadFactory;
+
+ public Adapter(final PublishedAction.PayloadFactory payloadFactory) {
+ this.payloadFactory = payloadFactory;
+ }
+
+ @Override
+ public EventPayload payloadFor(Identifier actionIdentifier, Object target, List<Object> arguments, Object result) {
+ return payloadFactory.payloadFor(actionIdentifier, target, arguments, result);
+ }
+ }
+ }
+
+
+ // TODO: factor out PayloadFactory.Default so similar to interaction
+ Class<? extends PublishingPayloadFactory> publishingPayloadFactory() default PublishingPayloadFactory.class;
+
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java
index bd88d5e..32354b2 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java
@@ -26,36 +26,17 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
/**
- * Indicates that a member is an action that should use a custom
- * (subclass of) {@link org.apache.isis.applib.services.eventbus.ActionInteractionEvent} to propagate the phases
- * of the interaction with collaborators over the registered
- * {@link org.apache.isis.applib.services.eventbus.EventBusService}.
- *
- * <p>For example:
- * <pre>
- * public static class ChangeStartDate extends ActionInteractionEvent {}
- *
- * @ActionInteraction(ChangedStartDate.class)
- * public void changeStartDate(final Date startDate) { ...}
- * </pre>
- *
- * <p>
- * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
- * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- *
- * @see org.apache.isis.applib.annotation.PostsActionInvokedEvent
+ * @deprecated - see {@link Action#interaction()}.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
+@Deprecated
public @interface ActionInteraction {
/**
- * The subclass of {@link ActionInteractionEvent} to be instantiated and posted.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * @deprecated - see {@link Action#interaction()}.
*/
+ @Deprecated
Class<? extends ActionInteractionEvent<?>> value() default ActionInteractionEvent.Default.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionOrder.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionOrder.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionOrder.java
index 920afe9..ad9ee37 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionOrder.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionOrder.java
@@ -26,14 +26,17 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates the order that actions should be grouped/displayed in.
- *
- * @deprecated - use {@link MemberOrder} instead.
+ * @deprecated - use {@link MemberOrder} or <code>Xxx.layout.json</code> instead.
*/
+@Deprecated
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
-@Deprecated
public @interface ActionOrder {
+
+ /**
+ * @deprecated - use {@link MemberOrder} or <code>Xxx.layout.json</code> instead.
+ */
+ @Deprecated
String value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionSemantics.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionSemantics.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionSemantics.java
index cd87c51..6b4c982 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionSemantics.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionSemantics.java
@@ -25,60 +25,76 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.apache.isis.applib.util.Enums;
-
/**
- * Indicates that an instance cannot be persisted by a user, but only
- * programmatically.
+ * @deprecated - see {@link Action#semantics()}.
*/
+@Deprecated
@Inherited
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface ActionSemantics {
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics}
+ */
+ @Deprecated
public enum Of {
/**
- * Safe, with no side-effects.
- *
- * <p>
- * In other words, a query-only action. By definition, is also idempotent.
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics#SAFE}
*/
+ @Deprecated
SAFE,
/**
- * Post-conditions are always the same, irrespective as to how many times called.
- *
- * <p>
- * An example might be <tt>placeOrder()</tt>, that is a no-op if the order has already been placed.
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics#IDEMPOTENT}
*/
+ @Deprecated
IDEMPOTENT,
/**
- * Neither safe nor idempotent; every invocation is likely to change the state of the object.
- *
- * <p>
- * An example is increasing the quantity of a line item in an Order by 1.
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics#IDEMPOTENT}
*/
+ @Deprecated
NON_IDEMPOTENT;
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics#getFriendlyName()}
+ */
+ @Deprecated
public String getFriendlyName() {
- return Enums.getFriendlyNameOf(this);
+ return Action.Semantics.from(this).getFriendlyName();
+ //return Enums.getFriendlyNameOf(this);
}
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics#getCamelCaseName()}
+ */
+ @Deprecated
public String getCamelCaseName() {
- return Enums.enumToCamelCase(this);
+ return Action.Semantics.from(this).getCamelCaseName();
}
/**
* {@link #SAFE} is idempotent in nature, as well as, obviously, {@link #IDEMPOTENT}.
+ *
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics#isIdempotentInNature()}
*/
+ @Deprecated
public boolean isIdempotentInNature() {
- return this == SAFE || this == IDEMPOTENT;
+ return Action.Semantics.from(this).isIdempotentInNature();
}
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.Semantics#isSafe()}.
+ */
+ @Deprecated
public boolean isSafe() {
- return this == SAFE;
+ return Action.Semantics.from(this).isSafe();
}
}
+ /**
+ * @deprecated - use {@link Action#semantics()} instead.
+ */
+ @Deprecated
Of value() default Of.NON_IDEMPOTENT;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Aggregated.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Aggregated.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Aggregated.java
index 2afdad3..a8fbaff 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Aggregated.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Aggregated.java
@@ -31,11 +31,12 @@ import java.lang.annotation.Target;
*
* <p>
* This is/should be interpreted by viewers as meaning that references to the
- * object may not be shared between instances. So for example in the DnD viewer
- * an aggregated object may not be drag/dropped into an empty "slot".
- * Instead, the user would need to use copy/paste.
- *
- * @see Value
+ * object may not be shared between instances.
+ *
+ * <p>
+ * Note: This annotation is not recognized by the Wicket viewer, Restful Objects viewer or JDO Objectstore,
+ * and may be deprecated in the future.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Audited.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Audited.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Audited.java
index 6081f40..5726579 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Audited.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Audited.java
@@ -25,29 +25,19 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.apache.isis.applib.services.audit.AuditingService3;
-
/**
- * Indicates that the entity should be audited.
- *
- * <p>
- * Requires that an implementation of the {@link AuditingService3} is registered with the framework.
- *
- * <p>
- * Check that the configured object store supports the annotation. For example, the
- * JDO objectstore does support this annotation, but others may not.
- *
- * <p>
- * Alternatively can use the similarly named {@link org.apache.isis.applib.marker.Auditable marker interface}.
+ * @deprecated - see {@link DomainObject#auditing()}.
*/
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface Audited {
+
/**
- * If set to <tt>true</tt>, acts as an override to <i>disable</i> auditing when it is otherwise (eg through
- * configuration) configured as the default.
+ * @deprecated - use {@link DomainObject#auditing()} instead.
*/
+ @Deprecated
boolean disabled() default false;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/AutoComplete.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/AutoComplete.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/AutoComplete.java
index b48608a..c08d544 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/AutoComplete.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/AutoComplete.java
@@ -28,21 +28,18 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.bookmark.Bookmark;
/**
- * Specifies a repository action to use to support auto-complete.
+ * @deprecated - see {@link DomainObject#autoCompleteRepository()}.
*/
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface AutoComplete {
/**
- * A candidate match for the auto-complete.
- *
- * <p>
- * The auto-complete action is required to return a list of these instances.
- * The title can be used by the viewer in the drop down, while the
- * {@link #getBookmark()} identifies the object.
+ * @deprecated - never implemented, also not required.
*/
+ @Deprecated
public static class Candidate {
private final String title;
private final Bookmark bookmark;
@@ -59,20 +56,15 @@ public @interface AutoComplete {
}
/**
- * The class of the repository to use.
- *
- * <p>
- * It is sufficient to specify an interface rather than a concrete type.
+ * @deprecated - see {@link DomainObject#autoCompleteRepository()}.
*/
+ @Deprecated
Class<?> repository();
/**
- * The action to use in order to perform the auto-complete search
- * (defaults to "autoComplete").
- *
- * <p>
- * The action is required to accept a single string parameter, and must return
- *
+ * @deprecated - see {@link DomainObject#autoCompleteAction()}.
*/
+ @Deprecated
String action() default "autoComplete";
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Bookmarkable.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bookmarkable.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bookmarkable.java
index 360c085..c338d76 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bookmarkable.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bookmarkable.java
@@ -30,12 +30,18 @@ import java.lang.annotation.Target;
*
* <p>
* Three {@link BookmarkPolicy policies} are defined, which control how bookmarked entities are organized.
- * These have no meaning for bookmarkable actions.
+ * These have no meaning for bookmarkable actions.
+ *
+ * @deprecated - see {@link DomainObjectLayout#bookmarkable()}.
*/
@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Bookmarkable {
-
+
+ /**
+ * @deprecated - see {@link DomainObjectLayout#bookmarkable()}.
+ */
+ @Deprecated
BookmarkPolicy value() default BookmarkPolicy.AS_ROOT;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Bounded.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bounded.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bounded.java
index 4ee5034..38f4708 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bounded.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bounded.java
@@ -26,10 +26,11 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that the class has a bounded, or finite, set of instances.
+ * @deprecated - use {@link DomainObject#bounded()} instead.
*/
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface Bounded {
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
index f97790a..08f0bc6 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Bulk.java
@@ -26,63 +26,48 @@ import java.util.List;
import javax.enterprise.context.RequestScoped;
/**
- * Indicates the (entity) action should be used only against many objects
- * in a collection.
- *
- * <p>
- * Bulk actions have a number of constraints:
- * <ul>
- * <li>It must take no arguments
- * <li>It cannot be hidden (any annotations or supporting methods to that effect will be
- * ignored).
- * <li>It cannot be disabled (any annotations or supporting methods to that effect will be
- * ignored).
- * </ul>
- *
- * <p>
- * Has no meaning if annotated on an action of a domain service.
+ * @deprecated - use {@link Action#bulk()} instead.
*/
@Inherited
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface Bulk {
-
+
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.BulkAppliesTo}
+ */
+ @Deprecated
public static enum AppliesTo {
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.BulkAppliesTo#BULK_AND_REGULAR}
+ */
+ @Deprecated
BULK_AND_REGULAR,
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.BulkAppliesTo#BULK_ONLY}
+ */
+ @Deprecated
BULK_ONLY
}
-
+
+ /**
+ * @deprecated - see {@link Action#bulk()}.
+ */
+ @Deprecated
AppliesTo value() default AppliesTo.BULK_AND_REGULAR;
-
+
+
+ // //////////////////////////////////////
+
/**
- * This service (API and implementation) provides access to context information about a bulk action invocation.
- *
- * <p>
- * This implementation has no UI and there is only one implementation (this class) in applib, so it is annotated
- * with {@link org.apache.isis.applib.annotation.DomainService}. This means that it is automatically registered
- * and available for use; no further configuration is required.
+ * @deprecated - see {@link BulkInteractionContext}.
*/
+ @Deprecated
@DomainService
@RequestScoped
- public static class InteractionContext {
+ public static class InteractionContext extends BulkInteractionContext {
- public static enum InvokedAs {
- BULK,
- REGULAR;
- public boolean isRegular() { return this == REGULAR; }
- public boolean isBulk() { return this == BULK; }
- }
-
- /**
- * Intended only to be set only by the framework.
- *
- * <p>
- * Will be populated while a bulk action is being invoked.
- *
- * @deprecated - now a {@link RequestScoped} service
- */
- @Deprecated
- public static final ThreadLocal<InteractionContext> current = new ThreadLocal<InteractionContext>();
/**
* @deprecated - now a {@link RequestScoped} service
@@ -99,142 +84,40 @@ public @interface Bulk {
public static void with(final Runnable runnable, final InvokedAs invokedAs, final Object... domainObjects) {
throw new RuntimeException("No longer supported - instead inject Bulk.InteractionContext as service");
}
-
+
// //////////////////////////////////////
-
+
/**
- * Intended only to support unit testing.
+ * @deprecated - see {@link BulkInteractionContext#regularAction(Object)}.
*/
+ @Deprecated
public static InteractionContext regularAction(Object domainObject) {
return new InteractionContext(InvokedAs.REGULAR, Collections.singletonList(domainObject));
}
-
+
/**
- * Intended only to support unit testing.
+ * @deprecated - see {@link BulkInteractionContext#bulkAction(Object...)}.
*/
+ @Deprecated
public static InteractionContext bulkAction(Object... domainObjects) {
return bulkAction(Arrays.asList(domainObjects));
}
/**
- * Intended only to support unit testing.
+ * @deprecated - see {@link BulkInteractionContext#bulkAction(java.util.List)}.
*/
+ @Deprecated
public static InteractionContext bulkAction(List<Object> domainObjects) {
return new InteractionContext(InvokedAs.BULK, domainObjects);
}
-
- // //////////////////////////////////////
-
- private InvokedAs invokedAs;
- private List<Object> domainObjects;
-
- private int index;
-
- // //////////////////////////////////////
-
-
- public InteractionContext() {
- }
-
- /**
- * @deprecated - now a {@link RequestScoped} service
- */
- @Deprecated
- public InteractionContext(final InvokedAs invokedAs, final Object... domainObjects) {
- this(invokedAs, Arrays.asList(domainObjects));
- }
/**
* @deprecated - now a {@link RequestScoped} service
*/
@Deprecated
public InteractionContext(final InvokedAs invokedAs, final List<Object> domainObjects) {
- this.invokedAs = invokedAs;
- this.domainObjects = domainObjects;
- }
-
- // //////////////////////////////////////
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- @Programmatic
- public void setInvokedAs(InvokedAs invokedAs) {
- this.invokedAs = invokedAs;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- @Programmatic
- public void setDomainObjects(List<Object> domainObjects) {
- this.domainObjects = domainObjects;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- @Programmatic
- public void setIndex(int index) {
- this.index = index;
- }
-
- // //////////////////////////////////////
-
-
- /**
- * Whether this particular {@link InteractionContext} was applied as a {@link InvokedAs#BULK bulk} action
- * (against each domain object in a list of domain objects) or as a {@link InvokedAs#REGULAR regular}
- * action (against a single domain object).
- */
- @Programmatic
- public InvokedAs getInvokedAs() {
- return invokedAs;
+ super(invokedAs, domainObjects);
}
-
- /**
- * The list of domain objects which are being acted upon.
- */
- @Programmatic
- public List<Object> getDomainObjects() {
- return domainObjects;
- }
-
- /**
- * The number of {@link #domainObjects domain objects} being acted upon.
- */
- @Programmatic
- public int getSize() {
- return domainObjects.size();
- }
-
- /**
- * The 0-based index to the object being acted upon.
- *
- * <p>
- * Will be a value in range [0, {@link #getSize() size}).
- */
- @Programmatic
- public int getIndex() {
- return index;
- }
-
- /**
- * Whether this object being acted upon is the first such.
- */
- @Programmatic
- public boolean isFirst() {
- return this.index == 0;
- }
-
- /**
- * Whether this object being acted upon is the last such.
- */
- @Programmatic
- public boolean isLast() {
- return this.index == (getSize()-1);
- }
-
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
new file mode 100644
index 0000000..7bd7410
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/BulkInteractionContext.java
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.annotation;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * This service (API and implementation) provides access to context information about a bulk action invocation.
+ *
+ * <p>
+ * This implementation has no UI and there is only one implementation (this class) in applib, so it is annotated
+ * with {@link DomainService}. This means that it is automatically registered
+ * and available for use; no further configuration is required.
+ * </p>
+ *
+ * <p>
+ * Note that this not annotated as <tt>@DomainService</tt> an <tt>@RequestScoped</tt> only because of the
+ * legacy {@link org.apache.isis.applib.annotation.Bulk.InteractionContext} subclass (which *is* registered as
+ * the service).
+ * </p>
+ */
+public abstract class BulkInteractionContext {
+
+ public static enum InvokedAs {
+ BULK,
+ REGULAR;
+ public boolean isRegular() { return this == REGULAR; }
+ public boolean isBulk() { return this == BULK; }
+ }
+
+ /**
+ * Intended only to be set only by the framework.
+ *
+ * <p>
+ * Will be populated while a bulk action is being invoked.
+ *
+ * @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
+ */
+ @Deprecated
+ public static final ThreadLocal<BulkInteractionContext> current = new ThreadLocal<BulkInteractionContext>();
+
+ /**
+ * @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
+ */
+ @Deprecated
+ public static void with(final Runnable runnable, final Object... domainObjects) {
+ throw new RuntimeException("No longer supported - instead inject Bulk.InteractionContext as service");
+ }
+
+ /**
+ * @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
+ */
+ @Deprecated
+ public static void with(final Runnable runnable, final InvokedAs invokedAs, final Object... domainObjects) {
+ throw new RuntimeException("No longer supported - instead inject Bulk.InteractionContext as service");
+ }
+
+ // //////////////////////////////////////
+
+ private InvokedAs invokedAs;
+ private List<Object> domainObjects;
+
+ private int index;
+
+ // //////////////////////////////////////
+
+
+ public BulkInteractionContext() {
+ }
+
+ /**
+ * @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
+ */
+ @Deprecated
+ public BulkInteractionContext(final InvokedAs invokedAs, final Object... domainObjects) {
+ this(invokedAs, Arrays.asList(domainObjects));
+ }
+
+ /**
+ * @deprecated - now a {@link javax.enterprise.context.RequestScoped} service
+ */
+ @Deprecated
+ public BulkInteractionContext(final InvokedAs invokedAs, final List<Object> domainObjects) {
+ this.invokedAs = invokedAs;
+ this.domainObjects = domainObjects;
+ }
+
+ // //////////////////////////////////////
+
+ /**
+ * Intended only to support unit testing.
+ */
+ public static BulkInteractionContext regularAction(Object domainObject) {
+ return new BulkInteractionContext(InvokedAs.REGULAR, Collections.singletonList(domainObject)){};
+ }
+
+ /**
+ * Intended only to support unit testing.
+ */
+ public static BulkInteractionContext bulkAction(Object... domainObjects) {
+ return bulkAction(Arrays.asList(domainObjects));
+ }
+
+ /**
+ * Intended only to support unit testing.
+ */
+ public static BulkInteractionContext bulkAction(List<Object> domainObjects) {
+ return new BulkInteractionContext(InvokedAs.BULK, domainObjects){};
+ }
+
+
+ // //////////////////////////////////////
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ */
+ @Programmatic
+ public void setInvokedAs(InvokedAs invokedAs) {
+ this.invokedAs = invokedAs;
+ }
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ */
+ @Programmatic
+ public void setDomainObjects(List<Object> domainObjects) {
+ this.domainObjects = domainObjects;
+ }
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ */
+ @Programmatic
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ // //////////////////////////////////////
+
+
+ /**
+ * Whether this particular {@link org.apache.isis.applib.annotation.Bulk.InteractionContext} was applied as a {@link InvokedAs#BULK bulk} action
+ * (against each domain object in a list of domain objects) or as a {@link InvokedAs#REGULAR regular}
+ * action (against a single domain object).
+ */
+ @Programmatic
+ public InvokedAs getInvokedAs() {
+ return invokedAs;
+ }
+
+ /**
+ * The list of domain objects which are being acted upon.
+ */
+ @Programmatic
+ public List<Object> getDomainObjects() {
+ return domainObjects;
+ }
+
+ /**
+ * The number of {@link #domainObjects domain objects} being acted upon.
+ */
+ @Programmatic
+ public int getSize() {
+ return domainObjects.size();
+ }
+
+ /**
+ * The 0-based index to the object being acted upon.
+ *
+ * <p>
+ * Will be a value in range [0, {@link #getSize() size}).
+ */
+ @Programmatic
+ public int getIndex() {
+ return index;
+ }
+
+ /**
+ * Whether this object being acted upon is the first such.
+ */
+ @Programmatic
+ public boolean isFirst() {
+ return this.index == 0;
+ }
+
+ /**
+ * Whether this object being acted upon is the last such.
+ */
+ @Programmatic
+ public boolean isLast() {
+ return this.index == (getSize()-1);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Cardinality.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Cardinality.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Cardinality.java
new file mode 100644
index 0000000..005a9ee
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Cardinality.java
@@ -0,0 +1,35 @@
+package org.apache.isis.applib.annotation;
+
+/**
+ * Whether the property or parameter is mandatory or not.
+ */
+public enum Cardinality {
+ /**
+ * Default, usually mandatory (and always so for parameters) unless JDO {@link javax.jdo.annotations.Column}
+ * has also specified with {@link javax.jdo.annotations.Column#allowsNull()} set to <code>true</code>.
+ */
+ DEFAULT,
+ /**
+ * Indicates that the property or parameter is not mandatory.
+ */
+ OPTIONAL,
+ /**
+ * Indicates that the property is mandatory (even if the JDO {@link javax.jdo.annotations.Column} annotation
+ * says otherwise).
+ *
+ * <p>
+ * When using the JDO/DataNucleus objectstore, it is sometimes necessary to annotate a property as optional
+ * (using {@link javax.jdo.annotations.Column#allowsNull()} set to <code>true</code>), even if the property is
+ * logically mandatory. For example, this can occur when the property is in a subtype class that has been
+ * "rolled up" to the superclass table using {@link javax.jdo.annotations.Inheritance} with the
+ * {@link javax.jdo.annotations.InheritanceStrategy#SUPERCLASS_TABLE superclass}<tt> strategy.
+ * </p>
+ *
+ * <p>
+ * This annotation, therefore, is intended to override any objectstore-specific
+ * annotation, so that Isis can apply the constraint even though the objectstore
+ * is unable to do so.
+ * </p>
+ */
+ MANDATORY
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java
new file mode 100644
index 0000000..75d2ecc
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import org.apache.isis.applib.services.eventbus.CollectionInteractionEvent;
+
+/**
+ * Domain semantics for domain object collection.
+ */
+@Inherited
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Collection {
+
+ /**
+ * Indicates that changes to the collection that should be posted to the
+ * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+ * {@link org.apache.isis.applib.services.eventbus.CollectionInteractionEvent}.
+ *
+ * <p>For example:
+ * </p>
+ * <pre>
+ * public class Order {
+ * public static class OrderLineItems extends CollectionInteractionEvent {}
+ *
+ * @CollectionInteraction(OrderLineItems.class)
+ * public SortedSet<OrderLine> getLineItems() { ...}
+ * }
+ * </pre>
+ *
+ * <p>
+ * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
+ * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
+ * load them using a repository, and then to delegate to the event to them.
+ * </p>
+ *
+ * <p>
+ * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * </p>
+ */
+ Class<? extends CollectionInteractionEvent<?,?>> interaction() default CollectionInteractionEvent.Default.class;
+
+ // //////////////////////////////////////
+
+ /**
+ * Indicates when the collection is not visible to the user.
+ */
+ Where hidden() default Where.NOWHERE;
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Indicates when the collection is not editable by the user.
+ *
+ * <p>
+ * Note that if the owning domain object is {@link DomainObject#notEditable()}, then that will take precedence.
+ * </p>
+ */
+ Where disabled() default Where.NOWHERE;
+
+ /**
+ * If {@link #disabled()} (in any {@link Where} context), then the reason to provide to the user as to why the
+ * collection cannot be edited.
+ * @return
+ */
+ String disabledReason();
+
+
+ // //////////////////////////////////////
+
+ /**
+ * The type-of the elements held within the collection.
+ * @return
+ */
+ Class<?> typeOf();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionInteraction.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionInteraction.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionInteraction.java
index f59e3d4..6aaa304 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionInteraction.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionInteraction.java
@@ -26,39 +26,17 @@ import java.lang.annotation.Target;
import org.apache.isis.applib.services.eventbus.CollectionInteractionEvent;
/**
- * Indicates that a member is (the accessor of) a collection that should use a custom (subclass of)
- * {@link org.apache.isis.applib.services.eventbus.CollectionInteractionEvent} to propagate the phases of the
- * interaction with collaborators over the registered {@link org.apache.isis.applib.services.eventbus.EventBusService}.
- *
- * <p>For example:
- * <pre>
- * public class Order {
- * public static class OrderLineItems extends CollectionInteractionEvent {}
- *
- * @CollectionInteraction(OrderLineItems.class)
- * public SortedSet<OrderLine> getLineItems() { ...}
- * }
- * </pre>
- *
- * <p>
- * Only domain services should be registered as subscribers; only domain services are guaranteed to be instantiated and
- * resident in memory. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- *
- * @see org.apache.isis.applib.annotation.PostsCollectionAddedToEvent
- * @see org.apache.isis.applib.annotation.PostsCollectionRemovedFromEvent
+ * @deprecated - see {@link Collection#interaction()}.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
+@Deprecated
public @interface CollectionInteraction {
/**
- * The subclass of {@link org.apache.isis.applib.services.eventbus.CollectionInteractionEvent} to be instantiated
- * and posted when a reference is added to or removed from the collection.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ * @deprecated - see {@link Collection#interaction()}.
*/
+ @Deprecated
Class<? extends CollectionInteractionEvent<?,?>> value() default CollectionInteractionEvent.Default.class;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
index 0df2ec8..670d538 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/CollectionLayout.java
@@ -40,11 +40,17 @@ public @interface CollectionLayout {
*/
String cssClass() default "";
+ // //////////////////////////////////////
+
+
/**
* Description of this collection, eg to be rendered in a tooltip.
*/
String describedAs() default "";
+
+ // //////////////////////////////////////
+
/**
* Indicates where in the UI the collection should <i>not</i>not be visible.
*
@@ -55,11 +61,17 @@ public @interface CollectionLayout {
*/
Where hidden() default Where.NOT_SPECIFIED;
+
+ // //////////////////////////////////////
+
/**
* Name of this collection (overriding the name derived from its name in code).
*/
String named() default "";
+
+ // //////////////////////////////////////
+
/**
* The page size for instances of this class when rendered within
* a table.
@@ -74,16 +86,18 @@ public @interface CollectionLayout {
*/
public int paged() default -1;
- public enum RenderType {
+
+ // //////////////////////////////////////
+
+ enum RenderType {
EAGERLY,
LAZILY;
- public static Render.Type typeOf(RenderType renderType) {
- if (renderType == EAGERLY) {
- return Render.Type.EAGERLY;
- } else { // (renderType == CollectionLayout.RenderType.LAZILY)
- return Render.Type.LAZILY;
- }
+ public static Render.Type typeOf(final RenderType renderType) {
+ if (renderType == EAGERLY) return Render.Type.EAGERLY;
+ if (renderType == LAZILY) return Render.Type.LAZILY;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized renderType: " + renderType);
}
}
@@ -106,6 +120,8 @@ public @interface CollectionLayout {
public RenderType render() default RenderType.EAGERLY;
+ // //////////////////////////////////////
+
/**
* Indicates that the elements in a ({@link java.util.SortedSet}) collection should be sorted according to a different order than the
* natural sort order, as defined by the specified{@link java.util.Comparator}.
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java
index 6ef28a2..26da941 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java
@@ -24,80 +24,78 @@ import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-
import org.apache.isis.applib.services.background.BackgroundCommandService;
-import org.apache.isis.applib.services.command.spi.CommandService;
/**
- * Indicates how the {@link org.apache.isis.applib.services.command.Command Command} object provided by the
- * (request-scoped) {@link org.apache.isis.applib.services.command.CommandContext command context} service should be
- * used.
- *
+ * @deprecated - use {@link Action#command()} instead
*/
+@Deprecated
@Inherited
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Command {
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.CommandPersistence}
+ */
+ @Deprecated
public static enum Persistence {
/**
- * (If the configured {@link CommandService} supports it), indicates that the
- * {@link org.apache.isis.applib.services.command.Command Command} object should be persisted.
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.CommandPersistence#PERSISTED}
*/
+ @Deprecated
PERSISTED,
/**
- * (If the configured {@link CommandService} supports it), indicates that the
- * {@link org.apache.isis.applib.services.command.Command Command} object should only be persisted if
- * another service, such as the {@link BackgroundCommandService}, hints that it should.
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.CommandPersistence#IF_HINTED}
*/
+ @Deprecated
IF_HINTED,
/**
- * (Even if the configured {@link CommandService} supports it), indicates that the
- * {@link org.apache.isis.applib.services.command.Command Command} object should <i>not</i> be persisted (even if
- * another service, such as the {@link BackgroundCommandService}, hints that it should).
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action.CommandPersistence#NOT_PERSISTED}
*/
+ @Deprecated
NOT_PERSISTED
}
/**
- * How the {@link org.apache.isis.applib.services.command.Command Command} object provided by the
- * {@link org.apache.isis.applib.services.command.CommandContext CommandContext} domain service should be persisted.
+ * @deprecated - see {@link org.apache.isis.applib.annotation.Action#commandPersistence()}.
*/
+ @Deprecated
Persistence persistence() default Persistence.PERSISTED;
// //////////////////////////////////////
-
+
+ /**
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Action.CommandExecuteIn}
+ */
+ @Deprecated
public static enum ExecuteIn {
/**
- * Execute synchronously in the "foreground", wait for the results.
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Action.CommandExecuteIn#FOREGROUND}
*/
+ @Deprecated
FOREGROUND,
/**
- * Execute "asynchronously" through the {@link BackgroundCommandService}, returning (if possible) the
- * persisted {@link org.apache.isis.applib.services.command.Command command} object as a placeholder to the
- * result.
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Action.CommandExecuteIn#BACKGROUND}
*/
+ @Deprecated
BACKGROUND
}
/**
- * How the command/action should be executed.
- *
- * <p>
- * If the corresponding {@link org.apache.isis.applib.services.command.Command Command} object is persisted,
- * then its {@link org.apache.isis.applib.services.command.Command#getExecuteIn() invocationType} property
- * will be set to this value.
+ * @deprecated - use {@link Action#commandExecuteIn()}
*/
+ @Deprecated
ExecuteIn executeIn() default ExecuteIn.FOREGROUND;
/**
- * If set to <tt>true</tt>, acts as an override to <i>disable</i> command semantics for the action when it is
- * otherwise (eg through configuration) configured as the default.
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Action#commandDisabled()}.
*/
+ @Deprecated
boolean disabled() default false;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClass.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClass.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClass.java
index 98fca77..2b0fc0b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClass.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClass.java
@@ -33,5 +33,11 @@ import java.lang.annotation.Target;
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface CssClass {
+
+ /**
+ * @deprecated - see {@link DomainObjectLayout#cssClass()}, {@link PropertyLayout#cssClass()}, {@link CollectionLayout#cssClass()}, {@link ActionLayout#cssClass()} and {@link ParameterLayout#cssClass()}
+ * @return
+ */
+ @Deprecated
String value();
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClassFa.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClassFa.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClassFa.java
index a25e8c0..08990f3 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClassFa.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/CssClassFa.java
@@ -29,8 +29,17 @@ import java.lang.annotation.*;
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface CssClassFa {
+
+ /**
+ * @deprecated - see {@link ActionLayout#cssClassFa()}
+ */
+ @Deprecated
String value();
+ /**
+ * @deprecated - see {@link org.apache.isis.applib.annotation.ActionLayout#cssClassFaPosition()}
+ */
+ @Deprecated
ActionLayout.CssClassFaPosition position() default ActionLayout.CssClassFaPosition.LEFT;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Defaulted.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Defaulted.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Defaulted.java
index 2c0b266..92acc9a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Defaulted.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Defaulted.java
@@ -43,6 +43,10 @@ import org.apache.isis.applib.adapters.DefaultsProvider;
* @see Encodable
* @see Parseable
* @see Value
+ *
+ * <p>
+ * Note: This annotation is only incompletely recognized by the framework, and may be deprecated in the future.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/DescribedAs.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/DescribedAs.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/DescribedAs.java
index 08244b5..c559ef8 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/DescribedAs.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/DescribedAs.java
@@ -34,5 +34,12 @@ import java.lang.annotation.Target;
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface DescribedAs {
+
+ /**
+ * @deprecated - see {@link DomainObjectLayout#describedAs()}, {@link PropertyLayout#describedAs()},
+ * {@link CollectionLayout#describedAs()}, {@link ActionLayout#describedAs()} and {@link ParameterLayout#describedAs()}.
+ * @return
+ */
+ @Deprecated
String value();
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Disabled.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Disabled.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Disabled.java
index f0ebd01..33a01e0 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Disabled.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Disabled.java
@@ -26,13 +26,27 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that a property/action is to be always unavailable to the user.
+ * @deprecated - see {@link Property#disabled()}, {@link Collection#disabled()} and {@link Action#disabled()}.
*/
@Inherited
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface Disabled {
+
+ /**
+ * @deprecated. There is no corresponding attribute in {@link org.apache.isis.applib.annotation.Property}, {@link org.apache.isis.applib.annotation.Collection} and {@link org.apache.isis.applib.annotation.Action}, if the
+ * corresponding <code>disabled()</code> attribute is set then the feature is assumed to be disabled ALWAYS.
+ */
+ @Deprecated
When when() default When.ALWAYS;
+
+ /**
+ * @deprecated - see {@link Property#disabled()}, {@link Collection#disabled()} and {@link Action#disabled()}.
+ */
+ @Deprecated
Where where() default Where.ANYWHERE;
+
+ @Deprecated
String reason() default "";
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
new file mode 100644
index 0000000..c73f07f
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
@@ -0,0 +1,207 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import org.apache.isis.applib.services.publish.EventPayload;
+
+/**
+ * Domain semantics for domain objects (entities and view models; for services see {@link org.apache.isis.applib.annotation.DomainService}).
+ */
+@Inherited
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DomainObject {
+
+ public enum AuditingPolicy {
+ /**
+ * The auditing of the object should be as per the default auditing policy configured in <tt>isis.properties</tt>.
+ *
+ * <p>
+ * If no auditing policy is configured, then the auditing is disabled.
+ * </p>
+ */
+ AS_CONFIGURED,
+ /**
+ * Audit changes to this object.
+ */
+ ENABLED,
+ /**
+ * Do not audit changes to this object (even if otherwise configured to enable auditing).
+ */
+ DISABLED
+ }
+
+ /**
+ * Whether the entity should be audited (note: does not apply to {@link #viewModel() view model}s.
+ *
+ * <p>
+ * Requires that an implementation of the {@link org.apache.isis.applib.services.audit.AuditingService3} is
+ * registered with the framework.
+ * </p>
+ */
+ AuditingPolicy auditing() default AuditingPolicy.AS_CONFIGURED;
+
+
+ // //////////////////////////////////////
+
+
+ public enum PublishingChangeKind {
+ CREATE,
+ UPDATE,
+ DELETE;
+
+ @Deprecated
+ public static PublishedObject.ChangeKind from(final PublishingChangeKind publishingChangeKind) {
+ if(publishingChangeKind == CREATE) return PublishedObject.ChangeKind.CREATE;
+ if(publishingChangeKind == UPDATE) return PublishedObject.ChangeKind.UPDATE;
+ if(publishingChangeKind == DELETE) return PublishedObject.ChangeKind.DELETE;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized changeKind: " + publishingChangeKind);
+ }
+ @Deprecated
+ public static PublishingChangeKind from(final PublishedObject.ChangeKind publishingChangeKind) {
+ if(publishingChangeKind == PublishedObject.ChangeKind.CREATE) return CREATE;
+ if(publishingChangeKind == PublishedObject.ChangeKind.UPDATE) return UPDATE;
+ if(publishingChangeKind == PublishedObject.ChangeKind.DELETE) return DELETE;
+ // shouldn't happen
+ throw new IllegalArgumentException("Unrecognized changeKind: " + publishingChangeKind);
+ }
+ }
+
+ public interface PublishingPayloadFactory {
+
+ @Programmatic
+ public EventPayload payloadFor(Object changedObject, PublishingChangeKind publishingChangeKind);
+
+ /**
+ * Adapter to subclass if have an existing {@link org.apache.isis.applib.annotation.PublishedObject.PayloadFactory}.
+ */
+ @Deprecated
+ public abstract class Adapter implements PublishingPayloadFactory {
+
+ private final PublishedObject.PayloadFactory payloadFactory;
+
+ public Adapter(final PublishedObject.PayloadFactory payloadFactory) {
+ this.payloadFactory = payloadFactory;
+ }
+
+ @Override
+ public EventPayload payloadFor(Object changedObject, PublishingChangeKind publishingChangeKind) {
+ return payloadFactory.payloadFor(changedObject, PublishingChangeKind.from(publishingChangeKind));
+ }
+ }
+ }
+
+ // TODO: factor out PayloadFactory.Default so similar to interaction
+ Class<? extends PublishingPayloadFactory> publishingPayloadFactory() default PublishingPayloadFactory.class;
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * The class of the domain service that provides an <code>autoComplete(String)</code> method.
+ *
+ * <p>
+ * It is sufficient to specify an interface rather than a concrete type.
+ */
+ Class<?> autoCompleteRepository();
+
+
+ /**
+ * The action to use in order to perform the auto-complete search
+ * (defaults to "autoComplete").
+ *
+ * <p>
+ * The action is required to accept a single string parameter, and must return
+ */
+ String autoCompleteAction() default "autoComplete";
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * Indicates that the class has a bounded, or finite, set of instances.
+ *
+ * <p>
+ * Takes precedence over auto-complete.
+ * </p>
+ */
+ boolean bounded() default false;
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * Whether the properties of this domain object can be edited, or collections of this object be added to/removed from.
+ *
+ * <p>
+ * Note that non-editable objects can nevertheless have actions invoked upon them.
+ * </p>
+ *
+ * <p>
+ * Corresponds to the {@link org.apache.isis.applib.annotation.Immutable} annotation).
+ * </p>
+ */
+ boolean notEditable() default false;
+
+
+ /**
+ * If {@link #notEditable()}, then the reason to provide to the user as to why the object's properties cannot be
+ * edited.
+ */
+ String notEditableReason();
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * Provides a unique abbreviation for the object type, eg "CUS" for Customer.
+ *
+ * <p>
+ * This value, if specified, is used in the serialized form of the object's OID. An OID is
+ * used by the framework to unique identify an object over time (same concept as a URN).
+ * </p>
+ */
+ String objectType();
+
+
+ // //////////////////////////////////////
+
+ /**
+ * Indicates that instances of this class should be handled as a view model.
+ *
+ * <p>
+ * All of the view model object's read/write and non-{@link Programmatic} properties (not collections) will
+ * be included in the memento; in other words as returned and marshalled by
+ * {@link org.apache.isis.applib.ViewModel#viewModelMemento()}.
+ * </p>
+ */
+ boolean viewModel() default false;
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObjectLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObjectLayout.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObjectLayout.java
index 6a605e5..8fd1a1d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObjectLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObjectLayout.java
@@ -38,16 +38,25 @@ public @interface DomainObjectLayout {
*/
String cssClass() default "";
+
+ // //////////////////////////////////////
+
/**
* Description of this class, eg to be rendered in a tooltip.
*/
String describedAs() default "";
+
+ // //////////////////////////////////////
+
/**
* Name of this class (overriding the name derived from its name in code).
*/
String named() default "";
+
+ // //////////////////////////////////////
+
/**
* The page size for instances of this class when rendered within
* a table.
@@ -62,10 +71,19 @@ public @interface DomainObjectLayout {
*/
public int paged() default -1;
+
+ // //////////////////////////////////////
+
/**
* The plural name of the class.
*/
String plural() default "";
+ // //////////////////////////////////////
+
+ /**
+ * Whether (and how) this domain object can be bookmarked in the UI.
+ */
+ BookmarkPolicy bookmarkable() default BookmarkPolicy.AS_ROOT;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Encodable.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Encodable.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Encodable.java
index c641f37..7c42a01 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Encodable.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Encodable.java
@@ -34,6 +34,11 @@ import org.apache.isis.applib.adapters.EncoderDecoder;
* @see Defaulted
* @see Parseable
* @see Value
+ *
+ *
+ * <p>
+ * Note: This annotation is only incompletely recognized by the framework, and may be deprecated in the future.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/EqualByContent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/EqualByContent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/EqualByContent.java
index 7d87a90..499be0a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/EqualByContent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/EqualByContent.java
@@ -53,6 +53,10 @@ import java.util.HashMap;
*
* @see Immutable
* @see Value
+ *
+ * <p>
+ * Note: This annotation is only incompletely recognized by the framework, and may be deprecated in the future.
+ * </p>
*/
@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/FieldOrder.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/FieldOrder.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/FieldOrder.java
index 3aef642..463d992 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/FieldOrder.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/FieldOrder.java
@@ -26,9 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates the order that properties should be displayed in.
- *
- * @deprecated - use {@link MemberOrder} instead.
+ * @deprecated - use {@link MemberOrder} or <code>Xxx.layout.json</code> instead.
*/
@Inherited
@Target({ ElementType.TYPE })
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Hidden.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Hidden.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Hidden.java
index 8b7abb9..6dbe0b6 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Hidden.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Hidden.java
@@ -26,23 +26,25 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that a property, collection or action is to be hidden from the
- * user.
- *
- * <p>
- * For a repository action, is equivalent to {@link NotContributed} and also
- * {@link NotInServiceMenu}.
- *
- * <p>
- * If a repository action is contributed as a property, then the {@link Hidden#where() where}
- * attribute can be used to optionally hide the contributed property in a table (using
- * {@link Where#ALL_TABLES}, {@link Where#STANDALONE_TABLES}, {@link Where#PARENTED_TABLES}
-s * as appropriate).
+ * @deprecated - see {@link Property#hidden()}, {@link Collection#hidden()} and {@link Action#hidden()}.
*/
+@Deprecated
@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Hidden {
+
+ /**
+ * @deprecated. There is no corresponding attribute in {@link org.apache.isis.applib.annotation.Property}, {@link org.apache.isis.applib.annotation.Collection} and {@link org.apache.isis.applib.annotation.Action}, if the
+ * corresponding <code>hidden()</code> attribute is set then the feature is assumed to be hidden ALWAYS.
+ */
+ @Deprecated
When when() default When.ALWAYS;
+
+ /**
+ * @deprecated - see {@link Property#hidden()}, {@link Collection#hidden()} and {@link Action#hidden()}.
+ */
+ @Deprecated
Where where() default Where.ANYWHERE;
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Idempotent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Idempotent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Idempotent.java
index c79bdbb..1902463 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Idempotent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Idempotent.java
@@ -26,16 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that an action is idempotent; invoking may modify domain object
- * state, but invoking it once more will not make further changes (meaning that
- * it is safe to invoke multiple times).
- *
- * <p>
- * More formally, the post-conditions of the action are guaranteed to be the
- * same whether called once or more than once.
- *
- * <p>
- * Deprecated - use <tt>@ActionSemantics(Of.IDEMPOTENT)</tt> instead.
+ * @deprecated - use {@link Action#semantics()} instead.
*/
@Deprecated
@Inherited
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java
index c273d2d..b58d5ac 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java
@@ -26,16 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that an property, collection or action should be ignored from the
- * metamodel.
- *
- * <p>
- * Use of this annotation is discouraged because of the nameclash with
- * <tt>org.junit.Ignore</tt>.
- *
- * Instead, use {@link Programmatic}, which is functionally identical.
- *
- * @see Programmatic
+ * @deprecated - use {@link org.apache.isis.applib.annotation.Programmatic} instead.
*/
@Deprecated
@Inherited
http://git-wip-us.apache.org/repos/asf/isis/blob/bad6d813/core/applib/src/main/java/org/apache/isis/applib/annotation/Immutable.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Immutable.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Immutable.java
index fae878d..a95303d 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Immutable.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Immutable.java
@@ -26,25 +26,18 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that an instance cannot be changed.
- *
- * <p>
- * To make something always immutable use the form <tt>@Immutable</tt>. To make
- * something immutable only once persisted use the form
- * <tt>@Immutable(When.ONCE_PERSISTED)</tt>.
- *
- * <p>
- * By default any {@link Value value} types are assumed to be immutable, though
- * this can be overridden if required. Immutable objects that are acting as a
- * value type should almost certainly also follow the {@link EqualByContent
- * equal-by-content} contract.
- *
- * @see Value
- * @see EqualByContent
+ * @deprecated - use {@link DomainObject#notEditable()} instead.
*/
@Inherited
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface Immutable {
+
+ /**
+ * @deprecated - see {@link DomainObject#notEditable()}. <code>true</code> corresponds to {@link When#ALWAYS}, <code>false</code> corresponds to {@link org.apache.isis.applib.annotation.When#NEVER}. The other values for the
+ * {@link org.apache.isis.applib.annotation.When} are not (ie no longer) supported.
+ */
+ @Deprecated
When value() default When.ALWAYS;
}