001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.lar;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portal.kernel.zip.ZipReader;
019    import com.liferay.portal.kernel.zip.ZipWriter;
020    import com.liferay.portal.theme.ThemeDisplay;
021    
022    import java.util.Date;
023    import java.util.Map;
024    
025    /**
026     * @author Mate Thurzo
027     */
028    public class PortletDataContextFactoryUtil {
029    
030            public static PortletDataContext clonePortletDataContext(
031                    PortletDataContext portletDataContext) {
032    
033                    return getPortletDataContextFactory().clonePortletDataContext(
034                            portletDataContext);
035            }
036    
037            public static PortletDataContext createExportPortletDataContext(
038                            long companyId, long groupId, Map<String, String[]> parameterMap,
039                            Date startDate, Date endDate, ZipWriter zipWriter)
040                    throws PortletDataException {
041    
042                    return getPortletDataContextFactory().createExportPortletDataContext(
043                            companyId, groupId, parameterMap, startDate, endDate, zipWriter);
044            }
045    
046            public static PortletDataContext createImportPortletDataContext(
047                            long companyId, long groupId, Map<String, String[]> parameterMap,
048                            UserIdStrategy userIdStrategy, ZipReader zipReader)
049                    throws PortletDataException {
050    
051                    return getPortletDataContextFactory().createImportPortletDataContext(
052                            companyId, groupId, parameterMap, userIdStrategy, zipReader);
053            }
054    
055            public static PortletDataContext createPreparePortletDataContext(
056                            ThemeDisplay themeDisplay, Date startDate, Date endDate)
057                    throws PortletDataException {
058    
059                    return getPortletDataContextFactory().createPreparePortletDataContext(
060                            themeDisplay, startDate, endDate);
061            }
062    
063            public static PortletDataContextFactory getPortletDataContextFactory() {
064                    PortalRuntimePermission.checkGetBeanProperty(
065                            PortletDataContextFactoryUtil.class);
066    
067                    return _portletDataContextFactory;
068            }
069    
070            public void setPortletDataContextFactory(
071                    PortletDataContextFactory portletDataContextFactory) {
072    
073                    PortalRuntimePermission.checkSetBeanProperty(getClass());
074    
075                    _portletDataContextFactory = portletDataContextFactory;
076            }
077    
078            private static PortletDataContextFactory _portletDataContextFactory;
079    
080    }