From ea405457b370398bf9e476ffd6e39d5ffb534fdc Mon Sep 17 00:00:00 2001 From: quarkusbot Date: Wed, 4 Dec 2024 17:59:42 +0000 Subject: [PATCH] Sync web site with Quarkus documentation --- _guides/_attributes.adoc | 2 +- .../hibernate-search-orm-elasticsearch.adoc | 25 ++++++++----------- ...rnate-search-standalone-elasticsearch.adoc | 19 ++++++-------- _guides/qute-reference.adoc | 21 ++++++++++++---- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/_guides/_attributes.adoc b/_guides/_attributes.adoc index 5016d481380..3d30c1f6ef2 100644 --- a/_guides/_attributes.adoc +++ b/_guides/_attributes.adoc @@ -1,7 +1,7 @@ // Common attributes. // --> No blank lines (it ends the document header) :project-name: Quarkus -:quarkus-version: 3.17.2 +:quarkus-version: 3.17.3 :quarkus-platform-groupid: io.quarkus.platform // . :maven-version: 3.9.9 diff --git a/_guides/hibernate-search-orm-elasticsearch.adoc b/_guides/hibernate-search-orm-elasticsearch.adoc index 674de2b0c92..c856125afe8 100644 --- a/_guides/hibernate-search-orm-elasticsearch.adoc +++ b/_guides/hibernate-search-orm-elasticsearch.adoc @@ -627,32 +627,29 @@ Edit `src/main/resources/application.properties` and inject the following config [source,properties] ---- -quarkus.ssl.native=false <1> +quarkus.datasource.db-kind=postgresql <1> -quarkus.datasource.db-kind=postgresql <2> +quarkus.hibernate-orm.sql-load-script=import.sql <2> -quarkus.hibernate-orm.sql-load-script=import.sql <3> +quarkus.hibernate-search-orm.elasticsearch.version=8 <3> +quarkus.hibernate-search-orm.indexing.plan.synchronization.strategy=sync <4> -quarkus.hibernate-search-orm.elasticsearch.version=8 <4> -quarkus.hibernate-search-orm.indexing.plan.synchronization.strategy=sync <5> - -%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost/quarkus_test <6> +%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost/quarkus_test %prod.quarkus.datasource.username=quarkus_test %prod.quarkus.datasource.password=quarkus_test %prod.quarkus.hibernate-orm.database.generation=create -%prod.quarkus.hibernate-search-orm.elasticsearch.hosts=localhost:9200 <6> +%prod.quarkus.hibernate-search-orm.elasticsearch.hosts=localhost:9200 <5> ---- -<1> We won't use SSL, so we disable it to have a more compact native executable. -<2> Let's create a PostgreSQL datasource. -<3> We load some initial data on startup (see <>). -<4> We need to tell Hibernate Search about the version of Elasticsearch we will use. +<1> Let's create a PostgreSQL datasource. +<2> We load some initial data on startup (see <>). +<3> We need to tell Hibernate Search about the version of Elasticsearch we will use. It is important because there are significant differences between Elasticsearch mapping syntax depending on the version. Since the mapping is created at build time to reduce startup time, Hibernate Search cannot connect to the cluster to automatically detect the version. Note that, for OpenSearch, you need to prefix the version with `opensearch:`; see <>. -<5> This means that we wait for the entities to be searchable before considering a write complete. +<4> This means that we wait for the entities to be searchable before considering a write complete. On a production setup, the `write-sync` default will provide better performance. Using `sync` is especially important when testing as you need the entities to be searchable immediately. -<6> For development and tests, we rely on <>, +<5> For development and tests, we rely on <>, which means Quarkus will start a PostgreSQL database and Elasticsearch cluster automatically. In production mode, however, we will want to start a PostgreSQL database and Elasticsearch cluster manually, diff --git a/_guides/hibernate-search-standalone-elasticsearch.adoc b/_guides/hibernate-search-standalone-elasticsearch.adoc index bf2b4ef7dd1..fc4f742d8c1 100644 --- a/_guides/hibernate-search-standalone-elasticsearch.adoc +++ b/_guides/hibernate-search-standalone-elasticsearch.adoc @@ -559,31 +559,28 @@ Edit `src/main/resources/application.properties` and inject the following config [source,properties] ---- -quarkus.ssl.native=false <1> +quarkus.hibernate-search-standalone.mapping.structure=document <1> +quarkus.hibernate-search-standalone.elasticsearch.version=8 <2> +quarkus.hibernate-search-standalone.indexing.plan.synchronization.strategy=sync <3> -quarkus.hibernate-search-standalone.mapping.structure=document <2> -quarkus.hibernate-search-standalone.elasticsearch.version=8 <3> -quarkus.hibernate-search-standalone.indexing.plan.synchronization.strategy=sync <4> - -%prod.quarkus.hibernate-search-standalone.elasticsearch.hosts=localhost:9200 <5> +%prod.quarkus.hibernate-search-standalone.elasticsearch.hosts=localhost:9200 <4> ---- -<1> We won't use SSL, so we disable it to have a more compact native executable. -<2> We need to tell Hibernate Search about the structure of our entities. +<1> We need to tell Hibernate Search about the structure of our entities. + In this application we consider an indexed entity (the author) is the root of a "document": the author "owns" books it references through associations, which *cannot* be updated independently of the author. + See <> for other options and more details. -<3> We need to tell Hibernate Search about the version of Elasticsearch we will use. +<2> We need to tell Hibernate Search about the version of Elasticsearch we will use. + It is important because there are significant differences between Elasticsearch mapping syntax depending on the version. Since the mapping is created at build time to reduce startup time, Hibernate Search cannot connect to the cluster to automatically detect the version. Note that, for OpenSearch, you need to prefix the version with `opensearch:`; see <>. -<4> This means that we wait for the entities to be searchable before considering a write complete. +<3> This means that we wait for the entities to be searchable before considering a write complete. On a production setup, the `write-sync` default will provide better performance. Using `sync` is especially important when testing as you need the entities to be searchable immediately. -<5> For development and tests, we rely on <>, +<4> For development and tests, we rely on <>, which means Quarkus will start an Elasticsearch cluster automatically. In production mode, however, we will want to start an Elasticsearch cluster manually, diff --git a/_guides/qute-reference.adoc b/_guides/qute-reference.adoc index 4b62a037bd4..162103b1c31 100644 --- a/_guides/qute-reference.adoc +++ b/_guides/qute-reference.adoc @@ -2994,10 +2994,9 @@ If there is a message bundle method that accepts a single parameter of an enum t @Message <1> String methodName(MyEnum enum); ---- -<1> The value is intentionally not provided. There's also no key for the method in a localized file. - -Then it receives a generated template: +<1> The value is intentionally not provided. There's also no key/value pair for this method in a localized file. +Then it receives a generated template like: [source,html] ---- {#when enumParamName} @@ -3006,7 +3005,8 @@ Then it receives a generated template: {/when} ---- -Furthermore, a special message method is generated for each enum constant. Finally, each localized file must contain keys and values for all constant message keys: +Furthermore, a special message method is generated for each enum constant. +Finally, each localized file must contain keys and values for all enum constants: [source,poperties] ---- @@ -3014,7 +3014,18 @@ methodName_CONSTANT1=Value 1 methodName_CONSTANT2=Value 2 ---- -In a template, an enum constant can be localized with a message bundle method like `{msg:methodName(enumConstant)}`. +// We need to escape the first underscore +// See https://docs.asciidoctor.org/asciidoc/latest/subs/prevent/ +[IMPORTANT] +.Message keys for enum constants +==== +By default, the message key consists of the method name followed by the `\_` separator and the constant name. +If any constant name of a particular enum contains the `_` or the `$` character then the `\_$` separator must be used for all message keys for this enum instead. +For example, `methodName_$CONSTANT_1=Value 1` or `methodName_$CONSTANT$1=Value 1`. +A constant of a localized enum may not contain the `_$` separator. +==== + +In a template, the localized message for an enum constant can be obtained with a message bundle method like `{msg:methodName(enumConstant)}`. TIP: There is also <> - a convenient annotation to access enum constants in a template.