Liferay 6.2-ce-ga5

com.liferay.portlet.sites.util
Class SitesImpl

java.lang.Object
  extended by com.liferay.portlet.sites.util.SitesImpl
All Implemented Interfaces:
Sites

public class SitesImpl
extends Object
implements Sites


Field Summary
static boolean LAYOUT_SET_PROTOTYPE_PROPAGATE_LOGO
           
 
Fields inherited from interface com.liferay.portlet.sites.util.Sites
ANALYTICS_PREFIX, CONTENT_SHARING_WITH_CHILDREN_DEFAULT_VALUE, CONTENT_SHARING_WITH_CHILDREN_DISABLED, CONTENT_SHARING_WITH_CHILDREN_DISABLED_BY_DEFAULT, CONTENT_SHARING_WITH_CHILDREN_ENABLED, CONTENT_SHARING_WITH_CHILDREN_ENABLED_BY_DEFAULT, LAST_MERGE_TIME, LAST_RESET_TIME, LAYOUT_UPDATEABLE, MERGE_FAIL_COUNT, MERGE_FAIL_FRIENDLY_URL_LAYOUTS
 
Constructor Summary
SitesImpl()
           
 
Method Summary
 void addMergeFailFriendlyURLLayout(Layout layout)
           
 void addPortletBreadcrumbEntries(Group group, javax.servlet.http.HttpServletRequest request, RenderResponse renderResponse)
           
 void addPortletBreadcrumbEntries(Group group, String pagesName, PortletURL redirectURL, javax.servlet.http.HttpServletRequest request, RenderResponse renderResponse)
           
 void applyLayoutPrototype(LayoutPrototype layoutPrototype, Layout targetLayout, boolean linkEnabled)
           
protected  void checkResetPrototypePermissions(Group group, Layout layout)
          Checks the permissions necessary for resetting the layout or site.
 void copyLayout(long userId, Layout sourceLayout, Layout targetLayout, ServiceContext serviceContext)
           
 void copyLookAndFeel(Layout targetLayout, Layout sourceLayout)
           
 void copyPortletPermissions(Layout targetLayout, Layout sourceLayout)
           
 void copyPortletSetups(Layout sourceLayout, Layout targetLayout)
           
 void copyTypeSettings(Group sourceGroup, Group targetGroup)
           
 Object[] deleteLayout(ActionRequest actionRequest, ActionResponse actionResponse)
           
 Object[] deleteLayout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void deleteLayout(RenderRequest renderRequest, RenderResponse renderResponse)
           
protected  void doMergeLayoutPrototypeLayout(Group group, Layout layout)
           
protected  void doResetPrototype(Layout layout)
          Resets the modified timestamp on the layout, and then calls doResetPrototype(LayoutSet) to reset the modified timestamp on the layout's site.
protected  void doResetPrototype(LayoutSet layoutSet)
          Resets the modified timestamp on the layout set.
 File exportLayoutSetPrototype(LayoutSetPrototype layoutSetPrototype, ServiceContext serviceContext)
           
 Long[] filterGroups(List<Group> groups, String[] names)
           
 Layout getLayoutSetPrototypeLayout(Layout layout)
           
 Map<String,String[]> getLayoutSetPrototypeParameters(ServiceContext serviceContext)
           
protected  Map<String,String[]> getLayoutSetPrototypesParameters(boolean importData)
           
 int getMergeFailCount(LayoutPrototype layoutPrototype)
          Returns the number of failed merge attempts for the layout prototype since its last reset or update.
 int getMergeFailCount(LayoutSetPrototype layoutSetPrototype)
          Returns the number of failed merge attempts for the layout set prototype since its last reset or update.
 List<Layout> getMergeFailFriendlyURLLayouts(LayoutSet layoutSet)
           
 void importLayoutSetPrototype(LayoutSetPrototype layoutSetPrototype, InputStream inputStream, ServiceContext serviceContext)
           
protected  void importLayoutSetPrototype(LayoutSetPrototype layoutSetPrototype, long groupId, boolean privateLayout, Map<String,String[]> parameterMap, boolean importData)
           
 boolean isContentSharingWithChildrenEnabled(Group group)
           
 boolean isFirstLayout(long groupId, boolean privateLayout, long layoutId)
           
 boolean isLayoutDeleteable(Layout layout)
           
 boolean isLayoutModifiedSinceLastMerge(Layout layout)
           
 boolean isLayoutSetMergeable(Group group, LayoutSet layoutSet)
          Returns true if the linked site template can be merged into the layout set.
 boolean isLayoutSetPrototypeUpdateable(LayoutSet layoutSet)
           
 boolean isLayoutSortable(Layout layout)
           
 boolean isLayoutUpdateable(Layout layout)
           
 boolean isOrganizationUser(long companyId, Group group, User user, List<String> organizationNames)
           
 boolean isUserGroupLayoutSetViewable(PermissionChecker permissionChecker, Group userGroupGroup)
           
 boolean isUserGroupUser(long companyId, Group group, User user, List<String> userGroupNames)
           
 void mergeLayoutPrototypeLayout(Group group, Layout layout)
           
 void mergeLayoutProtypeLayout(Group group, Layout layout)
          Deprecated. As of 6.2.0, replaced by mergeLayoutPrototypeLayout(Group, Layout)
 void mergeLayoutSetPrototypeLayouts(Group group, LayoutSet layoutSet)
           
 void mergeLayoutSetProtypeLayouts(Group group, LayoutSet layoutSet)
          Deprecated. As of 6.2.0, replaced by mergeLayoutSetPrototypeLayouts(Group, LayoutSet)
 void removeMergeFailFriendlyURLLayouts(LayoutSet layoutSet)
           
 void resetPrototype(Layout layout)
          Checks the permissions necessary for resetting the layout.
 void resetPrototype(LayoutSet layoutSet)
          Checks the permissions necessary for resetting the layout set.
protected  void setLayoutSetPrototypeLinkEnabledParameter(Map<String,String[]> parameterMap, LayoutSet targetLayoutSet, ServiceContext serviceContext)
           
 void setMergeFailCount(LayoutPrototype layoutPrototype, int newMergeFailCount)
          Sets the number of failed merge attempts for the layout prototype to a new value.
 void setMergeFailCount(LayoutSetPrototype layoutSetPrototype, int newMergeFailCount)
          Sets the number of failed merge attempts for the layout set prototype to a new value.
 void updateLayoutScopes(long userId, Layout sourceLayout, Layout targetLayout, PortletPreferences sourcePreferences, PortletPreferences targetPreferences, String sourcePortletId, String languageId)
           
protected  void updateLayoutSetPrototypeLink(long groupId, boolean privateLayout, long layoutSetPrototypeId, boolean layoutSetPrototypeLinkEnabled)
           
 void updateLayoutSetPrototypesLinks(Group group, long publicLayoutSetPrototypeId, long privateLayoutSetPrototypeId, boolean publicLayoutSetPrototypeLinkEnabled, boolean privateLayoutSetPrototypeLinkEnabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYOUT_SET_PROTOTYPE_PROPAGATE_LOGO

public static final boolean LAYOUT_SET_PROTOTYPE_PROPAGATE_LOGO
Constructor Detail

SitesImpl

public SitesImpl()
Method Detail

addMergeFailFriendlyURLLayout

public void addMergeFailFriendlyURLLayout(Layout layout)
                                   throws PortalException,
                                          SystemException
Specified by:
addMergeFailFriendlyURLLayout in interface Sites
Throws:
PortalException
SystemException

addPortletBreadcrumbEntries

public void addPortletBreadcrumbEntries(Group group,
                                        javax.servlet.http.HttpServletRequest request,
                                        RenderResponse renderResponse)
                                 throws Exception
Specified by:
addPortletBreadcrumbEntries in interface Sites
Throws:
Exception

addPortletBreadcrumbEntries

public void addPortletBreadcrumbEntries(Group group,
                                        String pagesName,
                                        PortletURL redirectURL,
                                        javax.servlet.http.HttpServletRequest request,
                                        RenderResponse renderResponse)
                                 throws Exception
Specified by:
addPortletBreadcrumbEntries in interface Sites
Throws:
Exception

applyLayoutPrototype

public void applyLayoutPrototype(LayoutPrototype layoutPrototype,
                                 Layout targetLayout,
                                 boolean linkEnabled)
                          throws Exception
Specified by:
applyLayoutPrototype in interface Sites
Throws:
Exception

copyLayout

public void copyLayout(long userId,
                       Layout sourceLayout,
                       Layout targetLayout,
                       ServiceContext serviceContext)
                throws Exception
Specified by:
copyLayout in interface Sites
Throws:
Exception

copyLookAndFeel

public void copyLookAndFeel(Layout targetLayout,
                            Layout sourceLayout)
                     throws Exception
Specified by:
copyLookAndFeel in interface Sites
Throws:
Exception

copyPortletPermissions

public void copyPortletPermissions(Layout targetLayout,
                                   Layout sourceLayout)
                            throws Exception
Specified by:
copyPortletPermissions in interface Sites
Throws:
Exception

copyPortletSetups

public void copyPortletSetups(Layout sourceLayout,
                              Layout targetLayout)
                       throws Exception
Specified by:
copyPortletSetups in interface Sites
Throws:
Exception

copyTypeSettings

public void copyTypeSettings(Group sourceGroup,
                             Group targetGroup)
                      throws Exception
Specified by:
copyTypeSettings in interface Sites
Throws:
Exception

deleteLayout

public Object[] deleteLayout(ActionRequest actionRequest,
                             ActionResponse actionResponse)
                      throws Exception
Specified by:
deleteLayout in interface Sites
Throws:
Exception

deleteLayout

public Object[] deleteLayout(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws Exception
Specified by:
deleteLayout in interface Sites
Throws:
Exception

deleteLayout

public void deleteLayout(RenderRequest renderRequest,
                         RenderResponse renderResponse)
                  throws Exception
Specified by:
deleteLayout in interface Sites
Throws:
Exception

exportLayoutSetPrototype

public File exportLayoutSetPrototype(LayoutSetPrototype layoutSetPrototype,
                                     ServiceContext serviceContext)
                              throws PortalException,
                                     SystemException
Specified by:
exportLayoutSetPrototype in interface Sites
Throws:
PortalException
SystemException

filterGroups

public Long[] filterGroups(List<Group> groups,
                           String[] names)
Specified by:
filterGroups in interface Sites

getLayoutSetPrototypeLayout

public Layout getLayoutSetPrototypeLayout(Layout layout)
Specified by:
getLayoutSetPrototypeLayout in interface Sites

getLayoutSetPrototypeParameters

public Map<String,String[]> getLayoutSetPrototypeParameters(ServiceContext serviceContext)
Specified by:
getLayoutSetPrototypeParameters in interface Sites

getMergeFailCount

public int getMergeFailCount(LayoutPrototype layoutPrototype)
                      throws PortalException,
                             SystemException
Returns the number of failed merge attempts for the layout prototype since its last reset or update.

Specified by:
getMergeFailCount in interface Sites
Parameters:
layoutPrototype - the page template being checked for failed merge attempts
Returns:
the number of failed merge attempts for the layout prototype
Throws:
PortalException - if no page was associated with the layout prototype or if a portal exception occurred
SystemException - if a system exception occurred

getMergeFailCount

public int getMergeFailCount(LayoutSetPrototype layoutSetPrototype)
                      throws PortalException,
                             SystemException
Returns the number of failed merge attempts for the layout set prototype since its last reset or update.

Specified by:
getMergeFailCount in interface Sites
Parameters:
layoutSetPrototype - the site template being checked for failed merge attempts
Returns:
the number of failed merge attempts for the layout set prototype
Throws:
PortalException - if no site was associated with the layout set prototype or if a portal exception occurred
SystemException - if a system exception occurred

getMergeFailFriendlyURLLayouts

public List<Layout> getMergeFailFriendlyURLLayouts(LayoutSet layoutSet)
                                            throws PortalException,
                                                   SystemException
Specified by:
getMergeFailFriendlyURLLayouts in interface Sites
Throws:
PortalException
SystemException

importLayoutSetPrototype

public void importLayoutSetPrototype(LayoutSetPrototype layoutSetPrototype,
                                     InputStream inputStream,
                                     ServiceContext serviceContext)
                              throws PortalException,
                                     SystemException
Specified by:
importLayoutSetPrototype in interface Sites
Throws:
PortalException
SystemException

isContentSharingWithChildrenEnabled

public boolean isContentSharingWithChildrenEnabled(Group group)
                                            throws SystemException
Specified by:
isContentSharingWithChildrenEnabled in interface Sites
Throws:
SystemException

isFirstLayout

public boolean isFirstLayout(long groupId,
                             boolean privateLayout,
                             long layoutId)
                      throws SystemException
Specified by:
isFirstLayout in interface Sites
Throws:
SystemException

isLayoutDeleteable

public boolean isLayoutDeleteable(Layout layout)
Specified by:
isLayoutDeleteable in interface Sites

isLayoutModifiedSinceLastMerge

public boolean isLayoutModifiedSinceLastMerge(Layout layout)
Specified by:
isLayoutModifiedSinceLastMerge in interface Sites

isLayoutSetMergeable

public boolean isLayoutSetMergeable(Group group,
                                    LayoutSet layoutSet)
                             throws PortalException,
                                    SystemException
Returns true if the linked site template can be merged into the layout set. This method checks the current number of merge fail attempts stored for the linked site template and, if greater than the merge fail threshold, will return false.

Specified by:
isLayoutSetMergeable in interface Sites
Parameters:
group - the site template's group, which is about to be merged into the layout set
layoutSet - the site in which the site template is attempting to merge into
Returns:
true if the linked site template can be merged into the layout set; false otherwise
Throws:
PortalException - if no site template was associated with the layout set or if a portal exception occurred
SystemException - if a system exception occurred

isLayoutSetPrototypeUpdateable

public boolean isLayoutSetPrototypeUpdateable(LayoutSet layoutSet)
Specified by:
isLayoutSetPrototypeUpdateable in interface Sites

isLayoutSortable

public boolean isLayoutSortable(Layout layout)
Specified by:
isLayoutSortable in interface Sites

isLayoutUpdateable

public boolean isLayoutUpdateable(Layout layout)
Specified by:
isLayoutUpdateable in interface Sites

isOrganizationUser

public boolean isOrganizationUser(long companyId,
                                  Group group,
                                  User user,
                                  List<String> organizationNames)
                           throws Exception
Specified by:
isOrganizationUser in interface Sites
Throws:
Exception

isUserGroupLayoutSetViewable

public boolean isUserGroupLayoutSetViewable(PermissionChecker permissionChecker,
                                            Group userGroupGroup)
                                     throws PortalException,
                                            SystemException
Specified by:
isUserGroupLayoutSetViewable in interface Sites
Throws:
PortalException
SystemException

isUserGroupUser

public boolean isUserGroupUser(long companyId,
                               Group group,
                               User user,
                               List<String> userGroupNames)
                        throws Exception
Specified by:
isUserGroupUser in interface Sites
Throws:
Exception

mergeLayoutPrototypeLayout

public void mergeLayoutPrototypeLayout(Group group,
                                       Layout layout)
                                throws Exception
Specified by:
mergeLayoutPrototypeLayout in interface Sites
Throws:
Exception

mergeLayoutProtypeLayout

public void mergeLayoutProtypeLayout(Group group,
                                     Layout layout)
                              throws Exception
Deprecated. As of 6.2.0, replaced by mergeLayoutPrototypeLayout(Group, Layout)

Specified by:
mergeLayoutProtypeLayout in interface Sites
Throws:
Exception

mergeLayoutSetPrototypeLayouts

public void mergeLayoutSetPrototypeLayouts(Group group,
                                           LayoutSet layoutSet)
                                    throws Exception
Specified by:
mergeLayoutSetPrototypeLayouts in interface Sites
Throws:
Exception

mergeLayoutSetProtypeLayouts

public void mergeLayoutSetProtypeLayouts(Group group,
                                         LayoutSet layoutSet)
                                  throws Exception
Deprecated. As of 6.2.0, replaced by mergeLayoutSetPrototypeLayouts(Group, LayoutSet)

Specified by:
mergeLayoutSetProtypeLayouts in interface Sites
Throws:
Exception

removeMergeFailFriendlyURLLayouts

public void removeMergeFailFriendlyURLLayouts(LayoutSet layoutSet)
                                       throws SystemException
Specified by:
removeMergeFailFriendlyURLLayouts in interface Sites
Throws:
SystemException

resetPrototype

public void resetPrototype(Layout layout)
                    throws PortalException,
                           SystemException
Checks the permissions necessary for resetting the layout. If sufficient, the layout is reset by calling doResetPrototype(Layout).

Specified by:
resetPrototype in interface Sites
Parameters:
layout - the page being checked for sufficient permissions
Throws:
PortalException - if no site was associated with the layout, if the user did not have permission to update the layout or the layout's site, or if a portal exception occurred
SystemException - if a system exception occurred

resetPrototype

public void resetPrototype(LayoutSet layoutSet)
                    throws PortalException,
                           SystemException
Checks the permissions necessary for resetting the layout set. If sufficient, the layout set is reset by calling doResetPrototype(LayoutSet).

Specified by:
resetPrototype in interface Sites
Parameters:
layoutSet - the site being checked for sufficient permissions
Throws:
PortalException - if the user did not have permission to update the site or if a portal exception occurred
SystemException - if a system exception occurred

setMergeFailCount

public void setMergeFailCount(LayoutPrototype layoutPrototype,
                              int newMergeFailCount)
                       throws PortalException,
                              SystemException
Sets the number of failed merge attempts for the layout prototype to a new value.

Specified by:
setMergeFailCount in interface Sites
Parameters:
layoutPrototype - the page template of the counter being updated
newMergeFailCount - the new value of the counter
Throws:
PortalException - if no page was associated with the layout prototype, if the user did not have permission to update the page, or if a portal exception occurred
SystemException - if a system exception occurred

setMergeFailCount

public void setMergeFailCount(LayoutSetPrototype layoutSetPrototype,
                              int newMergeFailCount)
                       throws PortalException,
                              SystemException
Sets the number of failed merge attempts for the layout set prototype to a new value.

Specified by:
setMergeFailCount in interface Sites
Parameters:
layoutSetPrototype - the site template of the counter being updated
newMergeFailCount - the new value of the counter
Throws:
PortalException - if no site was associated with the layout set prototype, if the user did not have permission to update the layout set prototype, or if a portal exception occurred
SystemException - if a system exception occurred

updateLayoutScopes

public void updateLayoutScopes(long userId,
                               Layout sourceLayout,
                               Layout targetLayout,
                               PortletPreferences sourcePreferences,
                               PortletPreferences targetPreferences,
                               String sourcePortletId,
                               String languageId)
                        throws Exception
Specified by:
updateLayoutScopes in interface Sites
Throws:
Exception

updateLayoutSetPrototypesLinks

public void updateLayoutSetPrototypesLinks(Group group,
                                           long publicLayoutSetPrototypeId,
                                           long privateLayoutSetPrototypeId,
                                           boolean publicLayoutSetPrototypeLinkEnabled,
                                           boolean privateLayoutSetPrototypeLinkEnabled)
                                    throws Exception
Specified by:
updateLayoutSetPrototypesLinks in interface Sites
Throws:
Exception

checkResetPrototypePermissions

protected void checkResetPrototypePermissions(Group group,
                                              Layout layout)
                                       throws PortalException,
                                              SystemException
Checks the permissions necessary for resetting the layout or site. If the permissions are not sufficient, a PortalException is thrown.

Parameters:
group - the site being checked for sufficient permissions
layout - the page being checked for sufficient permissions (optionally null). If null, the permissions are only checked for resetting the site.
Throws:
PortalException - if the user did not have permission to update the layout or site, or if a portal exception occurred
SystemException - if a system exception occurred

doMergeLayoutPrototypeLayout

protected void doMergeLayoutPrototypeLayout(Group group,
                                            Layout layout)
                                     throws Exception
Throws:
Exception

doResetPrototype

protected void doResetPrototype(Layout layout)
                         throws PortalException,
                                SystemException
Resets the modified timestamp on the layout, and then calls doResetPrototype(LayoutSet) to reset the modified timestamp on the layout's site.

After the timestamps are reset, the modified page template and site template are merged into their linked layout and site when they are first accessed.

Parameters:
layout - the page having its timestamp reset
Throws:
PortalException - if no site was associated with the layout or if a portal exception occurred
SystemException - if a system exception occurred

doResetPrototype

protected void doResetPrototype(LayoutSet layoutSet)
                         throws SystemException
Resets the modified timestamp on the layout set.

After the timestamp is reset, the modified site template is merged into its linked layout set when it is first accessed.

Parameters:
layoutSet - the site having its timestamp reset
Throws:
SystemException - if a system exception occurred

getLayoutSetPrototypesParameters

protected Map<String,String[]> getLayoutSetPrototypesParameters(boolean importData)

importLayoutSetPrototype

protected void importLayoutSetPrototype(LayoutSetPrototype layoutSetPrototype,
                                        long groupId,
                                        boolean privateLayout,
                                        Map<String,String[]> parameterMap,
                                        boolean importData)
                                 throws PortalException,
                                        SystemException
Throws:
PortalException
SystemException

setLayoutSetPrototypeLinkEnabledParameter

protected void setLayoutSetPrototypeLinkEnabledParameter(Map<String,String[]> parameterMap,
                                                         LayoutSet targetLayoutSet,
                                                         ServiceContext serviceContext)

updateLayoutSetPrototypeLink

protected void updateLayoutSetPrototypeLink(long groupId,
                                            boolean privateLayout,
                                            long layoutSetPrototypeId,
                                            boolean layoutSetPrototypeLinkEnabled)
                                     throws Exception
Throws:
Exception

Liferay 6.2-ce-ga5