return com.dotmarketing.util.PortletURLUtil.getActionURL(httpReq, _windowState, _params);
}
public static String getActionURL(HttpServletRequest req, String _windowState, Map _params) {
PortletConfigImpl portletConfig = (PortletConfigImpl) req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);
String portletName = null;
if(portletConfig==null) {
try {
User user = WebAPILocator.getUserWebAPI().getLoggedInUser(req);
List<Layout>layouts = APILocator.getLayoutAPI().loadLayoutsForUser(user);
if(layouts.size()==0){
return null;
}
Layout layout = layouts.get(0);
List<String> portletIds = layout.getPortletIds();
portletName = portletIds.get(0);
return getActionURL(req, layout.getId(), _windowState, _params, portletName);
} catch (Exception e) {
Logger.error(PortletURLUtil.class, e.toString(), e);
}
} else {
portletName = portletConfig.getPortletId();
}
return getActionURL(req, _windowState, _params, portletName);
}