Interface PublicDocumentAccessService
public interface PublicDocumentAccessService
-
Method Summary
Modifier and TypeMethodDescriptioncreatePublicDocumentAccess(long docOwnerId, String nodeId, String password, Long expirationDate, boolean hasPassword) Creates a public access for a documentgetPublicDocumentAccess(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 accessbooleanisPublicDocumentAccessExpired(String documentId) Checks if public access expiredvoidrevokeDocumentPublicAccess(String documentId) Revokes a document public access
-
Method Details
-
createPublicDocumentAccess
PublicDocumentAccess createPublicDocumentAccess(long docOwnerId, String nodeId, String password, Long expirationDate, boolean hasPassword) Creates 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
-
getPublicDocumentAccess
Gets a document public access by its node id- Parameters:
documentId- node id- Returns:
PublicDocumentAccess
-
isPublicDocumentAccessExpired
Checks if public access expired- Parameters:
documentId- node id- Returns:
- true or false
-
isDocumentPublicAccessValid
Checks the validity of a public access- Parameters:
documentId- node idpassword- password of the document public access- Returns:
- true if access is valid or false else
-
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.- 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
Revokes a document public access- Parameters:
documentId- document id
-