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 |
lastModifiedDOMAIN_NAME_KEY| Constructor and Description |
|---|
PublisherServiceImpl() |
deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtensionprotected 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)
ComponentapplicationStarted in interface ComponentapplicationStarted in class DefaultComponentprotected void doApplicationStarted()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic int getLiveTreeCount()
public PublicationTree getTreeBySid(String sid)
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentprotected void registerTreeConfig(PublicationTreeConfigDescriptor desc)
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution in class DefaultComponentprotected String computeTreeSessionId(String treeConfigName, CoreSession coreSession)
protected String computeTreeSessionId(String treeConfigName, String sid)
public List<String> getAvailablePublicationTree()
getAvailablePublicationTree in interface PublisherServicepublic Map<String,String> getAvailablePublicationTrees()
PublisherServiceMap with tree name as key and tree title as value.getAvailablePublicationTrees in interface PublisherServicepublic PublicationTree getPublicationTree(String treeName, CoreSession coreSession, Map<String,String> params) throws PublicationTreeNotAvailable
getPublicationTree in interface PublisherServicePublicationTreeNotAvailablepublic PublicationTree getPublicationTree(String treeName, CoreSession coreSession, Map<String,String> params, DocumentModel currentDocument) throws PublicationTreeNotAvailable
getPublicationTree in interface PublisherServicePublicationTreeNotAvailablepublic Map<String,String> initRemoteSession(String treeConfigName, Map<String,String> params)
initRemoteSession in interface RemotePublicationTreeManagerpublic void release(String sid)
release in interface RemotePublicationTreeManagerpublic void releaseAllTrees(String sessionId)
releaseAllTrees in interface PublisherServiceprotected PublicationTree getOrBuildTree(String treeConfigName, CoreSession coreSession, Map<String,String> params) throws PublicationTreeNotAvailable
PublicationTreeNotAvailableprotected PublicationTree buildTree(String sid, String treeConfigName, CoreSession coreSession, Map<String,String> params) throws PublicationTreeNotAvailable
PublicationTreeNotAvailableprotected 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
PublicationTreeNotAvailablepublic PublishedDocument publish(DocumentModel doc, PublicationNode targetNode)
publish in interface PublisherServicepublish in interface RemotePublicationTreeManagerpublic PublishedDocument publish(DocumentModel doc, PublicationNode targetNode, Map<String,String> params)
publish in interface PublisherServicepublish in interface RemotePublicationTreeManagerpublic void unpublish(DocumentModel doc, PublicationNode targetNode)
unpublish in interface PublisherServiceunpublish in interface RemotePublicationTreeManagerpublic void unpublish(String sid, PublishedDocument publishedDocument)
unpublish in interface RemotePublicationTreeManagerpublic List<PublishedDocument> getChildrenDocuments(PublicationNode node)
getChildrenDocuments in interface RemotePublicationTreeManagerprotected List<PublicationNode> makeRemotable(List<PublicationNode> nodes, String sid)
public List<PublicationNode> getChildrenNodes(PublicationNode node)
getChildrenNodes in interface RemotePublicationTreeManagerpublic PublicationNode getParent(PublicationNode node)
getParent in interface RemotePublicationTreeManagerpublic PublicationNode getNodeByPath(String sid, String path)
getNodeByPath in interface RemotePublicationTreeManagerpublic List<PublishedDocument> getExistingPublishedDocument(String sid, DocumentLocation docLoc)
getExistingPublishedDocument in interface RemotePublicationTreeManagerpublic List<PublishedDocument> getPublishedDocumentInNode(PublicationNode node)
getPublishedDocumentInNode in interface RemotePublicationTreeManagerpublic void setCurrentDocument(String sid, DocumentModel currentDocument)
RemotePublicationTreeManagersetCurrentDocument in interface RemotePublicationTreeManagercurrentDocument - the current documentpublic void validatorPublishDocument(String sid, PublishedDocument publishedDocument, String comment)
RemotePublicationTreeManagervalidatorPublishDocument in interface RemotePublicationTreeManagerpublishedDocument - the current published document that will be approvedpublic void validatorRejectPublication(String sid, PublishedDocument publishedDocument, String comment)
RemotePublicationTreeManagervalidatorRejectPublication in interface RemotePublicationTreeManagerpublishedDocument - the currently published document that will be rejectedpublic boolean canPublishTo(String sid, PublicationNode publicationNode)
RemotePublicationTreeManagertrue if the current user can publish to the specified publicationNode, false otherwise.canPublishTo in interface RemotePublicationTreeManagertrue if the current user can publish to the specified publicationNode, false otherwise.public boolean canUnpublish(String sid, PublishedDocument publishedDocument)
RemotePublicationTreeManagertrue if the current user can unpublish the given publishedDocument, false otherwise.canUnpublish in interface RemotePublicationTreeManagertrue if the current user can unpublish the given publishedDocument, false otherwise.public boolean canManagePublishing(String sid, PublishedDocument publishedDocument)
RemotePublicationTreeManagertrue if the current user can manage the publishing of the given published document, ie. approve
or reject the document.canManagePublishing in interface RemotePublicationTreeManagerpublic boolean isPublishedDocument(DocumentModel documentModel)
isPublishedDocument in interface PublisherServicepublic PublicationTree getPublicationTreeFor(DocumentModel doc, CoreSession coreSession)
getPublicationTreeFor in interface PublisherServicepublic boolean hasValidationTask(String sid, PublishedDocument publishedDocument)
hasValidationTask in interface RemotePublicationTreeManagerpublic PublishedDocument wrapToPublishedDocument(String sid, DocumentModel documentModel)
wrapToPublishedDocument in interface RemotePublicationTreeManagerpublic boolean isPublicationNode(String sid, DocumentModel documentModel)
RemotePublicationTreeManagertrue if the given documentModel is a PublicationNode of the current tree, false
otherwise.isPublicationNode in interface RemotePublicationTreeManagerpublic PublicationNode wrapToPublicationNode(String sid, DocumentModel documentModel)
RemotePublicationTreeManagerdocumentModel.wrapToPublicationNode in interface RemotePublicationTreeManagerpublic PublicationNode wrapToPublicationNode(DocumentModel documentModel, CoreSession coreSession) throws PublicationTreeNotAvailable
wrapToPublicationNode in interface PublisherServicePublicationTreeNotAvailableprotected 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 PublisherServicepublic RootSectionFinder getRootSectionFinder(CoreSession session)
getRootSectionFinder in interface PublisherServiceCopyright © 2016 Nuxeo SA. All rights reserved.