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 CoreSession
coreSession
static String
ENABLE_SNAPSHOT
protected EventProducer
eventProducer
protected Map<String,String>
parameters
protected PublicationTree
publicationTree
static String
TARGET_PUBLISHED_DOCUMENT_STATE
protected ValidatorsRule
validatorsRule
-
Constructor Summary
Constructors Constructor Description AbstractBasePublishedDocumentFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canManagePublishing(PublishedDocument publishedDocument)
protected EventProducer
getEventProducer()
String
getName()
protected String
getParameter(String name)
protected String
getTargetPublishedDocumentState()
String[]
getValidatorsFor(DocumentModel dm)
Computes the list of publishing validators given the document model of the document just published.ValidatorsRule
getValidatorsRule()
Returns the registered section validators rule.boolean
hasValidationTask(PublishedDocument publishedDocument)
void
init(CoreSession coreSession, Map<String,String> parameters)
void
init(CoreSession coreSession, ValidatorsRule validatorsRule, Map<String,String> parameters)
protected boolean
isSnapshotingEnabled()
protected boolean
needToVersionDocument(DocumentModel doc)
protected void
notifyEvent(String eventId, Map<String,Serializable> properties, String comment, String category, DocumentModel dm, CoreSession coreSession)
protected void
notifyEvent(PublishingEvent event, DocumentModel doc, CoreSession coreSession)
PublishedDocument
publishDocument(DocumentModel doc, PublicationNode targetNode)
DocumentModel
snapshotDocumentBeforePublish(DocumentModel doc)
void
validatorPublishDocument(PublishedDocument publishedDocument, String comment)
A validator (the current user) approves the publication.void
validatorRejectPublication(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:
init
in interfacePublishedDocumentFactory
-
init
public void init(CoreSession coreSession, Map<String,String> parameters)
- Specified by:
init
in interfacePublishedDocumentFactory
-
getName
public String getName()
- Specified by:
getName
in interfacePublishedDocumentFactory
-
isSnapshotingEnabled
protected boolean isSnapshotingEnabled()
-
getTargetPublishedDocumentState
protected String getTargetPublishedDocumentState()
-
publishDocument
public PublishedDocument publishDocument(DocumentModel doc, PublicationNode targetNode)
- Specified by:
publishDocument
in interfacePublishedDocumentFactory
-
needToVersionDocument
protected boolean needToVersionDocument(DocumentModel doc)
-
snapshotDocumentBeforePublish
public DocumentModel snapshotDocumentBeforePublish(DocumentModel doc)
- Specified by:
snapshotDocumentBeforePublish
in interfacePublishedDocumentFactory
-
getValidatorsFor
public String[] getValidatorsFor(DocumentModel dm)
Description copied from interface:PublishedDocumentFactory
Computes 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:
getValidatorsFor
in 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:PublishedDocumentFactory
Returns the registered section validators rule.- Specified by:
getValidatorsRule
in interfacePublishedDocumentFactory
- Returns:
- a validators rule
-
validatorPublishDocument
public void validatorPublishDocument(PublishedDocument publishedDocument, String comment)
Description copied from interface:PublishedDocumentFactory
A validator (the current user) approves the publication.- Specified by:
validatorPublishDocument
in interfacePublishedDocumentFactory
- Parameters:
publishedDocument
- the current published document that will be approved
-
validatorRejectPublication
public void validatorRejectPublication(PublishedDocument publishedDocument, String comment)
Description copied from interface:PublishedDocumentFactory
A validator (the current user) rejects the publication.- Specified by:
validatorRejectPublication
in interfacePublishedDocumentFactory
- Parameters:
publishedDocument
- the currently published document that will be rejected
-
canManagePublishing
public boolean canManagePublishing(PublishedDocument publishedDocument)
- Specified by:
canManagePublishing
in interfacePublishedDocumentFactory
-
hasValidationTask
public boolean hasValidationTask(PublishedDocument publishedDocument)
- Specified by:
hasValidationTask
in 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()
-
-