Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Gwowen Fu
Create URL to Asset Publisher with category id
September 28, 2012 10:50 AM
Answer

Gwowen Fu

Rank: Expert

Posts: 315

Join Date: December 27, 2010

Recent Posts

Hi,
In web content, I want to have a URL link that will open asset publisher in current page or different page that shows documents tagged by category ID passed from the URL link.

The Java code I found for this is something like this:

PortletURL portletURL = PortletURLFactoryUtil.create(request, PortletKeys.ASSET_PUBLISHER, plid, PortletRequest.RENDER_PHASE);
portletURL.setPortletMode(PortletMode.VIEW);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("struts_action", "/asset_publisher/view_content");
portletURL.setParameter("type", assetRendererFactory.getType());
portletURL.setParameter("urlTitle", assetRenderer.getUrlTitle());


How do I set the category ID for asset publish through PortletURL?

Thanks for any help!
Gwowen
Pablo Rendón
RE: Create URL to Asset Publisher with category id
February 18, 2013 5:44 AM
Answer

Pablo Rendón

Rank: New Member

Posts: 8

Join Date: December 29, 2011

Recent Posts

You can find an example of how to filter the asset publisher by category or tag dynamically and the creation of the URL in a hook here:

http://www.rotterdam-cs.com/blogs/-/blogs/how-to-filter-the-asset-publisher-by-category-dynamicall-1?_33_redirect=http%3A%2F%2Fwww.rotterdam-cs.com%2Fblogs%3Fp_p_id%3D33%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3D_118_INSTANCE_HwrUZetgi0eN__column-1%26p_p_col_count%3D1

however you can apply the same concept in a portlet or in a theme...
I hope this helps....