Interface CMSPageLockingService
- All Known Implementing Classes:
DefaultCMSPageLockingService
public interface CMSPageLockingService
Service contains methods that handles locking/unlocking pages by the user and also perform checks if page is locked
by or for specified user.
- Spring Bean ID:
- cmsPageLockingService
-
Method Summary
Modifier and TypeMethodDescriptiongetComponentLockers(AbstractCMSComponentModel componentModel) Method returns users that locked given component by page or page template.getSlotLockers(ContentSlotModel contentSlotModel) Method returns user that locked given content slot by page or page template, or null if slot is not locked.booleanisComponentLockedForUser(AbstractCMSComponentModel componentModel, UserModel userModel) Method that checks if given component is locked for specified user.booleanisContentSlotLockedForUser(ContentSlotModel contentSlotModel, UserModel userModel) Method that checks if given content slot belongs to any page that is locked for specified user.booleanisPageLockedBy(AbstractPageModel pageModel, UserModel userModel) Method checks if page is locked by the given user.booleanisPageLockedFor(AbstractPageModel pageModel, UserModel userModel) Method checks if the page is locked for given user.voidsetPageLocked(AbstractPageModel pageModel, UserModel userModel, boolean lock) Method that allows to set and unset page lock for given combination of user and page.
-
Method Details
-
getComponentLockers
Method returns users that locked given component by page or page template.- Parameters:
componentModel- - component model to check- Returns:
- users that locked this component
-
getSlotLockers
Method returns user that locked given content slot by page or page template, or null if slot is not locked.- Parameters:
contentSlotModel- - content slot model to check- Returns:
- users that locked this slot
-
isComponentLockedForUser
Method that checks if given component is locked for specified user. Should check if given component is placed in any page that is locked for given user and returns true if it is.- Parameters:
componentModel- - abstract CMS component model to checkuserModel- - user model for which lock will be checked- Returns:
- true if component is locked for the given user in any page
-
isContentSlotLockedForUser
Method that checks if given content slot belongs to any page that is locked for specified user.- Parameters:
contentSlotModel- - content slot model to checkuserModel- - user model for which lock will be checked- Returns:
- true if content slot is locked for the given user in any page
-
isPageLockedBy
Method checks if page is locked by the given user. Even if user has special permission that allows him to unlock any page this method still will return true, because this administration unlock must be performed explicitly.- Parameters:
pageModel- - page model for which lock will be checkeduserModel- - user model for which lock will be checked- Returns:
- true if the page is locked by the given user.
-
isPageLockedFor
Method checks if the page is locked for given user. If the page is locked and was locked by given user it returns false, but if it was locked by other user it returns true.- Parameters:
pageModel- - page model for which lock will be checkeduserModel- - user model for which lock will be checked- Returns:
- true if the page is locked for specified combination of user and page.
-
setPageLocked
Method that allows to set and unset page lock for given combination of user and page. This method should first check if page is not locked by other user and then perform lock/unlock for given parameters. Also will perform unlock if the given user does not set lock for given page, but has permission to unlock any page.- Parameters:
pageModel- - page model for which the lock will be set or unsetuserModel- - user model for which the lock will be set or unsetlock- - if set to true the lock will be set for given combination, otherwise it will be unset.
-