Introducing the new ADT Framework

Hi community!

 
For the last few weeks I have been working on a new framework for Liferay Portal. We have decided to call it " Application Display Templates Framework" ("ADT Framework" for family and friends :D), and it is basically the application of our templating system to the way we see information in our applications in Liferay Portal. 
 
The ADT Framework will allow portal admins to define via Velocity templates how to show the information on each portlet. Imagine you want to show up your blog entries horizontally, or you want to list your assets in the asset publisher in different sizes depending on where they are going to be shown: now you can do it by using custom Application Display Templates! Cool, right? :)
 
For the moment I have applied it to the Asset Publisher and the Blogs portlet, but I plan to apply it to Wiki, Navigation, Site Map and Tags/Categories Navigation. 
 
 
How can you use it? There's a new application in the control panel called "Application Display Templates" (it's in the "Site" section) where you can add and manage the ADTs for the different apps in Liferay, and appart from that, on each on of the portlets that support ADTs (blogs and asset publisher for the moment), in the configuration screen you will be able to choose your ADTs, or the global ADTs (if available).
 
 
Appart from this, you'll be able to plug your custom plugins into the ADT framework, just by implementing the interface PortletDisplayTemplateHandler and declaring your implementing class in liferay-portlet.xml (in "portlet-display-template-handler")
 
How will the ADTs can look like? They will be just normal velocity templates, like the ones you use for the web content or the dynamic data lists. Additionally, there are a set of variables that have been made available for the templates (like $entries, which is the list of entries the user can see at a given moment) so that you can access all the information you need. There are a few samples made available for you in the asset publisher.
 
We have many improvements in mind that are related to this feature, but before going on I wanted to share this with you.
 
I write this blog entry for two reasons: the first one is to have the community updated on new features we the core engineering team is working on for the next version, and the second reason is to ask for your feedback and comments. 
 
Today I want to summon the Liferay Bugsquad and the rest of community members: I'd be delighted if you could test this new feature in current trunk, and I'd love to receive your feedback, the templates that you may build, your ideas, your complains or pain points, so that we can improve it asap.
 
Remember we do Liferay Portal for you: this is the kind of moments when you can have a real impact in the evolution of YOUR project.
 
Thanks in advance, and I hope you like it
Juan Fernández
 
[UPDATE] Thanks all for your feedback! We have added the features you asked for and today (a little after Milestone 4) we have implemented  Freemarker support and  ADT support for Asset Publisher, Blogs, Wiki, Documents and Media, Site Map, Tags Navigation and Categories Navigation... I'm sure you'll love this tool to create new awesome sites!
 
Blogs
This can open alot of posibilites, but can also open a can of worms. Could you add web-form portlet to the list of adding this framework. What variables will be exposed by the portlet that can be used in the template?
Nice. Will it also support Freemarker template language or are we just limiting it to the inferior and hard to debug Velocity?
Hi Mika:
up to now, I have done all test with velocity. Will check Freemarker to see what changes it will imply.
Thanks for the heads up
Hi Juan,

Thanks for bringing out this powerful feature. This will help the developers to avoid customizing the existing portlets through hooks inorder to change the look and feel, which usually involves too much of gymnastics. This feature will provide the flexibility and power to render the data of a portlet in whatever format the user wants "on-the-fly" just by changing the template. But it will be a long way till people really start using this new feature of Liferay.
Nice Juan,

I think that applying ADT to the Asset Publisher is a big improvement. As the asset publisher is a multi content type container, it could be used to display whatever we need through templates.

When do you plan to released that feauture ?

Christophe
Hi,
It is great one. Particular this idea is great but If I understood by applying ADT-velcoty template to particular portlet say "Language" ... and
if I have 3 langauge portlet on portal/web and all have different style (Listing/secect Box/ Icon)
-- so By Applying ADt-velocity template will it change all instance of langauge portlet ???

-- Will we change or able to use pre-defined one ???
Juan: Freemarker is very similar to Velocity with the exception that it doesn't eat any errors. Another clear advantage over velocity is that you can use taglibs in the template if you have access to request and response. See ThemeUtil in how we use it with themes.
Sounds great! I can really see this being a huge improvement for asset publisher!
Hi guys:
I respond here to your comments

Christophe ["When do you plan to released that feauture?"]: this is already in trunk, so it'll be part of the 6.2 release

DarshanKumar N Bhatia ["By Applying ADT template will it change all instances of portlets? Will we change or able to use pre-defined one?]: each portlet instance will be configurable, so each one could be able to be rendered using a different template, and yes, all current templates or views will be respected, so this is an "optional" feature for your portlets.

Mika ["Another clear advantage over velocity is that you can use taglibs in the template if you have access to request and response"]: awesome! I have access to req and resp so this is an awesome feature!

Thanks for the feedback!
Hi Juan,
are you gonna use this feature to centalize all templates we use in Liferay? Web Content templates and DDL templates for example have their own separate places inside of Control Panel.
Hi Juan,

Is this feature available on trunk if I build it now? Could you tell me the commit id?
This feature seems to be very handy, I'd like to test it. Btw do you have testcases?

Thanks,
Akos