Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.publisher.api
Class AbstractBasePublicationTree

java.lang.Object
  extended by org.nuxeo.ecm.platform.publisher.api.AbstractBasePublicationTree
All Implemented Interfaces:
Serializable, PublicationNode, PublicationTree
Direct Known Subclasses:
LocalFSPublicationTree, SectionPublicationTree

public abstract class AbstractBasePublicationTree
extends Object
implements PublicationTree

See Also:
Serialized Form

Field Summary
static String ICON_COLLAPSED_KEY
           
static String ICON_EXPANDED_KEY
           
static String ROOT_PATH_KEY
           
static String TITLE_KEY
           
 
Constructor Summary
AbstractBasePublicationTree()
           
 
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.
 List<PublishedDocument> getChildrenDocuments()
           
 List<PublicationNode> getChildrenNodes()
           
 String getConfigName()
           
 String getIconCollapsed()
           
 String getIconExpanded()
           
 String getName()
           
 String getNodeType()
           
 PublicationNode getParent()
           
 String getPath()
           
 List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node)
           
 String getSessionId()
           
 String getTitle()
           
 String getTreeConfigName()
           
 String getTreeTitle()
           
 String getTreeType()
           
 String getType()
           
 boolean hasValidationTask(PublishedDocument publishedDocument)
           
 void initTree(String sid, 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)
           
 
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
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
Constructor Detail

AbstractBasePublicationTree

public AbstractBasePublicationTree()
Method Detail

initTree

public void initTree(String sid,
                     CoreSession coreSession,
                     Map<String,String> parameters,
                     PublishedDocumentFactory factory,
                     String configName,
                     String title)
              throws ClientException
Specified by:
initTree in interface PublicationTree
Throws:
ClientException

getConfigName

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

getSessionId

public String getSessionId()
Specified by:
getSessionId in interface PublicationNode

getNodeType

public String getNodeType()
Specified by:
getNodeType in interface PublicationNode

getType

public String getType()
Specified by:
getType in interface PublicationNode

getTreeType

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

getTreeTitle

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

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

getTitle

public String getTitle()
                throws ClientException
Specified by:
getTitle in interface PublicationNode
Throws:
ClientException

getName

public String getName()
               throws ClientException
Specified by:
getName in interface PublicationNode
Throws:
ClientException

getTreeConfigName

public String getTreeConfigName()
Specified by:
getTreeConfigName in interface PublicationNode

getParent

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

getChildrenNodes

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

getChildrenDocuments

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

getPath

public String getPath()
Specified by:
getPath in interface PublicationNode

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 interface PublicationTree
Parameters:
currentDocument - the current document

getIconExpanded

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

getIconCollapsed

public String getIconCollapsed()
Specified by:
getIconCollapsed 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.