Interface PublicDocumentAccessService
public interface PublicDocumentAccessService
-
Method Summary
Modifier and TypeMethodDescriptioncreateDocumentPublicAccess(long userIdentityId, String documentId, String password, Long expirationDate, boolean hasPassword) Creates or updates a document public access on behalf of a user.createPublicDocumentAccess(long docOwnerId, String nodeId, String password, Long expirationDate, boolean hasPassword) Deprecated, for removal: This API element is subject to removal in a future version.getLinkAccess(String documentId, String password) Decides what the document's public link grants an anonymous visitor, on one read of the link and, when it has one, of its space's committed settings: a document whose space keeps its documents inside is answered as a document with no link, before its expiry or its password is read.getPublicDocumentAccess(String documentId) Gets a document public access by its node idgetPublicDocumentInfo(String documentId) Gets what the public link page shows of a document that has a public access link: whether the link asks for a password or has expired, and the document's name and mime type, without reading its content.booleanhasDocumentPublicAccess(String documentId) Checks if a document has public accessbooleanisDocumentPublicAccessValid(String documentId, String password) Checks the validity of a public access.booleanisProtectedBySpace(String documentId) Whether the document's space keeps its documents inside, on the space's committed settings: its public link, if it has one, then serves nothing.booleanisPublicDocumentAccessExpired(String documentId) Checks if public access expired.voidrevokeDocumentPublicAccess(String documentId) Deprecated, for removal: This API element is subject to removal in a future version.userevokeDocumentPublicAccess(String, long), which applies the document's space settings to the user revokingvoidrevokeDocumentPublicAccess(String documentId, long userIdentityId) Revokes a document public access on behalf of a user.
-
Method Details
-
createPublicDocumentAccess
@Deprecated(forRemoval=true, since="7.3.0") PublicDocumentAccess createPublicDocumentAccess(long docOwnerId, String nodeId, String password, Long expirationDate, boolean hasPassword) Deprecated, for removal: This API element is subject to removal in a future version.usecreateDocumentPublicAccess(long, String, String, Long, boolean), which applies the document's space settings to the user creating the link; a refusal is thrown here as anIllegalStateExceptionCreates a public access for a document- Parameters:
docOwnerId- document ownernodeId- document node idpassword- password of the public accessexpirationDate- public access expiration datehasPassword- document has already old password- Returns:
PublicDocumentAccess
-
createDocumentPublicAccess
PublicDocumentAccess createDocumentPublicAccess(long userIdentityId, String documentId, String password, Long expirationDate, boolean hasPassword) throws IllegalAccessException Creates or updates a document public access on behalf of a user.- Parameters:
userIdentityId- social identity id of the user creating the linkdocumentId- document node idpassword- password of the public accessexpirationDate- public access expiration datehasPassword- document has already old password- Returns:
PublicDocumentAccess, null when it could not be saved- Throws:
DocumentSharingRefusedException- when the document's space refuses the user to manage its accessIllegalAccessException- when the user is unknown
-
getPublicDocumentAccess
Gets a document public access by its node id- Parameters:
documentId- node id- Returns:
PublicDocumentAccess
-
isPublicDocumentAccessExpired
Checks if public access expired. A document whose space keeps its documents inside is answered as a document with no link: expired.- Parameters:
documentId- node id- Returns:
- true or false
-
isDocumentPublicAccessValid
Checks the validity of a public access. A document whose space keeps its documents inside is answered as a document with no link: not valid.- Parameters:
documentId- node idpassword- password of the document public access- Returns:
- true if access is valid or false else
-
isProtectedBySpace
Whether the document's space keeps its documents inside, on the space's committed settings: its public link, if it has one, then serves nothing. A document whose space or settings cannot be read is protected.- Parameters:
documentId- document id- Returns:
- true when the document's public link must serve nothing
-
getLinkAccess
Decides what the document's public link grants an anonymous visitor, on one read of the link and, when it has one, of its space's committed settings: a document whose space keeps its documents inside is answered as a document with no link, before its expiry or its password is read.- Parameters:
documentId- document idpassword- the password the visitor gave, null when none- Returns:
- the link's answer
-
hasDocumentPublicAccess
Checks if a document has public access- Parameters:
documentId- document id- Returns:
- true or false
-
getPublicDocumentInfo
PublicDocumentInfo getPublicDocumentInfo(String documentId) throws org.exoplatform.commons.exception.ObjectNotFoundException Gets what the public link page shows of a document that has a public access link: whether the link asks for a password or has expired, and the document's name and mime type, without reading its content. The link is read once and its password is never decoded. Nothing of the document is read when it has no public access link. A document whose space keeps its documents inside is answered as a document with no link.- Parameters:
documentId- document id- Returns:
PublicDocumentInfo- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the document has no public access link, no longer exists or cannot be read
-
revokeDocumentPublicAccess
Deprecated, for removal: This API element is subject to removal in a future version.userevokeDocumentPublicAccess(String, long), which applies the document's space settings to the user revokingRevokes a document public access, with no check of the caller.- Parameters:
documentId- document id
-
revokeDocumentPublicAccess
void revokeDocumentPublicAccess(String documentId, long userIdentityId) throws IllegalAccessException Revokes a document public access on behalf of a user.- Parameters:
documentId- document iduserIdentityId- social identity id of the user revoking the link- Throws:
DocumentSharingRefusedException- when the document's space refuses the user to manage its accessIllegalAccessException- when the user is unknown
-
createDocumentPublicAccess(long, String, String, Long, boolean), which applies the document's space settings to the user creating the link; a refusal is thrown here as anIllegalStateException