001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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                            long companyId, long groupId, Date startDate, Date endDate)
057                    throws PortletDataException {
058    
059                    return getPortletDataContextFactory().createPreparePortletDataContext(
060                            companyId, groupId, startDate, endDate);
061            }
062    
063            public static PortletDataContext createPreparePortletDataContext(
064                            ThemeDisplay themeDisplay, Date startDate, Date endDate)
065                    throws PortletDataException {
066    
067                    return getPortletDataContextFactory().createPreparePortletDataContext(
068                            themeDisplay, startDate, endDate);
069            }
070    
071            public static PortletDataContextFactory getPortletDataContextFactory() {
072                    PortalRuntimePermission.checkGetBeanProperty(
073                            PortletDataContextFactoryUtil.class);
074    
075                    return _portletDataContextFactory;
076            }
077    
078            public void setPortletDataContextFactory(
079                    PortletDataContextFactory portletDataContextFactory) {
080    
081                    PortalRuntimePermission.checkSetBeanProperty(getClass());
082    
083                    _portletDataContextFactory = portletDataContextFactory;
084            }
085    
086            private static PortletDataContextFactory _portletDataContextFactory;
087    
088    }