diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smooks.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smooks.json index b2844871613ad..b105f895b02c0 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smooks.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, "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 messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties index ca8d6981a6e84..d6145c7729c5b 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties @@ -31,6 +31,7 @@ pgp protobuf protobufJackson rss +smooks snakeYaml soap swiftMt diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/smooks.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/smooks.json new file mode 100644 index 0000000000000..167e4c55c5c7c --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/smooks.json @@ -0,0 +1,22 @@ +{ + "dataformat": { + "kind": "dataformat", + "name": "smooks", + "title": "Smooks", + "description": "Transform XML and non-XML data using Smooks. A configuration for a SmooksDataFormat should not allocate system resources because SmooksDataFormat does not close those resources.", + "deprecated": false, + "firstVersion": "4.9.0", + "label": "dataformat,transformation,smooks", + "javaType": "org.apache.camel.dataformat.smooks.SmooksDataFormat", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-smooks", + "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/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties index 9631a0ce18020..bbe8e85ee8ed7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties @@ -183,6 +183,7 @@ setProperty setVariable setVariables simple +smooks soap sort spel diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json index 7a5c949c25421..ea2b0bb8013ff 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json @@ -12,6 +12,6 @@ "output": false }, "properties": { - "dataFormats": { "index": 0, "kind": "element", "displayName": "Data Formats", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "A list holding the configured data formats" } + "dataFormats": { "index": 0, "kind": "element", "displayName": "Data Formats", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "smooks", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "A list holding the configured data formats" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json index 98f8d55c65b77..ecc749299c3ac 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json @@ -15,7 +15,7 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" }, "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." }, - "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, + "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "smooks", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, "variableSend": { "index": 4, "kind": "attribute", "displayName": "Variable Send", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable as the source for the message body to send. This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using send variable then the message body is taken from this variable instead of the current message, however the headers from the message will still be used as well. In other words, the variable is used instead of the message body, but everything else is as usual." }, "variableReceive": { "index": 5, "kind": "attribute", "displayName": "Variable Receive", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable to store the received message body (only body, not headers). This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using receive variable then the received body is stored only in this variable and not on the current message." } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/smooks.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/smooks.json new file mode 100644 index 0000000000000..12fd8193964ea --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/smooks.json @@ -0,0 +1,19 @@ +{ + "model": { + "kind": "model", + "name": "smooks", + "title": "Smooks", + "description": "Transform XML and non-XML data using Smooks. A configuration for a SmooksDataFormat should not allocate system resources because SmooksDataFormat does not close those resources.", + "deprecated": false, + "firstVersion": "4.9.0", + "label": "dataformat,transformation,smooks", + "javaType": "org.apache.camel.model.dataformat.SmooksDataFormat", + "abstract": false, + "input": false, + "output": false + }, + "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/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json index 5a832d4470d2c..fa3b561f0eaf6 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json @@ -15,7 +15,7 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" }, "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." }, - "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, + "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "smooks", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, "variableSend": { "index": 4, "kind": "attribute", "displayName": "Variable Send", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable as the source for the message body to send. This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using send variable then the message body is taken from this variable instead of the current message, however the headers from the message will still be used as well. In other words, the variable is used instead of the message body, but everything else is as usual." }, "variableReceive": { "index": 5, "kind": "attribute", "displayName": "Variable Receive", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable to store the received message body (only body, not headers). This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using receive variable then the received body is stored only in this variable and not on the current message." }, "allowNullBody": { "index": 6, "kind": "attribute", "displayName": "Allow Null Body", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Indicates whether null is allowed as value of a body to unmarshall." } 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 3879096bf103b..1731bc7e6be18 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 @@ -1849,6 +1849,16 @@ Allows setting multiple variables at the same time. + + + + + + + @@ -7410,6 +7420,7 @@ down. Default value: false + @@ -9717,6 +9728,22 @@ value: true + + + + + + + + + + + + + + @@ -14581,6 +14608,7 @@ To type used as a target data type in the transformation. + @@ -16770,6 +16798,7 @@ Set a reference to a custom Expression to use. + @@ -17557,6 +17586,7 @@ Sets the component name that this definition will apply to. + diff --git a/components/camel-smooks/src/generated/java/org/apache/camel/component/smooks/SmooksDataFormatConfigurer.java b/components/camel-smooks/src/generated/java/org/apache/camel/component/smooks/SmooksDataFormatConfigurer.java new file mode 100644 index 0000000000000..439af9d6e16d9 --- /dev/null +++ b/components/camel-smooks/src/generated/java/org/apache/camel/component/smooks/SmooksDataFormatConfigurer.java @@ -0,0 +1,27 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.component.smooks; + +import javax.annotation.processing.Generated; + +import org.apache.camel.CamelContext; +import org.apache.camel.dataformat.smooks.SmooksDataFormat; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.support.component.PropertyConfigurerSupport; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.PackageDataFormatMojo") +@SuppressWarnings("unchecked") +public class SmooksDataFormatConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer { + + @Override + public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) { + SmooksDataFormat dataformat = (SmooksDataFormat) target; + switch (ignoreCase ? name.toLowerCase() : name) { + default: return false; + } + } + +} + diff --git a/components/camel-smooks/src/generated/java/org/apache/camel/dataformat/smooks/SmooksDataFormatConfigurer.java b/components/camel-smooks/src/generated/java/org/apache/camel/dataformat/smooks/SmooksDataFormatConfigurer.java new file mode 100644 index 0000000000000..4381bae9cefe2 --- /dev/null +++ b/components/camel-smooks/src/generated/java/org/apache/camel/dataformat/smooks/SmooksDataFormatConfigurer.java @@ -0,0 +1,30 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.dataformat.smooks; + +import javax.annotation.processing.Generated; +import java.util.HashMap; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.support.component.PropertyConfigurerSupport; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.PackageDataFormatMojo") +@SuppressWarnings("unchecked") +public class SmooksDataFormatConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer { + + @Override + public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) { + SmooksDataFormat dataformat = (SmooksDataFormat) target; + switch (ignoreCase ? name.toLowerCase() : name) { + case "smooksconfig": + case "smooksConfig": dataformat.setSmooksConfig(property(camelContext, java.lang.String.class, value)); return true; + default: return false; + } + } + +} + diff --git a/components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/component/smooks/smooks.json b/components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/component/smooks/smooks.json index b2844871613ad..b105f895b02c0 100644 --- a/components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/component/smooks/smooks.json +++ b/components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/component/smooks/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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, "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 messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, diff --git a/components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/dataformat/smooks/smooks.json b/components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/dataformat/smooks/smooks.json new file mode 100644 index 0000000000000..167e4c55c5c7c --- /dev/null +++ b/components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/dataformat/smooks/smooks.json @@ -0,0 +1,22 @@ +{ + "dataformat": { + "kind": "dataformat", + "name": "smooks", + "title": "Smooks", + "description": "Transform XML and non-XML data using Smooks. A configuration for a SmooksDataFormat should not allocate system resources because SmooksDataFormat does not close those resources.", + "deprecated": false, + "firstVersion": "4.9.0", + "label": "dataformat,transformation,smooks", + "javaType": "org.apache.camel.dataformat.smooks.SmooksDataFormat", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-smooks", + "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/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/configurer/smooks-dataformat b/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/configurer/smooks-dataformat new file mode 100644 index 0000000000000..cc79fd7de3a36 --- /dev/null +++ b/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/configurer/smooks-dataformat @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.dataformat.smooks.SmooksDataFormatConfigurer diff --git a/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties b/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties new file mode 100644 index 0000000000000..fb35cf2007ac7 --- /dev/null +++ b/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties @@ -0,0 +1,7 @@ +# Generated by camel build tools - do NOT edit this file! +dataFormats=smooks +groupId=org.apache.camel +artifactId=camel-smooks +version=4.9.0-SNAPSHOT +projectName=Camel :: Smooks :: Parent +projectDescription=Camel Smooks Component diff --git a/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/dataformat/smooks b/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/dataformat/smooks new file mode 100644 index 0000000000000..ac50e4b08b0cc --- /dev/null +++ b/components/camel-smooks/src/generated/resources/META-INF/services/org/apache/camel/dataformat/smooks @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.dataformat.smooks.SmooksDataFormat diff --git a/components/camel-smooks/src/main/java/org/apache/camel/component/smooks/SmooksEndpoint.java b/components/camel-smooks/src/main/java/org/apache/camel/component/smooks/SmooksEndpoint.java index f07aa830a47e6..0a854ca1702a3 100644 --- a/components/camel-smooks/src/main/java/org/apache/camel/component/smooks/SmooksEndpoint.java +++ b/components/camel-smooks/src/main/java/org/apache/camel/component/smooks/SmooksEndpoint.java @@ -32,7 +32,7 @@ category = { Category.TRANSFORMATION }) public class SmooksEndpoint extends ProcessorEndpoint { - @UriPath(description = "Smooks XML configuration file") + @UriPath(description = "Path to the Smooks configuration file") @Metadata(required = true, supportFileReference = true) private String smooksConfig; diff --git a/components/camel-smooks/src/main/java/org/apache/camel/dataformat/smooks/SmooksDataFormat.java b/components/camel-smooks/src/main/java/org/apache/camel/dataformat/smooks/SmooksDataFormat.java new file mode 100644 index 0000000000000..e3ff53e1235c6 --- /dev/null +++ b/components/camel-smooks/src/main/java/org/apache/camel/dataformat/smooks/SmooksDataFormat.java @@ -0,0 +1,153 @@ +/* + * 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; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; + +import org.xml.sax.SAXException; + +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.Exchange; +import org.apache.camel.TypeConverter; +import org.apache.camel.component.smooks.SmooksComponent; +import org.apache.camel.component.smooks.SmooksProcessor; +import org.apache.camel.spi.DataFormat; +import org.apache.camel.spi.annotations.Dataformat; +import org.apache.camel.support.processor.MarshalProcessor; +import org.apache.camel.support.processor.UnmarshalProcessor; +import org.apache.camel.support.service.ServiceSupport; +import org.smooks.Smooks; +import org.smooks.SmooksFactory; +import org.smooks.api.ExecutionContext; +import org.smooks.api.SmooksException; +import org.smooks.api.io.Sink; +import org.smooks.engine.lookup.ExportsLookup; +import org.smooks.io.payload.Exports; +import org.smooks.io.sink.StringSink; +import org.smooks.io.source.JavaSource; +import org.smooks.io.source.StreamSource; + +/** + * SmooksDataFormat is a Camel data format which is a pluggable transformer capable of transforming from one dataformat + * to another and back again. This means that what is marshaled can be unmarshalled by an instance of this class. + *

+ *

+ * A smooks configuration for a SmooksDataFormat should not utilize Smooks features such as routing that might allocate + * system resources. The reason for this is that there is no functionality in the SmooksDataFormat which will close + * those resources. If you need to use these Smooks features please take a look at the {@link SmooksComponent} or + * {@link SmooksProcessor} as they hook into Camels lifecycle management and will close resources correctly. + *

+ */ +@Dataformat("smooks") +public class SmooksDataFormat extends ServiceSupport implements DataFormat, CamelContextAware { + private Smooks smooks; + private CamelContext camelContext; + private String smooksConfig; + + /** + * Marshals the Object 'fromBody' to an OutputStream 'toStream' + *

+ *

+ * The Camel framework will call this method from {@link MarshalProcessor#process(Exchange)} and it will take care + * of setting the Out Message's body to the bytes written to the toStream OutputStream. + * + * @param exchange The Camel {@link Exchange}. + * @param fromBody The object to be marshalled into the output stream. + * @param toStream The output stream that will be written to. + */ + @Override + public void marshal(final Exchange exchange, final Object fromBody, final OutputStream toStream) throws Exception { + final ExecutionContext executionContext = smooks.createExecutionContext(); + final TypeConverter typeConverter = exchange.getContext().getTypeConverter(); + final JavaSource javaSource = typeConverter.mandatoryConvertTo(JavaSource.class, exchange, fromBody); + final StringSink stringSink = new StringSink(); + smooks.filterSource(executionContext, javaSource, stringSink); + + toStream.write(stringSink.getResult().getBytes(executionContext.getContentEncoding())); + } + + /** + * Unmarshals the fromStream to an Object. + *

+ * The Camel framework will call this method from {@link UnmarshalProcessor#process(Exchange)} and it will take care + * of setting the returned Object on the Out Message's body. + * + * @param exchange The Camel {@link Exchange}. + * @param fromStream The InputStream that will be unmarshalled into an Object instance. + */ + @Override + public Object unmarshal(final Exchange exchange, final InputStream fromStream) { + final ExecutionContext executionContext = smooks.createExecutionContext(); + final Exports exports = smooks.getApplicationContext().getRegistry().lookup(new ExportsLookup()); + final Sink[] sinks = exports.createSinks(); + smooks.filterSource(executionContext, new StreamSource<>(fromStream), sinks); + return getResult(exports, sinks, exchange); + } + + protected Object getResult(final Exports exports, final Sink[] sinks, final Exchange exchange) { + final List objects = Exports.extractSinks(sinks, exports); + if (objects.size() == 1) { + return objects.get(0); + } else { + return objects; + } + } + + @Override + public void setCamelContext(CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Override + public CamelContext getCamelContext() { + return camelContext; + } + + @Override + public void doStart() { + final SmooksFactory smooksFactory + = (SmooksFactory) camelContext.getRegistry().lookupByName(SmooksFactory.class.getName()); + try { + if (smooksFactory != null) { + smooks = smooksFactory.createInstance(smooksConfig); + } else { + smooks = new Smooks(smooksConfig); + } + } catch (IOException | SAXException e) { + throw new SmooksException(e.getMessage(), e); + } + } + + @Override + public void doStop() { + if (smooks != null) { + smooks.close(); + } + } + + public String getSmooksConfig() { + return smooksConfig; + } + + public void setSmooksConfig(String smooksConfig) { + this.smooksConfig = smooksConfig; + } +} diff --git a/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/Customer.java b/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/Customer.java new file mode 100644 index 0000000000000..12aebd787a389 --- /dev/null +++ b/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/Customer.java @@ -0,0 +1,86 @@ +/* + * 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; + +import org.apache.camel.dataformat.smooks.gender.Gender; + +public class Customer { + + private String firstName; + private String lastName; + private Gender gender; + private Integer age; + private String country; + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + age; + result = prime * result + ((country == null) ? 0 : country.hashCode()); + result = prime * result + + ((firstName == null) ? 0 : firstName.hashCode()); + result = prime * result + ((gender == null) ? 0 : gender.hashCode()); + result = prime * result + + ((lastName == null) ? 0 : lastName.hashCode()); + return result; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Gender getGender() { + return gender; + } + + public void setGender(Gender gender) { + this.gender = gender; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public String toString() { + return "[" + firstName + ", " + lastName + ", " + gender + ", " + age + ", " + country + "]"; + } +} diff --git a/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/SmooksDataFormatTest.java b/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/SmooksDataFormatTest.java new file mode 100644 index 0000000000000..51d9e3944b3df --- /dev/null +++ b/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/SmooksDataFormatTest.java @@ -0,0 +1,125 @@ +/* + * 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; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.dataformat.smooks.gender.Gender; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.support.DefaultExchange; +import org.apache.camel.support.processor.MarshalProcessor; +import org.apache.camel.support.processor.UnmarshalProcessor; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.smooks.io.source.JavaSource; +import org.smooks.support.StreamUtils; +import org.xmlunit.builder.DiffBuilder; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +public class SmooksDataFormatTest extends CamelTestSupport { + private static final String SMOOKS_CONFIG = "/smooks-config.xml"; + private static final String CUSTOMER_XML = "/customer.xml"; + private static final String CUSTOMER_XML_EXPECTED = "/customer-expected.xml"; + private DefaultCamelContext camelContext; + private SmooksDataFormat dataFormatter; + + public SmooksDataFormatTest() { + super(); + testConfigurationBuilder.withUseRouteBuilder(false); + } + + @BeforeEach + public void beforeEach() { + camelContext = new DefaultCamelContext(); + dataFormatter = new SmooksDataFormat(); + dataFormatter.setSmooksConfig(SMOOKS_CONFIG); + dataFormatter.setCamelContext(camelContext); + dataFormatter.start(); + } + + @AfterEach + public void afterEach() { + dataFormatter.stop(); + } + + @Test + public void unmarshal() throws Exception { + final UnmarshalProcessor unmarshalProcessor = new UnmarshalProcessor(dataFormatter); + final DefaultExchange exchange = new DefaultExchange(camelContext); + exchange.getIn().setBody(getCustomerInputStream(CUSTOMER_XML)); + + unmarshalProcessor.process(exchange); + + assertEquals(Customer.class, exchange.getOut().getBody().getClass()); + } + + @Test + public void marshal() throws Exception { + final MarshalProcessor marshalProcessor = new MarshalProcessor(dataFormatter); + final DefaultExchange exchange = new DefaultExchange(camelContext); + final Customer customer = new Customer(); + customer.setFirstName("John"); + customer.setLastName("Cocktolstol"); + customer.setGender(Gender.Male); + customer.setAge(35); + customer.setCountry("USA"); + + exchange.getIn().setBody(customer, JavaSource.class); + + marshalProcessor.process(exchange); + + assertFalse(DiffBuilder.compare(getCustomerXml(CUSTOMER_XML_EXPECTED)).withTest(exchange.getOut().getBody(String.class)) + .ignoreComments().ignoreWhitespace().build().hasDifferences()); + } + + @Test + public void unmarshalMarshalThroughCamel() throws Exception { + context.addRoutes(new RouteBuilder() { + @Override + public void configure() { + from("direct:a") + .unmarshal().smooks(SMOOKS_CONFIG) + .marshal().smooks(SMOOKS_CONFIG); + } + }); + + context.start(); + + final Exchange exchange + = template.request("direct:a", exchange1 -> exchange1.getIn().setBody(getCustomerInputStream(CUSTOMER_XML))); + + assertFalse(DiffBuilder.compare(getCustomerXml(CUSTOMER_XML_EXPECTED)).withTest(exchange.getOut().getBody(String.class)) + .ignoreComments().ignoreWhitespace().build().hasDifferences()); + } + + private InputStream getCustomerInputStream(final String resource) { + return getClass().getResourceAsStream(resource); + } + + private String getCustomerXml(final String resource) throws IOException { + return StreamUtils.readStream(new InputStreamReader(getCustomerInputStream(resource))); + } + +} diff --git a/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/gender/Gender.java b/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/gender/Gender.java new file mode 100644 index 0000000000000..92d373f62d1b9 --- /dev/null +++ b/components/camel-smooks/src/test/java/org/apache/camel/dataformat/smooks/gender/Gender.java @@ -0,0 +1,22 @@ +/* + * 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.gender; + +public enum Gender { + Male, + Female +} diff --git a/components/camel-smooks/src/test/resources/customer-expected.xml b/components/camel-smooks/src/test/resources/customer-expected.xml new file mode 100644 index 0000000000000..dd5f71af8b9de --- /dev/null +++ b/components/camel-smooks/src/test/resources/customer-expected.xml @@ -0,0 +1,25 @@ + + + John + Cocktolstol + Male + 35 + USA + diff --git a/components/camel-smooks/src/test/resources/customer.xml b/components/camel-smooks/src/test/resources/customer.xml new file mode 100644 index 0000000000000..b4a3409d74ce0 --- /dev/null +++ b/components/camel-smooks/src/test/resources/customer.xml @@ -0,0 +1,25 @@ + + + John + Cocktolstol + Male + 35 + USA + diff --git a/components/camel-smooks/src/test/resources/smooks-config.xml b/components/camel-smooks/src/test/resources/smooks-config.xml new file mode 100644 index 0000000000000..48137e80e707e --- /dev/null +++ b/components/camel-smooks/src/test/resources/smooks-config.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/dataFormats.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/dataFormats.json index 7a5c949c25421..ea2b0bb8013ff 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/dataFormats.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/dataFormats.json @@ -12,6 +12,6 @@ "output": false }, "properties": { - "dataFormats": { "index": 0, "kind": "element", "displayName": "Data Formats", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "A list holding the configured data formats" } + "dataFormats": { "index": 0, "kind": "element", "displayName": "Data Formats", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "smooks", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "A list holding the configured data formats" } } } diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/smooks.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/smooks.json new file mode 100644 index 0000000000000..12fd8193964ea --- /dev/null +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/smooks.json @@ -0,0 +1,19 @@ +{ + "model": { + "kind": "model", + "name": "smooks", + "title": "Smooks", + "description": "Transform XML and non-XML data using Smooks. A configuration for a SmooksDataFormat should not allocate system resources because SmooksDataFormat does not close those resources.", + "deprecated": false, + "firstVersion": "4.9.0", + "label": "dataformat,transformation,smooks", + "javaType": "org.apache.camel.model.dataformat.SmooksDataFormat", + "abstract": false, + "input": false, + "output": false + }, + "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/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/marshal.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/marshal.json index 98f8d55c65b77..ecc749299c3ac 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/marshal.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/marshal.json @@ -15,7 +15,7 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" }, "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." }, - "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, + "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "smooks", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, "variableSend": { "index": 4, "kind": "attribute", "displayName": "Variable Send", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable as the source for the message body to send. This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using send variable then the message body is taken from this variable instead of the current message, however the headers from the message will still be used as well. In other words, the variable is used instead of the message body, but everything else is as usual." }, "variableReceive": { "index": 5, "kind": "attribute", "displayName": "Variable Receive", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable to store the received message body (only body, not headers). This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using receive variable then the received body is stored only in this variable and not on the current message." } } diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/unmarshal.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/unmarshal.json index 5a832d4470d2c..fa3b561f0eaf6 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/unmarshal.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/unmarshal.json @@ -15,7 +15,7 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" }, "description": { "index": 1, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }, "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." }, - "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, + "dataFormatType": { "index": 3, "kind": "element", "displayName": "Data Format Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "asn1", "avro", "barcode", "base64", "beanio", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "parquetAvro", "pgp", "protobuf", "rss", "smooks", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "thrift", "tidyMarkup", "univocityCsv", "univocityFixed", "univocityTsv", "xmlSecurity", "yaml", "zipDeflater", "zipFile" ], "deprecated": false, "autowired": false, "secret": false, "description": "The data format to be used" }, "variableSend": { "index": 4, "kind": "attribute", "displayName": "Variable Send", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable as the source for the message body to send. This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using send variable then the message body is taken from this variable instead of the current message, however the headers from the message will still be used as well. In other words, the variable is used instead of the message body, but everything else is as usual." }, "variableReceive": { "index": 5, "kind": "attribute", "displayName": "Variable Receive", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a variable to store the received message body (only body, not headers). This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using receive variable then the received body is stored only in this variable and not on the current message." }, "allowNullBody": { "index": 6, "kind": "attribute", "displayName": "Allow Null Body", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Indicates whether null is allowed as value of a body to unmarshall." } diff --git a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties index d7144297bbf9d..8840f959ce35c 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties +++ b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties @@ -184,6 +184,7 @@ setProperty setVariable setVariables simple +smooks soap sort spel diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index index e2e8c68bb923b..ab142d762599f 100644 --- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index +++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index @@ -31,6 +31,7 @@ ParquetAvroDataFormat ProtobufDataFormat ProtobufLibrary RssDataFormat +SmooksDataFormat SoapDataFormat SwiftMtDataFormat SwiftMxDataFormat diff --git a/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatBuilderFactory.java b/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatBuilderFactory.java index 5e812f095d9ba..71c55d831030f 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatBuilderFactory.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatBuilderFactory.java @@ -43,6 +43,7 @@ import org.apache.camel.model.dataformat.ParquetAvroDataFormat; import org.apache.camel.model.dataformat.ProtobufDataFormat; import org.apache.camel.model.dataformat.RssDataFormat; +import org.apache.camel.model.dataformat.SmooksDataFormat; import org.apache.camel.model.dataformat.SoapDataFormat; import org.apache.camel.model.dataformat.SwiftMtDataFormat; import org.apache.camel.model.dataformat.SwiftMxDataFormat; @@ -252,6 +253,13 @@ public RssDataFormat.Builder rss() { return new RssDataFormat.Builder(); } + /** + * Uses the Smooks data format + */ + public SmooksDataFormat.Builder smooks() { + return new SmooksDataFormat.Builder(); + } + /** * Uses the Soap v1.1 data format */ diff --git a/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java b/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java index 328891add7ca5..6cc14d97acf47 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java @@ -52,6 +52,7 @@ import org.apache.camel.model.dataformat.ProtobufDataFormat; import org.apache.camel.model.dataformat.ProtobufLibrary; import org.apache.camel.model.dataformat.RssDataFormat; +import org.apache.camel.model.dataformat.SmooksDataFormat; import org.apache.camel.model.dataformat.SoapDataFormat; import org.apache.camel.model.dataformat.SwiftMtDataFormat; import org.apache.camel.model.dataformat.SwiftMxDataFormat; @@ -811,6 +812,15 @@ public T rss() { return dataFormat(new RssDataFormat()); } + /** + * Uses the Smooks data format + */ + public T smooks(String smooksConfig) { + SmooksDataFormat smooksDataFormat = new SmooksDataFormat(); + smooksDataFormat.setSmooksConfig(smooksConfig); + return dataFormat(smooksDataFormat); + } + /** * Uses the Soap v1.1 data format */ diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java index 5ba4ef47167cc..8cf1457554a69 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java @@ -50,6 +50,7 @@ import org.apache.camel.model.dataformat.ParquetAvroDataFormat; import org.apache.camel.model.dataformat.ProtobufDataFormat; import org.apache.camel.model.dataformat.RssDataFormat; +import org.apache.camel.model.dataformat.SmooksDataFormat; import org.apache.camel.model.dataformat.SoapDataFormat; import org.apache.camel.model.dataformat.SwiftMtDataFormat; import org.apache.camel.model.dataformat.SwiftMxDataFormat; @@ -101,6 +102,7 @@ public class MarshalDefinition extends NoOutputDefinition imp @XmlElement(name = "parquetAvro", type = ParquetAvroDataFormat.class), @XmlElement(name = "protobuf", type = ProtobufDataFormat.class), @XmlElement(name = "rss", type = RssDataFormat.class), + @XmlElement(name = "smooks", type = SmooksDataFormat.class), @XmlElement(name = "soap", type = SoapDataFormat.class), @XmlElement(name = "swiftMt", type = SwiftMtDataFormat.class), @XmlElement(name = "swiftMx", type = SwiftMxDataFormat.class), diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java index 6293d3bf84a6f..233ae83aca6ec 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java @@ -50,6 +50,7 @@ import org.apache.camel.model.dataformat.ParquetAvroDataFormat; import org.apache.camel.model.dataformat.ProtobufDataFormat; import org.apache.camel.model.dataformat.RssDataFormat; +import org.apache.camel.model.dataformat.SmooksDataFormat; import org.apache.camel.model.dataformat.SoapDataFormat; import org.apache.camel.model.dataformat.SwiftMtDataFormat; import org.apache.camel.model.dataformat.SwiftMxDataFormat; @@ -101,6 +102,7 @@ public class UnmarshalDefinition extends NoOutputDefinition @XmlElement(name = "parquetAvro", type = ParquetAvroDataFormat.class), @XmlElement(name = "protobuf", type = ProtobufDataFormat.class), @XmlElement(name = "rss", type = RssDataFormat.class), + @XmlElement(name = "smooks", type = SmooksDataFormat.class), @XmlElement(name = "soap", type = SoapDataFormat.class), @XmlElement(name = "swiftMt", type = SwiftMtDataFormat.class), @XmlElement(name = "swiftMx", type = SwiftMxDataFormat.class), diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java index e129a74a6a915..28f4b63a232b3 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java @@ -68,6 +68,7 @@ public class DataFormatsDefinition implements CopyableDefinition { + + private String smooksConfig; + + /** + * Path to the Smooks configuration file. + */ + public Builder smooksConfig(String smooksConfig) { + this.smooksConfig = smooksConfig; + return this; + } + + @Override + public SmooksDataFormat end() { + return new SmooksDataFormat(this); + } + } +} diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java index a9656a330c6b0..f70c865f28b56 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java @@ -50,6 +50,7 @@ import org.apache.camel.model.dataformat.ParquetAvroDataFormat; import org.apache.camel.model.dataformat.ProtobufDataFormat; import org.apache.camel.model.dataformat.RssDataFormat; +import org.apache.camel.model.dataformat.SmooksDataFormat; import org.apache.camel.model.dataformat.SoapDataFormat; import org.apache.camel.model.dataformat.SwiftMtDataFormat; import org.apache.camel.model.dataformat.SwiftMxDataFormat; @@ -103,6 +104,7 @@ public class DataFormatTransformerDefinition extends TransformerDefinition { @XmlElement(name = "parquetAvro", type = ParquetAvroDataFormat.class), @XmlElement(name = "protobuf", type = ProtobufDataFormat.class), @XmlElement(name = "rss", type = RssDataFormat.class), + @XmlElement(name = "smooks", type = SmooksDataFormat.class), @XmlElement(name = "soap", type = SoapDataFormat.class), @XmlElement(name = "swiftMt", type = SwiftMtDataFormat.class), @XmlElement(name = "swiftMx", type = SwiftMxDataFormat.class), diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java index 65097c1298ea2..ce5f94dc2736a 100644 --- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java +++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java @@ -53,6 +53,7 @@ import org.apache.camel.model.dataformat.ParquetAvroDataFormat; import org.apache.camel.model.dataformat.ProtobufDataFormat; import org.apache.camel.model.dataformat.RssDataFormat; +import org.apache.camel.model.dataformat.SmooksDataFormat; import org.apache.camel.model.dataformat.SoapDataFormat; import org.apache.camel.model.dataformat.SwiftMtDataFormat; import org.apache.camel.model.dataformat.SwiftMxDataFormat; @@ -232,6 +233,8 @@ private static DataFormatReifier coreReifier( return new ProtobufDataFormatReifier(camelContext, definition); } else if (definition instanceof RssDataFormat) { return new RssDataFormatReifier(camelContext, definition); + } else if (definition instanceof SmooksDataFormat) { + return new SmooksDataFormatReifier(camelContext, definition); } else if (definition instanceof SoapDataFormat) { return new SoapDataFormatReifier(camelContext, definition); } else if (definition instanceof SyslogDataFormat) { diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SmooksDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SmooksDataFormatReifier.java new file mode 100644 index 0000000000000..e334e6d90292f --- /dev/null +++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SmooksDataFormatReifier.java @@ -0,0 +1,36 @@ +/* + * 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.reifier.dataformat; + +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.model.DataFormatDefinition; +import org.apache.camel.model.dataformat.SmooksDataFormat; + +public class SmooksDataFormatReifier extends DataFormatReifier { + + public SmooksDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) { + super(camelContext, (SmooksDataFormat) definition); + } + + @Override + protected void prepareDataFormatConfig(Map properties) { + properties.put("smooksConfig", definition.getSmooksConfig()); + } + +} diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties index ca8d6981a6e84..d6145c7729c5b 100644 --- a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties +++ b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties @@ -31,6 +31,7 @@ pgp protobuf protobufJackson rss +smooks snakeYaml soap swiftMt diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java index 479084a27a343..fa13ed925ab02 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java @@ -2017,6 +2017,12 @@ protected ProtobufDataFormat doParseProtobufDataFormat() throws IOException, Xml protected RssDataFormat doParseRssDataFormat() throws IOException, XmlPullParserException { return doParse(new RssDataFormat(), identifiedTypeAttributeHandler(), noElementHandler(), noValueHandler()); } + protected SmooksDataFormat doParseSmooksDataFormat() throws IOException, XmlPullParserException { + return doParse(new SmooksDataFormat(), (def, key, val) -> switch (key) { + case "smooksConfig": def.setSmooksConfig(val); yield true; + default: yield identifiedTypeAttributeHandler().accept(def, key, val); + }, noElementHandler(), noValueHandler()); + } protected SoapDataFormat doParseSoapDataFormat() throws IOException, XmlPullParserException { return doParse(new SoapDataFormat(), (def, key, val) -> switch (key) { case "contextPath": def.setContextPath(val); yield true; @@ -2855,6 +2861,7 @@ protected DataFormatDefinition doParseDataFormatDefinitionRef(String key) throws case "parquetAvro": return doParseParquetAvroDataFormat(); case "protobuf": return doParseProtobufDataFormat(); case "rss": return doParseRssDataFormat(); + case "smooks": return doParseSmooksDataFormat(); case "soap": return doParseSoapDataFormat(); case "swiftMt": return doParseSwiftMtDataFormat(); case "swiftMx": return doParseSwiftMxDataFormat(); diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java index ce5841617db86..52222734e0f6a 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java @@ -520,6 +520,9 @@ public void writeProtobufDataFormat(ProtobufDataFormat def) throws IOException { public void writeRssDataFormat(RssDataFormat def) throws IOException { doWriteRssDataFormat("rss", def); } + public void writeSmooksDataFormat(SmooksDataFormat def) throws IOException { + doWriteSmooksDataFormat("smooks", def); + } public void writeSoapDataFormat(SoapDataFormat def) throws IOException { doWriteSoapDataFormat("soap", def); } @@ -1170,6 +1173,7 @@ protected void doWriteMarshalDefinition(String name, MarshalDefinition def) thro case "ParquetAvroDataFormat" -> doWriteParquetAvroDataFormat("parquetAvro", (ParquetAvroDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); @@ -1919,6 +1923,7 @@ protected void doWriteUnmarshalDefinition(String name, UnmarshalDefinition def) case "ParquetAvroDataFormat" -> doWriteParquetAvroDataFormat("parquetAvro", (ParquetAvroDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); @@ -2479,6 +2484,7 @@ protected void doWriteDataFormatsDefinition(String name, DataFormatsDefinition d case "PGPDataFormat" -> doWritePGPDataFormat("pgp", (PGPDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); @@ -2727,6 +2733,12 @@ protected void doWriteRssDataFormat(String name, RssDataFormat def) throws IOExc doWriteIdentifiedTypeAttributes(def); endElement(name); } + protected void doWriteSmooksDataFormat(String name, SmooksDataFormat def) throws IOException { + startElement(name); + doWriteIdentifiedTypeAttributes(def); + doWriteAttribute("smooksConfig", def.getSmooksConfig()); + endElement(name); + } protected void doWriteSoapDataFormat(String name, SoapDataFormat def) throws IOException { startElement(name); doWriteIdentifiedTypeAttributes(def); @@ -3578,6 +3590,7 @@ protected void doWriteDataFormatTransformerDefinition(String name, DataFormatTra case "ParquetAvroDataFormat" -> doWriteParquetAvroDataFormat("parquetAvro", (ParquetAvroDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java index 75466431c09a6..9c9b14b29230b 100644 --- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java +++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java @@ -520,6 +520,9 @@ public void writeProtobufDataFormat(ProtobufDataFormat def) throws IOException { public void writeRssDataFormat(RssDataFormat def) throws IOException { doWriteRssDataFormat("rss", def); } + public void writeSmooksDataFormat(SmooksDataFormat def) throws IOException { + doWriteSmooksDataFormat("smooks", def); + } public void writeSoapDataFormat(SoapDataFormat def) throws IOException { doWriteSoapDataFormat("soap", def); } @@ -1170,6 +1173,7 @@ protected void doWriteMarshalDefinition(String name, MarshalDefinition def) thro case "ParquetAvroDataFormat" -> doWriteParquetAvroDataFormat("parquetAvro", (ParquetAvroDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); @@ -1919,6 +1923,7 @@ protected void doWriteUnmarshalDefinition(String name, UnmarshalDefinition def) case "ParquetAvroDataFormat" -> doWriteParquetAvroDataFormat("parquetAvro", (ParquetAvroDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); @@ -2479,6 +2484,7 @@ protected void doWriteDataFormatsDefinition(String name, DataFormatsDefinition d case "PGPDataFormat" -> doWritePGPDataFormat("pgp", (PGPDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); @@ -2727,6 +2733,12 @@ protected void doWriteRssDataFormat(String name, RssDataFormat def) throws IOExc doWriteIdentifiedTypeAttributes(def); endElement(name); } + protected void doWriteSmooksDataFormat(String name, SmooksDataFormat def) throws IOException { + startElement(name); + doWriteIdentifiedTypeAttributes(def); + doWriteAttribute("smooksConfig", def.getSmooksConfig()); + endElement(name); + } protected void doWriteSoapDataFormat(String name, SoapDataFormat def) throws IOException { startElement(name); doWriteIdentifiedTypeAttributes(def); @@ -3578,6 +3590,7 @@ protected void doWriteDataFormatTransformerDefinition(String name, DataFormatTra case "ParquetAvroDataFormat" -> doWriteParquetAvroDataFormat("parquetAvro", (ParquetAvroDataFormat) v); case "ProtobufDataFormat" -> doWriteProtobufDataFormat("protobuf", (ProtobufDataFormat) v); case "RssDataFormat" -> doWriteRssDataFormat("rss", (RssDataFormat) v); + case "SmooksDataFormat" -> doWriteSmooksDataFormat("smooks", (SmooksDataFormat) v); case "SoapDataFormat" -> doWriteSoapDataFormat("soap", (SoapDataFormat) v); case "SwiftMtDataFormat" -> doWriteSwiftMtDataFormat("swiftMt", (SwiftMtDataFormat) v); case "SwiftMxDataFormat" -> doWriteSwiftMxDataFormat("swiftMx", (SwiftMxDataFormat) v); diff --git a/docs/components/modules/dataformats/examples/json/smooks.json b/docs/components/modules/dataformats/examples/json/smooks.json new file mode 120000 index 0000000000000..87704161dc952 --- /dev/null +++ b/docs/components/modules/dataformats/examples/json/smooks.json @@ -0,0 +1 @@ +../../../../../../components/camel-smooks/src/generated/resources/META-INF/org/apache/camel/dataformat/smooks/smooks.json \ No newline at end of file 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 21479d47ce126..e818af3cfa55a 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 @@ -13212,7 +13212,7 @@ public static SmbEndpointBuilderFactory.SmbEndpointBuilder smb(String componentN * Syntax: smooks:smooksConfig * * Path parameter: smooksConfig (required) - * Smooks XML configuration file + * Path to the Smooks configuration file * This option can also be loaded from an existing file, by prefixing with * file: or classpath: followed by the location of the file. * @@ -13234,7 +13234,7 @@ public static SmooksEndpointBuilderFactory.SmooksEndpointBuilder smooks(String p * Syntax: smooks:smooksConfig * * Path parameter: smooksConfig (required) - * Smooks XML configuration file + * Path to the Smooks configuration file * This option can also be loaded from an existing file, by prefixing with * file: or classpath: followed by the location of the file. * diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SmooksEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SmooksEndpointBuilderFactory.java index 2d76309e86062..387e4e65defad 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SmooksEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SmooksEndpointBuilderFactory.java @@ -855,7 +855,7 @@ public interface SmooksBuilders { * Syntax: smooks:smooksConfig * * Path parameter: smooksConfig (required) - * Smooks XML configuration file + * Path to the Smooks configuration file * This option can also be loaded from an existing file, by prefixing * with file: or classpath: followed by the location of the file. * @@ -877,7 +877,7 @@ default SmooksEndpointBuilder smooks(String path) { * Syntax: smooks:smooksConfig * * Path parameter: smooksConfig (required) - * Smooks XML configuration file + * Path to the Smooks configuration file * This option can also be loaded from an existing file, by prefixing * with file: or classpath: followed by the location of the file. * diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java index 2c8db785ea248..108aa6c669c54 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java @@ -163,6 +163,7 @@ import org.apache.camel.model.dataformat.ParquetAvroDataFormat; import org.apache.camel.model.dataformat.ProtobufDataFormat; import org.apache.camel.model.dataformat.RssDataFormat; +import org.apache.camel.model.dataformat.SmooksDataFormat; import org.apache.camel.model.dataformat.SoapDataFormat; import org.apache.camel.model.dataformat.SwiftMtDataFormat; import org.apache.camel.model.dataformat.SwiftMxDataFormat; @@ -3603,6 +3604,7 @@ protected boolean setProperty(DataFormatDefinition target, String propertyKey, @YamlProperty(name = "protobuf", type = "object:org.apache.camel.model.dataformat.ProtobufDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "scheme", type = "string"), + @YamlProperty(name = "smooks", type = "object:org.apache.camel.model.dataformat.SmooksDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "swiftMt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "swiftMx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat", oneOf = "dataFormatType"), @@ -3770,6 +3772,11 @@ protected boolean setProperty(DataFormatTransformerDefinition target, String pro target.setDataFormatType(val); break; } + case "smooks": { + org.apache.camel.model.dataformat.SmooksDataFormat val = asType(node, org.apache.camel.model.dataformat.SmooksDataFormat.class); + target.setDataFormatType(val); + break; + } case "soap": { org.apache.camel.model.dataformat.SoapDataFormat val = asType(node, org.apache.camel.model.dataformat.SoapDataFormat.class); target.setDataFormatType(val); @@ -3911,6 +3918,7 @@ protected boolean setProperty(DataFormatTransformerDefinition target, String pro @YamlProperty(name = "pgp", type = "object:org.apache.camel.model.dataformat.PGPDataFormat"), @YamlProperty(name = "protobuf", type = "object:org.apache.camel.model.dataformat.ProtobufDataFormat"), @YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat"), + @YamlProperty(name = "smooks", type = "object:org.apache.camel.model.dataformat.SmooksDataFormat"), @YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat"), @YamlProperty(name = "swiftMt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat"), @YamlProperty(name = "swiftMx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat"), @@ -4217,6 +4225,16 @@ protected boolean setProperty(DataFormatsDefinition target, String propertyKey, target.setDataFormats(existing); break; } + case "smooks": { + org.apache.camel.model.dataformat.SmooksDataFormat val = asType(node, org.apache.camel.model.dataformat.SmooksDataFormat.class); + java.util.List existing = target.getDataFormats(); + if (existing == null) { + existing = new java.util.ArrayList<>(); + } + existing.add(val); + target.setDataFormats(existing); + break; + } case "soap": { org.apache.camel.model.dataformat.SoapDataFormat val = asType(node, org.apache.camel.model.dataformat.SoapDataFormat.class); java.util.List existing = target.getDataFormats(); @@ -9644,6 +9662,7 @@ protected boolean setProperty(LoopDefinition target, String propertyKey, @YamlProperty(name = "pgp", type = "object:org.apache.camel.model.dataformat.PGPDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "protobuf", type = "object:org.apache.camel.model.dataformat.ProtobufDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat", oneOf = "dataFormatType"), + @YamlProperty(name = "smooks", type = "object:org.apache.camel.model.dataformat.SmooksDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "swiftMt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "swiftMx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat", oneOf = "dataFormatType"), @@ -9812,6 +9831,11 @@ protected boolean setProperty(MarshalDefinition target, String propertyKey, target.setDataFormatType(val); break; } + case "smooks": { + org.apache.camel.model.dataformat.SmooksDataFormat val = asType(node, org.apache.camel.model.dataformat.SmooksDataFormat.class); + target.setDataFormatType(val); + break; + } case "soap": { org.apache.camel.model.dataformat.SoapDataFormat val = asType(node, org.apache.camel.model.dataformat.SoapDataFormat.class); target.setDataFormatType(val); @@ -17257,6 +17281,51 @@ protected boolean setProperty(SimpleExpression target, String propertyKey, } } + @YamlType( + nodes = "smooks", + types = org.apache.camel.model.dataformat.SmooksDataFormat.class, + order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1, + displayName = "Smooks", + description = "Transform XML and non-XML data using Smooks. A configuration for a SmooksDataFormat should not allocate system resources because SmooksDataFormat does not close those resources.", + deprecated = false, + properties = { + @YamlProperty(name = "id", type = "string", description = "The id of this node", displayName = "Id"), + @YamlProperty(name = "smooksConfig", type = "string", required = true, description = "Path to the Smooks configuration file.", displayName = "Smooks Config") + } + ) + public static class SmooksDataFormatDeserializer extends YamlDeserializerBase { + public SmooksDataFormatDeserializer() { + super(SmooksDataFormat.class); + } + + @Override + protected SmooksDataFormat newInstance() { + return new SmooksDataFormat(); + } + + @Override + protected boolean setProperty(SmooksDataFormat target, String propertyKey, + String propertyName, Node node) { + propertyKey = org.apache.camel.util.StringHelper.dashToCamelCase(propertyKey); + switch(propertyKey) { + case "id": { + String val = asText(node); + target.setId(val); + break; + } + case "smooksConfig": { + String val = asText(node); + target.setSmooksConfig(val); + break; + } + default: { + return false; + } + } + return true; + } + } + @YamlType( nodes = "soap", inline = true, @@ -20189,6 +20258,7 @@ protected boolean setProperty(UniVocityTsvDataFormat target, String propertyKey, @YamlProperty(name = "pgp", type = "object:org.apache.camel.model.dataformat.PGPDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "protobuf", type = "object:org.apache.camel.model.dataformat.ProtobufDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat", oneOf = "dataFormatType"), + @YamlProperty(name = "smooks", type = "object:org.apache.camel.model.dataformat.SmooksDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "swiftMt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat", oneOf = "dataFormatType"), @YamlProperty(name = "swiftMx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat", oneOf = "dataFormatType"), @@ -20362,6 +20432,11 @@ protected boolean setProperty(UnmarshalDefinition target, String propertyKey, target.setDataFormatType(val); break; } + case "smooks": { + org.apache.camel.model.dataformat.SmooksDataFormat val = asType(node, org.apache.camel.model.dataformat.SmooksDataFormat.class); + target.setDataFormatType(val); + break; + } case "soap": { org.apache.camel.model.dataformat.SoapDataFormat val = asType(node, org.apache.camel.model.dataformat.SoapDataFormat.class); target.setDataFormatType(val); diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java index 359f651bf7a54..464872791b32e 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java @@ -485,6 +485,8 @@ public ConstructNode resolve(String id) { case "org.apache.camel.model.SetVariablesDefinition": return new ModelDeserializers.SetVariablesDefinitionDeserializer(); case "simple": return new ModelDeserializers.SimpleExpressionDeserializer(); case "org.apache.camel.model.language.SimpleExpression": return new ModelDeserializers.SimpleExpressionDeserializer(); + case "smooks": return new ModelDeserializers.SmooksDataFormatDeserializer(); + case "org.apache.camel.model.dataformat.SmooksDataFormat": return new ModelDeserializers.SmooksDataFormatDeserializer(); case "soap": return new ModelDeserializers.SoapDataFormatDeserializer(); case "org.apache.camel.model.dataformat.SoapDataFormat": return new ModelDeserializers.SoapDataFormatDeserializer(); case "sort": return new ModelDeserializers.SortDefinitionDeserializer(); diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json index 648c27fed1360..fa15548b8de49 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json @@ -2870,6 +2870,8 @@ "required" : [ "protobuf" ] }, { "required" : [ "rss" ] + }, { + "required" : [ "smooks" ] }, { "required" : [ "soap" ] }, { @@ -3108,6 +3110,14 @@ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.RssDataFormat" } } + }, { + "type" : "object", + "required" : [ "smooks" ], + "properties" : { + "smooks" : { + "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SmooksDataFormat" + } + } }, { "type" : "object", "required" : [ "soap" ], @@ -3275,6 +3285,7 @@ "pgp" : { }, "protobuf" : { }, "rss" : { }, + "smooks" : { }, "soap" : { }, "swiftMt" : { }, "swiftMx" : { }, @@ -7629,6 +7640,7 @@ "pgp" : { }, "protobuf" : { }, "rss" : { }, + "smooks" : { }, "soap" : { }, "swiftMt" : { }, "swiftMx" : { }, @@ -7709,6 +7721,8 @@ "required" : [ "protobuf" ] }, { "required" : [ "rss" ] + }, { + "required" : [ "smooks" ] }, { "required" : [ "soap" ] }, { @@ -7947,6 +7961,14 @@ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.RssDataFormat" } } + }, { + "type" : "object", + "required" : [ "smooks" ], + "properties" : { + "smooks" : { + "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SmooksDataFormat" + } + } }, { "type" : "object", "required" : [ "soap" ], @@ -10602,6 +10624,9 @@ "rss" : { "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.RssDataFormat" }, + "smooks" : { + "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SmooksDataFormat" + }, "soap" : { "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat" }, @@ -11669,6 +11694,25 @@ } } }, + "org.apache.camel.model.dataformat.SmooksDataFormat" : { + "title" : "Smooks", + "description" : "Transform XML and non-XML data using Smooks. A configuration for a SmooksDataFormat should not allocate system resources because SmooksDataFormat does not close those resources.", + "type" : "object", + "additionalProperties" : false, + "properties" : { + "id" : { + "type" : "string", + "title" : "Id", + "description" : "The id of this node" + }, + "smooksConfig" : { + "type" : "string", + "title" : "Smooks Config", + "description" : "Path to the Smooks configuration file." + } + }, + "required" : [ "smooksConfig" ] + }, "org.apache.camel.model.dataformat.SoapDataFormat" : { "title" : "SOAP", "description" : "Marshal Java objects to SOAP messages and back.", @@ -16102,6 +16146,8 @@ "required" : [ "protobuf" ] }, { "required" : [ "rss" ] + }, { + "required" : [ "smooks" ] }, { "required" : [ "soap" ] }, { @@ -16340,6 +16386,14 @@ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.RssDataFormat" } } + }, { + "type" : "object", + "required" : [ "smooks" ], + "properties" : { + "smooks" : { + "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SmooksDataFormat" + } + } }, { "type" : "object", "required" : [ "soap" ], @@ -16494,6 +16548,7 @@ "pgp" : { }, "protobuf" : { }, "rss" : { }, + "smooks" : { }, "soap" : { }, "swiftMt" : { }, "swiftMx" : { },