Class PublicLinkManager

java.lang.Object
com.jalios.jcms.publiclink.PublicLinkManager
All Implemented Interfaces:
JPropertiesListener

public class PublicLinkManager extends Object implements JPropertiesListener
  • Method Details

    • 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(String accessId)
      Parameters:
      accessId - the access id
      Returns:
      the PublicLink bound to the given accessId
      Since:
      jcms-10.0.5
    • generateAccessId

      public String generateAccessId()
      Returns:
      a random access ID.
      Since:
      jcms-10.0.5
    • generateAccessCode

      public 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 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 String buildAccessUrl(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: 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 or channel.getProperty.

      Specified by:
      propertiesChange in interface JPropertiesListener
      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 document
      opAuthor - the member who has deleted the document
      Since:
      jcms-10.0.6