Class PublicationFollowerManager

    • Field Detail

      • PUBLICATION_ID_FIELD

        public static final java.lang.String PUBLICATION_ID_FIELD
        See Also:
        Constant Field Values
      • PUBLICATION_FOLLOWER_AUTO_ENABLED

        public static final java.lang.String PUBLICATION_FOLLOWER_AUTO_ENABLED
        See Also:
        Constant Field Values
    • Method Detail

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

        public boolean isAutoFollowEnabled()
        Returns true if auto follow is enabled (A member is added to the PublicationFollower of the publication he creates)
        Returns:
        true if auto follow is enabled
        Since:
        jcms-9.0.0
      • addFollower

        public void addFollower​(Publication pub,
                                Member mbr)
        Adds the given member as follower of the given publication.
        Parameters:
        pub - the publication
        mbr - the member
        Since:
        jcms-7.0.0
      • removeFollower

        public void removeFollower​(Publication pub,
                                   Member mbr)
        Removes the given members from the followers of the given publication.
        Parameters:
        pub - the publication
        mbr - the member
        Since:
        jcms-7.0.0
      • removeAllFollowers

        public void removeAllFollowers​(Publication pub)
        Removes all the followers for the given publication.
        Parameters:
        pub - the publication
        Since:
        jcms-7.0.0
      • isFollowed

        public boolean isFollowed​(Publication pub,
                                  Member mbr)
        Returns true if the given publication is followed by the given member.
        Parameters:
        pub - the publication
        mbr - the member
        Returns:
        true if the given publication is followed by the given member.
        Since:
        jcms-7.0.0
      • getPublicationFollowerCount

        public int getPublicationFollowerCount​(Publication pub,
                                               boolean searchParents)
        Returns the PublicationFollower count attached to the given publication.
        Parameters:
        pub - the publication
        searchParents - if true search followers of the (TreeNode) parent of this publication
        Returns:
        the PublicationFollower count attached to the given publication.
        Since:
        jcms-8.0.1
      • getPublicationFollowerList

        public java.util.List<PublicationFollower> getPublicationFollowerList​(Publication pub,
                                                                              boolean searchParents)
        Returns the PublicationFollower list attached to the given publication.
        Parameters:
        pub - the publication
        searchParents - if true search followers of the (TreeNode) parent of this publication
        Returns:
        the PublicationFollower list attached to the given publication.
        Since:
        jcms-7.0.0
      • getFollowerList

        public java.util.List<Member> getFollowerList​(Publication pub,
                                                      boolean searchParents)
        Returns all the followers of the given publication.
        Parameters:
        pub - the publication
        searchParents - if true search followers of the (TreeNode) parent of this publication
        Returns:
        all the followers of the given publication.
        Since:
        jcms-7.0.0
      • getFollowedPublicationList

        public java.util.List<Publication> getFollowedPublicationList​(Member mbr)
        Returns publications followed by the given member.
        Parameters:
        mbr - the member
        Returns:
        publications followed by the given member.
        Since:
        jcms-7.0.0
      • canFollow

        public boolean canFollow​(Member mbr,
                                 Publication pub)
        Returns true if the given member can follow the given publication.
        Parameters:
        mbr - the member
        pub - the publication
        Returns:
        true if the given member can follow the given publication.
        Since:
        jcms-7.0.0
      • notifyFollowers

        public void notifyFollowers​(Publication pub,
                                    Member opAuthor,
                                    java.util.Map context)
        Notify all the follower of the given publication.
        Parameters:
        pub - the publication
        opAuthor - the author of the publication's operation which triggered this notification
        context - the context used in the publication's operation which triggered this notification
        Since:
        jcms-7.0.0
      • notifyFollowers

        public void notifyFollowers​(Publication pub,
                                    Member opAuthor,
                                    java.util.Map context,
                                    boolean searchParents)
        Notify all the follower of the given publication.
        Parameters:
        pub - the publication
        opAuthor - the author of the publication's operation which triggered this notification
        context - the context used in the publication's operation which triggered this notification
        searchParents - if true search followers of the (TreeNode) parent of this publication
        Since:
        jcms-8.0.1
      • notifyFollowers

        public void notifyFollowers​(Publication pub,
                                    Member opAuthor,
                                    java.util.Map context,
                                    Publication parent)
        Notify all the follower of the given publication.
        Parameters:
        pub - the publication
        opAuthor - the author of the publication's operation which triggered this notification
        context - the context used in the publication's operation which triggered this notification
        parent - the parent Publication of notified pub
        Since:
        jcms-8.0.1