public class PublisherServiceImpl extends DefaultComponent implements PublisherService, RemotePublicationTreeManager
PublisherService
and RemotePublicationTreeManager
.Modifier and Type | Field and Description |
---|---|
static String |
FACTORY_EP |
static String |
TREE_CONFIG_EP |
static String |
TREE_EP |
static String |
VALIDATORS_RULE_EP |
DOMAIN_NAME_KEY
Constructor and Description |
---|
PublisherServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo
bundles.
|
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<String> |
getAvailablePublicationTree() |
Map<String,String> |
getAvailablePublicationTrees()
Returns a
Map with tree name as key and tree title as value. |
List<PublishedDocument> |
getChildrenDocuments(PublicationNode node) |
List<PublicationNode> |
getChildrenNodes(PublicationNode node) |
List<PublishedDocument> |
getExistingPublishedDocument(String sid,
DocumentLocation docLoc) |
static int |
getLiveTreeCount() |
PublicationNode |
getNodeByPath(String sid,
String path) |
Map<String,String> |
getParametersFor(String treeConfigName) |
PublicationNode |
getParent(PublicationNode node) |
PublicationTree |
getPublicationTree(String treeName,
CoreSession coreSession,
Map<String,String> params) |
PublicationTree |
getPublicationTree(String treeName,
CoreSession coreSession,
Map<String,String> params,
DocumentModel currentDocument) |
PublicationTree |
getPublicationTreeFor(DocumentModel doc,
CoreSession coreSession) |
List<PublishedDocument> |
getPublishedDocumentInNode(PublicationNode node) |
static PublicationTree |
getTreeBySid(String sid) |
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. |
boolean |
isPublishedDocument(DocumentModel documentModel) |
PublishedDocument |
publish(DocumentModel doc,
PublicationNode targetNode) |
PublishedDocument |
publish(DocumentModel doc,
PublicationNode targetNode,
Map<String,String> params) |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
registerTreeConfigFor(DocumentModel domain) |
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 |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unRegisterTreeConfigFor(DocumentModel domain) |
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(DocumentModel documentModel,
CoreSession coreSession) |
PublicationNode |
wrapToPublicationNode(String sid,
DocumentModel documentModel)
Returns a PublicationNode for the current tree built on the given
documentModel . |
PublishedDocument |
wrapToPublishedDocument(String sid,
DocumentModel documentModel) |
deactivate, getAdapter, registerExtension, unregisterExtension
public static final String TREE_EP
public static final String TREE_CONFIG_EP
public static final String VALIDATORS_RULE_EP
public static final String FACTORY_EP
public void applicationStarted(ComponentContext context) throws Exception
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
Exception
public void activate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic static int getLiveTreeCount()
public static PublicationTree getTreeBySid(String sid)
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution
in class DefaultComponent
Exception
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution
in class DefaultComponent
Exception
public List<String> getAvailablePublicationTree()
getAvailablePublicationTree
in interface PublisherService
public Map<String,String> getAvailablePublicationTrees()
PublisherService
Map
with tree name as key and tree title as value.getAvailablePublicationTrees
in interface PublisherService
public PublicationTree getPublicationTree(String treeName, CoreSession coreSession, Map<String,String> params) throws ClientException, PublicationTreeNotAvailable
getPublicationTree
in interface PublisherService
ClientException
PublicationTreeNotAvailable
public PublicationTree getPublicationTree(String treeName, CoreSession coreSession, Map<String,String> params, DocumentModel currentDocument) throws ClientException, PublicationTreeNotAvailable
getPublicationTree
in interface PublisherService
ClientException
PublicationTreeNotAvailable
public Map<String,String> initRemoteSession(String treeConfigName, Map<String,String> params) throws Exception
initRemoteSession
in interface RemotePublicationTreeManager
Exception
public void release(String sid)
release
in interface RemotePublicationTreeManager
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode) throws ClientException
publish
in interface PublisherService
publish
in interface RemotePublicationTreeManager
ClientException
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode, Map<String,String> params) throws ClientException
publish
in interface PublisherService
publish
in interface RemotePublicationTreeManager
ClientException
public void unpublish(DocumentModel doc, PublicationNode targetNode) throws ClientException
unpublish
in interface PublisherService
unpublish
in interface RemotePublicationTreeManager
ClientException
public void unpublish(String sid, PublishedDocument publishedDocument) throws ClientException
unpublish
in interface RemotePublicationTreeManager
ClientException
public List<PublishedDocument> getChildrenDocuments(PublicationNode node) throws ClientException
getChildrenDocuments
in interface RemotePublicationTreeManager
ClientException
public List<PublicationNode> getChildrenNodes(PublicationNode node) throws ClientException
getChildrenNodes
in interface RemotePublicationTreeManager
ClientException
public PublicationNode getParent(PublicationNode node)
getParent
in interface RemotePublicationTreeManager
public PublicationNode getNodeByPath(String sid, String path) throws ClientException
getNodeByPath
in interface RemotePublicationTreeManager
ClientException
public List<PublishedDocument> getExistingPublishedDocument(String sid, DocumentLocation docLoc) throws ClientException
getExistingPublishedDocument
in interface RemotePublicationTreeManager
ClientException
public List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node) throws ClientException
getPublishedDocumentInNode
in interface RemotePublicationTreeManager
ClientException
public void setCurrentDocument(String sid, DocumentModel currentDocument) throws ClientException
RemotePublicationTreeManager
setCurrentDocument
in interface RemotePublicationTreeManager
currentDocument
- the current documentClientException
public void validatorPublishDocument(String sid, PublishedDocument publishedDocument, String comment) throws ClientException
RemotePublicationTreeManager
validatorPublishDocument
in interface RemotePublicationTreeManager
publishedDocument
- the current published document that will be
approvedClientException
public void validatorRejectPublication(String sid, PublishedDocument publishedDocument, String comment) throws ClientException
RemotePublicationTreeManager
validatorRejectPublication
in interface RemotePublicationTreeManager
publishedDocument
- the currently published document that will be
rejectedClientException
public boolean canPublishTo(String sid, PublicationNode publicationNode) throws ClientException
RemotePublicationTreeManager
true
if the current user can publish to the specified
publicationNode, false
otherwise.canPublishTo
in interface RemotePublicationTreeManager
true
if the current user can publish to the specified
publicationNode, false
otherwise.ClientException
public boolean canUnpublish(String sid, PublishedDocument publishedDocument) throws ClientException
RemotePublicationTreeManager
true
if the current user can unpublish the given
publishedDocument, false
otherwise.canUnpublish
in interface RemotePublicationTreeManager
true
if the current user can unpublish the given
publishedDocument, false
otherwise.ClientException
public boolean canManagePublishing(String sid, PublishedDocument publishedDocument) throws ClientException
RemotePublicationTreeManager
true
if the current user can manage the publishing of the
given published document, ie. approve or reject the document.canManagePublishing
in interface RemotePublicationTreeManager
ClientException
public boolean isPublishedDocument(DocumentModel documentModel)
isPublishedDocument
in interface PublisherService
public PublicationTree getPublicationTreeFor(DocumentModel doc, CoreSession coreSession) throws ClientException
getPublicationTreeFor
in interface PublisherService
ClientException
public boolean hasValidationTask(String sid, PublishedDocument publishedDocument) throws ClientException
hasValidationTask
in interface RemotePublicationTreeManager
ClientException
public PublishedDocument wrapToPublishedDocument(String sid, DocumentModel documentModel) throws ClientException
wrapToPublishedDocument
in interface RemotePublicationTreeManager
ClientException
public boolean isPublicationNode(String sid, DocumentModel documentModel) throws ClientException
RemotePublicationTreeManager
true
if the given documentModel
is a
PublicationNode of the current tree, false
otherwise.isPublicationNode
in interface RemotePublicationTreeManager
ClientException
public PublicationNode wrapToPublicationNode(String sid, DocumentModel documentModel) throws ClientException
RemotePublicationTreeManager
documentModel
.wrapToPublicationNode
in interface RemotePublicationTreeManager
ClientException
- if the given documentModel cannot be a
PublicationNode.public PublicationNode wrapToPublicationNode(DocumentModel documentModel, CoreSession coreSession) throws ClientException, PublicationTreeNotAvailable
wrapToPublicationNode
in interface PublisherService
ClientException
PublicationTreeNotAvailable
public void registerTreeConfigFor(DocumentModel domain) throws ClientException
ClientException
public void unRegisterTreeConfigFor(DocumentModel domain)
public Map<String,String> getParametersFor(String treeConfigName)
getParametersFor
in interface PublisherService
Copyright © 2011 Nuxeo SA. All Rights Reserved.