Example usage for com.liferay.portal.kernel.util PortalUtil getPortletTitle

List of usage examples for com.liferay.portal.kernel.util PortalUtil getPortletTitle

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PortalUtil getPortletTitle.

Prototype

public static String getPortletTitle(String portletId, User user) 

Source Link

Usage

From source file:com.liferay.asset.publisher.web.util.AssetPublisherUtil.java

License:Open Source License

public static Map<String, String> getEmailDefinitionTerms(PortletRequest portletRequest,
        String emailFromAddress, String emailFromName) {

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

    Map<String, String> definitionTerms = new LinkedHashMap<>();

    definitionTerms.put("[$ASSET_ENTRIES$]", LanguageUtil.get(themeDisplay.getLocale(), "the-list-of-assets"));
    definitionTerms.put("[$COMPANY_ID$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-id-associated-with-the-assets"));
    definitionTerms.put("[$COMPANY_MX$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-mx-associated-with-the-assets"));
    definitionTerms.put("[$COMPANY_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-name-associated-with-the-assets"));
    definitionTerms.put("[$FROM_ADDRESS$]", HtmlUtil.escape(emailFromAddress));
    definitionTerms.put("[$FROM_NAME$]", HtmlUtil.escape(emailFromName));

    Company company = themeDisplay.getCompany();

    definitionTerms.put("[$PORTAL_URL$]", company.getVirtualHostname());

    definitionTerms.put("[$PORTLET_NAME$]", HtmlUtil.escape(
            PortalUtil.getPortletTitle(AssetPublisherPortletKeys.ASSET_PUBLISHER, themeDisplay.getLocale())));

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    definitionTerms.put("[$PORTLET_TITLE$]", HtmlUtil.escape(portletDisplay.getTitle()));

    definitionTerms.put("[$SITE_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-site-name-associated-with-the-assets"));
    definitionTerms.put("[$TO_ADDRESS$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-address-of-the-email-recipient"));
    definitionTerms.put("[$TO_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-name-of-the-email-recipient"));

    return definitionTerms;
}

From source file:com.liferay.blogs.web.internal.template.BlogsPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public String getName(Locale locale) {
    String portletTitle = PortalUtil.getPortletTitle(BlogsPortletKeys.BLOGS, locale);

    return portletTitle.concat(StringPool.SPACE).concat(LanguageUtil.get(locale, "template"));
}

From source file:com.liferay.notifications.web.internal.util.comparator.PortletIdComparator.java

License:Open Source License

@Override
public int compare(String portletId1, String portletId2) {
    String portletTitle1 = PortalUtil.getPortletTitle(portletId1, _locale);
    String portletTitle2 = PortalUtil.getPortletTitle(portletId2, _locale);

    return _collator.compare(portletTitle1, portletTitle2);
}

From source file:com.liferay.wiki.web.internal.portlet.template.WikiPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public String getName(Locale locale) {
    ResourceBundle resourceBundle = ResourceBundleUtil.getBundle("content.Language", locale, getClass());

    String portletTitle = PortalUtil.getPortletTitle(WikiPortletKeys.WIKI, resourceBundle);

    return portletTitle.concat(StringPool.SPACE).concat(LanguageUtil.get(locale, "template"));
}