You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Nicolas Le Bas (Created) (JIRA)" <ji...@apache.org> on 2012/02/17 18:59:59 UTC

[jira] [Created] (TREQ-11) Support for Mustache

Support for Mustache
--------------------

                 Key: TREQ-11
                 URL: https://issues.apache.org/jira/browse/TREQ-11
             Project: Tiles Request
          Issue Type: Improvement
    Affects Versions: 1.0.0
            Reporter: Nicolas Le Bas


Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TREQ-11) Support for Mustache

Posted by "Nicolas Le Bas (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210447#comment-13210447 ] 

Nicolas Le Bas commented on TREQ-11:
------------------------------------

I've had a look at the code and I have a couple of questions about it. No criticism meant: I realize the request API is not sufficiently documented yet, and I appreciate the effort involved in contributing in a pre-beta version.

- why a new interface to locate Mustache templates? If ApplicationContext.getResource(...) doesn't deliver, perhaps we should improve on that instead of creating a new interface.

- relying on java.io.File / FileFilter seems dangerous to me, it has cross-platform issues. If the intent is to locate a file on the classpath (as expressed in the test case), then the file separator should always be "/". Using File would accept "\" as a separator on Windows, which would be incorrect.

- Do we need MustacheRequest at all? I don't see it instantiated anywhere.

                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TREQ-11) Support for Mustache

Posted by "Mck SembWever (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210898#comment-13210898 ] 

Mck SembWever commented on TREQ-11:
-----------------------------------

As Greg mentions on the dev list we can't include this contribution until the author grants license to Tiles. (see http://thread.gmane.org/gmane.comp.apache.tiles.devel/358 )

                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (TREQ-11) Support for Mustache

Posted by "Mck SembWever (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210499#comment-13210499 ] 

Mck SembWever edited comment on TREQ-11 at 2/17/12 9:04 PM:
------------------------------------------------------------

bq. why a new interface to locate Mustache templates? If ApplicationContext.getResource(...) doesn't deliver, perhaps we should improve on that instead of creating a new interface.

yes ofc. request.getApplicationContext().getResource().openStream()
(that's my fault - sorry morten!)

bq. relying on java.io.File / FileFilter seems dangerous to me, it has cross-platform issues. If the intent is to locate a file on the classpath (as expressed in the test case), then the file separator should always be "/". Using File would accept "\" as a separator on Windows, which would be incorrect.

Nice catch Nick! The intent is just to apply a regexp pattern, eg which file extensions to accept as mustache templates (since mustache can operate on anything).

bq. Do we need MustacheRequest at all? I don't see it instantiated anywhere. 

No not really. Mustache partials don't have a plugin interface so it's not actually possible. Of course we could fork the java Mustache implementation to embed tiles functionality, but this wouldn't make sense unless we pushed for similar functionality in the other mustache implementation (particularly the javascript implementation). And this would indeed be very cool because the composition tiles provides because a common abstraction over both the server and client side. (Something i've been thinking a lot about recently).
I suggest for now we leave it as proof of concept and first just pull in MustacheRenderer (given the above two improvements).

                
      was (Author: michaelsembwever):
    bq. why a new interface to locate Mustache templates? If ApplicationContext.getResource(...) doesn't deliver, perhaps we should improve on that instead of creating a new interface.

yes ofc. request.getApplicationContext().getResource().openStream()
(thanks my fault - sorry morten!)

bq. relying on java.io.File / FileFilter seems dangerous to me, it has cross-platform issues. If the intent is to locate a file on the classpath (as expressed in the test case), then the file separator should always be "/". Using File would accept "\" as a separator on Windows, which would be incorrect.

Nice catch Nick! The intent is just to apply a regexp pattern, eg which file extensions to accept as mustache templates (since mustache can operate on anything).

bq. Do we need MustacheRequest at all? I don't see it instantiated anywhere. 

No not really. Mustache partials don't have a plugin interface so it's not actually possible. Of course we could fork the java Mustache implementation to embed tiles functionality, but this wouldn't make sense unless we pushed for similar functionality in the javascript mustache implementation. And this would indeed be very cool because the composition tiles provides because a common abstraction over both the server and client side. (Something i've been thinking a lot about recently).
I suggest for now we leave it as proof of concept and first just pull in MustacheRenderer.

                  
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TREQ-11) Support for Mustache

Posted by "Adam Gent (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232707#comment-13232707 ] 

Adam Gent commented on TREQ-11:
-------------------------------

So what version of tiles will include this? Apologies if its a dumb question.
                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>             Fix For: 1.0.0
>
>         Attachments: mustache.patch
>
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TREQ-11) Support for Mustache

Posted by "Nicolas Le Bas (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13233085#comment-13233085 ] 

Nicolas Le Bas commented on TREQ-11:
------------------------------------

_Tiles Request_ is a new project, version 1.0 is scheduled to be released with _Tiles_ 3.0
                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>             Fix For: 1.0.0
>
>         Attachments: mustache.patch
>
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TREQ-11) Support for Mustache

Posted by "Morten Lied Johansen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Morten Lied Johansen updated TREQ-11:
-------------------------------------

    Attachment: mustache.patch

The github pull-request as a patch. (Downloaded from https://github.com/apache/tiles/pull/1.patch)

I have implemented a couple of the changes suggested here (removing the ResourceLoader interface, using regex Pattern instead of FileFilter).

                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>         Attachments: mustache.patch
>
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (TREQ-11) Support for Mustache

Posted by "Nicolas Le Bas (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Le Bas resolved TREQ-11.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.0

I pulled the patch and applied the necessary changes since the code has evolved since we started this.
I didn't pull MustacheRequest because I don't want to maintain it without a use case or a test case.

Please confirm that it fits your needs.

                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>             Fix For: 1.0.0
>
>         Attachments: mustache.patch
>
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TREQ-11) Support for Mustache

Posted by "Mck SembWever (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210499#comment-13210499 ] 

Mck SembWever commented on TREQ-11:
-----------------------------------

bq. why a new interface to locate Mustache templates? If ApplicationContext.getResource(...) doesn't deliver, perhaps we should improve on that instead of creating a new interface.

yes ofc. request.getApplicationContext().getResource().openStream()
(thanks my fault - sorry morten!)

bq. relying on java.io.File / FileFilter seems dangerous to me, it has cross-platform issues. If the intent is to locate a file on the classpath (as expressed in the test case), then the file separator should always be "/". Using File would accept "\" as a separator on Windows, which would be incorrect.

Nice catch Nick! The intent is just to apply a regexp pattern, eg which file extensions to accept as mustache templates (since mustache can operate on anything).

bq. Do we need MustacheRequest at all? I don't see it instantiated anywhere. 

No not really. Mustache partials don't have a plugin interface so it's not actually possible. Of course we could fork the java Mustache implementation to embed tiles functionality, but this wouldn't make sense unless we pushed for similar functionality in the javascript mustache implementation. And this would indeed be very cool because the composition tiles provides because a common abstraction over both the server and client side. (Something i've been thinking a lot about recently).
I suggest for now we leave it as proof of concept and first just pull in MustacheRenderer.

                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (TREQ-11) Support for Mustache

Posted by "Nicolas Le Bas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Le Bas closed TREQ-11.
------------------------------

    
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>             Fix For: 1.0.0
>
>         Attachments: mustache.patch
>
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TREQ-11) Support for Mustache

Posted by "Morten Lied Johansen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TREQ-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225253#comment-13225253 ] 

Morten Lied Johansen commented on TREQ-11:
------------------------------------------

This looks fine to me. Thanks.

                
> Support for Mustache
> --------------------
>
>                 Key: TREQ-11
>                 URL: https://issues.apache.org/jira/browse/TREQ-11
>             Project: Tiles Request
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Nicolas Le Bas
>              Labels: patch
>             Fix For: 1.0.0
>
>         Attachments: mustache.patch
>
>
> Morten Lied Johansen has filed a pull request on github: https://github.com/apache/tiles/pull/1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira