Liferay 7.0-ce-b4

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
 
Fields inherited from interface com.liferay.sites.kernel.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[] groupKeys)
           
 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)
           
 List<String> getOrganizationNames(Group group, User user)
           
 List<String> getUserGroupNames(Group group, User user)
           
 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 isUserGroupLayout(Layout layout)
           
 boolean isUserGroupLayoutSetViewable(PermissionChecker permissionChecker, Group userGroupGroup)
           
 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
 

Constructor Detail

SitesImpl

public SitesImpl()
Method Detail

addMergeFailFriendlyURLLayout

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

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
Specified by:
exportLayoutSetPrototype in interface Sites
Throws:
PortalException

filterGroups

public Long[] filterGroups(List<Group> groups,
                           String[] groupKeys)
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
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

getMergeFailCount

public int getMergeFailCount(LayoutSetPrototype layoutSetPrototype)
                      throws PortalException
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

getMergeFailFriendlyURLLayouts

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

getOrganizationNames

public List<String> getOrganizationNames(Group group,
                                         User user)
                                  throws Exception
Specified by:
getOrganizationNames in interface Sites
Throws:
Exception

getUserGroupNames

public List<String> getUserGroupNames(Group group,
                                      User user)
                               throws Exception
Specified by:
getUserGroupNames in interface Sites
Throws:
Exception

importLayoutSetPrototype

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

isContentSharingWithChildrenEnabled

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

isFirstLayout

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

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
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

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

isUserGroupLayout

public boolean isUserGroupLayout(Layout layout)
                          throws PortalException
Specified by:
isUserGroupLayout in interface Sites
Throws:
PortalException

isUserGroupLayoutSetViewable

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

mergeLayoutPrototypeLayout

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

mergeLayoutProtypeLayout

@Deprecated
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

@Deprecated
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)
Specified by:
removeMergeFailFriendlyURLLayouts in interface Sites

resetPrototype

public void resetPrototype(Layout layout)
                    throws PortalException
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

resetPrototype

public void resetPrototype(LayoutSet layoutSet)
                    throws PortalException
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

setMergeFailCount

public void setMergeFailCount(LayoutPrototype layoutPrototype,
                              int newMergeFailCount)
                       throws PortalException
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

setMergeFailCount

public void setMergeFailCount(LayoutSetPrototype layoutSetPrototype,
                              int newMergeFailCount)
                       throws PortalException
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

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
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

doMergeLayoutPrototypeLayout

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

doResetPrototype

protected void doResetPrototype(Layout layout)
                         throws PortalException
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

doResetPrototype

protected void doResetPrototype(LayoutSet layoutSet)
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

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
Throws:
PortalException

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 7.0-ce-b4