public class JCRPublicationService extends JahiaService
settingsBean| Modifier and Type | Method and Description |
|---|---|
void |
addPropertiesToSkipForReferences(String propertiesToSkipForReferences) |
void |
addReferencedNodeTypesToSkip(String referencedNodeTypesToSkip) |
protected void |
addRemovedLabel(JCRNodeWrapper node,
String label) |
static JCRPublicationService |
getInstance()
Get the singleton instance of the JCRPublicationService
|
List<PublicationInfo> |
getPublicationInfo(String uuid,
Set<String> languages,
boolean includesReferences,
boolean includesSubnodes,
boolean allsubtree,
JCRSessionWrapper sourceSession,
JCRSessionWrapper destinationSession) |
List<PublicationInfo> |
getPublicationInfo(String uuid,
Set<String> languages,
boolean includesReferences,
boolean includesSubnodes,
boolean allsubtree,
String sourceWorkspace,
String destinationWorkspace)
Gets the publication info for the current node and if acquired also for referenced nodes and subnodes.
|
List<PublicationInfo> |
getPublicationInfos(List<String> uuids,
Set<String> languages,
boolean includesReferences,
boolean includesSubnodes,
boolean allsubtree,
String sourceWorkspace,
String destinationWorkspace) |
JCRSessionFactory |
getSessionFactory()
Get the JCR session factory
|
int |
getStatus(JCRNodeWrapper node,
JCRSessionWrapper destinationSession,
Set<String> languages)
Get the publication status of a specific node
|
int |
getStatus(JCRNodeWrapper node,
JCRSessionWrapper destinationSession,
Set<String> languages,
Set<String> includedUuids)
Get the publication status of a specific node, taking into account nodes being published at the same time (used for conflict detection)
|
boolean |
hasIndependantPublication(JCRNodeWrapper node) |
void |
lockForPublication(List<String> publicationInfo,
String workspace,
String key) |
void |
print(javax.jcr.version.VersionHistory vh) |
void |
print(javax.jcr.version.Version v,
int indent) |
void |
publish(List<String> uuids,
String sourceWorkspace,
String destinationWorkspace,
boolean checkPermissions,
boolean updateMetadata,
List<String> comments) |
void |
publish(List<String> uuids,
String sourceWorkspace,
String destinationWorkspace,
boolean checkPermissions,
List<String> comments) |
void |
publish(List<String> uuids,
String sourceWorkspace,
String destinationWorkspace,
List<String> comments) |
void |
publishByInfoList(List<PublicationInfo> publicationInfos,
String sourceWorkspace,
String destinationWorkspace,
boolean checkPermissions,
List<String> comments) |
void |
publishByInfoList(List<PublicationInfo> publicationInfos,
String sourceWorkspace,
String destinationWorkspace,
List<String> comments) |
void |
publishByMainId(String uuid)
Publish a node sub-tree from default into the live workspace.
|
void |
publishByMainId(String uuid,
String sourceWorkspace,
String destinationWorkspace,
Set<String> languages,
boolean allSubTree,
List<String> comments)
Publish a node into the live workspace.
|
void |
registerListener(PublicationEventListener listener)
Register a listener of publication events.
|
void |
setBatchSize(int batchSize) |
void |
setLoggingService(MetricsLoggingService loggingService) |
void |
setPropertiesToSkipForReferences(String propertiesToSkipForReferences) |
void |
setReferencedNodeTypesToSkip(String referencedNodeTypesToSkip) |
void |
setSessionFactory(JCRSessionFactory sessionFactory)
Set the JCR session factory
|
void |
setVersionedTypes(String versionedTypes) |
void |
start() |
void |
stop() |
static boolean |
supportsPublication(JCRSessionWrapper sourceSession,
JCRNodeWrapper node) |
void |
unlockForPublication(List<String> publicationInfo,
String workspace,
String key) |
List<String> |
unpublish(List<String> uuids)
Unpublish a node from live workspace.
|
List<String> |
unpublish(List<String> uuids,
boolean checkPermissions)
Unpublish a node from live workspace.
|
void |
unregisterListener(PublicationEventListener listener)
Unregister a listener of publication events.
|
getSettingsBean, setSettingsBeanpublic JCRSessionFactory getSessionFactory()
public void setSessionFactory(JCRSessionFactory sessionFactory)
sessionFactory - The JCR session factorypublic void setLoggingService(MetricsLoggingService loggingService)
public static JCRPublicationService getInstance()
public boolean hasIndependantPublication(JCRNodeWrapper node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void lockForPublication(List<String> publicationInfo, String workspace, String key) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void unlockForPublication(List<String> publicationInfo, String workspace, String key) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void publishByMainId(String uuid) throws javax.jcr.RepositoryException
uuid - UUID of the node to publishjavax.jcr.RepositoryException - in case of errorpublic void publishByMainId(String uuid, String sourceWorkspace, String destinationWorkspace, Set<String> languages, boolean allSubTree, List<String> comments) throws javax.jcr.RepositoryException
uuid - Uuid of the node to publishsourceWorkspace - the source workspace of the publicationdestinationWorkspace - the destination workspace of the publicationlanguages - set of languages you wish to publishallSubTree - comments - an optional Listjavax.jcr.RepositoryException - in case of errorpublic void publishByInfoList(List<PublicationInfo> publicationInfos, String sourceWorkspace, String destinationWorkspace, List<String> comments) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void publishByInfoList(List<PublicationInfo> publicationInfos, String sourceWorkspace, String destinationWorkspace, boolean checkPermissions, List<String> comments) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void publish(List<String> uuids, String sourceWorkspace, String destinationWorkspace, List<String> comments) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void publish(List<String> uuids, String sourceWorkspace, String destinationWorkspace, boolean checkPermissions, List<String> comments) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void publish(List<String> uuids, String sourceWorkspace, String destinationWorkspace, boolean checkPermissions, boolean updateMetadata, List<String> comments) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic List<String> unpublish(List<String> uuids) throws javax.jcr.RepositoryException
uuids - uuids of the node to unpublishjavax.jcr.RepositoryException - in case of an error during this operationpublic List<String> unpublish(List<String> uuids, boolean checkPermissions) throws javax.jcr.RepositoryException
uuids - uuids of the node to unpublishcheckPermissions - do we need to check publish permissions on the provided nodes?javax.jcr.RepositoryException - in case of an error during this operationpublic List<PublicationInfo> getPublicationInfos(List<String> uuids, Set<String> languages, boolean includesReferences, boolean includesSubnodes, boolean allsubtree, String sourceWorkspace, String destinationWorkspace) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic List<PublicationInfo> getPublicationInfo(String uuid, Set<String> languages, boolean includesReferences, boolean includesSubnodes, boolean allsubtree, String sourceWorkspace, String destinationWorkspace) throws javax.jcr.RepositoryException
PublicationInfo has the publication info for the current node (NOT_PUBLISHED, PUBLISHED, MODIFIED, UNPUBLISHABLE)
and if requested you will be able to get the infos also for the subnodes and the referenced nodes.
As language dependent data is always stored in subnodes you need to set includesSubnodes to true, if you also specify a list of languages.uuid - The uuid of the node to get publication infolanguages - Languages list to use for publication info, or null for all languages (only appplied if includesSubnodes is true)includesReferences - If true include info for referenced nodesincludesSubnodes - If true include info for subnodesPublicationInfo for the requested node(s)javax.jcr.RepositoryException - in case of JCR-related errorspublic List<PublicationInfo> getPublicationInfo(String uuid, Set<String> languages, boolean includesReferences, boolean includesSubnodes, boolean allsubtree, JCRSessionWrapper sourceSession, JCRSessionWrapper destinationSession) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic int getStatus(JCRNodeWrapper node, JCRSessionWrapper destinationSession, Set<String> languages) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic int getStatus(JCRNodeWrapper node, JCRSessionWrapper destinationSession, Set<String> languages, Set<String> includedUuids) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static boolean supportsPublication(JCRSessionWrapper sourceSession, JCRNodeWrapper node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected void addRemovedLabel(JCRNodeWrapper node, String label) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
throws JahiaException
stop in class JahiaServiceJahiaExceptionpublic void print(javax.jcr.version.VersionHistory vh)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void print(javax.jcr.version.Version v,
int indent)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void setPropertiesToSkipForReferences(String propertiesToSkipForReferences)
public void setReferencedNodeTypesToSkip(String referencedNodeTypesToSkip)
public void setVersionedTypes(String versionedTypes)
public void addReferencedNodeTypesToSkip(String referencedNodeTypesToSkip)
public void addPropertiesToSkipForReferences(String propertiesToSkipForReferences)
public void setBatchSize(int batchSize)
public void registerListener(PublicationEventListener listener)
listener - Publication events listener to register.public void unregisterListener(PublicationEventListener listener)
listener - Publication events listener to unregister.Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.