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 2021/10/03 21:28:53 UTC
[isis-app-demo] branch main updated (c1768b8 -> 01b46a7)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git.
from c1768b8 deletes (unused) PetOwner#others.columnOrder.txt
add ca1312f adds PetName meta-annotation
add a13c370 adds Pet entity
add 196edfa adds PetRepository
add 8766a65 adds PetOwner_pets mixin collection
add 3af94b9 updates PetOwner layout file for positioning of pets collection
add 9e39c5d adds column order file for PetOwner's pets collection
add fb3ca7d adds PetSpecies enum
add 1615c7e adds petSpecies property to Pet
add 3e7a51d adds notes property to Pet
add cf720fd adds table name for Pet entity
add e6d3de0 adds table name and column names for PetOwner entity
add cdc1130 updates jdbc url
add a1dfc36 adds PetOwner_addPet mixin
add f3b0431 adds findByPetOwnerAndName to PetRepository
add e5211b0 adds validation to prevent two Pets with same name for given owner
add bf1caa8 Defaults the species of Pet to Dog when adding pet
add df66b07 adds a Pet.layout.xml file
add 2da6f94 adds Pet.png icon file
add 1b26346 updates icon file for PetOwner
add ac1a122 adds title for Pet
add bb0be9b adds custom icon for Pet, based on its species
add 2a03eff shows title with icon, in tables
add 686f454 makes PetOwnerBuilder idempotent
add 43e4eaf adds a PetBuilder to add Pets using domain logic
add 6aba5b2 adds Pet_persona with example Pets
add 11ef129 updates PetClinicDemo to create Pets as well as PetOwners.
new cd5b0e8 adds removePet action mixin for PetOwner
new 03d943c adds sequence for addPet action, to be explicit
new f98b8d0 adds choices for removeAct to restrict names to those owned
new 477de6e diables removePet action if the owner has no pets.
new 01b46a7 defaults name for removePet if there is only one.
The 5 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:
.../modules/pets/dom/petowner/Pet-budgerigar.png | Bin 0 -> 1034 bytes
.../modules/pets/dom/petowner/Pet-cat.png | Bin 0 -> 1747 bytes
.../modules/pets/dom/petowner/Pet-dog.png | Bin 0 -> 2001 bytes
.../modules/pets/dom/petowner/Pet-hamster.png | Bin 0 -> 992 bytes
.../petclinic/modules/pets/dom/petowner/Pet.java | 119 +++++++++++++++++++++
.../modules/pets/dom/petowner/Pet.layout.xml | 48 +++++++++
.../petclinic/modules/pets/dom/petowner/Pet.png | Bin 0 -> 2001 bytes
.../dom/petowner/PetOwner#pets.columnOrder.txt | 2 +
.../modules/pets/dom/petowner/PetOwner.java | 13 +--
.../modules/pets/dom/petowner/PetOwner.layout.xml | 9 +-
.../modules/pets/dom/petowner/PetOwner.png | Bin 653 -> 1035 bytes
.../modules/pets/dom/petowner/PetOwner_addPet.java | 44 ++++++++
.../modules/pets/dom/petowner/PetOwner_pets.java | 24 +++++
.../pets/dom/petowner/PetOwner_removePet.java | 51 +++++++++
.../modules/pets/dom/petowner/PetRepository.java | 12 +++
.../modules/pets/dom/petowner/PetSpecies.java | 8 ++
.../petclinic/modules/pets/fixture/PetBuilder.java | 43 ++++++++
.../modules/pets/fixture/PetOwnerBuilder.java | 15 +--
.../modules/pets/fixture/Pet_persona.java | 53 +++++++++
.../pets/types/{FirstName.java => PetName.java} | 9 +-
.../fixture/scenarios/PetClinicDemo.java | 2 +
webapp/src/main/resources/application-custom.yml | 3 +
.../main/resources/config/application.properties | 2 +-
.../src/main/resources/static/css/application.css | 7 ++
24 files changed, 444 insertions(+), 20 deletions(-)
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/Pet-budgerigar.png
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/Pet-cat.png
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/Pet-dog.png
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/Pet-hamster.png
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/Pet.java
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/Pet.layout.xml
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/Pet.png
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner#pets.columnOrder.txt
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_addPet.java
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_pets.java
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetRepository.java
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetSpecies.java
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/fixture/PetBuilder.java
create mode 100644 module-pets/src/main/java/petclinic/modules/pets/fixture/Pet_persona.java
copy module-pets/src/main/java/petclinic/modules/pets/types/{FirstName.java => PetName.java} (69%)
[isis-app-demo] 04/05: diables removePet action if the owner has no
pets.
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit 477de6e11be8eebbd8d0f59514b47bbc79d5db4f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Oct 3 22:26:49 2021 +0100
diables removePet action if the owner has no pets.
---
.../java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
index 045f14c..97aa8d4 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
@@ -32,6 +32,9 @@ public class PetOwner_removePet {
.ifPresent(pet -> repositoryService.remove(pet));
return petOwner;
}
+ public String disableAct() {
+ return petRepository.findByPetOwner(petOwner).isEmpty() ? "No pets" : null;
+ }
public List<String> choices0Act() {
return petRepository.findByPetOwner(petOwner)
.stream()
[isis-app-demo] 02/05: adds sequence for addPet action,
to be explicit
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit 03d943cbbcf14603a492357f0d14892c1ae40c3f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Oct 3 22:18:51 2021 +0100
adds sequence for addPet action, to be explicit
---
.../main/java/petclinic/modules/pets/dom/petowner/PetOwner_addPet.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_addPet.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_addPet.java
index e136947..10e00db 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_addPet.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_addPet.java
@@ -17,7 +17,7 @@ import petclinic.modules.pets.types.PetName;
commandPublishing = Publishing.ENABLED,
executionPublishing = Publishing.ENABLED
)
-@ActionLayout(associateWith = "pets")
+@ActionLayout(associateWith = "pets", sequence = "1")
@RequiredArgsConstructor
public class PetOwner_addPet {
[isis-app-demo] 01/05: adds removePet action mixin for PetOwner
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit cd5b0e87b29a9645920f73758c18d4e4b9c0d56f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Oct 3 22:18:33 2021 +0100
adds removePet action mixin for PetOwner
---
.../pets/dom/petowner/PetOwner_removePet.java | 38 ++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
new file mode 100644
index 0000000..b68918d
--- /dev/null
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
@@ -0,0 +1,38 @@
+package petclinic.modules.pets.dom.petowner;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Publishing;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.repository.RepositoryService;
+
+import lombok.RequiredArgsConstructor;
+
+import petclinic.modules.pets.types.PetName;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ commandPublishing = Publishing.ENABLED,
+ executionPublishing = Publishing.ENABLED
+)
+@ActionLayout(associateWith = "pets", sequence = "2")
+@RequiredArgsConstructor
+public class PetOwner_removePet {
+
+ private final PetOwner petOwner;
+
+ public PetOwner act(@PetName final String name) {
+ petRepository.findByPetOwnerAndName(petOwner, name)
+ .ifPresent(pet -> repositoryService.remove(pet));
+ return petOwner;
+ }
+
+ @Inject PetRepository petRepository;
+ @Inject RepositoryService repositoryService;
+}
[isis-app-demo] 05/05: defaults name for removePet if there is only
one.
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit 01b46a7e110cd654d5d28bb17e8489000baf5ec4
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Oct 3 22:27:49 2021 +0100
defaults name for removePet if there is only one.
---
.../java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
index 97aa8d4..bba2eac 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
@@ -41,6 +41,10 @@ public class PetOwner_removePet {
.map(Pet::getName)
.collect(Collectors.toList());
}
+ public String default0Act() {
+ List<String> names = choices0Act();
+ return names.size() == 1 ? names.get(0) : null;
+ }
@Inject PetRepository petRepository;
@Inject RepositoryService repositoryService;
[isis-app-demo] 03/05: adds choices for removeAct to restrict names
to those owned
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit f98b8d048c3c368b6fd1bafcbcaf9e8aee40214f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Oct 3 22:23:13 2021 +0100
adds choices for removeAct to restrict names to those owned
---
.../petclinic/modules/pets/dom/petowner/PetOwner_removePet.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
index b68918d..045f14c 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner_removePet.java
@@ -32,6 +32,12 @@ public class PetOwner_removePet {
.ifPresent(pet -> repositoryService.remove(pet));
return petOwner;
}
+ public List<String> choices0Act() {
+ return petRepository.findByPetOwner(petOwner)
+ .stream()
+ .map(Pet::getName)
+ .collect(Collectors.toList());
+ }
@Inject PetRepository petRepository;
@Inject RepositoryService repositoryService;