Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Daniel Aschauer
Access current asset in custom portlet
December 7, 2012 6:57 AM
Answer

Daniel Aschauer

Rank: Junior Member

Posts: 39

Join Date: October 22, 2012

Recent Posts

Hi there!
I have written a portlet where i want to access and show data from an asset.
So I have Page A with an asset publisher showing abstracts, and page B with the same instance of the asset publisher showing the full content (e.g. of a JournalArticle).
On Page B a have placed my portlet, and i need to know about the select asset (assetEntyId).
Obviously these information is not in my portlet's request. Can asset publisher share this information somehow to make it accessible by other (custom) portlets?
Thanks,
Daniel
Daniel Aschauer
RE: Access current asset in custom portlet
December 7, 2012 8:15 AM
Answer

Daniel Aschauer

Rank: Junior Member

Posts: 39

Join Date: October 22, 2012

Recent Posts

By the way the communication for the same thing works fine within the core portlets asset puplisher and "Related Assets". Is this just because the are part of the portal core, and/or share the same context. Or is this configurated to be like this, and if so how can this applied to other portlets?
Daniel Aschauer
RE: Access current asset in custom portlet
December 12, 2012 2:11 AM
Answer

Daniel Aschauer

Rank: Junior Member

Posts: 39

Join Date: October 22, 2012

Recent Posts

I was able to partly solve the issue, making extending the definition of the assetpublisher portal by an ext plugin.
I added the paramters assetEntryId and urlTitle:
1        <supported-public-render-parameter>assetEntryId</supported-public-render-parameter>
2        <supported-public-render-parameter>urlTitle</supported-public-render-parameter>

The same I did for my custom portlet.

This works fine now as long as the asset publisher showing the abstracts directly links to the full content. But when i use a friendly url like http://liferay/-/articleurltitle the article shows up in the asset publisher but my portlet wont get the parameter urlTitle.

I wonder if anyone faced the same problem and knows how it can be solved?
Thanks!