You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Davis, Daniel" <Da...@si.edu> on 2015/03/17 16:04:36 UTC

Camel exec component tokenizer in Spring XML DSL removing plus sign in arguments

I have been unable to find an encoding or approach to include the
ImageMagick argument "+profile" in the argument list for "exec" in
Spring XML DSL as show below.  With each experiment Trace clearly shows
that the "+" sign in the arguments being stripped out.  I tried
plaintext, HTML and decimal encoding plus some dynamic character
substitutions.  I assume the tokenizer and/or the encoder for the
arguments is eating the "+".  Other than the problem argument this
"exec" is working fine.

Does anyone know a good approach, a workaround or an error I made in
Spring DSL before I move to the Java DSL for this one?

<!-- Create a thumbnail. -->
<recipientList>
   <simple>
       <!-- The arg tokenizer strips the plus sign for profile. This is
unsolved. -->
      exec:convert?args=${header.CamelFileNameProduced} -thumbnail
200x150 -colorspace RGB +profile * ${header.CamelFileNameProduced}.jpg
      <!-- exec:convert?args=${header.CamelFileNameProduced}[0]
-thumbnail 200x150 -colorspace RGB ${header.CamelFileNameProduced}.jpg -->
   </simple>
</recipientList>

--
Daniel Davis
 

Re: Camel exec component tokenizer in Spring XML DSL removing plus sign in arguments

Posted by "Davis, Daniel" <Da...@si.edu>.
You are right, this worked.  In experiments I had put RAW() around just
the "+profile *" argument and it did not work.  After wrapping the call
in RAW() I now have a "contains unsafe characters, please check
encoding" warning which I can work through but the code is passing a
valid argument list to "exec".  Its a small issue but I think its bad
form for the tokenizer or encoder to eat all plaintext and encoded forms
of "+" (I bet handling exec uniformly across all platforms is hard) but
having a way that works is gold.

Thanks,

--
Daniel Davis
Technical Manager, Office of Research Information Services
Smithsonian Institution

On 03/17/2015 09:56 PM, Willem Jiang wrote:
> Camel just replace the “+” with “ “ by default.
> You can use the RAW() to wrap the args parameter just like this.
> exec:test?args=RAW(arg1+arg2 arg3)
>
> --  
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang  
> Weibo: 姜宁willem
>
>
>
> On March 17, 2015 at 11:06:05 PM, Davis, Daniel (davisda@si.edu) wrote:
>> I have been unable to find an encoding or approach to include the
>> ImageMagick argument "+profile" in the argument list for "exec" in
>> Spring XML DSL as show below. With each experiment Trace clearly shows
>> that the "+" sign in the arguments being stripped out. I tried
>> plaintext, HTML and decimal encoding plus some dynamic character
>> substitutions. I assume the tokenizer and/or the encoder for the
>> arguments is eating the "+". Other than the problem argument this
>> "exec" is working fine.
>>  
>> Does anyone know a good approach, a workaround or an error I made in
>> Spring DSL before I move to the Java DSL for this one?
>>  
>>  
>>  
>>  
>>  
>> exec:convert?args=${header.CamelFileNameProduced} -thumbnail
>> 200x150 -colorspace RGB +profile * ${header.CamelFileNameProduced}.jpg
>>  
>>  
>>  
>>  
>> --
>> Daniel Davis
>>  
>>  
>


Re: Camel exec component tokenizer in Spring XML DSL removing plus sign in arguments

Posted by Willem Jiang <wi...@gmail.com>.
Camel just replace the “+” with “ “ by default.
You can use the RAW() to wrap the args parameter just like this.
exec:test?args=RAW(arg1+arg2 arg3)

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On March 17, 2015 at 11:06:05 PM, Davis, Daniel (davisda@si.edu) wrote:
> I have been unable to find an encoding or approach to include the
> ImageMagick argument "+profile" in the argument list for "exec" in
> Spring XML DSL as show below. With each experiment Trace clearly shows
> that the "+" sign in the arguments being stripped out. I tried
> plaintext, HTML and decimal encoding plus some dynamic character
> substitutions. I assume the tokenizer and/or the encoder for the
> arguments is eating the "+". Other than the problem argument this
> "exec" is working fine.
>  
> Does anyone know a good approach, a workaround or an error I made in
> Spring DSL before I move to the Java DSL for this one?
>  
>  
>  
>  
>  
> exec:convert?args=${header.CamelFileNameProduced} -thumbnail
> 200x150 -colorspace RGB +profile * ${header.CamelFileNameProduced}.jpg
>  
>  
>  
>  
> --
> Daniel Davis
>  
>