Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tim Cardwell
Acessing metadata from Asset Publisher Assets
July 19, 2012 3:30 PM
Answer

Tim Cardwell

Rank: Junior Member

Posts: 27

Join Date: July 19, 2012

Recent Posts

I need to access the metadata from each asset in my asset publishers that I have on my portal, but I'm not sure how to get a handle on any of the asset publishers...

Is there a way to cycle through all of the portlets on a portal, and then recognize which is an asset publisher and which isn't?

If anyone has a better way of getting a handle on an asset publisher let me know.

Thanks,
-Tim
Hitoshi Ozawa
RE: Acessing metadata from Asset Publisher Assets
July 19, 2012 4:00 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

Just use PortletLocalServiceUtil.dynamicQuery with criteria portletId = 101

The above will get the portlet but I think you want the content?
Do a dynamicQuery on AssetEntryLocalServiceUtil
Tim Cardwell
RE: Acessing metadata from Asset Publisher Assets
July 20, 2012 11:54 AM
Answer

Tim Cardwell

Rank: Junior Member

Posts: 27

Join Date: July 19, 2012

Recent Posts

Alright, then here's a follow up question...

The dynamic query will give me a list of portlets or a list of asset entries, dependind on which query I do. What I need is a list of all the asset entries in a certain asset publisher.

Currently, the list of assets I get after a AssetEntryLocalServiceUtil.dynamicQuery() doesn't give me any information about if they belong to an asset publisher or not. Also, the list of portlets I get after I do a PortletLocalServiceUtil.dynamicQuery with criteria portletId = 101 doesn't give me any information about the assets that it is using. I checked the javadocs and can't find any method like Portlet.getAssets() or AssetEntry.getPortlet(). Is there a similar method to either one of these?

Does this make sense?

-Tim
Hitoshi Ozawa
RE: Acessing metadata from Asset Publisher Assets
July 20, 2012 6:30 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

The following thread may help you on that.

http://www.liferay.com/community/forums/-/message_boards/message/12859746