This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push: new b0736c5896e Regen b0736c5896e is described below commit b0736c5896e9d4920cb595b6c38368a2491ced00 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Oct 30 09:25:08 2024 +0100 Regen --- .../springboot/catalog/components/smooks.json | 2 +- .../springboot/catalog/dataformats.properties | 1 + .../springboot/catalog/dataformats/smooks.json | 22 ++++++ .../camel-smooks-starter/src/main/docs/smooks.json | 28 ++++++++ .../SmooksDataFormatAutoConfiguration.java | 78 ++++++++++++++++++++++ .../springboot/SmooksDataFormatConfiguration.java | 49 ++++++++++++++ ...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +- 7 files changed, 181 insertions(+), 2 deletions(-) diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smooks.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smooks.json index 2624d2e7127..0deb7fea5f0 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smooks.json +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/smooks.json @@ -29,7 +29,7 @@ "autowiredEnabled": { "index": 2, "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 [...] }, "properties": { - "smooksConfig": { "index": 0, "kind": "path", "displayName": "Smooks Config", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Smooks XML configuration file" }, + "smooksConfig": { "index": 0, "kind": "path", "displayName": "Smooks Config", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Path to the Smooks configuration file" }, "reportPath": { "index": 1, "kind": "parameter", "displayName": "Report Path", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "File path to place the generated HTML execution report. The report is a useful tool in the developers arsenal for diagnosing issues or comprehending a transformation. Do not set in production since this is a major performance drain" }, "sendEmptyMessageWhenIdle": { "index": 2, "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." }, "bridgeErrorHandler": { "index": 3, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming [...] diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties index 77bef15064d..7f1286e6c46 100644 --- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties @@ -32,6 +32,7 @@ pgp protobuf protobufJackson rss +smooks snakeYaml soap swiftMt diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/smooks.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/smooks.json new file mode 100644 index 00000000000..5e9870f9e64 --- /dev/null +++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/smooks.json @@ -0,0 +1,22 @@ +{ + "dataformat": { + "kind": "dataformat", + "name": "smooks", + "title": "Smooks", + "description": "Transform and bind XML as well as non-XML data using Smooks.", + "deprecated": false, + "firstVersion": "4.9.0", + "label": "dataformat,transformation,smooks", + "javaType": "org.apache.camel.dataformat.smooks.SmooksDataFormat", + "supportLevel": "Preview", + "groupId": "org.apache.camel.springboot", + "artifactId": "camel-smooks-starter", + "version": "4.9.0-SNAPSHOT", + "modelName": "smooks", + "modelJavaType": "org.apache.camel.model.dataformat.SmooksDataFormat" + }, + "properties": { + "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, + "smooksConfig": { "index": 1, "kind": "attribute", "displayName": "Smooks Config", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Path to the Smooks configuration file." } + } +} diff --git a/components-starter/camel-smooks-starter/src/main/docs/smooks.json b/components-starter/camel-smooks-starter/src/main/docs/smooks.json index cbf058bacc0..dc37c7c24ec 100644 --- a/components-starter/camel-smooks-starter/src/main/docs/smooks.json +++ b/components-starter/camel-smooks-starter/src/main/docs/smooks.json @@ -10,6 +10,17 @@ "type": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties", "sourceType": "org.apache.camel.component.smooks.springboot.SmooksComponentConfiguration", "sourceMethod": "getCustomizer()" + }, + { + "name": "camel.dataformat.smooks", + "type": "org.apache.camel.dataformat.smooks.springboot.SmooksDataFormatConfiguration", + "sourceType": "org.apache.camel.dataformat.smooks.springboot.SmooksDataFormatConfiguration" + }, + { + "name": "camel.dataformat.smooks.customizer", + "type": "org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon$CustomizerProperties", + "sourceType": "org.apache.camel.dataformat.smooks.springboot.SmooksDataFormatConfiguration", + "sourceMethod": "getCustomizer()" } ], "properties": [ @@ -44,6 +55,23 @@ "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 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 [...] "sourceType": "org.apache.camel.component.smooks.springboot.SmooksComponentConfiguration", "defaultValue": false + }, + { + "name": "camel.dataformat.smooks.customizer.enabled", + "type": "java.lang.Boolean", + "sourceType": "org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon$CustomizerProperties" + }, + { + "name": "camel.dataformat.smooks.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable auto configuration of the smooks data format. This is enabled by default.", + "sourceType": "org.apache.camel.dataformat.smooks.springboot.SmooksDataFormatConfiguration" + }, + { + "name": "camel.dataformat.smooks.smooks-config", + "type": "java.lang.String", + "description": "Path to the Smooks configuration file.", + "sourceType": "org.apache.camel.dataformat.smooks.springboot.SmooksDataFormatConfiguration" } ], "hints": [] diff --git a/components-starter/camel-smooks-starter/src/main/java/org/apache/camel/dataformat/smooks/springboot/SmooksDataFormatAutoConfiguration.java b/components-starter/camel-smooks-starter/src/main/java/org/apache/camel/dataformat/smooks/springboot/SmooksDataFormatAutoConfiguration.java new file mode 100644 index 00000000000..96256465911 --- /dev/null +++ b/components-starter/camel-smooks-starter/src/main/java/org/apache/camel/dataformat/smooks/springboot/SmooksDataFormatAutoConfiguration.java @@ -0,0 +1,78 @@ +/* + * 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.dataformat.smooks.springboot; + +import org.apache.camel.CamelContext; +import org.apache.camel.dataformat.smooks.SmooksDataFormat; +import org.apache.camel.spi.DataFormat; +import org.apache.camel.spi.DataFormatCustomizer; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.DataFormatConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.convert.ApplicationConversionService; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration(proxyBeanMethods = false) +@AutoConfigureAfter(CamelAutoConfiguration.class) +@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class) +@EnableConfigurationProperties({DataFormatConfigurationProperties.class,SmooksDataFormatConfiguration.class}) +@ConditionalOnHierarchicalProperties({"camel.dataformat", "camel.dataformat.smooks"}) +public class SmooksDataFormatAutoConfiguration { + + @Autowired + private ApplicationContext applicationContext; + private final CamelContext camelContext; + @Autowired + private SmooksDataFormatConfiguration configuration; + + public SmooksDataFormatAutoConfiguration( + org.apache.camel.CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Lazy + @Bean + public DataFormatCustomizer configureSmooksDataFormatFactory() { + return new DataFormatCustomizer() { + @Override + public void configure(String name, DataFormat target) { + CamelPropertiesHelper.copyProperties(camelContext, configuration, target); + } + @Override + public boolean isEnabled(String name, DataFormat target) { + return HierarchicalPropertiesEvaluator.evaluate( + applicationContext, + "camel.dataformat.customizer", + "camel.dataformat.smooks.customizer") + && target instanceof SmooksDataFormat; + } + }; + } +} \ No newline at end of file diff --git a/components-starter/camel-smooks-starter/src/main/java/org/apache/camel/dataformat/smooks/springboot/SmooksDataFormatConfiguration.java b/components-starter/camel-smooks-starter/src/main/java/org/apache/camel/dataformat/smooks/springboot/SmooksDataFormatConfiguration.java new file mode 100644 index 00000000000..66f91ddd01d --- /dev/null +++ b/components-starter/camel-smooks-starter/src/main/java/org/apache/camel/dataformat/smooks/springboot/SmooksDataFormatConfiguration.java @@ -0,0 +1,49 @@ +/* + * 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.dataformat.smooks.springboot; + +import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Transform and bind XML as well as non-XML data using Smooks. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.dataformat.smooks") +public class SmooksDataFormatConfiguration + extends + DataFormatConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the smooks data format. This is + * enabled by default. + */ + private Boolean enabled; + /** + * Path to the Smooks configuration file. + */ + private String smooksConfig; + + public String getSmooksConfig() { + return smooksConfig; + } + + public void setSmooksConfig(String smooksConfig) { + this.smooksConfig = smooksConfig; + } +} \ No newline at end of file diff --git a/components-starter/camel-smooks-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-smooks-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index ac0cca497c2..20409bfae6b 100644 --- a/components-starter/camel-smooks-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/components-starter/camel-smooks-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -15,4 +15,5 @@ ## limitations under the License. ## --------------------------------------------------------------------------- -org.apache.camel.component.smooks.springboot.SmooksComponentAutoConfiguration \ No newline at end of file +org.apache.camel.component.smooks.springboot.SmooksComponentAutoConfiguration +org.apache.camel.dataformat.smooks.springboot.SmooksDataFormatAutoConfiguration