Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 508CF11D53 for ; Tue, 23 Sep 2014 12:51:01 +0000 (UTC) Received: (qmail 12500 invoked by uid 500); 23 Sep 2014 12:51:01 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 12450 invoked by uid 500); 23 Sep 2014 12:51:01 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 12441 invoked by uid 99); 23 Sep 2014 12:51:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2014 12:51:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2014 12:50:20 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DDC5E23889E1 for ; Tue, 23 Sep 2014 12:50:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r923235 [3/6] - in /websites/production/camel/content: ./ cache/ Date: Tue, 23 Sep 2014 12:50:15 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140923125016.DDC5E23889E1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/camel/content/component.html ============================================================================== --- websites/production/camel/content/component.html (original) +++ websites/production/camel/content/component.html Tue Sep 23 12:50:14 2014 @@ -136,7 +136,10 @@

For working with Amazon's Simple Storage Service (S3).

Bean / camel-core

-

Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects).

Bean Validator / camel-bean-validator

+

Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects).

Beanstalk / camel-beanstalk

+ +


For working with Amazon's Beanstalk.

Bean Validator / camel-bean-validator

Validates the payload of a message using the Java Validation API (JSR 303 and JAXP Validation) and its reference implementation Hibernate Validator

Box / camel-box

@@ -387,10 +390,16 @@ disruptor-vm:someName[?<option>]

Sending passive checks to Nagios using JSendNSCA

Netty / camel-netty

-

Working with TCP and UDP protocols using Java NIO based capabilities offered by the Netty project

Netty HTTP / camel-netty-http

+

Working with TCP and UDP protocols using Java NIO based capabilities offered by the Netty project

Netty4 / camel-netty4

+ +


 Working with TCP and UDP protocols using Java NIO based capabilities offered by the Netty project

Netty HTTP / camel-netty-http

-

Netty HTTP server and client using the Netty project

Olingo2 / camel-olingo2

+

Netty HTTP server and client using the Netty project

Netty4 HTTP / camel-netty4-http

+ +
 Netty HTTP server and client using the Netty project 4.x

Olingo2 / camel-olingo2

Communicates with OData 2.0 services using Apache Olingo 2.0.

Openshift / camel-openshift

@@ -455,7 +464,10 @@ disruptor-vm:someName[?<option>]

To integrate with Salesforce

SAP NetWeaver / camel-sap-netweaver

-

To integrate with SAP NetWeaver Gateway

SEDA / camel-core

+

To integrate with SAP NetWeaver Gateway

schematron / camel-schematron

+ +
Camel component of Schematron which supports to validate the XML instance documents.

SEDA / camel-core

Asynchronous call to another endpoint in the same Camel Context

SERVLET / camel-servlet

Modified: websites/production/camel/content/csv.html ============================================================================== --- websites/production/camel/content/csv.html (original) +++ websites/production/camel/content/csv.html Tue Sep 23 12:50:14 2014 @@ -101,7 +101,7 @@ from("direct:start").

... you will end up with a String containing this CSV message

abc,123

Sending the Map below through this route will result in a CSV message that looks like foo,bar

Unmarshalling a CSV message into a Java List

Unmarshalling will transform a CSV messsage into a Java List with CSV file lines (containing another List with all the field values).

An example: we have a CSV file with names of persons, their IQ and their current activity.

- Modified: websites/production/camel/content/file-language.html ============================================================================== --- websites/production/camel/content/file-language.html (original) +++ websites/production/camel/content/file-language.html Tue Sep 23 12:50:14 2014 @@ -85,92 +85,33 @@ -

File Expression Language

- -
+

File Expression Language

File language is now merged with Simple language

Icon
- -

From Camel 2.2 onwards, the file language is now merged with Simple language which means you can use all the file syntax directly within the simple language.

+

From Camel 2.2 onwards, the file language is now merged with Simple language which means you can use all the file syntax directly within the simple language.

- - -

The File Expression Language is an extension to the Simple language, adding file related capabilities. These capabilities are related to common use cases working with file path and names. The goal is to allow expressions to be used with the File and FTP components for setting dynamic file patterns for both consumer and producer.

- -

Syntax

-

This language is an extension to the Simple language so the Simple syntax applies also. So the table below only lists the additional.
-As opposed to Simple language File Language also supports Constant expressions so you can enter a fixed filename.

- -

All the file tokens use the same expression name as the method on the java.io.File object, for instance file:absolute refers to the java.io.File.getAbsolute() method. Notice that not all expressions are supported by the current Exchange. For instance the FTP component supports some of the options, where as the File component supports all of them.

- -
-

Expression

Type

File Consumer

File Producer

FTP Consumer

FTP Producer

Description

file:name

String

yes

no

yes

no

refers to the file name (is relative to the starting directory, see note below)

file:name.ext

String

yes

no

yes

no

Camel 2.3: refers to the file extension only

file:name.noext

String

yes

no

yes

no

refers to the file name with no extension (is relative to the starting directory, see note below)

file:onlyname

String

yes

no

yes

no

refers to the file name only with no leading paths.

file:onlyname.noext

String

yes

no

yes

no

refers to the file name only with no extension and with no leading paths.

file:ext

String

yes

no

yes

no

refers to the file extension only

file:parent

String

yes

no

yes

no

refers to the file parent

file:path

String

yes

no

yes

no

refers to the file path

file:absolute

Boolean

yes

no

no

no

refers to whether the file is regarded as absolute or relative

file:absolute.path

String

yes

no

no

no

refers to the absolute file path

file:length

Long

yes

no

yes

no

refers to the file length returned as a Long type

file:size

Long

yes

no

yes

no

Camel 2.5: refers to the file length returned as a Long type

file:modified

Date

yes

no

yes

no

efers to the file last modified returned as a Date type

date:command:pattern

String

yes

yes

yes

yes

for date formatting using the java.text.SimepleDataFormat patterns. Is an extension to the Simple language. Additional command is: file (consumers only) for the last modified timestamp of the file. Notice: all the commands from the Simple language can also be used.

-
- -

File token example

- -

Relative paths

-

We have a java.io.File handle for the file hello.txt in the following relative directory: .\filelanguage\test. And we configure our endpoint to use this starting directory .\filelanguage. The file tokens will return as:

-

Expression

Returns

file:name

test\hello.txt

file:name.ext

txt

file:name.noext

test\hello

file:onlyname

hello.txt

file:onlyname.noext

hello

file:ext

txt

file:parent

filelanguage\test

file:path

filelanguage\test\hello.txt

file:absolute

false

file:absolute.path

\workspace\camel\camel-core\target\filelanguage\test\hello.txt

- - -

Absolute paths

-

We have a java.io.File handle for the file hello.txt in the following absolute directory: \workspace\camel\camel-core\target\filelanguage\test. And we configure out endpoint to use the absolute starting directory \workspace\camel\camel-core\target\filelanguage. The file tokens will return as:

-

Expression

Returns

file:name

test\hello.txt

file:name.ext

txt

file:name.noext

test\hello

file:onlyname

hello.txt

file:onlyname.noext

hello

file:ext

txt

file:parent

\workspace\camel\camel-core\target\filelanguage\test

file:path

\workspace\camel\camel-core\target\filelanguage\test\hello.txt

file:absolute

true

file:absolute.path

\workspace\camel\camel-core\target\filelanguage\test\hello.txt

- - -

Samples

-

You can enter a fixed Constant expression such as myfile.txt:

-
- -
- -

Lets assume we use the file consumer to read files and want to move the read files to backup folder with the current date as a sub folder. This can be archieved using an expression like:

-
- -
- -

relative folder names are also supported so suppose the backup folder should be a sibling folder then you can append .. as:

-
- -
- -

As this is an extension to the Simple language we have access to all the goodies from this language also, so in this use case we want to use the in.header.type as a parameter in the dynamic expression:

-
- -
- -

If you have a custom Date you want to use in the expression then Camel supports retrieving dates from the message header.

-
- -
- -

And finally we can also use a bean expression to invoke a POJO class that generates some String output (or convertible to String) to be used:

-
- -
- -

And of course all this can be combined in one expression where you can use the File Language, Simple and the Bean language in one combined expression. This is pretty powerful for those common file path patterns.

- -

Using Spring PropertyPlaceholderConfigurer together with the File component

-

In Camel you can use the File Language directly from the Simple language which makes a Content Based Router easier to do in Spring XML, where we can route based on file extensions as shown below:

-
- -
- -

If you use the fileName option on the File endpoint to set a dynamic filename using the File Language then make sure you
-use the alternative syntax (available from Camel 2.5 onwards) to avoid clashing with Springs PropertyPlaceholderConfigurer.

- -
bundle-context.xml
- -
- -
bundle-context.cfg
- -
- -

Notice how we use the $simple{ } syntax in the toEndpoint above.
-If you don't do this, there is a clash and Spring will throw an exception like

-
- -
- - -

Dependencies

-

The File language is part of camel-core.

+

Dependencies

The File language is part of camel-core.

+