Class AbstractBasePublishedDocumentFactory
- java.lang.Object
-
- org.nuxeo.ecm.platform.publisher.api.AbstractBasePublishedDocumentFactory
-
- All Implemented Interfaces:
PublishedDocumentFactory
- Direct Known Subclasses:
CoreProxyFactory
public abstract class AbstractBasePublishedDocumentFactory extends Object implements PublishedDocumentFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected CoreSessioncoreSessionstatic StringENABLE_SNAPSHOTprotected EventProducereventProducerprotected Map<String,String>parametersprotected PublicationTreepublicationTreestatic StringTARGET_PUBLISHED_DOCUMENT_STATEprotected ValidatorsRulevalidatorsRule
-
Constructor Summary
Constructors Constructor Description AbstractBasePublishedDocumentFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanManagePublishing(PublishedDocument publishedDocument)protected EventProducergetEventProducer()StringgetName()protected StringgetParameter(String name)protected StringgetTargetPublishedDocumentState()String[]getValidatorsFor(DocumentModel dm)Computes the list of publishing validators given the document model of the document just published.ValidatorsRulegetValidatorsRule()Returns the registered section validators rule.booleanhasValidationTask(PublishedDocument publishedDocument)voidinit(CoreSession coreSession, Map<String,String> parameters)voidinit(CoreSession coreSession, ValidatorsRule validatorsRule, Map<String,String> parameters)protected booleanisSnapshotingEnabled()protected booleanneedToVersionDocument(DocumentModel doc)protected voidnotifyEvent(String eventId, Map<String,Serializable> properties, String comment, String category, DocumentModel dm, CoreSession coreSession)protected voidnotifyEvent(PublishingEvent event, DocumentModel doc, CoreSession coreSession)PublishedDocumentpublishDocument(DocumentModel doc, PublicationNode targetNode)DocumentModelsnapshotDocumentBeforePublish(DocumentModel doc)voidvalidatorPublishDocument(PublishedDocument publishedDocument, String comment)A validator (the current user) approves the publication.voidvalidatorRejectPublication(PublishedDocument publishedDocument, String comment)A validator (the current user) rejects the publication.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.platform.publisher.api.PublishedDocumentFactory
publishDocument, wrapDocumentModel
-
-
-
-
Field Detail
-
ENABLE_SNAPSHOT
public static final String ENABLE_SNAPSHOT
- See Also:
- Constant Field Values
-
TARGET_PUBLISHED_DOCUMENT_STATE
public static final String TARGET_PUBLISHED_DOCUMENT_STATE
- See Also:
- Constant Field Values
-
coreSession
protected CoreSession coreSession
-
publicationTree
protected PublicationTree publicationTree
-
validatorsRule
protected ValidatorsRule validatorsRule
-
eventProducer
protected EventProducer eventProducer
-
-
Method Detail
-
init
public void init(CoreSession coreSession, ValidatorsRule validatorsRule, Map<String,String> parameters)
- Specified by:
initin interfacePublishedDocumentFactory
-
init
public void init(CoreSession coreSession, Map<String,String> parameters)
- Specified by:
initin interfacePublishedDocumentFactory
-
getName
public String getName()
- Specified by:
getNamein interfacePublishedDocumentFactory
-
isSnapshotingEnabled
protected boolean isSnapshotingEnabled()
-
getTargetPublishedDocumentState
protected String getTargetPublishedDocumentState()
-
publishDocument
public PublishedDocument publishDocument(DocumentModel doc, PublicationNode targetNode)
- Specified by:
publishDocumentin interfacePublishedDocumentFactory
-
needToVersionDocument
protected boolean needToVersionDocument(DocumentModel doc)
-
snapshotDocumentBeforePublish
public DocumentModel snapshotDocumentBeforePublish(DocumentModel doc)
- Specified by:
snapshotDocumentBeforePublishin interfacePublishedDocumentFactory
-
getValidatorsFor
public String[] getValidatorsFor(DocumentModel dm)
Description copied from interface:PublishedDocumentFactoryComputes the list of publishing validators given the document model of the document just published. The string can be prefixed with 'group:' or 'user:'. If there is no prefix (no : in the string) it is assumed to be a user.- Specified by:
getValidatorsForin interfacePublishedDocumentFactory- Parameters:
dm- a Nuxeo Core document model. (the document that just has been published)- Returns:
- a list of principal names.
-
getValidatorsRule
public ValidatorsRule getValidatorsRule()
Description copied from interface:PublishedDocumentFactoryReturns the registered section validators rule.- Specified by:
getValidatorsRulein interfacePublishedDocumentFactory- Returns:
- a validators rule
-
validatorPublishDocument
public void validatorPublishDocument(PublishedDocument publishedDocument, String comment)
Description copied from interface:PublishedDocumentFactoryA validator (the current user) approves the publication.- Specified by:
validatorPublishDocumentin interfacePublishedDocumentFactory- Parameters:
publishedDocument- the current published document that will be approved
-
validatorRejectPublication
public void validatorRejectPublication(PublishedDocument publishedDocument, String comment)
Description copied from interface:PublishedDocumentFactoryA validator (the current user) rejects the publication.- Specified by:
validatorRejectPublicationin interfacePublishedDocumentFactory- Parameters:
publishedDocument- the currently published document that will be rejected
-
canManagePublishing
public boolean canManagePublishing(PublishedDocument publishedDocument)
- Specified by:
canManagePublishingin interfacePublishedDocumentFactory
-
hasValidationTask
public boolean hasValidationTask(PublishedDocument publishedDocument)
- Specified by:
hasValidationTaskin interfacePublishedDocumentFactory
-
notifyEvent
protected void notifyEvent(PublishingEvent event, DocumentModel doc, CoreSession coreSession)
-
notifyEvent
protected void notifyEvent(String eventId, Map<String,Serializable> properties, String comment, String category, DocumentModel dm, CoreSession coreSession)
-
getEventProducer
protected EventProducer getEventProducer()
-
-