Thursday, December 9, 2010

Alfresco @MVC part 2 - views

As explained in my previous post, the idea behind Alfresco @MVC is to provide spring annotations through an Alfresco webscript. Why a webscript? Well, simply because it avoids changing the web.xml file and to use AMPs (alfresco module packages).

A part from that, all this would allow to use spring views and all the features spring @MVC has to offer, like annotated parameters, return methods types and so on. I do not have to preach for spring @MVC but I like using it on my projects and know I can use it with Alfresco ... cool.

Many of you know about the framework I developed for Alfresco (Jibe) but what Jibe does is imitating Spring in a lot of features and one thing that is helpful is having conditions to evaluate a role or group for instance. Meaning that a specific view is shown to that group of people.

What about JSPs? At the end that is the solution I appreciate as it is standard and many developers know it, opposed to learning a new framework. Using a tag library is the solution. I have many tag libraries defining different needs like roles, groups, permissions and it is easily extendable in a standard way.

One more thing to note is the usage of JSON. Again a simple spring annotation @ResponseBody allows to return a JSON representation of your model.

Soon I will show some examples but for now Alfresco @MVC has some previews and a starting documentation, what is good is that there is no need for a lot of documentation as Spring has it:)

More info can be found here.

Cheers.