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/02 06:40:21 UTC

[isis-app-demo] tag tags/03-07-derived-PetOwner-name created (now 35c80e7)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to tag tags/03-07-derived-PetOwner-name
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git.


      at 35c80e7  (commit)
This tag includes the following new commits:

     new 24cd430  Removes unnecessary @ActionLayout#promptStyle and commened out code
     new ebf727f  adds derived PetOwner#name property
     new 9b4f857  hides PetOwner lastName and firstName propertie
     new 7302be3  associates PetOwner#updateName with new name property
     new 35c80e7  fixes integ tests

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.


[isis-app-demo] 01/05: Removes unnecessary @ActionLayout#promptStyle and commened out code

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to tag tags/03-07-derived-PetOwner-name
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit 24cd430c37557adf9ba015c7804ad19249f4ea16
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 07:10:36 2021 +0100

    Removes unnecessary @ActionLayout#promptStyle and commened out code
---
 .../src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java   | 4 ++--
 .../src/main/java/petclinic/modules/pets/dom/petowner/PetOwners.java  | 4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
index 35ce1bd..6793a77 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
@@ -123,10 +123,10 @@ public class PetOwner implements Comparable<PetOwner> {
 
 
     @Action(semantics = IDEMPOTENT, commandPublishing = Publishing.ENABLED, executionPublishing = Publishing.ENABLED)
-    @ActionLayout(associateWith = "lastName"/*, promptStyle = PromptStyle.DIALOG*/)
+    @ActionLayout(associateWith = "lastName")
     public PetOwner updateName(
             @LastName final String lastName,
-            @FirstName String firstName) {
+            @FirstName final String firstName) {
         setLastName(lastName);
         setFirstName(firstName);
         return this;
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwners.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwners.java
index b1e5530..9745cd7 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwners.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwners.java
@@ -38,7 +38,6 @@ public class PetOwners {
 
 
     @Action(semantics = SemanticsOf.NON_IDEMPOTENT)
-    @ActionLayout(/*promptStyle = PromptStyle.DIALOG_MODAL*/)
     public PetOwner create(
             @LastName final String lastName,
             @FirstName final String firstName) {
@@ -47,7 +46,6 @@ public class PetOwners {
 
 
     @Action(semantics = SemanticsOf.NON_IDEMPOTENT)
-    @ActionLayout(promptStyle = PromptStyle.DIALOG_SIDEBAR)
     public List<PetOwner> findByLastNameLike(
             @LastName final String lastName) {
         return repositoryService.allMatches(
@@ -57,7 +55,7 @@ public class PetOwners {
 
 
     @Action(semantics = SemanticsOf.SAFE)
-    @ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT, promptStyle = PromptStyle.DIALOG_SIDEBAR)
+    @ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT)
     public List<PetOwner> findByLastName(
             @LastName final String lastName
             ) {

[isis-app-demo] 03/05: hides PetOwner lastName and firstName propertie

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to tag tags/03-07-derived-PetOwner-name
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit 9b4f857d31c8e003b87cd1750fe6307e6d9c9ffe
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 07:11:50 2021 +0100

    hides PetOwner lastName and firstName propertie
---
 .../src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
index c2d08cc..09a32b4 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
@@ -25,6 +25,7 @@ import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 import org.apache.isis.applib.annotation.Publishing;
+import org.apache.isis.applib.annotation.Where;
 import org.apache.isis.applib.jaxb.PersistentEntityAdapter;
 import org.apache.isis.applib.services.message.MessageService;
 import org.apache.isis.applib.services.repository.RepositoryService;
@@ -111,13 +112,13 @@ public class PetOwner implements Comparable<PetOwner> {
     @LastName
     @Column(length = LastName.MAX_LEN, nullable = false)
     @Getter @Setter @ToString.Include
-    @PropertyLayout(fieldSetId = "name", sequence = "1")
+    @Property(hidden = Where.EVERYWHERE)
     private String lastName;
 
     @FirstName
     @Column(length = FirstName.MAX_LEN, nullable = true)
     @Getter @Setter @ToString.Include
-    @PropertyLayout(fieldSetId = "name", sequence = "2")
+    @Property(hidden = Where.EVERYWHERE)
     private String firstName;
 
     @Notes

[isis-app-demo] 04/05: associates PetOwner#updateName with new name property

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to tag tags/03-07-derived-PetOwner-name
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit 7302be356804247469c4f74779c3799b9d074aac
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 07:12:26 2021 +0100

    associates PetOwner#updateName with new name property
---
 .../src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
index 09a32b4..11de65e 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
@@ -130,7 +130,7 @@ public class PetOwner implements Comparable<PetOwner> {
 
 
     @Action(semantics = IDEMPOTENT, commandPublishing = Publishing.ENABLED, executionPublishing = Publishing.ENABLED)
-    @ActionLayout(associateWith = "lastName")
+    @ActionLayout(associateWith = "name")
     public PetOwner updateName(
             @LastName final String lastName,
             @FirstName final String firstName) {

[isis-app-demo] 05/05: fixes integ tests

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to tag tags/03-07-derived-PetOwner-name
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit 35c80e76bd06b199e3e406200c09fce7e26834d2
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 07:39:19 2021 +0100

    fixes integ tests
---
 .../pets/integtests/tests/PetOwner_IntegTest.java  | 32 +++++++++++++++++-----
 .../webapp/integtests/smoke/Smoke_IntegTest.java   |  2 +-
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java b/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java
index 34135be..e3a114b 100644
--- a/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java
+++ b/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java
@@ -9,6 +9,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import org.apache.isis.applib.services.wrapper.DisabledException;
+import org.apache.isis.applib.services.wrapper.HiddenException;
 import org.apache.isis.applib.services.wrapper.InvalidException;
 
 import petclinic.modules.pets.dom.petowner.PetOwner;
@@ -33,23 +34,39 @@ public class PetOwner_IntegTest extends PetsModuleIntegTestAbstract {
         @Test
         public void accessible() {
             // when
-            final String name = wrap(petOwner).getLastName();
+            final String name = wrap(petOwner).getName();
 
             // then
             assertThat(name).isEqualTo(petOwner.getLastName());
         }
+    }
 
-        @Test
-        public void not_editable() {
+    @Nested
+    public static class lastName extends PetOwner_IntegTest {
 
+        @Test
+        public void not_accessible() {
             // expect
-            assertThrows(DisabledException.class, ()->{
+            assertThrows(HiddenException.class, ()->{
 
                 // when
-                wrap(petOwner).setLastName("new name");
+                wrap(petOwner).getLastName();
             });
         }
+    }
+
+    @Nested
+    public static class firstName extends PetOwner_IntegTest {
 
+        @Test
+        public void not_accessible() {
+            // expect
+            assertThrows(HiddenException.class, ()->{
+
+                // when
+                wrap(petOwner).getFirstName();
+            });
+        }
     }
 
     @Nested
@@ -60,11 +77,12 @@ public class PetOwner_IntegTest extends PetsModuleIntegTestAbstract {
         public void can_be_updated_directly() {
 
             // when
-            wrap(petOwner).updateName("new name", null);
+            wrap(petOwner).updateName("McAdam", "Adam");
             transactionService.flushTransaction();
 
             // then
-            assertThat(wrap(petOwner).getLastName()).isEqualTo("new name");
+            assertThat(petOwner.getLastName()).isEqualTo("McAdam");
+            assertThat(petOwner.getFirstName()).isEqualTo("Adam");
         }
 
         @Test
diff --git a/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java b/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java
index 4e47cde..1bc39d4 100644
--- a/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java
+++ b/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java
@@ -58,7 +58,7 @@ class Smoke_IntegTest extends WebAppIntegTestAbstract {
         transactionService.flushTransaction();
 
         // then
-        assertThat(wrap(fred).getLastName()).isEqualTo("Freddy");
+        assertThat(wrap(fred).getName()).isEqualTo("Freddy");
 
 
         // when

[isis-app-demo] 02/05: adds derived PetOwner#name property

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to tag tags/03-07-derived-PetOwner-name
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit ebf727f6369920d3f2c56e7d16489fafcddce5a1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 07:16:18 2021 +0100

    adds derived PetOwner#name property
---
 .../src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
index 6793a77..c2d08cc 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
@@ -102,6 +102,12 @@ public class PetOwner implements Comparable<PetOwner> {
         return getLastName() + (getFirstName() != null ? ", " + getFirstName() : "");
     }
 
+    @Transient
+    @PropertyLayout(fieldSetId = "name", sequence = "1")
+    public String getName() {
+        return (getFirstName() != null ? getFirstName() + " ": "")  + getLastName();
+    }
+
     @LastName
     @Column(length = LastName.MAX_LEN, nullable = false)
     @Getter @Setter @ToString.Include