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 TypeMethodDescriptiongetExposure(long spaceId, String username) getPublicLinkDocuments(long spaceId, int offset, int limit, String username) voidremovePublicLinks(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 identifierusername- 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
SpaceDocumentsExposurestates them - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the space does not existIllegalAccessException- 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 identifieroffset- the index of the first document of the page, from 0limit- the maximum count of documents of the page, positiveusername- 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 existIllegalAccessException- when the user may not manage the spaceIllegalArgumentException- 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 changesdocumentsKeptInside- the value about to be storedusername- the user changing the setting- Throws:
IllegalStateException- when a link's document cannot be read or written: the setting must not change
-