Class ReaderTrackerManager
- All Implemented Interfaces:
DBConstants,DBListener,PluginComponent,JaliosConstants,JPropertiesListener
- Author:
- bransard
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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_FIELDFields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR -
Method Summary
Modifier and TypeMethodDescriptionvoidackRead(Publication pub, Member mbr) Confirm the read of the given publication by the given member.voidReports all the accesses of the given member as anonymous accesses.booleancanAccessReaderTracker(Publication pub, Member mbr) booleanReturns true if the given member can access reader tracking.booleancanDeleteReaderTracker(Publication pub, Member mbr) intReturns the sum of access count for the given publication.intgetAccessCount(List<ReaderTracker> list) Returns the sum of access count for the list of ReaderTracker.intintintintintintgetAuthorSet(Set<ReaderTracker> readerTrackerSet) Get the authors set of given ReaderTracker set.intReturns the download count for the given publication for authentified users.static ReaderTrackerManagergetMergedReaderTrackerSet(Publication pub, ReaderTrackerEntry.Sort Sort, boolean isReverse) getMergedReaderTrackerSet(Collection<ReaderTracker> readerTrackers, ReaderTrackerEntry.Sort Sort, boolean isReverse) Returns a Set ofReaderTrackerEntrywhich merges aReaderTrackerList to avoid duplicatesgetMergedReaderTrackerSet(List<ReaderTracker> readerTrackerList, ReaderTrackerEntry.Sort Sort, boolean isReverse) Returns a Set ofReaderTrackerEntrywhich merges aReaderTrackerList to avoid duplicatesintReturns the count of member who confirm the reading of the given publication.intintReturns the reader count for the given publication.getReaderTracker(Publication pub, Member mbr) Returns the ReaderTracker for the given Publication and the given Member.getReaderTracker(Publication pub, Member mbr, int accessType) Returns the ReaderTracker for the given Publication and the given Member.Returns the reader list for the given publication.getReaderTrackerList(Publication pub, int accessType) getReaderTrackerList(Publication pub, String orderBy, boolean reverse, int accessType) booleanhasBeenAckBy(Publication pub, Member mbr) Returns true if the given member has confirmed the reading of the given publication.booleanhasBeenRead(Publication pub) voidInvalidate all the cache entries.voidInvalidate the cache entries for the given publicationbooleanisPerformTrack(Browser browser) Returns true if track must be performed for current visitor.booleanisReadAckAllowed(Class clazz) Returns true if reading confirmation is allowed for the given class.booleanisReader(Publication pub, Member mbr) Returns true if the given publication has been read by the given member.booleanbooleanbooleanReturns true if workers of a Workspace can access the reader tracking of all of the publications of their WorkspacebooleanisTracked(Publication pub) booleanisTypeReaderTracked(Class<?> clazz) Returns true if the given class is reader trackedvoidonPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime) This method is called after a DBData has been deleted.voidonPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime) This method is called after a DBData has been created.voidonPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime) This method is called after a DBData has been updated.voidpropertiesChange(JProperties properties) Invoked after properties have been modified in JCMS and save on disk.voidremoveAllReaderTracker(Member mbr, boolean anonymize) Removes all the ReaderTracekr bound to the given member ; and optionally report all the access of this member as anonymous access.voidRemoves all the ReaderTracker bound to the given publication.voidtrack(Publication pub, Member mbr) Tracks the given member for the given publication.voidtrack(Publication pub, Member mbr, int accessType) Tracks the given member for the given publication and for given access Type.Methods inherited from class com.jalios.jcms.db.BasicDBListener
getAdateFromState, getAuthorIdFromState, getCdateFromState, getDateFromState, getEdateFromState, getMdateFromState, getPdateFromState, getPrePstatus, getPrePstatus, getPstatusFromState, hasNoChange, hasNoChange, init, onPreUpdate
-
Field Details
-
READER_TRACKER_ANONYMIZE_PROP
- See Also:
-
READER_TRACKER_TYPES_PROP
- See Also:
-
READER_TRACKER_TYPESOFF_PROP
- See Also:
-
READER_TRACKER_ENABLED_PROP
- See Also:
-
READER_TRACKER_WORKER_ACCESS_ENABLED_PROP
- See Also:
-
READER_TRACKER_READ_ACK_TYPES
- See Also:
-
READER_TRACKER_CAN_ACCESS_TRACKING_ACL
- See Also:
-
-
Method Details
-
getInstance
-
propertiesChange
Description copied from interface:JPropertiesListenerInvoked 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.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change- Since:
- jcms-8.0.0
-
isReaderTrackerEnabled
public boolean isReaderTrackerEnabled()- Returns:
- true if the property "readertracker.enabled.boolean" is set to true
- Since:
- jcms-8.0.0
-
isReaderTrackerWorkerAccessEnabled
public boolean isReaderTrackerWorkerAccessEnabled()Returns true if workers of a Workspace can access the reader tracking of all of the publications of their Workspace- Returns:
- true if the property "readertracker.worker.access.enabled.boolean" is set to true
- Since:
- jcms-9.0.1
-
isReaderTrackerAnonymized
public boolean isReaderTrackerAnonymized()- Returns:
- true if the property "readertracker.anonymize.boolean" is set to true
- Since:
- jcms-8.0.0
-
isTypeReaderTracked
Returns true if the given class is reader tracked- Parameters:
clazz- the class to check- Returns:
- boolean true if the given class is compatible
-
isTracked
- Parameters:
pub- thePublication- Returns:
- true if given Publication is tracked and reader tracker is enabled
- Since:
- jcms-8.0.0
-
hasBeenRead
- Parameters:
pub- thePublication- Returns:
- true if given publication has been read or downloaded
- Since:
- jcms-8.0.4 & jcms-9.0.2
-
getReaderCount
Returns the reader count for the given publication.- Parameters:
pub- the publication- Returns:
- the reader count for the given publication.
- Since:
- jcms-6.0.0
-
getReaderAccessCount
- Parameters:
pub- thePublication- Returns:
- count of access for the given Publication
- Since:
- jcms-8.0.0
-
getAuthentifiedReaderUniqueAccessCount
- Parameters:
pub- thePublication- Returns:
- the count of unique authentified users who have read the given Publication
- Since:
- jcms-8.0.0
-
getAuthentifiedReaderAccessCount
- Parameters:
pub- thePublication- Returns:
- the count of authentified users who have read the given Publication
- Since:
- jcms-8.0.0
-
getAnonymousReaderAccessCount
- Parameters:
pub- thePublication- Returns:
- the count of anonymous users who have accessed the given Publication
- Since:
- jcms-8.0.0
-
getReaderTrackerList
Returns the reader list for the given publication.- Parameters:
pub- the publication- Returns:
- the reader list for the given publication.
- Since:
- jcms-6.0.0
-
getReaderTrackerList
- Parameters:
pub- thePublicationaccessType- the type of access (Read vs download)- Returns:
- the list of ReaderTracker for given access type
- Since:
- jcms-8.0.0
-
getReaderTrackerList
public List<ReaderTracker> getReaderTrackerList(Publication pub, String orderBy, boolean reverse, int accessType) - Parameters:
pub- thePublicationorderBy- the orderby of the queryreverse- to defines the order of the queryaccessType- the type of access- Returns:
- the list of ReaderTracker for given access type and for given parameters
- Since:
- jcms-8.0.0
-
getMergedReaderTrackerSet
public Set<ReaderTrackerEntry> getMergedReaderTrackerSet(Publication pub, ReaderTrackerEntry.Sort Sort, boolean isReverse) - Parameters:
pub- the trackedPublicationSort- theReaderTrackerEntry.Sortof the queryisReverse- true to sort results reversed- Returns:
- a List of
ReaderTrackerEntrywhich merges aReaderTrackerList to avoid duplicates - Since:
- jcms-8.0.0
-
getMergedReaderTrackerSet
public Set<ReaderTrackerEntry> getMergedReaderTrackerSet(List<ReaderTracker> readerTrackerList, ReaderTrackerEntry.Sort Sort, boolean isReverse) Returns a Set ofReaderTrackerEntrywhich merges aReaderTrackerList to avoid duplicates- Parameters:
readerTrackerList- collection ofReaderTrackerSort- theReaderTrackerEntry.Sortof the queryisReverse- true to sort results reversed- Returns:
- a List of
ReaderTrackerEntrywhich merges aReaderTrackerList to avoid duplicates - Since:
- jcms-8.0.0
-
getMergedReaderTrackerSet
public Set<ReaderTrackerEntry> getMergedReaderTrackerSet(Collection<ReaderTracker> readerTrackers, ReaderTrackerEntry.Sort Sort, boolean isReverse) Returns a Set ofReaderTrackerEntrywhich merges aReaderTrackerList to avoid duplicates- Parameters:
readerTrackers- collection ofReaderTrackerSort- theReaderTrackerEntry.Sortof the queryisReverse- true to sort results reversed- Returns:
- a List of
ReaderTrackerEntrywhich merges aReaderTrackerList to avoid duplicates - Since:
- jcms-10.0.6
-
getReaderTracker
Returns the ReaderTracker for the given Publication and the given Member.- Parameters:
pub- the publicationmbr- the member- Returns:
- the ReaderTracker for the given Publication and the given Member.
- Since:
- jcms-6.0.0
-
getReaderTracker
Returns the ReaderTracker for the given Publication and the given Member.- Parameters:
pub- the publicationmbr- the memberaccessType- the type of access (read vs download)- Returns:
- the ReaderTracker for the given Publication and the given Member.
- Since:
- jcms-6.0.0
-
getDownloadCount
Returns the download count for the given publication for authentified users.- Parameters:
pub- the publication- Returns:
- the download count for the given publication for authentified users..
- Since:
- jcms-8.0.0
-
getAuthentifiedReaderUniqueDownloadCount
- Parameters:
pub- thePublication- Returns:
- the count of unique authentified reader who has downloaded the file document
- Since:
- jcms-8.0.0
-
getAuthentifiedReaderDownloadCount
- Parameters:
pub- thePublication- Returns:
- the total count of authenfied reader who has downloaded the file document
- Since:
- jcms-8.0.0
-
getAnonymousReaderDownloadCount
- Parameters:
pub- thePublication- Returns:
- the count of anonymous reader who has downloaded the file document
- Since:
- jcms-8.0.0
-
getAccessCount
Returns the sum of access count for the given publication.- Parameters:
pub- the publication.- Returns:
- the sum of access count for the given publication.
- Since:
- jcms-6.0.0
-
getAccessCount
Returns the sum of access count for the list of ReaderTracker.- Parameters:
list- a list of ReaderTracker- Returns:
- the sum of access count for the list of ReaderTracker.
- Since:
- jcms-6.0.0
-
isReader
Returns true if the given publication has been read by the given member.- Parameters:
pub- the publicationmbr- the member- Returns:
- true if the given publication has been read by the given member.
- Since:
- jcms-6.0.0
-
hasBeenAckBy
Returns true if the given member has confirmed the reading of the given publication.- Parameters:
pub- the publicationmbr- the member- Returns:
- if the given member has confirmed the reading of the given publication.
- Since:
- jcms-10.0.5
-
getReadAckCount
Returns the count of member who confirm the reading of the given publication.- Parameters:
pub- the publication- Returns:
- the count of member who confirm the reading of the given publication.
- Since:
- jcms-10.0.5
-
isReadAckAllowed
Returns true if reading confirmation is allowed for the given class.- Parameters:
clazz- the class- Returns:
- true if reading confirmation is allowed for the given class.
- Since:
- jcms-10.0.5
-
isPerformTrack
Returns true if track must be performed for current visitor. If the visitor is a robot, the reader tracking is not saved.- Parameters:
browser- the browser of the user- Returns:
- true if track must be performed for current visitor
- Since:
- jcms-8.0.3 & jcms-9.0.2
- See Also:
-
track
Tracks the given member for the given publication.- Parameters:
pub- the publicationmbr- the reader to be tracked (may be null)- Since:
- jcms-6.0.0
-
track
Tracks the given member for the given publication and for given access Type.- Parameters:
pub- the publicationmbr- the reader to be tracked (may be null)accessType- the type of access- Since:
- jcms-8.0.0
-
removeAllReaderTracker
Removes all the ReaderTracker bound to the given publication.- Parameters:
pub- the publication- Since:
- jcms-6.0.0
-
removeAllReaderTracker
Removes all the ReaderTracekr bound to the given member ; and optionally report all the access of this member as anonymous access.- Parameters:
mbr- the memberanonymize- if true report all the access of this member as anonymous access.- Since:
- jcms-6.0.0
-
anonymizeAllReaderTracker
Reports all the accesses of the given member as anonymous accesses.Access counts are first aggregated by publication and access type, then each anonymous ReaderTracker is created or incremented once, in the current transaction.
The increment must not be performed in a dedicated transaction (as done by
incrementAccess()for web accesses): an anonymous ReaderTracker created earlier in the current (not yet committed) transaction would be locked by this transaction, and the dedicated transaction would wait for this lock until the database lock wait timeout expires.- Parameters:
mbr- the member whose accesses must be anonymized
-
ackRead
Confirm the read of the given publication by the given member.- Parameters:
pub- the publicationmbr- the member- Since:
- jcms-10.0.5
-
canAccessReaderTracking
Returns true if the given member can access reader tracking.Access is granted if reader tracking is enable, and given member is global admin, or if check access and exists ACL test succeeds for
READER_TRACKER_CAN_ACCESS_TRACKING_ACL.- Parameters:
mbr- the member- Returns:
- true if the given member can access reader tracking.
- Since:
- jcms-10.0.6
- See Also:
-
canAccessReaderTracker
- Parameters:
pub- thePublicationmbr- theMember- Returns:
- true if given Member can access reader tracker list on given Publication
- Since:
- jcms-8.0.0
-
canDeleteReaderTracker
- Parameters:
pub- thePublicationmbr- theMember- Returns:
- true if given Member can delete reader tracker list on given Publication
- Since:
- jcms-8.0.0
-
invalidateCacheEntry
Invalidate the cache entries for the given publication- Parameters:
pub- the publication id- Since:
- jcms-6.1.2
-
invalidateAllCacheEntries
public void invalidateAllCacheEntries()Invalidate all the cache entries.- Since:
- jcms-6.1.2
-
onPostInsert
Description copied from interface:DBListenerThis method is called after a DBData has been created.- Specified by:
onPostInsertin interfaceDBListener- Overrides:
onPostInsertin classBasicDBListener- Parameters:
data- the data.event- the event.firstTime- true on the JSync replica on which the operation took place and false on the other replicas.- See Also:
-
onPostUpdate
Description copied from interface:DBListenerThis method is called after a DBData has been updated.- Specified by:
onPostUpdatein interfaceDBListener- Overrides:
onPostUpdatein classBasicDBListener- Parameters:
data- the data.event- the event.firstTime- true on the JSync replica on which the operation took place and false on the other replicas.- See Also:
-
onPostDelete
Description copied from interface:DBListenerThis method is called after a DBData has been deleted.- Specified by:
onPostDeletein interfaceDBListener- Overrides:
onPostDeletein classBasicDBListener- Parameters:
data- the deleted DBData. WARNING! In a JSync Cluster, when firstTime is false, this data will be null. In this case, to get information about this deleted data, you must use the event and in particular event.getId(), which returns the JPlatform ID of the data, and event.getDeletedState() which returns the attributes of the data.event- the eventfirstTime- true on the JSync replica on which the operation took place and false on the other replicas.- See Also:
-
getAuthorSet
Get the authors set of given ReaderTracker set.- Parameters:
readerTrackerSet- the tracker set to get corresponding unique readers- Returns:
- unique Members set
- Since:
- jcms-10.0.6
-