Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to modify the links that appear on Asset Publisher portlet?
    text
    copied!<p>The requirement is as follows,</p> <p>When a new web content(corresponding to a particular structure, say A) is published, it should automatically get updated on the Asset Publisher portlet (default functionality of Asset Publisher).</p> <p>By default the Title of the web content is what appears as a link on the Asset Publisher for different web contents. Instead of this I want the content of an element (say name) of structure A to appear as a link. Clicking on this link should open an <strong>Alloy UI Popup</strong> containing the corresponding Web content.</p> <p>For this to happen I created a new <strong>'display style'</strong> jsp using hooks (tweaked the <strong>abstracts.jsp</strong>).</p> <p>Wrote this scriptlet in the <code>.jsp</code>:</p> <pre><code>&lt;% String personName=null; JournalArticle journalArticle=null; String myContent=null; Document document = null; Node node=null; Node node1=null; Node node2=null; Node node3=null; int noOfWords=0; String pic=null; String aboutMe=null; double version=0; try { version=JournalArticleLocalServiceUtil.getLatestVersion(assetRenderer.getGroupId(), "14405"); journalArticle = JournalArticleLocalServiceUtil.getArticle(assetRenderer.getGroupId() , "14405",version); myContent = journalArticle.getContent(); document = SAXReaderUtil.read(new StringReader(myContent)); node = document.selectSingleNode("/root/dynamic-element[@name='personName']/dynamic-content"); if (node.getText().length() &gt; 0) { personName = node.getText(); } node1 = document.selectSingleNode("/root/dynamic-element[@name='pic']/dynamic-content"); if (node1.getText().length() &gt; 0) { pic = node1.getText(); } node2 = document.selectSingleNode("/root/dynamic-element[@name='noOfWords']/dynamic-content"); if (node2.getText().length() &gt; 0) { noOfWords = Integer.parseInt(node2.getText()); } node3 = document.selectSingleNode("/root/dynamic-element[@name='aboutMe']/dynamic-content"); if (node3.getText().length() &gt; 0) { aboutMe = node3.getText(). substring(0,noOfWords)+"...."; } } catch (PortalException e) { e.printStackTrace(); } catch (DocumentException e) { e.printStackTrace(); } %&gt; </code></pre> <p>But here the <code>articleId</code> needs to be hard coded.</p> <p>I want to fetch the <code>articleId</code> here as and when a new web content is published i.e. dynamically.</p> <p>Which API should be used here?</p> <p>Any help is appreciated.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload