Repository: camel Updated Branches: refs/heads/master 1aa62f89e -> 22371f5a4
Added barcode Dataformat to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/22371f5a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/22371f5a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/22371f5a Branch: refs/heads/master Commit: 22371f5a4a54593e74afca8ff0caf8fcc9f2583d Parents: 1aa62f8 Author: Andrea Cosentino <[email protected]> Authored: Tue Aug 23 13:54:46 2016 +0200 Committer: Andrea Cosentino <[email protected]> Committed: Tue Aug 23 13:54:46 2016 +0200 ---------------------------------------------------------------------- .../src/main/docs/barcode-data-format.adoc | 118 ------------------ .../docs/barcode-data-format.data/qr-code.png | Bin 307 -> 0 bytes .../src/main/docs/barcode-dataformat.adoc | 122 +++++++++++++++++++ .../en/barcode-data-format.data/qr-code.png | Bin 0 -> 307 bytes 4 files changed, 122 insertions(+), 118 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/22371f5a/components/camel-barcode/src/main/docs/barcode-data-format.adoc ---------------------------------------------------------------------- diff --git a/components/camel-barcode/src/main/docs/barcode-data-format.adoc b/components/camel-barcode/src/main/docs/barcode-data-format.adoc deleted file mode 100644 index 2e8bfe6..0000000 --- a/components/camel-barcode/src/main/docs/barcode-data-format.adoc +++ /dev/null @@ -1,118 +0,0 @@ -*Available as of Camel 2.14* - -The barcode data format is based on the -https://github.com/zxing/zxing[zxing library]. The goal of this -component is to create a barcode image from a String (marshal) and a -String from a barcode image (unmarshal). You're free to use all features -that zxing offers. - -[[BarcodeDataFormat-Dependencies]] -Dependencies -^^^^^^^^^^^^ - -To use the barcode data format in your camel routes you need to add the -a dependency on *camel-barcode* which implements this data format. - -If you use maven you could just add the following to your pom.xml, -substituting the version number for the latest & greatest release (see -link:download.html[the download page for the latest versions]). - -[source,java] ----------------------------------------- -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-barcode</artifactId> - <version>x.x.x</version> -</dependency> ----------------------------------------- - -[[BarcodeDataFormat-UsingtheJavaDSL]] -Using the Java DSL -^^^^^^^^^^^^^^^^^^ - -First you have to initialize the barcode data fomat class. You can use -the default constructor, or one of parameterized (see JavaDoc). The -default values are: - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Parameter |Default Value -|image type (BarcodeImageType) |PNG - -|width |100 px - -|height |100 px - -|encoding |UTF-8 - -|barcode format (BarcodeFormat) |QR-Code -|======================================================================= - -[source,java] ------------------------------------------- -// QR-Code default -DataFormat code = new BarcodeDataFormat(); ------------------------------------------- - -If you want to use zxing hints, you can use the 'addToHintMap' method of -your BarcodeDataFormat instance: - -[source,java] ------------------------------------------------------------ -code.addToHintMap(DecodeHintType.TRY_HARDER, Boolean.true); ------------------------------------------------------------ - -For possible hints, please consult the xzing documentation. - -[[BarcodeDataFormat-Marshalling]] -Marshalling -+++++++++++ - -[source,java] ----------------------------- -from("direct://code") - .marshal(code) - .to("file://barcode_out"); ----------------------------- - -You can call the route from a test class with: - -[source,java] -------------------------------------------------------------- -template.sendBody("direct://code", "This is a testmessage!"); -------------------------------------------------------------- - -You should find inside the 'barcode_out' folder this image: - -image:barcode-data-format.data/qr-code.png[image] - -[[BarcodeDataFormat-Unmarshalling]] -Unmarshalling -+++++++++++++ - -The unmarshaller is generic. For unmarshalling you can use any -BarcodeDataFormat instance. If you've two instances, one for -(generating) QR-Code and one for PDF417, it doesn't matter which one -will be used. - -[source,java] --------------------------------------------------------------------- -from("file://barcode_in?noop=true") - .unmarshal(code) // for unmarshalling, the instance doesn't matter - .to("mock:out"); --------------------------------------------------------------------- - -If you'll paste the QR-Code image above into the 'barcode_in' folder, -you should find '`This is a testmessage!`' inside the mock. You can find -the barcode data format as header variable: - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= - -|Name |Type |Description - -|BarcodeFormat |String |Value of com.google.zxing.BarcodeFormat. -|======================================================================= -Â - -Â http://git-wip-us.apache.org/repos/asf/camel/blob/22371f5a/components/camel-barcode/src/main/docs/barcode-data-format.data/qr-code.png ---------------------------------------------------------------------- diff --git a/components/camel-barcode/src/main/docs/barcode-data-format.data/qr-code.png b/components/camel-barcode/src/main/docs/barcode-data-format.data/qr-code.png deleted file mode 100644 index be0e7c8..0000000 Binary files a/components/camel-barcode/src/main/docs/barcode-data-format.data/qr-code.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/camel/blob/22371f5a/components/camel-barcode/src/main/docs/barcode-dataformat.adoc ---------------------------------------------------------------------- diff --git a/components/camel-barcode/src/main/docs/barcode-dataformat.adoc b/components/camel-barcode/src/main/docs/barcode-dataformat.adoc new file mode 100644 index 0000000..72c4b87 --- /dev/null +++ b/components/camel-barcode/src/main/docs/barcode-dataformat.adoc @@ -0,0 +1,122 @@ +[[BarcodeDataFormat]] +Barcode Dataformat +~~~~~~~~~~~~~~~~~~ + +*Available as of Camel 2.14* + +The barcode data format is based on the +https://github.com/zxing/zxing[zxing library]. The goal of this +component is to create a barcode image from a String (marshal) and a +String from a barcode image (unmarshal). You're free to use all features +that zxing offers. + +[[BarcodeDataFormat-Dependencies]] +Dependencies +^^^^^^^^^^^^ + +To use the barcode data format in your camel routes you need to add the +a dependency on *camel-barcode* which implements this data format. + +If you use maven you could just add the following to your pom.xml, +substituting the version number for the latest & greatest release (see +link:download.html[the download page for the latest versions]). + +[source,java] +---------------------------------------- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-barcode</artifactId> + <version>x.x.x</version> +</dependency> +---------------------------------------- + +[[BarcodeDataFormat-UsingtheJavaDSL]] +Using the Java DSL +^^^^^^^^^^^^^^^^^^ + +First you have to initialize the barcode data fomat class. You can use +the default constructor, or one of parameterized (see JavaDoc). The +default values are: + +[width="100%",cols="10%,90%",options="header",] +|======================================================================= +|Parameter |Default Value +|image type (BarcodeImageType) |PNG + +|width |100 px + +|height |100 px + +|encoding |UTF-8 + +|barcode format (BarcodeFormat) |QR-Code +|======================================================================= + +[source,java] +------------------------------------------ +// QR-Code default +DataFormat code = new BarcodeDataFormat(); +------------------------------------------ + +If you want to use zxing hints, you can use the 'addToHintMap' method of +your BarcodeDataFormat instance: + +[source,java] +----------------------------------------------------------- +code.addToHintMap(DecodeHintType.TRY_HARDER, Boolean.true); +----------------------------------------------------------- + +For possible hints, please consult the xzing documentation. + +[[BarcodeDataFormat-Marshalling]] +Marshalling ++++++++++++ + +[source,java] +---------------------------- +from("direct://code") + .marshal(code) + .to("file://barcode_out"); +---------------------------- + +You can call the route from a test class with: + +[source,java] +------------------------------------------------------------- +template.sendBody("direct://code", "This is a testmessage!"); +------------------------------------------------------------- + +You should find inside the 'barcode_out' folder this image: + +image:barcode-data-format.data/qr-code.png[image] + +[[BarcodeDataFormat-Unmarshalling]] +Unmarshalling ++++++++++++++ + +The unmarshaller is generic. For unmarshalling you can use any +BarcodeDataFormat instance. If you've two instances, one for +(generating) QR-Code and one for PDF417, it doesn't matter which one +will be used. + +[source,java] +-------------------------------------------------------------------- +from("file://barcode_in?noop=true") + .unmarshal(code) // for unmarshalling, the instance doesn't matter + .to("mock:out"); +-------------------------------------------------------------------- + +If you'll paste the QR-Code image above into the 'barcode_in' folder, +you should find '`This is a testmessage!`' inside the mock. You can find +the barcode data format as header variable: + +[width="100%",cols="10%,10%,80%",options="header",] +|======================================================================= + +|Name |Type |Description + +|BarcodeFormat |String |Value of com.google.zxing.BarcodeFormat. +|======================================================================= +Â + +Â http://git-wip-us.apache.org/repos/asf/camel/blob/22371f5a/docs/user-manual/en/barcode-data-format.data/qr-code.png ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/barcode-data-format.data/qr-code.png b/docs/user-manual/en/barcode-data-format.data/qr-code.png new file mode 100644 index 0000000..be0e7c8 Binary files /dev/null and b/docs/user-manual/en/barcode-data-format.data/qr-code.png differ
