Class PublishingService

java.lang.Object
fr.paris.lutece.plugins.blog.service.PublishingService

public class PublishingService extends Object
Publishing service
  • Constructor Details

    • PublishingService

      public PublishingService()
  • Method Details

    • getInstance

      public static PublishingService getInstance()
      Get the unique instance of the service
      Returns:
      The unique instance
    • assign

      public void assign(int nBlogId, int nPortletId)
      Assign Blog to a Portlet
      Parameters:
      nBlogId - The Blog identifier
      nPortletId - The Portlet identifier
    • publish

      public void publish(int nBlogId, int nPortletId)
      Publishing blogs assigned to a portlet at the begin of the list
      Parameters:
      nBlogId - the Blog id
      nPortletId - the portlet identifier
    • unAssign

      public void unAssign(int nBlogId, int nPortletId)
      unAssign Blog to a Portlet
      Parameters:
      nBlogId - The Blog identifier
      nPortletId - The Portlet identifier
    • isPublished

      public boolean isPublished(int nBlogId, int nPortletId)
      Check if the specified Blog is published into the specified Portlet
      Parameters:
      nBlogId - The Blog identifier
      nPortletId - The Portlet identifier
      Returns:
      True if Blog is published, false else (unpublished or not assigned)
    • isAssigned

      public boolean isAssigned(int nBlogId)
      Check if the specified Blog is assigned (unpublished or published) into at least one Portlet
      Parameters:
      nBlogId - The Blog identifier
      Returns:
      True if Blog is assigned (published or unpublished), false else (not assigned)
    • isAssigned

      public boolean isAssigned(int nBlogId, int nPortletId)
      Check if the specified Blog is assigned (unpublished or published) into the specified Portlet
      Parameters:
      nBlogId - The Blog identifier
      nPortletId - The Portlet identifier
      Returns:
      True if Blog is assigned (published or unpublished), false else (not assigned)
    • getBlogPublication

      public BlogPublication getBlogPublication(int nPortletId, int nBlogId)
      Return a BlogPublication from a Portlet identifier and Blog identifier
      Parameters:
      nPortletId - the Portlet identifier
      nBlogId - the Blog identifier
      Returns:
      a BlogPublication or null if no object match
    • getBlogsPortlets

      public Collection<fr.paris.lutece.portal.business.portlet.Portlet> getBlogsPortlets()
      Loads the list of portlets
      Returns:
      the Collection of the portlets
    • getBlogsPortletstoPublish

      public Collection<fr.paris.lutece.portal.business.portlet.Portlet> getBlogsPortletstoPublish()
      Loads the list of portlets blogs empty and blogslist
      Returns:
      the Collection of the portlets
    • getPortletsByBlogId

      public Collection<fr.paris.lutece.portal.business.portlet.Portlet> getPortletsByBlogId(String strBlogId)
      Loads the list of the portlets whoes contain blog specified by id
      Parameters:
      strBlogId - the blog identifier
      Returns:
      the Collection of the portlets
    • getPublishedBlogsSinceDate

      public Collection<Blog> getPublishedBlogsSinceDate(Date datePublishing, Date dateEndPublishing, BlogFilter blogFilter, Locale locale)
      Loads the list of the blog whose filter and date publication is specified Return published blogs since the publication date. The is also filtered with the blogFilter
      Parameters:
      datePublishing - The start publication date
      dateEndPublishing - The end publication date
      blogFilter - The filter for the published blog. The filter can be null or empty. The array of Ids will not be taked in account.
      locale - The locale is used to get the list of blogs with the findByFilter method
      Returns:
      the list of the blog in form of a List. return null if datePublishing is null
    • getPublishedBlogsIdsListByPortletIds

      public static List<Integer> getPublishedBlogsIdsListByPortletIds(int[] nPortletsIds, Date datePublishing, Date dateEndPublishing, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of id of published blogs associated with a given collection of portlets.
      Parameters:
      nPortletsIds - The list of portlet ids.
      datePublishing - The publishing date
      dateEndPublishing - The publishing end date
      plugin - The blog plugin
      Returns:
      The list of blogs id.
    • getLastPublishedBlogsIdsListByPortletIds

      public static List<Integer> getLastPublishedBlogsIdsListByPortletIds(int[] nPortletsIds, Date dateUpdated, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of id of published Blogs, associated with a given collection of porlets, which has been updated since the dateUpdated
      Parameters:
      nPortletsIds - The list of portlet ids.
      dateUpdated - The date from the blogs had to be updated
      plugin - The plugin
      Returns:
      The list of Blogs id.