Class AbstractBasePublicationTree
- java.lang.Object
-
- org.nuxeo.ecm.platform.publisher.api.AbstractBasePublicationTree
-
- All Implemented Interfaces:
Serializable
,PublicationNode
,PublicationTree
- Direct Known Subclasses:
SectionPublicationTree
public abstract class AbstractBasePublicationTree extends Object implements PublicationTree
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
configName
protected CoreSession
coreSession
protected PublishedDocumentFactory
factory
static String
ICON_COLLAPSED_KEY
static String
ICON_EXPANDED_KEY
protected String
iconCollapsed
protected String
iconExpanded
static String
ROOT_PATH_KEY
protected PublicationNode
rootNode
protected String
rootPath
static String
TITLE_KEY
protected String
treeTitle
-
Constructor Summary
Constructors Constructor Description AbstractBasePublicationTree()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
accept(PublishedDocument publishedDocument)
boolean
canManagePublishing(PublishedDocument publishedDocument)
Returnstrue
if the current user can manage the publishing of the given publishedDocument, ie approve or reject the document.boolean
canPublishTo(PublicationNode publicationNode)
Returnstrue
if the current user can publish to the specified publicationNode,false
otherwise.boolean
canUnpublish(PublishedDocument publishedDocument)
Returnstrue
if the current user can unpublish the given publishedDocument,false
otherwise.List<PublishedDocument>
getChildrenDocuments()
List<PublicationNode>
getChildrenNodes()
String
getConfigName()
protected abstract PublishedDocumentFactory
getDefaultFactory()
protected abstract String
getDefaultRootPath()
String
getIconCollapsed()
String
getIconExpanded()
String
getName()
String
getNodeType()
PublicationNode
getParent()
String
getPath()
List<PublishedDocument>
getPublishedDocumentInNode(PublicationNode node)
List<PublishedDocument>
getPublishedDocumentsFor(String docId)
Returns only the published documents for the givendoc
.String
getTitle()
PublicationTree
getTree()
String
getTreeTitle()
String
getTreeType()
String
getType()
boolean
hasValidationTask(PublishedDocument publishedDocument)
void
initTree(CoreSession coreSession, Map<String,String> parameters, PublishedDocumentFactory factory, String configName, String title)
boolean
isPublicationNode(DocumentModel documentModel)
Returnstrue
if the givendocumentModel
is a PublicationNode of the current tree,false
otherwise.PublishedDocument
publish(DocumentModel doc, PublicationNode targetNode)
PublishedDocument
publish(DocumentModel doc, PublicationNode targetNode, Map<String,String> params)
void
setCurrentDocument(DocumentModel currentDocument)
Sets the current document on which the tree will be based, if needed.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.PublicationNode
wrapToPublicationNode(DocumentModel documentModel)
Returns a PublicationNode for the current tree built on the givendocumentModel
.PublishedDocument
wrapToPublishedDocument(DocumentModel documentModel)
-
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.PublicationTree
getExistingPublishedDocument, getNodeByPath, release, unpublish, unpublish
-
-
-
-
Field Detail
-
ROOT_PATH_KEY
public static final String ROOT_PATH_KEY
- See Also:
- Constant Field Values
-
ICON_EXPANDED_KEY
public static final String ICON_EXPANDED_KEY
- See Also:
- Constant Field Values
-
ICON_COLLAPSED_KEY
public static final String ICON_COLLAPSED_KEY
- See Also:
- Constant Field Values
-
TITLE_KEY
public static final String TITLE_KEY
- See Also:
- Constant Field Values
-
rootNode
protected PublicationNode rootNode
-
factory
protected PublishedDocumentFactory factory
-
coreSession
protected CoreSession coreSession
-
configName
protected String configName
-
rootPath
protected String rootPath
-
treeTitle
protected String treeTitle
-
iconCollapsed
protected String iconCollapsed
-
iconExpanded
protected String iconExpanded
-
-
Method Detail
-
getDefaultRootPath
protected abstract String getDefaultRootPath()
-
getDefaultFactory
protected abstract PublishedDocumentFactory getDefaultFactory()
-
initTree
public void initTree(CoreSession coreSession, Map<String,String> parameters, PublishedDocumentFactory factory, String configName, String title)
- Specified by:
initTree
in interfacePublicationTree
-
getConfigName
public String getConfigName()
- Specified by:
getConfigName
in interfacePublicationTree
-
getNodeType
public String getNodeType()
- Specified by:
getNodeType
in interfacePublicationNode
-
getType
public String getType()
- Specified by:
getType
in interfacePublicationNode
-
getTreeType
public String getTreeType()
- Specified by:
getTreeType
in interfacePublicationTree
-
getTreeTitle
public String getTreeTitle()
- Specified by:
getTreeTitle
in interfacePublicationTree
-
getPublishedDocumentInNode
public List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node)
- Specified by:
getPublishedDocumentInNode
in interfacePublicationTree
-
getPublishedDocumentsFor
public List<PublishedDocument> getPublishedDocumentsFor(String docId)
Description copied from interface:PublicationNode
Returns only the published documents for the givendoc
.- Specified by:
getPublishedDocumentsFor
in interfacePublicationNode
-
publish
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode)
- Specified by:
publish
in interfacePublicationTree
-
publish
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode, Map<String,String> params)
- Specified by:
publish
in interfacePublicationTree
-
getTitle
public String getTitle()
- Specified by:
getTitle
in interfacePublicationNode
-
getName
public String getName()
- Specified by:
getName
in interfacePublicationNode
-
getTree
public PublicationTree getTree()
- Specified by:
getTree
in interfacePublicationNode
-
getParent
public PublicationNode getParent()
- Specified by:
getParent
in interfacePublicationNode
-
getChildrenNodes
public List<PublicationNode> getChildrenNodes()
- Specified by:
getChildrenNodes
in interfacePublicationNode
-
getChildrenDocuments
public List<PublishedDocument> getChildrenDocuments()
- Specified by:
getChildrenDocuments
in interfacePublicationNode
-
getPath
public String getPath()
- Specified by:
getPath
in interfacePublicationNode
-
setCurrentDocument
public void setCurrentDocument(DocumentModel currentDocument)
Description copied from interface:PublicationTree
Sets the current document on which the tree will be based, if needed.Can be useful for some implementations that need to know on which document the user is.
- Specified by:
setCurrentDocument
in interfacePublicationTree
- Parameters:
currentDocument
- the current document
-
getIconExpanded
public String getIconExpanded()
- Specified by:
getIconExpanded
in interfacePublicationTree
-
getIconCollapsed
public String getIconCollapsed()
- Specified by:
getIconCollapsed
in interfacePublicationTree
-
validatorPublishDocument
public void validatorPublishDocument(PublishedDocument publishedDocument, String comment)
Description copied from interface:PublicationTree
A validator (the current user) approves the publication.- Specified by:
validatorPublishDocument
in interfacePublicationTree
- Parameters:
publishedDocument
- the current published document that will be approved
-
validatorRejectPublication
public void validatorRejectPublication(PublishedDocument publishedDocument, String comment)
Description copied from interface:PublicationTree
A validator (the current user) rejects the publication.- Specified by:
validatorRejectPublication
in interfacePublicationTree
- Parameters:
publishedDocument
- the currently published document that will be rejected
-
canPublishTo
public boolean canPublishTo(PublicationNode publicationNode)
Description copied from interface:PublicationTree
Returnstrue
if the current user can publish to the specified publicationNode,false
otherwise.- Specified by:
canPublishTo
in interfacePublicationTree
- Returns:
true
if the current user can publish to the specified publicationNode,false
otherwise.
-
canUnpublish
public boolean canUnpublish(PublishedDocument publishedDocument)
Description copied from interface:PublicationTree
Returnstrue
if the current user can unpublish the given publishedDocument,false
otherwise.- Specified by:
canUnpublish
in interfacePublicationTree
- Returns:
true
if the current user can unpublish the given publishedDocument,false
otherwise.
-
hasValidationTask
public boolean hasValidationTask(PublishedDocument publishedDocument)
- Specified by:
hasValidationTask
in interfacePublicationTree
-
canManagePublishing
public boolean canManagePublishing(PublishedDocument publishedDocument)
Description copied from interface:PublicationTree
Returnstrue
if the current user can manage the publishing of the given publishedDocument, ie approve or reject the document.- Specified by:
canManagePublishing
in interfacePublicationTree
-
wrapToPublishedDocument
public PublishedDocument wrapToPublishedDocument(DocumentModel documentModel)
- Specified by:
wrapToPublishedDocument
in interfacePublicationTree
-
isPublicationNode
public boolean isPublicationNode(DocumentModel documentModel)
Description copied from interface:PublicationTree
Returnstrue
if the givendocumentModel
is a PublicationNode of the current tree,false
otherwise.- Specified by:
isPublicationNode
in interfacePublicationTree
-
wrapToPublicationNode
public PublicationNode wrapToPublicationNode(DocumentModel documentModel)
Description copied from interface:PublicationTree
Returns a PublicationNode for the current tree built on the givendocumentModel
.- Specified by:
wrapToPublicationNode
in interfacePublicationTree
-
accept
protected abstract boolean accept(PublishedDocument publishedDocument)
-
-