fr.paris.lutece.plugins.whatsnew.service
Class WhatsNewService

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

public class WhatsNewService
extends Object

WhatsNewService


Constructor Summary
WhatsNewService()
           
 
Method Summary
 fr.paris.lutece.util.ReferenceList getComboDays()
          Initialize the number of days' combo
 Collection<IWhatsNew> getDocumentsByCriterias(Timestamp limitTimestamp, Locale locale)
          Get the documents by criteria
static WhatsNewService getInstance()
          Return the WhatsNewService singleton
 Collection<IWhatsNew> getModeratedDocuments(int nWhatsNewPortletId, Locale locale)
          Get the moderated document from the given whatsNewPortletId
 String getModeratedElementsListHtml(WhatsNewPortlet whatsNewPortlet, Locale locale)
          Get the HTML code of the moderated elements list
 Collection<IWhatsNew> getModeratedPages(int nWhatsNewPortletId, Locale locale)
          Get the moderated pages from the given whatsNewPortletId
 Collection<IWhatsNew> getModeratedPortlets(int nWhatsNewPortletId, Locale locale)
          Get the moderated portlets from the given whatsNewPortletId
 Collection<IWhatsNew> getPagesByCriterias(Timestamp limitTimestamp, Locale locale)
          Get the pages by criteria
 Collection<IWhatsNew> getPortletsByCriterias(Timestamp limitTimestamp, Locale locale)
          Get the portlets by criteria
 Timestamp getTimestampFromPeriodAndCurrentDate(int nDays, Locale locale)
          Get the timestamp correspnding to a given day in the past.
 List<WhatsNewType> getWhatsNewType(Locale locale)
          Get the list of WhatsNewType
 void init()
          Init
 boolean isDocumentOutOfDate(PortletDocumentLink pdLink, Timestamp limitTimestamp, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if the given document is out of date
 boolean isPageOutOfDate(int nPageId, Timestamp limitTimestamp)
          Check if the given page is out of date
 boolean isPluginDocumentActivated()
          Check if the plugin-document is activated and its pool is not null
 boolean isPortletOutOfDate(int nPortletId, Timestamp limitTimestamp)
          Check if the given portlet is out of date
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WhatsNewService

public WhatsNewService()
Method Detail

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


Copyright © 2013 Mairie de Paris. All Rights Reserved.