### Install Serve for Previewing Source: https://github.com/apache/causeway/blob/main/antora/components/conguide/modules/documentation/pages/building-docs-and-website.adoc Installs the 'serve' package globally using npm, which is used for previewing the generated static website. ```bash npm i -g serve@^13.0.2 ``` -------------------------------- ### Install Node.js and npm Source: https://github.com/apache/causeway/blob/main/antora/components/conguide/modules/documentation/pages/building-docs-and-website.adoc Installs Node.js and npm using apt. Ensure Node LTS is installed. ```bash sudo apt install nodejs sudo apt install npm ``` -------------------------------- ### Example Implementation of SpecificationAnd Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/applib/pages/index/spec/SpecificationAnd.adoc This example shows how to extend SpecificationAnd by providing the Specifications to be satisfied in the constructor. ```java public class MilkAndSugarSpec extends SpecificationAnd { public MilkAndSugarSpec() { super(new MustBeMilkySpec(), new TwoLumpsOfSugarSpec()); } } ``` -------------------------------- ### Install jq on Linux Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/merging-a-pull-request.adoc Installs the 'jq' utility on Linux systems using aptitude. This is a prerequisite for the `github-pr.sh` script. ```bash aptitude install jq ``` -------------------------------- ### Spring Datasource Configuration Example Source: https://github.com/apache/causeway/blob/main/antora/components/relnotes/modules/ROOT/pages/2021/2.0.0-M5/mignotes.adoc Example of configuring datasources using Spring properties. ```properties spring.datasource.platform=h2 spring.datasource.url=jdbc:h2:mem:... ``` -------------------------------- ### Install MVN Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/partials/verify-process-docker-container-prep.adoc Installs MVN (Maven wrapper) version 1.0.3 using SDKMAN. ```bash sdk install mvnd 1.0.3 ``` -------------------------------- ### Install Maven Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/partials/verify-process-docker-container-prep.adoc Installs Apache Maven version 3.9.11 using SDKMAN. ```bash sdk install maven 3.9.11 ``` -------------------------------- ### Datanucleus Settings Configuration Example Source: https://github.com/apache/causeway/blob/main/antora/components/relnotes/modules/ROOT/pages/2021/2.0.0-M5/mignotes.adoc Example of configuring Datanucleus settings using properties. ```properties datanucleus. ... javax.jdo. ... ``` -------------------------------- ### Choices for Property Example Source: https://github.com/apache/causeway/blob/main/antora/components/refguide/modules/applib-methods/partials/prefixes/choices.adoc Example of providing choices for a property. This method would return a collection of Product objects for the 'product' property. ```java import lombok.Getter; import lombok.Setter; public class ShoppingCartItem { @Property(editing = Editing.ENABLED) @Getter @Setter private Product product; public Collection choicesProduct() { // ... } // ... } ``` -------------------------------- ### Install jq on MacOS Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/merging-a-pull-request.adoc Installs the 'jq' utility on MacOS using Homebrew. This is a prerequisite for the `github-pr.sh` script. ```bash brew install jq ``` -------------------------------- ### Install pandoc using apt Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/release-process-prereqs.adoc Installs the pandoc document converter using the apt package manager. This is a tool for converting between markup formats. ```bash sudo apt update sudo apt install pandoc ``` -------------------------------- ### Install Java 21 using SDKMAN Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/release-process-prereqs.adoc Installs Java 21 using the SDKMAN tool. This is a prerequisite for building the project. ```bash sdk install java 21... ``` -------------------------------- ### Set up build prerequisites in a Docker container Source: https://github.com/apache/causeway/blob/main/antora/supplemental-ui/index.html Prepare a Docker container with the necessary Java and Maven versions for building Apache Causeway projects. This involves installing SDKMAN! and then using it to install Java and Maven. ```bash mkdir /tmp/causeway docker run -p8080:8080 -v /tmp/causeway:/tmp \ -it ubuntu:latest /bin/bash within the container, install the prereqs and continue as above: apt update && apt install -y curl zip unzip vim git curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" sdk install java 21.0.8-tem sdk install maven 3.9.11 sdk install mvnd 1.0.3 cd /tmp ``` -------------------------------- ### Install jq using apt Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/release-process-prereqs.adoc Installs the jq command-line JSON processor using the apt package manager. This is a utility for processing JSON data. ```bash sudo apt update sudo apt install jq ``` -------------------------------- ### Install dos2unix Source: https://github.com/apache/causeway/blob/main/antora/components/conguide/modules/documentation/pages/building-docs-and-website.adoc Installs the dos2unix utility using apt. This tool is used for converting line endings and is required for some documentation generation processes. ```bash sudo apt install dos2unix ``` -------------------------------- ### Example: autoComplete for Property Source: https://github.com/apache/causeway/blob/main/antora/components/refguide/modules/applib-methods/partials/prefixes/autoComplete.adoc Example demonstrating an autoComplete method for a property named 'product'. The @MinLength annotation requires at least 3 characters to be entered before searching. ```java import lombok.Getter; import lombok.Setter; public class ShoppingCartItem { @Getter @Setter private Product product; public Collection autoCompleteProduct( @MinLength(3) // <.> final String search ) { ... } ... } ``` -------------------------------- ### Example: autoComplete for Action Parameter Source: https://github.com/apache/causeway/blob/main/antora/components/refguide/modules/applib-methods/partials/prefixes/autoComplete.adoc Example demonstrating an autoComplete method for the 0th parameter of an action. The @MinLength annotation requires at least 3 characters to be entered before searching. ```java import lombok.Getter; import lombok.Setter; public class ShoppingCartItem { @Property(editing=Editing.DISABLED) @Getter @Setter private Product product; @Property(editing=Editing.DISABLED) @Getter @Setter private int quantity; @Action(semantics=SemanticsOf.IDEMPOTENT) public ShoppingCartItem updateProduct( final Product product, final int quantity) { // ... } public Collection autoComplete0UpdateProduct( // <.> @MinLength(3) // <.> final String search ) { // ... } // ... } ``` -------------------------------- ### Install Antora, Kroki, and Default Site Generator Source: https://github.com/apache/causeway/blob/main/antora/components/conguide/modules/documentation/pages/building-docs-and-website.adoc Installs Antora CLI, the default Antora site generator, and the asciidoctor-kroki extension globally using npm. This is required for building the documentation site. ```bash npm i -g @antora/cli@^3.1.1 @antora/site-generator-default@^3.1.1 asciidoctor-kroki ``` -------------------------------- ### Get Sub-Can from Start Index Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/commons/pages/index/collections/Can.adoc Returns a new Can containing elements from the specified start index to the end of the original Can. Out-of-bounds start indices are ignored. ```java this.subCan(startInclusive) ``` -------------------------------- ### Build helloworld starter app from source Source: https://github.com/apache/causeway/blob/main/antora/supplemental-ui/index.html Build the helloworld starter application from its GitHub repository. This involves downloading the source, installing dependencies, and running the build commands. ```bash APP=causeway-app-helloworld VER="3-jpa" # or "4-jpa" curl https://codeload.github.com/apache/$APP/zip/v$VER | jar xv cd $APP-$VER mvn clean install -Dskip.staging -Dskip.nightly mvn spring-boot:run ``` -------------------------------- ### Simple App Starter (JPA) Source: https://github.com/apache/causeway/blob/main/starters/adoc/modules/starters/pages/about.adoc This snippet shows the command to download and set up the Simple App starter application using JPA. ```bash mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.apache.causeway.app -DarchetypeArtifactId=causeway-app-archetype-simpleapp -DgroupId=com.example -DartifactId=myapp -Dversion=1.0.0-SNAPSHOT ``` -------------------------------- ### Example Specification Implementation Source: https://github.com/apache/causeway/blob/main/antora/components/refguide/modules/applib-classes/pages/spec.adoc An example implementation of the Specification interface for validating if a string starts with a capital letter. This example demonstrates a direct implementation of the Specification interface. ```java public class StartWithCapitalLetterSpecification implements Specification { public String satisfies(Object proposedObj) { String proposed = (String)proposedObj; // <1> return "".equals(proposed) ? "Empty string" : !Character.isUpperCase(proposed.charAt(0)) ? "Does not start with a capital letter" : null; } } ``` -------------------------------- ### HelloWorld Starter App (JPA) Source: https://github.com/apache/causeway/blob/main/starters/adoc/modules/starters/pages/about.adoc This snippet shows the command to download and set up the HelloWorld starter application using JPA. ```bash mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.apache.causeway.app -DarchetypeArtifactId=causeway-app-archetype-helloworld -DgroupId=com.example -DartifactId=myapp -Dversion=1.0.0-SNAPSHOT ``` -------------------------------- ### Declare Company Domain Object Source: https://github.com/apache/causeway/blob/main/viewers/wicket/adoc/modules/ROOT/pages/features/where-am-i.adoc Example of a basic domain object class. No specific setup is required beyond standard domain object annotations. ```java @DomainObject public class Company { /* ... */ } ``` -------------------------------- ### QueryRange Interface Definition Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/applib/pages/index/query/QueryRange.adoc Defines the API for managing query result ranges, including methods to check for unconstrained ranges, get start and limit values, and set range parameters. ```java interface QueryRange { boolean isUnconstrained() // <.> boolean hasOffset() // <.> boolean hasLimit() // <.> long getStart() // <.> long getLimit() // <.> long getEnd() // <.> int getStartAsInt() // <.> int getLimitAsInt() // <.> int getEndAsInt() // <.> QueryRange unconstrained() QueryRange start(long start) QueryRange limit(long limit) QueryRange of(long... range) QueryRange withStart(long start) QueryRange withLimit(long limit) } ``` -------------------------------- ### Property AutoComplete in Java Source: https://github.com/apache/causeway/blob/main/antora/components/userguide/modules/ROOT/partials/drop-down-and-defaults/auto-complete.adoc Example of an AutoComplete method for a property. The method name must start with 'autoComplete' and match the property name. The @MinLength annotation specifies the minimum characters required to trigger the search. ```java public class Order { @Property(editing = Editing.ENABLED) @Getter @Setter private Product product; public List autoCompleteProduct( @MinLength(2) String search) { return productRepository.findByReferenceOrName(search); } // ... } ``` -------------------------------- ### Checkout and Run Example Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/060-unit-testing.adoc Checks out a specific tag, builds the project, and runs the application with a development profile. This is useful for setting up the environment for testing. ```bash git checkout tags/{tag-version}/06-01-unit-test-bookVisit-default-time mvn clean install mvn -pl webapp spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev" ``` -------------------------------- ### Action AutoComplete in Java Source: https://github.com/apache/causeway/blob/main/antora/components/userguide/modules/ROOT/partials/drop-down-and-defaults/auto-complete.adoc Example of an AutoComplete method for an action. The method name must start with 'autoComplete', followed by a number (if it's not the first parameter), and then match the action name. It returns a collection of the parameter's type. ```java public class Customer { public Order invoice( ShoppingCart cart, String paymentMethod, DiscountVoucher voucher, LocalDate shipBy) { ... return this; } public List autoComplete2Invoice( @MinLength(2) String voucherCode) { return discountVoucherRepository.findByVoucherCode(this, voucherCode); } // ... } ``` -------------------------------- ### Checkout and Run Petclinic Demo Setup Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/020-the-petclinic-domain.adoc Checkout the specified tag, build the project, and run the application to set up demo data. ```bash git checkout tags/{tag-version}/02-05-setup-demo-petowners mvn clean install mvn -pl webapp spring-boot:run ``` -------------------------------- ### Setup and Run Project (Bash) Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/030-petowner-entity.adoc Commands to check out a specific version of the project, build it, and run the application with Spring profiles. ```bash git checkout tags/{tag-version}/03-10-use-meta-annotations-to-reduce-duplication mvn clean install mvn -pl webapp spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev" ``` -------------------------------- ### Build simpleapp starter app from source Source: https://github.com/apache/causeway/blob/main/antora/supplemental-ui/index.html Compile and run the simpleapp starter application from its source code. This process includes dependency management and building the web application module. ```bash APP=causeway-app-simpleapp VER="3-jpa" # or "4-jpa" curl https://codeload.github.com/apache/$APP/zip/v$VER | jar xv cd $APP-$VER mvn clean install -Dskip.staging -Dskip.nightly mvn -pl webapp spring-boot:run ``` -------------------------------- ### Remove Installer Source: https://github.com/apache/causeway/blob/main/retired/todo-deprecation-list.txt The *Installer components are removed. ```java // remove *Installer ``` -------------------------------- ### Install Antora CLI and Site Generator Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/release-process-prereqs.adoc Installs the Antora command-line interface and site generator globally using npm. Also installs asciidoctor-kroki and serve. ```bash npm i -g @antora/cli@^3.1.7 @antora/site-generator@^3.1.7 asciidoctor-kroki@0.17.0 npm i -g serve@^13.0.2 ``` -------------------------------- ### Checkout Tag and Build Starter App Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc After cloning the repository, checkout the specified tag for the initial starter app and then build the project using Maven. This ensures you have the correct starting point for the tutorial. ```bash git checkout tags/{tag-version}/01-01-starter-app mvn clean install ``` -------------------------------- ### Checkout Solution and Build Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/020-the-petclinic-domain.adoc Checkout the solution tag for Exercise 2.1 and build the project. This command sequence helps in setting up the initial state of the petowner module. ```bash git checkout tags/{tag-version}/02-01-copies-SimpleObject-to-PetOwner mvn clean install mvn -pl webapp spring-boot:run ``` -------------------------------- ### Install nvm and Node.js LTS Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/release-process-prereqs.adoc Installs Node Version Manager (nvm) and then installs the latest Long Term Support (LTS) version of Node.js. This is required for Antora. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash source ~/.bashrc nvm install --lts ``` -------------------------------- ### Checkout and Run Petclinic Example Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/020-the-petclinic-domain.adoc Checkout the specified tag, build the project, and run the application. ```bash git checkout tags/{tag-version}/02-04-update-menubar-for-petowners mvn clean install mvn -pl webapp spring-boot:run ``` -------------------------------- ### Installing DCEVM Source: https://github.com/apache/causeway/blob/main/antora/components/setupguide/modules/intellij/partials/faster-turnaround-times.txt This command executes the DCEVM installer JAR. It's crucial to run this with appropriate privileges (e.g., as Administrator on Windows) to allow modification of JDK installation directories. ```bash java -jar DCEVM-light-8u51-installer.jar ``` -------------------------------- ### Install Project Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/020-the-petclinic-domain.adoc Confirms that the project builds successfully after adding the new petowner module. This is a verification step. ```bash mvn install ``` -------------------------------- ### Project Structure Source: https://github.com/apache/causeway/blob/main/starters/adoc/modules/starters/pages/helloworld.adoc Overview of the Maven module structure for the Hello World starter application, highlighting key packages and files. ```text src/main/java/ domainapp/ modules hello/ dom/ hwo/ HelloWorldObject.java HelloWorldObject.layout.xml HelloWorldObject.png HelloWorldObjectRepository.java HelloWorldObjects.java types/ Name.java Notes.java HelloWorldModule.java webapp/ AppManifest.java HelloWorldApp.java ``` -------------------------------- ### Install GnuPG on Windows Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/cutting-a-release.adoc Install a specific version of GnuPG using Chocolatey for Windows. ```powershell choco install gnupg -version 2.3.7 ``` -------------------------------- ### Checkout and Build Example Code Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/050-visit-entity.adoc Use git to checkout a specific tag and then build the project with Maven. Finally, run the application using Maven, activating the 'dev' Spring profile. ```bash git checkout tags/{tag-version}/05-03-visit-entity-key-properties mvn clean install mvn -pl webapp spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev" ``` -------------------------------- ### Setup Restful Client with Basic-Auth Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/viewer/pages/index/restfulobjects/client/RestfulClient.adoc Configure and build a RestfulClient instance with basic authentication credentials and enable request debug logging. ```java var clientConfig = RestfulClientConfig.builder(); .restfulBaseUrl("http://localhost:8080/helloworld/restful/") .authenticationMode(AuthenticationMode.BASIC) .basicAuthUser("sven") .basicAuthPassword("pass") .useRequestDebugLogging(true) // default = false .build(); RestfulClient client = RestfulClient.ofConfig(clientConfig); ``` -------------------------------- ### Test HelloWorld Starter Application (JPA) Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/verifying-releases.adoc Runs the HelloWorld starter application built with JPA. This command navigates into the application directory and starts the Spring Boot application. ```bash pushd causeway-app-helloworld-jpa mvn spring-boot:run popd ``` -------------------------------- ### Customer Action Example Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/applib/pages/index/services/eventbus/hooks/EventBusService_020-examples-and-usage.adoc An example of a Customer class with an action that will propagate a default ActionDomainEvent. ```java public class Customer { @Action() public Customer placeOrder( Product product, int quantity) { ... } ... } ``` -------------------------------- ### Setup and Run Project for Validation Exercise (Bash) Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/030-petowner-entity.adoc Commands to check out the validation exercise branch, build the project, and run the application. ```bash git checkout tags/{tag-version}/03-11-validation-rules-using-metaannotations mvn clean install mvn -pl webapp spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev" ``` -------------------------------- ### Test SimpleApp Starter Application (JPA) Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/verifying-releases.adoc Runs the SimpleApp starter application built with JPA. This command navigates into the application directory and starts the Spring Boot application, specifically targeting the webapp module. ```bash pushd causeway-app-simpleapp-jpa mvn -pl webapp spring-boot:run popd ``` -------------------------------- ### Example Object Collection URL Source: https://github.com/apache/causeway/blob/main/viewers/restfulobjects/adoc/modules/ROOT/pages/content-negotiation/simplified-representations/object-collection.adoc This is an example of a URL that would access a domain object collection. ```http http://localhost:8080/restful/objects/TODO/45/collections/similarTo ``` -------------------------------- ### UserCreatedEvent Listener Example Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/extensions/pages/index/secman/applib/user/events/UserCreatedEvent.adoc Example of how to listen for the UserCreatedEvent and execute business logic within the listener. ```java @Component public class Listener { @EventListener(UserCreatedEvent.class) public void listenOn(UserCreatedEvent event) { // business logic ... } } ``` -------------------------------- ### Checkout and Build Integration Test Example Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/090-integration-testing.adoc Checks out a specific tag for integration testing and builds the project. ```bash git checkout tags/{tag-version}/09-01-bookVisit-integ-test mvn clean install ``` -------------------------------- ### Clone the Apache Causeway PetClinic Starter Repo Source: https://github.com/apache/causeway/blob/main/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc Use this command to clone the starter application repository from GitHub. This is the first step in setting up the project for the tutorial. ```bash git clone https://github.com/apache/causeway-app-petclinic ``` -------------------------------- ### Clone and Build SimpleApp JPA Starter Source: https://github.com/apache/causeway/blob/main/starters/adoc/modules/starters/pages/simpleapp-script-jpa.adoc Clones the SimpleApp JPA starter project from GitHub, extracts it, and builds it using Maven. ```bash curl https://codeload.github.com/apache/causeway-app-simpleapp/zip/v{fwk-version}-jpa | jar xv cd causeway-app-simpleapp-{fwk-version}-jpa mvn clean install ``` -------------------------------- ### Install SDKMAN Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/partials/verify-process-docker-container-prep.adoc Downloads and installs SDKMAN, a tool for managing parallel versions of multiple Software Development Kits. ```bash curl -s "https://get.sdkman.io" | bash ``` -------------------------------- ### Build and Serve Website Source: https://github.com/apache/causeway/blob/main/antora/components/conguide/modules/documentation/pages/building-docs-and-website.adoc Builds the entire website using Antora and serves it locally for preview. This is the default behavior of the preview.sh script. ```bash preview.sh ``` -------------------------------- ### Run helloworld starter app locally Source: https://github.com/apache/causeway/blob/main/antora/supplemental-ui/index.html Quickly test the Apache Causeway framework using the minimal helloworld starter application. This command pulls and runs the latest version of the application in a Docker container. ```bash docker run -p 8080:8080 apache/causeway-app-helloworld:latest ``` -------------------------------- ### PanelAbstract migration example Source: https://github.com/apache/causeway/blob/main/antora/components/relnotes/modules/ROOT/pages/2021/2.0.0-M5/mignotes.adoc Example of migrating a `PanelAbstract` implementation to use the new two generic type arguments. ```java MyPanel extends PanelAbstract> ``` -------------------------------- ### Download and Build Hello World JPA App Source: https://github.com/apache/causeway/blob/main/starters/adoc/modules/starters/pages/helloworld-script-jpa.adoc Download the Hello World JPA application archive, extract it, navigate into the project directory, and then build and run the application using Maven. ```bash curl https://codeload.github.com/apache/causeway-app-helloworld/zip/v{fwk-version}-jpa | jar xv cd causeway-app-helloworld-{fwk-version}-jpa mvn clean install mvn spring-boot:run ``` -------------------------------- ### Create Database and Login for SimpleApp Source: https://github.com/apache/causeway/blob/main/starters/adoc/modules/starters/pages/simpleapp.adoc SQL script to create the 'simpleapp' database and a corresponding login with password 'simpleapp'. It then sets the authorization for the database to the new login. ```sql CREATE DATABASE [simpleapp] go CREATE LOGIN [simpleapp] WITH PASSWORD=N'simpleapp', DEFAULT_DATABASE=[simpleapp], CHECK_EXPIRATION=OFF CHECK_POLICY=OFF go USE [simpleapp] GO ALTER AUTHORIZATION ON DATABASE::[simpleapp] TO [simpleapp] GO ``` -------------------------------- ### Example URL with Suppressed Header and Footer Source: https://github.com/apache/causeway/blob/main/viewers/wicket/adoc/modules/ROOT/pages/customisation/embedded-view.adoc This example demonstrates how to combine both parameters to suppress both the header and footer for an embedded view. ```ini http://localhost:8080/wicket/entity/TODO:0?causeway.no.header&causeway.no.footer ``` -------------------------------- ### FontAwesomeLayers Quick Notation Example Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/applib/pages/index/fa/FontAwesomeLayers.adoc Illustrates the quick notation format for creating FontAwesomeLayers instances, useful for defining icon stacks with specific classes and positions. ```text solid person-walking-arrow-right .my-color, solid scale-balanced .my-color .bottom-right-overlay ``` -------------------------------- ### Example Content-Type Header for Simplified Representation Source: https://github.com/apache/causeway/blob/main/viewers/restfulobjects/adoc/modules/ROOT/pages/content-negotiation/simplified-representations/object-collection.adoc This is an example of a Content-Type header that specifies the simplified JSON representation for object collections. ```http Content-Type: application/json;profile="urn:org.apache.causeway/v2";repr-type="object-collection" ``` -------------------------------- ### Enable Prototyping Mode via System Property Source: https://github.com/apache/causeway/blob/main/core/config/src/main/adoc/modules/config/pages/about.adoc Use the '-DPROTOTYPING=true' system property to enable prototyping mode. This is an alternative to using an environment variable. ```bash -DPROTOTYPING=true ``` -------------------------------- ### Choices for Action Parameter Example Source: https://github.com/apache/causeway/blob/main/antora/components/refguide/modules/applib-methods/partials/prefixes/choices.adoc Example of providing choices for the quantity parameter in an action. The choices are a predefined list of integers. ```java import lombok.Getter; import lombok.Setter; public class ShoppingCartItem { @Property(editing=Editing.DISABLED) @Getter @Setter private Product product; @Property(editing=Editing.DISABLED) @Getter @Setter private int quantity; @Action(semantics=SemanticsOf.IDEMPOTENT) public ShoppingCartItem updateProduct( Product product, final Integer quantity) { // ... } public Collection choices1UpdateProduct() { return Arrays.asList(1,2,3,5,10,25,50,100); } // ... } ``` -------------------------------- ### Implement HintIdProvider Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/applib/pages/index/services/hint/hooks/HintIdProvider_020-examples-and-usage.adoc Example of a view model wrapping a Customer and its Orders, implementing HintIdProvider. The hintId() method provides a bookmark for the customer. ```java @XmlRootElement("customerAndOrders") @XmlAccessType(FIELD) public class CustomerAndOrders implements HintStore.HintIdProvider { @Getter @Setter private Customer customer; // ... @Programmatic public String hintId() { bookmarkService.bookmarkFor(getCustomer()).toString(); } @XmlTransient @Inject BookmarkService bookmarkService; } ``` -------------------------------- ### Install Groovy 3.0.21 using SDKMAN Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/release-process-prereqs.adoc Installs Groovy version 3.0.21 using the SDKMAN tool. This is a prerequisite for building the project. ```bash sdk install groovy 3.0.21 ``` -------------------------------- ### Install Maven 3.9.7 using SDKMAN Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/release-process-prereqs.adoc Installs Maven version 3.9.7 using the SDKMAN tool. This is a prerequisite for building the project. ```bash sdk install maven 3.9.7 ``` -------------------------------- ### Update and Install Packages Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/partials/verify-process-docker-container-prep.adoc Updates the package list and installs essential tools like curl, zip, unzip, and vim in the container. ```bash apt update && apt install -y curl zip unzip vim ``` -------------------------------- ### Tabular Model Example Source: https://github.com/apache/causeway/blob/main/extensions/vw/tabular/adoc/modules/tabular/pages/about.adoc Demonstrates the creation of a TabularModel with columns and rows using basic building blocks like Cell, Column, and Row. ```java import org.apache.causeway.commons.tabular.*; import org.apache.causeway.commons.collections.Can; // create a TabularModel with 2 columns and 2 rows .. var col1 = new TabularModel.TabularColumn(0, "Col-1", "Column Description 1"); ``` -------------------------------- ### Query Default Example Source: https://github.com/apache/causeway/blob/main/antora/components/relnotes/modules/ROOT/pages/2021/2.0.0-M5/mignotes.adoc Demonstrates the new syntax for creating named queries with parameters, replacing the removed QueryDefault class. ```java QueryDefault (removed) | [line-through]#new QueryDefault<>(CommandJdo.class, "findByParent", "parent", parent));# Query.named(CommandJdo.class, "findByParent") + .withParameter("parent", parent)); ``` -------------------------------- ### AppManifest Abstract Class Example Source: https://github.com/apache/causeway/blob/main/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M3/mignotes.adoc Example of an AppManifest implementation that builds IsisConfiguration from the AppManifest itself. This is required if the AppConfig is to be picked up using CDI. ```java public class HelloWorldAppManifest extends AppManifestAbstract implements AppConfig { // <2> ... @Override public IsisConfiguration isisConfiguration () { return IsisConfiguration.buildFromAppManifest(this); } } ``` -------------------------------- ### Build and Serve Antora Only Source: https://github.com/apache/causeway/blob/main/antora/components/conguide/modules/documentation/pages/building-docs-and-website.adoc Runs only Antora generation and serves the site. Use this option to skip other documentation generation steps. ```bash preview.sh -AS ``` -------------------------------- ### Generate website preview Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/post-release-successful.adoc Run the preview script to generate the website in the antora/target/site directory. ```bash ./preview.sh -AS ``` -------------------------------- ### Find Background and Not Yet Started Commands Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/extensions/pages/index/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.adoc Returns any persisted commands that have not yet started execution. Useful for identifying pending background tasks. ```java List findBackgroundAndNotYetStarted() ``` -------------------------------- ### Build Framework Source: https://github.com/apache/causeway/blob/main/antora/components/comguide/modules/ROOT/pages/post-release-successful.adoc Builds the framework, skipping tests and enabling GitHub integration. ```bash mvnd clean install -DskipTests -Dgithub ``` -------------------------------- ### Example Log Output with DuplicateMessageFilter Source: https://github.com/apache/causeway/blob/main/antora/components/userguide/modules/btb/pages/logging.adoc This example shows how log messages appear when the `DuplicateMessageFilter` is active, highlighting repeated messages and the summary count. ```txt ... 07:37:09.992 ...ObjectActionDefault : Executing: org.apache.isis.extensions.executionoutbox.applib.restapi.OutboxRestApi#pending() ... 07:37:47.865 ...DuplicateMessageFilter: ... repeated 3 times ... 07:37:47.865 ...ObjectActionMixedIn : Executing: org.apache.isis.extensions.secman.applib.user.menu.MeService#me() ... 07:37:49.984 ...ObjectActionDefault : Executing: org.apache.isis.extensions.executionoutbox.applib.restapi.OutboxRestApi#pending() ``` -------------------------------- ### Warehouse Entity Example with persistAndFlush Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/applib/pages/index/services/repository/hooks/RepositoryService_020-examples-and-usage.adoc Example demonstrating the usage of `persistAndFlush` within an action method of a Warehouse entity to add an excluded product. ```java public abstract class Warehouse extends SalesVIPEntity { @Persistent(mappedBy = "marketplace", dependentElement = "true") @Getter @Setter SortedSet excludedProducts = new TreeSet(); @Action(semantics = SemanticsOf.IDEMPOTENT) public MarketplaceExcludedProduct addExcludedProduct(final Product product) { val marketplaceExcludedProduct = findExcludedProduct(product); if (marketplaceExcludedProduct == null) { marketplaceExcludedProduct = repositoryService.detachedEntity( new MarketplaceExcludedProduct.builder() .marketPlace(this) .product(product) .build()); } repositoryService.persistAndFlush(marketplaceExcludedProduct); // <.> return marketplaceExcludedProduct; } @Action(semantics = SemanticsOf.IDEMPOTENT) public void removeExcludedProducts(final Product product) { val marketplaceExcludedProduct = findExcludedProduct(product); if (marketplaceExcludedProduct != null) { repositoryService.removeAndFlush(marketplaceExcludedProduct); } } ... ``` -------------------------------- ### Enable Action Execution Publishing Source: https://github.com/apache/causeway/blob/main/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Action_025-execution-publishing.adoc This example demonstrates how to explicitly enable execution publishing for an action, ensuring it is published regardless of the global configuration. ```java public class Order { @Action(executionPublishing=Publishing.ENABLED) // <.> public Invoice generateInvoice(...) { // ... } } // <.> because set to enabled, will be published irrespective of the configured value. ```