You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2023/03/02 08:16:09 UTC
[causeway] branch master updated: CAUSEWAY-3309: [Demo] adding alternative layouts to UIEvent demo
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/master by this push:
new b95eea4eb9 CAUSEWAY-3309: [Demo] adding alternative layouts to UIEvent demo
b95eea4eb9 is described below
commit b95eea4eb9dfca906d851cc7a120b54f36197558
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Mar 2 09:16:03 2023 +0100
CAUSEWAY-3309: [Demo] adding alternative layouts to UIEvent demo
---
.../DomainObjectLayoutXxxUiEventService.java | 2 +-
...bjectLayoutXxxUiEventVm-alternative1.layout.xml | 49 ++++++++++++++++++++++
...bjectLayoutXxxUiEventVm-alternative2.layout.xml | 49 ++++++++++++++++++++++
.../xxxUiEvent/DomainObjectLayoutXxxUiEventVm.java | 4 ++
4 files changed, 103 insertions(+), 1 deletion(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventService.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventService.java
index 0f3c7209f8..45af1c5136 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventService.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventService.java
@@ -59,7 +59,7 @@ public class DomainObjectLayoutXxxUiEventService {
@EventListener
void onLayoutUiEvent(final DomainObjectLayoutXxxUiEventVm.LayoutUiEvent layoutUiEvent) {
val in = layoutUiEvent.getLayout();
- val out = "alternative";
+ val out = "alternative2";
layoutUiEvent.setLayout(out);
log.info("layoutUiEvent: {}->{}", in, out);
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm-alternative1.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm-alternative1.layout.xml
new file mode 100644
index 0000000000..3085b3b067
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm-alternative1.layout.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- 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. -->
+<bs3:grid
+ xsi:schemaLocation="https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd https://causeway.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="https://causeway.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Alternative Layout selected via Object-Support-Method" 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="recentCommands" 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/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm-alternative2.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm-alternative2.layout.xml
new file mode 100644
index 0000000000..5ee4a74ebe
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm-alternative2.layout.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- 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. -->
+<bs3:grid
+ xsi:schemaLocation="https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd https://causeway.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="https://causeway.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Alternative Layout selected via UI-Event" 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="recentCommands" 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/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm.java
index 881e55430c..c5eaa3c61a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/xxxUiEvent/DomainObjectLayoutXxxUiEventVm.java
@@ -60,6 +60,10 @@ public class DomainObjectLayoutXxxUiEventVm implements HasAsciiDocDescription {
return "DomainObjectLayout#xxxUiEvent (should be overwritten by ui-title-event-listener)";
}
+ @ObjectSupport public String layout() {
+ return "alternative1"; // should be overwritten by ui-layout-event-listener
+ }
+
//TODO[CAUSEWAY-3309]
@Property(optionality = Optionality.OPTIONAL)
@XmlElement(required = false)