Package com.jalios.jcms.publiclink
Class PublicLinkManager
- java.lang.Object
-
- com.jalios.jcms.publiclink.PublicLinkManager
-
- All Implemented Interfaces:
JPropertiesListener
public class PublicLinkManager extends java.lang.Object implements JPropertiesListener
-
-
Field Summary
-
Fields inherited from interface com.jalios.util.JPropertiesListener
REVISION
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
buildAccessUrl(java.lang.String accessId)
boolean
canCreatePublicLink(Member mbr)
boolean
canManagePublicLink(Member mbr)
java.lang.String
generateAccessCode()
java.lang.String
generateAccessCode(int length)
java.lang.String
generateAccessId()
int
getAccessCodeLength()
static PublicLinkManager
getInstance()
PublicLink
getPublicLink(java.lang.String accessId)
boolean
isEnabled()
void
processDocumentDeletion(FileDocument doc)
Delete or update PublicLink when a document is deletedvoid
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.
-
-
-
Method Detail
-
getInstance
public static PublicLinkManager getInstance()
-
isEnabled
public boolean isEnabled()
- Returns:
- true if the Public Link feature is enabled.
- Since:
- jcms-10.0.5
-
getPublicLink
public PublicLink getPublicLink(java.lang.String accessId)
- Parameters:
accessId
- the access id- Returns:
- the PublicLink bound to the given accessId
- Since:
- jcms-10.0.5
-
generateAccessId
public java.lang.String generateAccessId()
- Returns:
- a random access ID.
- Since:
- jcms-10.0.5
-
generateAccessCode
public java.lang.String generateAccessCode()
- Returns:
- a random access code
- Since:
- jcms-10.0.5
-
getAccessCodeLength
public int getAccessCodeLength()
- Returns:
- the length of the access code
- Since:
- jcms-10.0.5
-
generateAccessCode
public java.lang.String generateAccessCode(int length)
- Parameters:
length
- the number of digit of the code- Returns:
- a random access code
- Since:
- jcms-10.0.5
-
buildAccessUrl
public java.lang.String buildAccessUrl(java.lang.String accessId)
- Parameters:
accessId
- the access ID- Returns:
- the access URL for the given accessId.
- Since:
- jcms-10.0.5
-
canManagePublicLink
public boolean canManagePublicLink(Member mbr)
- Parameters:
mbr
- the member- Returns:
- true if the given member can manage all public links
- Since:
- jcms-10.0.5
-
canCreatePublicLink
public boolean canCreatePublicLink(Member mbr)
- Parameters:
mbr
- the member- Returns:
- true if the given member can create public links
- Since:
- jcms-10.0.5
-
propertiesChange
public void propertiesChange(JProperties properties)
Description copied from interface:JPropertiesListener
Invoked after properties have been modified in JCMS and save on disk.You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using
channel.getProperties
orchannel.getProperty
.- Specified by:
propertiesChange
in interfaceJPropertiesListener
- Parameters:
properties
- the properties which have been submitted to change
-
processDocumentDeletion
public void processDocumentDeletion(FileDocument doc)
Delete or update PublicLink when a document is deleted- Parameters:
doc
- the document- Since:
- jcms-10.0.6
-
-