Example usage for com.liferay.portal.kernel.util ColorSchemeFactoryUtil getDefaultRegularColorSchemeId

List of usage examples for com.liferay.portal.kernel.util ColorSchemeFactoryUtil getDefaultRegularColorSchemeId

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util ColorSchemeFactoryUtil getDefaultRegularColorSchemeId.

Prototype

public static String getDefaultRegularColorSchemeId() 

Source Link

Usage

From source file:com.liferay.layout.internal.exportimport.data.handler.StagedLayoutSetStagedModelDataHandler.java

License:Open Source License

protected void exportTheme(PortletDataContext portletDataContext, StagedLayoutSet stagedLayoutSet) {

    boolean exportThemeSettings = MapUtil.getBoolean(portletDataContext.getParameterMap(),
            PortletDataHandlerKeys.THEME_REFERENCE);

    if (!exportThemeSettings) {
        stagedLayoutSet.setColorSchemeId(ColorSchemeFactoryUtil.getDefaultRegularColorSchemeId());
        stagedLayoutSet.setCss(StringPool.BLANK);
        stagedLayoutSet.setThemeId(ThemeFactoryUtil.getDefaultRegularThemeId(stagedLayoutSet.getCompanyId()));

        return;//from www  .j a va 2s . com
    }

    long layoutSetBranchId = MapUtil.getLong(portletDataContext.getParameterMap(), "layoutSetBranchId");

    LayoutSetBranch layoutSetBranch = _layoutSetBranchLocalService.fetchLayoutSetBranch(layoutSetBranchId);

    ThemeExporter themeExporter = ThemeExporter.getInstance();

    if (layoutSetBranch != null) {
        try {
            themeExporter.exportTheme(portletDataContext, layoutSetBranch);
        } catch (Exception e) {
            if (_log.isWarnEnabled()) {
                _log.warn("Unable to export theme reference for layout set " + "branch "
                        + layoutSetBranch.getLayoutSetBranchId(), e);
            }
        }
    } else {
        try {
            themeExporter.exportTheme(portletDataContext, stagedLayoutSet);
        } catch (Exception e) {
            if (_log.isWarnEnabled()) {
                _log.warn("Unable to export theme reference for layout set " + stagedLayoutSet.getLayoutSetId(),
                        e);
            }
        }
    }
}