cancel
Showing results for 
Search instead for 
Did you mean: 

Velocity templates instead of xls

walbar
Champ in-the-making
Champ in-the-making
Hi,

I finished the great WCM tutorial and I would like to start making some "advanced" tests. Would anyone point me in the right direction on how to use Velocity to write my templates? I haven't found any docs about it, actually I wonder if that is possible nowadays (I see FreeMaker is a possibility but I must use Velocity).

Thanks in advance,

Waldemar
3 REPLIES 3

arielb
Champ in-the-making
Champ in-the-making
there is no current plan for us to support velocity templates.  however, it's really easy to do.  and we will sooner or later be making it possible to add your own presention template engines to the system (and even contribute them back to our codebase).  it will be sooner if you file a feature request in jira (http://issues.alfresco.org) Smiley Happy

walbar
Champ in-the-making
Champ in-the-making
Ariel,

Thanks a lot for your answer. I have already created a new issue in Jira, it is http://issues.alfresco.com/browse/WCM-110.

Now I'm wondering: when you say that it is really easy to do, you mean that it is easy for the Alfresco team to develop the Velocity support or easy for a developer like me that wants to personalize Alfresco to be able to use Velocity templating. If you mean the latter please point me in the right direction and any improvement that I make will be a contribution for sure.

Thanks again for your valuable help.

Waldemar

arielb
Champ in-the-making
Champ in-the-making
Thanks a lot for your answer. I have already created a new issue in Jira, it is http://issues.alfresco.com/browse/WCM-110.

yay!  thanks!

Now I'm wondering: when you say that it is really easy to do, you mean that it is easy for the Alfresco team to develop the Velocity support or easy for a developer like me that wants to personalize Alfresco to be able to use Velocity templating. If you mean the latter please point me in the right direction and any improvement that I make will be a contribution for sure.

well - it would be easy enough for us to do - but the intention is to open up this part of the product up to customization since there are so many rendering technologies out there that would be very difficult for us to anticipate and support all of them.  so, yes, the expectation is that you would help us with that and that we'll enable you to customize the product in this area as easily as possible.  for the release, we'll have reference implementations of what we're now calling rendering engines for freemarker, xslt, and xsl-fo.

i can't point you at anything quite yet since the customization mechanism isn't in place yet.  however, in the end i anticipate you'll be implementing a class that will look something like this:


public class VelocityRenderingEngine implements RenderingEngine
{
    public void render(Document formInstanceData, Map<String, String> parameters, OutputStream out) { … }
}

there are a bunch more details here relating to callback functions from the template that we should discuss in more detail.  i'll try and write up a spec for this on the wiki in the near future for you (and everyone else) to review so we can ensure that this will meet your criteria.