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

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

Introduction

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

Prototype

public <T> T getPortletInstanceConfiguration(Class<T> clazz) throws ConfigurationException 

Source Link

Usage

From source file:com.liferay.asset.categories.navigation.web.internal.display.context.AssetCategoriesNavigationDisplayContext.java

License:Open Source License

public AssetCategoriesNavigationDisplayContext(HttpServletRequest request) throws ConfigurationException {

    _request = request;//  w w w .  j  a  v  a 2 s.c  o  m

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    _assetCategoriesNavigationPortletInstanceConfiguration = portletDisplay
            .getPortletInstanceConfiguration(AssetCategoriesNavigationPortletInstanceConfiguration.class);
}

From source file:com.liferay.asset.publisher.web.portlet.action.AssetPublisherConfigurationAction.java

License:Open Source License

private AssetPublisherPortletInstanceConfiguration _getAssetPublisherPortletInstanceConfiguration(
        HttpServletRequest request) throws ConfigurationException {

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.getPortletInstanceConfiguration(AssetPublisherPortletInstanceConfiguration.class);
}

From source file:com.liferay.asset.publisher.web.portlet.AssetPublisherPortlet.java

License:Open Source License

@Override
protected void doDispatch(RenderRequest renderRequest, RenderResponse renderResponse)
        throws IOException, PortletException {

    try {//from   ww  w  . j  a  va  2 s .com
        renderRequest.setAttribute(AssetPublisherWebKeys.ASSET_ENTRY_ACTION_REGISTRY, assetEntryActionRegistry);

        renderRequest.setAttribute(AssetWebKeys.ASSET_HELPER, assetHelper);

        String rootPortletId = PortletIdCodec.decodePortletName(portal.getPortletId(renderRequest));

        AssetPublisherCustomizer assetPublisherCustomizer = assetPublisherCustomizerRegistry
                .getAssetPublisherCustomizer(rootPortletId);

        renderRequest.setAttribute(AssetPublisherWebKeys.ASSET_PUBLISHER_CUSTOMIZER, assetPublisherCustomizer);

        renderRequest.setAttribute(AssetPublisherWebKeys.ASSET_PUBLISHER_WEB_CONFIGURATION,
                assetPublisherWebConfiguration);

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

        PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

        AssetPublisherPortletInstanceConfiguration assetPublisherPortletInstanceConfiguration = portletDisplay
                .getPortletInstanceConfiguration(AssetPublisherPortletInstanceConfiguration.class);

        renderRequest.setAttribute(AssetPublisherWebKeys.ASSET_PUBLISHER_PORTLET_INSTANCE_CONFIGURATION,
                assetPublisherPortletInstanceConfiguration);

        renderRequest.setAttribute(WebKeys.SINGLE_PAGE_APPLICATION_CLEAR_CACHE, Boolean.TRUE);
    } catch (Exception e) {
        _log.error("Unable to get asset publisher customizer", e);
    }

    if (SessionErrors.contains(renderRequest, NoSuchGroupException.class.getName())
            || SessionErrors.contains(renderRequest, PrincipalException.getNestedClasses())) {

        include("/error.jsp", renderRequest, renderResponse);
    } else {
        super.doDispatch(renderRequest, renderResponse);
    }
}

From source file:com.liferay.iframe.web.internal.display.context.IFrameDisplayContext.java

License:Open Source License

public IFrameDisplayContext(PortletRequest request) throws ConfigurationException {

    _request = request;/* w  ww.ja  va2  s.  c o  m*/

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

    PortletDisplay portletDisplay = _themeDisplay.getPortletDisplay();

    _iFramePortletInstanceConfiguration = portletDisplay
            .getPortletInstanceConfiguration(IFramePortletInstanceConfiguration.class);
}

From source file:com.liferay.journal.content.web.internal.display.context.JournalContentDisplayContext.java

License:Open Source License

public static JournalContentDisplayContext create(PortletRequest portletRequest,
        PortletResponse portletResponse, PortletDisplay portletDisplay, long ddmStructureClassNameId)
        throws PortalException {

    JournalContentDisplayContext journalContentDisplayContext = (JournalContentDisplayContext) portletRequest
            .getAttribute(JournalContentDisplayContext.class.getName());

    if (journalContentDisplayContext == null) {
        JournalContentPortletInstanceConfiguration journalContentPortletInstanceConfiguration = portletDisplay
                .getPortletInstanceConfiguration(JournalContentPortletInstanceConfiguration.class);

        journalContentDisplayContext = new JournalContentDisplayContext(portletRequest, portletResponse,
                journalContentPortletInstanceConfiguration, ddmStructureClassNameId);

        portletRequest.setAttribute(JournalContentDisplayContext.class.getName(), journalContentDisplayContext);
    }/*from   w  w  w .  j  a v a  2 s  .  co  m*/

    return journalContentDisplayContext;
}

From source file:com.liferay.nested.portlets.web.internal.display.context.NestedPortletsDisplayContext.java

License:Open Source License

public NestedPortletsDisplayContext(HttpServletRequest request) throws ConfigurationException {

    _request = request;/* w w w.  j av  a2  s.  c  om*/

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    _nestedPortletsPortletInstanceConfiguration = portletDisplay
            .getPortletInstanceConfiguration(NestedPortletsPortletInstanceConfiguration.class);
}

From source file:com.liferay.rss.web.internal.display.context.RSSDisplayContext.java

License:Open Source License

public RSSDisplayContext(HttpServletRequest request, RSSWebCacheConfiguration rssWebCacheConfiguration)
        throws ConfigurationException {

    _request = request;//w w w .  j a v a2 s. c  o m
    _rssWebCacheConfiguration = rssWebCacheConfiguration;

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    _rssPortletInstanceConfiguration = portletDisplay
            .getPortletInstanceConfiguration(RSSPortletInstanceConfiguration.class);
}

From source file:com.liferay.site.navigation.breadcrumb.web.internal.display.context.SiteNavigationBreadcrumbDisplayContext.java

License:Open Source License

public SiteNavigationBreadcrumbDisplayContext(HttpServletRequest request) throws ConfigurationException {

    _request = request;//from   w w  w. j av a 2s . c o  m

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    _siteNavigationBreadcrumbPortletInstanceConfiguration = portletDisplay
            .getPortletInstanceConfiguration(SiteNavigationBreadcrumbPortletInstanceConfiguration.class);
}

From source file:com.liferay.site.navigation.directory.web.internal.display.context.SitesDirectoryDisplayContext.java

License:Open Source License

public SitesDirectoryDisplayContext(HttpServletRequest request) throws ConfigurationException {

    _request = request;/*from w w  w . jav a  2  s .  c o m*/

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    _sitesDirectoryPortletInstanceConfiguration = portletDisplay
            .getPortletInstanceConfiguration(SitesDirectoryPortletInstanceConfiguration.class);
}

From source file:com.liferay.site.navigation.language.web.internal.display.context.SiteNavigationLanguageDisplayContext.java

License:Open Source License

public SiteNavigationLanguageDisplayContext(HttpServletRequest request) throws ConfigurationException {

    _portletDisplayTemplate = (PortletDisplayTemplate) request.getAttribute(WebKeys.PORTLET_DISPLAY_TEMPLATE);

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

    PortletDisplay portletDisplay = _themeDisplay.getPortletDisplay();

    _siteNavigationLanguagePortletInstanceConfiguration = portletDisplay
            .getPortletInstanceConfiguration(SiteNavigationLanguagePortletInstanceConfiguration.class);
}