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.sites.kernel.util;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.model.Group;
019    import com.liferay.portal.kernel.model.Layout;
020    import com.liferay.portal.kernel.model.LayoutPrototype;
021    import com.liferay.portal.kernel.model.LayoutSet;
022    import com.liferay.portal.kernel.model.LayoutSetPrototype;
023    import com.liferay.portal.kernel.model.User;
024    import com.liferay.portal.kernel.security.permission.PermissionChecker;
025    import com.liferay.portal.kernel.service.ServiceContext;
026    
027    import java.io.File;
028    import java.io.InputStream;
029    
030    import java.util.List;
031    import java.util.Map;
032    
033    import javax.portlet.PortletPreferences;
034    import javax.portlet.PortletRequest;
035    import javax.portlet.PortletResponse;
036    import javax.portlet.PortletURL;
037    import javax.portlet.RenderRequest;
038    import javax.portlet.RenderResponse;
039    
040    import javax.servlet.http.HttpServletRequest;
041    import javax.servlet.http.HttpServletResponse;
042    
043    /**
044     * @author Eudaldo Alonso
045     */
046    public interface Sites {
047    
048            public static final String ANALYTICS_PREFIX = "analytics_";
049    
050            public static final int CONTENT_SHARING_WITH_CHILDREN_DEFAULT_VALUE = -1;
051    
052            public static final int CONTENT_SHARING_WITH_CHILDREN_DISABLED = 0;
053    
054            public static final int CONTENT_SHARING_WITH_CHILDREN_DISABLED_BY_DEFAULT =
055                    1;
056    
057            public static final int CONTENT_SHARING_WITH_CHILDREN_ENABLED = 3;
058    
059            public static final int CONTENT_SHARING_WITH_CHILDREN_ENABLED_BY_DEFAULT =
060                    2;
061    
062            public static final String LAST_MERGE_TIME = "last-merge-time";
063    
064            public static final String LAST_RESET_TIME = "last-reset-time";
065    
066            public static final String LAYOUT_UPDATEABLE = "layoutUpdateable";
067    
068            public static final String MERGE_FAIL_COUNT = "merge-fail-count";
069    
070            public static final String MERGE_FAIL_FRIENDLY_URL_LAYOUTS =
071                    "merge-fail-friendly-url-layouts";
072    
073            public void addMergeFailFriendlyURLLayout(Layout layout)
074                    throws PortalException;
075    
076            public void addPortletBreadcrumbEntries(
077                            Group group, HttpServletRequest request, PortletURL portletURL)
078                    throws Exception;
079    
080            public void addPortletBreadcrumbEntries(
081                            Group group, HttpServletRequest request,
082                            RenderResponse renderResponse)
083                    throws Exception;
084    
085            public void addPortletBreadcrumbEntries(
086                            Group group, String pagesName, PortletURL redirectURL,
087                            HttpServletRequest request, RenderResponse renderResponse)
088                    throws Exception;
089    
090            public void applyLayoutPrototype(
091                            LayoutPrototype layoutPrototype, Layout targetLayout,
092                            boolean linkEnabled)
093                    throws Exception;
094    
095            public void copyLayout(
096                            long userId, Layout sourceLayout, Layout targetLayout,
097                            ServiceContext serviceContext)
098                    throws Exception;
099    
100            public void copyLookAndFeel(Layout targetLayout, Layout sourceLayout)
101                    throws Exception;
102    
103            public void copyPortletPermissions(Layout targetLayout, Layout sourceLayout)
104                    throws Exception;
105    
106            public void copyPortletSetups(Layout sourceLayout, Layout targetLayout)
107                    throws Exception;
108    
109            public void copyTypeSettings(Group sourceGroup, Group targetGroup)
110                    throws Exception;
111    
112            public Object[] deleteLayout(
113                            HttpServletRequest request, HttpServletResponse response)
114                    throws Exception;
115    
116            public Object[] deleteLayout(
117                            PortletRequest portletRequest, PortletResponse portletResponse)
118                    throws Exception;
119    
120            public void deleteLayout(
121                            RenderRequest renderRequest, RenderResponse renderResponse)
122                    throws Exception;
123    
124            public File exportLayoutSetPrototype(
125                            LayoutSetPrototype layoutSetPrototype,
126                            ServiceContext serviceContext)
127                    throws PortalException;
128    
129            public Long[] filterGroups(List<Group> groups, String[] names);
130    
131            public Layout getLayoutSetPrototypeLayout(Layout layout);
132    
133            public Map<String, String[]> getLayoutSetPrototypeParameters(
134                    ServiceContext serviceContext);
135    
136            public int getMergeFailCount(LayoutPrototype layoutPrototype)
137                    throws PortalException;
138    
139            public int getMergeFailCount(LayoutSetPrototype layoutSetPrototype)
140                    throws PortalException;
141    
142            public List<Layout> getMergeFailFriendlyURLLayouts(LayoutSet layoutSet)
143                    throws PortalException;
144    
145            public List<String> getOrganizationNames(Group group, User user)
146                    throws Exception;
147    
148            public List<String> getUserGroupNames(Group group, User user)
149                    throws Exception;
150    
151            public void importLayoutSetPrototype(
152                            LayoutSetPrototype layoutSetPrototype, InputStream inputStream,
153                            ServiceContext serviceContext)
154                    throws PortalException;
155    
156            public boolean isContentSharingWithChildrenEnabled(Group group);
157    
158            public boolean isFirstLayout(
159                    long groupId, boolean privateLayout, long layoutId);
160    
161            public boolean isLayoutDeleteable(Layout layout);
162    
163            public boolean isLayoutModifiedSinceLastMerge(Layout layout)
164                    throws PortalException;
165    
166            public boolean isLayoutSetMergeable(Group group, LayoutSet layoutSet)
167                    throws PortalException;
168    
169            public boolean isLayoutSetPrototypeUpdateable(LayoutSet layoutSet);
170    
171            public boolean isLayoutSortable(Layout layout);
172    
173            public boolean isLayoutUpdateable(Layout layout);
174    
175            public boolean isUserGroupLayout(Layout layout) throws PortalException;
176    
177            public boolean isUserGroupLayoutSetViewable(
178                            PermissionChecker permissionChecker, Group userGroupGroup)
179                    throws PortalException;
180    
181            public void mergeLayoutPrototypeLayout(Group group, Layout layout)
182                    throws Exception;
183    
184            public void mergeLayoutSetPrototypeLayouts(Group group, LayoutSet layoutSet)
185                    throws Exception;
186    
187            public void removeMergeFailFriendlyURLLayouts(LayoutSet layoutSet);
188    
189            public void resetPrototype(Layout layout) throws PortalException;
190    
191            public void resetPrototype(LayoutSet layoutSet) throws PortalException;
192    
193            public void setMergeFailCount(
194                            LayoutPrototype layoutPrototype, int newMergeFailCount)
195                    throws PortalException;
196    
197            public void setMergeFailCount(
198                            LayoutSetPrototype layoutSetPrototype, int newMergeFailCount)
199                    throws PortalException;
200    
201            public void updateLayoutScopes(
202                            long userId, Layout sourceLayout, Layout targetLayout,
203                            PortletPreferences sourcePreferences,
204                            PortletPreferences targetPreferences, String sourcePortletId,
205                            String languageId)
206                    throws Exception;
207    
208            public void updateLayoutSetPrototypesLinks(
209                            Group group, long publicLayoutSetPrototypeId,
210                            long privateLayoutSetPrototypeId,
211                            boolean publicLayoutSetPrototypeLinkEnabled,
212                            boolean privateLayoutSetPrototypeLinkEnabled)
213                    throws Exception;
214    
215    }