Example usage for com.liferay.portal.kernel.settings ParameterMapSettingsLocator ParameterMapSettingsLocator

List of usage examples for com.liferay.portal.kernel.settings ParameterMapSettingsLocator ParameterMapSettingsLocator

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.settings ParameterMapSettingsLocator ParameterMapSettingsLocator.

Prototype

public ParameterMapSettingsLocator(Map<String, String[]> parameterMap, SettingsLocator settingsLocator) 

Source Link

Usage

From source file:com.liferay.dynamic.data.mapping.web.internal.context.util.DDMWebRequestHelper.java

License:Open Source License

protected <T> T getConfiguration(Class<T> clazz) throws ConfigurationException {

    if (Validator.isNotNull(getPortletResource())) {
        HttpServletRequest request = getRequest();

        return (T) ConfigurationProviderUtil.getConfiguration(clazz,
                new ParameterMapSettingsLocator(request.getParameterMap(),
                        new GroupServiceSettingsLocator(getSiteGroupId(), DDMConstants.SERVICE_NAME)));
    } else {//from  w  ww.j a  v  a2  s .c  o  m
        return (T) ConfigurationProviderUtil.getConfiguration(clazz,
                new GroupServiceSettingsLocator(getSiteGroupId(), DDMConstants.SERVICE_NAME));
    }
}

From source file:com.liferay.journal.web.internal.display.context.util.JournalWebRequestHelper.java

License:Open Source License

public JournalGroupServiceConfiguration getJournalGroupServiceConfiguration() {

    try {//from   w  w w  . ja  v a  2  s  .c o  m
        if (_journalGroupServiceConfiguration == null) {
            ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

            PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

            if (Validator.isNotNull(portletDisplay.getPortletResource())) {
                _journalGroupServiceConfiguration = ConfigurationProviderUtil.getConfiguration(
                        JournalGroupServiceConfiguration.class,
                        new ParameterMapSettingsLocator(_request.getParameterMap(),
                                new GroupServiceSettingsLocator(themeDisplay.getSiteGroupId(),
                                        JournalConstants.SERVICE_NAME)));
            } else {
                _journalGroupServiceConfiguration = ConfigurationProviderUtil.getConfiguration(
                        JournalGroupServiceConfiguration.class, new GroupServiceSettingsLocator(
                                themeDisplay.getSiteGroupId(), JournalConstants.SERVICE_NAME));
            }
        }

        return _journalGroupServiceConfiguration;
    } catch (PortalException pe) {
        throw new SystemException(pe);
    }
}

From source file:com.liferay.wiki.web.internal.display.context.util.WikiRequestHelper.java

License:Open Source License

public WikiGroupServiceOverriddenConfiguration getWikiGroupServiceOverriddenConfiguration() {

    try {/*from   w w  w.ja v  a2 s  . c  om*/
        if (_wikiGroupServiceOverriddenConfiguration == null) {
            String portletResource = getPortletResource();

            if (Validator.isNotNull(portletResource)) {
                _wikiGroupServiceOverriddenConfiguration = ConfigurationProviderUtil.getConfiguration(
                        WikiGroupServiceOverriddenConfiguration.class,
                        new ParameterMapSettingsLocator(getRequest().getParameterMap(),
                                new GroupServiceSettingsLocator(getSiteGroupId(), WikiConstants.SERVICE_NAME)));
            } else {
                _wikiGroupServiceOverriddenConfiguration = ConfigurationProviderUtil.getConfiguration(
                        WikiGroupServiceOverriddenConfiguration.class,
                        new GroupServiceSettingsLocator(getSiteGroupId(), WikiConstants.SERVICE_NAME));
            }
        }

        return _wikiGroupServiceOverriddenConfiguration;
    } catch (PortalException pe) {
        throw new SystemException(pe);
    }
}

From source file:com.liferay.wiki.web.internal.display.context.util.WikiRequestHelper.java

License:Open Source License

public WikiPortletInstanceOverriddenConfiguration getWikiPortletInstanceOverridenConfiguration() {

    try {//from w  ww  .j a  v  a  2  s .  c  om
        if (_wikiPortletInstanceOverridenConfiguration == null) {
            String portletResource = getPortletResource();

            if (Validator.isNotNull(portletResource)) {
                _wikiPortletInstanceOverridenConfiguration = ConfigurationProviderUtil.getConfiguration(
                        WikiPortletInstanceOverriddenConfiguration.class,
                        new ParameterMapSettingsLocator(getRequest().getParameterMap(),
                                new PortletInstanceSettingsLocator(getLayout(), getResourcePortletId())));
            } else {
                _wikiPortletInstanceOverridenConfiguration = ConfigurationProviderUtil.getConfiguration(
                        WikiPortletInstanceOverriddenConfiguration.class,
                        new PortletInstanceSettingsLocator(getLayout(), getPortletId()));
            }
        }

        return _wikiPortletInstanceOverridenConfiguration;
    } catch (PortalException pe) {
        throw new SystemException(pe);
    }
}