Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.publisher.impl.service
Class AbstractRemotableTree

java.lang.Object
  extended by org.nuxeo.ecm.platform.publisher.impl.service.AbstractRemotableTree
All Implemented Interfaces:
Serializable, PublicationNode, PublicationTree
Direct Known Subclasses:
ClientRemotePublicationTree, ProxyTree

public abstract class AbstractRemotableTree
extends Object
implements PublicationTree

Abstract class for PublicationTree that delegates method calls to a remote service.

Author:
tiry
See Also:
Serialized Form

Constructor Summary
AbstractRemotableTree()
           
 
Method Summary
 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)
           
 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.
 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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nuxeo.ecm.platform.publisher.api.PublicationTree
getIconCollapsed, getIconExpanded, getTreeTitle, getTreeType, initTree
 
Methods inherited from interface org.nuxeo.ecm.platform.publisher.api.PublicationNode
getChildrenDocuments, getChildrenNodes, getName, getNodeType, getPath, getSessionId, getTitle, getTreeConfigName, getType
 

Constructor Detail

AbstractRemotableTree

public AbstractRemotableTree()
Method Detail

getExistingPublishedDocument

public List<PublishedDocument> getExistingPublishedDocument(DocumentLocation docLoc)
                                                     throws ClientException
Specified by:
getExistingPublishedDocument in interface PublicationTree
Throws:
ClientException

getPublishedDocumentInNode

public List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node)
                                                   throws ClientException
Specified by:
getPublishedDocumentInNode in interface PublicationTree
Throws:
ClientException

publish

public PublishedDocument publish(DocumentModel doc,
                                 PublicationNode targetNode)
                          throws ClientException
Specified by:
publish in interface PublicationTree
Throws:
ClientException

publish

public PublishedDocument publish(DocumentModel doc,
                                 PublicationNode targetNode,
                                 Map<String,String> params)
                          throws ClientException
Specified by:
publish in interface PublicationTree
Throws:
ClientException

unpublish

public void unpublish(DocumentModel doc,
                      PublicationNode targetNode)
               throws ClientException
Specified by:
unpublish in interface PublicationTree
Throws:
ClientException

unpublish

public void unpublish(PublishedDocument publishedDocument)
               throws ClientException
Specified by:
unpublish in interface PublicationTree
Throws:
ClientException

getNodeByPath

public PublicationNode getNodeByPath(String path)
                              throws ClientException
Specified by:
getNodeByPath in interface PublicationTree
Throws:
ClientException

getConfigName

public String getConfigName()
Specified by:
getConfigName in interface PublicationTree

getParent

public PublicationNode getParent()
Specified by:
getParent in interface PublicationNode

setCurrentDocument

public void setCurrentDocument(DocumentModel currentDocument)
                        throws ClientException
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 interface PublicationTree
Parameters:
currentDocument - the current document
Throws:
ClientException

release

public void release()
Specified by:
release in interface PublicationTree

validatorPublishDocument

public void validatorPublishDocument(PublishedDocument publishedDocument,
                                     String comment)
                              throws ClientException
Description copied from interface: PublicationTree
A validator (the current user) approves the publication.

Specified by:
validatorPublishDocument in interface PublicationTree
Parameters:
publishedDocument - the current published document that will be approved
Throws:
ClientException

validatorRejectPublication

public void validatorRejectPublication(PublishedDocument publishedDocument,
                                       String comment)
                                throws ClientException
Description copied from interface: PublicationTree
A validator (the current user) rejects the publication.

Specified by:
validatorRejectPublication in interface PublicationTree
Parameters:
publishedDocument - the currently published document that will be rejected
Throws:
ClientException

canPublishTo

public boolean canPublishTo(PublicationNode publicationNode)
                     throws ClientException
Description copied from interface: PublicationTree
Returns true if the current user can publish to the specified publicationNode, false otherwise.

Specified by:
canPublishTo in interface PublicationTree
Returns:
true if the current user can publish to the specified publicationNode, false otherwise.
Throws:
ClientException

canUnpublish

public boolean canUnpublish(PublishedDocument publishedDocument)
                     throws ClientException
Description copied from interface: PublicationTree
Returns true if the current user can unpublish the given publishedDocument, false otherwise.

Specified by:
canUnpublish in interface PublicationTree
Returns:
true if the current user can unpublish the given publishedDocument, false otherwise.
Throws:
ClientException

hasValidationTask

public boolean hasValidationTask(PublishedDocument publishedDocument)
                          throws ClientException
Specified by:
hasValidationTask in interface PublicationTree
Throws:
ClientException

canManagePublishing

public boolean canManagePublishing(PublishedDocument publishedDocument)
                            throws ClientException
Description copied from interface: PublicationTree
Returns true if the current user can manage the publishing of the given publishedDocument, ie approve or reject the document.

Specified by:
canManagePublishing in interface PublicationTree
Throws:
ClientException

wrapToPublishedDocument

public PublishedDocument wrapToPublishedDocument(DocumentModel documentModel)
                                          throws ClientException
Specified by:
wrapToPublishedDocument in interface PublicationTree
Throws:
ClientException

isPublicationNode

public boolean isPublicationNode(DocumentModel documentModel)
                          throws ClientException
Description copied from interface: PublicationTree
Returns true if the given documentModel is a PublicationNode of the current tree, false otherwise.

Specified by:
isPublicationNode in interface PublicationTree
Throws:
ClientException

wrapToPublicationNode

public PublicationNode wrapToPublicationNode(DocumentModel documentModel)
                                      throws ClientException
Description copied from interface: PublicationTree
Returns a PublicationNode for the current tree built on the given documentModel.

Specified by:
wrapToPublicationNode in interface PublicationTree
Throws:
ClientException - if the given documentModel cannot be a PublicationNode

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.