public class PublisherServiceImpl extends DefaultComponent implements PublisherService, RemotePublicationTreeManager
PublisherService
and
RemotePublicationTreeManager
.Modifier and Type | Field and Description |
---|---|
static String |
FACTORY_EP |
protected Map<String,PublishedDocumentFactoryDescriptor> |
factoryDescriptors |
protected Map<String,PublicationTree> |
liveTrees |
protected Map<String,PublicationTreeConfigDescriptor> |
pendingDescriptors |
protected static String |
RELATIVE_ROOT_PATH_KEY |
protected Map<String,String> |
remoteLiveTrees |
protected static String |
ROOT_PATH_KEY |
static String |
ROOT_SECTION_FINDER_FACTORY_EP |
protected RootSectionFinderFactory |
rootSectionFinderFactory |
static String |
TREE_CONFIG_EP |
static String |
TREE_EP |
protected Map<String,PublicationTreeConfigDescriptor> |
treeConfigDescriptors |
protected Map<String,PublicationTreeDescriptor> |
treeDescriptors |
static String |
VALIDATORS_RULE_EP |
protected Map<String,ValidatorsRuleDescriptor> |
validatorsRuleDescriptors |
lastModified
DOMAIN_NAME_KEY
Constructor and Description |
---|
PublisherServiceImpl() |
deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
protected Map<String,PublicationTreeDescriptor> treeDescriptors
protected Map<String,PublishedDocumentFactoryDescriptor> factoryDescriptors
protected Map<String,PublicationTreeConfigDescriptor> treeConfigDescriptors
protected Map<String,ValidatorsRuleDescriptor> validatorsRuleDescriptors
protected Map<String,PublicationTreeConfigDescriptor> pendingDescriptors
protected Map<String,PublicationTree> liveTrees
protected RootSectionFinderFactory rootSectionFinderFactory
protected Map<String,String> remoteLiveTrees
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 static final String ROOT_SECTION_FINDER_FACTORY_EP
protected static final String ROOT_PATH_KEY
protected static final String RELATIVE_ROOT_PATH_KEY
public PublisherServiceImpl()
public void applicationStarted(ComponentContext context)
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
protected void doApplicationStarted()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic int getLiveTreeCount()
public PublicationTree getTreeBySid(String sid)
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
protected void registerTreeConfig(PublicationTreeConfigDescriptor desc)
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
protected String computeTreeSessionId(String treeConfigName, CoreSession coreSession)
protected String computeTreeSessionId(String treeConfigName, String sid)
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 PublicationTreeNotAvailable
getPublicationTree
in interface PublisherService
PublicationTreeNotAvailable
public PublicationTree getPublicationTree(String treeName, CoreSession coreSession, Map<String,String> params, DocumentModel currentDocument) throws PublicationTreeNotAvailable
getPublicationTree
in interface PublisherService
PublicationTreeNotAvailable
public Map<String,String> initRemoteSession(String treeConfigName, Map<String,String> params)
initRemoteSession
in interface RemotePublicationTreeManager
public void release(String sid)
release
in interface RemotePublicationTreeManager
public void releaseAllTrees(String sessionId)
releaseAllTrees
in interface PublisherService
protected PublicationTree getOrBuildTree(String treeConfigName, CoreSession coreSession, Map<String,String> params) throws PublicationTreeNotAvailable
PublicationTreeNotAvailable
protected PublicationTree buildTree(String sid, String treeConfigName, CoreSession coreSession, Map<String,String> params) throws PublicationTreeNotAvailable
PublicationTreeNotAvailable
protected Map<String,String> computeAllParameters(PublicationTreeConfigDescriptor config, Map<String,String> params)
protected PublishedDocumentFactory getPublishedDocumentFactory(PublicationTreeConfigDescriptor config, PublicationTreeDescriptor treeDescriptor, CoreSession coreSession, Map<String,String> params)
protected ValidatorsRule getValidatorsRule(PublishedDocumentFactoryDescriptor factoryDesc)
protected PublishedDocumentFactoryDescriptor getPublishedDocumentFactoryDescriptor(PublicationTreeConfigDescriptor config, PublicationTreeDescriptor treeDescriptor)
protected PublicationTreeConfigDescriptor getPublicationTreeConfigDescriptor(String treeConfigName)
protected PublicationTreeDescriptor getPublicationTreeDescriptor(PublicationTreeConfigDescriptor config)
protected PublicationTree getPublicationTree(PublicationTreeDescriptor treeDescriptor, String sid, CoreSession coreSession, Map<String,String> parameters, PublishedDocumentFactory factory, String configName, String treeTitle) throws PublicationTreeNotAvailable
PublicationTreeNotAvailable
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode)
publish
in interface PublisherService
publish
in interface RemotePublicationTreeManager
public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode, Map<String,String> params)
publish
in interface PublisherService
publish
in interface RemotePublicationTreeManager
public void unpublish(DocumentModel doc, PublicationNode targetNode)
unpublish
in interface PublisherService
unpublish
in interface RemotePublicationTreeManager
public void unpublish(String sid, PublishedDocument publishedDocument)
unpublish
in interface RemotePublicationTreeManager
public List<PublishedDocument> getChildrenDocuments(PublicationNode node)
getChildrenDocuments
in interface RemotePublicationTreeManager
protected List<PublicationNode> makeRemotable(List<PublicationNode> nodes, String sid)
public List<PublicationNode> getChildrenNodes(PublicationNode node)
getChildrenNodes
in interface RemotePublicationTreeManager
public PublicationNode getParent(PublicationNode node)
getParent
in interface RemotePublicationTreeManager
public PublicationNode getNodeByPath(String sid, String path)
getNodeByPath
in interface RemotePublicationTreeManager
public List<PublishedDocument> getExistingPublishedDocument(String sid, DocumentLocation docLoc)
getExistingPublishedDocument
in interface RemotePublicationTreeManager
public List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node)
getPublishedDocumentInNode
in interface RemotePublicationTreeManager
public void setCurrentDocument(String sid, DocumentModel currentDocument)
RemotePublicationTreeManager
setCurrentDocument
in interface RemotePublicationTreeManager
currentDocument
- the current documentpublic void validatorPublishDocument(String sid, PublishedDocument publishedDocument, String comment)
RemotePublicationTreeManager
validatorPublishDocument
in interface RemotePublicationTreeManager
publishedDocument
- the current published document that will be approvedpublic void validatorRejectPublication(String sid, PublishedDocument publishedDocument, String comment)
RemotePublicationTreeManager
validatorRejectPublication
in interface RemotePublicationTreeManager
publishedDocument
- the currently published document that will be rejectedpublic boolean canPublishTo(String sid, PublicationNode publicationNode)
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.public boolean canUnpublish(String sid, PublishedDocument publishedDocument)
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.public boolean canManagePublishing(String sid, PublishedDocument publishedDocument)
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
public boolean isPublishedDocument(DocumentModel documentModel)
isPublishedDocument
in interface PublisherService
public PublicationTree getPublicationTreeFor(DocumentModel doc, CoreSession coreSession)
getPublicationTreeFor
in interface PublisherService
public boolean hasValidationTask(String sid, PublishedDocument publishedDocument)
hasValidationTask
in interface RemotePublicationTreeManager
public PublishedDocument wrapToPublishedDocument(String sid, DocumentModel documentModel)
wrapToPublishedDocument
in interface RemotePublicationTreeManager
public boolean isPublicationNode(String sid, DocumentModel documentModel)
RemotePublicationTreeManager
true
if the given documentModel
is a PublicationNode of the current tree, false
otherwise.isPublicationNode
in interface RemotePublicationTreeManager
public PublicationNode wrapToPublicationNode(String sid, DocumentModel documentModel)
RemotePublicationTreeManager
documentModel
.wrapToPublicationNode
in interface RemotePublicationTreeManager
public PublicationNode wrapToPublicationNode(DocumentModel documentModel, CoreSession coreSession) throws PublicationTreeNotAvailable
wrapToPublicationNode
in interface PublisherService
PublicationTreeNotAvailable
protected void registerPendingDescriptors()
public void registerTreeConfigFor(DocumentModel domain)
public void unRegisterTreeConfigFor(DocumentModel domain)
public void unRegisterTreeConfigFor(String domainName)
public Map<String,String> getParametersFor(String treeConfigName)
getParametersFor
in interface PublisherService
public RootSectionFinder getRootSectionFinder(CoreSession session)
getRootSectionFinder
in interface PublisherService
Copyright © 2015 Nuxeo SA. All rights reserved.