You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/02/17 21:38:15 UTC
(camel) branch main updated (28a308a6801 -> cb92893a4f8)
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
from 28a308a6801 camel-jbang - Upgrade to 4.4.0 release
new eafcab131e1 CAMEL-20410: documentation fixes for camel-dataformat
new 78cb8b221ed CAMEL-20410: documentation fixes for camel-zipfile
new cb92893a4f8 CAMEL-20410: documentation fixes for camel-xj
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/main/docs/dataformat-component.adoc | 25 +++++++--------
.../camel-xj/src/main/docs/xj-component.adoc | 36 ++++++++++++----------
.../src/main/docs/zipFile-dataformat.adoc | 28 +++++++++--------
3 files changed, 47 insertions(+), 42 deletions(-)
(camel) 03/03: CAMEL-20410: documentation fixes for camel-xj
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit cb92893a4f8a1a1a9e3a4f6ae818ae8e4726cdae
Author: Otavio R. Piske <an...@gmail.com>
AuthorDate: Sat Feb 17 21:00:34 2024 +0100
CAMEL-20410: documentation fixes for camel-xj
- Fixed samples
- Converted to use tabs
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
Signed-off-by: Otavio R. Piske <an...@gmail.com>
---
.../camel-xj/src/main/docs/xj-component.adoc | 36 ++++++++++++----------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/components/camel-xj/src/main/docs/xj-component.adoc b/components/camel-xj/src/main/docs/xj-component.adoc
index 7f63e495666..86179469796 100644
--- a/components/camel-xj/src/main/docs/xj-component.adoc
+++ b/components/camel-xj/src/main/docs/xj-component.adoc
@@ -41,13 +41,13 @@ xj:templateName?transformDirection=XML2JSON|JSON2XML[&options]
====
*More documentation*
-The XJ component extends the XSLT component and therefore it supports all options provided by the XSLT
+The XJ component extends the XSLT component, and therefore it supports all options provided by the XSLT
component as well. At least look at the XSLT component documentation how to configure the xsl template.
====
The *transformDirection* option is mandatory and must be either XML2JSON or JSON2XML.
-The *templateName* parameter allows to use _identify transforma_ by specifying the name `identity`.
+The *templateName* parameter allows using _identify transforma_ by specifying the name `identity`.
@@ -74,7 +74,7 @@ include::partial$component-endpoint-headers.adoc[]
The following route does an "identity" transform of the message because no xslt stylesheet is given. In the context of
xml to xml transformations, "Identity" transform means that the output document is just a copy of the input document.
-In case of XJ it means it transforms the json document to an equivalent xml representation.
+In the case of XJ, it means it transforms the json document to an equivalent xml representation.
[source,java]
----
@@ -106,7 +106,7 @@ The input:
}
----
-will output
+Will output:
[source,xml]
----
@@ -131,7 +131,7 @@ will output
As can be seen in the output above, XJ writes some metadata in the resulting xml that can be used in further processing:
-* XJ metadata nodes are always in the "http://camel.apache.org/component/xj" namespace.
+* XJ metadata nodes are always in the `http://camel.apache.org/component/xj` namespace.
* JSON key names are placed in the xj:name attribute.
* The parsed JSON type can be found in the xj:type attribute. The above example already contains all possible types.
* Generated XML elements are always named "object".
@@ -165,7 +165,7 @@ Now we can apply a stylesheet, e.g.:
</xsl:stylesheet>
----
-to the above sample by specifying the template on the endpoint:
+To the above sample by specifying the template on the endpoint:
[source,java]
----
@@ -173,7 +173,7 @@ from("direct:start").
to("xj:com/example/json2xml.xsl?transformDirection=JSON2XML");
----
-and get the following output:
+And get the following output:
[source,xml]
----
@@ -192,7 +192,7 @@ and get the following output:
=== Converting XML to JSON
-Based on the explanations above an "identity" transform will be performed when no stylesheet is given:
+Based on the explanations above, an _identity_ transform will be performed when no stylesheet is given:
[source,java]
----
@@ -245,15 +245,15 @@ will result in
}
----
-You may have noted that the input xml and output json is very similar to the examples above when converting from json to xml
+You may have noted that the input xml and output json are very similar to the examples above when converting from json to xml,
although nothing special is done here. We only transformed an arbitrary XML document to json.
XJ uses the following rules by default:
-* The XML root element can be named somehow, it will always end in a json root object declaration '{}'
+* The XML root element can be named somehow, it will always end in a json root object declaration `{}`
* The json key name is the name of the xml element
-* If there is an name clash as in "<roles>" above where two "<entry>" elements exists a json array will be generated.
+* If there is a name clash as in `<roles>` above where two `<entry>` elements exist a json array will be generated.
* XML elements with text-only-child-nodes will result in the usual key/string-value pair. Mixed content elements
-results in key/child-object pair as seen in "<state>" above.
+result in a key/child-object pair as seen in `<state>` above.
Now we can apply again a stylesheet, e.g.:
@@ -354,7 +354,7 @@ and get the following output:
}
----
-Note, this transformation resulted in exactly the same json document as we used as input to the json2xml conversion.
+Note, this transformation resulted in exactly the same json document as we used as input to the _json2xml_ conversion.
What did the stylesheet do? We just gave some hints to XJ on how to write the json document. The following XML
document is that what is passed to XJ after xsl transformation:
@@ -382,7 +382,7 @@ document is that what is passed to XJ after xsl transformation:
In the stylesheet we just provided the minimal required type hints to get the same result.
The supported type hints are exactly the same as XJ writes to a XML document when converting from json to xml.
-In the end that means that we can feed back in the result document from the json to xml transformation sample above:
+In the end, that means that we can feed back in the result document from the json to xml transformation sample above:
[source,xml]
----
@@ -428,9 +428,11 @@ and get the same output again:
----
As seen in the example above:
+
* xj:type lets you specify exactly the desired output type
-* xj:name lets you overrule the json key name. This is required when you want to generate key names which contains chars
-that aren't allowed in XML element names.
+* xj:name lets you overrule the json key name.
+
+This is required when you want to generate key names that contain chars that aren't allowed in XML element names.
=== Available type hints
@@ -443,7 +445,7 @@ that aren't allowed in XML element names.
| int | Generate a json number without fractional part
| float | Generate a json number with fractional part
| boolean | Generate a json boolean
-| null | Generate an empty value, using the word null
+| null | Generate an empty value using the word null
|===
(camel) 01/03: CAMEL-20410: documentation fixes for camel-dataformat
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit eafcab131e19887bd26f3b8395023a4286551ca2
Author: Otavio R. Piske <an...@gmail.com>
AuthorDate: Sat Feb 17 20:49:23 2024 +0100
CAMEL-20410: documentation fixes for camel-dataformat
- Fixed samples
- Converted to use tabs
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
Signed-off-by: Otavio R. Piske <an...@gmail.com>
---
.../src/main/docs/dataformat-component.adoc | 25 +++++++++++-----------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/components/camel-dataformat/src/main/docs/dataformat-component.adoc b/components/camel-dataformat/src/main/docs/dataformat-component.adoc
index 4cd696d2a6d..2ee6e1e3ec8 100644
--- a/components/camel-dataformat/src/main/docs/dataformat-component.adoc
+++ b/components/camel-dataformat/src/main/docs/dataformat-component.adoc
@@ -15,8 +15,7 @@
*{component-header}*
-The Dataformat component allows to use xref:manual::data-format.adoc[Data
-Format] as a Camel Component.
+The Data Format component allows using xref:manual::data-format.adoc[Data Format] as a Camel Component.
== URI format
@@ -25,11 +24,10 @@ Format] as a Camel Component.
dataformat:name:(marshal|unmarshal)[?options]
----
-Where *name* is the name of the Data Format. And
-then followed by the operation which must either be `marshal` or
-`unmarshal`. The options is used for configuring the xref:manual::data-format.adoc[Data
-Format] in use. See the Data Format documentation
-for which options it support.
+Where *name* is the name of the Data Format.
+And then followed by the operation which must either be `marshal` or `unmarshal`.
+The options are used for configuring the xref:manual::data-format.adoc[Data Format] in use.
+See the Data Format documentation for which options it supports.
== DataFormat Options
@@ -53,9 +51,12 @@ include::partial$component-endpoint-options.adoc[]
== Samples
-For example to use the xref:dataformats:jaxb-dataformat.adoc[JAXB] xref:manual::data-format.adoc[Data
-Format] we can do as follows:
+For example, to use the xref:dataformats:jaxb-dataformat.adoc[JAXB] xref:manual::data-format.adoc[Data Format], we can do as follows:
+[tabs]
+====
+Java::
++
[source,java]
----
from("activemq:My.Queue").
@@ -63,8 +64,8 @@ from("activemq:My.Queue").
to("mqseries:Another.Queue");
----
-And in XML DSL you do:
-
+XML::
++
[source,xml]
----
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
@@ -75,6 +76,6 @@ And in XML DSL you do:
</route>
</camelContext>
----
-
+====
include::spring-boot:partial$starter.adoc[]
(camel) 02/03: CAMEL-20410: documentation fixes for camel-zipfile
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 78cb8b221edab7f09e5233fca307fbcb72bb5323
Author: Otavio R. Piske <an...@gmail.com>
AuthorDate: Sat Feb 17 20:52:29 2024 +0100
CAMEL-20410: documentation fixes for camel-zipfile
- Fixed samples
- Converted to use tabs
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
Signed-off-by: Otavio R. Piske <an...@gmail.com>
---
.../src/main/docs/zipFile-dataformat.adoc | 28 ++++++++++++----------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/components/camel-zipfile/src/main/docs/zipFile-dataformat.adoc b/components/camel-zipfile/src/main/docs/zipFile-dataformat.adoc
index 7958b7353e8..e719b7d13cd 100644
--- a/components/camel-zipfile/src/main/docs/zipFile-dataformat.adoc
+++ b/components/camel-zipfile/src/main/docs/zipFile-dataformat.adoc
@@ -11,9 +11,8 @@
*Since Camel {since}*
-The Zip File Data Format is a message compression
-and de-compression format. Messages can be marshalled (compressed) to
-Zip files containing a single entry, and Zip files containing a single
+The Zip File Data Format is a message compression and decompression format.
+Messages can be marshaled (compressed) to Zip files containing a single entry, and Zip files containing a single
entry can be unmarshalled (decompressed) to the original file contents.
This data format supports ZIP64, as long as Java 7 or later is being used.
@@ -25,7 +24,7 @@ include::partial$dataformat-options.adoc[]
== Marshal
-In this example we marshal a regular text/XML payload to a compressed
+In this example, we marshal a regular text/XML payload to a compressed
payload using Zip file compression, and send it to an ActiveMQ queue
called MY_QUEUE.
@@ -41,7 +40,7 @@ incoming `CamelFileName` message header, which is the standard message
header used by the file component. Additionally, the
outgoing `CamelFileName` message header is automatically set to the
value of the incoming `CamelFileName` message header, with the ".zip"
-suffix. So for example, if the following route finds a file named
+suffix. So, for example, if the following route finds a file named
"test.txt" in the input directory, the output will be a Zip file named
"test.txt.zip" containing a single Zip entry named "test.txt":
@@ -52,10 +51,10 @@ from("file:input/directory?antInclude=*/.txt")
.to("file:output/directory");
----
-If there is no incoming `CamelFileName` message header (for example, if
+If there is no incoming `CamelFileName` message header, (for example, if
the file component is not the consumer), then the
-message ID is used by default, and since the message ID is normally a
-unique generated ID, you will end up with filenames like
+message ID is used by default.
+Since the message ID is normally a unique generated ID, you will end up with filenames like
`ID-MACHINENAME-2443-1211718892437-1-0.zip`. If you want to override
this behavior, then you can set the value of the `CamelFileName` header
explicitly in your route:
@@ -84,7 +83,7 @@ from("activemq:queue:MY_QUEUE")
.process(new UnZippedMessageProcessor());
----
-If the zip file has more then one entry, the usingIterator option of
+If the zip file has more than one entry, the usingIterator option of
ZipFileDataFormat to be true, and you can use splitter to do the further
work.
@@ -110,7 +109,10 @@ from("file:src/test/resources/org/apache/camel/dataformat/zipfile?delay=1000&noo
.end();
----
-IMPORTANT: You cannot use ZipSplitter in _parallel_ mode with the splitter.
+[IMPORTANT]
+====
+You *cannot* use ZipSplitter in _parallel_ mode with the splitter.
+====
== Aggregate
@@ -119,7 +121,7 @@ IMPORTANT: You cannot use ZipSplitter in _parallel_ mode with the splitter.
Please note that this aggregation strategy requires eager completion check to work properly.
====
-In this example we aggregate all text files found in the input directory
+In this example, we aggregate all text files found in the input directory
into a single Zip file that is stored in the output directory.
[source,java]
@@ -146,10 +148,10 @@ from("file:input/directory?antInclude=*/.txt")
== Dependencies
-To use Zip files in your camel routes you need to add a dependency on
+To use Zip files in your camel routes, you need to add a dependency on
*camel-zipfile* which implements this data format.
-If you use Maven you can just add the following to your `pom.xml`,
+If you use Maven you can add the following to your `pom.xml`,
substituting the version number for the latest & greatest release (see
the download page for the latest versions).