public static String getStringFromPortletUrl ( PortletUrl portletUrl , HttpServletRequest request ) { if ( portletUrl == null ) { return null ; } // Default urlType UrlType urlType = UrlType . RENDER ; final PortletUrlType type = portletUrl . getType ( ) ; switch ( type ) { case ACTION : urlType = UrlType . ACTION ; break ; case RESOURCE : urlType = UrlType . RESOURCE ; break ; default : urlType = UrlType . RENDER ; break ; } IPortletWindow marketplaceWindow = portletWindowRegistry . getOrCreateDefaultPortletWindowByFname ( request , MarketplacePortletDefinition . MARKETPLACE_FNAME ) ; IPortalUrlBuilder portalUrlBuilder = portalUrlProvider . getPortalUrlBuilderByPortletWindow ( request , marketplaceWindow . getPortletWindowId ( ) , urlType ) ; IPortletUrlBuilder portletUrlBuilder = portalUrlBuilder . getTargetedPortletUrlBuilder ( ) ; final String portletMode = portletUrl . getPortletMode ( ) ; if ( portletMode != null ) { portletUrlBuilder . setPortletMode ( PortletUtils . getPortletMode ( portletMode ) ) ; } final String windowState = portletUrl . getWindowState ( ) ; if ( windowState != null ) { portletUrlBuilder . setWindowState ( PortletUtils . getWindowState ( windowState ) ) ; } for ( final PortletUrlParameter param : portletUrl . getParam ( ) ) { final String name = param . getName ( ) ; final List < String > values = param . getValue ( ) ; portletUrlBuilder . addParameter ( name , values . toArray ( new String [ values . size ( ) ] ) ) ; } return portalUrlBuilder . getUrlString ( ) ; }
A static EL function that is defined in portletUrl . tld Takes a portletUrl object and coverts it into an actual Url Example is in search returns a marketplace entry Url