Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.publisher.remoting.restProxies
Class RemotePublicationTreeManagerRestProxy

java.lang.Object
  extended by org.nuxeo.ecm.platform.publisher.remoting.restProxies.RemotePublicationTreeManagerRestProxy
All Implemented Interfaces:
RemotePublicationTreeManager

public class RemotePublicationTreeManagerRestProxy
extends Object
implements RemotePublicationTreeManager

HTTP facade for the RemotePublicationTreeManager service. This facade uses a invoker to do the actual calls to the remote back-end.

Author:
tiry

Constructor Summary
RemotePublicationTreeManagerRestProxy(String baseURL, String userName, String password, RemotePublisherMarshaler marshaler)
           
 
Method Summary
 boolean canManagePublishing(String sid, PublishedDocument publishedDocument)
          Returns true if the current user can manage the publishing of the given published document, ie.
 boolean canPublishTo(String sid, PublicationNode publicationNode)
          Returns true if the current user can publish to the specified publicationNode, false otherwise.
 boolean canUnpublish(String sid, PublishedDocument publishedDocument)
          Returns true if the current user can unpublish the given publishedDocument, false otherwise.
 List<PublishedDocument> getChildrenDocuments(PublicationNode node)
           
 List<PublicationNode> getChildrenNodes(PublicationNode node)
           
 List<PublishedDocument> getExistingPublishedDocument(String sid, DocumentLocation docLoc)
           
 PublicationNode getNodeByPath(String sid, String path)
           
 PublicationNode getParent(PublicationNode node)
           
 List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node)
           
 boolean hasValidationTask(String sid, PublishedDocument publishedDocument)
           
 Map<String,String> initRemoteSession(String treeConfigName, Map<String,String> params)
           
 boolean isPublicationNode(String sid, 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(String sid)
           
 void setCurrentDocument(String sid, DocumentModel currentDocument)
          Sets the current document on which the tree will be based, if needed.
 void unpublish(DocumentModel doc, PublicationNode targetNode)
           
 void unpublish(String sid, PublishedDocument publishedDocument)
           
 void validatorPublishDocument(String sid, PublishedDocument publishedDocument, String comment)
          A validator (the current user) approves the publication.
 void validatorRejectPublication(String sid, PublishedDocument publishedDocument, String comment)
          A validator (the current user) rejects the publication.
 PublicationNode wrapToPublicationNode(String sid, DocumentModel documentModel)
          Returns a PublicationNode for the current tree built on the given documentModel.
 PublishedDocument wrapToPublishedDocument(String sid, DocumentModel documentModel)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemotePublicationTreeManagerRestProxy

public RemotePublicationTreeManagerRestProxy(String baseURL,
                                             String userName,
                                             String password,
                                             RemotePublisherMarshaler marshaler)
Method Detail

getChildrenDocuments

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

getChildrenNodes

public List<PublicationNode> getChildrenNodes(PublicationNode node)
                                       throws ClientException
Specified by:
getChildrenNodes in interface RemotePublicationTreeManager
Throws:
ClientException

getExistingPublishedDocument

public List<PublishedDocument> getExistingPublishedDocument(String sid,
                                                            DocumentLocation docLoc)
                                                     throws ClientException
Specified by:
getExistingPublishedDocument in interface RemotePublicationTreeManager
Throws:
ClientException

getNodeByPath

public PublicationNode getNodeByPath(String sid,
                                     String path)
                              throws ClientException
Specified by:
getNodeByPath in interface RemotePublicationTreeManager
Throws:
ClientException

getParent

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

getPublishedDocumentInNode

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

publish

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

publish

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

unpublish

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

unpublish

public void unpublish(String sid,
                      PublishedDocument publishedDocument)
               throws ClientException
Specified by:
unpublish in interface RemotePublicationTreeManager
Throws:
ClientException

initRemoteSession

public Map<String,String> initRemoteSession(String treeConfigName,
                                            Map<String,String> params)
                                     throws Exception
Specified by:
initRemoteSession in interface RemotePublicationTreeManager
Throws:
Exception

setCurrentDocument

public void setCurrentDocument(String sid,
                               DocumentModel currentDocument)
                        throws ClientException
Description copied from interface: RemotePublicationTreeManager
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 RemotePublicationTreeManager
currentDocument - the current document
Throws:
ClientException

validatorPublishDocument

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

Specified by:
validatorPublishDocument in interface RemotePublicationTreeManager
publishedDocument - the current published document that will be approved
Throws:
PublishingException

validatorRejectPublication

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

Specified by:
validatorRejectPublication in interface RemotePublicationTreeManager
publishedDocument - the currently published document that will be rejected
Throws:
PublishingException

canPublishTo

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

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

canUnpublish

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

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

canManagePublishing

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

Specified by:
canManagePublishing in interface RemotePublicationTreeManager
Throws:
ClientException

hasValidationTask

public boolean hasValidationTask(String sid,
                                 PublishedDocument publishedDocument)
                          throws ClientException
Specified by:
hasValidationTask in interface RemotePublicationTreeManager
Throws:
ClientException

wrapToPublishedDocument

public PublishedDocument wrapToPublishedDocument(String sid,
                                                 DocumentModel documentModel)
                                          throws ClientException
Specified by:
wrapToPublishedDocument in interface RemotePublicationTreeManager
Throws:
ClientException

isPublicationNode

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

Specified by:
isPublicationNode in interface RemotePublicationTreeManager

wrapToPublicationNode

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

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

release

public void release(String sid)
Specified by:
release in interface RemotePublicationTreeManager

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.