001    /**
002     * Copyright (c) 2000-2011 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.staging;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.lar.PortletDataContext;
020    import com.liferay.portal.kernel.xml.Element;
021    import com.liferay.portal.model.Group;
022    import com.liferay.portal.model.Layout;
023    import com.liferay.portal.model.Portlet;
024    import com.liferay.portal.model.User;
025    import com.liferay.portal.service.ServiceContext;
026    
027    import java.util.Date;
028    import java.util.List;
029    import java.util.Map;
030    
031    import javax.portlet.PortletRequest;
032    
033    import javax.servlet.http.HttpServletRequest;
034    
035    /**
036     * @author Raymond Augé
037     */
038    public interface Staging {
039    
040            public void copyFromLive(PortletRequest PortletRequest) throws Exception;
041    
042            public void copyFromLive(PortletRequest PortletRequest, Portlet portlet)
043                    throws Exception;
044    
045            public void copyPortlet(
046                            PortletRequest PortletRequest, long sourceGroupId,
047                            long targetGroupId, long sourcePlid, long targetPlid,
048                            String portletId)
049                    throws Exception;
050    
051            public void copyRemoteLayouts(
052                            long sourceGroupId, boolean privateLayout,
053                            Map<Long, Boolean> layoutIdMap, Map<String, String[]> parameterMap,
054                            String remoteAddress, int remotePort, boolean secureConnection,
055                            long remoteGroupId, boolean remotePrivateLayout, Date startDate,
056                            Date endDate)
057                    throws Exception;
058    
059            public void deleteLastImportSettings(Group liveGroup, boolean privateLayout)
060                    throws Exception;
061    
062            public void deleteRecentLayoutRevisionId(
063                            HttpServletRequest request, long layoutSetBranchId, long plid)
064                    throws SystemException;
065    
066            public void deleteRecentLayoutRevisionId(
067                            User user, long layoutSetBranchId, long plid)
068                    throws SystemException;
069    
070            public void disableStaging(
071                            Group scopeGroup, Group liveGroup, ServiceContext serviceContext)
072                    throws Exception;
073    
074            public void disableStaging(
075                            PortletRequest portletRequest, Group scopeGroup, Group liveGroup,
076                            ServiceContext serviceContext)
077                    throws Exception;
078    
079            public void enableLocalStaging(
080                            long userId, Group scopeGroup, Group liveGroup,
081                            boolean branchingPublic, boolean branchingPrivate,
082                            ServiceContext serviceContext)
083                    throws Exception;
084    
085            public void enableRemoteStaging(
086                            long userId, Group scopeGroup, Group liveGroup,
087                            boolean branchingPublic, boolean branchingPrivate,
088                            String remoteAddress, long remoteGroupId, int remotePort,
089                            boolean secureConnection, ServiceContext serviceContext)
090                    throws Exception;
091    
092            public List<Layout> getMissingParentLayouts(Layout layout, long liveGroupId)
093                    throws Exception;
094    
095            public long getRecentLayoutRevisionId(
096                            HttpServletRequest request, long layoutSetBranchId, long plid)
097                    throws PortalException, SystemException;
098    
099            public long getRecentLayoutRevisionId(
100                            User user, long layoutSetBranchId, long plid)
101                    throws PortalException, SystemException;
102    
103            public long getRecentLayoutSetBranchId(
104                    HttpServletRequest request, long layoutSetId);
105    
106            public long getRecentLayoutSetBranchId(User user, long layoutSetId)
107                    throws SystemException;
108    
109            public String getSchedulerGroupName(String destinationName, long groupId);
110    
111            public Map<String, String[]> getStagingParameters();
112    
113            public Map<String, String[]> getStagingParameters(
114                    PortletRequest PortletRequest);
115    
116            public boolean isIncomplete(Layout layout, long layoutSetBranchId);
117    
118            public void publishLayout(
119                            long userId, long plid, long liveGroupId, boolean includeChildren)
120                    throws Exception;
121    
122            public void publishLayouts(
123                            long userId, long sourceGroupId, long targetGroupId,
124                            boolean privateLayout, long[] layoutIds,
125                            Map<String, String[]> parameterMap, Date startDate, Date endDate)
126                    throws Exception;
127    
128            public void publishLayouts(
129                            long userId, long sourceGroupId, long targetGroupId,
130                            boolean privateLayout, Map<Long, Boolean> layoutIdMap,
131                            Map<String, String[]> parameterMap, Date startDate, Date endDate)
132                    throws Exception;
133    
134            public void publishLayouts(
135                            long userId, long sourceGroupId, long targetGroupId,
136                            boolean privateLayout, Map<String, String[]> parameterMap,
137                            Date startDate, Date endDate)
138                    throws Exception;
139    
140            public void publishToLive(PortletRequest PortletRequest) throws Exception;
141    
142            public void publishToLive(PortletRequest PortletRequest, Portlet portlet)
143                    throws Exception;
144    
145            public void publishToRemote(PortletRequest PortletRequest) throws Exception;
146    
147            public void scheduleCopyFromLive(PortletRequest PortletRequest)
148                    throws Exception;
149    
150            public void schedulePublishToLive(PortletRequest PortletRequest)
151                    throws Exception;
152    
153            public void schedulePublishToRemote(PortletRequest PortletRequest)
154                    throws Exception;
155    
156            public void setRecentLayoutBranchId(
157                            HttpServletRequest request, long layoutSetBranchId, long plid,
158                            long layoutBranchId)
159                    throws SystemException;
160    
161            public void setRecentLayoutBranchId(
162                            User user, long layoutSetBranchId, long plid, long layoutBranchId)
163                    throws SystemException;
164    
165            public void setRecentLayoutRevisionId(
166                            HttpServletRequest request, long layoutSetBranchId, long plid,
167                            long layoutRevisionId)
168                    throws SystemException;
169    
170            public void setRecentLayoutRevisionId(
171                            User user, long layoutSetBranchId, long plid, long layoutRevisionId)
172                    throws SystemException;
173    
174            public void setRecentLayoutSetBranchId(
175                    HttpServletRequest request, long layoutSetId, long layoutSetBranchId);
176    
177            public void setRecentLayoutSetBranchId(
178                            User user, long layoutSetId, long layoutSetBranchId)
179                    throws SystemException;
180    
181            public void unscheduleCopyFromLive(PortletRequest PortletRequest)
182                    throws Exception;
183    
184            public void unschedulePublishToLive(PortletRequest PortletRequest)
185                    throws Exception;
186    
187            public void unschedulePublishToRemote(PortletRequest PortletRequest)
188                    throws Exception;
189    
190            public void updateLastImportSettings(
191                            Element layoutElement, Layout layout,
192                            PortletDataContext portletDataContext)
193                    throws Exception;
194    
195            public void updateStaging(PortletRequest PortletRequest, Group liveGroup)
196                    throws Exception;
197    
198    }