This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit bee4dc6d78df2ad05e8c2b74e691ff2c46e1840c Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Aug 5 14:37:17 2021 +0200 CAMEL-16844: component docs - prepare for regen tables with better titles --- .../src/main/docs/xchange-component.adoc | 49 +---- .../camel-xj/src/main/docs/xj-component.adoc | 64 +----- .../src/main/docs/xmlsecurity-sign-component.adoc | 122 +----------- .../main/docs/xmlsecurity-verify-component.adoc | 217 +++------------------ .../camel-xmpp/src/main/docs/xmpp-component.adoc | 68 +------ .../src/main/docs/xslt-saxon-component.adoc | 68 +------ .../camel-xslt/src/main/docs/xslt-component.adoc | 63 +----- 7 files changed, 51 insertions(+), 600 deletions(-) diff --git a/components/camel-xchange/src/main/docs/xchange-component.adoc b/components/camel-xchange/src/main/docs/xchange-component.adoc index 6a9f183..e3e8bd9 100644 --- a/components/camel-xchange/src/main/docs/xchange-component.adoc +++ b/components/camel-xchange/src/main/docs/xchange-component.adoc @@ -32,60 +32,19 @@ for this component: == URI format -[source,java] --------------------------------- xchange://exchange?options --------------------------------- -== Options - -// component options: START -The XChange component supports 2 options, which are listed below. - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *autowiredEnabled* (advanced) | 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. | true | boolean -|=== +// component options: START // component options: END - // endpoint options: START -The XChange endpoint is configured using URI syntax: - ----- -xchange:name ----- - -with the following path and query parameters: - -=== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *name* | *Required* The exchange to connect to | | String -|=== - - -=== Query Parameters (5 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *currency* (producer) | The currency | | Currency -| *currencyPair* (producer) | The currency pair | | String -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *method* (producer) | *Required* The method to execute. There are 8 enums and the value can be one of: balances, fundingHistory, wallets, currencies, currencyMetaData, currencyPairs, currencyPairMetaData, ticker | | XChangeMethod -| *service* (producer) | *Required* The service to call. There are 3 enums and the value can be one of: marketdata, metadata, account | | XChangeService -|=== // endpoint options: END + == Authentication This component communicates with supported crypto currency exchanges via REST API. Some API requests use simple unauthenticated GET request. @@ -106,10 +65,6 @@ apiKey = GuRW0********* secretKey = nKLki************ ---- -== Message Headers - -[TODO] - == Samples In this sample we find the current Bitcoin market price in USDT: diff --git a/components/camel-xj/src/main/docs/xj-component.adoc b/components/camel-xj/src/main/docs/xj-component.adoc index 31c7c31..256ef8a 100644 --- a/components/camel-xj/src/main/docs/xj-component.adoc +++ b/components/camel-xj/src/main/docs/xj-component.adoc @@ -47,75 +47,15 @@ The *transformDirection* option is mandatory and must be either XML2JSON or JSON The *templateName* parameter allows to use _identify transforma_ by specifying the name `identity`. -== Component options - -// component options: START -The XJ component supports 10 options, which are listed below. - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *contentCache* (producer) | Cache for the resource content (the stylesheet file) when it is loaded. If set to false Camel will reload the stylesheet file on each message processing. This is good for development. A cached stylesheet can be forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *autowiredEnabled* (advanced) | 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. | true | boolean -| *saxonConfiguration* (advanced) | To use a custom Saxon configuration | | Configuration -| *saxonConfigurationProperties* (advanced) | To set custom Saxon configuration properties | | Map -| *saxonExtensionFunctions* (advanced) | Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon to the classpath. The function is looked up in the registry, where you can comma to separate multiple values to lookup. | | String -| *transformerFactoryClass* (advanced) | To use a custom XSLT transformer factory, specified as a FQN class name | | String -| *transformerFactory{zwsp}ConfigurationStrategy* (advanced) | A configuration strategy to apply on freshly created instances of TransformerFactory. | | TransformerFactoryConfigurationStrategy -| *uriResolver* (advanced) | To use a custom UriResolver. Should not be used together with the option 'uriResolverFactory'. | | URIResolver -| *uriResolverFactory* (advanced) | To use a custom UriResolver which depends on a dynamic endpoint resource URI. Should not be used together with the option 'uriResolver'. | | XsltUriResolverFactory -|=== +// component options: START // component options: END - // endpoint options: START -The XJ endpoint is configured using URI syntax: - ----- -xj:resourceUri ----- - -with the following path and query parameters: - -=== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *resourceUri* | *Required* Path to the template. The following is supported by the default URIResolver. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will call a method on a bean to be used as the resource. For bean you can specify the method name after dot, eg bean:myBean.myMethod | | String -|=== - - -=== Query Parameters (17 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *allowStAX* (producer) | Whether to allow using StAX as the javax.xml.transform.Source. You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon). The Xalan library (default in JVM) does not support StAXSource. | true | boolean -| *contentCache* (producer) | Cache for the resource content (the stylesheet file) when it is loaded. If set to false Camel will reload the stylesheet file on each message processing. This is good for development. A cached stylesheet can be forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean -| *deleteOutputFile* (producer) | If you have output=file then this option dictates whether or not the output file should be deleted when the Exchange is done processing. For example suppose the output file is a temporary file, then it can be a good idea to delete it after use. | false | boolean -| *failOnNullBody* (producer) | Whether or not to throw an exception if the input body is null. | true | boolean -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *output* (producer) | Option to specify which output type to use. Possible values are: string, bytes, DOM, file. The first three options are all in memory based, where as file is streamed directly to a java.io.File. For file you must specify the filename in the IN header with the key Exchange.XSLT_FILE_NAME which is also CamelXsltFileName. Also any paths leading to the filename must be created beforehand, otherwise an exception is thrown at runtime. There are 4 enums and the value can [...] -| *transformDirection* (producer) | *Required* Transform direction. Either XML2JSON or JSON2XML. There are 2 enums and the value can be one of: XML2JSON, JSON2XML | | TransformDirection -| *transformerCacheSize* (producer) | The number of javax.xml.transform.Transformer object that are cached for reuse to avoid calls to Template.newTransformer(). | 0 | int -| *entityResolver* (advanced) | To use a custom org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource. | | EntityResolver -| *errorListener* (advanced) | Allows to configure to use a custom javax.xml.transform.ErrorListener. Beware when doing this then the default error listener which captures any errors or fatal errors and store information on the Exchange as properties is not in use. So only use this option for special use-cases. | | ErrorListener -| *resultHandlerFactory* (advanced) | Allows you to use a custom org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using custom org.apache.camel.builder.xml.ResultHandler types. | | ResultHandlerFactory -| *saxonConfiguration* (advanced) | To use a custom Saxon configuration | | Configuration -| *saxonExtensionFunctions* (advanced) | Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon to the classpath. The function is looked up in the registry, where you can comma to separate multiple values to lookup. | | String -| *transformerFactory* (advanced) | To use a custom XSLT transformer factory | | TransformerFactory -| *transformerFactoryClass* (advanced) | To use a custom XSLT transformer factory, specified as a FQN class name | | String -| *transformerFactory{zwsp}ConfigurationStrategy* (advanced) | A configuration strategy to apply on freshly created instances of TransformerFactory. | | TransformerFactoryConfigurationStrategy -| *uriResolver* (advanced) | To use a custom javax.xml.transform.URIResolver | | URIResolver -|=== // endpoint options: END + == Using XJ endpoints === Converting JSON to XML diff --git a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc index 5a3e088..7035dba 100644 --- a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc +++ b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc @@ -49,6 +49,13 @@ for this component: </dependency> ---- + +// component options: START +// component options: END +// endpoint options: START +// endpoint options: END + + == XML Signature Wrapping Modes XML Signature differs between enveloped, enveloping, and detached XML @@ -160,7 +167,6 @@ Elements): The camel component consists of two endpoints which have the following URI format: -[source] ---- xmlsecurity-sign:name[?options] xmlsecurity-verify:name[?options] @@ -229,118 +235,6 @@ the parent element of the Signature element; see option For creating _detached_ XML signatures, see sub-chapter "Detached XML Signatures as Siblings of the Signed Elements". -== Component Options - - - - - -// component options: START -The XML Security Sign component supports 29 options, which are listed below. - - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *addKeyInfoReference* (producer) | In order to protect the KeyInfo element from tampering you can add a reference to the signed info element so that it is protected via the signature value. The default value is true. Only relevant when a KeyInfo is returned by KeyAccessor. and KeyInfo#getId() is not null. | true | Boolean -| *baseUri* (producer) | You can set a base URI which is used in the URI dereferencing. Relative URIs are then concatenated with the base URI. | | String -| *canonicalizationMethod* (producer) | Canonicalization method used to canonicalize the SignedInfo element before the digest is calculated. You can use the helper methods XmlSignatureHelper.getCanonicalizationMethod(String algorithm) or getCanonicalizationMethod(String algorithm, List inclusiveNamespacePrefixes) to create a canonicalization method. | http://www.w3.org/TR/2001/REC-xml-c14n-20010315 | AlgorithmMethod -| *clearHeaders* (producer) | Determines if the XML signature specific headers be cleared after signing and verification. Defaults to true. | true | Boolean -| *contentObjectId* (producer) | Sets the content object Id attribute value. By default a UUID is generated. If you set the null value, then a new UUID will be generated. Only used in the enveloping case. | | String -| *contentReferenceType* (producer) | Type of the content reference. The default value is null. This value can be overwritten by the header XmlSignatureConstants#HEADER_CONTENT_REFERENCE_TYPE. | | String -| *contentReferenceUri* (producer) | Reference URI for the content to be signed. Only used in the enveloped case. If the reference URI contains an ID attribute value, then the resource schema URI ( setSchemaResourceUri(String)) must also be set because the schema validator will then find out which attributes are ID attributes. Will be ignored in the enveloping or detached case. | | String -| *cryptoContextProperties* (producer) | Sets the crypto context properties. See {link XMLCryptoContext#setProperty(String, Object)}. Possible properties are defined in XMLSignContext an XMLValidateContext (see Supported Properties). The following properties are set by default to the value Boolean#TRUE for the XML validation. If you want to switch these features off you must set the property value to Boolean#FALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.dsig.cacheReference | | Map -| *digestAlgorithm* (producer) | Digest algorithm URI. Optional parameter. This digest algorithm is used for calculating the digest of the input message. If this digest algorithm is not specified then the digest algorithm is calculated from the signature algorithm. Example: \http://www.w3.org/2001/04/xmlenc#sha256 | | String -| *disallowDoctypeDecl* (producer) | Disallows that the incoming XML document contains DTD DOCTYPE declaration. The default value is Boolean#TRUE. | true | Boolean -| *keyAccessor* (producer) | For the signing process, a private key is necessary. You specify a key accessor bean which provides this private key. The key accessor bean must implement the KeyAccessor interface. The package org.apache.camel.component.xmlsecurity.api contains the default implementation class DefaultKeyAccessor which reads the private key from a Java keystore. | | KeyAccessor -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *omitXmlDeclaration* (producer) | Indicator whether the XML declaration in the outgoing message body should be omitted. Default value is false. Can be overwritten by the header XmlSignatureConstants#HEADER_OMIT_XML_DECLARATION. | false | Boolean -| *outputXmlEncoding* (producer) | The character encoding of the resulting signed XML document. If null then the encoding of the original XML document is used. | | String -| *parentLocalName* (producer) | Local name of the parent element to which the XML signature element will be added. Only relevant for enveloped XML signature. Alternatively you can also use setParentXpath(XPathFilterParameterSpec). Default value is null. The value must be null for enveloping and detached XML signature. This parameter or the parameter setParentXpath(XPathFilterParameterSpec) for enveloped signature and the parameter setXpathsToIdAttributes(List) for detached signature mus [...] -| *parentNamespace* (producer) | Namespace of the parent element to which the XML signature element will be added. | | String -| *parentXpath* (producer) | Sets the XPath to find the parent node in the enveloped case. Either you specify the parent node via this method or the local name and namespace of the parent with the methods setParentLocalName(String) and setParentNamespace(String). Default value is null. The value must be null for enveloping and detached XML signature. If the parameters parentXpath and parentLocalName are specified in the same configuration then an exception is thrown. | | XPathFilterPara [...] -| *plainText* (producer) | Indicator whether the message body contains plain text. The default value is false, indicating that the message body contains XML. The value can be overwritten by the header XmlSignatureConstants#HEADER_MESSAGE_IS_PLAIN_TEXT. | false | Boolean -| *plainTextEncoding* (producer) | Encoding of the plain text. Only relevant if the message body is plain text (see parameter plainText. Default value is UTF-8. | UTF-8 | String -| *prefixForXmlSignatureNamespace* (producer) | Namespace prefix for the XML signature namespace \http://www.w3.org/2000/09/xmldsig#. Default value is ds. If null or an empty value is set then no prefix is used for the XML signature namespace. See best practice \http://www.w3.org/TR/xmldsig-bestpractices/#signing-xml- without-namespaces | ds | String -| *properties* (producer) | For adding additional References and Objects to the XML signature which contain additional properties, you can provide a bean which implements the XmlSignatureProperties interface. | | XmlSignatureProperties -| *schemaResourceUri* (producer) | Classpath to the XML Schema. Must be specified in the detached XML Signature case for determining the ID attributes, might be set in the enveloped and enveloping case. If set, then the XML document is validated with the specified XML schema. The schema resource URI can be overwritten by the header XmlSignatureConstants#HEADER_SCHEMA_RESOURCE_URI. | | String -| *signatureAlgorithm* (producer) | Signature algorithm. Default value is \http://www.w3.org/2000/09/xmldsig#rsa-sha1. | http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 | String -| *signatureId* (producer) | Sets the signature Id. If this parameter is not set (null value) then a unique ID is generated for the signature ID (default). If this parameter is set to (empty string) then no Id attribute is created in the signature element. | | String -| *transformMethods* (producer) | Transforms which are executed on the message body before the digest is calculated. By default, C14n is added and in the case of enveloped signature (see option parentLocalName) also \http://www.w3.org/2000/09/xmldsig#enveloped-signature is added at position 0 of the list. Use methods in XmlSignatureHelper to create the transform methods. | | List -| *xpathsToIdAttributes* (producer) | Define the elements which are signed in the detached case via XPATH expressions to ID attributes (attributes of type ID). For each element found via the XPATH expression a detached signature is created whose reference URI contains the corresponding attribute value (preceded by '#'). The signature becomes the last sibling of the signed element. Elements with deeper hierarchy level are signed first. You can also set the XPATH list dynamically via the h [...] -| *autowiredEnabled* (advanced) | 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. | true | boolean -| *signerConfiguration* (advanced) | To use a shared XmlSignerConfiguration configuration to use as base for configuring endpoints. | | XmlSignerConfiguration -| *uriDereferencer* (advanced) | If you want to restrict the remote access via reference URIs, you can set an own dereferencer. Optional parameter. If not set the provider default dereferencer is used which can resolve URI fragments, HTTP, file and XPpointer URIs. Attention: The implementation is provider dependent! | | URIDereferencer -|=== -// component options: END - - - - - - -== Endpoint Options - - -// endpoint options: START -The XML Security Sign endpoint is configured using URI syntax: - ----- -xmlsecurity-sign:name ----- - -with the following path and query parameters: - -=== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *name* | *Required* The name part in the URI can be chosen by the user to distinguish between different signer endpoints within the camel context. | | String -|=== - - -=== Query Parameters (27 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *addKeyInfoReference* (producer) | In order to protect the KeyInfo element from tampering you can add a reference to the signed info element so that it is protected via the signature value. The default value is true. Only relevant when a KeyInfo is returned by KeyAccessor. and KeyInfo#getId() is not null. | true | Boolean -| *baseUri* (producer) | You can set a base URI which is used in the URI dereferencing. Relative URIs are then concatenated with the base URI. | | String -| *canonicalizationMethod* (producer) | Canonicalization method used to canonicalize the SignedInfo element before the digest is calculated. You can use the helper methods XmlSignatureHelper.getCanonicalizationMethod(String algorithm) or getCanonicalizationMethod(String algorithm, List inclusiveNamespacePrefixes) to create a canonicalization method. | http://www.w3.org/TR/2001/REC-xml-c14n-20010315 | AlgorithmMethod -| *clearHeaders* (producer) | Determines if the XML signature specific headers be cleared after signing and verification. Defaults to true. | true | Boolean -| *contentObjectId* (producer) | Sets the content object Id attribute value. By default a UUID is generated. If you set the null value, then a new UUID will be generated. Only used in the enveloping case. | | String -| *contentReferenceType* (producer) | Type of the content reference. The default value is null. This value can be overwritten by the header XmlSignatureConstants#HEADER_CONTENT_REFERENCE_TYPE. | | String -| *contentReferenceUri* (producer) | Reference URI for the content to be signed. Only used in the enveloped case. If the reference URI contains an ID attribute value, then the resource schema URI ( setSchemaResourceUri(String)) must also be set because the schema validator will then find out which attributes are ID attributes. Will be ignored in the enveloping or detached case. | | String -| *cryptoContextProperties* (producer) | Sets the crypto context properties. See {link XMLCryptoContext#setProperty(String, Object)}. Possible properties are defined in XMLSignContext an XMLValidateContext (see Supported Properties). The following properties are set by default to the value Boolean#TRUE for the XML validation. If you want to switch these features off you must set the property value to Boolean#FALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.dsig.cacheReference | | Map -| *digestAlgorithm* (producer) | Digest algorithm URI. Optional parameter. This digest algorithm is used for calculating the digest of the input message. If this digest algorithm is not specified then the digest algorithm is calculated from the signature algorithm. Example: \http://www.w3.org/2001/04/xmlenc#sha256 | | String -| *disallowDoctypeDecl* (producer) | Disallows that the incoming XML document contains DTD DOCTYPE declaration. The default value is Boolean#TRUE. | true | Boolean -| *keyAccessor* (producer) | For the signing process, a private key is necessary. You specify a key accessor bean which provides this private key. The key accessor bean must implement the KeyAccessor interface. The package org.apache.camel.component.xmlsecurity.api contains the default implementation class DefaultKeyAccessor which reads the private key from a Java keystore. | | KeyAccessor -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *omitXmlDeclaration* (producer) | Indicator whether the XML declaration in the outgoing message body should be omitted. Default value is false. Can be overwritten by the header XmlSignatureConstants#HEADER_OMIT_XML_DECLARATION. | false | Boolean -| *outputXmlEncoding* (producer) | The character encoding of the resulting signed XML document. If null then the encoding of the original XML document is used. | | String -| *parentLocalName* (producer) | Local name of the parent element to which the XML signature element will be added. Only relevant for enveloped XML signature. Alternatively you can also use setParentXpath(XPathFilterParameterSpec). Default value is null. The value must be null for enveloping and detached XML signature. This parameter or the parameter setParentXpath(XPathFilterParameterSpec) for enveloped signature and the parameter setXpathsToIdAttributes(List) for detached signature mus [...] -| *parentNamespace* (producer) | Namespace of the parent element to which the XML signature element will be added. | | String -| *parentXpath* (producer) | Sets the XPath to find the parent node in the enveloped case. Either you specify the parent node via this method or the local name and namespace of the parent with the methods setParentLocalName(String) and setParentNamespace(String). Default value is null. The value must be null for enveloping and detached XML signature. If the parameters parentXpath and parentLocalName are specified in the same configuration then an exception is thrown. | | XPathFilterPara [...] -| *plainText* (producer) | Indicator whether the message body contains plain text. The default value is false, indicating that the message body contains XML. The value can be overwritten by the header XmlSignatureConstants#HEADER_MESSAGE_IS_PLAIN_TEXT. | false | Boolean -| *plainTextEncoding* (producer) | Encoding of the plain text. Only relevant if the message body is plain text (see parameter plainText. Default value is UTF-8. | UTF-8 | String -| *prefixForXmlSignatureNamespace* (producer) | Namespace prefix for the XML signature namespace \http://www.w3.org/2000/09/xmldsig#. Default value is ds. If null or an empty value is set then no prefix is used for the XML signature namespace. See best practice \http://www.w3.org/TR/xmldsig-bestpractices/#signing-xml- without-namespaces | ds | String -| *properties* (producer) | For adding additional References and Objects to the XML signature which contain additional properties, you can provide a bean which implements the XmlSignatureProperties interface. | | XmlSignatureProperties -| *schemaResourceUri* (producer) | Classpath to the XML Schema. Must be specified in the detached XML Signature case for determining the ID attributes, might be set in the enveloped and enveloping case. If set, then the XML document is validated with the specified XML schema. The schema resource URI can be overwritten by the header XmlSignatureConstants#HEADER_SCHEMA_RESOURCE_URI. | | String -| *signatureAlgorithm* (producer) | Signature algorithm. Default value is \http://www.w3.org/2000/09/xmldsig#rsa-sha1. | http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 | String -| *signatureId* (producer) | Sets the signature Id. If this parameter is not set (null value) then a unique ID is generated for the signature ID (default). If this parameter is set to (empty string) then no Id attribute is created in the signature element. | | String -| *transformMethods* (producer) | Transforms which are executed on the message body before the digest is calculated. By default, C14n is added and in the case of enveloped signature (see option parentLocalName) also \http://www.w3.org/2000/09/xmldsig#enveloped-signature is added at position 0 of the list. Use methods in XmlSignatureHelper to create the transform methods. | | List -| *xpathsToIdAttributes* (producer) | Define the elements which are signed in the detached case via XPATH expressions to ID attributes (attributes of type ID). For each element found via the XPATH expression a detached signature is created whose reference URI contains the corresponding attribute value (preceded by '#'). The signature becomes the last sibling of the signed element. Elements with deeper hierarchy level are signed first. You can also set the XPATH list dynamically via the h [...] -| *uriDereferencer* (advanced) | If you want to restrict the remote access via reference URIs, you can set an own dereferencer. Optional parameter. If not set the provider default dereferencer is used which can resolve URI fragments, HTTP, file and XPpointer URIs. Attention: The implementation is provider dependent! | | URIDereferencer -|=== -// endpoint options: END - - - - === Output Node Determination in Enveloping XML Signature Case After the validation the node is extracted from the XML signature @@ -575,7 +469,7 @@ can just omit them. [source,java] ---- - Keystore keystore = ... // load a keystore +Keystore keystore = ... // load a keystore DefaultKeyAccessor accessor = new DefaultKeyAccessor(); accessor.setKeyStore(keystore); accessor.setPassword("password"); diff --git a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc index 23e7ac4..999c612 100644 --- a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc +++ b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc @@ -49,6 +49,37 @@ for this component: </dependency> ---- +== URI Format + +The camel component consists of two endpoints which have the following +URI format: + +---- +xmlsecurity-sign:name[?options] +xmlsecurity-verify:name[?options] +---- + +* With the signer endpoint, you can generate a XML signature for the +body of the in-message which can be either a XML document or a plain +text. The enveloped, enveloping, or detached (as of 12.14) XML +signature(s) will be set to the body of the out-message. +* With the verifier endpoint, you can validate an enveloped or +enveloping XML signature or even several detached XML +signatures contained in the body of the in-message; if the validation is +successful, then the original content is extracted from the XML +signature and set to the body of the out-message. +* The `name` part in the URI can be chosen by the user to distinguish +between different signer/verifier endpoints within the camel context. + + + + +// component options: START +// component options: END +// endpoint options: START +// endpoint options: END + + == XML Signature Wrapping Modes XML Signature differs between enveloped, enveloping, and detached XML @@ -154,30 +185,6 @@ Elements): ---- - -== URI Format - -The camel component consists of two endpoints which have the following -URI format: - -[source] ----- -xmlsecurity-sign:name[?options] -xmlsecurity-verify:name[?options] ----- - -* With the signer endpoint, you can generate a XML signature for the -body of the in-message which can be either a XML document or a plain -text. The enveloped, enveloping, or detached (as of 12.14) XML -signature(s) will be set to the body of the out-message. -* With the verifier endpoint, you can validate an enveloped or -enveloping XML signature or even several detached XML -signatures contained in the body of the in-message; if the validation is -successful, then the original content is extracted from the XML -signature and set to the body of the out-message. -* The `name` part in the URI can be chosen by the user to distinguish -between different signer/verifier endpoints within the camel context. - == Basic Example The following example shows the basic usage of the component. @@ -229,166 +236,6 @@ the parent element of the Signature element; see option For creating _detached_ XML signatures, see sub-chapter "Detached XML Signatures as Siblings of the Signed Elements". -== Component Options - - - - - -// component options: START -The XML Security Verify component supports 19 options, which are listed below. - - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *baseUri* (producer) | You can set a base URI which is used in the URI dereferencing. Relative URIs are then concatenated with the base URI. | | String -| *clearHeaders* (producer) | Determines if the XML signature specific headers be cleared after signing and verification. Defaults to true. | true | Boolean -| *cryptoContextProperties* (producer) | Sets the crypto context properties. See {link XMLCryptoContext#setProperty(String, Object)}. Possible properties are defined in XMLSignContext an XMLValidateContext (see Supported Properties). The following properties are set by default to the value Boolean#TRUE for the XML validation. If you want to switch these features off you must set the property value to Boolean#FALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.dsig.cacheReference | | Map -| *disallowDoctypeDecl* (producer) | Disallows that the incoming XML document contains DTD DOCTYPE declaration. The default value is Boolean#TRUE. | true | Boolean -| *keySelector* (producer) | Provides the key for validating the XML signature. | | KeySelector -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *omitXmlDeclaration* (producer) | Indicator whether the XML declaration in the outgoing message body should be omitted. Default value is false. Can be overwritten by the header XmlSignatureConstants#HEADER_OMIT_XML_DECLARATION. | false | Boolean -| *outputNodeSearch* (producer) | Sets the output node search value for determining the node from the XML signature document which shall be set to the output message body. The class of the value depends on the type of the output node search. The output node search is forwarded to XmlSignature2Message. | | Object -| *outputNodeSearchType* (producer) | Determines the search type for determining the output node which is serialized into the output message bodyF. See setOutputNodeSearch(Object). The supported default search types you can find in DefaultXmlSignature2Message. | Default | String -| *outputXmlEncoding* (producer) | The character encoding of the resulting signed XML document. If null then the encoding of the original XML document is used. | | String -| *removeSignatureElements* (producer) | Indicator whether the XML signature elements (elements with local name Signature and namesapce \http://www.w3.org/2000/09/xmldsig#) shall be removed from the document set to the output message. Normally, this is only necessary, if the XML signature is enveloped. The default value is Boolean#FALSE. This parameter is forwarded to XmlSignature2Message. This indicator has no effect if the output node search is of type DefaultXmlSignature2Message#OUTPU [...] -| *schemaResourceUri* (producer) | Classpath to the XML Schema. Must be specified in the detached XML Signature case for determining the ID attributes, might be set in the enveloped and enveloping case. If set, then the XML document is validated with the specified XML schema. The schema resource URI can be overwritten by the header XmlSignatureConstants#HEADER_SCHEMA_RESOURCE_URI. | | String -| *secureValidation* (producer) | Enables secure validation. If true then secure validation is enabled. | true | Boolean -| *validationFailedHandler* (producer) | Handles the different validation failed situations. The default implementation throws specific exceptions for the different situations (All exceptions have the package name org.apache.camel.component.xmlsecurity.api and are a sub-class of XmlSignatureInvalidException. If the signature value validation fails, a XmlSignatureInvalidValueException is thrown. If a reference validation fails, a XmlSignatureInvalidContentHashException is thrown. For more [...] -| *xmlSignature2Message* (producer) | Bean which maps the XML signature to the output-message after the validation. How this mapping should be done can be configured by the options outputNodeSearchType, outputNodeSearch, and removeSignatureElements. The default implementation offers three possibilities which are related to the three output node search types Default, ElementName, and XPath. The default implementation determines a node which is then serialized and set to the body of the ou [...] -| *xmlSignatureChecker* (producer) | This interface allows the application to check the XML signature before the validation is executed. This step is recommended in \http://www.w3.org/TR/xmldsig-bestpractices/#check-what-is-signed | | XmlSignatureChecker -| *autowiredEnabled* (advanced) | 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. | true | boolean -| *uriDereferencer* (advanced) | If you want to restrict the remote access via reference URIs, you can set an own dereferencer. Optional parameter. If not set the provider default dereferencer is used which can resolve URI fragments, HTTP, file and XPpointer URIs. Attention: The implementation is provider dependent! | | URIDereferencer -| *verifierConfiguration* (advanced) | To use a shared XmlVerifierConfiguration configuration to use as base for configuring endpoints. | | XmlVerifierConfiguration -|=== -// component options: END - - - - - - -== Endpoint Options - - -// endpoint options: START -The XML Security Verify endpoint is configured using URI syntax: - ----- -xmlsecurity-verify:name ----- - -with the following path and query parameters: - -=== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *name* | *Required* The name part in the URI can be chosen by the user to distinguish between different verify endpoints within the camel context. | | String -|=== - - -=== Query Parameters (17 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *baseUri* (producer) | You can set a base URI which is used in the URI dereferencing. Relative URIs are then concatenated with the base URI. | | String -| *clearHeaders* (producer) | Determines if the XML signature specific headers be cleared after signing and verification. Defaults to true. | true | Boolean -| *cryptoContextProperties* (producer) | Sets the crypto context properties. See {link XMLCryptoContext#setProperty(String, Object)}. Possible properties are defined in XMLSignContext an XMLValidateContext (see Supported Properties). The following properties are set by default to the value Boolean#TRUE for the XML validation. If you want to switch these features off you must set the property value to Boolean#FALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.dsig.cacheReference | | Map -| *disallowDoctypeDecl* (producer) | Disallows that the incoming XML document contains DTD DOCTYPE declaration. The default value is Boolean#TRUE. | true | Boolean -| *keySelector* (producer) | Provides the key for validating the XML signature. | | KeySelector -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *omitXmlDeclaration* (producer) | Indicator whether the XML declaration in the outgoing message body should be omitted. Default value is false. Can be overwritten by the header XmlSignatureConstants#HEADER_OMIT_XML_DECLARATION. | false | Boolean -| *outputNodeSearch* (producer) | Sets the output node search value for determining the node from the XML signature document which shall be set to the output message body. The class of the value depends on the type of the output node search. The output node search is forwarded to XmlSignature2Message. | | Object -| *outputNodeSearchType* (producer) | Determines the search type for determining the output node which is serialized into the output message bodyF. See setOutputNodeSearch(Object). The supported default search types you can find in DefaultXmlSignature2Message. | Default | String -| *outputXmlEncoding* (producer) | The character encoding of the resulting signed XML document. If null then the encoding of the original XML document is used. | | String -| *removeSignatureElements* (producer) | Indicator whether the XML signature elements (elements with local name Signature and namesapce \http://www.w3.org/2000/09/xmldsig#) shall be removed from the document set to the output message. Normally, this is only necessary, if the XML signature is enveloped. The default value is Boolean#FALSE. This parameter is forwarded to XmlSignature2Message. This indicator has no effect if the output node search is of type DefaultXmlSignature2Message#OUTPU [...] -| *schemaResourceUri* (producer) | Classpath to the XML Schema. Must be specified in the detached XML Signature case for determining the ID attributes, might be set in the enveloped and enveloping case. If set, then the XML document is validated with the specified XML schema. The schema resource URI can be overwritten by the header XmlSignatureConstants#HEADER_SCHEMA_RESOURCE_URI. | | String -| *secureValidation* (producer) | Enables secure validation. If true then secure validation is enabled. | true | Boolean -| *validationFailedHandler* (producer) | Handles the different validation failed situations. The default implementation throws specific exceptions for the different situations (All exceptions have the package name org.apache.camel.component.xmlsecurity.api and are a sub-class of XmlSignatureInvalidException. If the signature value validation fails, a XmlSignatureInvalidValueException is thrown. If a reference validation fails, a XmlSignatureInvalidContentHashException is thrown. For more [...] -| *xmlSignature2Message* (producer) | Bean which maps the XML signature to the output-message after the validation. How this mapping should be done can be configured by the options outputNodeSearchType, outputNodeSearch, and removeSignatureElements. The default implementation offers three possibilities which are related to the three output node search types Default, ElementName, and XPath. The default implementation determines a node which is then serialized and set to the body of the ou [...] -| *xmlSignatureChecker* (producer) | This interface allows the application to check the XML signature before the validation is executed. This step is recommended in \http://www.w3.org/TR/xmldsig-bestpractices/#check-what-is-signed | | XmlSignatureChecker -| *uriDereferencer* (advanced) | If you want to restrict the remote access via reference URIs, you can set an own dereferencer. Optional parameter. If not set the provider default dereferencer is used which can resolve URI fragments, HTTP, file and XPpointer URIs. Attention: The implementation is provider dependent! | | URIDereferencer -|=== -// endpoint options: END - - - - -=== Output Node Determination in Enveloping XML Signature Case - -After the validation the node is extracted from the XML signature -document which is finally returned to the output-message body. In the -enveloping XML signature case, the default implementation -https://github.com/apache/camel/blob/main/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultXmlSignature2Message.java[`DefaultXmlSignature2Message`] -of -https://github.com/apache/camel/blob/main/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignature2Message.java[`XmlSignature2Message`] -does this for the node search type `Default` in the following way (see -option `xmlSignature2Message`): - -* First an object reference is determined: - -** Only same document references are taken into account (URI must start -with `#`) -** Also indirect same document references to an object via manifest are -taken into account. -** The resulting number of object references must be 1. - -* Then, the object is dereferenced and the object must only contain one -XML element. This element is returned as output node. - -This does mean that the enveloping XML signature must have either the -structure: - -[source,xml] ----- -<Signature> - <SignedInfo> - <Reference URI="#object"/> - <!-- further references possible but they must not point to an Object or Manifest containing an object reference --> - ... - </SignedInfo> - - <Object Id="object"> - <!-- contains one XML element which is extracted to the message body --> - <Object> - <!-- further object elements possible which are not referenced--> - ... - (<KeyInfo>)? -</Signature> ----- - -or the structure: - -[source,xml] ----- -<Signature> - <SignedInfo> - <Reference URI="#manifest"/> - <!-- further references are possible but they must not point to an Object or other manifest containing an object reference --> - ... - </SignedInfo> - - <Object > - <Manifest Id="manifest"> - <Reference URI=#object/> - </Manifest> - </Objet> - <Object Id="object"> - <!-- contains the DOM node which is extracted to the message body --> - </Object> - <!-- further object elements possible which are not referenced --> - ... - (<KeyInfo>)? -</Signature> ----- - == Detached XML Signatures as Siblings of the Signed Elements You can create detached signatures where the signature is a sibling of @@ -493,8 +340,6 @@ from("direct:detached") == XAdES-BES/EPES for the Signer Endpoint -*Since Camel 2.15.0* - http://www.etsi.org/deliver/etsi_ts/101900_101999/101903/01.04.02_60/ts_101903v010402p.pdf[XML Advanced Electronic Signatures (XAdES)] defines extensions to XML Signature. This standard was defined by the diff --git a/components/camel-xmpp/src/main/docs/xmpp-component.adoc b/components/camel-xmpp/src/main/docs/xmpp-component.adoc index c266dc6..6b18c6a 100644 --- a/components/camel-xmpp/src/main/docs/xmpp-component.adoc +++ b/components/camel-xmpp/src/main/docs/xmpp-component.adoc @@ -29,7 +29,6 @@ for this component: == URI format -[source,text] ------------------------------------------------------ xmpp://[login@]hostname[:port][/participant][?Options] ------------------------------------------------------ @@ -40,79 +39,16 @@ conversations. + from XMPP or send messages to XMPP). Consumer mode supports rooms starting. -You can append query options to the URI in the following format, -`?option=value&option=value&...` - -== Options // component options: START -The XMPP component supports 3 options, which are listed below. - - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. 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. | false | boolean -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *autowiredEnabled* (advanced) | 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. | true | boolean -|=== // component options: END - - - // endpoint options: START -The XMPP endpoint is configured using URI syntax: - ----- -xmpp:host:port/participant ----- - -with the following path and query parameters: - -=== Path Parameters (3 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *host* | *Required* Hostname for the chat server | | String -| *port* | *Required* Port number for the chat server | | int -| *participant* | JID (Jabber ID) of person to receive messages. room parameter has precedence over participant. | | String -|=== - - -=== Query Parameters (19 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *login* (common) | Whether to login the user. | true | boolean -| *nickname* (common) | Use nickname when joining room. If room is specified and nickname is not, user will be used for the nickname. | | String -| *pubsub* (common) | Accept pubsub packets on input, default is false | false | boolean -| *room* (common) | If this option is specified, the component will connect to MUC (Multi User Chat). Usually, the domain name for MUC is different from the login domain. For example, if you are supermanjabber.org and want to join the krypton room, then the room URL is kryptonconference.jabber.org. Note the conference part. It is not a requirement to provide the full room JID. If the room parameter does not contain the symbol, the domain part will be discovered and added by Camel | | String -| *serviceName* (common) | The name of the service you are connecting to. For Google Talk, this would be gmail.com. | | String -| *testConnectionOnStartup* (common) | Specifies whether to test the connection on startup. This is used to ensure that the XMPP client has a valid connection to the XMPP server when the route starts. Camel throws an exception on startup if a connection cannot be established. When this option is set to false, Camel will attempt to establish a lazy connection when needed by a producer, and will poll for a consumer connection until the connection is established. Default is true. | true | boolean -| *createAccount* (common) | If true, an attempt to create an account will be made. Default is false. | false | boolean -| *resource* (common) | XMPP resource. The default is Camel. | Camel | String -| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. 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. | false | boolean -| *connectionPollDelay* (consumer) | The amount of time in seconds between polls (in seconds) to verify the health of the XMPP connection, or between attempts to establish an initial consumer connection. Camel will try to re-establish a connection if it has become inactive. Default is 10 seconds. | 10 | int -| *doc* (consumer) | Set a doc header on the IN message containing a Document form of the incoming packet; default is true if presence or pubsub are true, otherwise false | false | boolean -| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler -| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *connectionConfig* (advanced) | To use an existing connection configuration. Currently org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration is only supported (XMPP over TCP). | | ConnectionConfiguration -| *headerFilterStrategy* (filter) | To use a custom HeaderFilterStrategy to filter header to and from Camel message. | | HeaderFilterStrategy -| *password* (security) | Password for login | | String -| *roomPassword* (security) | Password for room | | String -| *user* (security) | User name (without server name). If not specified, anonymous login will be attempted. | | String -|=== // endpoint options: END + == Headers and setting Subject or Language Camel sets the message IN headers as properties on the XMPP message. You @@ -126,14 +62,12 @@ are provided as IN headers. User `superman` to join room `krypton` at `jabber` server with password, `secret`: -[source,text] ------------------------------------------------------------------------------ xmpp://super...@jabber.org/?room=kryp...@conference.jabber.org&password=secret ------------------------------------------------------------------------------ User `superman` to send messages to `joker`: -[source,text] ----------------------------------------------------------- xmpp://super...@jabber.org/jo...@jabber.org?password=secret ----------------------------------------------------------- diff --git a/components/camel-xslt-saxon/src/main/docs/xslt-saxon-component.adoc b/components/camel-xslt-saxon/src/main/docs/xslt-saxon-component.adoc index af7b445..07438e4 100644 --- a/components/camel-xslt-saxon/src/main/docs/xslt-saxon-component.adoc +++ b/components/camel-xslt-saxon/src/main/docs/xslt-saxon-component.adoc @@ -19,15 +19,14 @@ Templating to generate responses for requests. == URI format -[source] ---- xslt-saxon:templateName[?options] ---- + The URI format contains *templateName*, which can be one of the following: * the classpath-local URI of the template to invoke - -* the complete URL of the remote template. +* the complete URL of the remote template. You can append query options to the URI in the following format: @@ -42,72 +41,11 @@ You can append query options to the URI in the following format: |xslt-saxon:http://acme.com/cheese/foo.xsl|Refers to the remote http resource |================================================================= -== Options + // component options: START -The XSLT Saxon component supports 10 options, which are listed below. - - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *contentCache* (producer) | Cache for the resource content (the stylesheet file) when it is loaded. If set to false Camel will reload the stylesheet file on each message processing. This is good for development. A cached stylesheet can be forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *autowiredEnabled* (advanced) | 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. | true | boolean -| *saxonConfiguration* (advanced) | To use a custom Saxon configuration | | Configuration -| *saxonConfigurationProperties* (advanced) | To set custom Saxon configuration properties | | Map -| *saxonExtensionFunctions* (advanced) | Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon to the classpath. The function is looked up in the registry, where you can comma to separate multiple values to lookup. | | String -| *transformerFactoryClass* (advanced) | To use a custom XSLT transformer factory, specified as a FQN class name | | String -| *transformerFactory{zwsp}ConfigurationStrategy* (advanced) | A configuration strategy to apply on freshly created instances of TransformerFactory. | | TransformerFactoryConfigurationStrategy -| *uriResolver* (advanced) | To use a custom UriResolver. Should not be used together with the option 'uriResolverFactory'. | | URIResolver -| *uriResolverFactory* (advanced) | To use a custom UriResolver which depends on a dynamic endpoint resource URI. Should not be used together with the option 'uriResolver'. | | XsltUriResolverFactory -|=== // component options: END - - // endpoint options: START -The XSLT Saxon endpoint is configured using URI syntax: - ----- -xslt-saxon:resourceUri ----- - -with the following path and query parameters: - -=== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *resourceUri* | *Required* Path to the template. The following is supported by the default URIResolver. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will call a method on a bean to be used as the resource. For bean you can specify the method name after dot, eg bean:myBean.myMethod | | String -|=== - - -=== Query Parameters (16 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *allowStAX* (producer) | Whether to allow using StAX as the javax.xml.transform.Source. You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon). The Xalan library (default in JVM) does not support StAXSource. | true | boolean -| *contentCache* (producer) | Cache for the resource content (the stylesheet file) when it is loaded. If set to false Camel will reload the stylesheet file on each message processing. This is good for development. A cached stylesheet can be forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean -| *deleteOutputFile* (producer) | If you have output=file then this option dictates whether or not the output file should be deleted when the Exchange is done processing. For example suppose the output file is a temporary file, then it can be a good idea to delete it after use. | false | boolean -| *failOnNullBody* (producer) | Whether or not to throw an exception if the input body is null. | true | boolean -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *output* (producer) | Option to specify which output type to use. Possible values are: string, bytes, DOM, file. The first three options are all in memory based, where as file is streamed directly to a java.io.File. For file you must specify the filename in the IN header with the key Exchange.XSLT_FILE_NAME which is also CamelXsltFileName. Also any paths leading to the filename must be created beforehand, otherwise an exception is thrown at runtime. There are 4 enums and the value can [...] -| *transformerCacheSize* (producer) | The number of javax.xml.transform.Transformer object that are cached for reuse to avoid calls to Template.newTransformer(). | 0 | int -| *entityResolver* (advanced) | To use a custom org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource. | | EntityResolver -| *errorListener* (advanced) | Allows to configure to use a custom javax.xml.transform.ErrorListener. Beware when doing this then the default error listener which captures any errors or fatal errors and store information on the Exchange as properties is not in use. So only use this option for special use-cases. | | ErrorListener -| *resultHandlerFactory* (advanced) | Allows you to use a custom org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using custom org.apache.camel.builder.xml.ResultHandler types. | | ResultHandlerFactory -| *saxonConfiguration* (advanced) | To use a custom Saxon configuration | | Configuration -| *saxonExtensionFunctions* (advanced) | Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon to the classpath. The function is looked up in the registry, where you can comma to separate multiple values to lookup. | | String -| *transformerFactory* (advanced) | To use a custom XSLT transformer factory | | TransformerFactory -| *transformerFactoryClass* (advanced) | To use a custom XSLT transformer factory, specified as a FQN class name | | String -| *transformerFactory{zwsp}ConfigurationStrategy* (advanced) | A configuration strategy to apply on freshly created instances of TransformerFactory. | | TransformerFactoryConfigurationStrategy -| *uriResolver* (advanced) | To use a custom javax.xml.transform.URIResolver | | URIResolver -|=== // endpoint options: END diff --git a/components/camel-xslt/src/main/docs/xslt-component.adoc b/components/camel-xslt/src/main/docs/xslt-component.adoc index 9de9d90..48a133e 100644 --- a/components/camel-xslt/src/main/docs/xslt-component.adoc +++ b/components/camel-xslt/src/main/docs/xslt-component.adoc @@ -19,15 +19,14 @@ Templating to generate response for requests. == URI format -[source] ---- xslt:templateName[?options] ---- + The URI format contains *templateName*, which can be one of the following: * the classpath-local URI of the template to invoke - -* the complete URL of the remote template. +* the complete URL of the remote template. You can append query options to the URI in the following format: @@ -42,69 +41,15 @@ You can append query options to the URI in the following format: |xslt:http://acme.com/cheese/foo.xsl|Refers to the remote http resource |================================================================= -== Options - -// component options: START -The XSLT component supports 7 options, which are listed below. - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *contentCache* (producer) | Cache for the resource content (the stylesheet file) when it is loaded. If set to false Camel will reload the stylesheet file on each message processing. This is good for development. A cached stylesheet can be forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *autowiredEnabled* (advanced) | 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. | true | boolean -| *transformerFactoryClass* (advanced) | To use a custom XSLT transformer factory, specified as a FQN class name | | String -| *transformerFactory{zwsp}ConfigurationStrategy* (advanced) | A configuration strategy to apply on freshly created instances of TransformerFactory. | | TransformerFactoryConfigurationStrategy -| *uriResolver* (advanced) | To use a custom UriResolver. Should not be used together with the option 'uriResolverFactory'. | | URIResolver -| *uriResolverFactory* (advanced) | To use a custom UriResolver which depends on a dynamic endpoint resource URI. Should not be used together with the option 'uriResolver'. | | XsltUriResolverFactory -|=== +// component options: START // component options: END - - // endpoint options: START -The XSLT endpoint is configured using URI syntax: - ----- -xslt:resourceUri ----- - -with the following path and query parameters: - -=== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *resourceUri* | *Required* Path to the template. The following is supported by the default URIResolver. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will call a method on a bean to be used as the resource. For bean you can specify the method name after dot, eg bean:myBean.myMethod | | String -|=== - - -=== Query Parameters (13 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *contentCache* (producer) | Cache for the resource content (the stylesheet file) when it is loaded. If set to false Camel will reload the stylesheet file on each message processing. This is good for development. A cached stylesheet can be forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean -| *deleteOutputFile* (producer) | If you have output=file then this option dictates whether or not the output file should be deleted when the Exchange is done processing. For example suppose the output file is a temporary file, then it can be a good idea to delete it after use. | false | boolean -| *failOnNullBody* (producer) | Whether or not to throw an exception if the input body is null. | true | boolean -| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] -| *output* (producer) | Option to specify which output type to use. Possible values are: string, bytes, DOM, file. The first three options are all in memory based, where as file is streamed directly to a java.io.File. For file you must specify the filename in the IN header with the key Exchange.XSLT_FILE_NAME which is also CamelXsltFileName. Also any paths leading to the filename must be created beforehand, otherwise an exception is thrown at runtime. There are 4 enums and the value can [...] -| *transformerCacheSize* (producer) | The number of javax.xml.transform.Transformer object that are cached for reuse to avoid calls to Template.newTransformer(). | 0 | int -| *entityResolver* (advanced) | To use a custom org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource. | | EntityResolver -| *errorListener* (advanced) | Allows to configure to use a custom javax.xml.transform.ErrorListener. Beware when doing this then the default error listener which captures any errors or fatal errors and store information on the Exchange as properties is not in use. So only use this option for special use-cases. | | ErrorListener -| *resultHandlerFactory* (advanced) | Allows you to use a custom org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using custom org.apache.camel.builder.xml.ResultHandler types. | | ResultHandlerFactory -| *transformerFactory* (advanced) | To use a custom XSLT transformer factory | | TransformerFactory -| *transformerFactoryClass* (advanced) | To use a custom XSLT transformer factory, specified as a FQN class name | | String -| *transformerFactory{zwsp}ConfigurationStrategy* (advanced) | A configuration strategy to apply on freshly created instances of TransformerFactory. | | TransformerFactoryConfigurationStrategy -| *uriResolver* (advanced) | To use a custom javax.xml.transform.URIResolver | | URIResolver -|=== // endpoint options: END + == Using XSLT endpoints The following format is an example of using an XSLT template to formulate a response for a message for InOut