Class RssManager


  • public class RssManager
    extends java.lang.Object
    RSS manager
    Since:
    JCMS 6.3
    Author:
    Ludovic SMADJA
    • Field Detail

      • PUBLICATION_DATE

        public static java.lang.String PUBLICATION_DATE
    • Method Detail

      • getInstance

        public static RssManager getInstance()
      • addDefaultListeners

        public void addDefaultListeners​(java.util.Set<RssEventListener> listeners)
        Add RssEventListener set to existing listeners
        Parameters:
        listeners - the set
      • getRssTrackerListener

        public RssEventListener getRssTrackerListener()
        Get Rss tracker listener
      • processRssTrackingEvent

        public void processRssTrackingEvent​(Member currentLoggedMember,
                                            java.lang.String channelSource,
                                            java.lang.String itemId,
                                            boolean articleRead)
        Process tracking event
        Parameters:
        currentLoggedMember - the current Member
        channelSource - the channel source
        itemId - the item id
      • isRead

        public RssTracker isRead​(Member member,
                                 java.lang.String channelSource,
                                 java.lang.String itemId,
                                 java.util.Set<RssTracker> trackersSet)
        Indicates if a rss is already read
        Parameters:
        member - the current Member
        channelSource - the channel source
        itemId - the item id
        trackersSet - Set of existing RssTracker
        Returns:
        the RssTracker instance if exists, null otherwise
      • cleanRssTracker

        public void cleanRssTracker​(Member member,
                                    java.lang.String channelSource,
                                    java.util.List<java.lang.String> itemIdList)
        Clean rssTracker table
        Parameters:
        member - the Member object
        channelSource - the channel source
        itemIdList - List of item id to clean
      • getSortItemList

        public static java.util.List<RssItem> getSortItemList​(java.util.List<RssItem> itemList,
                                                              java.lang.String sortAttribute)
        generated a sorted List of the provided List. RssItem are sort by attribute (null, publicationDate)
        Parameters:
        itemList - the List of RssItem to sort
        sortAttribute - the sort attribute (null for no sort, available element is publicationDate)
        Returns:
        the sorted List if any sort should be done (in this case, the list is cloned)