This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch graphql in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git
commit 18bca4e87932d357275c6d15d92480451038ae86 Author: danhaywood <[email protected]> AuthorDate: Mon Jan 29 17:11:34 2024 +0000 now working --- module-pets-tests/pom.xml | 3 + .../java/petclinic/modules/pets/dom/pet/Pet.java | 2 +- .../petclinic/modules/pets/dom/pet/Pet.layout.xml | 6 +- .../modules/pets/dom/petowner/PetOwner.java | 2 +- .../modules/pets/dom/petowner/PetOwner.layout.xml | 20 +++--- .../modules/pets/dom/petowner/PetOwners.java | 2 +- .../petclinic/modules/visits/dom/visit/Visit.java | 4 +- .../modules/visits/dom/visit/Visit.layout.xml | 6 +- pom.xml | 19 +++++- webapp-tests/log4j2-test.xml | 2 +- webapp-tests/pom.xml | 16 +++++ .../src/test/resources/application-test.properties | 23 +++++++ webapp/pom.xml | 11 ++++ .../services/health/HealthCheckServiceImpl.java | 2 +- .../services/homepage/HomePageViewModel.java | 2 +- .../services/homepage/HomePageViewModel.layout.xml | 36 ++++++----- .../services/homepage/VisitPlusPetOwner.java | 2 +- webapp/src/main/resources/application.yml | 8 +-- .../config/application-SQLSERVER.properties | 4 +- .../main/resources/config/application.properties | 31 +++++++-- webapp/src/main/resources/menubars.layout.xml | 72 ++++++++++++--------- webapp/src/main/resources/shiro.ini | 30 ++++----- webapp/src/main/resources/static/css/page.css | 9 +++ .../static/images/apache-causeway/logo-48x48.png | Bin 2622 -> 0 bytes webapp/src/main/resources/static/index.html | 22 +++---- 25 files changed, 232 insertions(+), 102 deletions(-) diff --git a/module-pets-tests/pom.xml b/module-pets-tests/pom.xml index f999327..cc4c73d 100644 --- a/module-pets-tests/pom.xml +++ b/module-pets-tests/pom.xml @@ -17,6 +17,8 @@ Integ tests for 'pets' module </description> + <packaging>jar</packaging> + <build> <testResources> <testResource> @@ -40,6 +42,7 @@ <dependency> <groupId>${project.groupId}</groupId> <artifactId>petclinic-module-pets</artifactId> + <scope>test</scope> </dependency> <!-- TESTS --> diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.java b/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.java index 8814ce6..5dd419c 100644 --- a/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.java +++ b/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.java @@ -47,7 +47,7 @@ import petclinic.modules.pets.types.PetName; } ) @EntityListeners(CausewayEntityListener.class) -@Named("pets.Pet") +@Named("app.pets.Pet") @DomainObject(entityChangePublishing = Publishing.ENABLED) @DomainObjectLayout() @NoArgsConstructor(access = AccessLevel.PUBLIC) diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.layout.xml b/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.layout.xml index 1822b83..6521a52 100644 --- a/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.layout.xml +++ b/module-pets/src/main/java/petclinic/modules/pets/dom/pet/Pet.layout.xml @@ -1,5 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<bs3:grid xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/links http://isis.apache.org/applib/layout/links/links.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3" xmlns:cpt="http://isis.apache.org/applib/layout/component" xmlns:lnk="h [...] +<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:cpt="https://causeway.apache.org/applib/layout/component" + xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <bs3:row> <bs3:col span="12" unreferencedActions="true"> <cpt:domainObject bookmarking="AS_ROOT"/> 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 6053605..4273780 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 @@ -65,7 +65,7 @@ import petclinic.modules.pets.types.PhoneNumber; ) }) @EntityListeners(CausewayEntityListener.class) -@Named("pets.PetOwner") +@Named("app.pets.PetOwner") @DomainObject(entityChangePublishing = Publishing.ENABLED) @DomainObjectLayout() @NoArgsConstructor(access = AccessLevel.PUBLIC) diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.layout.xml b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.layout.xml index 4217922..13a8d8e 100644 --- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.layout.xml +++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.layout.xml @@ -1,9 +1,13 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<bs3:grid xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns:c="http://isis.apache.org/applib/layout/component" xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<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:cpt="https://causeway.apache.org/applib/layout/component" + xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <bs3:row> <bs3:col span="12" unreferencedActions="true"> - <c:domainObject bookmarking="AS_ROOT"/> + <cpt:domainObject bookmarking="AS_ROOT"/> </bs3:col> </bs3:row> <bs3:row> @@ -12,34 +16,34 @@ <bs3:tab name="General"> <bs3:row> <bs3:col span="12"> - <c:fieldSet id="name" name="Name"/> + <cpt:fieldSet id="name" name="Name"/> </bs3:col> </bs3:row> </bs3:tab> <bs3:tab name="Metadata"> <bs3:row> <bs3:col span="12"> - <c:fieldSet name="Metadata" id="metadata"/> + <cpt:fieldSet name="Metadata" id="metadata"/> </bs3:col> </bs3:row> </bs3:tab> <bs3:tab name="Other"> <bs3:row> <bs3:col span="12"> - <c:fieldSet id="other" unreferencedProperties="true"/> + <cpt:fieldSet id="other" unreferencedProperties="true"/> </bs3:col> </bs3:row> </bs3:tab> </bs3:tabGroup> - <c:fieldSet id="contactDetails" name="Contact Details"/> - <c:fieldSet id="notes" name="Notes"/> + <cpt:fieldSet id="contactDetails" name="Contact Details"/> + <cpt:fieldSet id="notes" name="Notes"/> </bs3:col> <bs3:col span="6"> <bs3:tabGroup unreferencedCollections="true" collapseIfOne="false"> <bs3:tab name="Pets"> <!--.--> <bs3:row> <bs3:col span="12"> - <c:collection id="pets"/> + <cpt:collection id="pets"/> </bs3:col> </bs3:row> </bs3:tab> 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 e435abd..5392206 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 @@ -25,7 +25,7 @@ import lombok.RequiredArgsConstructor; import petclinic.modules.pets.types.FirstName; import petclinic.modules.pets.types.LastName; -@Named("pets.PetOwners") +@Named("app.pets.PetOwners") @DomainService(nature = NatureOfService.VIEW) @Priority(PriorityPrecedence.EARLY) @RequiredArgsConstructor(onConstructor_ = {@Inject} ) diff --git a/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.java b/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.java index d5bf491..1c630be 100644 --- a/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.java +++ b/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.java @@ -55,7 +55,7 @@ import petclinic.modules.visits.types.Reason; } ) @EntityListeners(CausewayEntityListener.class) -@Named("visits.Visit") +@Named("app.visits.Visit") @DomainObject(entityChangePublishing = Publishing.ENABLED) @DomainObjectLayout() @NoArgsConstructor(access = AccessLevel.PUBLIC) @@ -100,7 +100,7 @@ public class Visit implements Comparable<Visit> { private LocalDateTime visitAt; @Reason - @Column(name = "reason", length = FirstName.MAX_LEN, nullable = false) + @Column(name = "reason", length = Reason.MAX_LEN, nullable = false) @Getter @Setter @PropertyLayout(fieldSetId = "details", sequence = "1") private String reason; diff --git a/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.layout.xml b/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.layout.xml index a1a39a3..eeaf165 100644 --- a/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.layout.xml +++ b/module-visits/src/main/java/petclinic/modules/visits/dom/visit/Visit.layout.xml @@ -1,5 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<bs3:grid xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/links http://isis.apache.org/applib/layout/links/links.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3" xmlns:cpt="http://isis.apache.org/applib/layout/component" xmlns:lnk="h [...] +<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:cpt="https://causeway.apache.org/applib/layout/component" + xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <bs3:row> <bs3:col span="12" unreferencedActions="true"> <cpt:domainObject bookmarking="AS_ROOT"/> diff --git a/pom.xml b/pom.xml index 3dcd0e3..55a205f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,8 +21,12 @@ <properties> <causeway.version>2.0.0-SNAPSHOT</causeway.version> <java.version>21</java.version> - <maven-cucumber-reporting.version>5.3.0</maven-cucumber-reporting.version> + <archunit.version>0.14.1</archunit.version> + <datasource-proxy-spring-boot-starter.version>1.8.1</datasource-proxy-spring-boot-starter.version> + <maven-cucumber-reporting.version>5.3.0</maven-cucumber-reporting.version> + <sql-formatter.version>2.0.4</sql-formatter.version> + <skipBDD>${skipTests}</skipBDD> </properties> @@ -60,7 +64,20 @@ <type>test-jar</type> </dependency> + + <dependency> + <groupId>com.github.gavlyukovskiy</groupId> + <artifactId>datasource-proxy-spring-boot-starter</artifactId> + <version>${datasource-proxy-spring-boot-starter.version}</version> + </dependency> + <dependency> + <groupId>com.github.vertical-blank</groupId> + <artifactId>sql-formatter</artifactId> + <version>${sql-formatter.version}</version> + </dependency> + </dependencies> + </dependencyManagement> <dependencies> diff --git a/webapp-tests/log4j2-test.xml b/webapp-tests/log4j2-test.xml index 60e8974..d0a1d53 100644 --- a/webapp-tests/log4j2-test.xml +++ b/webapp-tests/log4j2-test.xml @@ -40,7 +40,7 @@ <AppenderRef ref="Console" /> </Root> - <logger name="org.apache.isis.core.runtimeservices.i18n.po.PoWriter" level="info"> + <logger name="org.apache.causeway.core.runtimeservices.i18n.po.PoWriter" level="info"> <AppenderRef ref="TranslationsPoFile"/> </logger> diff --git a/webapp-tests/pom.xml b/webapp-tests/pom.xml index ca0b2e5..4da4a06 100644 --- a/webapp-tests/pom.xml +++ b/webapp-tests/pom.xml @@ -25,6 +25,9 @@ <testResource> <filtering>false</filtering> <directory>src/test/java</directory> + <includes> + <include>**</include> + </includes> <excludes> <exclude>**/*.java</exclude> </excludes> @@ -72,6 +75,19 @@ <scope>test</scope> </dependency> + <dependency> + <groupId>com.github.gavlyukovskiy</groupId> + <artifactId>datasource-proxy-spring-boot-starter</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>com.github.vertical-blank</groupId> + <artifactId>sql-formatter</artifactId> + <version>${sql-formatter.version}</version> + <scope>test</scope> + </dependency> + </dependencies> </project> diff --git a/webapp-tests/src/test/resources/application-test.properties b/webapp-tests/src/test/resources/application-test.properties new file mode 100644 index 0000000..b8d0687 --- /dev/null +++ b/webapp-tests/src/test/resources/application-test.properties @@ -0,0 +1,23 @@ +# One of logging libraries (slf4j, jul, common, sysout) +decorator.datasource.datasource-proxy.logging=slf4j + +decorator.datasource.datasource-proxy.query.enable-logging=true +decorator.datasource.datasource-proxy.query.log-level=debug +# Logger name to log all queries, default depends on chosen logging, e.g. net.ttddyy.dsproxy.listener.logging.SLF4JQueryLoggingListener +decorator.datasource.datasource-proxy.query.logger-name= + +decorator.datasource.datasource-proxy.slow-query.enable-logging=true +decorator.datasource.datasource-proxy.slow-query.log-level=warn +decorator.datasource.datasource-proxy.slow-query.logger-name= +# Number of seconds to consider query as slow and log it +decorator.datasource.datasource-proxy.slow-query.threshold=300 + +decorator.datasource.datasource-proxy.multiline=true + +# Formats the SQL for better readability. Uses Hibernate's formatter if present on the class path. If you opted in for a different JPA provider you need to add https://github.com/vertical-blank/sql-formatter as a runtime dependency to your app to enable this. +# Mutually exclusive with json-format=true +decorator.datasource.datasource-proxy.format-sql=false +decorator.datasource.datasource-proxy.json-format=false + +# Enable Query Metrics +decorator.datasource.datasource-proxy.count-query=false \ No newline at end of file diff --git a/webapp/pom.xml b/webapp/pom.xml index 5383f52..4e12c16 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -113,6 +113,17 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency> + + <dependency> + <groupId>com.github.gavlyukovskiy</groupId> + <artifactId>datasource-proxy-spring-boot-starter</artifactId> + </dependency> + + <dependency> + <groupId>com.github.vertical-blank</groupId> + <artifactId>sql-formatter</artifactId> + </dependency> + </dependencies> <profiles> diff --git a/webapp/src/main/java/petclinic/webapp/application/services/health/HealthCheckServiceImpl.java b/webapp/src/main/java/petclinic/webapp/application/services/health/HealthCheckServiceImpl.java index 816f4fc..b68eb4f 100644 --- a/webapp/src/main/java/petclinic/webapp/application/services/health/HealthCheckServiceImpl.java +++ b/webapp/src/main/java/petclinic/webapp/application/services/health/HealthCheckServiceImpl.java @@ -11,7 +11,7 @@ import org.apache.causeway.applib.services.health.HealthCheckService; import petclinic.modules.pets.dom.petowner.PetOwners; @Service -@Named("petclinic.HealthCheckServiceImpl") +@Named("app.petclinic.HealthCheckServiceImpl") public class HealthCheckServiceImpl implements HealthCheckService { private final PetOwners petOwners; diff --git a/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.java b/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.java index 22155af..a2731c7 100644 --- a/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.java +++ b/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.java @@ -17,7 +17,7 @@ import petclinic.modules.pets.dom.petowner.PetOwner; import petclinic.modules.pets.dom.petowner.PetOwnerRepository; import petclinic.modules.visits.dom.visit.VisitRepository; -@Named("petclinic.HomePageViewModel") +@Named("app.petclinic.HomePageViewModel") @DomainObject(nature = Nature.VIEW_MODEL) @HomePage @DomainObjectLayout() diff --git a/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.layout.xml b/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.layout.xml index 14eebe6..a815037 100644 --- a/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.layout.xml +++ b/webapp/src/main/java/petclinic/webapp/application/services/homepage/HomePageViewModel.layout.xml @@ -1,20 +1,24 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<bs3:grid xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns="http://isis.apache.org/applib/layout/component" xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<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:cpt="https://causeway.apache.org/applib/layout/component" + xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <bs3:row> <bs3:col span="12"> <bs3:row> <bs3:col span="12" unreferencedActions="true"> - <domainObject/> - <action id="bookVisit"/> - <action id="clearHints" hidden="EVERYWHERE"/> - <action id="impersonate" hidden="EVERYWHERE"/> - <action id="impersonateWithRoles" hidden="EVERYWHERE"/> - <action id="stopImpersonating" hidden="EVERYWHERE"/> - <action id="downloadLayoutXml" hidden="EVERYWHERE"/> - <action id="inspectMetamodel" hidden="EVERYWHERE"/> - <action id="rebuildMetamodel" hidden="EVERYWHERE"/> - <action id="downloadMetamodelXml" hidden="EVERYWHERE"/> - <action id="openRestApi" hidden="EVERYWHERE"/> + <cpt:domainObject/> + <cpt:action id="bookVisit"/> + <cpt:action id="clearHints" hidden="EVERYWHERE"/> + <cpt:action id="impersonate" hidden="EVERYWHERE"/> + <cpt:action id="impersonateWithRoles" hidden="EVERYWHERE"/> + <cpt:action id="stopImpersonating" hidden="EVERYWHERE"/> + <cpt:action id="downloadLayoutXml" hidden="EVERYWHERE"/> + <cpt:action id="inspectMetamodel" hidden="EVERYWHERE"/> + <cpt:action id="rebuildMetamodel" hidden="EVERYWHERE"/> + <cpt:action id="downloadMetamodelXml" hidden="EVERYWHERE"/> + <cpt:action id="openRestApi" hidden="EVERYWHERE"/> </bs3:col> </bs3:row> </bs3:col> @@ -23,20 +27,20 @@ <bs3:col span="12" unreferencedCollections="true"> <bs3:row> <bs3:col span="4"> - <collection id="petOwners" defaultView="table"/> + <cpt:collection id="petOwners" defaultView="table"/> </bs3:col> <bs3:col span="4"> - <collection id="pets" defaultView="table"/> + <cpt:collection id="pets" defaultView="table"/> </bs3:col> <bs3:col span="4"> - <collection id="visits" defaultView="table"/> + <cpt:collection id="visits" defaultView="table"/> </bs3:col> </bs3:row> </bs3:col> </bs3:row> <bs3:row> <bs3:col span="0"> - <fieldSet name="General" id="general" unreferencedProperties="true"/> + <cpt:fieldSet name="General" id="general" unreferencedProperties="true"/> </bs3:col> </bs3:row> </bs3:grid> diff --git a/webapp/src/main/java/petclinic/webapp/application/services/homepage/VisitPlusPetOwner.java b/webapp/src/main/java/petclinic/webapp/application/services/homepage/VisitPlusPetOwner.java index 6959ff0..f934d3f 100644 --- a/webapp/src/main/java/petclinic/webapp/application/services/homepage/VisitPlusPetOwner.java +++ b/webapp/src/main/java/petclinic/webapp/application/services/homepage/VisitPlusPetOwner.java @@ -17,7 +17,7 @@ import petclinic.modules.pets.dom.pet.Pet; import petclinic.modules.pets.dom.petowner.PetOwner; import petclinic.modules.visits.dom.visit.Visit; -@Named("petclinic.VisitPlusPetOwner") +@Named("app.petclinic.VisitPlusPetOwner") @DomainObject(nature=Nature.VIEW_MODEL) @DomainObjectLayout(named = "Visit") @XmlRootElement diff --git a/webapp/src/main/resources/application.yml b/webapp/src/main/resources/application.yml index 357fb01..84ba96d 100644 --- a/webapp/src/main/resources/application.yml +++ b/webapp/src/main/resources/application.yml @@ -40,7 +40,7 @@ causeway: application: about: PetClinic brand-logo-signin: images/apache-causeway/logo-banner-591x120.png - brand-logo-header: images/apache-causeway/logo-48x48.png + brand-logo-header: images/apache-causeway/logo-65x48.png favicon-url: images/favicon.png menubars-layout-file: menubars.layout.xml name: PetClinic @@ -68,11 +68,9 @@ causeway: api-variant: query_with_mutations_non_spec_compliant authentication: fallback: - username: sven + username: "graphql" roles: - - simple-superuser - - foo - - bar + - "org.apache.causeway.applib.services.sudo.SudoService#accessAll" testing: fixtures: diff --git a/webapp/src/main/resources/config/application-SQLSERVER.properties b/webapp/src/main/resources/config/application-SQLSERVER.properties index 561b8a4..cf4281e 100644 --- a/webapp/src/main/resources/config/application-SQLSERVER.properties +++ b/webapp/src/main/resources/config/application-SQLSERVER.properties @@ -25,7 +25,7 @@ spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver spring.datasource.username=petclinic spring.datasource.password=petclinic -#isis.persistence.schema.create-schema-sql-template= (use flyway instead) -isis.persistence.schema.auto-create-schemas= +#causeway.persistence.schema.create-schema-sql-template= (use flyway instead) +causeway.persistence.schema.auto-create-schemas= diff --git a/webapp/src/main/resources/config/application.properties b/webapp/src/main/resources/config/application.properties index 9c9143c..c56384e 100644 --- a/webapp/src/main/resources/config/application.properties +++ b/webapp/src/main/resources/config/application.properties @@ -14,8 +14,8 @@ spring.sql.init.platform=h2 spring.datasource.url=jdbc:h2:mem:petclinic;DATABASE_TO_UPPER=false spring.datasource.driver-class-name=org.h2.Driver -isis.persistence.schema.create-schema-sql-template=CREATE SCHEMA IF NOT EXISTS %s -isis.persistence.schema.auto-create-schemas=pets,visits +causeway.persistence.schema.create-schema-sql-template=CREATE SCHEMA IF NOT EXISTS %s +causeway.persistence.schema.auto-create-schemas=pets,visits #eclipselink.weaving=true eclipselink.deploy-on-startup=true @@ -25,7 +25,30 @@ eclipselink.create-ddl-jdbc-file-name=create-db-schema.sql eclipselink.application-location=. eclipselink.jpa.upper-case-column-names=false -# uncomment to run during bootstrap -#isis.testing.fixtures.initial-script = petclinic.webapp.application.fixture.scenarios.PetClinicDemo + + +# One of logging libraries (slf4j, jul, common, sysout) +decorator.datasource.datasource-proxy.logging=slf4j + +decorator.datasource.datasource-proxy.query.enable-logging=true +decorator.datasource.datasource-proxy.query.log-level=debug +# Logger name to log all queries, default depends on chosen logging, e.g. net.ttddyy.dsproxy.listener.logging.SLF4JQueryLoggingListener +decorator.datasource.datasource-proxy.query.logger-name= + +decorator.datasource.datasource-proxy.slow-query.enable-logging=true +decorator.datasource.datasource-proxy.slow-query.log-level=warn +decorator.datasource.datasource-proxy.slow-query.logger-name= +# Number of seconds to consider query as slow and log it +decorator.datasource.datasource-proxy.slow-query.threshold=300 + +decorator.datasource.datasource-proxy.multiline=true + +# Formats the SQL for better readability. Uses Hibernate's formatter if present on the class path. If you opted in for a different JPA provider you need to add https://github.com/vertical-blank/sql-formatter as a runtime dependency to your app to enable this. +# Mutually exclusive with json-format=true +decorator.datasource.datasource-proxy.format-sql=false +decorator.datasource.datasource-proxy.json-format=false + +# Enable Query Metrics +decorator.datasource.datasource-proxy.count-query=false \ No newline at end of file diff --git a/webapp/src/main/resources/menubars.layout.xml b/webapp/src/main/resources/menubars.layout.xml index ddf60ba..f9861a7 100644 --- a/webapp/src/main/resources/menubars.layout.xml +++ b/webapp/src/main/resources/menubars.layout.xml @@ -1,5 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<mb3:menuBars xsi:schemaLocation="http://isis.apache.org/applib/layout/menubars/bootstrap3 http://isis.apache.org/applib/layout/menubars/bootstrap3/menubars.xsd http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/links http://isis.apache.org/applib/layout/links/links.xsd" xmlns:cpt="http://isis.apache.org/applib/layout/component" xmlns:lnk="http://isis.apache.org/applib/layout/links" xmlns:mb3="h [...] +<mb3:menuBars + xsi:schemaLocation="https://causeway.apache.org/applib/layout/menubars/bootstrap3 https://causeway.apache.org/applib/layout/menubars/bootstrap3/menubars.xsd https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd" + xmlns:cpt="https://causeway.apache.org/applib/layout/component" + xmlns:mb3="https://causeway.apache.org/applib/layout/menubars/bootstrap3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <mb3:primary> <mb3:menu> <mb3:named>Pet Owners</mb3:named> @@ -19,63 +23,73 @@ <mb3:named>Prototyping</mb3:named> <mb3:section> <mb3:named>Fixtures</mb3:named> - <mb3:serviceAction objectType="isis.testing.fixtures.FixtureScripts" id="runFixtureScript"/> - <mb3:serviceAction objectType="isis.testing.fixtures.FixtureScripts" id="recreateObjectsAndReturnFirst"/> + <mb3:serviceAction objectType="causeway.testing.fixtures.FixtureScripts" id="runFixtureScript"/> + <mb3:serviceAction objectType="causeway.testing.fixtures.FixtureScripts" id="recreateObjectsAndReturnFirst"/> </mb3:section> <mb3:section> <mb3:named>Layouts</mb3:named> - <mb3:serviceAction objectType="isis.applib.LayoutServiceMenu" id="downloadLayouts"/> - <mb3:serviceAction objectType="isis.applib.LayoutServiceMenu" id="downloadMenuBarsLayout"/> + <mb3:serviceAction objectType="causeway.applib.LayoutServiceMenu" id="downloadLayouts"/> + <mb3:serviceAction objectType="causeway.applib.LayoutServiceMenu" id="downloadMenuBarsLayout"/> + <mb3:serviceAction objectType="causeway.ext.layoutGithub.LayoutLoaderMenu" id="enableDynamicLayoutLoading"/> + <mb3:serviceAction objectType="causeway.ext.layoutGithub.LayoutLoaderMenu" id="disableDynamicLayoutLoading"/> </mb3:section> <mb3:section> <mb3:named>Meta Model and Features</mb3:named> - <mb3:serviceAction objectType="isis.applib.MetaModelServiceMenu" id="downloadMetaModelXml"/> - <mb3:serviceAction objectType="isis.applib.MetaModelServiceMenu" id="downloadMetaModelCsv"/> - <mb3:serviceAction objectType="isis.applib.MetaModelServiceMenu" id="downloadMetaModelAscii"/> - <mb3:serviceAction objectType="isis.applib.MetaModelServiceMenu" id="downloadMetaModelDiff"/> - <mb3:serviceAction objectType="isis.feat.ApplicationFeatureMenu" id="allNamespaces"/> - <mb3:serviceAction objectType="isis.feat.ApplicationFeatureMenu" id="allTypes"/> - <mb3:serviceAction objectType="isis.feat.ApplicationFeatureMenu" id="allActions"/> - <mb3:serviceAction objectType="isis.feat.ApplicationFeatureMenu" id="allProperties"/> - <mb3:serviceAction objectType="isis.feat.ApplicationFeatureMenu" id="allCollections"/> + <mb3:serviceAction objectType="causeway.applib.MetaModelServiceMenu" id="downloadMetaModel"/> + <mb3:serviceAction objectType="causeway.applib.MetaModelServiceMenu" id="downloadMetaModelDiff"/> + <mb3:serviceAction objectType="causeway.feat.ApplicationFeatureMenu" id="allNamespaces"/> + <mb3:serviceAction objectType="causeway.feat.ApplicationFeatureMenu" id="allTypes"/> + <mb3:serviceAction objectType="causeway.feat.ApplicationFeatureMenu" id="allActions"/> + <mb3:serviceAction objectType="causeway.feat.ApplicationFeatureMenu" id="allProperties"/> + <mb3:serviceAction objectType="causeway.feat.ApplicationFeatureMenu" id="allCollections"/> </mb3:section> <mb3:section> <mb3:named>Persistence</mb3:named> - <mb3:serviceAction objectType="isis.persistence.jdo.JdoMetamodelMenu" id="downloadMetamodels"/> - <mb3:serviceAction objectType="isis.ext.h2Console.H2ManagerMenu" id="openH2Console"/> + <mb3:serviceAction objectType="causeway.persistence.jdo.JdoMetamodelMenu" id="downloadMetamodels"/> + <mb3:serviceAction objectType="causeway.ext.h2Console.H2ManagerMenu" id="openH2Console"/> </mb3:section> <mb3:section> <mb3:named>REST API</mb3:named> - <mb3:serviceAction objectType="isis.viewer.restfulobjects.SwaggerServiceMenu" id="openSwaggerUi"/> - <mb3:serviceAction objectType="isis.viewer.restfulobjects.SwaggerServiceMenu" id="openRestApi"/> - <mb3:serviceAction objectType="isis.viewer.restfulobjects.SwaggerServiceMenu" id="downloadSwaggerSchemaDefinition"/> + <mb3:serviceAction objectType="causeway.viewer.roRendering.SwaggerServiceMenu" id="openSwaggerUi"/> + <mb3:serviceAction objectType="causeway.viewer.roRendering.SwaggerServiceMenu" id="openRestApi"/> + <mb3:serviceAction objectType="causeway.viewer.roRendering.SwaggerServiceMenu" id="downloadSwaggerSchemaDefinition"/> </mb3:section> <mb3:section> <mb3:named>i18n</mb3:named> - <mb3:serviceAction objectType="isis.applib.TranslationServicePoMenu" id="downloadTranslations"/> - <mb3:serviceAction objectType="isis.applib.TranslationServicePoMenu" id="resetTranslationCache"/> - <mb3:serviceAction objectType="isis.applib.TranslationServicePoMenu" id="switchToReadingTranslations"/> - <mb3:serviceAction objectType="isis.applib.TranslationServicePoMenu" id="switchToWritingTranslations"/> + <mb3:serviceAction objectType="causeway.applib.TranslationServicePoMenu" id="downloadTranslations"/> + <mb3:serviceAction objectType="causeway.applib.TranslationServicePoMenu" id="resetTranslationCache"/> + <mb3:serviceAction objectType="causeway.applib.TranslationServicePoMenu" id="switchToReadingTranslations"/> + <mb3:serviceAction objectType="causeway.applib.TranslationServicePoMenu" id="switchToWritingTranslations"/> + </mb3:section> + <mb3:section> + <mb3:named>Manual Testing</mb3:named> + <mb3:serviceAction objectType="causeway.applib.SitemapServiceMenu" id="downloadSitemap" > + <cpt:named>Download Site-Map Template (Adoc)</cpt:named> + </mb3:serviceAction> </mb3:section> </mb3:menu> </mb3:secondary> <mb3:tertiary> <mb3:menu> <mb3:named/> + <mb3:section> + <mb3:named>Documentation</mb3:named> + <mb3:serviceAction objectType="causeway.ext.docgen.DocumentationMenu" id="help"/> + </mb3:section> <mb3:section> <mb3:named>Configuration</mb3:named> - <mb3:serviceAction objectType="isis.conf.ConfigurationMenu" id="configuration"/> + <mb3:serviceAction objectType="causeway.conf.ConfigurationMenu" id="configuration"/> </mb3:section> <mb3:section> <mb3:named>Impersonate</mb3:named> - <mb3:serviceAction objectType="isis.sudo.ImpersonateMenu" id="impersonate"/> - <mb3:serviceAction objectType="isis.sudo.ImpersonateMenu" id="impersonateWithRoles"/> - <mb3:serviceAction objectType="isis.applib.ImpersonateStopMenu" id="stopImpersonating"/> + <mb3:serviceAction objectType="causeway.sudo.ImpersonateMenu" id="impersonate"/> + <mb3:serviceAction objectType="causeway.sudo.ImpersonateMenu" id="impersonateWithRoles"/> + <mb3:serviceAction objectType="causeway.applib.ImpersonateStopMenu" id="stopImpersonating"/> </mb3:section> <mb3:section> <mb3:named>Security</mb3:named> - <mb3:serviceAction objectType="isis.applib.UserMenu" id="me"/> - <mb3:serviceAction objectType="isis.security.LogoutMenu" id="logout"/> + <mb3:serviceAction objectType="causeway.applib.UserMenu" id="me"/> + <mb3:serviceAction objectType="causeway.security.LogoutMenu" id="logout"/> </mb3:section> </mb3:menu> </mb3:tertiary> diff --git a/webapp/src/main/resources/shiro.ini b/webapp/src/main/resources/shiro.ini index 98daf81..03a729d 100644 --- a/webapp/src/main/resources/shiro.ini +++ b/webapp/src/main/resources/shiro.ini @@ -16,12 +16,13 @@ securityManager.realms = $iniRealm # user = password, role1, role2, role3, ... -sven = pass, admin_role +sven = pass, admin_role, org.apache.causeway.applib.services.sudo.SudoService#accessAll dick = pass, simple_role, default_role bob = pass, simple_role, default_role, fixtures_role joe = pass, simple_role, default_role guest = guest, guest_role, default_role +graphql = pass, org.apache.causeway.applib.services.sudo.SudoService#accessAll # ----------------------------------------------------------------------------- @@ -35,18 +36,17 @@ guest = guest, guest_role, default_role # role = perm1, perm2, perm3, ... # perm in format: logicalTypeNamespace:logicalTypeSimpleName:memberName:r,w -simple_role = pets -guest_role = pets:PetOwners:findByName:*,\ - pets:PetOwners:listAll:*,\ - pets:*:*:r admin_role = * -default_role = isis.applib,\ - isis.security -fixtures_role = isis.testing.fixtures -features_role = isis.feat -metamodel_role = isis.metamodel -h2_role = isis.ext.h2Console -jdo_role = isis.persistence.jdo -swagger_role = isis.viewer.restfulobjects -conf_role = isis.conf -sudo_role = isis.sudo +guest_role = app.pets:PetOwners:findByName:*,\ + app.pets:PetOwners:listAll:*,\ + app.pets:*:*:r +default_role = causeway.applib,\ + causeway.security +conf_role = causeway.conf +h2_role = causeway.ext.h2Console +features_role = causeway.feat +schema_role = causeway.schema +sudo_role = causeway.sudo +fixtures_role = causeway.testing.fixtures +jdo_role = causeway.persistence.jdo +swagger_role = causeway.viewer.roRendering diff --git a/webapp/src/main/resources/static/css/page.css b/webapp/src/main/resources/static/css/page.css index 487d6a8..3c2454c 100644 --- a/webapp/src/main/resources/static/css/page.css +++ b/webapp/src/main/resources/static/css/page.css @@ -25,3 +25,12 @@ th, td { margin: 8px auto; padding: 12px; } +.center { + display: block; + margin-left: auto; + margin-right: auto; +} +.centered-text { + font-size: larger; + text-align: center; +} diff --git a/webapp/src/main/resources/static/images/apache-causeway/logo-48x48.png b/webapp/src/main/resources/static/images/apache-causeway/logo-48x48.png deleted file mode 100644 index 08e012c..0000000 Binary files a/webapp/src/main/resources/static/images/apache-causeway/logo-48x48.png and /dev/null differ diff --git a/webapp/src/main/resources/static/index.html b/webapp/src/main/resources/static/index.html index 1728b16..0fa02cb 100644 --- a/webapp/src/main/resources/static/index.html +++ b/webapp/src/main/resources/static/index.html @@ -2,19 +2,24 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> - <title>Apache Isis™ PetClinic app</title> + <title>Apache Causeway™ PetClinic app</title> <link rel="stylesheet" type="text/css" href="css/page.css"> </head> <body> <div id="wrapper"> - <img alt="Isis Logo" src="images/apache-isis/logo.png" /> + <img alt="Causeway Logo" src="images/apache-causeway/logo.png" class="center" /> - <p> - This is a PetClinic app implemented as an <a href="http://isis.apache.org">Apache Isis</a> application. + <br/> + <br/> + <p class="centered-text"> + This is a PetClinic app implemented as an <a href="https://causeway.apache.org">Apache Causeway</a> application. <br/> </p> + <br/> + <br/> + <p>To access the app:</p> <ul> <li> @@ -43,13 +48,8 @@ </b> </p> <p> - provides access to a Swagger UI for convenient access - to (a subset of) the automatically generated REST API. - </p> - <p> - The full backend API (at <a href="restful/">restful/</a>) renders both simple and also richer - hypermedia representations of domain objects, the latter conforming to the - <a href="https://www.restfulobjects.org" target="_blank">Restful Objects</a> spec. + provides access to a Swagger UI for convenient access to (a subset of) the + automatically generated REST API (accessible at <a href="restful/">restful/</a>). </p> </li> </ul>
