This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit d5a706998227c6faca27226dbf8940712695d900 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Tue Aug 24 17:57:53 2021 +0200 CAMEL-13590 First version json-patch component - Regen --- .../src/main/docs/json-patch-component.adoc | 71 ---------------------- 1 file changed, 71 deletions(-) diff --git a/components/camel-json-patch/src/main/docs/json-patch-component.adoc b/components/camel-json-patch/src/main/docs/json-patch-component.adoc index 9727f55..f466f3f 100644 --- a/components/camel-json-patch/src/main/docs/json-patch-component.adoc +++ b/components/camel-json-patch/src/main/docs/json-patch-component.adoc @@ -125,74 +125,3 @@ with the following path and query parameters: |=== // endpoint options: END - -== Passing values to JSLT - -Camel can supply exchange information as variables when applying a JSLT expression on the body. The available variables from the *Exchange* are: - -[width="100%",cols="2,5",options="header"] -|=== -| name | value -| headers | The headers of the In message as a json object -| exchange.properties | The *Exchange* properties as a json object. _exchange_ is the name of the variable and _properties_ is the path to the exchange properties. Available if _allowContextMapAll_ option is true. -|=== - -All the values that cannot be converted to json with Jackson are denied and will not be available in the jslt expression. - -For example, the header named "type" and the exchange property "instance" can be accessed like - -[source,json] --------------------------------------- -{ - "type": $headers.type, - "instance": $exchange.properties.instance -} --------------------------------------- - -== Samples - -For example you could use something like - -[source,java] --------------------------------------- -from("activemq:My.Queue"). - to("jslt:com/acme/MyResponse.json"); --------------------------------------- - -And a file based resource: - -[source,java] ---------------------------------------------------------------- -from("activemq:My.Queue"). - to("jslt:file://myfolder/MyResponse.json?contentCache=true"). - to("activemq:Another.Queue"); ---------------------------------------------------------------- - -You can also specify which JSLT expression the component should use -dynamically via a header, so for example: - -[source,java] ---------------------------------------------------------------------- -from("direct:in"). - setHeader("CamelJsltResourceUri").constant("path/to/my/spec.json"). - to("jslt:dummy?allowTemplateFromHeader=true"); ---------------------------------------------------------------------- - -Or send whole jslt expression via header: (suitable for querying) - -[source,java] ---------------------------------------------------------------------- -from("direct:in"). - setHeader("CamelJsltString").constant(".published"). - to("jslt:dummy?allowTemplateFromHeader=true"); ---------------------------------------------------------------------- - -Passing exchange properties to the jslt expression can be done like this - -[source,java] ---------------------------------------------------------------------- -from("direct:in"). - to("jslt:com/acme/MyResponse.json?allowContextMapAll=true"); ---------------------------------------------------------------------- - -include::{page-component-version}@camel-spring-boot::page$jslt-starter.adoc[]