You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/04/09 18:44:54 UTC

[isis] branch master updated (525f803 -> cccf7c6)

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

ahuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from 525f803  ISIS-2602: fixes Persistable_datanucleusIdLong not being hidden with tables
     new 2af0a81  ISIS-2063: Entering a string such as 10:45 for a joda LocalTime causes stack trace
     new cccf7c6  ISIS-2063: demo: adding Joda Local Time (no docs, no layout)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/java/demoapp/dom/menubars.layout.xml  |  1 +
 .../dom/types/jodatime/JodaTimeTypesMenu.java      |  6 ++
 .../JodaLocalTimes.java}                           | 28 +++++-----
 .../jodalocaltime/holder/JodaLocalTimeHolder.java} | 22 ++++----
 .../holder/JodaLocalTimeHolder2.java}              | 14 ++---
 .../JodaLocalTimeHolder_actionReturning.java}      |  8 +--
 ...LocalTimeHolder_actionReturningCollection.java} |  6 +-
 .../holder/JodaLocalTimeHolder_mixinProperty.java} |  8 +--
 ...TimeHolder_updateReadOnlyOptionalProperty.java} | 12 ++--
 ...odaLocalTimeHolder_updateReadOnlyProperty.java} | 10 ++--
 ...eHolder_updateReadOnlyPropertyWithChoices.java} | 16 +++---
 .../jodalocaltime/jdo/JodaLocalTimeJdo.java}       | 60 ++++++++++----------
 .../jdo/JodaLocalTimeJdoEntities.java}             | 14 ++---
 .../jdo/JodaLocalTimeJdoSeedService.java}          | 16 +++---
 .../samples/JodaLocalTimeSamples.java}             | 14 +++--
 .../vm/JodaLocalTimeVm.java}                       | 64 +++++++++++-----------
 ...tePanel.java => ConverterForJodaLocalTime.java} | 32 +++++------
 .../JodaLocalTimePanel.java}                       | 39 +++++++------
 ...Factory.java => JodaLocalTimePanelFactory.java} | 22 ++++----
 .../ComponentFactoryRegistrarDefault.java          |  2 +
 20 files changed, 200 insertions(+), 194 deletions(-)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/{jodalocaldate/JodaLocalDates.java => jodalocaltime/JodaLocalTimes.java} (74%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{isisext/asciidocs/holder/IsisAsciiDocHolder.java => jodatime/jodalocaltime/holder/JodaLocalTimeHolder.java} (60%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/{jodalocaldate/holder/JodaLocalDateHolder2.java => jodalocaltime/holder/JodaLocalTimeHolder2.java} (85%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{javalang/characters/holder/WrapperCharacterHolder_actionReturning.java => jodatime/jodalocaltime/holder/JodaLocalTimeHolder_actionReturning.java} (85%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/{jodalocaldatetime/holder/JodaLocalDateTimeHolder_actionReturningCollection.java => jodalocaltime/holder/JodaLocalTimeHolder_actionReturningCollection.java} (89%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{javalang/characters/holder/WrapperCharacterHolder_mixinProperty.java => jodatime/jodalocaltime/holder/JodaLocalTimeHolder_mixinProperty.java} (86%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{javalang/doubles/holder/WrapperDoubleHolder_updateReadOnlyOptionalProperty.java => jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyOptionalProperty.java} (84%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/{jodalocaldate/holder/JodaLocalDateHolder_updateReadOnlyProperty.java => jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyProperty.java} (84%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/{jodalocaldate/holder/JodaLocalDateHolder_updateReadOnlyPropertyWithChoices.java => jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyPropertyWithChoices.java} (80%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{javalang/doubles/jdo/WrapperDoubleJdo.java => jodatime/jodalocaltime/jdo/JodaLocalTimeJdo.java} (51%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{javalang/doubles/jdo/WrapperDoubleJdoEntities.java => jodatime/jodalocaltime/jdo/JodaLocalTimeJdoEntities.java} (76%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{javalang/doubles/jdo/WrapperDoubleJdoSeedService.java => jodatime/jodalocaltime/jdo/JodaLocalTimeJdoSeedService.java} (80%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/{isis/passwords/samples/IsisPasswordsSamples.java => jodatime/jodalocaltime/samples/JodaLocalTimeSamples.java} (73%)
 copy examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/{jodadatetime/vm/JodaDateTimeVm.java => jodalocaltime/vm/JodaLocalTimeVm.java} (51%)
 copy viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/{JodaLocalDatePanel.java => ConverterForJodaLocalTime.java} (59%)
 copy viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/{primitive/BytePanel.java => jodatime/JodaLocalTimePanel.java} (64%)
 copy viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/{JodaLocalDatePanelFactory.java => JodaLocalTimePanelFactory.java} (80%)

[isis] 02/02: ISIS-2063: demo: adding Joda Local Time (no docs, no layout)

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit cccf7c6aafed73de9723d4cc2e1e62aa3969aeea
Author: ahuber@apache.org <ah...@luna>
AuthorDate: Fri Apr 9 20:42:50 2021 +0200

    ISIS-2063: demo: adding Joda Local Time (no docs, no layout)
---
 .../src/main/java/demoapp/dom/menubars.layout.xml  |  1 +
 .../dom/types/jodatime/JodaTimeTypesMenu.java      |  6 ++
 .../jodatime/jodalocaltime/JodaLocalTimes.java     | 82 ++++++++++++++++++++
 .../jodalocaltime/holder/JodaLocalTimeHolder.java  | 37 +++++++++
 .../jodalocaltime/holder/JodaLocalTimeHolder2.java | 74 ++++++++++++++++++
 .../JodaLocalTimeHolder_actionReturning.java       | 39 ++++++++++
 ...aLocalTimeHolder_actionReturningCollection.java | 52 +++++++++++++
 .../holder/JodaLocalTimeHolder_mixinProperty.java  | 41 ++++++++++
 ...lTimeHolder_updateReadOnlyOptionalProperty.java | 54 +++++++++++++
 ...JodaLocalTimeHolder_updateReadOnlyProperty.java | 49 ++++++++++++
 ...meHolder_updateReadOnlyPropertyWithChoices.java | 65 ++++++++++++++++
 .../jodalocaltime/jdo/JodaLocalTimeJdo.java        | 80 ++++++++++++++++++++
 .../jdo/JodaLocalTimeJdoEntities.java              | 44 +++++++++++
 .../jdo/JodaLocalTimeJdoSeedService.java           | 57 ++++++++++++++
 .../samples/JodaLocalTimeSamples.java              | 39 ++++++++++
 .../jodatime/jodalocaltime/vm/JodaLocalTimeVm.java | 88 ++++++++++++++++++++++
 16 files changed, 808 insertions(+)

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 e24e574..c902c7d 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
@@ -195,6 +195,7 @@ For latest we use: https://raw.githubusercontent.com/apache/isis/master/antora/s
                 <mb3:named>JodaTime</mb3:named>
                 <mb3:serviceAction objectType="demo.JodaTimeTypesMenu" id="localDates"/>
                 <mb3:serviceAction objectType="demo.JodaTimeTypesMenu" id="localDateTimes"/>
+                <mb3:serviceAction objectType="demo.JodaTimeTypesMenu" id="localTimes"/>
                 <mb3:serviceAction objectType="demo.JodaTimeTypesMenu" id="dateTimes"/>
             </mb3:section>
         </mb3:menu>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/JodaTimeTypesMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/JodaTimeTypesMenu.java
index a381e17..4828cfa 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/JodaTimeTypesMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/JodaTimeTypesMenu.java
@@ -31,6 +31,7 @@ import lombok.extern.log4j.Log4j2;
 import demoapp.dom.types.jodatime.jodadatetime.JodaDateTimes;
 import demoapp.dom.types.jodatime.jodalocaldate.JodaLocalDates;
 import demoapp.dom.types.jodatime.jodalocaldatetime.JodaLocalDateTimes;
+import demoapp.dom.types.jodatime.jodalocaltime.JodaLocalTimes;
 
 @DomainService(nature=NatureOfService.VIEW, objectType = "demo.JodaTimeTypesMenu")
 @DomainObjectLayout(named="JodaTimeTypes")
@@ -55,5 +56,10 @@ public class JodaTimeTypesMenu {
         return new JodaLocalDateTimes();
     }
 
+    @Action(semantics = SemanticsOf.SAFE)
+    @ActionLayout(cssClassFa="fa-clock")
+    public JodaLocalTimes localTimes(){
+        return new JodaLocalTimes();
+    }
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/JodaLocalTimes.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/JodaLocalTimes.java
new file mode 100644
index 0000000..68add9c
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/JodaLocalTimes.java
@@ -0,0 +1,82 @@
+/*
+ *  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.types.jodatime.jodalocaltime;
+
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.joda.time.LocalTime;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.extern.log4j.Log4j2;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.types.Samples;
+import demoapp.dom.types.jodatime.jodalocaltime.jdo.JodaLocalTimeJdo;
+import demoapp.dom.types.jodatime.jodalocaltime.jdo.JodaLocalTimeJdoEntities;
+import demoapp.dom.types.jodatime.jodalocaltime.vm.JodaLocalTimeVm;
+
+@XmlRootElement(name = "Demo")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(nature=Nature.VIEW_MODEL, objectType = "demo.JodaLocalTimes", editing=Editing.ENABLED)
+@Log4j2
+public class JodaLocalTimes implements HasAsciiDocDescription {
+
+    public String title() {
+        return "org.joda.time.LocalTime data type";
+    }
+
+    @Action(semantics = SemanticsOf.SAFE)
+    @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
+    public JodaLocalTimeVm openViewModel(org.joda.time.LocalTime initialValue) {
+        return new JodaLocalTimeVm(initialValue);
+    }
+    public org.joda.time.LocalTime default0OpenViewModel() {
+        return samples.single();
+    }
+
+    @Collection
+    public List<JodaLocalTimeJdo> getEntities() {
+        return entities.all();
+    }
+
+    @Inject
+    @XmlTransient
+    JodaLocalTimeJdoEntities entities;
+
+    @Inject
+    @XmlTransient
+    Samples<LocalTime> samples;
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder.java
new file mode 100644
index 0000000..f137757
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder.java
@@ -0,0 +1,37 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+//tag::class[]
+public interface JodaLocalTimeHolder {
+
+    org.joda.time.LocalTime getReadOnlyProperty();
+    void setReadOnlyProperty(org.joda.time.LocalTime c);
+
+    org.joda.time.LocalTime getReadWriteProperty();
+    void setReadWriteProperty(org.joda.time.LocalTime c);
+
+    org.joda.time.LocalTime getReadOnlyOptionalProperty();
+    void setReadOnlyOptionalProperty(org.joda.time.LocalTime c);
+
+    org.joda.time.LocalTime getReadWriteOptionalProperty();
+    void setReadWriteOptionalProperty(org.joda.time.LocalTime c);
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder2.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder2.java
new file mode 100644
index 0000000..f060793
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder2.java
@@ -0,0 +1,74 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+//tag::class[]
+public interface JodaLocalTimeHolder2 extends JodaLocalTimeHolder {
+
+    @Property                                               // <.>
+    @PropertyLayout(
+        labelPosition = LabelPosition.LEFT,                 // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=LEFT)",
+        hidden = Where.ALL_TABLES, 
+        fieldSetId = "label-positions", sequence = "1")  // <.>
+    default org.joda.time.LocalTime getReadOnlyPropertyDerivedLabelPositionLeft() {
+        return getReadOnlyProperty();
+    }
+
+    @Property
+    @PropertyLayout(
+        labelPosition = LabelPosition.TOP,                  // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=TOP)",
+        hidden = Where.ALL_TABLES,
+        fieldSetId = "label-positions", sequence = "2")
+    default org.joda.time.LocalTime getReadOnlyPropertyDerivedLabelPositionTop() {
+        return getReadOnlyProperty();
+    }
+
+    @Property
+    @PropertyLayout(
+        labelPosition = LabelPosition.RIGHT,                // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=RIGHT)",
+        hidden = Where.ALL_TABLES,
+        fieldSetId = "label-positions", sequence = "3")
+    default org.joda.time.LocalTime getReadOnlyPropertyDerivedLabelPositionRight() {
+        return getReadOnlyProperty();
+    }
+
+    @Property
+    @PropertyLayout(
+        labelPosition = LabelPosition.NONE,                 // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=NONE)",
+        hidden = Where.ALL_TABLES,
+        fieldSetId = "label-positions", sequence = "4")
+    default org.joda.time.LocalTime getReadOnlyPropertyDerivedLabelPositionNone() {
+        return getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_actionReturning.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_actionReturning.java
new file mode 100644
index 0000000..cca3cc9
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_actionReturning.java
@@ -0,0 +1,39 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(semantics = SemanticsOf.SAFE)
+@RequiredArgsConstructor
+public class JodaLocalTimeHolder_actionReturning {
+
+    private final JodaLocalTimeHolder holder;
+
+    public org.joda.time.LocalTime act() {
+        return holder.getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_actionReturningCollection.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_actionReturningCollection.java
new file mode 100644
index 0000000..01ae8b9
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_actionReturningCollection.java
@@ -0,0 +1,52 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+import java.util.Collection;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
+import org.joda.time.LocalDateTime;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+import demoapp.dom.types.Samples;
+
+
+//tag::class[]
+@Action(semantics = SemanticsOf.SAFE)
+@RequiredArgsConstructor
+public class JodaLocalTimeHolder_actionReturningCollection {
+
+    private final JodaLocalTimeHolder holder;
+
+    public Collection<org.joda.time.LocalDateTime> act() {
+        return samples.stream()
+                .collect(Collectors.toList());
+    }
+
+    @Inject
+    Samples<LocalDateTime> samples;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_mixinProperty.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_mixinProperty.java
new file mode 100644
index 0000000..495b8c7
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_mixinProperty.java
@@ -0,0 +1,41 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Property()
+@PropertyLayout(hidden = Where.ALL_TABLES, fieldSetId = "contributed", sequence = "1")
+@RequiredArgsConstructor
+public class JodaLocalTimeHolder_mixinProperty {
+
+    private final JodaLocalTimeHolder holder;
+
+    public org.joda.time.LocalTime prop() {
+        return holder.getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyOptionalProperty.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyOptionalProperty.java
new file mode 100644
index 0000000..f2b8bc0
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyOptionalProperty.java
@@ -0,0 +1,54 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(
+        semantics = SemanticsOf.IDEMPOTENT,
+        associateWith = "readOnlyOptionalProperty"
+)
+@ActionLayout(promptStyle = PromptStyle.INLINE, named = "Update", sequence = "1")
+@RequiredArgsConstructor
+public class JodaLocalTimeHolder_updateReadOnlyOptionalProperty {
+
+    private final JodaLocalTimeHolder holder;
+
+    public JodaLocalTimeHolder act(
+            @Parameter(optionality = Optionality.OPTIONAL)              // <.>
+            org.joda.time.LocalTime newValue
+    ) {
+        holder.setReadOnlyOptionalProperty(newValue);
+        return holder;
+    }
+    public org.joda.time.LocalTime default0Act() {
+        return holder.getReadOnlyOptionalProperty();
+    }
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyProperty.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyProperty.java
new file mode 100644
index 0000000..03624a8
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyProperty.java
@@ -0,0 +1,49 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(
+        semantics = SemanticsOf.IDEMPOTENT,
+        associateWith = "readOnlyProperty"
+)
+@ActionLayout(promptStyle = PromptStyle.INLINE, named = "Update", sequence = "1")
+@RequiredArgsConstructor
+public class JodaLocalTimeHolder_updateReadOnlyProperty {
+
+    private final JodaLocalTimeHolder holder;
+
+    public JodaLocalTimeHolder act(org.joda.time.LocalTime newValue) {
+        holder.setReadOnlyProperty(newValue);
+        return holder;
+    }
+    public org.joda.time.LocalTime default0Act() {
+        return holder.getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyPropertyWithChoices.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyPropertyWithChoices.java
new file mode 100644
index 0000000..9d2c12f
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/holder/JodaLocalTimeHolder_updateReadOnlyPropertyWithChoices.java
@@ -0,0 +1,65 @@
+/*
+ *  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.types.jodatime.jodalocaltime.holder;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
+import org.joda.time.LocalTime;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+import demoapp.dom.types.Samples;
+
+
+//tag::class[]
+@Action(
+        semantics = SemanticsOf.IDEMPOTENT,
+        associateWith = "readOnlyProperty"
+)
+@ActionLayout(promptStyle = PromptStyle.INLINE, named = "Update with choices", sequence = "2")
+@RequiredArgsConstructor
+public class JodaLocalTimeHolder_updateReadOnlyPropertyWithChoices {
+
+    private final JodaLocalTimeHolder holder;
+
+    public JodaLocalTimeHolder act(org.joda.time.LocalTime newValue) {
+        holder.setReadOnlyProperty(newValue);
+        return holder;
+    }
+    public org.joda.time.LocalTime default0Act() {
+        return holder.getReadOnlyProperty();
+    }
+    public List<org.joda.time.LocalTime> choices0Act() {
+        return samples.stream()
+                .collect(Collectors.toList());
+    }
+
+    @Inject
+    Samples<LocalTime> samples;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdo.java
new file mode 100644
index 0000000..8fbb2cc
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdo.java
@@ -0,0 +1,80 @@
+/*
+ *  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.types.jodatime.jodalocaltime.jdo;
+
+import javax.jdo.annotations.Column;
+import javax.jdo.annotations.DatastoreIdentity;
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.types.jodatime.jodalocaltime.holder.JodaLocalTimeHolder2;
+import lombok.Getter;
+import lombok.Setter;
+
+//tag::class[]
+@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
+@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
+@DomainObject(
+      objectType = "demo.JodaLocalTimeJdo"
+)
+public class JodaLocalTimeJdo                                          // <.>
+      implements HasAsciiDocDescription, JodaLocalTimeHolder2 {
+
+//end::class[]
+  public JodaLocalTimeJdo(org.joda.time.LocalTime initialValue) {
+      this.readOnlyProperty = initialValue;
+      this.readWriteProperty = initialValue;
+  }
+
+//tag::class[]
+  @Title(prepend = "org.joda.time.LocalTime JDO entity: ")
+  @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+  @Column(allowsNull = "false")                                               // <.>
+  @Getter @Setter
+  private org.joda.time.LocalTime readOnlyProperty;
+
+  @Property(editing = Editing.ENABLED)                                        // <.>
+  @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+  @Column(allowsNull = "false")
+  @Getter @Setter
+  private org.joda.time.LocalTime readWriteProperty;
+
+  @Property(optionality = Optionality.OPTIONAL)                               // <.>
+  @PropertyLayout(fieldSetId = "optional-properties", sequence = "1")
+  @Column(allowsNull = "true")                                                // <.>
+  @Getter @Setter
+  private org.joda.time.LocalTime readOnlyOptionalProperty;
+
+  @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+  @PropertyLayout(fieldSetId = "optional-properties", sequence = "2")
+  @Column(allowsNull = "true")
+  @Getter @Setter
+  private org.joda.time.LocalTime readWriteOptionalProperty;
+
+}
+//end::class[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdoEntities.java
new file mode 100644
index 0000000..543da82
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdoEntities.java
@@ -0,0 +1,44 @@
+/*
+ *  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.types.jodatime.jodalocaltime.jdo;
+
+import java.util.List;
+import java.util.Optional;
+
+import javax.inject.Inject;
+
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.applib.services.repository.RepositoryService;
+
+@Service
+public class JodaLocalTimeJdoEntities {
+
+    public Optional<JodaLocalTimeJdo> find(final org.joda.time.LocalTime readOnlyProperty) {
+        return repositoryService.firstMatch(JodaLocalTimeJdo.class, x -> x.getReadOnlyProperty().equals(readOnlyProperty));
+    }
+
+    public List<JodaLocalTimeJdo> all() {
+        return repositoryService.allInstances(JodaLocalTimeJdo.class);
+    }
+
+    @Inject
+    RepositoryService repositoryService;
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdoSeedService.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdoSeedService.java
new file mode 100644
index 0000000..deef7d3
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/jdo/JodaLocalTimeJdoSeedService.java
@@ -0,0 +1,57 @@
+/*
+ *  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.types.jodatime.jodalocaltime.jdo;
+
+import javax.inject.Inject;
+
+import org.joda.time.LocalTime;
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.applib.services.repository.RepositoryService;
+import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScript;
+
+import demoapp.dom._infra.seed.SeedServiceAbstract;
+import demoapp.dom.types.Samples;
+
+@Service
+public class JodaLocalTimeJdoSeedService extends SeedServiceAbstract {
+
+    public JodaLocalTimeJdoSeedService() {
+        super(JodaLocalTimeJdoEntityFixture::new);
+    }
+
+    static class JodaLocalTimeJdoEntityFixture extends FixtureScript {
+
+        @Override
+        protected void execute(ExecutionContext executionContext) {
+            samples.stream()
+                    .map(JodaLocalTimeJdo::new)
+                    .forEach(domainObject -> {
+                        repositoryService.persist(domainObject);
+                        executionContext.addResult(this, domainObject);
+                    });
+        }
+
+        @Inject
+        RepositoryService repositoryService;
+
+        @Inject
+        Samples<LocalTime> samples;
+    }
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/samples/JodaLocalTimeSamples.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/samples/JodaLocalTimeSamples.java
new file mode 100644
index 0000000..d9048ad
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/samples/JodaLocalTimeSamples.java
@@ -0,0 +1,39 @@
+/*
+ *  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.types.jodatime.jodalocaltime.samples;
+
+import java.util.stream.Stream;
+
+import org.joda.time.LocalTime;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom.types.Samples;
+
+@Service
+public class JodaLocalTimeSamples implements Samples<LocalTime> {
+
+    @Override
+    public Stream<LocalTime> stream() {
+        return Stream.of(0, 8)
+                .flatMap(hour -> 
+                    Stream.of(0, 15)
+                        .map(minute -> new org.joda.time.LocalTime(hour, minute, 30)));
+    }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/vm/JodaLocalTimeVm.java b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/vm/JodaLocalTimeVm.java
new file mode 100644
index 0000000..2e3dbed
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/jodatime/jodalocaltime/vm/JodaLocalTimeVm.java
@@ -0,0 +1,88 @@
+/*
+ *  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.types.jodatime.jodalocaltime.vm;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.jaxb.JodaTimeJaxbAdapters;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.types.jodatime.jodalocaltime.holder.JodaLocalTimeHolder2;
+import lombok.Getter;
+import lombok.Setter;
+
+//tag::class[]
+@XmlRootElement(name = "root")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+      nature=Nature.VIEW_MODEL,
+      objectType = "demo.JodaLocalTimeVm"
+)
+@lombok.NoArgsConstructor                                                       // <.>
+public class JodaLocalTimeVm
+      implements HasAsciiDocDescription, JodaLocalTimeHolder2 {
+
+//end::class[]
+  public JodaLocalTimeVm(org.joda.time.LocalTime initialValue) {
+      this.readOnlyProperty = initialValue;
+      this.readWriteProperty = initialValue;
+  }
+
+//tag::class[]
+  @Title(prepend = "org.joda.time.LocalTime view model: ")
+  @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+  @XmlElement(required = true)                                                // <.>
+  @XmlJavaTypeAdapter(JodaTimeJaxbAdapters.LocalTimeToStringAdapter.class)    // <.>
+  @Getter @Setter
+  private org.joda.time.LocalTime readOnlyProperty;
+
+  @Property(editing = Editing.ENABLED)                                        // <.>
+  @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+  @XmlElement(required = true)
+  @XmlJavaTypeAdapter(JodaTimeJaxbAdapters.LocalTimeToStringAdapter.class)
+  @Getter @Setter
+  private org.joda.time.LocalTime readWriteProperty;
+
+  @Property(optionality = Optionality.OPTIONAL)                               // <.>
+  @PropertyLayout(fieldSetId = "optional-properties", sequence = "1")
+  @XmlJavaTypeAdapter(JodaTimeJaxbAdapters.LocalTimeToStringAdapter.class)
+  @Getter @Setter
+  private org.joda.time.LocalTime readOnlyOptionalProperty;
+
+  @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+  @PropertyLayout(fieldSetId = "optional-properties", sequence = "2")
+  @XmlJavaTypeAdapter(JodaTimeJaxbAdapters.LocalTimeToStringAdapter.class)
+  @Getter @Setter
+  private org.joda.time.LocalTime readWriteOptionalProperty;
+
+}
+//end::class[]

[isis] 01/02: ISIS-2063: Entering a string such as 10:45 for a joda LocalTime causes stack trace

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 2af0a8161a47ebbc7c1a0873be84e0b8b9de6890
Author: joonatan-r <jo...@student.lut.fi>
AuthorDate: Fri Apr 9 18:41:13 2021 +0300

    ISIS-2063: Entering a string such as 10:45 for a joda LocalTime causes stack trace
    
    Without this patch applied, input to a joda LocalTime field causes an error.
    This patch fixes the problem by adding a panel to be used by joda LocalTime.
---
 .../jodatime/ConverterForJodaLocalTime.java        | 43 ++++++++++++++++
 .../scalars/jodatime/JodaLocalTimePanel.java       | 59 ++++++++++++++++++++++
 .../jodatime/JodaLocalTimePanelFactory.java        | 43 ++++++++++++++++
 .../ComponentFactoryRegistrarDefault.java          |  2 +
 4 files changed, 147 insertions(+)

diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/ConverterForJodaLocalTime.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/ConverterForJodaLocalTime.java
new file mode 100644
index 0000000..84978db
--- /dev/null
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/ConverterForJodaLocalTime.java
@@ -0,0 +1,43 @@
+/*
+ *  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.viewer.wicket.ui.components.scalars.jodatime;
+
+import org.apache.wicket.util.convert.ConversionException;
+import org.apache.wicket.util.convert.IConverter;
+import org.joda.time.LocalTime;
+
+import java.util.Locale;
+
+public class ConverterForJodaLocalTime implements IConverter<LocalTime> {
+    
+    private static final long serialVersionUID = 1L;
+    
+    public LocalTime convertToObject(String value, Locale locale) throws ConversionException {
+        try {
+            return LocalTime.parse(value);
+        } catch (Exception e) {
+            throw new ConversionException("'" + value + "' is not a valid time.");
+        }
+    }
+    
+    public String convertToString(LocalTime value, Locale locale) {
+        return value.toString();
+    }
+}
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalTimePanel.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalTimePanel.java
new file mode 100644
index 0000000..2434193
--- /dev/null
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalTimePanel.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 org.apache.isis.viewer.wicket.ui.components.scalars.jodatime;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldAbstract;
+import org.apache.isis.viewer.wicket.ui.components.scalars.TextFieldValueModel;
+import org.apache.wicket.markup.html.form.AbstractTextComponent;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.util.convert.IConverter;
+import org.joda.time.LocalTime;
+
+/**
+ * Panel for rendering scalars of type {@link LocalTime}.
+ */
+public class JodaLocalTimePanel extends ScalarPanelTextFieldAbstract<LocalTime> {
+    
+    private static final long serialVersionUID = 1L;
+    
+    public JodaLocalTimePanel(final String id, final ScalarModel scalarModel) {
+        super(id, scalarModel, LocalTime.class);
+    }
+    
+    @Override
+    protected AbstractTextComponent<LocalTime> createTextFieldForRegular(final String id) {
+        final TextFieldValueModel<LocalTime> textFieldValueModel = new TextFieldValueModel<>(this);
+        return new TextField<LocalTime>(id, textFieldValueModel, LocalTime.class) {
+            private static final long serialVersionUID = 1L;
+    
+            @SuppressWarnings("unchecked")
+            @Override
+            public <C> IConverter<C> getConverter(Class<C> type) {
+                return (IConverter<C>) (type == LocalTime.class ? new ConverterForJodaLocalTime() : super.getConverter(type));
+            }
+        };
+    }
+    
+    @Override
+    protected String getScalarPanelType() {
+        return "jodaLocalTimePanel";
+    }
+}
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalTimePanelFactory.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalTimePanelFactory.java
new file mode 100644
index 0000000..10e3293
--- /dev/null
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalTimePanelFactory.java
@@ -0,0 +1,43 @@
+/*
+ *  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.viewer.wicket.ui.components.scalars.jodatime;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+import org.apache.isis.viewer.wicket.ui.ComponentFactory;
+import org.apache.isis.viewer.wicket.ui.components.scalars.ComponentFactoryScalarAbstract;
+import org.apache.wicket.Component;
+import org.joda.time.LocalTime;
+
+/**
+ * {@link ComponentFactory} for {@link JodaLocalTimePanel}.
+ */
+public class JodaLocalTimePanelFactory extends ComponentFactoryScalarAbstract {
+    
+    private static final long serialVersionUID = 1L;
+    
+    public JodaLocalTimePanelFactory() {
+        super(JodaLocalTimePanel.class, LocalTime.class);
+    }
+    
+    @Override
+    public Component createComponent(final String id, final ScalarModel scalarModel) {
+        return new JodaLocalTimePanel(id, scalarModel);
+    }
+}
diff --git a/viewers/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java b/viewers/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
index b00775f..7edb75e 100644
--- a/viewers/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
+++ b/viewers/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
@@ -65,6 +65,7 @@ import org.apache.isis.viewer.wicket.ui.components.scalars.jdkmath.JavaMathBigIn
 import org.apache.isis.viewer.wicket.ui.components.scalars.jodatime.JodaDateTimePanelFactory;
 import org.apache.isis.viewer.wicket.ui.components.scalars.jodatime.JodaLocalDatePanelFactory;
 import org.apache.isis.viewer.wicket.ui.components.scalars.jodatime.JodaLocalDateTimePanelFactory;
+import org.apache.isis.viewer.wicket.ui.components.scalars.jodatime.JodaLocalTimePanelFactory;
 import org.apache.isis.viewer.wicket.ui.components.scalars.markup.MarkupPanelFactories;
 import org.apache.isis.viewer.wicket.ui.components.scalars.oiddto.OidDtoPanelFactory;
 import org.apache.isis.viewer.wicket.ui.components.scalars.passwd.IsisPasswordPanelFactory;
@@ -252,6 +253,7 @@ public class ComponentFactoryRegistrarDefault implements ComponentFactoryRegistr
 
         componentFactories.add(new JodaLocalDatePanelFactory());
         componentFactories.add(new JodaLocalDateTimePanelFactory());
+        componentFactories.add(new JodaLocalTimePanelFactory());
         componentFactories.add(new JodaDateTimePanelFactory());
 
         componentFactories.add(new Jdk8OffsetDateTimePanelFactory());