Class ReaderTrackerManager

    • Field Detail

      • READER_TRACKER_ANONYMIZE_PROP

        public static final java.lang.String READER_TRACKER_ANONYMIZE_PROP
        See Also:
        Constant Field Values
      • READER_TRACKER_TYPES_PROP

        public static final java.lang.String READER_TRACKER_TYPES_PROP
        See Also:
        Constant Field Values
      • READER_TRACKER_TYPESOFF_PROP

        public static final java.lang.String READER_TRACKER_TYPESOFF_PROP
        See Also:
        Constant Field Values
      • READER_TRACKER_ENABLED_PROP

        public static final java.lang.String READER_TRACKER_ENABLED_PROP
        See Also:
        Constant Field Values
      • READER_TRACKER_WORKER_ACCESS_ENABLED_PROP

        public static final java.lang.String READER_TRACKER_WORKER_ACCESS_ENABLED_PROP
        See Also:
        Constant Field Values
      • READER_TRACKER_READ_ACK_TYPES

        public static final java.lang.String READER_TRACKER_READ_ACK_TYPES
        See Also:
        Constant Field Values
      • READER_TRACKER_CAN_ACCESS_TRACKING_ACL

        public static final java.lang.String READER_TRACKER_CAN_ACCESS_TRACKING_ACL
        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
        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

        public boolean isTypeReaderTracked​(java.lang.Class<?> clazz)
        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

        public boolean isTracked​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        true if given Publication is tracked and reader tracker is enabled
        Since:
        jcms-8.0.0
      • hasBeenRead

        public boolean hasBeenRead​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        true if given publication has been read or downloaded
        Since:
        jcms-8.0.4 & jcms-9.0.2
      • getReaderCount

        public int getReaderCount​(Publication pub)
        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

        public int getReaderAccessCount​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        count of access for the given Publication
        Since:
        jcms-8.0.0
      • getAuthentifiedReaderUniqueAccessCount

        public int getAuthentifiedReaderUniqueAccessCount​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        the count of unique authentified users who have read the given Publication
        Since:
        jcms-8.0.0
      • getAuthentifiedReaderAccessCount

        public int getAuthentifiedReaderAccessCount​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        the count of authentified users who have read the given Publication
        Since:
        jcms-8.0.0
      • getAnonymousReaderAccessCount

        public int getAnonymousReaderAccessCount​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        the count of anonymous users who have accessed the given Publication
        Since:
        jcms-8.0.0
      • getReaderTrackerList

        public java.util.List<ReaderTracker> getReaderTrackerList​(Publication pub)
        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

        public java.util.List<ReaderTracker> getReaderTrackerList​(Publication pub,
                                                                  int accessType)
        Parameters:
        pub - the Publication
        accessType - the type of access (Read vs download)
        Returns:
        the list of ReaderTracker for given access type
        Since:
        jcms-8.0.0
      • getReaderTrackerList

        public java.util.List<ReaderTracker> getReaderTrackerList​(Publication pub,
                                                                  java.lang.String orderBy,
                                                                  boolean reverse,
                                                                  int accessType)
        Parameters:
        pub - the Publication
        orderBy - the orderby of the query
        reverse - to defines the order of the query
        accessType - the type of access
        Returns:
        the list of ReaderTracker for given access type and for given parameters
        Since:
        jcms-8.0.0
      • getReaderTracker

        public ReaderTracker getReaderTracker​(Publication pub,
                                              Member mbr)
        Returns the ReaderTracker for the given Publication and the given Member.
        Parameters:
        pub - the publication
        mbr - the member
        Returns:
        the ReaderTracker for the given Publication and the given Member.
        Since:
        jcms-6.0.0
      • getReaderTracker

        public ReaderTracker getReaderTracker​(Publication pub,
                                              Member mbr,
                                              int accessType)
        Returns the ReaderTracker for the given Publication and the given Member.
        Parameters:
        pub - the publication
        mbr - the member
        accessType - the type of access (read vs download)
        Returns:
        the ReaderTracker for the given Publication and the given Member.
        Since:
        jcms-6.0.0
      • getDownloadCount

        public int getDownloadCount​(Publication pub)
        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

        public int getAuthentifiedReaderUniqueDownloadCount​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        the count of unique authentified reader who has downloaded the file document
        Since:
        jcms-8.0.0
      • getAuthentifiedReaderDownloadCount

        public int getAuthentifiedReaderDownloadCount​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        the total count of authenfied reader who has downloaded the file document
        Since:
        jcms-8.0.0
      • getAnonymousReaderDownloadCount

        public int getAnonymousReaderDownloadCount​(Publication pub)
        Parameters:
        pub - the Publication
        Returns:
        the count of anonymous reader who has downloaded the file document
        Since:
        jcms-8.0.0
      • getAccessCount

        public int getAccessCount​(Publication pub)
        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

        public int getAccessCount​(java.util.List<ReaderTracker> list)
        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

        public boolean isReader​(Publication pub,
                                Member mbr)
        Returns true if the given publication has been read by the given member.
        Parameters:
        pub - the publication
        mbr - the member
        Returns:
        true if the given publication has been read by the given member.
        Since:
        jcms-6.0.0
      • hasBeenAckBy

        public boolean hasBeenAckBy​(Publication pub,
                                    Member mbr)
        Returns true if the given member has confirmed the reading of the given publication.
        Parameters:
        pub - the publication
        mbr - the member
        Returns:
        if the given member has confirmed the reading of the given publication.
        Since:
        jcms-10.0.5
      • getReadAckCount

        public int getReadAckCount​(Publication pub)
        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

        public boolean isReadAckAllowed​(java.lang.Class clazz)
        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

        public boolean isPerformTrack​(Browser browser)
        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:
        Browser.isRobot()
      • track

        public void track​(Publication pub,
                          Member mbr)
        Tracks the given member for the given publication.
        Parameters:
        pub - the publication
        mbr - the reader to be tracked (may be null)
        Since:
        jcms-6.0.0
      • track

        public void track​(Publication pub,
                          Member mbr,
                          int accessType)
        Tracks the given member for the given publication and for given access Type.
        Parameters:
        pub - the publication
        mbr - the reader to be tracked (may be null)
        accessType - the type of access
        Since:
        jcms-8.0.0
      • removeAllReaderTracker

        public void removeAllReaderTracker​(Publication pub)
        Removes all the ReaderTracker bound to the given publication.
        Parameters:
        pub - the publication
        Since:
        jcms-6.0.0
      • removeAllReaderTracker

        public void removeAllReaderTracker​(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.
        Parameters:
        mbr - the member
        anonymize - if true report all the access of this member as anonymous access.
        Since:
        jcms-6.0.0
      • anonymizeAllReaderTracker

        public void anonymizeAllReaderTracker​(Member mbr)
      • ackRead

        public void ackRead​(Publication pub,
                            Member mbr)
        Confirm the read of the given publication by the given member.
        Parameters:
        pub - the publication
        mbr - the member
        Since:
        jcms-10.0.5
      • canAccessReaderTracker

        public boolean canAccessReaderTracker​(Publication pub,
                                              Member mbr)
        Parameters:
        pub - the Publication
        mbr - the Member
        Returns:
        true if given Member can access reader tracker list on given Publication
        Since:
        jcms-8.0.0
      • canDeleteReaderTracker

        public boolean canDeleteReaderTracker​(Publication pub,
                                              Member mbr)
        Parameters:
        pub - the Publication
        mbr - the Member
        Returns:
        true if given Member can delete reader tracker list on given Publication
        Since:
        jcms-8.0.0
      • invalidateCacheEntry

        public void invalidateCacheEntry​(Publication pub)
        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
      • onPostDelete

        public void onPostDelete​(DBData data,
                                 org.hibernate.event.PostDeleteEvent event,
                                 boolean firstTime)
        Description copied from interface: DBListener
        This method is called after a DBData has been deleted.
        Specified by:
        onPostDelete in interface DBListener
        Overrides:
        onPostDelete in class BasicDBListener
        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 event
        firstTime - true on the JSync replica on which the operation took place and false on the other replicas.
        See Also:
        DBListener.onPostDelete(DBData, PostDeleteEvent, boolean)
      • getAuthorSet

        public java.util.Set<Member> getAuthorSet​(java.util.Set<ReaderTracker> readerTrackerSet)
        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