Page 1 of 1

liquip / handleblars.java / jangod /

Posted: Thu Oct 31, 2013 5:19 am
by maurosergiosilva
I am looking for a template engine that meets the same requirements of the liquid:
  • It has to have beautiful and simple markup. Template engines which don't produce good looking markup are no fun to use.
  • It needs to be non evaling and secure. Liquid templates are made so that users can edit them. You don't want to run code on your server which your users wrote.
  • It has to be stateless. Compile and render steps have to be separate so that the expensive parsing and compiling can be done once and later on you can just render it passing in a hash with local variables and objects.
I'm evaluating the alternatives are as follows:
  • Using liquid. Its implementation in Java (liquip) or use the implementation originail with jRuby.
  • Jangod
  • handleblars.java

Handlebars is best supported by spring and you can make Helpers to emulate Liquid's filters.
I do not have much information on the implementation of the liquid in java, but its original version in ruby is very robust and is in use a long time.
The syntax Jangod isvery user friendly as the liquid.

Does anybody have some experiencie with one of this template engine on broadleaf?

Re: liquip / handleblars.java / jangod /

Posted: Wed Nov 06, 2013 6:15 am
by maurosergiosilva
Weel,
As I culd see liquip is the best option.
Its realtivly easy fork handlebars.java spring project to liquip-spring project and to use it as viewer.
Liquid is user friendly and yease to learn from a designer perspective and is secury to use in multi tenant / shared hosts.
I´m knew on broadleaf and I´m porting an template using thymeleaf know, so I dont know exclty what we loose when we change the site viewer, since themyleaf has good suport to spring, and broadleaf may extend its features.

Re: liquip / handleblars.java / jangod /

Posted: Wed Nov 06, 2013 9:44 am
by phillipuniverse
I haven't seen a BLC project with those specific templating languages but we did one about a year and a half ago with Mustache (very similar to Handlebars). One of our developers wrote a blog post about it: http://www.broadleafcommerce.com/blog/m ... evelopment. Somebody wrote a pretty good Java/Spring port for it and a client wanted to use it.

Just keep in mind that if you don't use Thymeleaf you might have to re-invent some functionality that we've written. For instance, we have some custom Thymeleaf processors (which are conceptually the same as JSP tags) that you might have to duplicate. Although with templating languages like the ones that you mentioned they pride themselves on being 'logicless' so that concept might not even exist.

If you go down that route we would love to hear about how it goes! At its heart, Broadleaf should be relatively view-layer agnostic so if you run into problems we want to know!

Re: liquip / handleblars.java / jangod /

Posted: Fri Nov 08, 2013 3:13 pm
by maurosergiosilva
Hi Phillip, thanks for replying.
I had seen this article, even thought you had used hanblebars.java, since it is a superset of the mustache and has an very good implementation / integration with spring.
Currently changing the view layer to the liquid is not in the version of MVP Broadleaf work we intend to use, but is in our roadmap and when we do I will post the POC on github.
In fact, the Liquid has a downside, it is to be associated with the brand Shoppify.
On the other hand would be possible to use the network of experts desing http://experts.shopify.com/designers, who are experts in liquid and ecommerce front end as templates providers.
Here in Brazil, the largest ecommerce player, though has marketed their product as SaaS (single tenant), it has a network of digital agencies specialized design templates, and indeed are the agencies that obtain new customers.