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 Details

    • getComponentLockers

      Collection<UserModel> getComponentLockers(AbstractCMSComponentModel componentModel)
      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

      Collection<UserModel> getSlotLockers(ContentSlotModel contentSlotModel)
      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

      boolean isComponentLockedForUser(AbstractCMSComponentModel componentModel, UserModel userModel)
      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 check
      userModel - - user model for which lock will be checked
      Returns:
      true if component is locked for the given user in any page
    • isContentSlotLockedForUser

      boolean isContentSlotLockedForUser(ContentSlotModel contentSlotModel, UserModel userModel)
      Method that checks if given content slot belongs to any page that is locked for specified user.
      Parameters:
      contentSlotModel - - content slot model to check
      userModel - - user model for which lock will be checked
      Returns:
      true if content slot is locked for the given user in any page
    • isPageLockedBy

      boolean isPageLockedBy(AbstractPageModel pageModel, UserModel userModel)
      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 checked
      userModel - - user model for which lock will be checked
      Returns:
      true if the page is locked by the given user.
    • isPageLockedFor

      boolean isPageLockedFor(AbstractPageModel pageModel, UserModel userModel)
      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 checked
      userModel - - user model for which lock will be checked
      Returns:
      true if the page is locked for specified combination of user and page.
    • setPageLocked

      void setPageLocked(AbstractPageModel pageModel, UserModel userModel, boolean lock)
      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 unset
      userModel - - user model for which the lock will be set or unset
      lock - - if set to true the lock will be set for given combination, otherwise it will be unset.