Search in sources :

Example 1 with PortletConfig

use of javax.portlet.PortletConfig in project acs-community-packaging by Alfresco.

the class AlfrescoFacesPortlet method getFacesContext.

/**
 * Initializes a new faces context using the portlet objects from a 'wrapped' servlet request.
 *
 * @param request
 *            the servlet request
 * @return the faces context
 */
public static FacesContext getFacesContext(ServletRequest request) {
    PortletRequest portletReq = (PortletRequest) request.getAttribute("javax.portlet.request");
    PortletResponse portletRes = (PortletResponse) request.getAttribute("javax.portlet.response");
    PortletConfig portletConfig = (PortletConfig) request.getAttribute("javax.portlet.config");
    return FacesHelper.getFacesContext(portletReq, portletRes, portletConfig.getPortletContext());
}
Also used : PortletRequest(javax.portlet.PortletRequest) PortletResponse(javax.portlet.PortletResponse) PortletConfig(javax.portlet.PortletConfig)

Example 2 with PortletConfig

use of javax.portlet.PortletConfig in project liferay-ide by liferay.

the class GadgetPortlet method getGadget.

@Override
protected Gadget getGadget(RenderRequest renderRequest) throws Exception {
    ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
    PortletConfig portletConfig = getPortletConfig();
    return ShindigUtil.getGadget(portletConfig.getPortletName(), themeDisplay.getCompanyId());
}
Also used : PortletConfig(javax.portlet.PortletConfig) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 3 with PortletConfig

use of javax.portlet.PortletConfig in project liferay-ide by liferay.

the class LiferayPortlet method translate.

protected String translate(PortletRequest portletRequest, String key, Object[] arguments) {
    PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
    return LanguageUtil.format(portletConfig, themeDisplay.getLocale(), key, arguments);
}
Also used : PortletConfig(javax.portlet.PortletConfig) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 4 with PortletConfig

use of javax.portlet.PortletConfig in project liferay-ide by liferay.

the class LiferayPortlet method translate.

protected String translate(PortletRequest portletRequest, String key) {
    PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
    return LanguageUtil.get(portletConfig, themeDisplay.getLocale(), key);
}
Also used : PortletConfig(javax.portlet.PortletConfig) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 5 with PortletConfig

use of javax.portlet.PortletConfig in project liferay-ide by liferay.

the class LiferayPortlet method translate.

protected String translate(PortletRequest portletRequest, String key, Object argument) {
    PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
    return LanguageUtil.format(portletConfig, themeDisplay.getLocale(), key, argument);
}
Also used : PortletConfig(javax.portlet.PortletConfig) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Aggregations

PortletConfig (javax.portlet.PortletConfig)5 ThemeDisplay (com.liferay.portal.theme.ThemeDisplay)4 PortletRequest (javax.portlet.PortletRequest)1 PortletResponse (javax.portlet.PortletResponse)1