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:11 UTC
[2/5] isis git commit: ISIS-970: new annotations and deprecating old
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;
}