public class JCRVersionService extends JahiaService
| Modifier and Type | Field and Description |
|---|---|
static org.joda.time.format.DateTimeFormatter |
DATE_FORMAT |
settingsBean| Constructor and Description |
|---|
JCRVersionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addVersionLabel(JCRNodeWrapper node,
String label) |
void |
addVersionLabel(List<String> allUuids,
String label,
String workspace) |
static javax.jcr.version.Version |
findClosestVersion(javax.jcr.version.VersionHistory vh,
Date versionDate)
Finds the closest version in a version history to a specific date.
|
static javax.jcr.version.Version |
findVersionByLabel(javax.jcr.version.VersionHistory vh,
String label) |
static JCRVersionService |
getInstance()
Get the singleton instance of the JCRPublicationService
|
List<VersionInfo> |
getLinearVersionInfos(javax.jcr.Session session,
JCRNodeWrapper node) |
Set<String> |
getVersionedTypes() |
List<VersionInfo> |
getVersionInfos(javax.jcr.Session session,
JCRNodeWrapper node)
Retrieves the list of versions, ignoring internal version created in the publication process.
|
void |
restoreVersionLabel(JCRNodeWrapper node,
Date versionDate,
String label,
boolean allSubTree) |
void |
setMixinsToRemoveOnDestination(Set<String> mixinsToRemoveOnDestination) |
void |
setVersionedTypes(String versionedTypes) |
void |
start() |
void |
stop() |
getSettingsBean, setSettingsBeanpublic static JCRVersionService getInstance()
public void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
throws JahiaException
stop in class JahiaServiceJahiaExceptionpublic void setVersionedTypes(String versionedTypes)
public List<VersionInfo> getVersionInfos(javax.jcr.Session session, JCRNodeWrapper node) throws javax.jcr.RepositoryException
session - the session to use to retrieve the versionsnode - the node for which to retrieve the versionsjavax.jcr.RepositoryException - happens if there was a problem retrieving the list of versions.public List<VersionInfo> getLinearVersionInfos(javax.jcr.Session session, JCRNodeWrapper node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static javax.jcr.version.Version findClosestVersion(javax.jcr.version.VersionHistory vh,
Date versionDate)
throws javax.jcr.RepositoryException
vh - the version history in which to lookup versionsversionDate - the date to compare with. Note that it will find the closest version at OR BEFORE the datejavax.jcr.RepositoryException - in case of JCR-related errorspublic void restoreVersionLabel(JCRNodeWrapper node, Date versionDate, String label, boolean allSubTree) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static javax.jcr.version.Version findVersionByLabel(javax.jcr.version.VersionHistory vh,
String label)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void addVersionLabel(JCRNodeWrapper node, String label) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void addVersionLabel(List<String> allUuids, String label, String workspace) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.