This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 117ccb9ad405483e807176534c724ba520ee0f53 Author: Craig Ziesman <[email protected]> AuthorDate: Fri Sep 8 10:01:38 2023 -0500 Added auto-generated new files and updated files due to new Thymeleaf component --- .../org/apache/camel/catalog/components.properties | 1 + .../apache/camel/catalog/components/thymeleaf.json | 49 ++ .../apache/camel/catalog/schemas/camel-spring.xsd | 2 +- .../org/apache/camel/main/components.properties | 1 + .../modules/ROOT/examples/json/thymeleaf.json | 1 + docs/components/modules/ROOT/nav.adoc | 1 + .../modules/ROOT/pages/thymeleaf-component.adoc | 1 + .../component/ComponentsBuilderFactory.java | 13 + .../dsl/ThymeleafComponentBuilderFactory.java | 121 +++++ .../src/generated/resources/metadata.json | 22 + .../builder/endpoint/EndpointBuilderFactory.java | 1 + .../camel/builder/endpoint/EndpointBuilders.java | 1 + .../builder/endpoint/StaticEndpointBuilders.java | 55 +++ .../dsl/ThymeleafEndpointBuilderFactory.java | 536 +++++++++++++++++++++ .../camel-component-known-dependencies.properties | 1 + 15 files changed, 805 insertions(+), 1 deletion(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties index b6e196d2221..d541e37e79c 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties @@ -295,6 +295,7 @@ string-template stub telegram thrift +thymeleaf tika timer twilio diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/thymeleaf.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/thymeleaf.json new file mode 100644 index 00000000000..07f99ce1ed7 --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/thymeleaf.json @@ -0,0 +1,49 @@ +{ + "component": { + "kind": "component", + "name": "thymeleaf", + "title": "Thymeleaf", + "description": "Transform messages using a Thymeleaf template.", + "deprecated": false, + "firstVersion": "1.0.0", + "label": "transformation", + "javaType": "org.apache.camel.component.thymeleaf.ThymeleafComponent", + "supportLevel": "Stable", + "groupId": "org.apache.camel", + "artifactId": "camel-thymeleaf", + "version": "4.1.0-SNAPSHOT", + "scheme": "thymeleaf", + "extendsScheme": "", + "syntax": "thymeleaf:templatePath", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false + }, + "componentProperties": { + "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] + "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] + }, + "headers": { + "CamelThymeleafResourceUri": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the Thymeleaf template.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_RESOURCE_URI" }, + "CamelThymeleafTemplate": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content of the Thymeleaf template.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_TEMPLATE" }, + "CamelThymeleafVariableMap": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, Object>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The value of this header should be a Map with key\/values that will be override any existing key with the same name. This can be used to preconfigure common key\/values you want to reuse in your Thymeleaf endpoints.", "cons [...] + "CamelThymeleafServletContext": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "jakarta.servlet.ServletContext", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ServletContext for a web application.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_SERVLET_CONTEXT" } + }, + "properties": { + "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Path to the resource. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will look [...] + "allowContextMapAll": { "index": 1, "kind": "parameter", "displayName": "Allow Context Map All", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether the context map should allow access to all details. By default only the message body and headers can be accessed. This option can be enabled for full access to the current Exchange and C [...] + "cacheable": { "index": 2, "kind": "parameter", "displayName": "Cacheable", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether templates have to be considered cacheable or not." }, + "cacheTimeToLive": { "index": 3, "kind": "parameter", "displayName": "Cache Time To Live", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "The cache Time To Live for templates, expressed in milliseconds." }, + "checkExistence": { "index": 4, "kind": "parameter", "displayName": "Check Existence", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether a template resources will be checked for existence before being returned." }, + "contentCache": { "index": 5, "kind": "parameter", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether to use resource content cache or not" }, + "encoding": { "index": 6, "kind": "parameter", "displayName": "Encoding", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The character encoding to be used for reading template resources." }, + "order": { "index": 7, "kind": "parameter", "displayName": "Order", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "The order in which this template will be resolved as part of the resolver chain." }, + "prefix": { "index": 8, "kind": "parameter", "displayName": "Prefix", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional prefix added to template names to convert them into resource names." }, + "resolver": { "index": 9, "kind": "parameter", "displayName": "Resolver", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.thymeleaf.ThymeleafResolverType", "enum": [ "CLASS_LOADER", "DEFAULT", "FILE", "STRING", "URL", "WEB_APP" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CLASS_LOADER", "description": "The type of resolver to be used by the template engine." }, + "suffix": { "index": 10, "kind": "parameter", "displayName": "Suffix", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional suffix added to template names to convert them into resource names." }, + "templateMode": { "index": 11, "kind": "parameter", "displayName": "Template Mode", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The template mode to be applied to templates." }, + "lazyStartProducer": { "index": 12, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...] + } +} diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd index 4572bd2431d..6ef43282182 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd @@ -439,7 +439,7 @@ Enriches a message with data from a secondary resource <xs:annotation> <xs:documentation xml:lang="en"> <![CDATA[ -Camel error handling. +Error handler settings ]]> </xs:documentation> </xs:annotation> diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties index b6e196d2221..d541e37e79c 100644 --- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties +++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties @@ -295,6 +295,7 @@ string-template stub telegram thrift +thymeleaf tika timer twilio diff --git a/docs/components/modules/ROOT/examples/json/thymeleaf.json b/docs/components/modules/ROOT/examples/json/thymeleaf.json new file mode 120000 index 00000000000..bfb96cbe841 --- /dev/null +++ b/docs/components/modules/ROOT/examples/json/thymeleaf.json @@ -0,0 +1 @@ +../../../../../../components/camel-thymeleaf/src/generated/resources/org/apache/camel/component/thymeleaf/thymeleaf.json \ No newline at end of file diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index b74c494422c..eb4b6b1bcb2 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -299,6 +299,7 @@ ** xref:stub-component.adoc[Stub] ** xref:telegram-component.adoc[Telegram] ** xref:thrift-component.adoc[Thrift] +** xref:thymeleaf-component.adoc[Thymeleaf] ** xref:tika-component.adoc[Tika] ** xref:timer-component.adoc[Timer] ** xref:twilio-component.adoc[Twilio] diff --git a/docs/components/modules/ROOT/pages/thymeleaf-component.adoc b/docs/components/modules/ROOT/pages/thymeleaf-component.adoc new file mode 120000 index 00000000000..1e2dda48415 --- /dev/null +++ b/docs/components/modules/ROOT/pages/thymeleaf-component.adoc @@ -0,0 +1 @@ +../../../../../components/camel-thymeleaf/src/main/docs/thymeleaf-component.adoc \ No newline at end of file diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index f95592f16c9..96899f9b5bf 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -3985,6 +3985,19 @@ public interface ComponentsBuilderFactory { static org.apache.camel.builder.component.dsl.ThriftComponentBuilderFactory.ThriftComponentBuilder thrift() { return org.apache.camel.builder.component.dsl.ThriftComponentBuilderFactory.thrift(); } + /** + * Thymeleaf (camel-thymeleaf) + * Transform messages using a Thymeleaf template. + * + * Category: transformation + * Since: 1.0 + * Maven coordinates: org.apache.camel:camel-thymeleaf + * + * @return the dsl builder + */ + static org.apache.camel.builder.component.dsl.ThymeleafComponentBuilderFactory.ThymeleafComponentBuilder thymeleaf() { + return org.apache.camel.builder.component.dsl.ThymeleafComponentBuilderFactory.thymeleaf(); + } /** * Tika (camel-tika) * Parse documents and extract metadata and text using Apache Tika. diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ThymeleafComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ThymeleafComponentBuilderFactory.java new file mode 100644 index 00000000000..ec1a8ec3780 --- /dev/null +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ThymeleafComponentBuilderFactory.java @@ -0,0 +1,121 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.builder.component.dsl; + +import javax.annotation.processing.Generated; +import org.apache.camel.Component; +import org.apache.camel.builder.component.AbstractComponentBuilder; +import org.apache.camel.builder.component.ComponentBuilder; +import org.apache.camel.component.thymeleaf.ThymeleafComponent; + +/** + * Transform messages using a Thymeleaf template. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.ComponentDslMojo") +public interface ThymeleafComponentBuilderFactory { + + /** + * Thymeleaf (camel-thymeleaf) + * Transform messages using a Thymeleaf template. + * + * Category: transformation + * Since: 1.0 + * Maven coordinates: org.apache.camel:camel-thymeleaf + * + * @return the dsl builder + */ + static ThymeleafComponentBuilder thymeleaf() { + return new ThymeleafComponentBuilderImpl(); + } + + /** + * Builder for the Thymeleaf component. + */ + interface ThymeleafComponentBuilder + extends + ComponentBuilder<ThymeleafComponent> { + /** + * Whether the producer should be started lazy (on the first message). + * By starting lazy you can use this to allow CamelContext and routes to + * startup in situations where a producer may otherwise fail during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default ThymeleafComponentBuilder lazyStartProducer( + boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * Whether autowiring is enabled. This is used for automatic autowiring + * options (the option must be marked as autowired) by looking up in the + * registry to find if there is a single instance of matching type, + * which then gets configured on the component. This can be used for + * automatic configuring JDBC data sources, JMS connection factories, + * AWS Clients, etc. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: advanced + * + * @param autowiredEnabled the value to set + * @return the dsl builder + */ + default ThymeleafComponentBuilder autowiredEnabled( + boolean autowiredEnabled) { + doSetProperty("autowiredEnabled", autowiredEnabled); + return this; + } + } + + class ThymeleafComponentBuilderImpl + extends + AbstractComponentBuilder<ThymeleafComponent> + implements + ThymeleafComponentBuilder { + @Override + protected ThymeleafComponent buildConcreteComponent() { + return new ThymeleafComponent(); + } + @Override + protected boolean setPropertyOnComponent( + Component component, + String name, + Object value) { + switch (name) { + case "lazyStartProducer": ((ThymeleafComponent) component).setLazyStartProducer((boolean) value); return true; + case "autowiredEnabled": ((ThymeleafComponent) component).setAutowiredEnabled((boolean) value); return true; + default: return false; + } + } + } +} \ No newline at end of file diff --git a/dsl/camel-componentdsl/src/generated/resources/metadata.json b/dsl/camel-componentdsl/src/generated/resources/metadata.json index b2b34ae56b5..c74c2d9a7b9 100644 --- a/dsl/camel-componentdsl/src/generated/resources/metadata.json +++ b/dsl/camel-componentdsl/src/generated/resources/metadata.json @@ -6588,6 +6588,28 @@ "producerOnly": false, "lenientProperties": false }, + "ThymeleafComponentBuilderFactory": { + "kind": "component", + "name": "thymeleaf", + "title": "Thymeleaf", + "description": "Transform messages using a Thymeleaf template.", + "deprecated": false, + "firstVersion": "1.0.0", + "label": "transformation", + "javaType": "org.apache.camel.component.thymeleaf.ThymeleafComponent", + "supportLevel": "Stable", + "groupId": "org.apache.camel", + "artifactId": "camel-thymeleaf", + "version": "4.1.0-SNAPSHOT", + "scheme": "thymeleaf", + "extendsScheme": "", + "syntax": "thymeleaf:templatePath", + "async": false, + "api": false, + "consumerOnly": false, + "producerOnly": true, + "lenientProperties": false + }, "TikaComponentBuilderFactory": { "kind": "component", "name": "tika", diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java index fd487c3abcd..9e0c2add79a 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java @@ -311,6 +311,7 @@ public interface EndpointBuilderFactory org.apache.camel.builder.endpoint.dsl.SwiftEndpointBuilderFactory.SwiftBuilders, org.apache.camel.builder.endpoint.dsl.TelegramEndpointBuilderFactory.TelegramBuilders, org.apache.camel.builder.endpoint.dsl.ThriftEndpointBuilderFactory.ThriftBuilders, + org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory.ThymeleafBuilders, org.apache.camel.builder.endpoint.dsl.TikaEndpointBuilderFactory.TikaBuilders, org.apache.camel.builder.endpoint.dsl.TimerEndpointBuilderFactory.TimerBuilders, org.apache.camel.builder.endpoint.dsl.Timestream2EndpointBuilderFactory.Timestream2Builders, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java index 593df8dcf6b..581ded9343e 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java @@ -308,6 +308,7 @@ public interface EndpointBuilders org.apache.camel.builder.endpoint.dsl.SwiftEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.TelegramEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.ThriftEndpointBuilderFactory, + org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.TikaEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.TimerEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.Timestream2EndpointBuilderFactory, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index b632170141e..1ff7eb91e5c 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -13904,6 +13904,61 @@ public class StaticEndpointBuilders { String path) { return org.apache.camel.builder.endpoint.dsl.ThriftEndpointBuilderFactory.endpointBuilder(componentName, path); } + /** + * Thymeleaf (camel-thymeleaf) + * Transform messages using a Thymeleaf template. + * + * Category: transformation + * Since: 1.0 + * Maven coordinates: org.apache.camel:camel-thymeleaf + * + * Syntax: <code>thymeleaf:templatePath</code> + * + * Path parameter: resourceUri (required) + * Path to the resource. You can prefix with: classpath, file, http, ref, or + * bean. classpath, file and http loads the resource using these protocols + * (classpath is default). ref will lookup the resource in the registry. + * bean will call a method on a bean to be used as the resource. For bean + * you can specify the method name after dot, eg bean:myBean.myMethod. + * This option can also be loaded from an existing file, by prefixing with + * file: or classpath: followed by the location of the file. + * + * @param path templatePath + * @return the dsl builder + */ + public static org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory.ThymeleafEndpointBuilder thymeleaf( + String path) { + return org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory.endpointBuilder("thymeleaf", path); + } + /** + * Thymeleaf (camel-thymeleaf) + * Transform messages using a Thymeleaf template. + * + * Category: transformation + * Since: 1.0 + * Maven coordinates: org.apache.camel:camel-thymeleaf + * + * Syntax: <code>thymeleaf:templatePath</code> + * + * Path parameter: resourceUri (required) + * Path to the resource. You can prefix with: classpath, file, http, ref, or + * bean. classpath, file and http loads the resource using these protocols + * (classpath is default). ref will lookup the resource in the registry. + * bean will call a method on a bean to be used as the resource. For bean + * you can specify the method name after dot, eg bean:myBean.myMethod. + * This option can also be loaded from an existing file, by prefixing with + * file: or classpath: followed by the location of the file. + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path templatePath + * @return the dsl builder + */ + public static org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory.ThymeleafEndpointBuilder thymeleaf( + String componentName, + String path) { + return org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory.endpointBuilder(componentName, path); + } /** * Tika (camel-tika) * Parse documents and extract metadata and text using Apache Tika. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ThymeleafEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ThymeleafEndpointBuilderFactory.java new file mode 100644 index 00000000000..d3a78df9d02 --- /dev/null +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ThymeleafEndpointBuilderFactory.java @@ -0,0 +1,536 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.builder.endpoint.dsl; + +import java.util.*; +import java.util.concurrent.*; +import java.util.function.*; +import java.util.stream.*; +import javax.annotation.processing.Generated; +import org.apache.camel.builder.EndpointConsumerBuilder; +import org.apache.camel.builder.EndpointProducerBuilder; +import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; + +/** + * Transform messages using a Thymeleaf template. + * + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointDslMojo") +public interface ThymeleafEndpointBuilderFactory { + + + /** + * Builder for endpoint for the Thymeleaf component. + */ + public interface ThymeleafEndpointBuilder extends EndpointProducerBuilder { + default AdvancedThymeleafEndpointBuilder advanced() { + return (AdvancedThymeleafEndpointBuilder) this; + } + /** + * Sets whether the context map should allow access to all details. By + * default only the message body and headers can be accessed. This + * option can be enabled for full access to the current Exchange and + * CamelContext. Doing so impose a potential security risk as this opens + * access to the full power of CamelContext API. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param allowContextMapAll the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder allowContextMapAll( + boolean allowContextMapAll) { + doSetProperty("allowContextMapAll", allowContextMapAll); + return this; + } + /** + * Sets whether the context map should allow access to all details. By + * default only the message body and headers can be accessed. This + * option can be enabled for full access to the current Exchange and + * CamelContext. Doing so impose a potential security risk as this opens + * access to the full power of CamelContext API. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: producer + * + * @param allowContextMapAll the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder allowContextMapAll( + String allowContextMapAll) { + doSetProperty("allowContextMapAll", allowContextMapAll); + return this; + } + /** + * Whether templates have to be considered cacheable or not. + * + * The option is a: <code>java.lang.Boolean</code> type. + * + * Group: producer + * + * @param cacheable the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder cacheable(Boolean cacheable) { + doSetProperty("cacheable", cacheable); + return this; + } + /** + * Whether templates have to be considered cacheable or not. + * + * The option will be converted to a + * <code>java.lang.Boolean</code> type. + * + * Group: producer + * + * @param cacheable the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder cacheable(String cacheable) { + doSetProperty("cacheable", cacheable); + return this; + } + /** + * The cache Time To Live for templates, expressed in milliseconds. + * + * The option is a: <code>java.lang.Long</code> type. + * + * Group: producer + * + * @param cacheTimeToLive the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder cacheTimeToLive(Long cacheTimeToLive) { + doSetProperty("cacheTimeToLive", cacheTimeToLive); + return this; + } + /** + * The cache Time To Live for templates, expressed in milliseconds. + * + * The option will be converted to a + * <code>java.lang.Long</code> type. + * + * Group: producer + * + * @param cacheTimeToLive the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder cacheTimeToLive(String cacheTimeToLive) { + doSetProperty("cacheTimeToLive", cacheTimeToLive); + return this; + } + /** + * Whether a template resources will be checked for existence before + * being returned. + * + * The option is a: <code>java.lang.Boolean</code> type. + * + * Group: producer + * + * @param checkExistence the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder checkExistence(Boolean checkExistence) { + doSetProperty("checkExistence", checkExistence); + return this; + } + /** + * Whether a template resources will be checked for existence before + * being returned. + * + * The option will be converted to a + * <code>java.lang.Boolean</code> type. + * + * Group: producer + * + * @param checkExistence the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder checkExistence(String checkExistence) { + doSetProperty("checkExistence", checkExistence); + return this; + } + /** + * Sets whether to use resource content cache or not. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param contentCache the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder contentCache(boolean contentCache) { + doSetProperty("contentCache", contentCache); + return this; + } + /** + * Sets whether to use resource content cache or not. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: producer + * + * @param contentCache the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder contentCache(String contentCache) { + doSetProperty("contentCache", contentCache); + return this; + } + /** + * The character encoding to be used for reading template resources. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param encoding the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder encoding(String encoding) { + doSetProperty("encoding", encoding); + return this; + } + /** + * The order in which this template will be resolved as part of the + * resolver chain. + * + * The option is a: <code>java.lang.Integer</code> type. + * + * Group: producer + * + * @param order the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder order(Integer order) { + doSetProperty("order", order); + return this; + } + /** + * The order in which this template will be resolved as part of the + * resolver chain. + * + * The option will be converted to a + * <code>java.lang.Integer</code> type. + * + * Group: producer + * + * @param order the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder order(String order) { + doSetProperty("order", order); + return this; + } + /** + * An optional prefix added to template names to convert them into + * resource names. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param prefix the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder prefix(String prefix) { + doSetProperty("prefix", prefix); + return this; + } + /** + * The type of resolver to be used by the template engine. + * + * The option is a: + * <code>org.apache.camel.component.thymeleaf.ThymeleafResolverType</code> type. + * + * Default: CLASS_LOADER + * Group: producer + * + * @param resolver the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder resolver( + org.apache.camel.component.thymeleaf.ThymeleafResolverType resolver) { + doSetProperty("resolver", resolver); + return this; + } + /** + * The type of resolver to be used by the template engine. + * + * The option will be converted to a + * <code>org.apache.camel.component.thymeleaf.ThymeleafResolverType</code> type. + * + * Default: CLASS_LOADER + * Group: producer + * + * @param resolver the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder resolver(String resolver) { + doSetProperty("resolver", resolver); + return this; + } + /** + * An optional suffix added to template names to convert them into + * resource names. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param suffix the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder suffix(String suffix) { + doSetProperty("suffix", suffix); + return this; + } + /** + * The template mode to be applied to templates. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param templateMode the value to set + * @return the dsl builder + */ + default ThymeleafEndpointBuilder templateMode(String templateMode) { + doSetProperty("templateMode", templateMode); + return this; + } + } + + /** + * Advanced builder for endpoint for the Thymeleaf component. + */ + public interface AdvancedThymeleafEndpointBuilder + extends + EndpointProducerBuilder { + default ThymeleafEndpointBuilder basic() { + return (ThymeleafEndpointBuilder) this; + } + /** + * Whether the producer should be started lazy (on the first message). + * By starting lazy you can use this to allow CamelContext and routes to + * startup in situations where a producer may otherwise fail during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedThymeleafEndpointBuilder lazyStartProducer( + boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * Whether the producer should be started lazy (on the first message). + * By starting lazy you can use this to allow CamelContext and routes to + * startup in situations where a producer may otherwise fail during + * starting and cause the route to fail being started. By deferring this + * startup to be lazy then the startup failure can be handled during + * routing messages via Camel's routing error handlers. Beware that when + * the first message is processed then creating and starting the + * producer may take a little time and prolong the total processing time + * of the processing. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: producer (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedThymeleafEndpointBuilder lazyStartProducer( + String lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + } + + public interface ThymeleafBuilders { + /** + * Thymeleaf (camel-thymeleaf) + * Transform messages using a Thymeleaf template. + * + * Category: transformation + * Since: 1.0 + * Maven coordinates: org.apache.camel:camel-thymeleaf + * + * @return the dsl builder for the headers' name. + */ + default ThymeleafHeaderNameBuilder thymeleaf() { + return ThymeleafHeaderNameBuilder.INSTANCE; + } + /** + * Thymeleaf (camel-thymeleaf) + * Transform messages using a Thymeleaf template. + * + * Category: transformation + * Since: 1.0 + * Maven coordinates: org.apache.camel:camel-thymeleaf + * + * Syntax: <code>thymeleaf:templatePath</code> + * + * Path parameter: resourceUri (required) + * Path to the resource. You can prefix with: classpath, file, http, + * ref, or bean. classpath, file and http loads the resource using these + * protocols (classpath is default). ref will lookup the resource in the + * registry. bean will call a method on a bean to be used as the + * resource. For bean you can specify the method name after dot, eg + * bean:myBean.myMethod. + * This option can also be loaded from an existing file, by prefixing + * with file: or classpath: followed by the location of the file. + * + * @param path templatePath + * @return the dsl builder + */ + default ThymeleafEndpointBuilder thymeleaf(String path) { + return ThymeleafEndpointBuilderFactory.endpointBuilder("thymeleaf", path); + } + /** + * Thymeleaf (camel-thymeleaf) + * Transform messages using a Thymeleaf template. + * + * Category: transformation + * Since: 1.0 + * Maven coordinates: org.apache.camel:camel-thymeleaf + * + * Syntax: <code>thymeleaf:templatePath</code> + * + * Path parameter: resourceUri (required) + * Path to the resource. You can prefix with: classpath, file, http, + * ref, or bean. classpath, file and http loads the resource using these + * protocols (classpath is default). ref will lookup the resource in the + * registry. bean will call a method on a bean to be used as the + * resource. For bean you can specify the method name after dot, eg + * bean:myBean.myMethod. + * This option can also be loaded from an existing file, by prefixing + * with file: or classpath: followed by the location of the file. + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path templatePath + * @return the dsl builder + */ + default ThymeleafEndpointBuilder thymeleaf( + String componentName, + String path) { + return ThymeleafEndpointBuilderFactory.endpointBuilder(componentName, path); + } + } + + /** + * The builder of headers' name for the Thymeleaf component. + */ + public static class ThymeleafHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + private static final ThymeleafHeaderNameBuilder INSTANCE = new ThymeleafHeaderNameBuilder(); + + /** + * The name of the Thymeleaf template. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code ThymeleafResourceUri}. + */ + public String thymeleafResourceUri() { + return "ThymeleafResourceUri"; + } + + /** + * The content of the Thymeleaf template. + * + * The option is a: {@code String} type. + * + * Group: producer + * + * @return the name of the header {@code ThymeleafTemplate}. + */ + public String thymeleafTemplate() { + return "ThymeleafTemplate"; + } + + /** + * The value of this header should be a Map with key/values that will be + * override any existing key with the same name. This can be used to + * preconfigure common key/values you want to reuse in your Thymeleaf + * endpoints. + * + * The option is a: {@code Map<String, Object>} type. + * + * Group: producer + * + * @return the name of the header {@code ThymeleafVariableMap}. + */ + public String thymeleafVariableMap() { + return "ThymeleafVariableMap"; + } + + /** + * The ServletContext for a web application. + * + * The option is a: {@code jakarta.servlet.ServletContext} type. + * + * Group: producer + * + * @return the name of the header {@code ThymeleafServletContext}. + */ + public String thymeleafServletContext() { + return "ThymeleafServletContext"; + } + } + static ThymeleafEndpointBuilder endpointBuilder( + String componentName, + String path) { + class ThymeleafEndpointBuilderImpl extends AbstractEndpointBuilder implements ThymeleafEndpointBuilder, AdvancedThymeleafEndpointBuilder { + public ThymeleafEndpointBuilderImpl(String path) { + super(componentName, path); + } + } + return new ThymeleafEndpointBuilderImpl(path); + } +} \ No newline at end of file diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties index 51543551966..27631e6d681 100644 --- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties +++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties @@ -300,6 +300,7 @@ org.apache.camel.component.stringtemplate.StringTemplateComponent=camel:stringte org.apache.camel.component.stub.StubComponent=camel:stub org.apache.camel.component.telegram.TelegramComponent=camel:telegram org.apache.camel.component.thrift.ThriftComponent=camel:thrift +org.apache.camel.component.thymeleaf.ThymeleafComponent=camel:thymeleaf org.apache.camel.component.tika.TikaComponent=camel:tika org.apache.camel.component.timer.TimerComponent=camel:timer org.apache.camel.component.twilio.TwilioComponent=camel:twilio
