Class PublishingService

java.lang.Object
fr.paris.lutece.plugins.document.service.publishing.PublishingService

public class PublishingService extends Object
Publishing service
  • Method Details

    • getInstance

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

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

      public void publish(int nDocumentId, int nPortletId)
      Publishing documents assigned to a portlet at the begin of the list
      Parameters:
      nDocumentId - the Document id
      nPortletId - the portlet identifier
    • unPublish

      public void unPublish(int nDocumentId, int nPortletId)
      UnPublishing documents assigned to a portlet
      Parameters:
      nDocumentId - the DocumentListPortlet identifier
      nPortletId - the portlet identifier
    • unAssign

      public void unAssign(int nDocumentId, int nPortletId)
      unAssign Document to a Portlet
      Parameters:
      nDocumentId - The Document identifier
      nPortletId - The Portlet identifier
    • changeDocumentOrder

      public void changeDocumentOrder(int nDocumentId, int nPortletId, int nNewOrder)
      Change the Document order in a Portlet
      Parameters:
      nDocumentId - the Document identifier
      nPortletId - the Portlet identifier
      nNewOrder - The new place in the list
    • isPublished

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

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

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

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

      public DocumentPublication getDocumentPublication(int nPortletId, int nDocumentId)
      Return a DocumentPublication from a Portlet identifier and Document identifier
      Parameters:
      nPortletId - the Portlet identifier
      nDocumentId - the Document identifier
      Returns:
      a DocumentPublication or null if no object match
    • getAssignedDocumentsByPortletId

      public Collection<Document> getAssignedDocumentsByPortletId(int nPortletId)
      Returns a Collection of Document objects from a Portlet identifier Document can be assigned or published.
      Parameters:
      nPortletId - the Portlet identifier
      Returns:
      a Collection of Document objects
    • getPublishedDocumentsByPortletId

      public Collection<Document> getPublishedDocumentsByPortletId(int nPortletId)
      Loads the list of the documents whose type is the same as the one specified in parameter Return published documents from a specified portlet
      Parameters:
      nPortletId - the portlet identifier
      Returns:
      the list of the document in form of a List
    • getFirstValidPublishedDocument

      public Document getFirstValidPublishedDocument(int nPortletId)
      Get the first valid document published in a portlet or null if there are none
      Parameters:
      nPortletId - the portlet identifier
      Returns:
      The document
    • getPublishedDocumentsSinceDate

      public Collection<Document> getPublishedDocumentsSinceDate(Date datePublishing, DocumentFilter documentFilter, Locale locale)
      Loads the list of the documents whose filter and date publication is specified Return published documents since the publication date. The is also filtered with the documentFilter
      Parameters:
      datePublishing - The start publication date
      documentFilter - The filter for the published documents. 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 documents with the findByFilter method
      Returns:
      the list of the document in form of a List. return null if datePublishing is null
    • getPortletsByDocumentId

      public Collection<fr.paris.lutece.portal.business.portlet.Portlet> getPortletsByDocumentId(String strDocumentId)
      Loads the list of the portlets whoes contain Document specified by id
      Parameters:
      strDocumentId - the document identifier
      Returns:
      the Collection of the portlets
    • getPublishedPortlets

      public Collection<fr.paris.lutece.portal.business.portlet.Portlet> getPublishedPortlets()
      Loads the list of portlets who contain published documents
      Returns:
      the Collection of the portlets
    • getMaxDocumentOrderByPortletId

      public int getMaxDocumentOrderByPortletId(int nPortletId)
      Get the max document order from a Portlet id
      Parameters:
      nPortletId - the Portlet identifer
      Returns:
      The max document order