This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch CAUSEWAY-2485 in repository https://gitbox.apache.org/repos/asf/causeway.git
commit d13a6c20076ee8c61e384f4be1e58d6aea2ddf41 Author: danhaywood <[email protected]> AuthorDate: Fri May 12 09:11:47 2023 +0100 CAUSEWAY-2485: adds new bulk action example --- .../src/main/java/demoapp/dom/DemoModuleJpa.java | 3 + .../ActionChoicesFromPage-description.adoc | 38 ++-------- .../assoc/AssociatedActionDemo-description.adoc | 54 ------------- .../progmodel/assoc/AssociatedActionDemo.java | 88 ---------------------- .../actions/progmodel/bulk/BulkActionItem.java | 54 +++++++++++++ .../BulkActionItem.layout.xml} | 50 ++++++++---- .../progmodel/bulk/BulkActionItemRepository.java | 26 +++++++ .../progmodel/bulk/BulkActionItemSeeding.java | 38 ++++++++++ .../BulkActionMenu.java} | 58 +++++++------- .../progmodel/bulk/BulkActionPage-description.adoc | 55 ++++++++++++++ .../actions/progmodel/bulk/BulkActionPage.java | 76 +++++++++++++++++++ .../progmodel/bulk/BulkActionPage.layout.xml | 88 ++++++++++++++++++++++ .../BulkActionPage_addToAmericanFavourites.java | 47 ++++++++++++ .../BulkActionPage_addToBritishFavourites.java | 43 +++++++++++ ...ulkActionPage_removeFromAmericanFavourites.java | 48 ++++++++++++ ...BulkActionPage_removeFromBritishFavourites.java | 44 +++++++++++ .../jpa/BulkActionItemJpa-description.adoc} | 21 +----- .../progmodel/bulk/jpa/BulkActionItemJpa.java | 73 ++++++++++++++++++ .../bulk/jpa/BulkActionItemJpaEntities.java | 55 ++++++++++++++ ...n.adoc => ActionDependentArgs-description.adoc} | 0 ...o.layout.xml => ActionDependentArgs.layout.xml} | 69 +++++++++-------- ...ctionMenu.java => ActionDependentArgsMenu.java} | 16 ++-- ...ctionDemo.java => ActionDependentArgsPage.java} | 6 +- ...on.java => ActionDependentArgs_bulkAction.java} | 6 +- ...va => ActionDependentArgs_useAutoComplete.java} | 6 +- ...a => ActionDependentArgs_useAutoComplete2.java} | 6 +- ...es.java => ActionDependentArgs_useChoices.java} | 6 +- ...2.java => ActionDependentArgs_useChoices2.java} | 6 +- ...lt.java => ActionDependentArgs_useDefault.java} | 6 +- ...le.java => ActionDependentArgs_useDisable.java} | 6 +- ...eHide.java => ActionDependentArgs_useHide.java} | 6 +- ...ava => ActionDependentArgs_useIndependent.java} | 6 +- .../progmodel/assoc => featured}/DemoItem.java | 2 +- .../java/demoapp/dom/featured/FeaturedMenu.java | 1 - .../featured/layout/describedAs/DescribedAsVm.java | 2 +- .../src/main/java/demoapp/dom/menubars.layout.xml | 6 +- 36 files changed, 801 insertions(+), 314 deletions(-) diff --git a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java index 646c5c23f5..90f6cf4e30 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java @@ -30,6 +30,7 @@ import demoapp.dom.domain.actions.Action.choicesFrom.jpa.ActionChoicesFromJpa; import demoapp.dom.domain.actions.Action.commandPublishing.jpa.ActionCommandPublishingJpa; import demoapp.dom.domain.actions.Action.executionPublishing.jpa.ActionExecutionPublishingJpa; import demoapp.dom.domain.actions.ActionLayout.hidden.jpa.ActionLayoutHiddenJpa; +import demoapp.dom.domain.actions.progmodel.bulk.jpa.BulkActionItemJpa; import demoapp.dom.domain.objects.DomainObject.aliased.jpa.DomainObjectAliasedJpa; import demoapp.dom.domain.objects.DomainObject.autoComplete.jpa.DomainObjectAutoCompleteJpa; import demoapp.dom.domain.objects.DomainObject.bounded.jpa.DomainObjectBoundingJpa; @@ -136,6 +137,8 @@ import demoapp.dom.types.primitive.shorts.jpa.PrimitiveShortJpa; ActionCommandPublishingJpa.class, ActionExecutionPublishingJpa.class, + BulkActionItemJpa.class, + ActionLayoutHiddenJpa.class, PropertyCommandPublishingJpa.class, diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/ActionChoicesFromPage-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/ActionChoicesFromPage-description.adoc index 3601fa5162..7a4d67d6bc 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/ActionChoicesFromPage-description.adoc +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/ActionChoicesFromPage-description.adoc @@ -1,40 +1,12 @@ :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...] -Actions parameters can be either value types or reference types (typically entities), and can be either for single-valued (a scalar) or multi-valued (a list). -Scalar values can be entered directly, but other combinations require a supporting method or other mechanism to provide a list of candidates for the end-user to select: +Actions parameters can be either value types or reference types (typically entities), and can be either single-valued (a scalar) or multi-valued (a list). +Scalar values can be entered directly, but references to entities must be selected by some mechanism or another. -.Parameter types and entry methods -[cols="1a,2a,2a", options="header"] -|=== +Most often this selection is enabled using a supporting method for the action parameter in question: `choicesNXxx()`, `autoCompleteNXxx()`. +Or alternatively it can be enabled by annotating the referenced domain type: `@DomainObject#autoComplete` or `@DomainObject#bounded`. ->| Type \ + -Param Cardinality -^| -Value type -^| -Reference type - - -<| Single -| Direct entry -| -* `choicesNXxx()` supporting method -* `autoCompleteNXxx()` supporting method -* `@DomainObject#autoCompleteXxx` -* `@DomainObject#bounded` - - -| Multiple -| -`choicesNXxx` supporting method -| -* `choicesNXxx()` supporting method -* `autoCompleteNXxx()` supporting method -* link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/Action.html#choicesfrom[@Action#choicesFrom] - -|=== - -The `choicesFrom` attribute specifies an action has a multi-value reference type parameter whose choices should be obtained from the specified collection. +In the case of multi-valued parameters, there is a further option, namely to annotate the action using link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/Action.html#choicesfrom[@Action#choicesFrom], where the "choicesFrom" indicates a collection of objects of the appropriate reference type. The end-user can select the choices using checkboxes rendered with the collection. diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo-description.adoc deleted file mode 100644 index 70351e4b55..0000000000 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo-description.adoc +++ /dev/null @@ -1,54 +0,0 @@ -:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...] - - -(since 1.16) - -The framework allows an action to be associated with other properties or -collections of the same domain object. For complete reference see the -https://causeway.apache.org/guides/rgant/rgant.html#_rgant-Action_associateWith[Apache -Causeway Reference Guide] - -We setup a simple `FibonacciNumberVm` class to demonstrate this. - -[source,java] ----- -@DomainObject -public class DemoItem { - - public String title() { - return String.format("DemoItem '%s'", getName()); - } - - @Property - @Getter @Setter private String name; - -} ----- - -Now following demo view model holds `items` a collection of element type -`FibonacciNumberVm`. The action method `doSomethingWithItems(...)` can be thought -of as associated with the `items` collection, because it expresses this -association using the annotation `@Action(associateWith="items")`. - -[source,java] ----- -@DomainObject(nature=Nature.VIEW_MODEL) -public class AssociatedActionDemo extends DemoStub { - - @Inject MessageService messageService; - - @Getter private final Set<DemoItem> items; - - @Action(associateWith="items") - public AssociatedActionDemo doSomethingWithItems(Set<DemoItem> items) { - if(items!=null) { - items.forEach(item->messageService.informUser(item.getName())); - } - return this; - } - -} ----- - -See the associated action demo -link:${SOURCES_DEMO}/demoapp/dom/actions/assoc[sources]. diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.java deleted file mode 100644 index 2af1993470..0000000000 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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.domain.actions.progmodel.assoc; - -import java.util.LinkedHashSet; -import java.util.Set; - -import javax.inject.Inject; -import javax.inject.Named; -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.causeway.applib.annotation.Action; -import org.apache.causeway.applib.annotation.ActionLayout; -import org.apache.causeway.applib.annotation.DomainObject; -import org.apache.causeway.applib.annotation.Editing; -import org.apache.causeway.applib.annotation.Nature; -import org.apache.causeway.applib.annotation.ObjectSupport; -import org.apache.causeway.applib.annotation.PromptStyle; -import org.apache.causeway.applib.services.message.MessageService; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.val; - -import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription; - -@XmlRootElement(name = "Demo") -@XmlType -@XmlAccessorType(XmlAccessType.FIELD) -@Named("demo.AssociatedAction") -@DomainObject(nature=Nature.VIEW_MODEL, editing=Editing.ENABLED) -@NoArgsConstructor -public class AssociatedActionDemo implements HasAsciiDocDescription { - - public static AssociatedActionDemo createWithDemoData() { - val demo = new AssociatedActionDemo(); - demo.getItems().clear(); - demo.getItems().add(DemoItem.of("first")); - demo.getItems().add(DemoItem.of("second")); - demo.getItems().add(DemoItem.of("third")); - demo.getItems().add(DemoItem.of("last")); - return demo; - } - - @XmlTransient - @Inject MessageService messageService; - - @Getter private final Set<DemoItem> items = new LinkedHashSet<>(); - - @ObjectSupport public String title() { - return "Associated Action Demo"; - } - - @Action(choicesFrom = "items") - @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL) - public AssociatedActionDemo doSomethingWithItems( - - // bulk selection - final Set<DemoItem> items) { - - if(items!=null) { - items.forEach(item->messageService.informUser(item.getName())); - } - return this; - } - - -} diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItem.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItem.java new file mode 100644 index 0000000000..8be41e6640 --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItem.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package demoapp.dom.domain.actions.progmodel.bulk; + +import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription; +import demoapp.dom._infra.values.ValueHolder; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.apache.causeway.applib.jaxb.PersistentEntityAdapter; + +//tag::class[] +@XmlJavaTypeAdapter(PersistentEntityAdapter.class) +public abstract class BulkActionItem +//end::class[] + implements + HasAsciiDocDescription, + ValueHolder<String> +//tag::class[] +{ + // ... +//end::class[] + + public String title() { + return value(); + } + + @Override + public String value() { + return getName(); + } + + public abstract String getName(); + public abstract void setName(String value); + +//tag::class[] +} +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItem.layout.xml similarity index 61% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.layout.xml rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItem.layout.xml index 4becb9b7d5..1135efb565 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.layout.xml +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItem.layout.xml @@ -10,10 +10,11 @@ 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"> + 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 /> @@ -25,15 +26,35 @@ <bs3:row> <bs3:col span="6"> - <cpt:collection defaultView="table" id="items"> - <cpt:action id="doSomethingWithItems"/> - </cpt:collection> - <bs3:row> - <bs3:col span="12"> - <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/> - </bs3:col> - </bs3:row> - + <bs3:tabGroup> + <bs3:tab name="General"> + <bs3:row> + <bs3:col span="12"> + <cpt:fieldSet name="General" id="general" > + <cpt:property id="name"/> + </cpt:fieldSet> + </bs3:col> + </bs3:row> + </bs3:tab> + <bs3:tab name="Metadata"> + <bs3:row> + <bs3:col span="12"> + <cpt:fieldSet name="Metadata" id="metadata" > + <cpt:property id="id"/> + <cpt:property id="logicalTypeName"/> + <cpt:property id="version"/> + </cpt:fieldSet> + </bs3:col> + </bs3:row> + </bs3:tab> + <bs3:tab name="Other"> + <bs3:row> + <bs3:col span="12"> + <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/> + </bs3:col> + </bs3:row> + </bs3:tab> + </bs3:tabGroup> </bs3:col> <bs3:col span="6"> <cpt:fieldSet name="Description" id="description" > @@ -50,8 +71,7 @@ <cpt:action id="openRestApi" position="PANEL_DROPDOWN" /> <cpt:property id="description"/> </cpt:fieldSet> - </bs3:col> - </bs3:row> + </bs3:col> </bs3:row> <bs3:row> <bs3:col span="12" unreferencedCollections="true"/> </bs3:row> diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItemRepository.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItemRepository.java new file mode 100644 index 0000000000..b0a00e7c6a --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItemRepository.java @@ -0,0 +1,26 @@ +/* + * 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.domain.actions.progmodel.bulk; + +import java.util.List; + +public interface BulkActionItemRepository { + + List<? extends BulkActionItem> allInstances(); +} diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItemSeeding.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItemSeeding.java new file mode 100644 index 0000000000..db77f31c77 --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionItemSeeding.java @@ -0,0 +1,38 @@ +/* + * 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.domain.actions.progmodel.bulk; + +import javax.inject.Inject; + +import org.springframework.stereotype.Service; + +import demoapp.dom._infra.seed.SeedServiceAbstract; +import demoapp.dom._infra.values.ValueHolderRepository; + +@Service +public class BulkActionItemSeeding +extends SeedServiceAbstract { + + @Inject + public BulkActionItemSeeding( + ValueHolderRepository<String, ? extends BulkActionItem> entities) { + super(entities); + } + +} diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionMenu.java similarity index 51% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionMenu.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionMenu.java index f1ae018bc9..1444f53ec4 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionMenu.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionMenu.java @@ -16,47 +16,51 @@ * specific language governing permissions and limitations * under the License. */ -package demoapp.dom.domain.actions.progmodel.assoc; +package demoapp.dom.domain.actions.progmodel.bulk; +import javax.annotation.Priority; import javax.inject.Inject; import javax.inject.Named; import org.apache.causeway.applib.annotation.Action; import org.apache.causeway.applib.annotation.ActionLayout; -import org.apache.causeway.applib.annotation.DomainObjectLayout; import org.apache.causeway.applib.annotation.DomainService; import org.apache.causeway.applib.annotation.NatureOfService; import org.apache.causeway.applib.annotation.PriorityPrecedence; import org.apache.causeway.applib.services.factory.FactoryService; -@Named("demo.AssociatedActionMenu") -@DomainService( - nature=NatureOfService.VIEW -) -@DomainObjectLayout( - named="Associated Action" -) [email protected](PriorityPrecedence.EARLY) -public class AssociatedActionMenu { +import lombok.RequiredArgsConstructor; +import lombok.val; - @Inject private FactoryService factoryService; +import java.util.Arrays; +import java.util.List; + +@Named("demo.BulkActionMenu") +@DomainService(nature=NatureOfService.VIEW) +@Priority(PriorityPrecedence.EARLY) +@RequiredArgsConstructor(onConstructor_ = { @Inject }) +public class BulkActionMenu { + + private static final List<String> FRIENDS_NAMES = + Arrays.asList("Joey", "Monica", "Rachel", "Phoebe", "Chandler", "Ross"); + + final FactoryService factoryService; + final BulkActionItemRepository repository; @Action - @ActionLayout(cssClassFa="fa-bolt") - public AssociatedActionDemo associatedActions(){ - return AssociatedActionDemo.createWithDemoData(); + @ActionLayout(cssClassFa="fa-bolt", describedAs = "Bulk actions") + public BulkActionPage bulkActions() { + val page = factoryService.viewModel(new BulkActionPage()); + repository.allInstances() + .stream() + .filter(x -> FRIENDS_NAMES.contains(x.getName())) + .forEach(x -> page.getAmericanCharacters().add(x)); + repository.allInstances() + .stream() + .filter(x -> ! FRIENDS_NAMES.contains(x.getName())) + .forEach(x -> page.getBritishCharacters().add(x)); + return page; } -// @Action -// @ActionLayout(cssClassFa="fa-bolt") -// public AssociatedActionDemo associatedActions(){ -// val demo = factoryService.viewModel(AssociatedActionDemo.class); -// demo.getItems().clear(); -// demo.getItems().add(DemoItem.of("first")); -// demo.getItems().add(DemoItem.of("second")); -// demo.getItems().add(DemoItem.of("third")); -// demo.getItems().add(DemoItem.of("last")); -// return demo; -// } - } + diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage-description.adoc new file mode 100644 index 0000000000..cd2d0344e7 --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage-description.adoc @@ -0,0 +1,55 @@ +:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...] + + + +Actions parameters can be either value types or reference types (typically entities), and can be either single-valued (a scalar) or multi-valued (a list). + +Actions that have one or more multi-valued parameters are sometimes called "bulk" actions because they act "in bulk", upon a number of objects. + +[TIP] +==== +Rather than using a supporting method, it is also possible to use link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/Action.html#choicesfrom[@Action#choicesFrom], which causes . +==== + +== How this demo works + +On the left hand side of this page are two different implementations of a design to mark "character" objects as favourites. +If added as a favourite, the object is moved to the "favourites" collection in the middle. + +The first implementation uses a supporting `choicesXNnn` method, providing a list of actions from the appropriate collection. + +The second implementation uses the link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/Action.html#choicesfrom[@Action#choicesFrom] annotation. +Instead of a supporting `choicesXNnn` method, checkboxes are rendered against a collection; these act as the source of candidate values for the parameter. + +In terms of code: + +* page object: ++ +[source,java,indent=0] +.BulkActionPage.java +---- +include::BulkActionPage.java[tags=class] +---- + +* the actions to add and remove American favorites use a `choices` method: ++ +[source,java,indent=0] +.BulkActionPage_addToAmericanFavourites.java.java +---- +include::BulkActionPage_addToAmericanFavourites.java[tags=class] +---- +<.> explicitly provide a set of candidates to select from ++ +with `removeFromAmericanFavourites` the equivalent code, but moving the objects in the other direction + +* whereas the avtions to add and remove British favourites use the `@Action#choicesFrom` annotation: ++ +[source,java,indent=0] +.BulkActionPage_addToBritishFavourites.java.java +---- +include::BulkActionPage_addToBritishFavourites.java[tags=class] +---- +<.> indicates that the choices are taken from this collection ++ +where again `removeFromBritishFavourites` the equivalent code, but moving the objects in the other direction. + diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage.java new file mode 100644 index 0000000000..86f6e0e99f --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage.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.domain.actions.progmodel.bulk; + +import javax.inject.Named; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import org.apache.causeway.applib.annotation.DomainObject; +import org.apache.causeway.applib.annotation.Nature; +import org.apache.causeway.applib.annotation.ObjectSupport; + +import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription; +import demoapp.dom.domain.collections.CollectionLayout.tabledec.child.CollectionLayoutTableDecoratorChildVm; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +//tag::class[] +@Named("demo.BulkActionPage") +@DomainObject(nature=Nature.VIEW_MODEL) +@XmlRootElement(name = "root") +@XmlType +@XmlAccessorType(XmlAccessType.FIELD) +public class BulkActionPage implements HasAsciiDocDescription { + // ... +//end::class[] + @ObjectSupport public String title() { + return "Bulk actions"; + } + +//tag::class[] + @XmlElementWrapper(name = "americanCharacters") + @XmlElement(name = "character") + @Getter @Setter + private List<BulkActionItem> americanCharacters = new ArrayList<>(); + + @XmlElementWrapper(name = "americanFavourites") + @XmlElement(name = "favourite") + @Getter @Setter + private List<BulkActionItem> americanFavourites = new ArrayList<>(); + + @XmlElementWrapper(name = "britishCharacters") + @XmlElement(name = "character") + @Getter @Setter + private List<BulkActionItem> britishCharacters = new ArrayList<>(); + + @XmlElementWrapper(name = "britishFavourites") + @XmlElement(name = "favourite") + @Getter @Setter + private List<BulkActionItem> britishFavourites = new ArrayList<>(); +} +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage.layout.xml new file mode 100644 index 0000000000..b82ce4a665 --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage.layout.xml @@ -0,0 +1,88 @@ +<?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"> + <bs3:row> + <bs3:col span="6"> + <cpt:collection id="americanCharacters"> + <cpt:action id="addToAmericanFavourites"> + <cpt:named>Add to favorites</cpt:named> + </cpt:action> + </cpt:collection> + </bs3:col> + <bs3:col span="6"> + <cpt:collection id="americanFavourites" namedEscaped="American Favorites"> + <cpt:action id="removeFromAmericanFavourites"> + <cpt:named>Remove from favorites</cpt:named> + </cpt:action> + </cpt:collection> + </bs3:col> + </bs3:row> + <bs3:row> + <bs3:col span="6"> + <cpt:collection id="britishCharacters"> + <cpt:action id="addToBritishFavourites"> + <cpt:named>Add to favourites</cpt:named> + </cpt:action> + </cpt:collection> + </bs3:col> + <bs3:col span="6"> + <cpt:collection id="britishFavourites"> + <cpt:action id="removeFromBritishFavourites"> + <cpt:named>Remove from favourites</cpt:named> + </cpt:action> + </cpt:collection> + </bs3:col> + </bs3:row> + <bs3:row> + <bs3:col span="12"> + <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/> + </bs3:col> + </bs3:row> + </bs3:col> + <bs3:col span="6"> + <cpt:fieldSet name="Description" id="description" > + <cpt:action id="clearHints" position="PANEL" /> + <cpt:action id="rebuildMetamodel" position="PANEL"/> + <cpt:action id="downloadLayout" position="PANEL_DROPDOWN"/> + <cpt:action id="inspectMetamodel" position="PANEL_DROPDOWN"/> + <cpt:action id="downloadMetamodelXml" position="PANEL_DROPDOWN"/> + <cpt:action id="downloadJdoMetamodel" position="PANEL_DROPDOWN"/> + <cpt:action id="recentCommands" position="PANEL_DROPDOWN"/> + <cpt:action id="recentExecutions" position="PANEL_DROPDOWN"/> + <cpt:action id="recentAuditTrailEntries" position="PANEL_DROPDOWN"/> + <cpt:action id="impersonateWithRoles" position="PANEL_DROPDOWN"/> + <cpt:action id="openRestApi" position="PANEL_DROPDOWN" /> + <cpt:property id="description"/> + </cpt:fieldSet> + </bs3:col> + </bs3:row> + <bs3:row> + <bs3:col span="12" unreferencedCollections="true"/> + </bs3:row> + +</bs3:grid> diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_addToAmericanFavourites.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_addToAmericanFavourites.java new file mode 100644 index 0000000000..2a8636e4bb --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_addToAmericanFavourites.java @@ -0,0 +1,47 @@ +/* + * 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.domain.actions.progmodel.bulk; + +import java.util.List; + +import org.apache.causeway.applib.annotation.Action; +import org.apache.causeway.applib.annotation.MemberSupport; + +import lombok.RequiredArgsConstructor; + +//tag::class[] +@Action +@RequiredArgsConstructor +public class BulkActionPage_addToAmericanFavourites { + + private final BulkActionPage page; + + @MemberSupport public BulkActionPage act( + final List<BulkActionItem> children) { + for (BulkActionItem child : children) { + page.getAmericanFavourites().add(child); + page.getAmericanCharacters().remove(child); + } + return page; + } + public List<BulkActionItem> choices0Act() { // <.> + return page.getAmericanCharacters(); + } +} +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_addToBritishFavourites.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_addToBritishFavourites.java new file mode 100644 index 0000000000..4104ab166a --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_addToBritishFavourites.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package demoapp.dom.domain.actions.progmodel.bulk; + +import java.util.List; + +import org.apache.causeway.applib.annotation.Action; +import org.apache.causeway.applib.annotation.MemberSupport; + +import lombok.RequiredArgsConstructor; + +//tag::class[] +@Action(choicesFrom = "britishCharacters") // <.> +@RequiredArgsConstructor +public class BulkActionPage_addToBritishFavourites { + private final BulkActionPage page; + + @MemberSupport public BulkActionPage act( + final List<BulkActionItem> children) { + for (BulkActionItem child : children) { + page.getBritishFavourites().add(child); + page.getBritishCharacters().remove(child); + } + return page; + } +} +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_removeFromAmericanFavourites.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_removeFromAmericanFavourites.java new file mode 100644 index 0000000000..8ae7fa720b --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_removeFromAmericanFavourites.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.domain.actions.progmodel.bulk; + +import java.util.List; + +import org.apache.causeway.applib.annotation.Action; +import org.apache.causeway.applib.annotation.MemberSupport; + +import lombok.RequiredArgsConstructor; + +//tag::class[] +@Action +@RequiredArgsConstructor +public class BulkActionPage_removeFromAmericanFavourites { + + private final BulkActionPage page; + + @MemberSupport public BulkActionPage act( + final List<BulkActionItem> children) { + for (BulkActionItem child : children) { + page.getAmericanFavourites().remove(child); + page.getAmericanCharacters().add(child); + + } + return page; + } + public List<BulkActionItem> choices0Act() { // <.> + return page.getAmericanFavourites(); + } +} +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_removeFromBritishFavourites.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_removeFromBritishFavourites.java new file mode 100644 index 0000000000..09a1076ddf --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/BulkActionPage_removeFromBritishFavourites.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package demoapp.dom.domain.actions.progmodel.bulk; + +import java.util.List; + +import org.apache.causeway.applib.annotation.Action; +import org.apache.causeway.applib.annotation.MemberSupport; + +import lombok.RequiredArgsConstructor; + +//tag::class[] +@Action(choicesFrom = "britishFavourites") // <.> +@RequiredArgsConstructor +public class BulkActionPage_removeFromBritishFavourites { + + private final BulkActionPage page; + + @MemberSupport public BulkActionPage act( + final List<BulkActionItem> children) { + for (BulkActionItem child : children) { + page.getBritishFavourites().remove(child); + page.getBritishCharacters().add(child); + } + return page; + } +} +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpa-description.adoc similarity index 62% copy from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo-description.adoc copy to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpa-description.adoc index c43b0cecfe..c0ce49a670 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo-description.adoc +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpa-description.adoc @@ -1,24 +1,5 @@ :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...] -(since 1.18.0 and 2.0.0-M3) +This domain class is used in the demo of "bulk" actions, in other words actions that have multi-valued (aka collection) parameters. -Known issues link:https://issues.apache.org/jira/browse/CAUSEWAY-2319[CAUSEWAY-2319] -[source,java] ----- - -public void act(X param0, Y param1, ...) { // <.> - ... -} - -public List<Y> choices1Act(X param0) { // <.> - return ... -} - ----- - -<.> Action with multiple parameters -<.> Choices for param1 depend on the user specified param0. - -See the associated action demo -link:${SOURCES_DEMO}/demoapp/dom/actions/depargs[sources]. diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpa.java new file mode 100644 index 0000000000..85787a371d --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpa.java @@ -0,0 +1,73 @@ +/* + * 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.domain.actions.progmodel.bulk.jpa; + +import javax.inject.Named; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.apache.causeway.applib.jaxb.PersistentEntityAdapter; + +import org.springframework.context.annotation.Profile; + +import org.apache.causeway.applib.annotation.DomainObject; +import org.apache.causeway.applib.annotation.Nature; +import org.apache.causeway.persistence.jpa.applib.integration.CausewayEntityListener; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import demoapp.dom.domain.actions.progmodel.bulk.BulkActionItem; + +@Profile("demo-jpa") +@Entity +@Table( + schema = "demo", + name = "BulkActionItem" +) +@XmlJavaTypeAdapter(PersistentEntityAdapter.class) +@EntityListeners(CausewayEntityListener.class) +@Named("demo.BulkActionItemJpa") +@NoArgsConstructor +//tag::class[] +// ... +@DomainObject(nature = Nature.ENTITY) +public class BulkActionItemJpa extends BulkActionItem { + // ... +//end::class[] + + public BulkActionItemJpa(String value) { + setName(value); + } + + @Id + @GeneratedValue + private Long id; + + @Getter @Setter + private String name; + +//tag::class[] +} +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpaEntities.java new file mode 100644 index 0000000000..a667fa6747 --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/bulk/jpa/BulkActionItemJpaEntities.java @@ -0,0 +1,55 @@ +/* + * 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.domain.actions.progmodel.bulk.jpa; + +import java.util.List; + +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Service; + +import demoapp.dom._infra.values.ValueHolderRepository; +import demoapp.dom.domain.actions.progmodel.bulk.BulkActionItem; +import demoapp.dom.domain.actions.progmodel.bulk.BulkActionItemRepository; + +@Profile("demo-jpa") +@Service +public class BulkActionItemJpaEntities +extends ValueHolderRepository<String, BulkActionItemJpa> implements BulkActionItemRepository { + + protected BulkActionItemJpaEntities() { + super(BulkActionItemJpa.class); + } + + @Override + protected BulkActionItemJpa newDetachedEntity(String value) { + return new BulkActionItemJpa(value); + } + + @Override + public List<? extends BulkActionItem> allInstances() { + return all(); + } + + public List<? extends BulkActionItem> allMatches(final String s) { + return all(); + } + public List<? extends BulkActionItem> allMatches() { + return all(); + } +} diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs-description.adoc similarity index 100% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo-description.adoc rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs-description.adoc diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs.layout.xml similarity index 59% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo.layout.xml rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs.layout.xml index 27b52a60a1..e5a90f7984 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo.layout.xml +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs.layout.xml @@ -14,47 +14,50 @@ 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="12" unreferencedActions="true"> - <cpt:domainObject /> - <cpt:action id="clearHints" /> - <cpt:action id="downloadLayoutXml" /> - <cpt:action id="openRestApi" /> - <cpt:action id="rebuildMetamodel" /> - - </bs3:col> - </bs3:row> - + <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"> + <bs3:row> + <bs3:col span="12"> + <cpt:collection id="items"/> + </bs3:col> + </bs3:row> + <bs3:row> + <bs3:col span="12"> + <cpt:fieldSet name="Action Parameter Support" id="actions-dep1"> - <cpt:fieldSet name="Action Parameter Support" id="actions-dep1"> - <cpt:action id="useChoices"/> - <cpt:action id="useChoices2"/> - <cpt:action id="useAutoComplete"/> - <cpt:action id="useAutoComplete2"/> - <cpt:action id="useDefault"/> - <cpt:property id="dependentText1"/> - <cpt:property id="dialogParityDefault" /> - </cpt:fieldSet> + <cpt:action id="useChoices"/> + <cpt:action id="useChoices2"/> + <cpt:action id="useAutoComplete"/> + <cpt:action id="useAutoComplete2"/> + <cpt:action id="useDefault"/> + <cpt:property id="dependentText1"/> + <cpt:property id="dialogParityDefault" /> + </cpt:fieldSet> - <cpt:fieldSet name="Action Parameter Support" id="actions-dep2"> - <cpt:action id="useHide"/> - <cpt:action id="useDisable"/> - <cpt:property id="dependentText2"/> - <cpt:property id="dialogCheckboxDefault" /> - </cpt:fieldSet> + <cpt:fieldSet name="Action Parameter Support" id="actions-dep2"> + <cpt:action id="useHide"/> + <cpt:action id="useDisable"/> + <cpt:property id="dependentText2"/> + <cpt:property id="dialogCheckboxDefault" /> + </cpt:fieldSet> - <cpt:fieldSet name="Action Parameter Support" id="actions-indep"> - <cpt:action id="useIndependent"/> - <cpt:property id="independentText"/> - </cpt:fieldSet> + <cpt:fieldSet name="Action Parameter Support" id="actions-indep"> + <cpt:action id="useIndependent"/> + <cpt:property id="independentText"/> + </cpt:fieldSet> + </bs3:col> + </bs3:row> <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/> - - <cpt:collection defaultView="table" id="items" /> - </bs3:col> <bs3:col span="6"> diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsMenu.java similarity index 83% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionMenu.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsMenu.java index 4a8b96da25..89264bc211 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionMenu.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsMenu.java @@ -18,6 +18,7 @@ */ package demoapp.dom.domain.actions.progmodel.depargs; +import javax.annotation.Priority; import javax.inject.Inject; import javax.inject.Named; @@ -32,21 +33,18 @@ import org.apache.causeway.applib.services.factory.FactoryService; import lombok.RequiredArgsConstructor; import lombok.val; -@Named("demo.DependentArgsActionMenu") -@DomainService( - nature=NatureOfService.VIEW -) -@DomainObjectLayout(named="Associated Action") [email protected](PriorityPrecedence.EARLY) +@Named("demo.ActionDependentArgsMenu") +@DomainService(nature=NatureOfService.VIEW) +@Priority(PriorityPrecedence.EARLY) @RequiredArgsConstructor(onConstructor_ = { @Inject }) -public class DependentArgsActionMenu { +public class ActionDependentArgsMenu { final FactoryService factoryService; @Action @ActionLayout(cssClassFa="fa-bolt") - public DependentArgsActionDemo dependentArgsActions(){ - val demo = factoryService.viewModel(new DependentArgsActionDemo()); + public ActionDependentArgsPage dependentArgsActions(){ + val demo = factoryService.viewModel(new ActionDependentArgsPage()); demo.getItems().clear(); demo.getItems().add(DemoItem.of("first", Parity.ODD)); diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage.java similarity index 95% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage.java index 0208c606f4..a1070792c3 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage.java @@ -46,12 +46,12 @@ import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription; @XmlRootElement(name = "Demo") @XmlType @XmlAccessorType(XmlAccessType.FIELD) -@Named("demo.DependentArgs") +@Named("demo.ActionDependentArgs") @DomainObject(nature=Nature.VIEW_MODEL, editing=Editing.ENABLED) -public class DependentArgsActionDemo implements HasAsciiDocDescription { +public class ActionDependentArgsPage implements HasAsciiDocDescription { @ObjectSupport public String title() { - return "Dependent Arguments Demo"; + return "Action Dependent Arguments"; } @Property(optionality = Optionality.OPTIONAL) diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_bulkAction.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_bulkAction.java similarity index 96% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_bulkAction.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_bulkAction.java index 5b26619d3d..afd1f285f7 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_bulkAction.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_bulkAction.java @@ -40,11 +40,11 @@ import lombok.experimental.Accessors; @Action(choicesFrom = "items") @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL) @RequiredArgsConstructor -public class DependentArgsActionDemo_bulkAction { +public class ActionDependentArgs_bulkAction { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -55,7 +55,7 @@ public class DependentArgsActionDemo_bulkAction { int d; } - public DependentArgsActionDemo act( + public ActionDependentArgsPage act( // BULK Set<DemoItem> demoItems, diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useAutoComplete.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useAutoComplete.java similarity index 95% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useAutoComplete.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useAutoComplete.java index 34c76236ed..7a6b559353 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useAutoComplete.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useAutoComplete.java @@ -41,11 +41,11 @@ import lombok.experimental.Accessors; @ActionLayout(named="Auto Complete", promptStyle = PromptStyle.DIALOG_MODAL) @Action @RequiredArgsConstructor -public class DependentArgsActionDemo_useAutoComplete { +public class ActionDependentArgs_useAutoComplete { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -53,7 +53,7 @@ public class DependentArgsActionDemo_useAutoComplete { DemoItem item1; } - @MemberSupport public DependentArgsActionDemo act( + @MemberSupport public ActionDependentArgsPage act( // PARAM 0 @Parameter(optionality = Optionality.MANDATORY) final diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useAutoComplete2.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useAutoComplete2.java similarity index 95% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useAutoComplete2.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useAutoComplete2.java index 97f9681954..674f4312ad 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useAutoComplete2.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useAutoComplete2.java @@ -46,11 +46,11 @@ import lombok.experimental.Accessors; promptStyle = PromptStyle.DIALOG_MODAL) @Action @RequiredArgsConstructor -public class DependentArgsActionDemo_useAutoComplete2 { +public class ActionDependentArgs_useAutoComplete2 { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -58,7 +58,7 @@ public class DependentArgsActionDemo_useAutoComplete2 { List<DemoItem> items; } - @MemberSupport public DependentArgsActionDemo act( + @MemberSupport public ActionDependentArgsPage act( // PARAM 0 @Parameter(optionality = Optionality.MANDATORY) final diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useChoices.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useChoices.java similarity index 95% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useChoices.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useChoices.java index 7a8e62549c..c89f1d0a6c 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useChoices.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useChoices.java @@ -40,11 +40,11 @@ import lombok.experimental.Accessors; @ActionLayout(named="Choices", promptStyle = PromptStyle.DIALOG_MODAL) @Action(semantics = SemanticsOf.SAFE) @RequiredArgsConstructor -public class DependentArgsActionDemo_useChoices { +public class ActionDependentArgs_useChoices { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -52,7 +52,7 @@ public class DependentArgsActionDemo_useChoices { DemoItem item1; } - @MemberSupport public DependentArgsActionDemo act( + @MemberSupport public ActionDependentArgsPage act( // PARAM 0 @Parameter(optionality = Optionality.MANDATORY) final diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useChoices2.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useChoices2.java similarity index 95% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useChoices2.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useChoices2.java index fe451bbe11..8f5e9721e3 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useChoices2.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useChoices2.java @@ -45,11 +45,11 @@ import lombok.experimental.Accessors; named="MultiChoices", promptStyle = PromptStyle.DIALOG_MODAL) @RequiredArgsConstructor -public class DependentArgsActionDemo_useChoices2 { +public class ActionDependentArgs_useChoices2 { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -57,7 +57,7 @@ public class DependentArgsActionDemo_useChoices2 { List<DemoItem> items; } - @MemberSupport public DependentArgsActionDemo act( + @MemberSupport public ActionDependentArgsPage act( // PARAM 0 @Parameter(optionality = Optionality.MANDATORY) diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useDefault.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useDefault.java similarity index 95% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useDefault.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useDefault.java index 68c781e8d7..f14a14a44d 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useDefault.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useDefault.java @@ -37,11 +37,11 @@ import lombok.experimental.Accessors; @ActionLayout(named="Default", promptStyle = PromptStyle.DIALOG_MODAL) @Action @RequiredArgsConstructor -public class DependentArgsActionDemo_useDefault { +public class ActionDependentArgs_useDefault { @Inject MessageService messageService; - private final DependentArgsActionDemo mixee; + private final ActionDependentArgsPage mixee; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -49,7 +49,7 @@ public class DependentArgsActionDemo_useDefault { String message; } - public DependentArgsActionDemo act( + public ActionDependentArgsPage act( // PARAM 0 @Parameter(optionality = Optionality.MANDATORY) final diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useDisable.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useDisable.java similarity index 94% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useDisable.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useDisable.java index 63a6ac6abf..220243107a 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useDisable.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useDisable.java @@ -36,11 +36,11 @@ import lombok.experimental.Accessors; @ActionLayout(named="Disable", promptStyle = PromptStyle.DIALOG_MODAL) @Action @RequiredArgsConstructor -public class DependentArgsActionDemo_useDisable { +public class ActionDependentArgs_useDisable { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -48,7 +48,7 @@ public class DependentArgsActionDemo_useDisable { String message; } - @MemberSupport public DependentArgsActionDemo act( + @MemberSupport public ActionDependentArgsPage act( // PARAM 0 @ParameterLayout(named = "Disable Message Field") final diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useHide.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useHide.java similarity index 94% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useHide.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useHide.java index d0cad0b38e..0a8fd310cd 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useHide.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useHide.java @@ -36,11 +36,11 @@ import lombok.experimental.Accessors; @ActionLayout(named="Hide", promptStyle = PromptStyle.DIALOG_MODAL) @Action @RequiredArgsConstructor -public class DependentArgsActionDemo_useHide { +public class ActionDependentArgs_useHide { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; @Value @Accessors(fluent = true) // fluent so we can replace this with Java(14+) records later static class Parameters { @@ -48,7 +48,7 @@ public class DependentArgsActionDemo_useHide { String message; } - @MemberSupport public DependentArgsActionDemo act( + @MemberSupport public ActionDependentArgsPage act( // PARAM 0 @ParameterLayout(named = "Hide Message Field") final diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useIndependent.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useIndependent.java similarity index 94% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useIndependent.java rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useIndependent.java index 64c22b6317..36bca6dd1b 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/DependentArgsActionDemo_useIndependent.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgs_useIndependent.java @@ -36,13 +36,13 @@ import lombok.val; @ActionLayout(named="Independent Args", promptStyle = PromptStyle.DIALOG_MODAL) @Action @RequiredArgsConstructor -public class DependentArgsActionDemo_useIndependent { +public class ActionDependentArgs_useIndependent { @Inject MessageService messageService; - private final DependentArgsActionDemo holder; + private final ActionDependentArgsPage holder; - @MemberSupport public DependentArgsActionDemo act( + @MemberSupport public ActionDependentArgsPage act( // PARAM 0 @Parameter(optionality = Optionality.MANDATORY) final diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/DemoItem.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/DemoItem.java similarity index 97% rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/DemoItem.java rename to examples/demo/domain/src/main/java/demoapp/dom/featured/DemoItem.java index 9f87b0174c..20a21a60e8 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/DemoItem.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/DemoItem.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package demoapp.dom.domain.actions.progmodel.assoc; +package demoapp.dom.featured; import javax.inject.Named; diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java index 3028ab2848..524c5af568 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java @@ -36,7 +36,6 @@ import org.apache.causeway.applib.services.factory.FactoryService; import lombok.RequiredArgsConstructor; import lombok.val; -import demoapp.dom.domain.actions.progmodel.assoc.DemoItem; import demoapp.dom.featured.customui.geocoding.GeoapifyClient; import demoapp.dom.featured.customui.latlng.Zoom; import demoapp.dom.featured.customui.vm.WhereInTheWorldVm; diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/describedAs/DescribedAsVm.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/describedAs/DescribedAsVm.java index 21011c59ea..fb24fcdfca 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/describedAs/DescribedAsVm.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/describedAs/DescribedAsVm.java @@ -53,7 +53,7 @@ import lombok.Getter; import lombok.Setter; import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription; -import demoapp.dom.domain.actions.progmodel.assoc.DemoItem; +import demoapp.dom.featured.DemoItem; @XmlRootElement(name = "Demo") @XmlType 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 e7e24639ad..08641abc7b 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 @@ -86,8 +86,10 @@ For latest we use: https://raw.githubusercontent.com/apache/causeway/master/anto </mb3:section> <mb3:section> <mb3:named>Prog Model</mb3:named> - <mb3:serviceAction objectType="demo.AssociatedActionMenu" id="associatedActions"/> - <mb3:serviceAction objectType="demo.DependentArgsActionMenu" id="dependentArgsActions"> + <mb3:serviceAction objectType="demo.BulkActionMenu" id="bulkActions"> + <cpt:named>Bulk Actions</cpt:named> + </mb3:serviceAction> + <mb3:serviceAction objectType="demo.ActionDependentArgsMenu" id="dependentArgsActions"> <cpt:named>Dependent Arguments</cpt:named> </mb3:serviceAction> </mb3:section>
