This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-2485
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/CAUSEWAY-2485 by this push:
new 52a6e6d166 CAUSEWAY-2485: replaces @Property#renderDaysBefore example
with @ValueSemantics#dateRenderAdjustDays
52a6e6d166 is described below
commit 52a6e6d166535c0cb04b033d597531108a693101
Author: danhaywood <[email protected]>
AuthorDate: Sun Apr 23 17:55:49 2023 +0100
CAUSEWAY-2485: replaces @Property#renderDaysBefore example with
@ValueSemantics#dateRenderAdjustDays
---
.../PropertyLayout/PropertyLayoutMenu.java | 13 --
.../PropertyLayoutRenderDayPage-description.adoc | 152 ---------------------
...nderDayPage_mixinEndDateWithMetaAnnotation.java | 49 -------
...e_mixinEndDateWithMetaAnnotationOverridden.java | 52 -------
...nderDayPage_mixinEndDateWithPropertyLayout.java | 49 -------
...derDayPage_updateEndDateWithMetaAnnotation.java | 60 --------
..._updateEndDateWithMetaAnnotationOverridden.java | 63 ---------
.../RenderDayMetaAnnotationEndDateExclusive.java | 42 ------
.../RenderDayMetaAnnotationStartDateInclusive.java | 41 ------
.../ValueSemantics/ValueSemanticsMenu.java | 59 ++++++++
...anticsDateRenderAdjustDaysPage-description.adoc | 70 ++++++++++
.../ValueSemanticsDateRenderAdjustDaysPage.java} | 80 +++--------
...ueSemanticsDateRenderAdjustDaysPage.layout.xml} | 16 +--
...icsDateRenderAdjustDaysPage_downloadAsXml.java} | 10 +-
...icsDateRenderAdjustDaysPage_updateEndDate.java} | 20 ++-
.../src/main/java/demoapp/dom/menubars.layout.xml | 5 +-
16 files changed, 171 insertions(+), 610 deletions(-)
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/PropertyLayoutMenu.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/PropertyLayoutMenu.java
index 474ca5c99a..4514365239 100644
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/PropertyLayoutMenu.java
+++
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/PropertyLayoutMenu.java
@@ -18,8 +18,6 @@
*/
package demoapp.dom.domain.properties.PropertyLayout;
-import java.time.ZoneId;
-
import javax.inject.Inject;
import javax.inject.Named;
@@ -29,7 +27,6 @@ import org.apache.causeway.applib.annotation.DomainService;
import org.apache.causeway.applib.annotation.NatureOfService;
import org.apache.causeway.applib.annotation.PriorityPrecedence;
import org.apache.causeway.applib.annotation.SemanticsOf;
-import org.apache.causeway.applib.services.clock.ClockService;
import org.apache.causeway.applib.value.Blob;
import org.apache.causeway.applib.value.NamedWithMimeType.CommonMimeType;
@@ -43,7 +40,6 @@ import
demoapp.dom.domain.properties.PropertyLayout.labelPosition.PropertyLayout
import
demoapp.dom.domain.properties.PropertyLayout.multiLine.PropertyLayoutMultiLinePage;
import
demoapp.dom.domain.properties.PropertyLayout.named.PropertyLayoutNamedPage;
import demoapp.dom.domain.properties.PropertyLayout.navigable.FileNodeVm;
-import
demoapp.dom.domain.properties.PropertyLayout.renderDay.PropertyLayoutRenderDayPage;
import
demoapp.dom.domain.properties.PropertyLayout.repainting.PropertyLayoutRepaintingPage;
import
demoapp.dom.domain.properties.PropertyLayout.typicalLength.PropertyLayoutTypicalLengthPage;
import demoapp.dom.types.Samples;
@@ -57,7 +53,6 @@ import demoapp.dom.types.Samples;
//@Log4j2
public class PropertyLayoutMenu {
- final ClockService clockService;
final Samples<Blob> samples;
@@ -130,14 +125,6 @@ public class PropertyLayoutMenu {
- @Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-step-forward", describedAs = "Inclusive and
exclusive date ranges")
- public PropertyLayoutRenderDayPage renderDay(){
- return new
PropertyLayoutRenderDayPage(clockService.getClock().nowAsLocalDate(ZoneId.systemDefault()));
- }
-
-
-
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa="fa-paint-brush", describedAs = "Performance hint
for properties holding unchanging large objects")
public PropertyLayoutRepaintingPage repainting(){
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage-description.adoc
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage-description.adoc
deleted file mode 100644
index 401c792ec6..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage-description.adoc
+++ /dev/null
@@ -1,152 +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 [...]
-
-The `renderDay` attribute applies to date fields, and indicates that the date
rendered should be one day before the day actually held in the property.
-
-The typical use case for this is when two date properties together model an
interval, namely a "startDate" and an "endDate".
-
-* If these are both inclusive, ie "[startDate, endDate]", then there will be a
day "missing" between adjacent intervals.
-+
-For example, ['Mon 1 Jan', 'Sun 7 Jan'], then ['Mon 8 Jan', 'Sun 14 Jan'], and
so on.
-
-* If instead the end date is exclusive, ie "[startDate, endDate)", then
adjacent intervals can use the same date for both the end of one interval and
the start of the next.
-+
-For example, ['Mon 1 Jan', 'Mon 8 Jan'), then ['Mon 8 Jan', 'Mon 15 Jan')`.
-
-This UI hint therefore allows the domain object to use an exclusive end date,
thus simplifying business logic, but to be rendered the day before, as if with
an inclusive end date.
-
-The attribute applies to both properties and parameters:
-
-* for properties, the attribute can be specified using either the
`@PropertyLayout` annotation, or using the `Xxx.layout.xml` layout file.
-
-* for parameters, the attribute can be specified using the `@ParameterLayout`
annotation.
-
-The attribute is supported only for properties and parameters representing
dates/times.
-
-// TODO: java.time datatypes not yet supported.
-
-TIP: You can inspect the "raw" data of the domain object, using the "download
as XML" action.
-
-== Annotated
-
-The `renderDay` attribute can be specified explicitly using an annotation:
-
-* for properties, using `@PropertyLayout#renderDay()`:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage.java[tags=render-as-day-before]
-----
-<.> explicitly specifies that the property should be rendered as the day
before.
-
-* for parameters, using `@ParameterLayout#renderDay()`:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage_updateEndDateWithParameterLayout.java[tags=annotation]
-----
-<.> explicitly specifies that the parameter should be rendered as the day
before.
-
-== Layout File
-
-For properties (not parameters), the `renderDay` attribute can be specified
using the `Xxx.layout.xml` file:
-
-* property definition:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage.java[tags=layout-file]
-----
-<.> `renderDay` hint is _not_ present.
-
-* layout file snippet:
-+
-[source,xml,indent=0,tabsize=4]
-----
-<cpt:property id="endDateLayoutFile" renderedAsDayBefore="true"/>
-----
-
-One advantage of the layout file over the annotation is that the layout file
is dynamic: it can be modified and the changes reloaded in a running
application.
-
-TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see
this take effect.
-
-== Contributed
-
-The `@PropertyLayout` can also be applied at the class-level to mixin
properties:.
-
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage_mixinEndDateWithPropertyLayout.java[tags=class]
-----
-<.> explicitly specifies that the contributed property should be rendered as
the day before
-
-== Meta-annotated
-
-The `renderDay` attribute can also be specified using a custom meta-annotation:
-
-* the meta-annotation is defined as:
-+
-[source,java]
-----
-include::RenderDayMetaAnnotationEndDateExclusive.java[tags=class]
-----
-<.> annotated for a property or a parameter
-<.> annotation can be applied to a property (either its getter or the field
directly)
-<.> annotation can be applied to a parameter
-<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
-
-* and can be applied to a property:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage.java[tags=meta-annotation]
-----
-<.> hint is inherited from the meta-annotation
-
-* or can be applied to a parameter:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotation.java[tags=meta-annotation]
-----
-<.> hint is inherited from the meta-annotation
-
-* or can be applied to mixin:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotation.java[tags=class]
-----
-<.> hint is inherited from the meta-annotation
-
-=== Meta-annotated Overridden
-
-The meta-annotation can itself be overridden:
-
-* in a property:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage.java[tags=meta-annotation-overridden]
-----
-<.> hint from meta-annotation (deliberately incorrectly annotated) ...
-<.> \... is overridden by the `@PropertyLayout` annotation
-
-* or a parameter:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
-----
-<.> hint from meta-annotation (deliberately incorrectly annotated) ...
-<.> \... is overridden by the `@ParameterLayout` annotation
-
-
-* or a mixin:
-+
-[source,java,indent=0]
-----
-include::PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
-----
-<.> hint from meta-annotation (deliberately incorrectly annotated) ...
-<.> \... is overridden by the `@PropertyLayout` annotation
-
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotation.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotation.java
deleted file mode 100644
index b99e46c9d6..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotation.java
+++ /dev/null
@@ -1,49 +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 demoapp.dom.domain.properties.PropertyLayout.renderDay;
-
-import java.time.LocalDate;
-
-import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
-
-import lombok.RequiredArgsConstructor;
-
-//tag::class[]
-@Property()
-@RenderDayMetaAnnotationEndDateExclusive // <.>
-@PropertyLayout(
- describedAs =
- "@RenderDayMetaAnnotationEndDateExclusive",
- fieldSetId = "meta-annotated", sequence = "2"
-)
-@RequiredArgsConstructor
-public class PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotation {
- // ...
-//end::class[]
-
- private final PropertyLayoutRenderDayPage page;
-
- public LocalDate prop() {
- return page.getEndDate();
- }
-
-//tag::class[]
-}
-//end::class[]
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotationOverridden.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotationOverridden.java
deleted file mode 100644
index c5a0e430a2..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotationOverridden.java
+++ /dev/null
@@ -1,52 +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 demoapp.dom.domain.properties.PropertyLayout.renderDay;
-
-import java.time.LocalDate;
-
-import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
-import org.apache.causeway.applib.annotation.ValueSemantics;
-
-import lombok.RequiredArgsConstructor;
-
-//tag::meta-annotation-overridden[]
-// deliberately incorrectly annotated
-@RenderDayMetaAnnotationStartDateInclusive // <.>
-@Property()
-@ValueSemantics(dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE)
// <.>
-@PropertyLayout(describedAs =
- "@RenderDayMetaAnnotationStartDateInclusive" +
- " @PropertyLayout(renderDay = AS_DAY_BEFORE",
- fieldSetId = "meta-annotated-overridden", sequence = "2"
-)
-@RequiredArgsConstructor
-public class
PropertyLayoutRenderDayPage_mixinEndDateWithMetaAnnotationOverridden {
- // ...
-//end::meta-annotation-overridden[]
-
- private final PropertyLayoutRenderDayPage page;
-
- public LocalDate prop() {
- return page.getEndDate();
- }
-
-//tag::meta-annotation-overridden[]
-}
-//end::meta-annotation-overridden[]
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithPropertyLayout.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithPropertyLayout.java
deleted file mode 100644
index f195cc937e..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_mixinEndDateWithPropertyLayout.java
+++ /dev/null
@@ -1,49 +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 demoapp.dom.domain.properties.PropertyLayout.renderDay;
-
-import java.time.LocalDate;
-
-import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
-import org.apache.causeway.applib.annotation.ValueSemantics;
-
-import lombok.RequiredArgsConstructor;
-
-//tag::class[]
-@Property()
-@ValueSemantics(dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE) //
<.>
-@PropertyLayout(describedAs =
- "@ValueSemantics(dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE)",
- fieldSetId = "contributed", sequence = "1"
-)
-@RequiredArgsConstructor
-public class PropertyLayoutRenderDayPage_mixinEndDateWithPropertyLayout {
- // ...
-//end::class[]
-
- private final PropertyLayoutRenderDayPage page;
-
- public LocalDate prop() {
- return page.getEndDate();
- }
-
-//tag::class[]
-}
-//end::class[]
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotation.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotation.java
deleted file mode 100644
index 85b9beb408..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotation.java
+++ /dev/null
@@ -1,60 +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 demoapp.dom.domain.properties.PropertyLayout.renderDay;
-
-import java.time.LocalDate;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Parameter;
-import org.apache.causeway.applib.annotation.ParameterLayout;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-
-import lombok.RequiredArgsConstructor;
-
-@Action(
- semantics = SemanticsOf.IDEMPOTENT
-)
-@ActionLayout(
- associateWith = "endDateUsingMetaAnnotation"
- , sequence = "1")
-@RequiredArgsConstructor
-public class PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotation {
-
- private final PropertyLayoutRenderDayPage page;
-
-//tag::meta-annotation[]
- @MemberSupport public PropertyLayoutRenderDayPage act(
- @Parameter(optionality = Optionality.OPTIONAL)
- @RenderDayMetaAnnotationEndDateExclusive // <.>
- @ParameterLayout(
- describedAs = "@RenderDayAsDayBeforeMetaAnnotation"
- )
- final LocalDate endDateExclusive) {
- page.setEndDateUsingMetaAnnotation(endDateExclusive);
- return page;
- }
-//end::meta-annotation[]
- @MemberSupport public LocalDate default0Act() {
- return page.getEndDateUsingMetaAnnotation();
- }
-
-}
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotationOverridden.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotationOverridden.java
deleted file mode 100644
index ad7d817c0e..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotationOverridden.java
+++ /dev/null
@@ -1,63 +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 demoapp.dom.domain.properties.PropertyLayout.renderDay;
-
-import java.time.LocalDate;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Parameter;
-import org.apache.causeway.applib.annotation.ParameterLayout;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-import org.apache.causeway.applib.annotation.ValueSemantics;
-
-import lombok.RequiredArgsConstructor;
-
-@Action(
- semantics = SemanticsOf.IDEMPOTENT
-)
-@ActionLayout(
- associateWith = "endDateUsingMetaAnnotationButOverridden"
- , sequence = "1")
-@RequiredArgsConstructor
-public class
PropertyLayoutRenderDayPage_updateEndDateWithMetaAnnotationOverridden {
-
- private final PropertyLayoutRenderDayPage page;
-
-//tag::meta-annotation-overridden[]
- @MemberSupport public PropertyLayoutRenderDayPage act(
- @RenderDayMetaAnnotationStartDateInclusive // <.>
- @Parameter(optionality = Optionality.OPTIONAL)
- @ValueSemantics(dateRenderAdjustDays =
ValueSemantics.AS_DAY_BEFORE) // <.>
- @ParameterLayout(describedAs =
- "@RenderDayMetaAnnotationStartDateInclusive " +
- "@ValueSemantics(dateRenderAdjustDays =
ValueSemantics.AS_DAY_BEFORE)"
- )
- final LocalDate endDate) {
- page.setEndDateUsingMetaAnnotationButOverridden(endDate);
- return page;
- }
-//end::meta-annotation-overridden[]
- @MemberSupport public LocalDate default0Act() {
- return page.getEndDateUsingMetaAnnotationButOverridden();
- }
-
-}
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/RenderDayMetaAnnotationEndDateExclusive.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/RenderDayMetaAnnotationEndDateExclusive.java
deleted file mode 100644
index 28361e12f2..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/RenderDayMetaAnnotationEndDateExclusive.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 demoapp.dom.domain.properties.PropertyLayout.renderDay;
-
-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.causeway.applib.annotation.ValueSemantics;
-
-//tag::class[]
-@ValueSemantics(dateRenderAdjustDays
- = ValueSemantics.AS_DAY_BEFORE) // <.>
-@Inherited
-@Target({
- ElementType.METHOD, ElementType.FIELD, // <.>
- ElementType.PARAMETER, // <.>
- ElementType.TYPE // <.>
-})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface RenderDayMetaAnnotationEndDateExclusive {
-
-}
-//end::class[]
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/RenderDayMetaAnnotationStartDateInclusive.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/RenderDayMetaAnnotationStartDateInclusive.java
deleted file mode 100644
index 99b08f2452..0000000000
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/RenderDayMetaAnnotationStartDateInclusive.java
+++ /dev/null
@@ -1,41 +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 demoapp.dom.domain.properties.PropertyLayout.renderDay;
-
-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.causeway.applib.annotation.ValueSemantics;
-
-//tag::class[]
-@ValueSemantics(dateRenderAdjustDays = 0) // <.>
-@Inherited
-@Target({
- ElementType.METHOD, ElementType.FIELD, // <.>
- ElementType.PARAMETER, // <.>
- ElementType.TYPE // <.>
-})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface RenderDayMetaAnnotationStartDateInclusive {
-
-}
-//end::class[]
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/ValueSemanticsMenu.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/ValueSemanticsMenu.java
new file mode 100644
index 0000000000..f087b50938
--- /dev/null
+++
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/ValueSemanticsMenu.java
@@ -0,0 +1,59 @@
+/*
+ * 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 demoapp.dom.domain.properties.ValueSemantics;
+
+import java.time.LocalDate;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.causeway.applib.annotation.Action;
+import org.apache.causeway.applib.annotation.ActionLayout;
+import org.apache.causeway.applib.annotation.DomainService;
+import org.apache.causeway.applib.annotation.NatureOfService;
+import org.apache.causeway.applib.annotation.PriorityPrecedence;
+import org.apache.causeway.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+
+import
demoapp.dom.domain.properties.ValueSemantics.dateRenderAdjustDays.ValueSemanticsDateRenderAdjustDaysPage;
+
+@Named("demo.ValueSemanticsMenu")
+@DomainService(
+ nature=NatureOfService.VIEW
+)
[email protected](PriorityPrecedence.EARLY)
+@RequiredArgsConstructor(onConstructor_ = { @Inject })
+//@Log4j2
+public class ValueSemanticsMenu {
+
+
+//tag::create-page[]
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(cssClassFa="fa-step-forward", describedAs = "Inclusive and
exclusive date ranges")
+ public ValueSemanticsDateRenderAdjustDaysPage dateRenderAdjustDays(){
+ val page = new ValueSemanticsDateRenderAdjustDaysPage();
+ page.setStartDate(LocalDate.of(2012,1,1));
+ page.setEndDate(page.getStartDate().plusDays(7)); // <.>
+ return page;
+ }
+//end::create-page[]
+
+}
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage-description.adoc
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage-description.adoc
new file mode 100644
index 0000000000..81cfa30ab0
--- /dev/null
+++
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage-description.adoc
@@ -0,0 +1,70 @@
+: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 [...]
+
+When dealing with date ranges, sometimes it can be easier to define ranges
that use a combination of inclusive-exclusive limits -- that is `[startDate,
endDate)` -- so that the dates within the range meet the constraint `startDate
<= date < endDate`.
+
+However, in the user interface your users may prefer inclusive ranges for both
the _startDate_ _and_ the `endDate`.
+To do that means that the rendered endDate must actually be for the _day
before_ the date stored internally.
+
+The
link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/ValueSemantics.html#daterenderadjustdays[@ValueSemantics#dateRenderAdjustDays]
attribute can be used to accomplish this.
+
+The attribute can be applied to both properties and parameters:
+
+WARNING: this functionality is currently broken; the attribute does nothing;
see link:https://issues.apache.org/jira/browse/CAUSEWAY-3445[CAUSEWAY-3445].
+
+
+
+== How this demo works
+
+This page has a `startDate` and an `endDate`, with the `endDate` (internally)
set to one week (7 days) after the `startDate`.
+
+[source,java,indent=0]
+.ValueSemanticsMenu.java
+----
+include::../ValueSemanticsMenu.java[tags=create-page]
+----
+<.> `endDate` set to +7 days from the `startDate`
+
+With respect to the page's members:
+
+* The `startDate` property has no annotations that would change the way in
which it is rendered:
++
+[source,java,indent=0]
+.ValueSemanticsDateRenderAdjustDaysPage.java
+----
+include::ValueSemanticsDateRenderAdjustDaysPage.java[tags=render-not-specified]
+----
+
+* The `endDate` property however should show 1 day before this date:
+[source,java,indent=0]
+.ValueSemanticsDateRenderAdjustDaysPage_updateEndDate.java
+----
+include::ValueSemanticsDateRenderAdjustDaysPage_updateEndDate.java[tags=annotation]
+----
+<.>
+
+* The `endDate` can also be updated using an action, also with adjusted days:
++
+[source,java,indent=0]
+.ValueSemanticsDateRenderAdjustDaysPage.java
+----
+include::ValueSemanticsDateRenderAdjustDaysPage.java[tags=render-as-day-before]
+----
+<.> render the internal date as the day before
+
+* The derived `endDateNotAdjusted` however shows the internally held date:
+
+[source,java,indent=0]
+.ValueSemanticsDateRenderAdjustDaysPage.java
+----
+include::ValueSemanticsDateRenderAdjustDaysPage.java[tags=render-as-day]
+----
+<.> explicitly specifies that the property should be rendered "as is".
+
+* You can also use the "download as XML" to inspect the "raw" data of the
domain object:
+
+[source,java,indent=0]
+.ValueSemanticsDateRenderAdjustDaysPage_downloadAsXml.java
+----
+include::ValueSemanticsDateRenderAdjustDaysPage_downloadAsXml.java[tags=class]
+----
+
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage.java
similarity index 52%
rename from
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage.java
rename to
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage.java
index c5c4a806c4..03d4f27fc9 100644
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage.java
+++
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage.java
@@ -16,7 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.domain.properties.PropertyLayout.renderDay;
+package demoapp.dom.domain.properties.ValueSemantics.dateRenderAdjustDays;
+
+import org.apache.causeway.applib.annotation.PropertyLayout;
+import org.apache.causeway.applib.jaxb.JavaTimeJaxbAdapters;
+import
org.apache.causeway.valuetypes.jodatime.applib.jaxb.JodaTimeJaxbAdapters;
import java.time.LocalDate;
@@ -34,9 +38,7 @@ import org.apache.causeway.applib.annotation.Nature;
import org.apache.causeway.applib.annotation.ObjectSupport;
import org.apache.causeway.applib.annotation.Optionality;
import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
import org.apache.causeway.applib.annotation.ValueSemantics;
-import org.apache.causeway.applib.jaxb.JavaTimeJaxbAdapters;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -51,24 +53,19 @@ import
demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
@Named("demo.PropertyLayoutRenderDayVm")
@DomainObject(
nature=Nature.VIEW_MODEL,
- editing = Editing.ENABLED)
+ editing = Editing.ENABLED
+)
@NoArgsConstructor
-public class PropertyLayoutRenderDayPage implements HasAsciiDocDescription {
-
- public PropertyLayoutRenderDayPage(final LocalDate localDate) {
- startDate = localDate;
- endDate = startDate.plusDays(7);
- }
+public class ValueSemanticsDateRenderAdjustDaysPage implements
HasAsciiDocDescription {
@ObjectSupport public String title() {
- return "@PropertyLayout#renderDay";
+ return "@ValueSemantics#dateRenderAdjustDays";
}
//tag::render-not-specified[]
@Property(optionality = Optionality.OPTIONAL)
- @ValueSemantics // <.>
- @PropertyLayout(describedAs = "@ValueSemantics",
- fieldSetId = "annotation", sequence = "1")
+ @PropertyLayout(describedAs = "start date of the date range")
+ @ValueSemantics
@XmlElement(required = false)
@XmlJavaTypeAdapter(JavaTimeJaxbAdapters.LocalDateToStringAdapter.class)
@Getter @Setter
@@ -77,10 +74,10 @@ public class PropertyLayoutRenderDayPage implements
HasAsciiDocDescription {
//tag::render-as-day-before[]
@Property(optionality = Optionality.OPTIONAL)
- @ValueSemantics(dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE)
// <.>
- @PropertyLayout(describedAs =
- "@ValueSemantics(dateRenderAdjustDays =
ValueSemantics.AS_DAY_BEFORE)",
- fieldSetId = "annotation", sequence = "2")
+ @PropertyLayout(describedAs = "end date of the date range (up to and
including)")
+ @ValueSemantics(
+ dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE // <.>
+ )
@XmlElement(required = false)
@XmlJavaTypeAdapter(JavaTimeJaxbAdapters.LocalDateToStringAdapter.class)
@Getter @Setter
@@ -89,53 +86,12 @@ public class PropertyLayoutRenderDayPage implements
HasAsciiDocDescription {
//tag::render-as-day[]
@Property(optionality = Optionality.OPTIONAL)
- @ValueSemantics(dateRenderAdjustDays = 0) // <.>
- @PropertyLayout(describedAs =
- "Value of getEndDate(), but @ValueSemantics(dateRenderAdjustDays =
0)",
- fieldSetId = "annotation", sequence = "3")
- public LocalDate getEndDateRaw() {
+ @PropertyLayout(describedAs = "end date of the date range (excluding)")
+ @ValueSemantics(dateRenderAdjustDays = 0) // <.>
+ public LocalDate getEndDateNotAdjusted() {
return getEndDate();
}
//end::render-as-day[]
-//tag::layout-file[]
- @Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout( // <.>
- describedAs =
- "<cpt:property id=\"endDateLayoutFile\" " +
- "renderedAsDayBefore=\"true\"/>",
- fieldSetId = "layout-file", sequence = "1")
- @XmlElement(required = false)
- @XmlJavaTypeAdapter(JavaTimeJaxbAdapters.LocalDateToStringAdapter.class)
- @Getter @Setter
- private LocalDate endDateUsingLayout;
-//end::layout-file[]
-
-//tag::meta-annotation[]
- @RenderDayMetaAnnotationEndDateExclusive // <.>
- @Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(
- describedAs =
- "@RenderDayMetaAnnotationEndDateExclusive",
- fieldSetId = "meta-annotated", sequence = "1")
- @XmlElement(required = false)
- @XmlJavaTypeAdapter(JavaTimeJaxbAdapters.LocalDateToStringAdapter.class)
- @Getter @Setter
- private LocalDate endDateUsingMetaAnnotation;
-//end::meta-annotation[]
-
-//tag::meta-annotation-overridden[]
- @RenderDayMetaAnnotationStartDateInclusive // <.>
- @Property(optionality = Optionality.OPTIONAL)
- @ValueSemantics(dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE)
- @PropertyLayout(describedAs =
- "@RenderDayMetaAnnotationEndDateExclusive",
- fieldSetId = "meta-annotated-overridden", sequence = "1")
- @XmlElement(required = false)
- @XmlJavaTypeAdapter(JavaTimeJaxbAdapters.LocalDateToStringAdapter.class)
- @Getter @Setter
- private LocalDate endDateUsingMetaAnnotationButOverridden;
-//end::meta-annotation-overridden[]
-
}
//end::class[]
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage.layout.xml
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage.layout.xml
similarity index 85%
rename from
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage.layout.xml
rename to
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage.layout.xml
index 42a2897e22..41966cc762 100644
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage.layout.xml
+++
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage.layout.xml
@@ -27,15 +27,13 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Annotated" id="annotation"/>
- <cpt:fieldSet name="Layout File" id="layout-file">
-<!-- tag::layout-file[] -->
- <cpt:property id="endDateLayoutFile"
renderedAsDayBefore="true"/>
-<!-- end::layout-file[] -->
- </cpt:fieldSet>
- <cpt:fieldSet name="Contributed" id="contributed"/>
- <cpt:fieldSet name="Meta-annotated"
id="meta-annotated"/>
- <cpt:fieldSet name="Meta-annotated Overridden"
id="meta-annotated-overridden"/>
+ <cpt:fieldSet name="General" id="general">
+ <cpt:property id="startDate"/>
+ <cpt:property id="endDate"/>
+ </cpt:fieldSet>
+ <cpt:fieldSet name="Internal" id="internal">
+ <cpt:property id="endDateNotAdjusted"/>
+ </cpt:fieldSet>
<cpt:fieldSet name="Other" id="other"
unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_downloadAsXml.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage_downloadAsXml.java
similarity index 80%
rename from
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_downloadAsXml.java
rename to
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage_downloadAsXml.java
index 9e2718de60..7a249e7719 100644
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_downloadAsXml.java
+++
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage_downloadAsXml.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.domain.properties.PropertyLayout.renderDay;
+package demoapp.dom.domain.properties.ValueSemantics.dateRenderAdjustDays;
import javax.inject.Inject;
@@ -35,17 +35,17 @@ import lombok.val;
semantics = SemanticsOf.IDEMPOTENT
)
@RequiredArgsConstructor
-public class PropertyLayoutRenderDayPage_downloadAsXml {
+public class ValueSemanticsDateRenderAdjustDaysPage_downloadAsXml {
- private final PropertyLayoutRenderDayPage propertyLayoutRenderDayPage;
+ private final ValueSemanticsDateRenderAdjustDaysPage
valueSemanticsDateRenderAdjustDaysPage;
@MemberSupport public Clob act(final String fileName) {
- val xml = jaxbService.toXml(propertyLayoutRenderDayPage);
+ val xml = jaxbService.toXml(valueSemanticsDateRenderAdjustDaysPage);
return Clob.of(fileName, NamedWithMimeType.CommonMimeType.XML, xml);
}
@MemberSupport public String default0Act() {
- return "PropertyLayoutRenderVm.xml";
+ return "ValueSemantics.dateRenderAdjustDaysPage.xml";
}
@Inject
diff --git
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithParameterLayout.java
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage_updateEndDate.java
similarity index 78%
rename from
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithParameterLayout.java
rename to
examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage_updateEndDate.java
index 74194b4335..ee75c62dfc 100644
---
a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/PropertyLayout/renderDay/PropertyLayoutRenderDayPage_updateEndDateWithParameterLayout.java
+++
b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/ValueSemantics/dateRenderAdjustDays/ValueSemanticsDateRenderAdjustDaysPage_updateEndDate.java
@@ -16,9 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.domain.properties.PropertyLayout.renderDay;
+package demoapp.dom.domain.properties.ValueSemantics.dateRenderAdjustDays;
-import java.time.LocalDate;
import org.apache.causeway.applib.annotation.Action;
import org.apache.causeway.applib.annotation.ActionLayout;
@@ -29,25 +28,22 @@ import
org.apache.causeway.applib.annotation.ParameterLayout;
import org.apache.causeway.applib.annotation.SemanticsOf;
import org.apache.causeway.applib.annotation.ValueSemantics;
+import java.time.LocalDate;
+
import lombok.RequiredArgsConstructor;
-@Action(
- semantics = SemanticsOf.IDEMPOTENT
+@Action(semantics = SemanticsOf.IDEMPOTENT
)
-@ActionLayout(
- associateWith = "endDate"
- , sequence = "1")
+@ActionLayout(associateWith = "endDate", sequence = "1")
@RequiredArgsConstructor
-public class PropertyLayoutRenderDayPage_updateEndDateWithParameterLayout {
+public class ValueSemanticsDateRenderAdjustDaysPage_updateEndDate {
- private final PropertyLayoutRenderDayPage page;
+ private final ValueSemanticsDateRenderAdjustDaysPage page;
//tag::annotation[]
- @MemberSupport public PropertyLayoutRenderDayPage act(
+ @MemberSupport public ValueSemanticsDateRenderAdjustDaysPage act(
@Parameter(optionality = Optionality.OPTIONAL)
@ValueSemantics(dateRenderAdjustDays =
ValueSemantics.AS_DAY_BEFORE) // <.>
- @ParameterLayout(describedAs =
- "@ValueSemantics(dateRenderAdjustDays =
ValueSemantics.AS_DAY_BEFORE)")
final LocalDate endDate) {
page.setEndDate(endDate);
return page;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index 28e73d691f..56b8e29b78 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -104,10 +104,13 @@ For latest we use:
https://raw.githubusercontent.com/apache/causeway/master/anto
<mb3:serviceAction objectType="demo.PropertyLayoutMenu"
id="multiLine"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu"
id="named"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu"
id="navigable"/>
- <mb3:serviceAction objectType="demo.PropertyLayoutMenu"
id="renderDay"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu"
id="repainting"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu"
id="typicalLength"/>
</mb3:section>
+ <mb3:section>
+ <mb3:named>@ValueSemantics</mb3:named>
+ <mb3:serviceAction objectType="demo.ValueSemanticsMenu"
id="dateRenderAdjustDays"/>
+ </mb3:section>
</mb3:menu>
<mb3:menu>