Interface SpaceDocumentsExposureService


public interface SpaceDocumentsExposureService
What a space's documents expose outside the space: their public links and their access entries outside the space, read for the space's managers, and the removal of the public links when the space keeps its documents inside.
  • Method Summary

    Modifier and Type
    Method
    Description
    getExposure(long spaceId, String username)
     
    getPublicLinkDocuments(long spaceId, int offset, int limit, String username)
     
    void
    removePublicLinks(org.exoplatform.social.core.space.model.Space space, boolean documentsKeptInside, String username)
    Removes the public links of the space's documents before the space's "Keep documents inside the space" setting changes, the user's right to change it being already checked.
  • Method Details

    • getExposure

      SpaceDocumentsExposure getExposure(long spaceId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Parameters:
      spaceId - a space's identifier
      username - the user asking
      Returns:
      the counts of the space's documents carrying a public link and of those still shared outside the space once it keeps its documents inside, as SpaceDocumentsExposure states them
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the space does not exist
      IllegalAccessException - when the user may not manage the space
    • getPublicLinkDocuments

      ExposedDocumentPage getPublicLinkDocuments(long spaceId, int offset, int limit, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Parameters:
      spaceId - a space's identifier
      offset - the index of the first document of the page, from 0
      limit - the maximum count of documents of the page, positive
      username - the user asking
      Returns:
      a page of the space's documents carrying a public link, sorted by name then identifier, with the size of the whole list
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the space does not exist
      IllegalAccessException - when the user may not manage the space
      IllegalArgumentException - when offset or limit is out of range
    • removePublicLinks

      void removePublicLinks(org.exoplatform.social.core.space.model.Space space, boolean documentsKeptInside, String username)
      Removes the public links of the space's documents before the space's "Keep documents inside the space" setting changes, the user's right to change it being already checked. On a turn-on, a document whose link is removed also loses the everyone entry of its own access list: one it inherits from its folder stays on that folder, and the children of a folder that inherit its access list lose the folder's own entry with it. Each link is checked again, and its document read again, just before its removal, and logged once removed; a link removed before a failure stays removed. The window that remains is that of one link: its document moved out of the space, or the link removed by another actor, between that check and its deletion.
      Parameters:
      space - the space whose setting changes
      documentsKeptInside - the value about to be stored
      username - the user changing the setting
      Throws:
      IllegalStateException - when a link's document cannot be read or written: the setting must not change