Search code examples
liferay

How to get content from Liferay structure


I need help getting JournalArticle content of a particular content structure in liferay.

I want to display the field values of the Journal content. This content has a custom structure.


Solution

  • The structure is essentially an xml structure of the type DYNAMIC ELEMENT tags. The value of the different fields of the structure that defines the article can be extracted using the format

    Document document = SaxReaderUtil.read(journalarticle.getContent());
    
    Node fieldNode = document.selectSingleNode("/root/dynamic-element[@name='Field-Name']/dynamic-content"); 
    
    String brand = brandNode.getText(); 
    

    `

    See more at http://liferayiseasy.blogspot.com.ng/2015/08/get-web-contentjournal-article-fields.html