Example usage for com.liferay.portal.kernel.theme PortletDisplay getURLExportImport

List of usage examples for com.liferay.portal.kernel.theme PortletDisplay getURLExportImport

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.theme PortletDisplay getURLExportImport.

Prototype

public String getURLExportImport() 

Source Link

Usage

From source file:com.liferay.exportimport.web.internal.portlet.configuration.icon.ExportImportPortletConfigurationIcon.java

License:Open Source License

@Override
public String getOnClick(PortletRequest portletRequest, PortletResponse portletResponse) {

    StringBundler sb = new StringBundler(12);

    sb.append("Liferay.Portlet.openWindow({bodyCssClass: ");
    sb.append("'dialog-with-footer', namespace: '");

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    sb.append(portletDisplay.getNamespace());

    sb.append("', portlet: '#p_p_id_");
    sb.append(portletDisplay.getId());//w ww  .  ja v  a  2  s. c  om
    sb.append("_', portletId: '");
    sb.append(portletDisplay.getId());
    sb.append("', title: '");
    sb.append(LanguageUtil.get(themeDisplay.getLocale(), "export-import"));
    sb.append("', uri: '");
    sb.append(HtmlUtil.escapeJS(portletDisplay.getURLExportImport()));
    sb.append("'}); return false;");

    return sb.toString();
}

From source file:com.liferay.exportimport.web.internal.portlet.configuration.icon.ExportImportPortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.getURLExportImport();
}