Class RecommendationManager

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

        public void sendRecommendation​(Recommendation recommendation,
                                       boolean isAuthorRecipient)
        Sends the given recommendation
        Parameters:
        isAuthorRecipient - defines if author should receive the recommendation too
        recommendation - the Recommendation
        Since:
        jcms-8.0.0
      • getAlertName

        public java.lang.String getAlertName​(Data data)
        Returns the alert name for a given data, in order to override the default alert name for Recommendation
        Parameters:
        data - the Data
        Returns:
        the alert name for a given data
      • getModalText

        public java.lang.String getModalText​(Data data,
                                             java.lang.String userLang)
        Returns the alert name for a given data, in order to override the default alert name for Recommendation
        Parameters:
        data - the Data
        userLang - the user language
        Returns:
        the alert name for a given data
      • getRecommendationCount

        public int getRecommendationCount​(Data data)
        Returns the count Recommendation for given Data
        Parameters:
        data - the Data
        Returns:
        the count of Recommendation for given Data
        Since:
        jcms-8.0.0
      • getRecommendationList

        public java.util.List<Recommendation> getRecommendationList​(Data data)
        Returns the List of Recommendation for given Data ordered by date desc
        Parameters:
        data - the Data
        Returns:
        the List of Recommendation for given Data ordered by date desc
        Since:
        jcms-8.0.0
      • getSentRecommendationCount

        public int getSentRecommendationCount​(Member mbr)
        Returns the count of Recommendation for given Member
        Parameters:
        mbr - the Member
        Returns:
        the count of Recommendation for given Member
        Since:
        jcms-8.0.0
      • getSentRecommendationCount

        public int getSentRecommendationCount​(Data data,
                                              Member mbr)
        Returns the count of Recommendation on given Data the given Member has made
        Parameters:
        data - the Data
        mbr - the Member
        Returns:
        the count of Recommendation on given Data the given Member has made
        Since:
        jcms-8.0.0
      • getSentRecommendationList

        public java.util.List<Recommendation> getSentRecommendationList​(Member mbr)
        Returns the List of Recommendation for given Member ordered by date desc
        Parameters:
        mbr - the Member
        Returns:
        the List of Recommendation for given Member ordered by date desc
        Since:
        jcms-8.0.0
      • getSentRecommendationList

        public java.util.List<Recommendation> getSentRecommendationList​(Data data,
                                                                        Member mbr)
        Returns the List of Recommendation on given Data the given Member has sent ordered by date desc
        Parameters:
        data - the Data
        mbr - the Member
        Returns:
        the List of Recommendation on given Data the given Member has made ordered by date desc
        Since:
        jcms-8.0.0
      • getReceivedRecommendationCount

        public int getReceivedRecommendationCount​(Data data,
                                                  Member mbr)
        Returns the count of Recommendation on given Data that given Member has received ordered by date desc
        Parameters:
        data - the Data
        mbr - the Member
        Returns:
        the count of Recommendation on given Data that given Member has received ordered by date desc
        Since:
        jcms-8.0.0
      • getReceivedRecommendationCount

        public int getReceivedRecommendationCount​(Member mbr)
        Returns the count of Recommendation where given member is a recipient ordered by date desc
        Parameters:
        mbr - the Member
        Returns:
        the count of Recommendation where given member is a recipient ordered by date desc
        Since:
        jcms-8.0.0
      • getReceivedRecommendationSet

        public java.util.Set<Recommendation> getReceivedRecommendationSet​(Member mbr)
        Returns the List of Recommendation where given member is a recipient ordered by date desc
        Parameters:
        mbr - the Member
        Returns:
        the List of Recommendation where given member is a recipient ordered by date desc
        Since:
        jcms-8.0.0
      • getReceivedRecommendationSet

        public java.util.Set<Recommendation> getReceivedRecommendationSet​(Data data,
                                                                          Member mbr)
        Returns the List of Recommendation on given Data, where given member is a recipient ordered by date desc
        Parameters:
        data - the Data
        mbr - the Member
        Returns:
        the List of Recommendation on given Data, where given member is a recipient ordered by date desc
        Since:
        jcms-8.0.0
      • getReceivedRecommendationSet

        public java.util.Set<Recommendation> getReceivedRecommendationSet​(Data data,
                                                                          java.util.Set<Member> recipientSet)
        Returns the List of Recommendation on given Data, where given member are recipient ordered by date desc
        Parameters:
        data - the Data
        recipientSet - the Set of Member
        Returns:
        the List of Recommendation on given Data, where given members are recipient ordered by date desc
        Since:
        jcms-8.0.0
      • getGroupMemberSet

        public java.util.Set<Member> getGroupMemberSet​(Group group)
        Returns a Set of Member which belongs to given group (Store and database)
        Parameters:
        group - the Group
        Returns:
        a Set of Member
        Since:
        jcms-9.0.3
      • getTotalRecipientCount

        public int getTotalRecipientCount​(Recommendation recommendation)
        Parameters:
        recommendation - the Recommendation
        Returns:
        the total count of recipient in given Recommendation
      • getRecommendationReaderTrackingMemberCount

        public int getRecommendationReaderTrackingMemberCount​(Recommendation recommendation)
        Parameters:
        recommendation - the Recommendation
        Returns:
        the count of ReaderTracking since the creation of given Recommendation
      • getRecommendationReaderTrackingMemberSet

        public java.util.List<ReaderTracker> getRecommendationReaderTrackingMemberSet​(Recommendation recommendation)
        Returns a List of ReaderTracker which have read the recommendation's Publication yet since the recommendation has been sent
        Parameters:
        recommendation - the Recommendation
        Returns:
        a List of ReaderTracker which have read the recommendation's Publication yet since the recommendation has been sent
        Since:
        jcms-8.0.0
      • getRecommendationGroupReaderTrackingMemberSet

        public java.util.List<ReaderTracker> getRecommendationGroupReaderTrackingMemberSet​(Recommendation recommendation,
                                                                                           Group group)
      • isGroupContainsMember

        public boolean isGroupContainsMember​(java.util.Set<Group> groupSet)
        Parameters:
        groupSet - a Set of Group
        Returns:
        true if given group set contains at least one member
      • canBeRecommended

        public boolean canBeRecommended​(Data data)
        Parameters:
        data - the Data to recommend
        Returns:
        true if given Data can be recommended
      • canBeRecommendedBy

        public boolean canBeRecommendedBy​(Data data,
                                          Member mbr)
        Parameters:
        data - the Data to recommend
        mbr - the Member which recommends
        Returns:
        true if given Data can be recommended by given Member
      • canAccessRecommendationReaderTracker

        public boolean canAccessRecommendationReaderTracker​(Recommendation reco,
                                                            Member mbr)
        Returns true if given mbr can access reader tracking of given Recommendation
        Parameters:
        reco - the Recommendation
        mbr - the Member
        Returns:
        true if given mbr can access reader tracking of given Recommendation
        Since:
        jcms-9.0.1
      • canBeReadBy

        public boolean canBeReadBy​(Recommendation recommendation,
                                   Member mbr)
        Returns true if given Member can read the given Recommendation data
        Parameters:
        recommendation - the Recommendation
        mbr - the Member
        Returns:
        true if given Member can read the given Recommendation data
        Since:
        jcms-8.0.1
      • isRecommendationEnabled

        public boolean isRecommendationEnabled()
        Returns:
        true if the property "recommendation.enabled.boolean" is set to true
        Since:
        jcms-8.0.0
      • getMaxRecipientReaderTracking

        public int getMaxRecipientReaderTracking()
        Property to define the max result of recipient which allow display of recommendation reader tracking. The max parameter for a "in" query in :
        • SQLServer : 2000.
        • Oracle 10 : 900
        Returns:
        the max size for "recommendation.readertracker.max-recipient"
        Since:
        jcms-8.0.3
      • isDataTracked

        public boolean isDataTracked​(Recommendation recommendation)
        Parameters:
        recommendation - the Recommendation
        Returns:
        true if given recommendation data is Reader Tracked
      • deleteAllRecommendation

        public void deleteAllRecommendation​(Data data)
        Deletes all the recommendation attached to the given Data.
        Parameters:
        data - the Data
        Since:
        jcms-8.0.0
      • printRecommendationLinkStart

        public void printRecommendationLinkStart​(java.lang.StringBuilder sb,
                                                 Data data,
                                                 java.lang.String css,
                                                 java.lang.String userLang,
                                                 java.lang.String title)
        Prints the start of the link for Recommendation
        Parameters:
        sb - the StringBuilder
        data - the Data
        css - optional classname to use in the link
        userLang - the user language
        title - the title
        Since:
        jcms-8.0.0
      • getAddRecommendationLink

        public java.lang.String getAddRecommendationLink​(Data data,
                                                         java.lang.String css,
                                                         java.lang.String body,
                                                         java.lang.String userLang,
                                                         java.lang.String title)
        Returns the link to add a recommendation on a data
        Parameters:
        data - the Data
        css - optional classname to use in the link
        body - the content in the link
        userLang - the user language
        title - the title of the link
        Returns:
        the link to add a recommendation on a data
      • printAddRecommendationLinkEnd

        public void printAddRecommendationLinkEnd​(java.lang.StringBuilder sb)
        Deprecated.
        Prints the end of the link for Recommendation
        Parameters:
        sb - the StringBuilder