We already see in my previous blog on Structues and Tempelates that Liferay Stores Structues in xml format. So if you create a Web Content using Structures and Template and want to get the value of fields programmatically , than you can use SAXReaderUtil Class of Liferay. This class is used to parse xml content.
Ex- I already Created a Structure MOBILE_STRUCTURE which contain 5 fields Brand,Model,Description,Camera and Price.Now i create web contents Sony Xperia C using this structures .This data is save in journalarticle table as:-
Here the Content column store the data in xml as:-
So What if we want to fetch the fields like Price of Sony Xperia C programmatically. Just use SAXReaderUtil as:-
For getting JournalArticle object you may refer my previous blog on Fetch Web Content Programmatically.
Hope this will Help....
Related Post:-
Get Web Content Fields Data using x:parse tag
Basic web content in Liferay
Categorization in web content
Structure and Template in Web Content
Fetch Web Content Programmatically
Embedding a Portlet in Web Content
Create tabs using Web Content
Embedding a Web Content/Journal Article in a Portlet
Fetch Latest Version Journal Article or Web Content in Liferay
No comments:
Post a Comment