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 2017/11/13 20:53:44 UTC

[isis] branch dev/2.0.0/ISIS-1632-meta-annotations updated: ISIS-1632: adds migration notes for meta annotations, and changes defaults to NOT_SPECIFIED in all cases

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch dev/2.0.0/ISIS-1632-meta-annotations
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1632-meta-annotations by this push:
     new 0114eec  ISIS-1632: adds migration notes for meta annotations, and changes defaults to NOT_SPECIFIED in all cases
0114eec is described below

commit 0114eec2290c6cf8d965c18938fd7295fc0ab78b
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Nov 13 20:47:56 2017 +0000

    ISIS-1632: adds migration notes for meta annotations, and changes defaults to NOT_SPECIFIED in all cases
---
 .../_migration-notes_1.16.0-to-2.0.0.adoc          | 223 +++++++++++++++++++++
 .../release-notes/_release-notes_2.0.0.adoc        |   9 +
 .../org/apache/isis/applib/annotation/Action.java  |   6 +-
 .../isis/applib/annotation/DomainObject.java       |   4 +-
 .../apache/isis/applib/annotation/Parameter.java   |   2 +-
 .../apache/isis/applib/annotation/Property.java    |   4 +-
 .../apache/isis/applib/annotation/RestrictTo.java  |   3 +-
 .../PrototypeFacetForActionAnnotation.java         |   1 +
 8 files changed, 243 insertions(+), 9 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/migration-notes/_migration-notes_1.16.0-to-2.0.0.adoc b/adocs/documentation/src/main/asciidoc/migration-notes/_migration-notes_1.16.0-to-2.0.0.adoc
new file mode 100644
index 0000000..3e073ca
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/migration-notes/_migration-notes_1.16.0-to-2.0.0.adoc
@@ -0,0 +1,223 @@
+[[_migration-notes_1.15.0-to-1.16.0]]
+= From v1.16.x to 1.16.0
+:Notice: 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 ag [...]
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+
+
+
+== Removed annotations
+
+TODO: document
+
+== Meta annotations
+
+TODO: document
+
+== Updated annotations
+
+Prior to v2.0.0, several annotation attributes were defined as booleans.
+In order to support meta annotations, these have been replaced by enums which also include a `NOT_SPECIFIED` value.
+Other enums have been extended (where necessary) to also have a `NOT_SPECIFIED` value.
+In all cases `NOT_SPECIFIED` is the new default.
+
+
+.xref:../guides/rgant/rgant.adoc#_rgant-Action[`@Action`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+| Modified attribute
+| Change
+
+|xref:../guides/rgant/rgant.adoc#_rgant-Action_command[`command`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Action_hidden[`hidden`]
+| Default changed from `NOWHERE` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Action_invokeOn[`invokeOn`]
+| Default changed from `OBJECT_ONLY` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Action_publishing[`publishing`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Action_restrictTo[`restrictTo`]
+| Default changed from `NO_RESTRICTIONS` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Action_semantics[`semantics`]
+| Default changed from `NON_IDEMPOTENT` to `NOT_SPECIFIED`.
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-ActionLayout[`@ActionLayout`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+| xref:../guides/rgant/rgant.adoc#_rgant-ActionLayout_bookmarking[`bookmarking`]
+| Default changed from `NEVER` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-ActionLayout_contributed[`contributed`]
+| Default changed from `AS_BOTH` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-ActionLayout_position[`position`]
+| Default changed from `BELOW` to `NOT_SPECIFIED`.
+
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-Collection[`@Collection`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Collection_hidden[`hidden`]
+| Default changed from `NOWHERE` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Collection_editing[`editing`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Collection_mementoSerialization[`mementoSerialization`]
+| Replaces `notPersisted`, taking values of `INCLUDED`, `EXCLUDED` or `NOT_SPECIFIED`.
+Defaults to `NOT_SPECIFIED`.
+
+| `notPersisted`
+| Removed, replaced with `mementoSerialization`
+
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-DomainObject[`@DomainObject`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+| xref:../guides/rgant/rgant.adoc#_rgant-DomainObject_auditing[`auditing`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+| `bounded`
+| Deleted (was a boolean attribute), replaced by `bounding` (below)
+
+| xref:../guides/rgant/rgant.adoc#_rgant-DomainObject_bounding[`bounding`]
+| Replaces `bounded`, taking values of `BOUNDED`, `UNBOUNDED` and `NOT_SPECIFIED`.
+Defaults to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-DomainObject_editing[`editing`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-DomainObject_publishing[`publishing`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-DomainObjectLayout[`@DomainObjectLayout`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+| xref:../guides/rgant/rgant.adoc#_rgant-DomainObjectLayout_bookmarking[`bookmarking`]
+| Default changed from `NEVER` to `NOT_SPECIFIED`.
+
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-Parameter[`@Parameter`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Parameter_optionality[`optionality`]
+| Default changed from `DEFAULT` to `NOT_SPECIFIED`.
+
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-ParameterLayout[`@ParameterLayout`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+
+| xref:../guides/rgant/rgant.adoc#_rgant-ParameterLayout_labelPosition[`labelPosition`]
+| Default changed from `DEFAULT` to `NOT_SPECIFIED`.
+
+| `renderedAsDayBefore`
+| Deleted (was a boolean attribute), replaced by `renderDay`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-ParameterLayout_renderDay[`renderBay`]
+| Replaces `notPersisted`, taking values of `AS_DAY`, `AS_DAY_BEFORE` or `NOT_SPECIFIED`.
+Defaults to `NOT_SPECIFIED`.
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-Property[`@Property`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Property_commandReification[`commandReification`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Property_editing[`editing`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Property_hidden[`hidden`]
+| Default changed from `NOWHERE` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Property_mementoSerialization[`mementoSerialization`]
+| Replaces `notPersisted`, taking values of `INCLUDED`, `EXCLUDED` or `NOT_SPECIFIED`.
+Defaults to `NOT_SPECIFIED`.
+
+| `notPersisted`
+| Removed, replaced with `mementoSerialization`
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Property_optionality[`optionality`]
+| Default changed from `DEFAULT` to `NOT_SPECIFIED`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-Property_publishing[`publishing`]
+| Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
+
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-PropertyLayout[`@PropertyLayout`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+| xref:../guides/rgant/rgant.adoc#_rgant-PropertyLayout_labelPosition[`labelPosition`]
+| Default changed from `DEFAULT` to `NOT_SPECIFIED`.
+
+
+| xref:../guides/rgant/rgant.adoc#_rgant-PropertyLayout_promptStyle[`promptStyle`]
+| Default changed from `DEFAULT` to `NOT_SPECIFIED`.
+
+
+| `renderedAsDayBefore`
+| Deleted (was a boolean attribute), replaced by `renderDay`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-PropertyLayout_renderDay[`renderBay`]
+| Replaces `notPersisted`, taking values of `AS_DAY`, `AS_DAY_BEFORE` or `NOT_SPECIFIED`.
+Defaults to `NOT_SPECIFIED`.
+
+
+| `unchanging`
+| Deleted (was a boolean attribute), replaced by `repainting`.
+
+| xref:../guides/rgant/rgant.adoc#_rgant-PropertyLayout_repainting[`repainting`]
+| Replaces `unchanging`, taking values of `REPAINT`, `NO_REPAINT` or `NOT_SPECIFIED`.
+Defaults to `NOT_SPECIFIED`.
+
+
+|===
+
+.xref:../guides/rgant/rgant.adoc#_rgant-ViewModelLayout[`@ViewModelLayout`] attributes
+[cols="1a,3a", options="header"]
+|===
+
+| xref:../guides/rgant/rgant.adoc#_rgant-ViewModelLayout[`@ViewModelLayout`]
+| xref:../guides/rgant/rgant.adoc#_rgant-ViewModelLayout_bookmarking[`bookmarking`]
+| adds new NOT_SPECIFIED value
+
+
+|===
+
+
diff --git a/adocs/documentation/src/main/asciidoc/release-notes/_release-notes_2.0.0.adoc b/adocs/documentation/src/main/asciidoc/release-notes/_release-notes_2.0.0.adoc
new file mode 100644
index 0000000..913436e
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/release-notes/_release-notes_2.0.0.adoc
@@ -0,0 +1,9 @@
+[[_release-notes_2.0.0]]
+= 2.0.0
+:notice: 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 ag [...]
+:_basedir: ../
+:_imagesdir: images/
+:toc: right
+
+
+
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 822c4d7..0183df7 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
@@ -82,7 +82,7 @@ public @interface Action {
      *     {@link ActionLayout#contributed()}.
      * </p>
      */
-    Where hidden() default Where.NOWHERE;
+    Where hidden() default Where.NOT_SPECIFIED;
 
 
     // //////////////////////////////////////
@@ -124,7 +124,7 @@ public @interface Action {
     /**
      * Whether the action invocation should be reified into a {@link org.apache.isis.applib.services.command.Command} object.
      */
-    CommandReification command() default CommandReification.AS_CONFIGURED;
+    CommandReification command() default CommandReification.NOT_SPECIFIED;
 
     /**
      * How the {@link org.apache.isis.applib.services.command.Command Command} object provided by the
@@ -178,7 +178,7 @@ public @interface Action {
      *     By default there are no restrictions, with the action being available in all environments.
      * </p>
      */
-    RestrictTo restrictTo() default RestrictTo.NO_RESTRICTIONS;
+    RestrictTo restrictTo() default RestrictTo.NOT_SPECIFIED;
 
 
 }
\ No newline at end of file
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 849ecb1..c2dd5d3 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
@@ -62,7 +62,7 @@ public @interface DomainObject {
      * registered with the framework.
      * </p>
      */
-    Publishing publishing() default Publishing.AS_CONFIGURED;
+    Publishing publishing() default Publishing.NOT_SPECIFIED;
 
 
     // //////////////////////////////////////
@@ -115,7 +115,7 @@ public @interface DomainObject {
      *     Note that non-editable objects can nevertheless have actions invoked upon them.
      * </p>
      */
-    Editing editing() default Editing.AS_CONFIGURED;
+    Editing editing() default Editing.NOT_SPECIFIED;
 
 
     /**
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
index abafa88..718908c 100644
--- 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
@@ -58,7 +58,7 @@ public @interface Parameter {
      *     to mean that the parameter is required.
      * </p>
      */
-    Optionality optionality() default Optionality.DEFAULT;
+    Optionality optionality() default Optionality.NOT_SPECIFIED;
 
 
 
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
index 77081a1..77632c9 100644
--- 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
@@ -87,7 +87,7 @@ public @interface Property {
      *     Note that non-editable objects can nevertheless have actions invoked upon them.
      * </p>
      */
-    Editing editing() default Editing.AS_CONFIGURED;
+    Editing editing() default Editing.NOT_SPECIFIED;
 
     /**
      * If {@link #editing()} is set to {@link Editing#DISABLED},
@@ -184,7 +184,7 @@ public @interface Property {
      *     with its {@link javax.jdo.annotations.Column#allowsNull() allowNulls()} attribute set to true.
      * </p>
      */
-    Optionality optionality() default Optionality.DEFAULT;
+    Optionality optionality() default Optionality.NOT_SPECIFIED;
 
 
 
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/RestrictTo.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/RestrictTo.java
index 140f40e..801939f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/RestrictTo.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/RestrictTo.java
@@ -23,5 +23,6 @@ package org.apache.isis.applib.annotation;
  */
 public enum RestrictTo {
     PROTOTYPING,
-    NO_RESTRICTIONS;
+    NO_RESTRICTIONS,
+    NOT_SPECIFIED;
 }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/prototype/PrototypeFacetForActionAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/prototype/PrototypeFacetForActionAnnotation.java
index 00f4d9f..b91c4d8 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/prototype/PrototypeFacetForActionAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/prototype/PrototypeFacetForActionAnnotation.java
@@ -37,6 +37,7 @@ public class PrototypeFacetForActionAnnotation extends PrototypeFacetAbstract {
 
         return actions.stream()
                 .map(Action::restrictTo)
+                .filter(restrictTo -> restrictTo != RestrictTo.NOT_SPECIFIED)
                 .filter(restrictTo -> restrictTo == RestrictTo.PROTOTYPING)
                 .findFirst()
                 .map(restrictTo -> new PrototypeFacetForActionAnnotation(holder, deploymentCategory))

-- 
To stop receiving notification emails like this one, please contact
['"commits@isis.apache.org" <co...@isis.apache.org>'].