Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache Velocity Engine #144

Closed
gustavogalvan opened this issue Jun 11, 2015 · 4 comments
Closed

Apache Velocity Engine #144

gustavogalvan opened this issue Jun 11, 2015 · 4 comments

Comments

@gustavogalvan
Copy link
Contributor

Can you add a template module for Apache Velocity ?
Thanks so much !

@decebals
Copy link
Member

@gustavogalvan Can you help me with some velocity templates? Now in resources/templates/pippo are some templates copied from freemarker project and I want to translate these templates from freemarker syntax to velocity syntax but I am a newbie in velocity.

@gustavogalvan
Copy link
Contributor Author

I'm not in my workplace but I do not want to delay you, so...

  • $welcome is ok for an String;
  • for HashMap <String, String> data (with "car","ferrari"): $data.car = ferrari
  • for HashMap <String, String[]> data (with "cars",["ferrari","fiat","ford"]):
    #foreach($car in ${data.cars})

    $car

    #end

#include: includes a file without processing vars
#parse: includes a file processing vars

I now this is not much but I hope it helps.
Sorry and thanks.

@decebals
Copy link
Member

I finished the implementation. Probably I must make some adjustments but the module is 100% functional (webjarsAt, publicAt, ....). You can test with VelocityDemo from pippo-demo-template.
From my experience with this implementation I don't recommend you velocity as template engine from these reasons:

  • the last release (1.7) is from 2010
  • no support for template inheritance (if you want to create sites with a base template)
  • no support for external extensions/methods/helpers and for this reason I must use PippoHandler from jade template.

@gitblit What you say if we rename the PippoHandler to TemplateHandler(or a better name) and move this class in core? We used this class in two templates engine (Jade and Velocity) and is a general solution for template engines that don't have support for external methods.

Please review and comment the pippo-velocity implementation (brnach). Any advice, observation is welcome.

@gitblit
Copy link
Collaborator

gitblit commented Jun 16, 2015

Generally I like the idea of having one implementation but PippoHandler depends on pretty-time which means adding a compile-time dependency to pippo-core. I suppose it could be specified as optional in pippo-core and required in the template engine poms...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants