public abstract class AbstractRemotableTree extends Object implements PublicationTree
PublicationTree
that delegates method calls to a remote service.Modifier and Type | Field and Description |
---|---|
protected String |
configName |
protected boolean |
released |
protected String |
sessionId |
protected RemotePublicationTreeManager |
treeService |
Constructor and Description |
---|
AbstractRemotableTree() |
Modifier and Type | Method and Description |
---|---|
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. |
String |
getConfigName() |
List<PublishedDocument> |
getExistingPublishedDocument(DocumentLocation docLoc) |
PublicationNode |
getNodeByPath(String path) |
PublicationNode |
getParent() |
List<PublishedDocument> |
getPublishedDocumentInNode(PublicationNode node) |
protected abstract String |
getServerTreeSessionId() |
protected abstract String |
getTargetTreeName() |
protected abstract RemotePublicationTreeManager |
getTreeService() |
boolean |
hasValidationTask(PublishedDocument publishedDocument) |
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 |
release() |
void |
setCurrentDocument(DocumentModel currentDocument)
Sets the current document on which the tree will be based, if needed.
|
protected abstract PublicationNode |
switchToClientNode(PublicationNode node) |
protected List<PublicationNode> |
switchToClientNodes(List<PublicationNode> nodes) |
protected abstract PublicationNode |
switchToServerNode(PublicationNode node) |
void |
unpublish(DocumentModel doc,
PublicationNode targetNode) |
void |
unpublish(PublishedDocument publishedDocument) |
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
getIconCollapsed, getIconExpanded, getTreeTitle, getTreeType, initTree
getChildrenDocuments, getChildrenNodes, getName, getNodeType, getPath, getSessionId, getTitle, getTreeConfigName, getType
protected RemotePublicationTreeManager treeService
protected String configName
protected boolean released
public AbstractRemotableTree()
protected abstract RemotePublicationTreeManager getTreeService()
protected abstract String getTargetTreeName()
protected abstract String getServerTreeSessionId()
public List<PublishedDocument> getExistingPublishedDocument(DocumentLocation docLoc)
getExistingPublishedDocument
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 void unpublish(DocumentModel doc, PublicationNode targetNode)
unpublish
in interface PublicationTree
public void unpublish(PublishedDocument publishedDocument)
unpublish
in interface PublicationTree
protected abstract PublicationNode switchToClientNode(PublicationNode node)
protected abstract PublicationNode switchToServerNode(PublicationNode node)
protected List<PublicationNode> switchToClientNodes(List<PublicationNode> nodes)
public PublicationNode getNodeByPath(String path)
getNodeByPath
in interface PublicationTree
public String getConfigName()
getConfigName
in interface PublicationTree
public PublicationNode getParent()
getParent
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 void release()
release
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
Copyright © 2016 Nuxeo SA. All rights reserved.