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/16 13:57:11 UTC
(camel) branch main updated (f05b4efd29d -> 13005a81e40)
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 f05b4efd29d CAMEL-20410: documentation fixes for camel-bean
new 24fedf30085 CAMEL-20410: documentation fixes for camel-bean-validator
new 9363bb3654d CAMEL-20410: documentation fixes for camel-beanio
new 13005a81e40 CAMEL-20410: documentation fixes for camel-bonita
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/bean-validator-component.adoc | 48 +++++++++++------
.../src/main/docs/beanio-dataformat.adoc | 61 +++++++++++-----------
.../src/main/docs/bonita-component.adoc | 9 ++--
3 files changed, 67 insertions(+), 51 deletions(-)
(camel) 02/03: CAMEL-20410: documentation fixes for camel-beanio
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 9363bb3654d26ee131f8d228763c188ab580305c
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Feb 16 13:33:28 2024 +0100
CAMEL-20410: documentation fixes for camel-beanio
- Fixed samples
- Converted to use tabs
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
---
.../src/main/docs/beanio-dataformat.adoc | 61 +++++++++++-----------
1 file changed, 31 insertions(+), 30 deletions(-)
diff --git a/components/camel-beanio/src/main/docs/beanio-dataformat.adoc b/components/camel-beanio/src/main/docs/beanio-dataformat.adoc
index 918fa95e037..35a47afbb49 100644
--- a/components/camel-beanio/src/main/docs/beanio-dataformat.adoc
+++ b/components/camel-beanio/src/main/docs/beanio-dataformat.adoc
@@ -15,7 +15,7 @@ The BeanIO Data Format uses
https://beanio.github.io/[BeanIO] to handle flat payloads (such as XML, CSV,
delimited, or fixed length formats).
-BeanIO is configured using a mappings XML file where you define the mapping from the flat format to Objects
+BeanIO is configured using a mapping XML file where you define the mapping from the flat format to Objects
(POJOs). This mapping file is mandatory to use.
== Options
@@ -30,52 +30,36 @@ An example of a
https://svn.apache.org/repos/asf/camel/trunk/components/camel-beanio/src/test/resources/org/apache/camel/dataformat/beanio/mappings.xml[mapping
file is here].
-=== Using Java DSL
+To use the `BeanIODataFormat` you need to configure the data format with the mapping file, as well the name of the stream.
-To use the `BeanIODataFormat` you need to configure the data format with
-the mapping file, as well the name of the stream.
-
-In Java DSL this can be done as shown below. The streamName is "employeeFile".
+This can be done as shown below. The streamName is `employeeFile`.
+[tabs]
+====
+Java::
++
[source,java]
----
DataFormat format = new BeanIODataFormat(
"org/apache/camel/dataformat/beanio/mappings.xml",
"employeeFile");
-// a route which uses the bean io data format to format a CSV data
+// a route which uses the bean io data format to format the CSV data
// to java objects
from("direct:unmarshal")
.unmarshal(format)
- // and then split the message body so we get a message for each row
+ // and then split the message body, so we get a message for each row
.split(body())
.to("mock:beanio-unmarshal");
-// convert list of java objects back to flat format
+// convert a list of java objects back to flat format
from("direct:marshal")
.marshal(format)
.to("mock:beanio-marshal");
----
-Then we have two routes. The first route is for transforming CSV data
-into a `List<Employee>` Java objects. Which we then split, so the mock endpoint receives a message for each row.
-
-The 2nd route is for the reverse operation, to transform a `List<Employee>` into a stream of CSV data.
-
-The CSV data could for example be as below:
-
-[source,text]
-----
-Joe,Smith,Developer,75000,10012009
-Jane,Doe,Architect,80000,01152008
-Jon,Anderson,Manager,85000,03182007
-----
-
-=== Using XML DSL
-
-To use the BeanIO data format in XML, you need to configure it using the
-`<beanio>` XML tag as shown below. The routes are similar to the example above.
-
+XML::
++
[source,xml]
----
<route>
@@ -97,13 +81,30 @@ To use the BeanIO data format in XML, you need to configure it using the
<to uri="mock:beanio-marshal"/>
</route>
----
+To use the BeanIO data format in XML, you need to configure it using the
+`<beanio>` XML tag as shown below. The routes are similar to the example above.
+====
+
+The first route is for transforming CSV data into a `List<Employee>` Java objects.
+Which we then split, so the mock endpoint receives a message for each row.
+
+The second route is for the reverse operation, to transform a `List<Employee>` into a stream of CSV data.
+
+The CSV data could, for example, be as below:
+
+[source,text]
+----
+Joe,Smith,Developer,75000,10012009
+Jane,Doe,Architect,80000,01152008
+Jon,Anderson,Manager,85000,03182007
+----
== Dependencies
-To use BeanIO in your Camel routes you need to add a dependency on
+To use BeanIO in your Camel routes, you need to add a dependency on
*camel-beanio* 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 just add the following to your pom.xml,
substituting the version number for the latest & greatest release (see
the download page for the latest versions).
(camel) 03/03: CAMEL-20410: documentation fixes for camel-bonita
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 13005a81e40f9c78c36a2670e35790253db13126
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Feb 16 13:36:20 2024 +0100
CAMEL-20410: documentation fixes for camel-bonita
- Fixed samples
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
---
components/camel-bonita/src/main/docs/bonita-component.adoc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/components/camel-bonita/src/main/docs/bonita-component.adoc b/components/camel-bonita/src/main/docs/bonita-component.adoc
index 3ce11dcfdea..b79c71618f1 100644
--- a/components/camel-bonita/src/main/docs/bonita-component.adoc
+++ b/components/camel-bonita/src/main/docs/bonita-component.adoc
@@ -40,12 +40,13 @@ include::partial$component-endpoint-options.adoc[]
== Body content
-For the startCase operation, the input variables are retrieved from the body message. This one has to contains a Map<String,Serializable>.
+For the startCase operation, the input variables are retrieved from the body message.
+This one has to contain a `Map<String,Serializable>`.
== Examples
-The following example start a new case in Bonita:
+The following example starts a new case in Bonita:
[source,java]
----------------------------------------------------------------------
@@ -54,10 +55,10 @@ from("direct:start").to("bonita:startCase?hostname=localhost&port=8080&p
== Dependencies
-To use Bonita in your Camel routes you need to add a dependency on
+To use Bonita in your Camel routes, you need to add a dependency on
*camel-bonita*, which implements the component.
-If you use Maven you can just add the following to your pom.xml,
+If you use Maven, you can just add the following to your pom.xml,
substituting the version number for the latest and greatest release (see
the download page for the latest versions).
(camel) 01/03: CAMEL-20410: documentation fixes for camel-bean-validator
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 24fedf300851a24afa9ca699d0e655582c995641
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Feb 16 13:25:25 2024 +0100
CAMEL-20410: documentation fixes for camel-bean-validator
- Fixed samples
- Converted to use tabs
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
---
.../src/main/docs/bean-validator-component.adoc | 48 ++++++++++++++--------
1 file changed, 31 insertions(+), 17 deletions(-)
diff --git a/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc b/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
index d1f501598a6..5aec4d15d6c 100644
--- a/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
+++ b/components/camel-bean-validator/src/main/docs/bean-validator-component.adoc
@@ -40,9 +40,8 @@ for this component:
bean-validator:label[?options]
------------------------------
-Where *label* is an arbitrary text value describing the endpoint. +
- You can append query options to the URI in the following format,
-?option=value&option=value&...
+Where *label* is an arbitrary text value describing the endpoint.
+You can append query options to the URI in the following format: `?option=value&option=value&...`
// component-configure options: START
@@ -68,17 +67,25 @@ To use Hibernate Validator in the OSGi environment use dedicated
The snippet below demonstrates this approach. You can also
use `HibernateValidationProviderResolver`.
-*Using HibernateValidationProviderResolver*
+=== Using HibernateValidationProviderResolver
+[tabs]
+====
+Java::
++
[source,java]
--------------------------------------------------------------------------------------------------------------------------------
from("direct:test").
to("bean-validator://ValidationProviderResolverTest?validationProviderResolver=#myValidationProviderResolver");
--------------------------------------------------------------------------------------------------------------------------------
+
+XML::
++
[source,xml]
--------------------------------------------------------------------------------------------------------------------------------
<bean id="myValidationProviderResolver" class="org.apache.camel.component.bean.validator.HibernateValidationProviderResolver"/>
--------------------------------------------------------------------------------------------------------------------------------
+====
If no custom `ValidationProviderResolver` is defined and the validator
component has been deployed into the OSGi environment,
@@ -116,7 +123,7 @@ public interface OptionalChecks {
---------------------------------
with the following Camel route, only the *@NotNull* constraints on the
-attributes manufacturer and licensePlate will be validated (Camel uses
+attributes `manufacturer` and `licensePlate` will be validated (Camel uses
the default group `jakarta.validation.groups.Default`).
[source,java]
@@ -137,7 +144,7 @@ from("direct:start")
----------------------------------------------
If you want to check the constraints from both groups, you have to
-define a new interface first
+define a new interface first:
*AllChecks.java*
@@ -148,7 +155,7 @@ public interface AllChecks {
}
-----------------------------------------------------
-and then your route definition should looks like this
+And then your route definition should look like this:
[source,java]
-----------------------------------------
@@ -159,15 +166,20 @@ from("direct:start")
And if you have to provide your own message interpolator, traversable
resolver and constraint validator factory, you have to write a route
-like this
+like this:
+[tabs]
+====
+Java::
++
[source,xml]
------------------------------------------------------------------------------------------------------
<bean id="myMessageInterpolator" class="my.ConstraintValidatorFactory" />
<bean id="myTraversableResolver" class="my.TraversableResolver" />
<bean id="myConstraintValidatorFactory" class="my.ConstraintValidatorFactory" />
------------------------------------------------------------------------------------------------------
-
+XML::
++
[source,java]
------------------------------------------------------------------------------------------------------
from("direct:start")
@@ -175,13 +187,16 @@ from("direct:start")
&traversableResolver=#myTraversableResolver&constraintValidatorFactory=#myConstraintValidatorFactory")
.to("mock:end")
------------------------------------------------------------------------------------------------------
+====
It's also possible to describe your constraints as XML and not as Java
-annotations. In this case, you have to provide the file
-`META-INF/validation.xml` which could looks like this
-
-*validation.xml*
+annotations.
+In this case, you have to provide the files `META-INF/validation.xml` and `constraints-car.xml` which could look like this:
+[tabs]
+====
+validation.xml::
++
[source,xml]
------------------------------------------------------------------------------------------------------------------------------
<validation-config
@@ -199,10 +214,8 @@ annotations. In this case, you have to provide the file
</validation-config>
------------------------------------------------------------------------------------------------------------------------------
-and the `constraints-car.xml` file
-
-*constraints-car.xml*
-
+constraints-car.xml::
++
[source,xml]
----------------------------------------------------------------------------------------------------
<constraint-mappings
@@ -233,6 +246,7 @@ and the `constraints-car.xml` file
</bean>
</constraint-mappings>
----------------------------------------------------------------------------------------------------
+====
Here is the XML syntax for the example route definition where **OrderedChecks** can be https://github.com/apache/camel/blob/main/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/OrderedChecks.java