Example usage for com.liferay.portal.model.adapter.impl StagedThemeImpl StagedThemeImpl

List of usage examples for com.liferay.portal.model.adapter.impl StagedThemeImpl StagedThemeImpl

Introduction

In this page you can find the example usage for com.liferay.portal.model.adapter.impl StagedThemeImpl StagedThemeImpl.

Prototype

public StagedThemeImpl(Theme theme) 

Source Link

Usage

From source file:com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.java

License:Open Source License

protected void exportTheme(PortletDataContext portletDataContext, Layout layout) throws Exception {

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

    if (_log.isDebugEnabled()) {
        _log.debug("Export theme settings " + exportThemeSettings);
    }//from w  ww.j a  v  a  2 s . com

    if (exportThemeSettings && !portletDataContext.isPerformDirectBinaryImport()
            && !layout.isInheritLookAndFeel()) {

        StagedTheme stagedTheme = new StagedThemeImpl(layout.getTheme());

        Element layoutElement = portletDataContext.getExportDataElement(layout);

        portletDataContext.addReferenceElement(layout, layoutElement, stagedTheme,
                PortletDataContext.REFERENCE_TYPE_DEPENDENCY, true);
    }
}