Class PublishingService
java.lang.Object
fr.paris.lutece.plugins.document.service.publishing.PublishingService
@ApplicationScoped
@Named("document.PublishingService")
public class PublishingService
extends Object
Publishing service
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassign(int nDocumentId, int nPortletId) AssignDocumentto aPortletvoidchangeDocumentOrder(int nDocumentId, int nPortletId, int nNewOrder) Change theDocumentorder in aPortletgetAssignedDocumentsByPortletId(int nPortletId) Returns aCollectionofDocumentobjects from aPortletidentifierDocumentcan be assigned or published.getDocumentPublication(int nPortletId, int nDocumentId) getFirstValidPublishedDocument(int nPortletId) Get the first valid document published in a portlet or null if there are nonestatic PublishingServiceDeprecated, for removal: This API element is subject to removal in a future version.intgetMaxDocumentOrderByPortletId(int nPortletId) Get the max document order from aPortletidCollection<fr.paris.lutece.portal.business.portlet.Portlet>getPortletsByDocumentId(String strDocumentId) Loads the list of the portlets whoes contain Document specified by idgetPublishedDocumentsByPortletId(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 portletgetPublishedDocumentsSinceDate(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.Collection<fr.paris.lutece.portal.business.portlet.Portlet>Loads the list of portlets who contain published documentsvoidinitializedService(jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext.booleanisAssigned(int nDocumentId) Check if the specifiedDocumentis assigned (unpublished or published) into at least onePortletbooleanisAssigned(int nDocumentId, int nPortletId) Check if the specifiedDocumentis assigned (unpublished or published) into the specifiedPortletbooleanisPublished(int nDocumentId) Check if the specifiedDocumentis published into the specifiedPortletbooleanisPublished(int nDocumentId, int nPortletId) Check if the specifiedDocumentis published into the specifiedPortletvoidpublish(int nDocumentId, int nPortletId) Publishing documents assigned to a portlet at the begin of the listvoidunAssign(int nDocumentId, int nPortletId) unAssignDocumentto aPortletvoidunPublish(int nDocumentId, int nPortletId) UnPublishing documents assigned to a portlet
-
Constructor Details
-
PublishingService
public PublishingService()Creates a new instance of PublishingService
-
-
Method Details
-
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.Use@Injectto obtain thePublishingServiceinstance. This method will be removed in future versions.Returns the unique instance of thePublishingServiceservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain thePublishingServiceinstance instead.- Returns:
- The unique instance of
PublishingService.
-
assign
public void assign(int nDocumentId, int nPortletId) AssignDocumentto aPortlet- Parameters:
nDocumentId- TheDocumentidentifiernPortletId- ThePortletidentifier
-
publish
public void publish(int nDocumentId, int nPortletId) Publishing documents assigned to a portlet at the begin of the list- Parameters:
nDocumentId- the Document idnPortletId- the portlet identifier
-
unPublish
public void unPublish(int nDocumentId, int nPortletId) UnPublishing documents assigned to a portlet- Parameters:
nDocumentId- the DocumentListPortlet identifiernPortletId- the portlet identifier
-
unAssign
public void unAssign(int nDocumentId, int nPortletId) unAssignDocumentto aPortlet- Parameters:
nDocumentId- TheDocumentidentifiernPortletId- ThePortletidentifier
-
changeDocumentOrder
public void changeDocumentOrder(int nDocumentId, int nPortletId, int nNewOrder) Change theDocumentorder in aPortlet- Parameters:
nDocumentId- theDocumentidentifiernPortletId- thePortletidentifiernNewOrder- The new place in the list
-
isPublished
public boolean isPublished(int nDocumentId, int nPortletId) Check if the specifiedDocumentis published into the specifiedPortlet -
isPublished
public boolean isPublished(int nDocumentId) Check if the specifiedDocumentis published into the specifiedPortlet -
isAssigned
public boolean isAssigned(int nDocumentId) Check if the specifiedDocumentis assigned (unpublished or published) into at least onePortlet -
isAssigned
public boolean isAssigned(int nDocumentId, int nPortletId) Check if the specifiedDocumentis assigned (unpublished or published) into the specifiedPortlet -
getDocumentPublication
- Parameters:
nPortletId- thePortletidentifiernDocumentId- theDocumentidentifier- Returns:
- a
DocumentPublicationor null if no object match
-
getAssignedDocumentsByPortletId
Returns aCollectionofDocumentobjects from aPortletidentifierDocumentcan be assigned or published.- Parameters:
nPortletId- thePortletidentifier- Returns:
- a
CollectionofDocumentobjects
-
getPublishedDocumentsByPortletId
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
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 datedocumentFilter- 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
Collectionof the portlets
-
getPublishedPortlets
Loads the list of portlets who contain published documents- Returns:
- the
Collectionof the portlets
-
getMaxDocumentOrderByPortletId
public int getMaxDocumentOrderByPortletId(int nPortletId) Get the max document order from aPortletid- Parameters:
nPortletId- thePortletidentifer- Returns:
- The max document order
-
initializedService
public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext. It ensures that this CDI beans are instantiated at the application startup.This method is triggered automatically by CDI when the
ApplicationScopedcontext is initialized, which typically occurs during the startup of the application server.- Parameters:
context- theServletContextthat is initialized. This parameter is observed and injected automatically by CDI when theApplicationScopedcontext is initialized.
-
@Injectto obtain thePublishingServiceinstance.