cancel
Showing results for 
Search instead for 
Did you mean: 

AVM vs Web forms Templates

ramigg
Champ in-the-making
Champ in-the-making
First I like to say that I find Alfresco a very powerful system.
I say it after working for a while with MOSS (Sharepoint 2007).
The combination of so many technologies lets you do anything you like.

I have a beginner's question:
Why do I need to use the templates (xsl or freemarker) in web forms when I can do anything through the AVM API. Just write a JSP that access anything on the web site.

Plus when I update the web form templated (xsl) I didn't see that all the associated generated content files from those templates get update with the new template output.

Thanks in advance
Rami.
3 REPLIES 3

kvc
Champ in-the-making
Champ in-the-making
Rami:


Glad to hear you like the system!  I look forward to you (hopefully) becoming an active member of the Community on this forum.

Why use templates?  You are right; you don't need do.  If you want your site to be entirely dynamic, just capture and store the XML and fetch directly from your run-time page (your JSP). 

Now, you may wish to do things like statically generate entire pages, page components, or fixed renditions (like a PDF).  In this case, you can associate templates with your web form.

This is also why we also template configuration on a per web project basis.  You may have a single web form - say, article.xsd - that is used in lots of sites.  For you www site, you may wish for articles to be statically generated as a web page - be that an HTML page or a dynamic page like a JSP.  For your customer self-service app, though, you just need the data - when associating the article form to this second web project, you simply wouldn't choose to also associate the output template.

Now remember another use of templates - they can be used for more than generating HTML or PDF.  You may want them to generate JSP.  So, if there are minor presentation layer changes your business users are frequently requesting of you for modifying your dynamic pages, you can extract those things out as parameters to be captured via a web form that in turn can generate your JSP pages for you.  This is particularly good for business user that want to do things like add teasers to a pages or maybe rearrange the way components are tiled on the page.

Also, please note that with 2.1.0, you now have another option available for you for coding your dynamic web pages:  instead of having to use our native Java API, you can now write web scripts and use our lighter-weight JavaScript and Template API.  Should be faster and easier.

Anyway, thanks for the post!  And keep'em coming.


Kevin

ramigg
Champ in-the-making
Champ in-the-making
what about this behavior which I found:
When I updated the web form template (xsl) I didn't see that all the associated generated content files from those templates get update with the new template output.


Thanks!

kvc
Champ in-the-making
Champ in-the-making
There is a special regenerate option on the web form in the data dictionary to re-generate renditions based on changes to templates.

Note that in 2.1.0 Community Final, we currently have indexing for staging snapshots configured asychronously.  We are changing this to be synchronous by default (it's a config option), because you can get incorrect results (say if you deleted an asset and submitted, but your index isn't updated, we'll want to regenerate the deleted asset, and error out).

So, take a look at this and once again we'll update the default indexing behavior to fix the above issue with 2.1.0E.

Kevin