Added camel-printer docs to Gitbook

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e267008a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e267008a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e267008a

Branch: refs/heads/master
Commit: e267008a5be0453cc50cc8a9015bcbce1b56434f
Parents: a7afc19
Author: Andrea Cosentino <anco...@gmail.com>
Authored: Tue May 17 11:15:54 2016 +0200
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Tue May 17 11:15:54 2016 +0200

----------------------------------------------------------------------
 components/camel-printer/src/main/docs/lpr.adoc | 151 +++++++++++++++++++
 docs/user-manual/en/SUMMARY.md                  |   1 +
 2 files changed, 152 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e267008a/components/camel-printer/src/main/docs/lpr.adoc
----------------------------------------------------------------------
diff --git a/components/camel-printer/src/main/docs/lpr.adoc 
b/components/camel-printer/src/main/docs/lpr.adoc
new file mode 100644
index 0000000..e7f3078
--- /dev/null
+++ b/components/camel-printer/src/main/docs/lpr.adoc
@@ -0,0 +1,151 @@
+[[Printer-PrinterComponent]]
+Printer Component
+~~~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.1*
+
+The *printer* component provides a way to direct payloads on a route to
+a printer. Obviously the payload has to be a formatted piece of payload
+in order for the component to appropriately print it. The objective is
+to be able to direct specific payloads as jobs to a line printer in a
+camel flow.
+
+This component only supports a camel producer endpoint.
+
+The functionality allows for the payload to be printed on a default
+printer, named local, remote or wirelessly linked printer using the
+javax printing API under the covers.
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-printer</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+[[Printer-URIformat]]
+URI format
+^^^^^^^^^^
+
+Since the URI scheme for a printer has not been standardized (the
+nearest thing to a standard being the IETF print standard) and therefore
+not uniformly applied by vendors, we have chosen *"lpr"* as the scheme.
+
+[source,java]
+-----------------------------------------------
+lpr://localhost/default[?options]
+lpr://remotehost:port/path/to/printer[?options]
+-----------------------------------------------
+
+You can append query options to the URI in the following format,
+`?option=value&option=value&...`
+
+[[Printer-Options]]
+Options
+^^^^^^^
+
+
+// component options: START
+The Printer component has no options.
+// component options: END
+
+
+
+// endpoint options: START
+The Printer component supports 15 endpoint options which are listed below:
+
+{% raw %}
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| hostname | producer |  | String | *Required* Hostname of the printer
+| port | producer |  | int | Port number of the printer
+| printername | producer |  | String | Name of the printer
+| copies | producer | 1 | int | Number of copies to print
+| docFlavor | producer |  | DocFlavor | Sets DocFlavor to use.
+| flavor | producer |  | String | Sets DocFlavor to use.
+| mediaSize | producer | na-letter | String | Sets the stationary as defined 
by enumeration names in the javax.print.attribute.standard.MediaSizeName API. 
The default setting is to use North American Letter sized stationary. The 
value's case is ignored e.g. values of iso_a4 and ISO_A4 may be used.
+| mediaTray | producer |  | String | Sets MediaTray supported by the 
javax.print.DocFlavor API for example uppermiddle etc.
+| mimeType | producer |  | String | Sets mimeTypes supported by the 
javax.print.DocFlavor API
+| orientation | producer | portrait | String | Sets the page orientation.
+| printerPrefix | producer |  | String | Sets the prefix name of the printer 
it is useful when the printer name does not start with //hostname/printer
+| sendToPrinter | producer | true | boolean | etting this option to false 
prevents sending of the print data to the printer
+| sides | producer | one-sided | String | Sets one sided or two sided printing 
based on the javax.print.attribute.standard.Sides API
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default 
exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous 
processing should be strictly used or Camel is allowed to use asynchronous 
processing (if supported).
+|=======================================================================
+{% endraw %}
+// endpoint options: END
+
+
+[[Printer-SendingMessagestoaPrinter]]
+Sending Messages to a Printer
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+[[Printer-PrinterProducer]]
+Printer Producer
+++++++++++++++++
+
+Sending data to the printer is very straightforward and involves
+creating a producer endpoint that can be sent message exchanges on in
+route.
+
+[[Printer-UsageSamples]]
+Usage Samples
+^^^^^^^^^^^^^
+
+[[Printer-Example1:PrintingtextbasedpayloadsonaDefaultprinterusingletterstationaryandone-sidedmode]]
+Example 1: Printing text based payloads on a Default printer using letter 
stationary and one-sided mode
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+[source,java]
+-----------------------------------------------
+RouteBuilder builder = new RouteBuilder() {
+    public void configure() {
+       from(file://inputdir/?delete=true)
+       .to("lpr://localhost/default?copies=2" +
+           "&flavor=DocFlavor.INPUT_STREAM&" +
+           "&mimeType=AUTOSENSE" +
+           "&mediaSize=NA_LETTER" +
+           "&sides=one-sided")
+    }};
+-----------------------------------------------
+
+[[Printer-Example2:PrintingGIFbasedpayloadsonaRemoteprinterusingA4stationaryandone-sidedmode]]
+Example 2: Printing GIF based payloads on a Remote printer using A4 stationary 
and one-sided mode
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+[source,java]
+--------------------------------------------------
+RouteBuilder builder = new RouteBuilder() {
+    public void configure() {
+       from(file://inputdir/?delete=true)
+       .to("lpr://remotehost/sales/salesprinter" +
+           "?copies=2&sides=one-sided" +
+           "&mimeType=GIF&mediaSize=ISO_A4" +
+           "&flavor=DocFlavor.INPUT_STREAM")
+   }};
+--------------------------------------------------
+
+[[Printer-Example3:PrintingJPEGbasedpayloadsonaRemoteprinterusingJapanesePostcardstationaryandone-sidedmode]]
+Example 3: Printing JPEG based payloads on a Remote printer using Japanese 
Postcard stationary and one-sided mode
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+[source,java]
+--------------------------------------------------
+RouteBuilder builder = new RouteBuilder() {
+    public void configure() {
+       from(file://inputdir/?delete=true)
+       .to("lpr://remotehost/sales/salesprinter" +
+           "?copies=2&sides=one-sided" +
+           "&mimeType=JPEG" +
+           "&mediaSize=JAPANESE_POSTCARD" +
+           "&flavor=DocFlavor.INPUT_STREAM")
+    }};
+--------------------------------------------------

http://git-wip-us.apache.org/repos/asf/camel/blob/e267008a/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 2ee7085..82d12f3 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -216,6 +216,7 @@
     * [Paxlogging](paxlogging.adoc)
     * [PDF](pdf.adoc)
     * [PGEvent](pgevent.adoc)
+    * [Printer](lpr.adoc)
     * [Properties](properties.adoc)
     * [Quickfix](quickfix.adoc)
     * [Scp](scp.adoc)

Reply via email to