Class PublicLinkManager

    • Method Detail

      • 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: 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