Example usage for com.liferay.portal.kernel.model ThemeSetting getValue

List of usage examples for com.liferay.portal.kernel.model ThemeSetting getValue

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model ThemeSetting getValue.

Prototype

public String getValue();

Source Link

Usage

From source file:com.liferay.layout.admin.web.internal.portlet.action.ActionUtil.java

License:Open Source License

protected void setThemeSettingProperties(ActionRequest actionRequest, UnicodeProperties typeSettingsProperties,
        Map<String, ThemeSetting> themeSettings, String device, boolean isLayout) throws PortalException {

    Layout layout = null;// w  ww  . jav a  2  s. co m

    if (isLayout) {
        long groupId = ParamUtil.getLong(actionRequest, "groupId");
        boolean privateLayout = ParamUtil.getBoolean(actionRequest, "privateLayout");
        long layoutId = ParamUtil.getLong(actionRequest, "layoutId");

        layout = _layoutLocalService.getLayout(groupId, privateLayout, layoutId);
    }

    for (Map.Entry<String, ThemeSetting> entry : themeSettings.entrySet()) {
        String key = entry.getKey();
        ThemeSetting themeSetting = entry.getValue();

        String property = StringBundler.concat(device, "ThemeSettingsProperties--", key,
                StringPool.DOUBLE_DASH);

        String value = ParamUtil.getString(actionRequest, property, themeSetting.getValue());

        if ((isLayout && !Objects.equals(value, layout.getDefaultThemeSetting(key, device, false)))
                || (!isLayout && !value.equals(themeSetting.getValue()))) {

            typeSettingsProperties.setProperty(ThemeSettingImpl.namespaceProperty(device, key), value);
        }
    }
}