Total Pageviews

Sunday, May 13, 2012

Parsing Web Content in Java


Template based web content is one of the most promising feature of Liferay and I personally found it very helpful for various requirements.
Creating Structure based template is quite easy, see this link.


Once the web content is created, there are various ways to display it. The easiest way is to put a web content display portlet on the page and select the web content to display in it. But there are cases in which we need to get field's data inside Java code. This makes web contents more usable in live scanerios like you have to render selected content of all template based web contents.


The following code will help you about this.
Once a web content is created, a content is created, but once it is modified another one is vreated, so need to get the latest versions of all the articles, following code will help you. 
Please help yourself with proper imports. Hope this will help you.

No comments:

Post a Comment