Class WhatsNewService

java.lang.Object
fr.paris.lutece.plugins.whatsnew.service.WhatsNewService

public class WhatsNewService extends Object
WhatsNewService
  • Constructor Details

    • WhatsNewService

      public WhatsNewService()
  • Method Details

    • getInstance

      public static WhatsNewService getInstance()
      Return the WhatsNewService singleton
      Returns:
      the WhatsNewService singleton
    • init

      public void init()
      Init
    • isPluginDocumentActivated

      public boolean isPluginDocumentActivated()
      Check if the plugin-document is activated and its pool is not null
      Returns:
      true if the plugin-document is activated, false otherwise
    • isPageOutOfDate

      public boolean isPageOutOfDate(int nPageId, Timestamp limitTimestamp)
      Check if the given page is out of date
      Parameters:
      nPageId - the page ID
      limitTimestamp - the date limit
      Returns:
      true if it is out of date, false otherwise
    • isPortletOutOfDate

      public boolean isPortletOutOfDate(int nPortletId, Timestamp limitTimestamp)
      Check if the given portlet is out of date
      Parameters:
      nPortletId - the portlet ID
      limitTimestamp - the date limit
      Returns:
      true if it is out of date, false otherwise
    • isDocumentOutOfDate

      public boolean isDocumentOutOfDate(PortletDocumentLink pdLink, Timestamp limitTimestamp, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Check if the given document is out of date
      Parameters:
      pdLink - PortletDocumentLink
      limitTimestamp - the date limit
      plugin - Plugin
      Returns:
      true if it is out of date, false otherwise
    • getComboDays

      public fr.paris.lutece.util.ReferenceList getComboDays()
      Initialize the number of days' combo
      Returns:
      the html code of the combo
    • getWhatsNewType

      public List<WhatsNewType> getWhatsNewType(Locale locale)
      Get the list of WhatsNewType
      Parameters:
      locale - Locale
      Returns:
      a list of WhatsNewType
    • getTimestampFromPeriodAndCurrentDate

      public Timestamp getTimestampFromPeriodAndCurrentDate(int nDays, Locale locale)
      Get the timestamp correspnding to a given day in the past. It is calculated from a period to remove from the current date.
      Parameters:
      nDays - the number of days between the current day and the timestamp to calculate.
      locale - Locale
      Returns:
      the timestamp corresponding to the limit in the past for the period given in days, with hours, minutesn sec. and millisec. set to 0.
    • getPagesByCriterias

      public Collection<IWhatsNew> getPagesByCriterias(Timestamp limitTimestamp, Locale locale)
      Get the pages by criteria
      Parameters:
      limitTimestamp - the limit time
      locale - Locale
      Returns:
      a collection of IWhatsNew
    • getPortletsByCriterias

      public Collection<IWhatsNew> getPortletsByCriterias(Timestamp limitTimestamp, Locale locale)
      Get the portlets by criteria
      Parameters:
      limitTimestamp - the limit time
      locale - Locale
      Returns:
      a collection of IWhatsNew
    • getDocumentsByCriterias

      public Collection<IWhatsNew> getDocumentsByCriterias(Timestamp limitTimestamp, Locale locale)
      Get the documents by criteria
      Parameters:
      limitTimestamp - the limit time
      locale - Locale
      Returns:
      a collection of IWhatsNew
    • getModeratedPortlets

      public Collection<IWhatsNew> getModeratedPortlets(int nWhatsNewPortletId, Locale locale)
      Get the moderated portlets from the given whatsNewPortletId
      Parameters:
      nWhatsNewPortletId - the ID of the portlet
      locale - Locale
      Returns:
      a collection of IWhatsNew
    • getModeratedPages

      public Collection<IWhatsNew> getModeratedPages(int nWhatsNewPortletId, Locale locale)
      Get the moderated pages from the given whatsNewPortletId
      Parameters:
      nWhatsNewPortletId - the ID of the page
      locale - Locale
      Returns:
      a collection of IWhatsNew
    • getModeratedDocuments

      public Collection<IWhatsNew> getModeratedDocuments(int nWhatsNewPortletId, Locale locale)
      Get the moderated document from the given whatsNewPortletId
      Parameters:
      nWhatsNewPortletId - the ID of the portlet
      locale - Locale
      Returns:
      a collection of IWhatsNew
    • getModeratedElementsListHtml

      public String getModeratedElementsListHtml(WhatsNewPortlet whatsNewPortlet, Locale locale)
      Get the HTML code of the moderated elements list
      Parameters:
      whatsNewPortlet - the portlet
      locale - Locale
      Returns:
      a HTML code