You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2020/06/27 11:23:51 UTC
[isis] branch ISIS-2222 updated (cf0d54e -> c22e3e1)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch ISIS-2222
in repository https://gitbox.apache.org/repos/asf/isis.git.
from cf0d54e ISIS-2222: renames PrimitivesDemo to WrapperDemo
add 5a60445 ISIS-2340: fx: adds application icon
add 9839b30 ISIS-2340: fx: basic dialog support
add cc282ad ISIS-2340: fx: refactor decoration logic into its own service(s)
add aeeb9aa ISIS-2340: fx: properly load ui table data
add eb5ad6e ISIS-2340: fx: add missing actions
add 4b94aae ISIS-2340: fx: adds a first ComponentFactory (Markup)
add 1de3f73 ISIS-2340: minor enhancements to the Fluent Interaction API
add bd7c4ca ISIS-2340: vaa: add missing action buttons
add c1a3b8b ISIS-2340: vaa: implement an UiActionHandler as already with fx
add 3c0c6c5 ISIS-2340: Interaction API: honor routing services
new c22e3e1 ISIS-2222: working towards more sophisticated asciidoc description handling.
The 1 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:
.../interactions/managed/ActionInteraction.java | 18 +++
.../managed/CollectionInteraction.java | 20 ++++
.../interactions/managed/ManagedAction.java | 60 +++++++++-
.../interactions/managed/ManagedCollection.java | 2 +-
.../interactions/managed/MemberInteraction.java | 22 ++--
.../interactions/managed/PropertyInteraction.java | 18 +++
examples/demo/domain/pom.xml | 11 +-
.../dom/_infra/AsciiDocConverterService.java | 81 +++++++++++++
.../demoapp/dom/_infra/AsciiDocReaderService.java | 39 ++-----
.../demoapp/dom/_infra/DefaultTitleProvider.java | 2 +-
.../dom/_infra/LibraryPreloadingService.java | 2 +-
.../dom/_infra/MarkupVariableResolverService.java | 2 +-
.../demoapp/dom/_infra/ResourceReaderService.java | 72 ++++++++++++
.../main/java/demoapp/dom/_infra/TagHandler.java | 31 +++++
.../dom/homepage/DemoHomePage-description.adoc | 15 +--
.../java/demoapp/dom/homepage/DemoHomePage.java | 8 +-
.../src/main/java/demoapp/dom/menubars.layout.xml | 3 +
.../main/java/demoapp/dom/types/DataTypesMenu.java | 7 ++
.../jdo/PrimitiveBooleanJdoEntity-description.adoc | 2 +-
.../booleans/jdo/PrimitiveBooleanJdoEntity.java | 2 +-
.../vm/PrimitiveBooleanViewModel-description.adoc | 2 +-
.../booleans/vm/PrimitiveBooleanViewModel.java | 2 +-
.../jdo/PrimitiveByteJdoEntity-description.adoc | 2 +-
.../bytes/jdo/PrimitiveByteJdoEntity.java | 2 +-
.../vm/PrimitiveByteViewModel-description.adoc | 2 +-
.../primitive/bytes/vm/PrimitiveByteViewModel.java | 2 +-
.../jdo/PrimitiveCharJdoEntity-description.adoc | 2 +-
.../chars/jdo/PrimitiveCharJdoEntity.java | 2 +-
.../vm/PrimitiveCharViewModel-description.adoc | 2 +-
.../primitive/chars/vm/PrimitiveCharViewModel.java | 2 +-
.../jdo/PrimitiveDoubleJdoEntity-description.adoc | 2 +-
.../doubles/jdo/PrimitiveDoubleJdoEntity.java | 2 +-
.../vm/PrimitiveDoubleViewModel-description.adoc | 2 +-
.../doubles/vm/PrimitiveDoubleViewModel.java | 2 +-
.../jdo/PrimitiveFloatJdoEntity-description.adoc | 2 +-
.../floats/jdo/PrimitiveFloatJdoEntity.java | 2 +-
.../vm/PrimitiveFloatViewModel-description.adoc | 2 +-
.../floats/vm/PrimitiveFloatViewModel.java | 2 +-
.../jdo/PrimitiveIntJdoEntity-description.adoc | 2 +-
.../primitive/ints/jdo/PrimitiveIntJdoEntity.java | 2 +-
.../ints/vm/PrimitiveIntViewModel-description.adoc | 2 +-
.../primitive/ints/vm/PrimitiveIntViewModel.java | 2 +-
.../jdo/PrimitiveLongJdoEntity-description.adoc | 2 +-
.../longs/jdo/PrimitiveLongJdoEntity.java | 2 +-
.../vm/PrimitiveLongViewModel-description.adoc | 2 +-
.../primitive/longs/vm/PrimitiveLongViewModel.java | 2 +-
.../jdo/PrimitiveShortJdoEntity-description.adoc | 2 +-
.../shorts/jdo/PrimitiveShortJdoEntity.java | 2 +-
.../vm/PrimitiveShortViewModel-description.adoc | 2 +-
.../shorts/vm/PrimitiveShortViewModel.java | 2 +-
.../characters/WrapperCharacters-description.adoc | 129 +++++++++++++++++++++
.../wrapper/characters/WrapperCharacters.java | 76 ++++++++++++
.../characters/WrapperCharacters.layout.xml} | 0
.../characters/holder/WrapperCharacterHolder.java | 91 +++++++++++++++
.../WrapperCharacterHolder_actionReturning.java | 22 +++-
...CharacterHolder_actionReturningCollection.java} | 36 +++---
...racterHolder_mixinPropertyNamedNotEscaped.java} | 30 ++---
...CharacterHolder_mixinPropertyWithCssClass.java} | 33 +++---
...pdateReadOnlyProperty2PromptInlineAsIfEdit.java | 49 ++++++++
...Holder_updateReadOnlyPropertyPositionPanel.java | 48 ++++++++
...er_updateReadOnlyPropertyPromptStyleInline.java | 49 ++++++++
...der_updateReadOnlyPropertyPromptStyleModal.java | 49 ++++++++
...teReadOnlyPropertyPromptStylePanelDropDown.java | 48 ++++++++
...r_updateReadOnlyPropertyPromptStyleSidebar.java | 49 ++++++++
...erHolder_updateReadOnlyPropertyWithChoices.java | 58 +++++++++
.../jdo/WrapperCharacterJdoEntities.java | 26 +++++
.../jdo/WrapperCharacterJdoEntity-description.adoc | 38 ++++++
.../characters/jdo/WrapperCharacterJdoEntity.java} | 29 +++--
.../jdo/WrapperCharacterJdoEntity.layout.xml | 55 +++++++++
.../jdo/WrapperCharacterJdoEntitySeedService.java | 42 +++++++
...WrapperCharacterViewModel-description.ORIG.adoc | 44 +++++++
.../vm/WrapperCharacterViewModel-description.adoc | 12 ++
.../characters/vm/WrapperCharacterViewModel.java} | 38 +++---
.../vm/WrapperCharacterViewModel.layout.xml | 55 +++++++++
.../dom/_infra/ResourceReaderService_Test.java | 56 +++++++++
.../ResourceReaderService_Test-Test1-expected.java | 5 +
.../_infra/ResourceReaderService_Test-Test1.java | 12 ++
.../main/java/demoapp/javafx/DemoAppJavaFx.java | 4 +
.../src/main/java/demoapp/javafx/icon.png} | Bin
.../model/action/ActionUiModelFactoryFx.java | 5 +-
.../javafx/model/action/ActionUiModelFx.java | 27 ++++-
.../UiContext.java} | 20 ++--
.../DecoratorService.java} | 23 ++--
.../javafx/model/events/JavaFxViewerConfig.java | 4 +
.../IconService.java} | 14 ++-
.../incubator/viewer/javafx/model/util/_fx.java | 41 +++++++
.../javafx/ui/IsisModuleIncViewerJavaFxUi.java | 9 ++
.../ui/components/collections/TableViewFx.java | 39 ++++---
.../javafx/ui/components/debug/DebugField.java | 1 -
.../javafx/ui/components/dialog/Dialogs.java | 129 +++++++++++++++++++++
.../ui/components/markup/MarkupFieldFactory.java | 59 ++++++++++
.../javafx/ui/components/object/ObjectViewFx.java | 67 +++++++----
.../ui/components/other/FallbackFieldFactory.java | 3 +-
.../javafx/ui/components/panel/TitledPanel.java | 57 +++++++++
.../viewer/javafx/ui/main/MenuBuilderFx.java | 6 +-
.../viewer/javafx/ui/main/UiActionHandler.java | 38 +++++-
.../incubator/viewer/javafx/ui/main/UiBuilder.java | 31 +++--
.../viewer/javafx/ui/main/UiController.java | 8 +-
.../ui/services/DecoratorServiceDefault.java | 81 +++++++++++++
.../javafx/ui/services/IconServiceDefault.java | 66 +++++++++++
.../viewer/javafx/ui/services/UiContexDefault.java | 34 +++---
.../incubator/viewer/vaadin/model/util/_vaa.java | 57 +++++++++
.../vaadin/ui/IsisModuleIncViewerVaadinUi.java | 2 +
.../vaadin/ui/components/action/ActionButton.java | 64 ----------
.../vaadin/ui/components/object/ObjectViewVaa.java | 80 ++++++++-----
.../viewer/vaadin/ui/pages/main/MainViewVaa.java | 31 ++---
.../vaadin/ui/pages/main/UiActionHandler.java | 83 +++++++++++++
.../common/model/binding/UiComponentFactory.java | 6 +
.../common/model/gridlayout/UiGridLayout.java | 4 +-
.../resources/ObjectAdapterAccessHelper.java | 6 +-
110 files changed, 2348 insertions(+), 407 deletions(-)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocConverterService.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/_infra/ResourceReaderService.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/_infra/TagHandler.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters.java
copy examples/demo/domain/src/main/java/demoapp/dom/types/{primitive/shorts/PrimitiveShorts.layout.xml => wrapper/characters/WrapperCharacters.layout.xml} (100%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java
copy incubator/viewers/javafx/model/src/main/java/org/apache/isis/incubator/viewer/javafx/model/action/ActionUiModelFactoryFx.java => examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java (63%)
copy examples/demo/domain/src/main/java/demoapp/dom/{_infra/DefaultTitleProvider.java => types/wrapper/characters/holder/WrapperCharacterHolder_actionReturningCollection.java} (51%)
copy examples/demo/domain/src/main/java/demoapp/dom/{_infra/DefaultTitleProvider.java => types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyNamedNotEscaped.java} (55%)
copy examples/demo/domain/src/main/java/demoapp/dom/{_infra/DefaultTitleProvider.java => types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java} (54%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyProperty2PromptInlineAsIfEdit.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPositionPanel.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleModal.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStylePanelDropDown.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleSidebar.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyWithChoices.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntities.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc
copy examples/demo/domain/src/main/java/demoapp/dom/types/{primitive/chars/jdo/PrimitiveCharJdoEntity.java => wrapper/characters/jdo/WrapperCharacterJdoEntity.java} (71%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.layout.xml
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntitySeedService.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.ORIG.adoc
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc
copy examples/demo/domain/src/main/java/demoapp/dom/types/{primitive/bytes/vm/PrimitiveByteViewModel.java => wrapper/characters/vm/WrapperCharacterViewModel.java} (62%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.layout.xml
create mode 100644 examples/demo/domain/src/test/java/demoapp/dom/_infra/ResourceReaderService_Test.java
create mode 100644 examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1-expected.java
create mode 100644 examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1.java
copy examples/demo/{domain/src/main/resources/static/images/favicon.png => javafx/src/main/java/demoapp/javafx/icon.png} (100%)
copy incubator/viewers/javafx/model/src/main/java/org/apache/isis/incubator/viewer/javafx/model/{events/JavaFxViewerConfig.java => context/UiContext.java} (63%)
copy incubator/viewers/javafx/model/src/main/java/org/apache/isis/incubator/viewer/javafx/model/{events/JavaFxViewerConfig.java => decorator/DecoratorService.java} (62%)
copy incubator/viewers/javafx/model/src/main/java/org/apache/isis/incubator/viewer/javafx/model/{action/ActionUiModelFactoryFx.java => icon/IconService.java} (73%)
create mode 100644 incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/dialog/Dialogs.java
create mode 100644 incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/markup/MarkupFieldFactory.java
create mode 100644 incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/panel/TitledPanel.java
create mode 100644 incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/services/DecoratorServiceDefault.java
create mode 100644 incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/services/IconServiceDefault.java
copy examples/demo/domain/src/main/java/demoapp/dom/_infra/LibraryPreloadingService.java => incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/services/UiContexDefault.java (50%)
create mode 100644 incubator/viewers/vaadin/model/src/main/java/org/apache/isis/incubator/viewer/vaadin/model/util/_vaa.java
delete mode 100644 incubator/viewers/vaadin/ui/src/main/java/org/apache/isis/incubator/viewer/vaadin/ui/components/action/ActionButton.java
create mode 100644 incubator/viewers/vaadin/ui/src/main/java/org/apache/isis/incubator/viewer/vaadin/ui/pages/main/UiActionHandler.java
[isis] 01/01: ISIS-2222: working towards more sophisticated
asciidoc description handling.
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch ISIS-2222
in repository https://gitbox.apache.org/repos/asf/isis.git
commit c22e3e1b2d9d2b4aca601e05ef9cb1f1c53e71a8
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Jun 27 12:22:14 2020 +0100
ISIS-2222: working towards more sophisticated asciidoc description handling.
---
examples/demo/domain/pom.xml | 11 +-
.../dom/_infra/AsciiDocConverterService.java | 81 +++++++++++++
.../demoapp/dom/_infra/AsciiDocReaderService.java | 39 ++-----
.../demoapp/dom/_infra/DefaultTitleProvider.java | 2 +-
.../dom/_infra/LibraryPreloadingService.java | 2 +-
.../dom/_infra/MarkupVariableResolverService.java | 2 +-
.../demoapp/dom/_infra/ResourceReaderService.java | 72 ++++++++++++
.../main/java/demoapp/dom/_infra/TagHandler.java | 31 +++++
.../dom/homepage/DemoHomePage-description.adoc | 15 +--
.../java/demoapp/dom/homepage/DemoHomePage.java | 8 +-
.../src/main/java/demoapp/dom/menubars.layout.xml | 3 +
.../main/java/demoapp/dom/types/DataTypesMenu.java | 7 ++
.../jdo/PrimitiveBooleanJdoEntity-description.adoc | 2 +-
.../booleans/jdo/PrimitiveBooleanJdoEntity.java | 2 +-
.../vm/PrimitiveBooleanViewModel-description.adoc | 2 +-
.../booleans/vm/PrimitiveBooleanViewModel.java | 2 +-
.../jdo/PrimitiveByteJdoEntity-description.adoc | 2 +-
.../bytes/jdo/PrimitiveByteJdoEntity.java | 2 +-
.../vm/PrimitiveByteViewModel-description.adoc | 2 +-
.../primitive/bytes/vm/PrimitiveByteViewModel.java | 2 +-
.../jdo/PrimitiveCharJdoEntity-description.adoc | 2 +-
.../chars/jdo/PrimitiveCharJdoEntity.java | 2 +-
.../vm/PrimitiveCharViewModel-description.adoc | 2 +-
.../primitive/chars/vm/PrimitiveCharViewModel.java | 2 +-
.../jdo/PrimitiveDoubleJdoEntity-description.adoc | 2 +-
.../doubles/jdo/PrimitiveDoubleJdoEntity.java | 2 +-
.../vm/PrimitiveDoubleViewModel-description.adoc | 2 +-
.../doubles/vm/PrimitiveDoubleViewModel.java | 2 +-
.../jdo/PrimitiveFloatJdoEntity-description.adoc | 2 +-
.../floats/jdo/PrimitiveFloatJdoEntity.java | 2 +-
.../vm/PrimitiveFloatViewModel-description.adoc | 2 +-
.../floats/vm/PrimitiveFloatViewModel.java | 2 +-
.../jdo/PrimitiveIntJdoEntity-description.adoc | 2 +-
.../primitive/ints/jdo/PrimitiveIntJdoEntity.java | 2 +-
.../ints/vm/PrimitiveIntViewModel-description.adoc | 2 +-
.../primitive/ints/vm/PrimitiveIntViewModel.java | 2 +-
.../jdo/PrimitiveLongJdoEntity-description.adoc | 2 +-
.../longs/jdo/PrimitiveLongJdoEntity.java | 2 +-
.../vm/PrimitiveLongViewModel-description.adoc | 2 +-
.../primitive/longs/vm/PrimitiveLongViewModel.java | 2 +-
.../jdo/PrimitiveShortJdoEntity-description.adoc | 2 +-
.../shorts/jdo/PrimitiveShortJdoEntity.java | 2 +-
.../vm/PrimitiveShortViewModel-description.adoc | 2 +-
.../shorts/vm/PrimitiveShortViewModel.java | 2 +-
.../characters/WrapperCharacters-description.adoc | 129 +++++++++++++++++++++
.../wrapper/characters/WrapperCharacters.java | 76 ++++++++++++
.../characters/WrapperCharacters.layout.xml | 46 ++++++++
.../characters/holder/WrapperCharacterHolder.java | 91 +++++++++++++++
.../WrapperCharacterHolder_actionReturning.java} | 30 ++---
...CharacterHolder_actionReturningCollection.java} | 36 +++---
...racterHolder_mixinPropertyNamedNotEscaped.java} | 30 ++---
...CharacterHolder_mixinPropertyWithCssClass.java} | 33 +++---
...pdateReadOnlyProperty2PromptInlineAsIfEdit.java | 49 ++++++++
...Holder_updateReadOnlyPropertyPositionPanel.java | 48 ++++++++
...er_updateReadOnlyPropertyPromptStyleInline.java | 49 ++++++++
...der_updateReadOnlyPropertyPromptStyleModal.java | 49 ++++++++
...teReadOnlyPropertyPromptStylePanelDropDown.java | 48 ++++++++
...r_updateReadOnlyPropertyPromptStyleSidebar.java | 49 ++++++++
...erHolder_updateReadOnlyPropertyWithChoices.java | 58 +++++++++
.../jdo/WrapperCharacterJdoEntities.java | 26 +++++
.../jdo/WrapperCharacterJdoEntity-description.adoc | 38 ++++++
.../characters/jdo/WrapperCharacterJdoEntity.java} | 29 +++--
.../jdo/WrapperCharacterJdoEntity.layout.xml | 55 +++++++++
.../jdo/WrapperCharacterJdoEntitySeedService.java | 42 +++++++
...WrapperCharacterViewModel-description.ORIG.adoc | 44 +++++++
.../vm/WrapperCharacterViewModel-description.adoc | 12 ++
.../characters/vm/WrapperCharacterViewModel.java} | 38 +++---
.../vm/WrapperCharacterViewModel.layout.xml | 55 +++++++++
.../dom/_infra/ResourceReaderService_Test.java | 56 +++++++++
.../ResourceReaderService_Test-Test1-expected.java | 5 +
.../_infra/ResourceReaderService_Test-Test1.java | 12 ++
71 files changed, 1389 insertions(+), 181 deletions(-)
diff --git a/examples/demo/domain/pom.xml b/examples/demo/domain/pom.xml
index 611ea78..2b43bd3 100644
--- a/examples/demo/domain/pom.xml
+++ b/examples/demo/domain/pom.xml
@@ -40,11 +40,9 @@
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
+ <!-- we include all .java too, so that we can reference it from the descriptions -->
<include>**</include>
</includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
</resource>
</resources>
@@ -129,6 +127,13 @@
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>3.16.1</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</project>
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocConverterService.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocConverterService.java
new file mode 100644
index 0000000..58cd37d
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocConverterService.java
@@ -0,0 +1,81 @@
+package demoapp.dom._infra;
+
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.asciidoctor.Asciidoctor;
+import org.asciidoctor.AttributesBuilder;
+import org.asciidoctor.Options;
+import org.asciidoctor.OptionsBuilder;
+import org.asciidoctor.SafeMode;
+import org.asciidoctor.ast.Document;
+import org.asciidoctor.extension.IncludeProcessor;
+import org.asciidoctor.extension.PreprocessorReader;
+import org.springframework.stereotype.Service;
+
+import lombok.val;
+
+
+@Service
+@Named("demo.AsciiDocConverterService")
+public class AsciiDocConverterService {
+
+ private static ThreadLocal<Class<?>> context = new ThreadLocal<>();
+
+
+ private Asciidoctor asciidoctor;
+ private Options options;
+
+ private Asciidoctor getAsciidoctor() {
+ if(asciidoctor == null) {
+ asciidoctor = Asciidoctor.Factory.create();
+ asciidoctor.javaExtensionRegistry().includeProcessor(new LocalIncludeProcessor());
+ }
+ return asciidoctor;
+ }
+
+ class LocalIncludeProcessor extends IncludeProcessor {
+
+ @Override
+ public boolean handles(String target) {
+ return true;
+ }
+
+ @Override
+ public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) {
+ Class<?> contextClass = context.get();
+ val content = resourceReaderService.readResource(contextClass, target, attributes);
+ reader.push_include(content, target, target, 1, attributes);
+ }
+ }
+
+ private Options getOptions() {
+ if (options == null) {
+ options = OptionsBuilder.options()
+ .safe(SafeMode.UNSAFE)
+ .toFile(false)
+ .attributes(AttributesBuilder.attributes()
+ .sourceHighlighter("prism")
+ .get())
+ .get();
+ }
+ return options;
+ }
+
+
+ String adocToHtml(Class<?> contextClass, String adoc) {
+ try {
+ context.set(contextClass);
+ return getAsciidoctor().convert(adoc, getOptions());
+ } finally {
+ context.remove();
+ }
+ }
+
+
+ @Inject
+ ResourceReaderService resourceReaderService;
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocReaderService.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocReaderService.java
index 6773756..e7f190d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocReaderService.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/AsciiDocReaderService.java
@@ -17,7 +17,7 @@ import lombok.val;
@Service
-@Named("demoapp.AsciiDocReaderService")
+@Named("demo.AsciiDocReaderService")
public class AsciiDocReaderService {
public AsciiDoc readFor(Object anObject) {
@@ -30,44 +30,21 @@ public class AsciiDocReaderService {
public AsciiDoc readFor(Class<?> aClass) {
val adocResourceName = String.format("%s.adoc", aClass.getSimpleName());
- val asciiDoc = readAsciiDoc(aClass, adocResourceName);
- return AsciiDoc.valueOfAdoc(asciiDoc);
+ val asciiDoc = resourceReaderService.readResource(aClass, adocResourceName);
+ return AsciiDoc.valueOfHtml(asciiDocConverterService.adocToHtml(aClass, asciiDoc));
}
public AsciiDoc readFor(Class<?> aClass, final String member) {
val adocResourceName = String.format("%s-%s.adoc", aClass.getSimpleName(), member);
- val asciiDoc = readAsciiDoc(aClass, adocResourceName);
- return AsciiDoc.valueOfAdoc(asciiDoc);
+ val asciiDoc = resourceReaderService.readResource(aClass, adocResourceName);
+ return AsciiDoc.valueOfHtml(asciiDocConverterService.adocToHtml(aClass, asciiDoc));
}
- private String readAsciiDoc(Class<?> aClass, String adocResourceName) {
- val adocResource = aClass.getResourceAsStream(adocResourceName);
- if(adocResource==null) {
- return String.format("AsciiDoc resource '%s' not found.", adocResourceName);
- }
- try {
- return read(adocResource);
- } catch (IOException e) {
- return String.format("Failed to read from adoc resource '%s': '%s': ", adocResourceName, e.getMessage());
- }
- }
- /**
- * Read the given {@code input} into a String, while also pre-processing placeholders.
- *
- * @param input
- * @return
- * @throws IOException
- */
- private String read(InputStream input) throws IOException {
- try (BufferedReader buffer = new BufferedReader(new InputStreamReader(input))) {
- return buffer.lines()
- .map(markupVariableResolverService::resolveVariables)
- .collect(Collectors.joining("\n"));
- }
- }
+ @Inject
+ AsciiDocConverterService asciiDocConverterService;
@Inject
- MarkupVariableResolverService markupVariableResolverService;
+ ResourceReaderService resourceReaderService;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
index 59a3e33..d024308 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
@@ -30,7 +30,7 @@ import lombok.val;
@Service
-@Named("demoapp.DefaultTitleProvider")
+@Named("demo.DefaultTitleProvider")
public class DefaultTitleProvider {
@EventListener(TitleUiEvent.class)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/LibraryPreloadingService.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/LibraryPreloadingService.java
index b801dd2..3156eca 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/LibraryPreloadingService.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/LibraryPreloadingService.java
@@ -30,7 +30,7 @@ import org.apache.isis.valuetypes.asciidoc.applib.value.AsciiDoc;
import lombok.val;
@Service
-@Named("demoapp.LibraryPreloadingService")
+@Named("demo.LibraryPreloadingService")
public class LibraryPreloadingService {
@PostConstruct
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/MarkupVariableResolverService.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/MarkupVariableResolverService.java
index 3303aec..6f40e80 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/MarkupVariableResolverService.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/MarkupVariableResolverService.java
@@ -13,7 +13,7 @@ import org.apache.isis.core.commons.internal.collections._Maps;
import lombok.val;
@Service
-@Named("demoapp.MarkupVariableResolverService")
+@Named("demo.MarkupVariableResolverService")
public class MarkupVariableResolverService {
private final Map<String, String> constants = _Maps.unmodifiable(
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/ResourceReaderService.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/ResourceReaderService.java
new file mode 100644
index 0000000..2646c3c
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/ResourceReaderService.java
@@ -0,0 +1,72 @@
+package demoapp.dom._infra;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.springframework.stereotype.Service;
+
+import lombok.val;
+
+
+@Service
+@Named("demo.ResourceReaderService")
+public class ResourceReaderService {
+
+ public String readResource(Class<?> aClass, String resourceName) {
+ return readResource(aClass, resourceName, Collections.emptyMap());
+ }
+ public String readResource(Class<?> aClass, String resourceName, Map<String, Object> attributes) {
+ val resourceStream = aClass.getResourceAsStream(resourceName);
+ if(resourceStream==null) {
+ return String.format("Resource '%s' not found.", resourceName);
+ }
+ try {
+ return read(resourceStream, attributes);
+ } catch (IOException e) {
+ return String.format("Failed to read from resource '%s': '%s': ", resourceName, e.getMessage());
+ }
+ }
+
+ /**
+ * Read the given {@code input} into a String, while also pre-processing placeholders.
+ *
+ * @param input
+ * @return
+ * @throws IOException
+ */
+ private String read(InputStream input) throws IOException {
+ return read(input, Collections.emptyMap());
+ }
+
+ /**
+ * Read the given {@code input} into a String, while also pre-processing placeholders.
+ *
+ * @param input
+ * @return
+ * @throws IOException
+ */
+ private String read(InputStream input, Map<String, Object> attributes) throws IOException {
+ val in = new InputStreamReader(input);
+ val tagHandler = new TagHandler(attributes);
+ try (val bufferReader = new BufferedReader(in)) {
+ return bufferReader.lines()
+ .map(tagHandler::handle)
+ .filter(Objects::nonNull)
+ .map(markupVariableResolverService::resolveVariables)
+ .collect(Collectors.joining("\n"));
+ }
+ }
+
+ @Inject
+ MarkupVariableResolverService markupVariableResolverService;
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/TagHandler.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/TagHandler.java
new file mode 100644
index 0000000..c549ce3
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/TagHandler.java
@@ -0,0 +1,31 @@
+package demoapp.dom._infra;
+
+import java.util.Map;
+
+class TagHandler {
+
+ private final Object tagsValue;
+ private boolean within = false;
+
+ TagHandler(final Map<String, Object> attributes) {
+ tagsValue = attributes.get("tags");
+ }
+
+ public String handle(final String line) {
+ if(tagsValue == null) {
+ return line;
+ }
+
+ if (line.startsWith(String.format("//tag::%s[]", tagsValue))) {
+ within = true;
+ return null;
+ }
+
+ if (line.startsWith(String.format("//end::%s[]", tagsValue))) {
+ within = false;
+ return null;
+ }
+
+ return within ? line : null;
+ }
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc
index 6a62c18..3242645 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc
@@ -2,20 +2,7 @@ Apache Isis applications can nominate a view model to act as the home page, usin
[source,java]
----
-@DomainObject(
- nature=Nature.VIEW_MODEL,
- objectType = "demo.Homepage"
-)
-@HomePage // <.>
-public class DemoHomePage {
-
- public String title() { // <.>
- return "Hello, " + userService.getUser().getName();
- }
-
- @Inject
- UserService userService; // <.>
-}
+include::DemoHomePage.java[tags="class"]
----
<.> declares this view-model class to be used as the viewer's homepage, there can be only one
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage.java b/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage.java
index dd751b9..0959e9b 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage.java
@@ -44,14 +44,15 @@ import lombok.Setter;
import demoapp.dom._infra.AsciiDocReaderService;
import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+//tag::class[]
@DomainObject(
nature=Nature.VIEW_MODEL
, objectType = "demo.Homepage"
)
-@HomePage
+@HomePage // <.>
public class DemoHomePage implements HasAsciiDocDescription {
- public String title() {
+ public String title() { // <.>
return "Hello, " + userService.getUser().getName();
}
@@ -60,8 +61,9 @@ public class DemoHomePage implements HasAsciiDocDescription {
}
@Inject
- UserService userService;
+ UserService userService; // <.>
@Inject
AsciiDocReaderService asciiDocReaderService;
}
+//end::class[]
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 af24e6a..4dd9b7b 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
@@ -26,6 +26,9 @@
<mb3:serviceAction objectType="demo.DataTypesMenu" id="primitiveBooleans"/>
</mb3:section>
<mb3:section>
+ <mb3:serviceAction objectType="demo.DataTypesMenu" id="wrapperCharacters"/>
+ </mb3:section>
+ <mb3:section>
<mb3:serviceAction objectType="demo.DataTypesMenu" id="text"/>
<mb3:serviceAction objectType="demo.DataTypesMenu" id="wrappers"/>
<mb3:serviceAction objectType="demo.DataTypesMenu" id="temporals">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/DataTypesMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/types/DataTypesMenu.java
index dd828b6..28ec7ad 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/DataTypesMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/DataTypesMenu.java
@@ -61,6 +61,7 @@ import demoapp.dom.types.primitive.shorts.PrimitiveShorts;
import demoapp.dom.types.text.TextDemo;
import demoapp.dom.types.time.TemporalDemo;
import demoapp.dom.types.uuid.UuidDemo;
+import demoapp.dom.types.wrapper.characters.WrapperCharacters;
@DomainService(nature=NatureOfService.VIEW, objectType = "demo.DataTypesMenu")
@DomainObjectLayout(named="DataTypes")
@@ -217,5 +218,11 @@ public class DataTypesMenu {
return new PrimitiveBooleans();
}
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(cssClassFa="fa-hashtag")
+ public WrapperCharacters wrapperCharacters(){
+ return new WrapperCharacters();
+ }
+
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity-description.adoc
index e129c91..73db59e 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity-description.adoc
@@ -20,8 +20,8 @@ public class PrimitiveBooleanJdoEntity
@Getter @Setter
private boolean readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private boolean readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity.java
index d4dcf48..e2ae9e2 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveBooleanJdoEntity
@Getter @Setter
private boolean readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private boolean readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel-description.adoc
index 674f79b..7b9e733 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveBooleanViewModel
@Getter @Setter
private boolean readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private boolean readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel.java
index a67c506..e350207 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/vm/PrimitiveBooleanViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveBooleanViewModel
@Getter @Setter
private boolean readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private boolean readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity-description.adoc
index f3c66f1..b9f566b 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity-description.adoc
@@ -19,8 +19,8 @@ public class PrimitiveByteJdoEntity
@Getter @Setter
private byte readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private byte readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity.java
index 16a0c34..c8961c0 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jdo/PrimitiveByteJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveByteJdoEntity
@Getter @Setter
private byte readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private byte readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel-description.adoc
index f86b45c..c17b66e 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveByteViewModel
@Getter @Setter
private byte readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private byte readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel.java
index 12f8542..fa12729 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/vm/PrimitiveByteViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveByteViewModel
@Getter @Setter
private byte readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private byte readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity-description.adoc
index 2f3bc66..74d313f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity-description.adoc
@@ -19,8 +19,8 @@ public class PrimitiveCharJdoEntity
@Getter @Setter
private char readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private char readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity.java
index bdef0e6..e372ff8 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jdo/PrimitiveCharJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveCharJdoEntity
@Getter @Setter
private char readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private char readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel-description.adoc
index 5f5b030..52dd46f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveCharViewModel
@Getter @Setter
private char readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private char readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel.java
index 9e63d0a..929b5c0 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveCharViewModel
@Getter @Setter
private char readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private char readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity-description.adoc
index 56c829a..6a2c555 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity-description.adoc
@@ -19,8 +19,8 @@ public class PrimitiveDoubleJdoEntity
@Getter @Setter
private double readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private double readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity.java
index 6698f78..84bb5d3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jdo/PrimitiveDoubleJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveDoubleJdoEntity
@Getter @Setter
private double readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private double readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel-description.adoc
index 7c41db4..9fb6abe 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveDoubleViewModel
@Getter @Setter
private double readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private double readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel.java
index 1c118a9..c9e42e4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/vm/PrimitiveDoubleViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveDoubleViewModel
@Getter @Setter
private double readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private double readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity-description.adoc
index bcee705..1db8957 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity-description.adoc
@@ -19,8 +19,8 @@ public class PrimitiveFloatJdoEntity
@Getter @Setter
private float readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private float readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity.java
index cf6cd08..51e96c4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jdo/PrimitiveFloatJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveFloatJdoEntity
@Getter @Setter
private float readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private float readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel-description.adoc
index 16c2ad3..70f4206 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveFloatViewModel
@Getter @Setter
private float readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private float readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel.java
index 03af7c6..34134a7 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/vm/PrimitiveFloatViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveFloatViewModel
@Getter @Setter
private float readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private float readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity-description.adoc
index 39fcfc8..2120453 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity-description.adoc
@@ -19,8 +19,8 @@ public class PrimitiveIntJdoEntity
@Getter @Setter
private int readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private int readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity.java
index 44458e1..2585d73 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jdo/PrimitiveIntJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveIntJdoEntity
@Getter @Setter
private int readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private int readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel-description.adoc
index 720ce53..118db83 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveIntViewModel
@Getter @Setter
private int readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private int readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel.java
index 3e53ef8..35239fe 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/vm/PrimitiveIntViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveIntViewModel
@Getter @Setter
private int readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private int readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity-description.adoc
index 439860d..2f833ad 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity-description.adoc
@@ -19,8 +19,8 @@ public class PrimitiveLongJdoEntity
@Getter @Setter
private long readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private long readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity.java
index c5c3e92..a938692 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jdo/PrimitiveLongJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveLongJdoEntity
@Getter @Setter
private long readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private long readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel-description.adoc
index 8cb40b8..2d4fc3a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveLongViewModel
@Getter @Setter
private long readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private long readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel.java
index 69c773b..8a4e399 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/vm/PrimitiveLongViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveLongViewModel
@Getter @Setter
private long readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private long readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity-description.adoc
index fe4e6f8..97f1fd3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity-description.adoc
@@ -19,8 +19,8 @@ public class PrimitiveShortJdoEntity
@Getter @Setter
private short readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private short readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity.java
index 437fdf1..761a330 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jdo/PrimitiveShortJdoEntity.java
@@ -60,8 +60,8 @@ public class PrimitiveShortJdoEntity
@Getter @Setter
private short readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private short readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel-description.adoc
index 8a3ca71..f125a6d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel-description.adoc
@@ -25,8 +25,8 @@ public class PrimitiveShortViewModel
@Getter @Setter
private short readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private short readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel.java
index 2c34f44..438e952 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/vm/PrimitiveShortViewModel.java
@@ -64,8 +64,8 @@ public class PrimitiveShortViewModel
@Getter @Setter
private short readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
+ @Getter @Setter
private short readWriteProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc
new file mode 100644
index 0000000..8c4749e
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc
@@ -0,0 +1,129 @@
+The framework has built-in support for all of the Wrapper data types, including `Character`.
+
+From here you can:
+
+* navigate to an entity that uses the `Character` datatype
+* open a view model that uses the `Character` datatype
+
+Some properties on these domain objects are mandatory, some optional.
+
+== Common interface
+
+These objects both implement a common interface, `WrapperCharacterHolder`:
+
+[source,java]
+----
+public interface WrapperCharacterHolder {
+
+ Character getReadOnlyProperty();
+ void setReadOnlyProperty(Character c);
+
+ Character getReadOnlyProperty2();
+ void setReadOnlyProperty2(Character c);
+
+ Character getReadWriteProperty();
+ void setReadWriteProperty(Character c);
+
+ @MemberOrder(name = "label-positions", sequence = "1")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.LEFT, describedAs = "labelPosition=LEFT", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionLeft() { return getReadOnlyProperty(); }
+
+ @MemberOrder(name = "label-positions", sequence = "2")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.TOP, describedAs = "labelPosition=TOP", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionTop() { return getReadOnlyProperty(); }
+
+ @MemberOrder(name = "label-positions", sequence = "3")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.RIGHT, describedAs = "labelPosition=RIGHT", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionRight() { return getReadOnlyProperty(); }
+
+ @MemberOrder(name = "label-positions", sequence = "4")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.NONE, describedAs = "labelPosition=NONE", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionNone() { return getReadOnlyProperty(); }
+
+}
+----
+
+The default methods have annotations that automatically inherited.
+Using `@MemberOrder` positions the properties into the appropriate `<field-set>` within the `Xxx.layout.xml` layout file.
+
+
+== Mixin actions
+
+A number of mixin actions contribute through this interface, demonstrate the use of `Character` as a parameter and as a return type.
+For example:
+
+* the `updateReadOnlyProperty` action is:
++
+[source,java]
+----
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyProperty {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+}
+----
++
+There are a number of variants of this action, to demonstrate different prompt layouts.
+
+* the `actionReturning` action is:
++
+[source,java]
+----
+@Action(
+ semantics = SemanticsOf.SAFE,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "3"
+)
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_actionReturning {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public Character act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+}
+----
+
+== Mixin properties
+
+We also use the interface to contribute a number of mixin properties:
+
+* the `mixinPropertyWithCssClass` property:
++
+[source,java]
+----
+@Property()
+@PropertyLayout(cssClass = "red", describedAs = "cssClass = \"red\" ")
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_mixinPropertyWithCssClass {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ @MemberOrder(name = "contributed", sequence = "1")
+ public Character prop() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+}
+----
++
+TIP: the styling is provided from the `application.css` static resource.
+
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters.java
new file mode 100644
index 0000000..4e49ddb
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters.java
@@ -0,0 +1,76 @@
+/*
+ * 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.wrapper.characters;
+
+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.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.wrapper.characters.jdo.WrapperCharacterJdoEntities;
+import demoapp.dom.types.wrapper.characters.jdo.WrapperCharacterJdoEntity;
+import demoapp.dom.types.wrapper.characters.vm.WrapperCharacterViewModel;
+
+@XmlRootElement(name = "Demo")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(nature=Nature.VIEW_MODEL, objectType = "demo.WrapperCharacters", editing=Editing.ENABLED)
+@Log4j2
+public class WrapperCharacters implements HasAsciiDocDescription {
+
+ public String title() {
+ return "Character (wrapper) data type";
+ }
+
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
+ public WrapperCharacterViewModel openViewModel(char initialValue) {
+ return new WrapperCharacterViewModel(initialValue);
+ }
+ public char default0OpenViewModel() {
+ return 'a';
+ }
+
+ @Collection
+ public List<WrapperCharacterJdoEntity> getEntities() {
+ return entities.all();
+ }
+
+ @Inject
+ @XmlTransient
+ WrapperCharacterJdoEntities entities;
+
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters.layout.xml
new file mode 100644
index 0000000..55c5b87
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters.layout.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+ xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="http://isis.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ <cpt:action id="rebuildMetamodel"/>
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:collection id="entities"/>
+ </bs3:col>
+ <bs3:col span="12">
+ <cpt:action id="openViewModel"/>
+ </bs3:col>
+ </bs3:row>
+ <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:action id="openRestApi" position="PANEL_DROPDOWN" />
+ <cpt:property id="description"/>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12" unreferencedCollections="true"/>
+ </bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java
new file mode 100644
index 0000000..16ce512
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java
@@ -0,0 +1,91 @@
+/*
+ * 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.wrapper.characters.holder;
+
+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.Action;
+import org.apache.isis.applib.annotation.Bounding;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.applib.annotation.MemberOrder;
+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.SemanticsOf;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.log4j.Log4j2;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
+public interface WrapperCharacterHolder {
+
+ @MemberOrder(name = "action-prompt-styles", sequence = "1") // TODO: doesn't seem to get picked up
+ @Property
+ @PropertyLayout
+ Character getReadOnlyProperty();
+ void setReadOnlyProperty(Character c);
+
+ @MemberOrder(name = "action-prompt-styles", sequence = "1") // TODO: doesn't seem to get picked up
+ @Property
+ @PropertyLayout(describedAs = "associated action uses promptStyle=INLINE_AS_IF_EDIT", hidden = Where.ALL_TABLES) // TODO: doesn't seem to get picked up
+ Character getReadOnlyProperty2();
+ void setReadOnlyProperty2(Character c);
+
+ @MemberOrder(name = "editable-properties", sequence = "1") // TODO: doesn't seem to get picked up
+ @Property
+ @PropertyLayout
+ Character getReadWriteProperty();
+ void setReadWriteProperty(Character c);
+
+ @MemberOrder(name = "editable-properties", sequence = "2") // TODO: doesn't seem to get picked up
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout
+ Character getReadWriteOptionalProperty();
+ void setReadWriteOptionalProperty(Character c);
+
+ @MemberOrder(name = "label-positions", sequence = "1")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.LEFT, describedAs = "labelPosition=LEFT", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionLeft() { return getReadOnlyProperty(); }
+
+ @MemberOrder(name = "label-positions", sequence = "2")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.TOP, describedAs = "labelPosition=TOP", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionTop() { return getReadOnlyProperty(); }
+
+ @MemberOrder(name = "label-positions", sequence = "3")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.RIGHT, describedAs = "labelPosition=RIGHT", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionRight() { return getReadOnlyProperty(); }
+
+ @MemberOrder(name = "label-positions", sequence = "4")
+ @Property
+ @PropertyLayout(labelPosition = LabelPosition.NONE, describedAs = "labelPosition=NONE", hidden = Where.ALL_TABLES)
+ default Character getReadOnlyPropertyDerivedLabelPositionNone() { return getReadOnlyProperty(); }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java
similarity index 56%
copy from examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
copy to examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java
index 59a3e33..4a3617e 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java
@@ -16,30 +16,24 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom._infra;
+package demoapp.dom.types.wrapper.characters.holder;
-import javax.inject.Named;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
-import org.springframework.context.event.EventListener;
-import org.springframework.stereotype.Service;
+import lombok.RequiredArgsConstructor;
-import org.apache.isis.applib.events.ui.TitleUiEvent;
-import org.apache.isis.core.commons.internal.base._Strings;
-import lombok.val;
+@Action(
+ semantics = SemanticsOf.SAFE
+)
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_actionReturning {
+ private final WrapperCharacterHolder wrapperCharacterHolder;
-@Service
-@Named("demoapp.DefaultTitleProvider")
-public class DefaultTitleProvider {
-
- @EventListener(TitleUiEvent.class)
- public void on(TitleUiEvent<?> event) {
- val source = event.getSource();
- val simpleName = source.getClass().getSimpleName();
- val title = _Strings.asNaturalName2.apply(simpleName);
-
- event.setTitle(title);
+ public Character act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
}
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturningCollection.java
similarity index 51%
copy from examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
copy to examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturningCollection.java
index 59a3e33..118cd00 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturningCollection.java
@@ -16,30 +16,34 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom._infra;
+package demoapp.dom.types.wrapper.characters.holder;
-import javax.inject.Named;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.stream.Stream;
-import org.springframework.context.event.EventListener;
-import org.springframework.stereotype.Service;
-
-import org.apache.isis.applib.events.ui.TitleUiEvent;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import lombok.RequiredArgsConstructor;
import lombok.val;
-@Service
-@Named("demoapp.DefaultTitleProvider")
-public class DefaultTitleProvider {
+@Action(
+ semantics = SemanticsOf.SAFE
+)
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_actionReturningCollection {
- @EventListener(TitleUiEvent.class)
- public void on(TitleUiEvent<?> event) {
- val source = event.getSource();
- val simpleName = source.getClass().getSimpleName();
- val title = _Strings.asNaturalName2.apply(simpleName);
+ private final WrapperCharacterHolder wrapperCharacterHolder;
- event.setTitle(title);
+ public Collection<Character> act() {
+ final Collection<Character> characters = new ArrayList<>();
+ val initial = wrapperCharacterHolder.getReadOnlyProperty();
+ Stream.of(0, 1, 2, 3).forEach(x ->
+ characters.add((char) (initial + x))
+ );
+ return characters;
}
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyNamedNotEscaped.java
similarity index 55%
copy from examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
copy to examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyNamedNotEscaped.java
index 59a3e33..ad440c6 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyNamedNotEscaped.java
@@ -16,30 +16,24 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom._infra;
+package demoapp.dom.types.wrapper.characters.holder;
-import javax.inject.Named;
+import org.apache.isis.applib.annotation.MemberOrder;
-import org.springframework.context.event.EventListener;
-import org.springframework.stereotype.Service;
+import lombok.RequiredArgsConstructor;
-import org.apache.isis.applib.events.ui.TitleUiEvent;
-import org.apache.isis.core.commons.internal.base._Strings;
-import lombok.val;
+//@Property()
+//@PropertyLayout(named = "<i>Named<i/> <b>not</b> escaped property", namedEscaped = false, describedAs = "named = \"(some markup)\", namedEscaped = false") // TODO: this doesn't render, and causes bootlint issues
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_mixinPropertyNamedNotEscaped {
+ private final WrapperCharacterHolder wrapperCharacterHolder;
-@Service
-@Named("demoapp.DefaultTitleProvider")
-public class DefaultTitleProvider {
-
- @EventListener(TitleUiEvent.class)
- public void on(TitleUiEvent<?> event) {
- val source = event.getSource();
- val simpleName = source.getClass().getSimpleName();
- val title = _Strings.asNaturalName2.apply(simpleName);
-
- event.setTitle(title);
+ @MemberOrder(name = "contributed", sequence = "3")
+ public Character prop() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
}
+
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java
similarity index 54%
copy from examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
copy to examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java
index 59a3e33..a950970 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/DefaultTitleProvider.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java
@@ -16,30 +16,25 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom._infra;
+package demoapp.dom.types.wrapper.characters.holder;
-import javax.inject.Named;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
-import org.springframework.context.event.EventListener;
-import org.springframework.stereotype.Service;
+import lombok.RequiredArgsConstructor;
-import org.apache.isis.applib.events.ui.TitleUiEvent;
-import org.apache.isis.core.commons.internal.base._Strings;
-import lombok.val;
+@Property()
+@PropertyLayout(cssClass = "red", describedAs = "cssClass = \"red\" ", hidden = Where.ALL_TABLES)
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_mixinPropertyWithCssClass {
+ private final WrapperCharacterHolder wrapperCharacterHolder;
-@Service
-@Named("demoapp.DefaultTitleProvider")
-public class DefaultTitleProvider {
-
- @EventListener(TitleUiEvent.class)
- public void on(TitleUiEvent<?> event) {
- val source = event.getSource();
- val simpleName = source.getClass().getSimpleName();
- val title = _Strings.asNaturalName2.apply(simpleName);
-
- event.setTitle(title);
+ @MemberOrder(name = "contributed", sequence = "1")
+ public Character prop() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
}
-
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyProperty2PromptInlineAsIfEdit.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyProperty2PromptInlineAsIfEdit.java
new file mode 100644
index 0000000..bcb4cb5
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyProperty2PromptInlineAsIfEdit.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.wrapper.characters.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;
+
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty2",
+ associateWithSequence = "1"
+)
+@ActionLayout(promptStyle = PromptStyle.INLINE_AS_IF_EDIT)
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyProperty2PromptInlineAsIfEdit {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty2(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty2();
+ }
+
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPositionPanel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPositionPanel.java
new file mode 100644
index 0000000..decfe46
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPositionPanel.java
@@ -0,0 +1,48 @@
+/*
+ * 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.wrapper.characters.holder;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "2"
+)
+@ActionLayout(position = ActionLayout.Position.PANEL, named = "Position in panel", describedAs = "position = PANEL")
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyPropertyPositionPanel {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java
new file mode 100644
index 0000000..36ee0b5
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.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.wrapper.characters.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;
+
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "1"
+)
+@ActionLayout(promptStyle = PromptStyle.INLINE, named = "Inline", describedAs = "promptStyle = INLINE")
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleModal.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleModal.java
new file mode 100644
index 0000000..147b9da
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleModal.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.wrapper.characters.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;
+
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "2"
+)
+@ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL, named = "Modal", describedAs = "promptStyle = MODAL")
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleModal {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStylePanelDropDown.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStylePanelDropDown.java
new file mode 100644
index 0000000..5b50df1
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStylePanelDropDown.java
@@ -0,0 +1,48 @@
+/*
+ * 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.wrapper.characters.holder;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "3"
+)
+@ActionLayout(position = ActionLayout.Position.PANEL_DROPDOWN, named = "Panel Dropdown", describedAs = "position = PANEL_DROPDOWN")
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyPropertyPromptStylePanelDropDown {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleSidebar.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleSidebar.java
new file mode 100644
index 0000000..5b7e405
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleSidebar.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.wrapper.characters.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;
+
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "3"
+)
+@ActionLayout(promptStyle = PromptStyle.DIALOG_SIDEBAR, named = "sidebar", describedAs = "promptStyle = DIALOG_SIDEBAR")
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleSidebar {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyWithChoices.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyWithChoices.java
new file mode 100644
index 0000000..28212ee
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyWithChoices.java
@@ -0,0 +1,58 @@
+/*
+ * 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.wrapper.characters.holder;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+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;
+
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "readOnlyProperty",
+ associateWithSequence = "4"
+)
+@ActionLayout(promptStyle = PromptStyle.AS_CONFIGURED, named = "with choices")
+@RequiredArgsConstructor
+public class WrapperCharacterHolder_updateReadOnlyPropertyWithChoices {
+
+ private final WrapperCharacterHolder wrapperCharacterHolder;
+
+ public WrapperCharacterHolder act(Character newValue) {
+ wrapperCharacterHolder.setReadOnlyProperty(newValue);
+ return wrapperCharacterHolder;
+ }
+ public Character default0Act() {
+ return wrapperCharacterHolder.getReadOnlyProperty();
+ }
+ public List<Character> choices0Act() {
+ return Stream.of('a', 'b', 'c').collect(Collectors.toList());
+ }
+ public boolean hideAct() {
+ return true;
+ } // TODO: choices doesn't seem to work for this datatype
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntities.java
new file mode 100644
index 0000000..0782723
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntities.java
@@ -0,0 +1,26 @@
+package demoapp.dom.types.wrapper.characters.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 WrapperCharacterJdoEntities {
+
+ public Optional<WrapperCharacterJdoEntity> find(final Character readOnlyProperty) {
+ return repositoryService.firstMatch(WrapperCharacterJdoEntity.class, x -> x.getReadOnlyProperty() == readOnlyProperty);
+ }
+
+ public List<WrapperCharacterJdoEntity> all() {
+ return repositoryService.allInstances(WrapperCharacterJdoEntity.class);
+ }
+
+ @Inject
+ RepositoryService repositoryService;
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc
new file mode 100644
index 0000000..3ccc271
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc
@@ -0,0 +1,38 @@
+JDO supports `Character` out-of-the-box, so no special annotations are required.
+
+[source,java]
+----
+@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
+@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
+@DomainObject(
+ objectType = "demo.WrapperCharacterJdoEntity"
+)
+public class WrapperCharacterJdoEntity
+ implements HasAsciiDocDescription, WrapperCharacterHolder { // <.>
+
+ public WrapperCharacterJdoEntity(Character initialValue) { ... } // <.>
+
+ @Title(prepend = "Character (wrapper) JDO entity: ")
+ @Getter @Setter
+ private Character readOnlyProperty; // <.>
+
+ @Getter @Setter
+ private Character readOnlyProperty2;
+
+ @Property(editing = Editing.ENABLED)
+ @Getter @Setter
+ private Character readWriteProperty;
+
+ @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL) // <.>
+ @Column(allowsNull = "true") // <.>
+ @Getter @Setter
+ private Character readWriteOptionalProperty;
+
+}
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> as a convenience
+<.> no additional annotations required.
+<.> optional property as defined to Apache Isis
+<.> optional property as defined to JDO/DataNucleus
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.java
similarity index 71%
copy from examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity.java
copy to examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.java
index d4dcf48..e2f4a61 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jdo/PrimitiveBooleanJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.java
@@ -16,8 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.types.primitive.booleans.jdo;
+package demoapp.dom.types.wrapper.characters.jdo;
+import javax.jdo.annotations.Column;
import javax.jdo.annotations.DatastoreIdentity;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
@@ -25,6 +26,7 @@ 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;
@@ -34,34 +36,39 @@ import lombok.Getter;
import lombok.Setter;
import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.booleans.holder.PrimitiveBooleanHolder;
+import demoapp.dom.types.wrapper.characters.holder.WrapperCharacterHolder;
@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
@DomainObject(
- objectType = "demo.PrimitiveBooleanJdoEntity"
+ objectType = "demo.WrapperCharacterJdoEntity"
)
-public class PrimitiveBooleanJdoEntity
+public class WrapperCharacterJdoEntity
implements HasAsciiDocDescription,
- PrimitiveBooleanHolder {
+ WrapperCharacterHolder {
- public PrimitiveBooleanJdoEntity(boolean initialValue) {
+ public WrapperCharacterJdoEntity(Character initialValue) {
this.readOnlyProperty = initialValue;
this.readOnlyProperty2 = initialValue;
this.readWriteProperty = initialValue;
}
- @Title(prepend = "boolean (primitive) JDO entity: ")
+ @Title(prepend = "Character (wrapper) JDO entity: ")
@Getter @Setter
- private boolean readOnlyProperty;
+ private Character readOnlyProperty;
@Property
@PropertyLayout(hidden = Where.ALL_TABLES)
@Getter @Setter
- private boolean readOnlyProperty2;
+ private Character readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
- private boolean readWriteProperty;
+ @Getter @Setter
+ private Character readWriteProperty;
+
+ @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+ @Column(allowsNull = "true")
+ @Getter @Setter
+ private Character readWriteOptionalProperty;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.layout.xml
new file mode 100644
index 0000000..6986955
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.layout.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+ xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="http://isis.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ <cpt:action id="actionReturning"/>
+ <cpt:action id="actionReturningCollection"/>
+ <cpt:action id="rebuildMetamodel"/>
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Action Prompt Styles" id="action-prompt-styles">
+ <cpt:property id="readOnlyProperty" />
+ <cpt:property id="readOnlyProperty2" >
+ <cpt:describedAs>
+ Associated action uses promptStyle=INLINE_AS_IF_EDIT
+ </cpt:describedAs>
+ </cpt:property>
+ </cpt:fieldSet>
+ <cpt:fieldSet name="Editable Properties" id="editable-properties">
+ <cpt:property id="readWriteProperty" />
+ <cpt:property id="readWriteOptionalProperty" />
+ </cpt:fieldSet>
+ <cpt:fieldSet name="Label Positions" id="label-positions"/>
+ <cpt:fieldSet name="Contributed by Mixins" id="contributed"/>
+ <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:action id="downloadJdoMetadata" position="PANEL_DROPDOWN"/>
+ <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+ <cpt:property id="description"/>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12" unreferencedCollections="true"/>
+ </bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntitySeedService.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntitySeedService.java
new file mode 100644
index 0000000..d77c6cd
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntitySeedService.java
@@ -0,0 +1,42 @@
+package demoapp.dom.types.wrapper.characters.jdo;
+
+import java.util.stream.Stream;
+
+import javax.inject.Inject;
+
+import org.springframework.context.event.EventListener;
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.applib.services.repository.RepositoryService;
+import org.apache.isis.core.runtime.events.app.AppLifecycleEvent;
+import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScript;
+import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScripts;
+
+@Service
+public class WrapperCharacterJdoEntitySeedService {
+
+ @EventListener(AppLifecycleEvent.class)
+ public void onAppLifecycleEvent(AppLifecycleEvent event) {
+
+ if (event.getEventType() == AppLifecycleEvent.EventType.appPostMetamodel) {
+ fixtureScripts.run(new WrapperCharacterJdoEntityFixture());
+ }
+ }
+
+ @Inject
+ FixtureScripts fixtureScripts;
+
+ static class WrapperCharacterJdoEntityFixture extends FixtureScript {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ Stream.of('a', 'b', 'c')
+ .map(WrapperCharacterJdoEntity::new)
+ .forEach(repositoryService::persist);
+ }
+
+ @Inject
+ RepositoryService repositoryService;
+
+ }
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.ORIG.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.ORIG.adoc
new file mode 100644
index 0000000..2bce338
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.ORIG.adoc
@@ -0,0 +1,44 @@
+JAXB supports `Character` out-of-the-box, so no special annotations are required.
+
+[source,java]
+----
+@XmlRootElement(name = "demo.WrapperCharacterViewModel")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+ nature=Nature.VIEW_MODEL,
+ objectType = "demo.WrapperCharacterViewModel"
+)
+@lombok.NoArgsConstructor // <.>
+public class WrapperCharacterViewModel
+ implements HasAsciiDocDescription, WrapperCharacterHolder {
+
+ public WrapperCharacterViewModel(Character initialValue) { // <.>
+ // ...
+ }
+
+ @Title(prepend = "Character (wrapper) view model: ")
+ @Getter @Setter
+ private Character readOnlyProperty; // <.>
+
+ @Getter @Setter
+ private Character readOnlyProperty2;
+
+ @Property(editing = Editing.ENABLED)
+ @Getter @Setter
+ private Character readWriteProperty;
+
+ @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL) // <.>
+ @XmlElement(required = false) // <.>
+ @Getter @Setter
+ private Character readWriteOptionalProperty;
+
+}
+----
+<.> a no-arg constructor is required by JAXB
+<.> as a convenience
+<.> no additional annotations required.
+<.> mandatory property as defined to JAXB.
+Note that JAXB's default is that a property is optional, whereas Apache Isis is the opposite, that it is mandatory.
+<.> optional property as defined to Apache Isis
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc
new file mode 100644
index 0000000..5c9b573
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc
@@ -0,0 +1,12 @@
+JAXB supports `Character` out-of-the-box, so no special annotations are required.
+
+[source,java]
+----
+include::WrapperCharacterViewModel.java[tag="class"]
+----
+<.> a no-arg constructor is required by JAXB
+<.> as a convenience
+<.> no additional annotations required.
+<.> optional property as defined to Apache Isis
+<.> optional property as defined to JAXB
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.java
similarity index 62%
copy from examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel.java
copy to examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.java
index 9e63d0a..3c51ec4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/vm/PrimitiveCharViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.java
@@ -16,16 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.types.primitive.chars.vm;
+package demoapp.dom.types.wrapper.characters.vm;
+import javax.jdo.annotations.Column;
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 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;
@@ -35,37 +38,46 @@ import lombok.Getter;
import lombok.Setter;
import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.chars.holder.PrimitiveCharHolder;
+import demoapp.dom.types.wrapper.characters.holder.WrapperCharacterHolder;
-@XmlRootElement(name = "demo.PrimitiveCharViewModel")
+//tag::class[]
+@XmlRootElement(name = "demo.WrapperCharacterViewModel")
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
@DomainObject(
nature=Nature.VIEW_MODEL,
- objectType = "demo.PrimitiveCharViewModel"
+ objectType = "demo.WrapperCharacterViewModel"
)
-@lombok.NoArgsConstructor
-public class PrimitiveCharViewModel
+@lombok.NoArgsConstructor // <.>
+public class WrapperCharacterViewModel
implements HasAsciiDocDescription,
- PrimitiveCharHolder {
+ WrapperCharacterHolder {
- public PrimitiveCharViewModel(char initialValue) {
+ public WrapperCharacterViewModel(Character initialValue) { // <.>
this.readOnlyProperty = initialValue;
this.readOnlyProperty2 = initialValue;
this.readWriteProperty = initialValue;
}
- @Title(prepend = "char (primitive) view model: ")
+ @Title(prepend = "Character (wrapper) view model: ")
+ @XmlElement(required = true)
@Getter @Setter
- private char readOnlyProperty;
+ private Character readOnlyProperty; // <.>
@Property
@PropertyLayout(hidden = Where.ALL_TABLES)
+ @XmlElement(required = true)
@Getter @Setter
- private char readOnlyProperty2;
+ private Character readOnlyProperty2;
- @Getter @Setter
@Property(editing = Editing.ENABLED)
- private char readWriteProperty;
+ @XmlElement(required = true) // <.>
+ @Getter @Setter
+ private Character readWriteProperty;
+
+ @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL) // <.>
+ @Getter @Setter
+ private Character readWriteOptionalProperty;
}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.layout.xml
new file mode 100644
index 0000000..6986955
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.layout.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+ xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="http://isis.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ <cpt:action id="actionReturning"/>
+ <cpt:action id="actionReturningCollection"/>
+ <cpt:action id="rebuildMetamodel"/>
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Action Prompt Styles" id="action-prompt-styles">
+ <cpt:property id="readOnlyProperty" />
+ <cpt:property id="readOnlyProperty2" >
+ <cpt:describedAs>
+ Associated action uses promptStyle=INLINE_AS_IF_EDIT
+ </cpt:describedAs>
+ </cpt:property>
+ </cpt:fieldSet>
+ <cpt:fieldSet name="Editable Properties" id="editable-properties">
+ <cpt:property id="readWriteProperty" />
+ <cpt:property id="readWriteOptionalProperty" />
+ </cpt:fieldSet>
+ <cpt:fieldSet name="Label Positions" id="label-positions"/>
+ <cpt:fieldSet name="Contributed by Mixins" id="contributed"/>
+ <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:action id="downloadJdoMetadata" position="PANEL_DROPDOWN"/>
+ <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+ <cpt:property id="description"/>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12" unreferencedCollections="true"/>
+ </bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/test/java/demoapp/dom/_infra/ResourceReaderService_Test.java b/examples/demo/domain/src/test/java/demoapp/dom/_infra/ResourceReaderService_Test.java
new file mode 100644
index 0000000..45d608a
--- /dev/null
+++ b/examples/demo/domain/src/test/java/demoapp/dom/_infra/ResourceReaderService_Test.java
@@ -0,0 +1,56 @@
+package demoapp.dom._infra;
+
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import lombok.val;
+import static org.assertj.core.api.Assertions.*;
+
+class ResourceReaderService_Test {
+
+ ResourceReaderService resourceReaderService;
+
+ @BeforeEach
+ void setUp() {
+ resourceReaderService = new ResourceReaderService();
+ resourceReaderService.markupVariableResolverService = new MarkupVariableResolverService();
+
+ }
+
+ @Test
+ void read_with_tags() {
+
+ // given
+ val attributes = new HashMap<String, Object>();
+ attributes.put("tags", "class");
+
+ // when
+ String actual = resourceReaderService.readResource(getClass(), "ResourceReaderService_Test-Test1.java", attributes);
+
+ // then
+ String expected = resourceReaderService.readResource(getClass(), "ResourceReaderService_Test-Test1-expected.java");
+ assertThat(actual).isEqualTo(expected);
+ }
+
+ @Test
+ void read_missing_tags() {
+
+ // given
+ val attributes = new HashMap<String, Object>();
+ attributes.put("tags", "other");
+
+ // when
+ String actual = resourceReaderService.readResource(getClass(), "ResourceReaderService_Test-Test1.java", attributes);
+
+ // then
+ String expected = "";
+ assertThat(actual).isEqualTo(expected);
+ }
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1-expected.java b/examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1-expected.java
new file mode 100644
index 0000000..94d7ce6
--- /dev/null
+++ b/examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1-expected.java
@@ -0,0 +1,5 @@
+
+// this stuff should be included
+public class Test1 {
+}
+
diff --git a/examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1.java b/examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1.java
new file mode 100644
index 0000000..1ddf644
--- /dev/null
+++ b/examples/demo/domain/src/test/resources/demoapp/dom/_infra/ResourceReaderService_Test-Test1.java
@@ -0,0 +1,12 @@
+// this stuff should be ignored
+
+//tag::class[]
+
+// this stuff should be included
+public class Test1 {
+}
+
+//end::class[]
+
+// this stuff should be ignored
+