001    /**
002     * Copyright (c) 2000-present 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.portlet.exportimport.lar;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.ProxyFactory;
020    import com.liferay.portal.kernel.zip.ZipReader;
021    import com.liferay.portal.kernel.zip.ZipWriter;
022    import com.liferay.portal.theme.ThemeDisplay;
023    
024    import java.util.Date;
025    import java.util.Map;
026    
027    /**
028     * @author Mate Thurzo
029     */
030    @ProviderType
031    public class PortletDataContextFactoryUtil {
032    
033            public static PortletDataContext clonePortletDataContext(
034                    PortletDataContext portletDataContext) {
035    
036                    return _portletDataContextFactory.clonePortletDataContext(
037                            portletDataContext);
038            }
039    
040            public static PortletDataContext createExportPortletDataContext(
041                            long companyId, long groupId, Map<String, String[]> parameterMap,
042                            Date startDate, Date endDate, ZipWriter zipWriter)
043                    throws PortletDataException {
044    
045                    return _portletDataContextFactory.createExportPortletDataContext(
046                            companyId, groupId, parameterMap, startDate, endDate, zipWriter);
047            }
048    
049            public static PortletDataContext createImportPortletDataContext(
050                            long companyId, long groupId, Map<String, String[]> parameterMap,
051                            UserIdStrategy userIdStrategy, ZipReader zipReader)
052                    throws PortletDataException {
053    
054                    return _portletDataContextFactory.createImportPortletDataContext(
055                            companyId, groupId, parameterMap, userIdStrategy, zipReader);
056            }
057    
058            public static PortletDataContext createPreparePortletDataContext(
059                            long companyId, long groupId, Date startDate, Date endDate)
060                    throws PortletDataException {
061    
062                    return _portletDataContextFactory.createPreparePortletDataContext(
063                            companyId, groupId, startDate, endDate);
064            }
065    
066            public static PortletDataContext createPreparePortletDataContext(
067                            ThemeDisplay themeDisplay, Date startDate, Date endDate)
068                    throws PortletDataException {
069    
070                    return _portletDataContextFactory.createPreparePortletDataContext(
071                            themeDisplay, startDate, endDate);
072            }
073    
074            private static final PortletDataContextFactory _portletDataContextFactory =
075                    ProxyFactory.newServiceTrackedInstance(PortletDataContextFactory.class);
076    
077    }