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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringbuildAccessUrl(java.lang.String accessId)booleancanCreatePublicLink(Member mbr)Check if the specified member can create a public link.booleancanCreatePublicLink(Member mbr, Publication pub)Check if the specified member can create a public link for the specified publication.booleancanManagePublicLink(Member mbr)java.lang.StringgenerateAccessCode()java.lang.StringgenerateAccessCode(int length)java.lang.StringgenerateAccessId()intgetAccessCodeLength()static PublicLinkManagergetInstance()PublicLinkgetPublicLink(java.lang.String accessId)booleanisEnabled()booleanisForceDownload()voidprocessDocumentDeletion(FileDocument doc, Member opAuthor)Delete or update PublicLink when a document is deletedvoidpropertiesChange(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
-
isForceDownload
public boolean isForceDownload()
-
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, Publication pub)
Check if the specified member can create a public link for the specified publication.- Parameters:
mbr- the member for which verification is performed (null accepted)pub- the publication for which a pub link would be created (null accepted)- Returns:
- true if the given member can create public link for the specified publication
- Since:
- 10.0.8 / JCMS-10746
-
canCreatePublicLink
public boolean canCreatePublicLink(Member mbr)
Check if the specified member can create a public link.If you need to check rights for a specific publication, use
canCreatePublicLink(Member, Publication).- 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:JPropertiesListenerInvoked 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.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
processDocumentDeletion
public void processDocumentDeletion(FileDocument doc, Member opAuthor)
Delete or update PublicLink when a document is deleted- Parameters:
doc- the documentopAuthor- the member who has deleted the document- Since:
- jcms-10.0.6
-
-