Extending an AssetRendererFactory

 

Many of you know a lot and do an extensive use of the Asset Framework, the framework within Liferay Portal that "provides a set of functionalities that are common to several different content types".
 
In many projects we find that developers need to extend the behaviour of the AssetRendererFactories to fit their needs, and, even it is not that hard, it takes a while to think on the best and cleaner way to achieve this. 
 
In a recent forum post, a user asked how to modify the UserAssetRendererFactory and I decided to write down the steps in a wiki article to share it with the rest of the community. 
 
Here's the link, but for the most impatients, here are the steps to do:
 
 
1.- Create an ext plugin
2.- Add the portlet you want to modify/extend to liferay-portlet-ext.xml 
3.- Make <asset-renderer-factory> point to your custom class
4.- Create a class that extends the original AssetRendererFactory and the add or modify the methods you need
5.- Deploy, restart the server and you are ready to go! :)
 
That's it!
I hope this is useful for you
Regards, 
Juan Fernández
 
Blogs
Hi Juan, Thanks to post.

Question: can AssetRendererFactory be hook-able? Hook plugin would be better solution.