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 2022/08/16 13:55:16 UTC

[isis] branch master updated: ISIS-3123: adoc templating: fill in remaining vars

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


The following commit(s) were added to refs/heads/master by this push:
     new 588db40806 ISIS-3123: adoc templating: fill in remaining vars
588db40806 is described below

commit 588db40806f73253214d6a0127db751d8fe4cca5
Author: andi-huber <ah...@apache.org>
AuthorDate: Tue Aug 16 15:55:06 2022 +0200

    ISIS-3123: adoc templating: fill in remaining vars
---
 .../metaprog/demoshowcases/value/ValueTypeGenTemplate.java | 12 ++++++------
 tooling/metaprog/src/main/resources/$Templates-common.adoc |  4 ++--
 .../src/main/resources/$Templates-description.adoc         | 14 +++++++-------
 .../src/main/resources/jdo/$TemplateJdo-description.adoc   |  2 +-
 .../src/main/resources/jpa/$TemplateJpa-description.adoc   |  2 +-
 .../src/main/resources/vm/$TemplateVm-description.adoc     |  2 +-
 .../demoshowcases/value/ValueTypeGenTemplateTest.java      |  4 ++--
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java b/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java
index 21449f8360..3eb011c7f9 100644
--- a/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java
+++ b/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java
@@ -60,20 +60,20 @@ public class ValueTypeGenTemplate {
         DOC(".adoc"){
             @Override String formatAsComment(final String text) {
                 return "//// " + text + " ////"; }
-            @Override String formatAsTemplateVar(final String text) {
-                return "////${" + text + "}////"; }
+            @Override String formatAsTemplateVar(final String key) {
+                return "#{" + key + "}"; } // ADOC pass through var syntax
         },
         JAVA(".java"){
             @Override String formatAsComment(final String text) {
                 return "/* " + text + " */"; }
-            @Override String formatAsTemplateVar(final String text) {
-                return "/*${" + text + "}*/"; }
+            @Override String formatAsTemplateVar(final String key) {
+                return "/*${" + key + "}*/"; }
         },
         LAYOUT(".layout.xml"){
             @Override String formatAsComment(final String text) {
                 return "<!-- " + text + " -->"; }
-            @Override String formatAsTemplateVar(final String text) {
-                return "<!--${" + text + "}-->"; }
+            @Override String formatAsTemplateVar(final String key) {
+                return "<!--${" + key + "}-->"; }
         };
         boolean isDoc() { return this == DOC; }
         boolean isJava() { return this == JAVA; }
diff --git a/tooling/metaprog/src/main/resources/$Templates-common.adoc b/tooling/metaprog/src/main/resources/$Templates-common.adoc
index 326e6b9eed..a23ce7a9d6 100644
--- a/tooling/metaprog/src/main/resources/$Templates-common.adoc
+++ b/tooling/metaprog/src/main/resources/$Templates-common.adoc
@@ -2,7 +2,7 @@
 
 == Mixin actions
 
-A number of mixin actions contribute through the `JavaUtilUuidHolder` interface, demonstrate the use of `java.util.UUID` as a parameter and as a return type.
+A number of mixin actions contribute through the `#{showcase-name}Holder` interface, demonstrate the use of `#{showcase-type}` as a parameter and as a return type.
 For example:
 
 * the `updateReadOnlyProperty` action is:
@@ -48,7 +48,7 @@ include::holder/$TemplateHolder_mixinProperty.java[tags=class]
 
 == @PropertyLayout(labelPosition=...)
 
-To demonstrate support for label positions using `@PropertyLayout(labelPosition=...)`, the entity and view model objects both implement the extended `JavaUtilUuidHolder2` interface:
+To demonstrate support for label positions using `@PropertyLayout(labelPosition=...)`, the entity and view model objects both implement the extended `#{showcase-name}Holder2` interface:
 
 [source,java]
 ----
diff --git a/tooling/metaprog/src/main/resources/$Templates-description.adoc b/tooling/metaprog/src/main/resources/$Templates-description.adoc
index 1497c75794..3fe6fa17f8 100644
--- a/tooling/metaprog/src/main/resources/$Templates-description.adoc
+++ b/tooling/metaprog/src/main/resources/$Templates-description.adoc
@@ -1,11 +1,11 @@
 :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 framework has built-in support for the `java.util.UUID` data type.
+The framework has built-in support for the `#{showcase-type}` data type.
 
 From here you can:
 
-* navigate to an entity that uses the `java.util.UUID` datatype
-* open a view model that uses the `java.util.UUID` datatype
+* navigate to an entity that uses the `#{showcase-type}` datatype
+* open a view model that uses the `#{showcase-type}` datatype
 
 Some properties on these domain objects are mandatory, some optional.
 
@@ -13,17 +13,17 @@ Some properties on these domain objects are mandatory, some optional.
 
 The entity and view model types both implement some common interfaces.
 
-=== JavaUtilUuidHolder
+=== #{showcase-name}Holder
 
-The `JavaUtilUuidHolder` interface is used to contribute a number of mixins to both types:
+The `#{showcase-name}Holder` interface is used to contribute a number of mixins to both types:
 
 [source,java]
 ----
 include::holder/$TemplateHolder.java[tags=class]
 ----
 
-=== JavaUtilUuidHolder2
+=== #{showcase-name}Holder2
 
-The `JavaUtilUuidHolder2` 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/jdo/$TemplateJdo-description.adoc b/tooling/metaprog/src/main/resources/jdo/$TemplateJdo-description.adoc
index 9e9229e9c1..4719cfcc7a 100644
--- a/tooling/metaprog/src/main/resources/jdo/$TemplateJdo-description.adoc
+++ b/tooling/metaprog/src/main/resources/jdo/$TemplateJdo-description.adoc
@@ -1,6 +1,6 @@
 :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 [...]
 
-JDO supports `java.util.UUID` out-of-the-box, so no special annotations are required.
+JDO supports `#{showcase-type}` out-of-the-box, so no special annotations are required.
 
 [source,java]
 ----
diff --git a/tooling/metaprog/src/main/resources/jpa/$TemplateJpa-description.adoc b/tooling/metaprog/src/main/resources/jpa/$TemplateJpa-description.adoc
index d34e536add..14bddbaa25 100644
--- a/tooling/metaprog/src/main/resources/jpa/$TemplateJpa-description.adoc
+++ b/tooling/metaprog/src/main/resources/jpa/$TemplateJpa-description.adoc
@@ -5,7 +5,7 @@
 TODO this yet is just a copy from JDO
 ====
 
-JDO supports `java.util.UUID` out-of-the-box, so no special annotations are required.
+JDO supports `#{showcase-type}` out-of-the-box, so no special annotations are required.
 
 [source,java]
 ----
diff --git a/tooling/metaprog/src/main/resources/vm/$TemplateVm-description.adoc b/tooling/metaprog/src/main/resources/vm/$TemplateVm-description.adoc
index 3763d2c948..bc8bef6e80 100644
--- a/tooling/metaprog/src/main/resources/vm/$TemplateVm-description.adoc
+++ b/tooling/metaprog/src/main/resources/vm/$TemplateVm-description.adoc
@@ -1,6 +1,6 @@
 :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 [...]
 
-JAXB supports `java.util.UUID` out-of-the-box, so no special annotations are required.
+JAXB supports `#{showcase-type}` out-of-the-box, so no special annotations are required.
 
 [source,java]
 ----
diff --git a/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java b/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
index c3651af704..f62c28363e 100644
--- a/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
+++ b/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
@@ -40,8 +40,8 @@ class ValueTypeGenTemplateTest {
                   || file.getName().endsWith(".adoc")
               );
 
-        val outputRootDir = new File("D:/tmp");
-                //_Files.tempDir("isis-tooling-showcases");
+        val outputRootDir = _Files.tempDir("isis-tooling-showcases");
+                //new File("D:/tmp/uuid");
         log.info("tmp dir created in {}", outputRootDir);
 
         val generator = new ValueTypeGenTemplate(Config.builder()