Package com.jalios.jcms.recommendation
Class RecommendationManager
- java.lang.Object
-
- com.jalios.jcms.recommendation.RecommendationManager
-
- All Implemented Interfaces:
DBConstants
,JPropertiesListener
public class RecommendationManager extends java.lang.Object implements DBConstants, JPropertiesListener
This class gives Utils to handle Recommendation- Since:
- jcms-8.0.0
- Author:
- Kevin Bransard
-
-
Field Summary
-
Fields inherited from interface com.jalios.jcms.db.DBConstants
ALL_CATEGORIES_SET_FIELD, ATTACH_WS_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, CLASSIFICATION_LEVEL_FIELD, DBDATA_URID, EXTENDED_READ_RIGHTS, HAS_ATTACH_WS_FIELD, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HAS_ATTACH_WS, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAININSTANCE_ID, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MERGE_DATE, HIBERNATE_MAPPING_MERGE_ID, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_OPAUTHOR, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READ_ACK, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_RESTRICTIVE_UPDATE_RIGHTS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_TRACKED, HIBERNATE_MAPPING_UDATE, HIBERNATE_MAPPING_VOTECOUNT, HIBERNATE_MAPPING_VOTESCORE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MAX_HIBERNATE_MAPPING_PUBLICATION, MDATE_FIELD, OPAUTHOR_ID_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canAccessRecommendationReaderTracker(Recommendation reco, Member mbr)
Returns true if given mbr can access reader tracking of givenRecommendation
boolean
canBeReadBy(Recommendation recommendation, Member mbr)
Returns true if given Member can read the given Recommendation databoolean
canBeRecommended(Data data)
boolean
canBeRecommendedBy(Data data, Member mbr)
void
deleteAllRecommendation(Data data)
Deletes all the recommendation attached to the given Data.java.lang.String
getAddRecommendationLink(Data data, java.lang.String css, java.lang.String body, java.lang.String userLang, java.lang.String title)
Deprecated.since jcms-10.0.8 : useShareManager.getShareLink(Data, String, String, String, String)
java.lang.String
getAlertName(Data data)
Returns the alert name for a given data, in order to override the default alert name for Recommendationjava.util.Set<Member>
getGroupMemberSet(Group group)
Returns a Set ofMember
which belongs to given group (Store and database)static RecommendationManager
getInstance()
int
getMaxRecipientReaderTracking()
Property to define the max result of recipient which allow display of recommendation reader tracking.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 Recommendationint
getReceivedRecommendationCount(Data data, Member mbr)
Returns the count of Recommendation on given Data that given Member has received ordered by date descint
getReceivedRecommendationCount(Member mbr)
Returns the count of Recommendation where given member is a recipient ordered by date descjava.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 descjava.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 descjava.util.Set<Recommendation>
getReceivedRecommendationSet(Member mbr)
Returns the List of Recommendation where given member is a recipient ordered by date descint
getRecommendationCount(Data data)
Returns the count Recommendation for given Datajava.util.List<ReaderTracker>
getRecommendationGroupReaderTrackingMemberSet(Recommendation recommendation, Group group)
java.util.List<Recommendation>
getRecommendationList(Data data)
Returns the List of Recommendation for given Data ordered by date descint
getRecommendationReaderTrackingMemberCount(Recommendation recommendation)
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 sentint
getSentRecommendationCount(Data data, Member mbr)
Returns the count of Recommendation on given Data the given Member has madeint
getSentRecommendationCount(Member mbr)
Returns the count of Recommendation for given Memberjava.util.List<Recommendation>
getSentRecommendationList(Data data, Member mbr)
Returns the List of Recommendation on given Data the given Member has sent ordered by date descjava.util.List<Recommendation>
getSentRecommendationList(Member mbr)
Returns the List of Recommendation for given Member ordered by date descint
getTotalRecipientCount(Recommendation recommendation)
boolean
isDataTracked(Recommendation recommendation)
boolean
isGroupContainsMember(java.util.Set<Group> groupSet)
boolean
isRecommendationEnabled()
boolean
isRecommendationReaderTrackerAnonymized()
void
printAddRecommendationLinkEnd(java.lang.StringBuilder sb)
Deprecated.since jcms-10.0.8 : useShareManager.printShareLinkEnd(StringBuilder)
void
printRecommendationLinkStart(java.lang.StringBuilder sb, Data data, java.lang.String css, java.lang.String userLang, java.lang.String title)
Deprecated.since jcms-10.0.8 : useShareManager.printShareLinkStart(StringBuilder, Data, String, String, String)
void
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.void
sendRecommendation(Recommendation recommendation, boolean isAuthorRecipient)
Sends the given recommendation
-
-
-
Method Detail
-
getInstance
public static RecommendationManager getInstance()
-
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
orchannel.getProperty
.- Specified by:
propertiesChange
in interfaceJPropertiesListener
- 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 toorecommendation
- 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
- theData
- 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
- theData
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
- theData
- 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
- theData
- 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
- theMember
- 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
-
getSentRecommendationList
public java.util.List<Recommendation> getSentRecommendationList(Member mbr)
Returns the List of Recommendation for given Member ordered by date desc- Parameters:
mbr
- theMember
- 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
-
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
-
getReceivedRecommendationCount
public int getReceivedRecommendationCount(Member mbr)
Returns the count of Recommendation where given member is a recipient ordered by date desc- Parameters:
mbr
- theMember
- 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
- theMember
- 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
-
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
-
getGroupMemberSet
public java.util.Set<Member> getGroupMemberSet(Group group)
Returns a Set ofMember
which belongs to given group (Store and database)
-
getTotalRecipientCount
public int getTotalRecipientCount(Recommendation recommendation)
- Parameters:
recommendation
- theRecommendation
- Returns:
- the total count of recipient in given Recommendation
-
getRecommendationReaderTrackingMemberCount
public int getRecommendationReaderTrackingMemberCount(Recommendation recommendation)
- Parameters:
recommendation
- theRecommendation
- 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
- theRecommendation
- 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 ofGroup
- Returns:
- true if given group set contains at least one member
-
canBeRecommended
public boolean canBeRecommended(Data data)
- Parameters:
data
- theData
to recommend- Returns:
- true if given Data can be recommended
-
canAccessRecommendationReaderTracker
public boolean canAccessRecommendationReaderTracker(Recommendation reco, Member mbr)
Returns true if given mbr can access reader tracking of givenRecommendation
- Parameters:
reco
- theRecommendation
mbr
- theMember
- 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
- theRecommendation
mbr
- theMember
- 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
-
isRecommendationReaderTrackerAnonymized
public boolean isRecommendationReaderTrackerAnonymized()
- Returns:
- true if the property "recommendation.readertracker.anonymize.enabled.boolean" is set to true
- Since:
- jcms-10.0.6
-
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
- theRecommendation
- 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
- theData
- 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)
Deprecated.since jcms-10.0.8 : useShareManager.printShareLinkStart(StringBuilder, Data, String, String, String)
Prints the start of the link for Recommendation- Parameters:
sb
- theStringBuilder
data
- theData
css
- optional classname to use in the linkuserLang
- the user languagetitle
- 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)
Deprecated.since jcms-10.0.8 : useShareManager.getShareLink(Data, String, String, String, String)
Returns the link to add a recommendation on a data- Parameters:
data
- theData
css
- optional classname to use in the linkbody
- the content in the linkuserLang
- the user languagetitle
- the title of the link- Returns:
- the link to add a recommendation on a data
-
printAddRecommendationLinkEnd
public void printAddRecommendationLinkEnd(java.lang.StringBuilder sb)
Deprecated.since jcms-10.0.8 : useShareManager.printShareLinkEnd(StringBuilder)
Prints the end of the link for Recommendation- Parameters:
sb
- the StringBuilder
-
-