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

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

Introduction

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

Prototype

public String getTitle() 

Source Link

Usage

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public String getRSSName() {
    if (_rssName != null) {
        return _rssName;
    }//w  w w  . j  ava  2 s. c o  m

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    _rssName = _portletPreferences.getValue("rssName", portletDisplay.getTitle());

    return _rssName;
}

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

License:Open Source License

public Map<String, String> getEmailDefinitionTerms(PortletRequest portletRequest, String emailFromAddress,
        String emailFromName) {/*from   ww w .  j  av a 2  s. co m*/

    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(
            _portal.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.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.util.BlogsUtil.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("[$BLOGS_ENTRY_CONTENT$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-blog-entry-content"));
    definitionTerms.put("[$BLOGS_ENTRY_CREATE_DATE$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-date-the-blog-entry-was-created"));
    definitionTerms.put("[$BLOGS_ENTRY_DESCRIPTION$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-blog-entry-description"));
    definitionTerms.put("[$BLOGS_ENTRY_SITE_NAME$]", LanguageUtil.get(themeDisplay.getLocale(),
            "the-name-of-the-site-where-the-blog-entry-was-created"));
    definitionTerms.put("[$BLOGS_ENTRY_STATUS_BY_USER_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-user-who-updated-the-blog-entry"));
    definitionTerms.put("[$BLOGS_ENTRY_TITLE$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-blog-entry-title"));
    definitionTerms.put("[$BLOGS_ENTRY_UPDATE_COMMENT$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-comment-of-the-user-who-updated-the-blog-entry"));
    definitionTerms.put("[$BLOGS_ENTRY_USER_ADDRESS$]", LanguageUtil.get(themeDisplay.getLocale(),
            "the-email-address-of-the-user-who-added-the-blog-entry"));
    definitionTerms.put("[$BLOGS_ENTRY_USER_PORTRAIT_URL$]", LanguageUtil.get(themeDisplay.getLocale(),
            "the-portrait-url-of-the-user-who-added-the-blog-entry"));
    definitionTerms.put("[$BLOGS_ENTRY_USER_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-user-who-added-the-blog-entry"));
    definitionTerms.put("[$BLOGS_ENTRY_USER_URL$]", LanguageUtil.get(themeDisplay.getLocale(),
            "the-public-site-url-of-the-user-who-added-the-blog-entry"));
    definitionTerms.put("[$BLOGS_ENTRY_URL$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-blog-entry-url"));
    definitionTerms.put("[$COMPANY_ID$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-id-associated-with-the-blog"));
    definitionTerms.put("[$COMPANY_MX$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-mx-associated-with-the-blog"));
    definitionTerms.put("[$COMPANY_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-name-associated-with-the-blog"));
    definitionTerms.put("[$FROM_ADDRESS$]", HtmlUtil.escape(emailFromAddress));
    definitionTerms.put("[$FROM_NAME$]", HtmlUtil.escape(emailFromName));

    Company company = themeDisplay.getCompany();

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

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

    definitionTerms.put("[$SITE_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-site-name-associated-with-the-blog"));
    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"));
    definitionTerms.put("[$UNSUBSCRIBE_URL$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-url-to-unsubscribe-the-user"));

    return definitionTerms;
}

From source file:com.liferay.blogs.util.BlogsUtil.java

License:Open Source License

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

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

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

    definitionTerms.put("[$BLOGS_ENTRY_USER_ADDRESS$]", LanguageUtil.get(themeDisplay.getLocale(),
            "the-email-address-of-the-user-who-added-the-blog-entry"));
    definitionTerms.put("[$BLOGS_ENTRY_USER_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-user-who-added-the-blog-entry"));
    definitionTerms.put("[$COMPANY_ID$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-id-associated-with-the-blog"));
    definitionTerms.put("[$COMPANY_MX$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-mx-associated-with-the-blog"));
    definitionTerms.put("[$COMPANY_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-company-name-associated-with-the-blog"));

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

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

    definitionTerms.put("[$SITE_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-site-name-associated-with-the-blog"));

    return definitionTerms;
}

From source file:com.liferay.bookmarks.web.internal.portlet.util.BookmarksUtil.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("[$BOOKMARKS_ENTRY_USER_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-user-who-added-the-bookmark-entry"));
    definitionTerms.put("[$BOOKMARKS_ENTRY_STATUS_BY_USER_NAME$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-user-who-updated-the-bookmark-entry"));
    definitionTerms.put("[$BOOKMARKS_ENTRY_URL$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-bookmark-entry-url"));
    definitionTerms.put("[$FROM_ADDRESS$]", HtmlUtil.escape(emailFromAddress));
    definitionTerms.put("[$FROM_NAME$]", HtmlUtil.escape(emailFromName));

    Company company = themeDisplay.getCompany();

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

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

    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.journal.util.impl.JournalUtil.java

License:Open Source License

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

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

    String fromAddress = HtmlUtil.escape(emailFromAddress);
    String fromName = HtmlUtil.escape(emailFromName);
    String toAddress = LanguageUtil.get(themeDisplay.getLocale(), "the-address-of-the-email-recipient");
    String toName = LanguageUtil.get(themeDisplay.getLocale(), "the-name-of-the-email-recipient");

    if (emailType.equals("requested")) {
        toName = fromName;/* www  .  j a v a  2 s.co  m*/
        toAddress = fromAddress;

        fromName = LanguageUtil.get(themeDisplay.getLocale(), "the-name-of-the-email-sender");
        fromAddress = LanguageUtil.get(themeDisplay.getLocale(), "the-address-of-the-email-sender");
    }

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

    definitionTerms.put("[$ARTICLE_CONTENT]", LanguageUtil.get(themeDisplay.getLocale(), "the-web-content"));
    definitionTerms.put("[$ARTICLE_DIFFS$]", LanguageUtil.get(themeDisplay.getLocale(),
            "the-web-content-compared-with-the-previous-version-web-" + "content"));
    definitionTerms.put("[$ARTICLE_ID$]", LanguageUtil.get(themeDisplay.getLocale(), "the-web-content-id"));
    definitionTerms.put("[$ARTICLE_TITLE$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-web-content-title"));
    definitionTerms.put("[$ARTICLE_URL$]", LanguageUtil.get(themeDisplay.getLocale(), "the-web-content-url"));
    definitionTerms.put("[$ARTICLE_VERSION$]",
            LanguageUtil.get(themeDisplay.getLocale(), "the-web-content-version"));
    definitionTerms.put("[$FROM_ADDRESS$]", fromAddress);
    definitionTerms.put("[$FROM_NAME$]", fromName);

    Company company = themeDisplay.getCompany();

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

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

    definitionTerms.put("[$TO_ADDRESS$]", toAddress);
    definitionTerms.put("[$TO_NAME$]", toName);

    return definitionTerms;
}

From source file:com.liferay.product.navigation.control.menu.web.internal.PortletHeaderProductNavigationControlMenuEntry.java

License:Open Source License

@Override
public boolean includeIcon(HttpServletRequest request, HttpServletResponse response) throws IOException {

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    request.setAttribute(ProductNavigationControlMenuWebKeys.PORTLET_DESCRIPTION,
            portletDisplay.getDescription());
    request.setAttribute(ProductNavigationControlMenuWebKeys.PORTLET_TITLE, portletDisplay.getTitle());

    return super.includeIcon(request, response);
}