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/10/03 14:18:57 UTC

[isis] 02/02: ISIS-1742 removes @CollectionLayout#render and RenderType enum, and updates .adoc

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

danhaywood pushed a commit to branch dev/2.0.0/ISIS-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 2ded6ccfd725e495e583b09edd8f5738f61e773e
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 3 15:09:37 2017 +0100

    ISIS-1742 removes @CollectionLayout#render and RenderType enum, and updates .adoc
---
 .../guides/rgant/_rgant-CollectionLayout.adoc      |  7 ----
 .../rgant/_rgant-CollectionLayout_defaultView.adoc |  5 ---
 .../rgant/_rgant-CollectionLayout_render.adoc      | 43 ----------------------
 .../src/main/asciidoc/guides/rgant/rgant.adoc      |  2 +-
 ...amming-model_domain-services_contributions.adoc |  2 +-
 .../ugfun/_ugfun_programming-model_mixins.adoc     |  2 +-
 ...amming-model_mixins_contributed-collection.adoc |  2 +-
 ...fun_programming-model_mixins_inferred-name.adoc |  2 +-
 .../ugfun/_ugfun_ui-hints_eager-rendering.adoc     |  4 --
 .../tg/_tg_stop-scaffolding-start-coding.adoc      |  2 +-
 .../isis/applib/annotation/CollectionLayout.java   | 22 -----------
 .../apache/isis/applib/annotation/RenderType.java  |  2 +
 .../layout/CollectionLayoutFacetFactory.java       |  8 ----
 .../RenderFacetForCollectionLayoutAnnotation.java  | 42 ---------------------
 14 files changed, 8 insertions(+), 137 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout.adoc
index 14b3e99..e4d36eb 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout.adoc
@@ -60,12 +60,6 @@ A typical use case is if the desired name is a reserved Java keyword, such as `d
 |the page size for instances of this class when rendered within a table.
 
 
-|xref:../rgant/rgant.adoc#_rgant-CollectionLayout_render[`render()`]
-|`EAGERLY`, `LAZILY` +
-(`LAZILY`)
-|whether the collection should be (eagerly) rendered open or (lazily) rendered closed
-
-
 |xref:../rgant/rgant.adoc#_rgant-CollectionLayout_sortedBy[`sortedBy()`]
 |Subclass of `java.util.Comparator` for element type
 |indicates that the elements in the `java.util.SortedSet` collection should be sorted according to a specified `Comparator` rather than their natural sort order.
@@ -117,7 +111,6 @@ include::_rgant-CollectionLayout_describedAs.adoc[leveloffset=+1]
 include::_rgant-CollectionLayout_hidden.adoc[leveloffset=+1]
 include::_rgant-CollectionLayout_named.adoc[leveloffset=+1]
 include::_rgant-CollectionLayout_paged.adoc[leveloffset=+1]
-include::_rgant-CollectionLayout_render.adoc[leveloffset=+1]
 include::_rgant-CollectionLayout_sortedBy.adoc[leveloffset=+1]
 
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout_defaultView.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout_defaultView.adoc
index b2c58c3..b0603ce 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout_defaultView.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout_defaultView.adoc
@@ -38,8 +38,3 @@ NOTE: FIXME - change to .layout.xml syntax instead.
 }
 ----
 
-[NOTE]
-====
-This attribute takes precedence over any value for the xref:../rgant/rgant.adoc#_rgant-CollectionLayout_render[`@CollectionLayout#render()`] attribute.  For example, if the
-`defaultView` attribute is defined to "table", then the table will be show even if `render` is set to `LAZILY`.
-====
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout_render.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout_render.adoc
deleted file mode 100644
index 3466f1d..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-CollectionLayout_render.adoc
+++ /dev/null
@@ -1,43 +0,0 @@
-[[_rgant-CollectionLayout_render]]
-= `render()`
-: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/
-
-
-The `render()` attribute specifies that the collection be rendered either "eagerly" (shown open, displaying its contents) or "lazily" (shown closed, hiding its contents). The terminology here is based on the similar concept of lazy loading of collections in the domain/persistence layer boundary (except that the rendering relates to the presentation/domain layer boundary).
-
-
-For example:
-
-[source,java]
-----
-public class Order {
-    @CollectionLayout(render=RenderType.EAGERLY)
-    public SortedSet<LineItem> getDetails() { ... }
-    ...
-}
-----
-
-
-As an alternative to using the annotation, the dynamic xref:../ugvw/ugvw.adoc#_ugvw_layout_file-based[file-based layout] can be used instead, eg:
-
-NOTE: FIXME - change to .layout.xml syntax instead.
-
-[source,javascript]
-----
-"details": {
-    "collectionLayout": {
-        "render": "EAGERLY"
-    }
-}
-----
-
-
-[NOTE]
-====
-Note that xref:../ugfun/ugfun.adoc#_ugfun_how-tos_contributed-members[contributed collections] (which, under the covers are just action invocations against a domain service) are always rendered eagerly.
-
-Also, if a xref:../rgant/rgant.adoc#_rgant-CollectionLayout_defaultView[`@CollectionLayout#defaultView()`] attribute has been specified then that will take precedence over the value of the `render()` attribute.
-====
-
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/rgant.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/rgant.adoc
index 59df0de..aaf5833 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/rgant.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/rgant.adoc
@@ -56,7 +56,7 @@ To give just a few examples of annotations supported by Apache Isis:
 
 Some annotations act as UI hints, for example:
 
-* if a collection should be rendered "open" rather than collapsed, it can be annotated using `@CollectionLayout(render=RenderType.EAGERLY)`
+* if a collection should be rendered "open" rather than collapsed, it can be annotated using `@CollectionLayout(defaultView="table")`
 * if an action has a tooltip, it can be annotated using `@ActionLayout(describedAs=...)`
 * if a domain object is bookmarkable, it can be annotated using `@DomainObjectLayout(bookmarking=BookmarkPolicy.AS_ROOT`).
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_domain-services_contributions.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_domain-services_contributions.adoc
index a3126d0..f43c5c2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_domain-services_contributions.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_domain-services_contributions.adoc
@@ -28,7 +28,7 @@ We suggest naming such classes `XxxContributions`, eg:
 public class OrderContributions {
     @Action(semantics=SemanticsOf.SAFE)
     @ActionLayout(contributed=Contributed.AS_ASSOCIATION)       // <2>
-    @CollectionLayout(render=RenderType.EAGERLY)
+    @CollectionLayout(defaultView="table")
     public List<Order> orders(Customer customer) {              // <3>
         return container.allMatches(...);
     }
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins.adoc
index e585f5c..bcdcc18 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins.adoc
@@ -23,7 +23,7 @@ public class Customer_orders {                              // <2>
 
     @Action(semantics=SemanticsOf.SAFE)                     // <4>
     @ActionLayout(contributed=Contributed.AS_ASSOCIATION)   // <4>
-    @CollectionLayout(render=RenderType.EAGERLY)
+    @CollectionLayout(defaultView="table")
     public List<Order> coll() {                             // <1>
         return repositoryService.findOrdersFor(customer);
     }
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_contributed-collection.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_contributed-collection.adoc
index d92f5d7..2d0282e 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_contributed-collection.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_contributed-collection.adoc
@@ -19,7 +19,7 @@ public class DocumentHolder_documents {
 
     @Action(semantics=SemanticsOf.SAFE)                         // <1>
     @ActionLayout(contributed = Contributed.AS_ASSOCIATION)     // <2>
-    @CollectionLayout(render = RenderType.EAGERLY)
+    @CollectionLayout(defaultView="table")
     public List<Document> coll() {                              // <3>
         ...
     }
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc
index b84c247..d35fc22 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc
@@ -24,7 +24,7 @@ public class DocumentHolder_documents {
 
     @Action(semantics=SemanticsOf.SAFE)
     @ActionLayout(contributed = Contributed.AS_ASSOCIATION)
-    @CollectionLayout(render = RenderType.EAGERLY)
+    @CollectionLayout(defaultView="table")
     public List<Document> act() {
         ...
     }
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_ui-hints_eager-rendering.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_ui-hints_eager-rendering.adoc
index 5686774..8da2939 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_ui-hints_eager-rendering.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_ui-hints_eager-rendering.adoc
@@ -26,10 +26,6 @@ public Set<ToDoItem> getDependencies() {
 }
 ----
 
-[NOTE]
-====
-The `defaultView()` attribute replaces the deprecated approach of using xref:../rgant/rgant.adoc#_rgant_CollectionLayout_render[`@CollectionLayout#render()`] eagerly.
-====
 
 Alternatively, it can be specified the `Xxx.layout.xml` file:
 
diff --git a/adocs/documentation/src/main/asciidoc/pages/tg/_tg_stop-scaffolding-start-coding.adoc b/adocs/documentation/src/main/asciidoc/pages/tg/_tg_stop-scaffolding-start-coding.adoc
index f4ef91d..890ef32 100644
--- a/adocs/documentation/src/main/asciidoc/pages/tg/_tg_stop-scaffolding-start-coding.adoc
+++ b/adocs/documentation/src/main/asciidoc/pages/tg/_tg_stop-scaffolding-start-coding.adoc
@@ -356,7 +356,7 @@ Returning back to references, Isis also supports vector (multi-valued) reference
 *** you can also implement `equals()`, `hashCode()`, `toString()`
 * Add a xref:../../guides/ugfun/ugfun.adoc#_ugfun_programming-model_collections[collection] to one of the entities
 ** Use `SortedSet` as the class
-** Use the xref:../../guides/rgant/rgant.adoc#_rgant-CollectionLayout_render[`@CollectionLayout(render=...)`] annotation to indicate if the collection should be visible or hidden by default
+** Use the xref:../../guides/rgant/rgant.adoc#_rgant-CollectionLayout_defaultView[`@CollectionLayout(defaultView="table")`] annotation to indicate if the collection should be visible or hidden by default
 * optional: use the xref:../../guides/rgant/rgant.adoc#_rgant-CollectionLayout_sortedBy[`@CollectionLayout(sortedBy=...)`] annotation to specify a different comparator than the natural ordering
 
 
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 5eeda95..336d7e1 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
@@ -106,28 +106,6 @@ public @interface CollectionLayout {
     int paged() default -1;
 
 
-    // //////////////////////////////////////
-
-    /**
-     * Indicates that the rendering of a collection should be performed lazily or eagerly.
-     *
-     * <p>
-     * By default, collections are rendered lazily, meaning its contents is not shown automatically.
-     *
-     * <p>
-     * Using this attribute, an <tt>Order#lineItems</tt> collection might be rendered eagerly.  A viewer might use this
-     * hint to &quot;open&quot; the collection automatically so that the user could see a list of line items
-     * immediately when the order is rendered.
-     * </p>
-     *
-     * <p>
-     * There is some similarity between this concept and that of eager-loading as supported by some object stores.
-     * </p>
-     * 
-     * @deprecated - use {@link #defaultView()} set to &quot;table&quot; instead.
-     */
-    @Deprecated
-    RenderType render() default RenderType.LAZILY;
 
 
     // //////////////////////////////////////
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java
index 9998dde..5a65d61 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/RenderType.java
@@ -22,6 +22,8 @@ import javax.xml.bind.annotation.XmlType;
 
 /**
  * @deprecated - use {@link CollectionLayout#defaultView()} set to &quot;table&quot; instead.
+ *
+ * This field is now ignored.
  */
 @XmlType(
         namespace = "http://isis.apache.org/applib/layout/component"
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CollectionLayoutFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CollectionLayoutFacetFactory.java
index 2d7d8d2..7c2c1e3 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CollectionLayoutFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CollectionLayoutFacetFactory.java
@@ -104,14 +104,6 @@ public class CollectionLayoutFacetFactory extends FacetFactoryAbstract implement
         FacetUtil.addFacet(pagedFacet);
 
 
-        // renderType
-        RenderFacet renderFacet = RenderFacetOnCollectionFromLayoutProperties.create(properties, holder);
-        if(renderFacet == null) {
-            renderFacet = RenderFacetForCollectionLayoutAnnotation.create(collectionLayout, holder);
-        }
-        FacetUtil.addFacet(renderFacet);
-
-
         // sortedBy
         SortedByFacet sortedByFacet = SortedByFacetOnCollectionFromLayoutProperties.create(properties, holder);
         if(sortedByFacet == null) {
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/RenderFacetForCollectionLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/RenderFacetForCollectionLayoutAnnotation.java
deleted file mode 100644
index 149281f..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/RenderFacetForCollectionLayoutAnnotation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.layout;
-
-import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.render.RenderFacet;
-import org.apache.isis.core.metamodel.facets.members.render.RenderFacetAbstract;
-
-public class RenderFacetForCollectionLayoutAnnotation extends RenderFacetAbstract {
-
-    public static RenderFacet create(final CollectionLayout collectionLayout, FacetHolder holder) {
-        if (collectionLayout == null) {
-            return null;
-        }
-        final RenderType renderType = collectionLayout.render();
-        return renderType != null ? new RenderFacetForCollectionLayoutAnnotation(renderType, holder) : null;
-    }
-
-    private RenderFacetForCollectionLayoutAnnotation(final RenderType renderType, final FacetHolder holder) {
-        super(renderType, holder);
-    }
-
-}

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