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.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.repository.model.FileEntry;
020    import com.liferay.portal.kernel.util.DateRange;
021    import com.liferay.portal.kernel.xml.Document;
022    import com.liferay.portal.kernel.xml.Element;
023    import com.liferay.portal.model.Layout;
024    import com.liferay.portal.model.Portlet;
025    import com.liferay.portal.model.StagedModel;
026    import com.liferay.portal.theme.ThemeDisplay;
027    
028    import java.io.File;
029    
030    import java.util.Calendar;
031    import java.util.Map;
032    
033    import javax.portlet.PortletPreferences;
034    import javax.portlet.PortletRequest;
035    
036    /**
037     * @author Zsolt Berentey
038     */
039    public interface ExportImportHelper {
040    
041            public static final String TEMP_FOLDER_NAME =
042                    ExportImportHelper.class.getName();
043    
044            public Calendar getCalendar(
045                    PortletRequest portletRequest, String paramPrefix,
046                    boolean timeZoneSensitive);
047    
048            public DateRange getDateRange(
049                            PortletRequest portletRequest, long groupId, boolean privateLayout,
050                            long plid, String portletId)
051                    throws Exception;
052    
053            public Layout getExportableLayout(ThemeDisplay themeDisplay)
054                    throws PortalException, SystemException;
055    
056            public String getExportableRootPortletId(long companyId, String portletId)
057                    throws Exception;
058    
059            public ManifestSummary getManifestSummary(
060                            long userId, long groupId, Map<String, String[]> parameterMap,
061                            File file)
062                    throws Exception;
063    
064            public ManifestSummary getManifestSummary(
065                            long userId, long groupId, Map<String, String[]> parameterMap,
066                            FileEntry fileEntry)
067                    throws Exception;
068    
069            public long getModelDeletionCount(
070                            final PortletDataContext portletDataContext,
071                            final StagedModelType stagedModelType)
072                    throws PortalException, SystemException;
073    
074            public FileEntry getTempFileEntry(
075                            long groupId, long userId, String folderName)
076                    throws PortalException, SystemException;
077    
078            public String replaceExportContentReferences(
079                            PortletDataContext portletDataContext,
080                            StagedModel entityStagedModel, Element entityElement,
081                            String content, boolean exportReferencedContent)
082                    throws Exception;
083    
084            public String replaceExportDLReferences(
085                            PortletDataContext portletDataContext,
086                            StagedModel entityStagedModel, Element entityElement,
087                            String content, boolean exportReferencedContent)
088                    throws Exception;
089    
090            public String replaceExportLayoutReferences(
091                            PortletDataContext portletDataContext, String content,
092                            boolean exportReferencedContent)
093                    throws Exception;
094    
095            public String replaceExportLinksToLayouts(
096                            PortletDataContext portletDataContext,
097                            StagedModel entityStagedModel, Element entityElement,
098                            String content, boolean exportReferencedContent)
099                    throws Exception;
100    
101            public String replaceImportContentReferences(
102                            PortletDataContext portletDataContext, Element entityElement,
103                            String content, boolean importReferencedContent)
104                    throws Exception;
105    
106            public String replaceImportDLReferences(
107                            PortletDataContext portletDataContext, Element entityElement,
108                            String content, boolean importReferencedContent)
109                    throws Exception;
110    
111            public String replaceImportLayoutReferences(
112                            PortletDataContext portletDataContext, String content,
113                            boolean importReferencedContent)
114                    throws Exception;
115    
116            public String replaceImportLinksToLayouts(
117                            PortletDataContext portletDataContext, String content,
118                            boolean importReferencedContent)
119                    throws Exception;
120    
121            public void updateExportPortletPreferencesClassPKs(
122                            PortletDataContext portletDataContext, Portlet portlet,
123                            PortletPreferences portletPreferences, String key, String className,
124                            Element rootElement)
125                    throws Exception;
126    
127            public void updateImportPortletPreferencesClassPKs(
128                            PortletDataContext portletDataContext,
129                            PortletPreferences portletPreferences, String key, Class<?> clazz,
130                            long companyGroupId)
131                    throws Exception;
132    
133            public MissingReferences validateMissingReferences(
134                            long userId, long groupId, Map<String, String[]> parameterMap,
135                            File file)
136                    throws Exception;
137    
138            public void writeManifestSummary(
139                    Document document, ManifestSummary manifestSummary);
140    
141    }