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

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

commit 44086765f53439b2b77b73804d4eadca2c1a6f65
Author: danhaywood <[email protected]>
AuthorDate: Tue May 16 11:10:48 2023 +0100

    CAUSEWAY-2485 : updates templates for generating data type demo pages
---
 .../demoshowcases/value/ValueShowCase.java         |  2 +-
 .../src/main/resources/$Templates-description.adoc | 25 +++++++++------------
 .../$Templates-description~primitive.adoc          | 26 ++++++++++------------
 .../src/main/resources/$Templates.layout.xml       | 18 +++++++++------
 .../$TemplateHolder_actionReturningArray.java      |  3 ++-
 .../$TemplateHolder_actionReturningCollection.java |  3 ++-
 ..._updateReadOnlyOptionalPropertyWithChoices.java |  3 ++-
 ...teHolder_updateReadOnlyPropertyWithChoices.java |  3 ++-
 .../persistence/$TemplateEntity.layout.xml         | 19 +++++++++-------
 .../$TemplateEntity~primitive.layout.xml           | 19 +++++++++-------
 .../src/main/resources/vm/$TemplateVm.layout.xml   | 23 ++++++++++---------
 .../resources/vm/$TemplateVm~primitive.layout.xml  | 19 +++++++++-------
 .../value/ValueTypeGenTemplateTest.java            |  4 ++--
 13 files changed, 91 insertions(+), 76 deletions(-)

diff --git 
a/tooling/metaprog/src/main/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueShowCase.java
 
b/tooling/metaprog/src/main/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueShowCase.java
index 6f96b0b383..089d373c8f 100644
--- 
a/tooling/metaprog/src/main/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueShowCase.java
+++ 
b/tooling/metaprog/src/main/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueShowCase.java
@@ -184,7 +184,7 @@ public enum ValueShowCase {
         return Config.builder()
                 .jdoTypeSupportNotice(defaults.getJdoTypeSupportNotice()
                         + " see 
link:https://www.datanucleus.org/products/accessplatform_6_0/jdo/mapping.html#_primitive_and_java_lang_types[DataNucleus]";)
-                .jpaTypeSupportNotice(defaults.getJdoTypeSupportNotice()
+                .jpaTypeSupportNotice(defaults.getJpaTypeSupportNotice()
                         + " see 
link:https://www.objectdb.com/java/jpa/entity/types#simple_java_data_types[ObjectDB]";)
                 .jaxbTypeSupportNotice(defaults.getJaxbTypeSupportNotice()
                         + " see 
link:https://docs.oracle.com/cd/E12840_01/wls/docs103/webserv/data_types.html#wp223908[Oracle]";);
diff --git a/tooling/metaprog/src/main/resources/$Templates-description.adoc 
b/tooling/metaprog/src/main/resources/$Templates-description.adoc
index 023202dea7..e2df2c2eb7 100644
--- a/tooling/metaprog/src/main/resources/$Templates-description.adoc
+++ b/tooling/metaprog/src/main/resources/$Templates-description.adoc
@@ -3,29 +3,26 @@
 //#{generated-file-notice}
 
 The framework has built-in support for the `#{showcase-type}` data type.
+These can be used either in entities or view models.
 
-From here you can:
+== How this demo works
 
-* navigate to an entity that uses the `#{showcase-type}` datatype
-* open a view model that uses the `#{showcase-type}` datatype
+On the left hand side is a collection of entities that uses the 
`#{showcase-type}` datatype.
+There is also an action that opens a view model; this view model also uses the 
`#{showcase-type}` datatype.
 
-Some properties on these domain objects are mandatory, some optional.
+Navigate into the entity or view model to see the datatype used as a property, 
an action parameter and as a return type of collections.
 
-== Common interfaces
+=== Implementation Notes
 
-The entity and view model types both implement some common interfaces.
-
-=== #{showcase-name}Holder
-
-The `#{showcase-name}Holder` interface is used to contribute a number of 
mixins to both types:
+The entity and view model types both implement some common interfaces:
 
+* The `#{showcase-name}Holder` interface is used to contribute a number of 
mixins to both types:
++
 [source,java]
 ----
-include::holder/$TemplateHolder.java[tags=class]
+include::holder/#{showcase-name}Holder.java[tags=class]
 ----
 
-=== #{showcase-name}Holder2
+* The `#{showcase-name}Holder2` interface is used to demonstrate support for 
label positions using `@PropertyLayout(labelPosition=...)`.
 
-The `#{showcase-name}Holder2` interface is used to demonstrate support for 
label positions using `@PropertyLayout(labelPosition=...)`.
 
-Further details, along with the effect of this annotation, can be seen on the 
entity and view model object pages.
\ No newline at end of file
diff --git 
a/tooling/metaprog/src/main/resources/$Templates-description~primitive.adoc 
b/tooling/metaprog/src/main/resources/$Templates-description~primitive.adoc
index dc9174da6e..f4624c487f 100644
--- a/tooling/metaprog/src/main/resources/$Templates-description~primitive.adoc
+++ b/tooling/metaprog/src/main/resources/$Templates-description~primitive.adoc
@@ -2,30 +2,28 @@
 
 //#{generated-file-notice}
 
-The framework has built-in support for the (primitive) `#{showcase-type}` data 
type.
-
-From here you can:
 
-* navigate to an entity that uses the `#{showcase-type}` datatype
-* open a view model that uses the `#{showcase-type}` datatype
+The framework has built-in support for the (primitive) `#{showcase-type}` data 
type.
+These can be used either in entities or view models.
 
-Because `#{showcase-type}` is a primitive value, the properties on these 
domain objects are mandatory.
+== How this demo works
 
-== Common interfaces
+On the left hand side is a collection of entities that uses the 
`#{showcase-type}` datatype.
+There is also an action that opens a view model; this view model also uses the 
`#{showcase-type}` datatype.
 
-The entity and view model types both implement some common interfaces.
+Navigate into the entity or view model to see the datatype used as a property, 
an action parameter and as a return type of collections.
 
-=== #{showcase-name}Holder
+=== Implementation Notes
 
-The `#{showcase-name}Holder` interface is used to contribute a number of 
mixins to both types:
+The entity and view model types both implement some common interfaces:
 
+* The `#{showcase-name}Holder` interface is used to contribute a number of 
mixins to both types:
++
 [source,java]
 ----
-include::holder/$TemplateHolder~primitive.java[tags=class]
+include::holder/#{showcase-name}Holder.java[tags=class]
 ----
 
-=== #{showcase-name}Holder2
+* The `#{showcase-name}Holder2` interface is used to demonstrate support for 
label positions using `@PropertyLayout(labelPosition=...)`.
 
-The `#{showcase-name}Holder2` interface is used to demonstrate support for 
label positions using `@PropertyLayout(labelPosition=...)`.
 
-Further details, along with the effect of this annotation, can be seen on the 
entity and view model object pages.
\ No newline at end of file
diff --git a/tooling/metaprog/src/main/resources/$Templates.layout.xml 
b/tooling/metaprog/src/main/resources/$Templates.layout.xml
index 47ea1745ea..234efaca1c 100644
--- a/tooling/metaprog/src/main/resources/$Templates.layout.xml
+++ b/tooling/metaprog/src/main/resources/$Templates.layout.xml
@@ -40,14 +40,18 @@
                </bs3:col>
                <bs3:col span="6">
                        <cpt:fieldSet name="Description" id="description" >
-                               <cpt:action id="clearHints" position="PANEL" />
-                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
-                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="clearHints" position="PANEL" />
+                <cpt:action id="rebuildMetamodel" position="PANEL"/>
+                <cpt:action id="downloadLayout"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadJdoMetamodel"  
position="PANEL_DROPDOWN"/>
                 <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
-                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
-                               <cpt:property id="description"/>
+                <cpt:action id="recentExecutions"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentAuditTrailEntries"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="impersonateWithRoles"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+                <cpt:property id="description"/>
                        </cpt:fieldSet>
                </bs3:col>
        </bs3:row>
diff --git 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningArray.java
 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningArray.java
index b791bd9e40..9cbb650af3 100644
--- 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningArray.java
+++ 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningArray.java
@@ -24,10 +24,11 @@ import org.apache.causeway.applib.annotation.Action;
 import org.apache.causeway.applib.annotation.SemanticsOf;
 import org.apache.causeway.commons.functional.IndexedConsumer;
 
-import demoapp.dom.types.Samples;
 import lombok.RequiredArgsConstructor;
 import lombok.val;
 
+import demoapp.dom.types.Samples;
+
 /*${generated-file-notice}*/
 //tag::class[]
 @Action(semantics = SemanticsOf.SAFE)
diff --git 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningCollection.java
 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningCollection.java
index 4e8c6826ad..53647da457 100644
--- 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningCollection.java
+++ 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_actionReturningCollection.java
@@ -26,9 +26,10 @@ import javax.inject.Inject;
 import org.apache.causeway.applib.annotation.Action;
 import org.apache.causeway.applib.annotation.SemanticsOf;
 
-import demoapp.dom.types.Samples;
 import lombok.RequiredArgsConstructor;
 
+import demoapp.dom.types.Samples;
+
 /*${generated-file-notice}*/
 //tag::class[]
 @Action(semantics = SemanticsOf.SAFE)
diff --git 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyOptionalPropertyWithChoices.java
 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyOptionalPropertyWithChoices.java
index 7e485d564a..3e92205d7c 100644
--- 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyOptionalPropertyWithChoices.java
+++ 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyOptionalPropertyWithChoices.java
@@ -31,9 +31,10 @@ import org.apache.causeway.applib.annotation.Parameter;
 import org.apache.causeway.applib.annotation.PromptStyle;
 import org.apache.causeway.applib.annotation.SemanticsOf;
 
-import demoapp.dom.types.Samples;
 import lombok.RequiredArgsConstructor;
 
+import demoapp.dom.types.Samples;
+
 /*${generated-file-notice}*/
 //tag::class[]
 @Action(
diff --git 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyPropertyWithChoices.java
 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyPropertyWithChoices.java
index 1c648d02c9..e30e5c2746 100644
--- 
a/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyPropertyWithChoices.java
+++ 
b/tooling/metaprog/src/main/resources/holder/$TemplateHolder_updateReadOnlyPropertyWithChoices.java
@@ -29,9 +29,10 @@ import org.apache.causeway.applib.annotation.MemberSupport;
 import org.apache.causeway.applib.annotation.PromptStyle;
 import org.apache.causeway.applib.annotation.SemanticsOf;
 
-import demoapp.dom.types.Samples;
 import lombok.RequiredArgsConstructor;
 
+import demoapp.dom.types.Samples;
+
 /*${generated-file-notice}*/
 //tag::class[]
 @Action(
diff --git 
a/tooling/metaprog/src/main/resources/persistence/$TemplateEntity.layout.xml 
b/tooling/metaprog/src/main/resources/persistence/$TemplateEntity.layout.xml
index 3b94b28918..b25e69307f 100644
--- a/tooling/metaprog/src/main/resources/persistence/$TemplateEntity.layout.xml
+++ b/tooling/metaprog/src/main/resources/persistence/$TemplateEntity.layout.xml
@@ -39,15 +39,18 @@
                </bs3:col>
                <bs3:col span="6">
                        <cpt:fieldSet name="Description" id="description" >
-                               <cpt:action id="clearHints" position="PANEL" />
-                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
-                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="clearHints" position="PANEL" />
+                <cpt:action id="rebuildMetamodel" position="PANEL"/>
+                <cpt:action id="downloadLayout"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadJdoMetamodel"  
position="PANEL_DROPDOWN"/>
                 <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
-                               <cpt:action id="downloadJdoMetadata"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
-                               <cpt:property id="description"/>
+                <cpt:action id="recentExecutions"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentAuditTrailEntries"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="impersonateWithRoles"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+                <cpt:property id="description"/>
                        </cpt:fieldSet>
                </bs3:col>
        </bs3:row>
diff --git 
a/tooling/metaprog/src/main/resources/persistence/$TemplateEntity~primitive.layout.xml
 
b/tooling/metaprog/src/main/resources/persistence/$TemplateEntity~primitive.layout.xml
index a37745c073..d1cda9ed42 100644
--- 
a/tooling/metaprog/src/main/resources/persistence/$TemplateEntity~primitive.layout.xml
+++ 
b/tooling/metaprog/src/main/resources/persistence/$TemplateEntity~primitive.layout.xml
@@ -38,15 +38,18 @@
                </bs3:col>
                <bs3:col span="6">
                        <cpt:fieldSet name="Description" id="description" >
-                               <cpt:action id="clearHints" position="PANEL" />
-                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
-                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="clearHints" position="PANEL" />
+                <cpt:action id="rebuildMetamodel" position="PANEL"/>
+                <cpt:action id="downloadLayout"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadJdoMetamodel"  
position="PANEL_DROPDOWN"/>
                 <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
-                               <cpt:action id="downloadJdoMetadata"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
-                               <cpt:property id="description"/>
+                <cpt:action id="recentExecutions"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentAuditTrailEntries"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="impersonateWithRoles"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+                <cpt:property id="description"/>
                        </cpt:fieldSet>
                </bs3:col>
        </bs3:row>
diff --git a/tooling/metaprog/src/main/resources/vm/$TemplateVm.layout.xml 
b/tooling/metaprog/src/main/resources/vm/$TemplateVm.layout.xml
index 3b94b28918..0215d651c2 100644
--- a/tooling/metaprog/src/main/resources/vm/$TemplateVm.layout.xml
+++ b/tooling/metaprog/src/main/resources/vm/$TemplateVm.layout.xml
@@ -38,17 +38,20 @@
                        <cpt:fieldSet name="Other" id="other" 
unreferencedProperties="true"/>
                </bs3:col>
                <bs3:col span="6">
-                       <cpt:fieldSet name="Description" id="description" >
-                               <cpt:action id="clearHints" position="PANEL" />
-                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
-                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+            <cpt:fieldSet name="Description" id="description" >
+                <cpt:action id="clearHints" position="PANEL" />
+                <cpt:action id="rebuildMetamodel" position="PANEL"/>
+                <cpt:action id="downloadLayout"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadJdoMetamodel"  
position="PANEL_DROPDOWN"/>
                 <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
-                               <cpt:action id="downloadJdoMetadata"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
-                               <cpt:property id="description"/>
-                       </cpt:fieldSet>
+                <cpt:action id="recentExecutions"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentAuditTrailEntries"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="impersonateWithRoles"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+                <cpt:property id="description"/>
+            </cpt:fieldSet>
                </bs3:col>
        </bs3:row>
        <bs3:row>
diff --git 
a/tooling/metaprog/src/main/resources/vm/$TemplateVm~primitive.layout.xml 
b/tooling/metaprog/src/main/resources/vm/$TemplateVm~primitive.layout.xml
index a37745c073..d1cda9ed42 100644
--- a/tooling/metaprog/src/main/resources/vm/$TemplateVm~primitive.layout.xml
+++ b/tooling/metaprog/src/main/resources/vm/$TemplateVm~primitive.layout.xml
@@ -38,15 +38,18 @@
                </bs3:col>
                <bs3:col span="6">
                        <cpt:fieldSet name="Description" id="description" >
-                               <cpt:action id="clearHints" position="PANEL" />
-                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
-                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="clearHints" position="PANEL" />
+                <cpt:action id="rebuildMetamodel" position="PANEL"/>
+                <cpt:action id="downloadLayout"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="downloadJdoMetamodel"  
position="PANEL_DROPDOWN"/>
                 <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
-                               <cpt:action id="downloadJdoMetadata"  
position="PANEL_DROPDOWN"/>
-                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
-                               <cpt:property id="description"/>
+                <cpt:action id="recentExecutions"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentAuditTrailEntries"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="impersonateWithRoles"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+                <cpt:property id="description"/>
                        </cpt:fieldSet>
                </bs3:col>
        </bs3:row>
diff --git 
a/tooling/metaprog/src/test/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
 
b/tooling/metaprog/src/test/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
index fece2b0406..8f8c5fc0d7 100644
--- 
a/tooling/metaprog/src/test/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
+++ 
b/tooling/metaprog/src/test/java/org/apache/causeway/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
@@ -92,8 +92,8 @@ class ValueTypeGenTemplateTest {
     @BeforeAll
     static void setup() {
         outputRootDir = PERSIST
-                ? FileUtils.makeDir(new File("D:/tmp/valueTypes"))
-                : FileUtils.tempDir("casueway-tooling-showcases");
+                ? FileUtils.makeDir(new File("C:/tmp/valueTypes"))
+                : FileUtils.tempDir("causeway-tooling-showcases");
 
         log.info("tmp dir created in {}", outputRootDir);
     }

Reply via email to