public abstract class AbstractBasePublicationTree extends Object implements PublicationTree
Modifier and Type | Field and 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 and Description |
---|
AbstractBasePublicationTree() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
accept(PublishedDocument publishedDocument) |
boolean |
canManagePublishing(PublishedDocument publishedDocument)
Returns
true if the current user can manage the publishing of the given publishedDocument, ie approve or
reject the document. |
boolean |
canPublishTo(PublicationNode publicationNode)
Returns
true if the current user can publish to the specified publicationNode, false otherwise. |
boolean |
canUnpublish(PublishedDocument publishedDocument)
Returns
true 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) |
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)
Returns
true if the given documentModel 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 given
documentModel . |
PublishedDocument |
wrapToPublishedDocument(DocumentModel documentModel) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExistingPublishedDocument, getNodeByPath, release, unpublish, unpublish
public static final String ROOT_PATH_KEY
public static final String ICON_EXPANDED_KEY
public static final String ICON_COLLAPSED_KEY
public static final String TITLE_KEY
protected PublicationNode rootNode
protected PublishedDocumentFactory factory
protected CoreSession coreSession
protected String configName
protected String iconCollapsed
protected String iconExpanded
public AbstractBasePublicationTree()
protected abstract String getDefaultRootPath()
protected abstract PublishedDocumentFactory getDefaultFactory()
public void initTree(CoreSession coreSession, Map<String,String> parameters, PublishedDocumentFactory factory, String configName, String title)
initTree
in interface PublicationTree
public String getConfigName()
getConfigName
in interface PublicationTree
public String getNodeType()
getNodeType
in interface PublicationNode
public String getType()
getType
in interface PublicationNode
public String getTreeType()
getTreeType
in interface PublicationTree
public String getTreeTitle()
getTreeTitle
in interface PublicationTree
public List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node)
getPublishedDocumentInNode
in interface PublicationTree
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode)
publish
in interface PublicationTree
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode, Map<String,String> params)
publish
in interface PublicationTree
public String getTitle()
getTitle
in interface PublicationNode
public String getName()
getName
in interface PublicationNode
public PublicationTree getTree()
getTree
in interface PublicationNode
public PublicationNode getParent()
getParent
in interface PublicationNode
public List<PublicationNode> getChildrenNodes()
getChildrenNodes
in interface PublicationNode
public List<PublishedDocument> getChildrenDocuments()
getChildrenDocuments
in interface PublicationNode
public String getPath()
getPath
in interface PublicationNode
public void setCurrentDocument(DocumentModel currentDocument)
PublicationTree
Can be useful for some implementations that need to know on which document the user is.
setCurrentDocument
in interface PublicationTree
currentDocument
- the current documentpublic String getIconExpanded()
getIconExpanded
in interface PublicationTree
public String getIconCollapsed()
getIconCollapsed
in interface PublicationTree
public void validatorPublishDocument(PublishedDocument publishedDocument, String comment)
PublicationTree
validatorPublishDocument
in interface PublicationTree
publishedDocument
- the current published document that will be approvedpublic void validatorRejectPublication(PublishedDocument publishedDocument, String comment)
PublicationTree
validatorRejectPublication
in interface PublicationTree
publishedDocument
- the currently published document that will be rejectedpublic boolean canPublishTo(PublicationNode publicationNode)
PublicationTree
true
if the current user can publish to the specified publicationNode, false
otherwise.canPublishTo
in interface PublicationTree
true
if the current user can publish to the specified publicationNode, false
otherwise.public boolean canUnpublish(PublishedDocument publishedDocument)
PublicationTree
true
if the current user can unpublish the given publishedDocument, false
otherwise.canUnpublish
in interface PublicationTree
true
if the current user can unpublish the given publishedDocument, false
otherwise.public boolean hasValidationTask(PublishedDocument publishedDocument)
hasValidationTask
in interface PublicationTree
public boolean canManagePublishing(PublishedDocument publishedDocument)
PublicationTree
true
if the current user can manage the publishing of the given publishedDocument, ie approve or
reject the document.canManagePublishing
in interface PublicationTree
public PublishedDocument wrapToPublishedDocument(DocumentModel documentModel)
wrapToPublishedDocument
in interface PublicationTree
public boolean isPublicationNode(DocumentModel documentModel)
PublicationTree
true
if the given documentModel
is a PublicationNode of the current tree, false
otherwise.isPublicationNode
in interface PublicationTree
public PublicationNode wrapToPublicationNode(DocumentModel documentModel)
PublicationTree
documentModel
.wrapToPublicationNode
in interface PublicationTree
protected abstract boolean accept(PublishedDocument publishedDocument)
Copyright © 2018 Nuxeo. All rights reserved.