You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Fernando Ribeiro (JIRA)" <ji...@apache.org> on 2011/05/09 02:46:03 UTC

[jira] [Created] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Move Default Encoding to Component Class in the FreeMarker Component
--------------------------------------------------------------------

                 Key: CAMEL-3956
                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.7.1
         Environment: All Camel environments.
            Reporter: Fernando Ribeiro
            Priority: Minor
         Attachments: patch.txt

The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Resolved] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by Fernando Ribeiro <we...@fernandoribeiro.eti.br>.
Claus,

Sorry to insist, but can you explain the difference there to me?

Thanks,

On Mon, May 9, 2011 at 11:43 AM, Fernando Ribeiro <
webmaster@fernandoribeiro.eti.br> wrote:

> Claus,
>
> Humm, I admit that I don't really understand the difference between the two
> parameters in the current implementation, can you help me there, please?
>
> In a separate note, you don't really need a Configuration object when you
> don't want a cache, will submit that change as well later.
>
> Thanks,
>
> On Mon, May 9, 2011 at 9:24 AM, Claus Ibsen (JIRA) <ji...@apache.org>wrote:
>
>>
>>     [
>> https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>>
>> Claus Ibsen resolved CAMEL-3956.
>> --------------------------------
>>
>>       Resolution: Won't Fix
>>    Fix Version/s: 2.8.0
>>         Assignee: Claus Ibsen
>>
>> This wont work as the endpoint option allows per endpoint configuration.
>> For example you may have N+ freemarker endpoints and they can each use their
>> own encoding.
>>
>> The configuration is a shared global configuration. And it only has 1
>> encoding.
>>
>> > Move Default Encoding to Component Class in the FreeMarker Component
>> > --------------------------------------------------------------------
>> >
>> >                 Key: CAMEL-3956
>> >                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>> >             Project: Camel
>> >          Issue Type: Improvement
>> >          Components: camel-core
>> >    Affects Versions: 2.7.1
>> >         Environment: All Camel environments.
>> >            Reporter: Fernando Ribeiro
>> >            Assignee: Claus Ibsen
>> >            Priority: Minor
>> >             Fix For: 2.8.0
>> >
>> >         Attachments: patch.txt
>> >
>> >
>> > The default encoding should be set in the component class, like the
>> contentCache parameter.
>>
>> --
>> This message is automatically generated by JIRA.
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>
>

Re: [jira] [Resolved] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by Fernando Ribeiro <we...@fernandoribeiro.eti.br>.
Claus,

Humm, I admit that I don't really understand the difference between the two
parameters in the current implementation, can you help me there, please?

In a separate note, you don't really need a Configuration object when you
don't want a cache, will submit that change as well later.

Thanks,

On Mon, May 9, 2011 at 9:24 AM, Claus Ibsen (JIRA) <ji...@apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Claus Ibsen resolved CAMEL-3956.
> --------------------------------
>
>       Resolution: Won't Fix
>    Fix Version/s: 2.8.0
>         Assignee: Claus Ibsen
>
> This wont work as the endpoint option allows per endpoint configuration.
> For example you may have N+ freemarker endpoints and they can each use their
> own encoding.
>
> The configuration is a shared global configuration. And it only has 1
> encoding.
>
> > Move Default Encoding to Component Class in the FreeMarker Component
> > --------------------------------------------------------------------
> >
> >                 Key: CAMEL-3956
> >                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
> >             Project: Camel
> >          Issue Type: Improvement
> >          Components: camel-core
> >    Affects Versions: 2.7.1
> >         Environment: All Camel environments.
> >            Reporter: Fernando Ribeiro
> >            Assignee: Claus Ibsen
> >            Priority: Minor
> >             Fix For: 2.8.0
> >
> >         Attachments: patch.txt
> >
> >
> > The default encoding should be set in the component class, like the
> contentCache parameter.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Attachment: patch.txt

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt, patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Attachment:     (was: patch.txt)

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034600#comment-13034600 ] 

Claus Ibsen commented on CAMEL-3956:
------------------------------------

Fernando.

We do not want to change the current patch. The current code works for people.

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031189#comment-13031189 ] 

Fernando Ribeiro edited comment on CAMEL-3956 at 5/11/11 12:37 PM:
-------------------------------------------------------------------

I got what you meant when I read "and use the encoding from Freemarker Configuration", which was not the content of the patch. It actually only provided a default value to be passed to the getTemplate method of the Configuration object in the endpoint class.

Anyway I took a closer look at the FreeMarker source code and realized that there is an even better solution, which is going with FreeMarker itself, which defaults to the platform's encoding when none is provided. Please find the revision attached.

      was (Author: fribeiro):
    I got what you meant when I read "and use the encoding from Freemarker Configuration", which is not really that the content of the patch. It actually only provided a default value to be passed to the getTemplate method of the Configuration object in the endpoint class.

Anyway I took a closer look at the FreeMarker source code and realized that there is an even better solution, which is going with FreeMarker itself, which defaults to the platform's encoding when none is provided.

Please find the revision attached.
  
> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3956.
--------------------------------

       Resolution: Won't Fix
    Fix Version/s: 2.8.0
         Assignee: Claus Ibsen

This wont work as the endpoint option allows per endpoint configuration. For example you may have N+ freemarker endpoints and they can each use their own encoding.

The configuration is a shared global configuration. And it only has 1 encoding.

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Comment: was deleted

(was: That's fine, I realize that the only change that "survived" the second round of investigation was using the encoding field instead of the getEncoding method -- isn't it a good thing to apply, though?)

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034324#comment-13034324 ] 

Fernando Ribeiro commented on CAMEL-3956:
-----------------------------------------

Any feedback yet? I have a few other patches to these same classes to submit next.

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Attachment: patch.txt

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038038#comment-13038038 ] 

Fernando Ribeiro edited comment on CAMEL-3956 at 5/24/11 5:53 PM:
------------------------------------------------------------------

That's fine, I realize that the only change that "survived" the second round of investigation was using the encoding field instead of the getEncoding method -- isn't it a good thing to apply, though?

      was (Author: fribeiro):
    That's fine, I realize that the only change that "survived" the secound round of investigation was using the encoding field instead of the getEncoding method -- isn't it a good practice to follow here?
  
> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro reopened CAMEL-3956:
-------------------------------------


> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Attachment:     (was: patch.txt)

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro reopened CAMEL-3956:
-------------------------------------


> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3956.
--------------------------------

    Resolution: Won't Fix

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Attachment:     (was: patch.txt)

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3956.
--------------------------------

    Resolution: Won't Fix

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Attachment: patch.txt

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Priority: Minor
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038038#comment-13038038 ] 

Fernando Ribeiro commented on CAMEL-3956:
-----------------------------------------

That's fine, I realize that the only change that "survived" the secound round of investigation was using the encoding field instead of the getEncoding method -- isn't it a good practice to follow here?

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031189#comment-13031189 ] 

Fernando Ribeiro commented on CAMEL-3956:
-----------------------------------------

I got what you meant when I read "and use the encoding from Freemarker Configuration", which is not really what the patch was meant to change. It actually only provided a default value to be passed to the getTemplate method of the Configuration object in the endpoint class.

Anyway I took a closer look at the FreeMarker source code and realized that there is an even better solution, which is going with FreeMarker itself, which defaults to the platform's encoding when none is provided.

Please find the revision attached.

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031178#comment-13031178 ] 

Claus Ibsen commented on CAMEL-3956:
------------------------------------

If we have 3 routes using freemarker
{code}
route1
from X to "freemarker:x?encoding=utf-8"

route2
from Y to "freemarker:y?encoding=iso-8859-1"

route3
from Z to "freemarker:z"
{code}

Then we want the encoding parameter not be shared between the endpoints. So the first route have utf-8, the 2nd iso-8859-1, and the last route do not have any encoding set.

This is possible today as the encoding parameter is *per* endpoint.

If you remove that, and use the encoding from Freemarker Configuration, then that is a *shared* between all endpoints. So that mean when route2 set the encoding to iso-8859-1, it will override the encoding set by route1. And the last route will also use the iso-8859-1 encoding, despite it doesnt have any set.




> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Ribeiro updated CAMEL-3956:
------------------------------------

    Attachment: patch.txt

> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (CAMEL-3956) Move Default Encoding to Component Class in the FreeMarker Component

Posted by "Fernando Ribeiro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031189#comment-13031189 ] 

Fernando Ribeiro edited comment on CAMEL-3956 at 5/10/11 1:53 PM:
------------------------------------------------------------------

I got what you meant when I read "and use the encoding from Freemarker Configuration", which is not really that the content of the patch. It actually only provided a default value to be passed to the getTemplate method of the Configuration object in the endpoint class.

Anyway I took a closer look at the FreeMarker source code and realized that there is an even better solution, which is going with FreeMarker itself, which defaults to the platform's encoding when none is provided.

Please find the revision attached.

      was (Author: fribeiro):
    I got what you meant when I read "and use the encoding from Freemarker Configuration", which is not really what the patch was meant to change. It actually only provided a default value to be passed to the getTemplate method of the Configuration object in the endpoint class.

Anyway I took a closer look at the FreeMarker source code and realized that there is an even better solution, which is going with FreeMarker itself, which defaults to the platform's encoding when none is provided.

Please find the revision attached.
  
> Move Default Encoding to Component Class in the FreeMarker Component
> --------------------------------------------------------------------
>
>                 Key: CAMEL-3956
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3956
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.1
>         Environment: All Camel environments.
>            Reporter: Fernando Ribeiro
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: patch.txt
>
>
> The default encoding should be set in the component class, like the contentCache parameter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira