-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.8.0-HF39, 6.0-HF28, 7.10-HF07, 8.2-SNAPSHOT, 8.3
-
Fix Version/s: 9.2
-
Component/s: Core, Publishing
-
Sprint:nxFG 9.1.10
-
Story Points:2
The class org.nuxeo.ecm.platform.publisher.api.AbstractBasePublicationTree which is stored by org.nuxeo.ecm.platform.publisher.impl.service.PublisherServiceImpl.getPublicationTree(String, CoreSession, Map<String, String>, DocumentModel) in org.nuxeo.ecm.platform.publisher.impl.service.PublisherServiceImpl.liveTree stores a CoreSession instance.
@Override public PublicationTree getPublicationTree(String treeName, CoreSession coreSession, Map<String, String> params, DocumentModel currentDocument) throws ClientException, PublicationTreeNotAvailable { PublicationTree tree = getOrBuildTree(treeName, coreSession, params); if (tree == null) { return null; } if (currentDocument != null) { tree.setCurrentDocument(currentDocument); } return new ProxyTree(tree, tree.getSessionId()); }
protected PublicationTree getOrBuildTree(String treeConfigName, CoreSession coreSession, Map<String, String> params) throws PublicationTreeNotAvailable { String key = computeTreeSessionId(treeConfigName, coreSession); PublicationTree tree; if (liveTrees.containsKey(key)) { tree = liveTrees.get(key); } else { tree = buildTree(key, treeConfigName, coreSession, params); if (tree != null) { liveTrees.put(key, tree); } } return tree; }
protected PublicationTree buildTree(String sid, String treeConfigName, CoreSession coreSession, Map<String, String> params) throws PublicationTreeNotAvailable { try { PublicationTreeConfigDescriptor config = getPublicationTreeConfigDescriptor(treeConfigName); Map<String, String> allParameters = computeAllParameters(config, params); PublicationTreeDescriptor treeDescriptor = getPublicationTreeDescriptor(config); PublishedDocumentFactory publishedDocumentFactory = getPublishedDocumentFactory( config, treeDescriptor, coreSession, allParameters); return getPublicationTree(treeDescriptor, sid, coreSession, allParameters, publishedDocumentFactory, config.getName(), config.getTitle()); } catch (PublisherException e) { log.error("Unable to build PublicationTree", e); return null; } }
nuxeo-features/nuxeo-platform-rendition/nuxeo-platform-rendition-publisher/src/main/resources/OSGI-INF/rendition-publisher-contrib.xml
<extension target="org.nuxeo.ecm.platform.publisher.impl.service.PublisherServiceImpl" point="tree"> <documentation> PublicationTree that allows retrieving all the published Rendition documents in addition to the 'standard' proxies for the given document. </documentation> <publicationTree name="RenditionPublicationCoreTree" class="org.nuxeo.ecm.platform.rendition.publisher.RenditionPublicationCoreTree" /> </extension>
Similarly, the org.nuxeo.ecm.platform.publisher.impl.finder.AbstractRootSectionsFinder holds a CoreSession instance, and is stored inside org.nuxeo.ecm.platform.publisher.impl.core.RootSectionsPublicationTree which is a subclass of the org.nuxeo.ecm.platform.publisher.api.AbstractBasePublicationTree mentioned above.