|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.runtime.model.DefaultComponent org.nuxeo.ecm.platform.publisher.impl.service.PublisherServiceImpl
public class PublisherServiceImpl
POJO implementation of the publisher service Implements both
PublisherService
and RemotePublicationTreeManager
.
Field Summary | |
---|---|
static java.lang.String |
FACTORY_EP
|
static java.lang.String |
TREE_CONFIG_EP
|
static java.lang.String |
TREE_EP
|
static java.lang.String |
VALIDATORS_RULE_EP
|
Fields inherited from interface org.nuxeo.ecm.platform.publisher.api.PublisherService |
---|
DOMAIN_NAME_KEY |
Constructor Summary | |
---|---|
PublisherServiceImpl()
|
Method Summary | |
---|---|
void |
activate(ComponentContext context)
Activates the component. |
boolean |
canManagePublishing(java.lang.String sid,
PublishedDocument publishedDocument)
Returns true if the current user can manage the publishing of the
given published document, ie. approve or reject the document. |
boolean |
canPublishTo(java.lang.String sid,
PublicationNode publicationNode)
Returns true if the current user can publish to the specified
publicationNode, false otherwise. |
boolean |
canUnpublish(java.lang.String sid,
PublishedDocument publishedDocument)
Returns true if the current user can unpublish the given
publishedDocument, false otherwise. |
void |
deactivate(ComponentContext context)
Deactivates the component. |
void |
frameworkEvent(org.osgi.framework.FrameworkEvent frameworkEvent)
|
java.util.List<java.lang.String> |
getAvailablePublicationTree()
|
java.util.Map<java.lang.String,java.lang.String> |
getAvailablePublicationTrees()
Returns a Map with tree name as key and tree title as value. |
java.util.List<PublishedDocument> |
getChildrenDocuments(PublicationNode node)
|
java.util.List<PublicationNode> |
getChildrenNodes(PublicationNode node)
|
java.util.List<PublishedDocument> |
getExistingPublishedDocument(java.lang.String sid,
DocumentLocation docLoc)
|
static int |
getLiveTreeCount()
|
PublicationNode |
getNodeByPath(java.lang.String sid,
java.lang.String path)
|
java.util.Map<java.lang.String,java.lang.String> |
getParametersFor(java.lang.String treeConfigName)
|
PublicationNode |
getParent(PublicationNode node)
|
PublicationTree |
getPublicationTree(java.lang.String treeName,
CoreSession coreSession,
java.util.Map<java.lang.String,java.lang.String> params)
|
PublicationTree |
getPublicationTree(java.lang.String treeName,
CoreSession coreSession,
java.util.Map<java.lang.String,java.lang.String> params,
DocumentModel currentDocument)
|
PublicationTree |
getPublicationTreeFor(DocumentModel doc,
CoreSession coreSession)
|
java.util.List<PublishedDocument> |
getPublishedDocumentInNode(PublicationNode node)
|
static PublicationTree |
getTreeBySid(java.lang.String sid)
|
boolean |
hasValidationTask(java.lang.String sid,
PublishedDocument publishedDocument)
|
java.util.Map<java.lang.String,java.lang.String> |
initRemoteSession(java.lang.String treeConfigName,
java.util.Map<java.lang.String,java.lang.String> params)
|
boolean |
isPublicationNode(java.lang.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,
java.util.Map<java.lang.String,java.lang.String> params)
|
void |
registerContribution(java.lang.Object contribution,
java.lang.String extensionPoint,
ComponentInstance contributor)
|
void |
registerTreeConfigFor(DocumentModel domain)
|
void |
release(java.lang.String sid)
|
void |
setCurrentDocument(java.lang.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(java.lang.String sid,
PublishedDocument publishedDocument)
|
void |
unregisterContribution(java.lang.Object contribution,
java.lang.String extensionPoint,
ComponentInstance contributor)
|
void |
unRegisterTreeConfigFor(DocumentModel domain)
|
void |
validatorPublishDocument(java.lang.String sid,
PublishedDocument publishedDocument,
java.lang.String comment)
A validator (the current user) approves the publication. |
void |
validatorRejectPublication(java.lang.String sid,
PublishedDocument publishedDocument,
java.lang.String comment)
A validator (the current user) rejects the publication. |
PublicationNode |
wrapToPublicationNode(DocumentModel documentModel,
CoreSession coreSession)
|
PublicationNode |
wrapToPublicationNode(java.lang.String sid,
DocumentModel documentModel)
Returns a PublicationNode for the current tree built on the given documentModel . |
PublishedDocument |
wrapToPublishedDocument(java.lang.String sid,
DocumentModel documentModel)
|
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent |
---|
getAdapter, registerExtension, unregisterExtension |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TREE_EP
public static final java.lang.String TREE_CONFIG_EP
public static final java.lang.String VALIDATORS_RULE_EP
public static final java.lang.String FACTORY_EP
Constructor Detail |
---|
public PublisherServiceImpl()
Method Detail |
---|
public void activate(ComponentContext context) throws java.lang.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 context
java.lang.Exception
- if an error occurs during activationpublic static int getLiveTreeCount()
public static PublicationTree getTreeBySid(java.lang.String sid)
public void registerContribution(java.lang.Object contribution, java.lang.String extensionPoint, ComponentInstance contributor) throws java.lang.Exception
registerContribution
in class DefaultComponent
java.lang.Exception
public void unregisterContribution(java.lang.Object contribution, java.lang.String extensionPoint, ComponentInstance contributor) throws java.lang.Exception
unregisterContribution
in class DefaultComponent
java.lang.Exception
public java.util.List<java.lang.String> getAvailablePublicationTree()
getAvailablePublicationTree
in interface PublisherService
public java.util.Map<java.lang.String,java.lang.String> getAvailablePublicationTrees()
PublisherService
Map
with tree name as key and tree title as value.
getAvailablePublicationTrees
in interface PublisherService
public PublicationTree getPublicationTree(java.lang.String treeName, CoreSession coreSession, java.util.Map<java.lang.String,java.lang.String> params) throws ClientException, PublicationTreeNotAvailable
getPublicationTree
in interface PublisherService
ClientException
PublicationTreeNotAvailable
public PublicationTree getPublicationTree(java.lang.String treeName, CoreSession coreSession, java.util.Map<java.lang.String,java.lang.String> params, DocumentModel currentDocument) throws ClientException, PublicationTreeNotAvailable
getPublicationTree
in interface PublisherService
ClientException
PublicationTreeNotAvailable
public java.util.Map<java.lang.String,java.lang.String> initRemoteSession(java.lang.String treeConfigName, java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.Exception
initRemoteSession
in interface RemotePublicationTreeManager
java.lang.Exception
public void release(java.lang.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, java.util.Map<java.lang.String,java.lang.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(java.lang.String sid, PublishedDocument publishedDocument) throws ClientException
unpublish
in interface RemotePublicationTreeManager
ClientException
public java.util.List<PublishedDocument> getChildrenDocuments(PublicationNode node) throws ClientException
getChildrenDocuments
in interface RemotePublicationTreeManager
ClientException
public java.util.List<PublicationNode> getChildrenNodes(PublicationNode node) throws ClientException
getChildrenNodes
in interface RemotePublicationTreeManager
ClientException
public PublicationNode getParent(PublicationNode node)
getParent
in interface RemotePublicationTreeManager
public PublicationNode getNodeByPath(java.lang.String sid, java.lang.String path) throws ClientException
getNodeByPath
in interface RemotePublicationTreeManager
ClientException
public java.util.List<PublishedDocument> getExistingPublishedDocument(java.lang.String sid, DocumentLocation docLoc) throws ClientException
getExistingPublishedDocument
in interface RemotePublicationTreeManager
ClientException
public java.util.List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node) throws ClientException
getPublishedDocumentInNode
in interface RemotePublicationTreeManager
ClientException
public void setCurrentDocument(java.lang.String sid, DocumentModel currentDocument) throws ClientException
RemotePublicationTreeManager
setCurrentDocument
in interface RemotePublicationTreeManager
currentDocument
- the current document
ClientException
public void validatorPublishDocument(java.lang.String sid, PublishedDocument publishedDocument, java.lang.String comment) throws ClientException
RemotePublicationTreeManager
validatorPublishDocument
in interface RemotePublicationTreeManager
publishedDocument
- the current published document that will be
approved
ClientException
public void validatorRejectPublication(java.lang.String sid, PublishedDocument publishedDocument, java.lang.String comment) throws ClientException
RemotePublicationTreeManager
validatorRejectPublication
in interface RemotePublicationTreeManager
publishedDocument
- the currently published document that will be
rejected
ClientException
public boolean canPublishTo(java.lang.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(java.lang.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(java.lang.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(java.lang.String sid, PublishedDocument publishedDocument) throws ClientException
hasValidationTask
in interface RemotePublicationTreeManager
ClientException
public PublishedDocument wrapToPublishedDocument(java.lang.String sid, DocumentModel documentModel) throws ClientException
wrapToPublishedDocument
in interface RemotePublicationTreeManager
ClientException
public boolean isPublicationNode(java.lang.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(java.lang.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 deactivate(ComponentContext context) throws java.lang.Exception
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime context
java.lang.Exception
- if an error occurs during activationpublic void frameworkEvent(org.osgi.framework.FrameworkEvent frameworkEvent)
frameworkEvent
in interface org.osgi.framework.FrameworkListener
public void registerTreeConfigFor(DocumentModel domain) throws ClientException
ClientException
public void unRegisterTreeConfigFor(DocumentModel domain)
public java.util.Map<java.lang.String,java.lang.String> getParametersFor(java.lang.String treeConfigName)
getParametersFor
in interface PublisherService
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |