|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.core.version.BaseVersionManager
public abstract class BaseVersionManager
This version manager uses an extra workspace to manage the versions. The workspace maintains a flat hierarchy. The content is then finally versioned using JCR versioning which also copies the sub-nodes. The mix:versionable is only added on the top level nodes.
Field Summary | |
---|---|
static String |
PROPERTY_RULE
Property name for collection rule. |
protected static String |
ROOT_VERSION
JCR version store root. |
protected static String |
SYSTEM_NODE
Sub-node containing the data used for the version/restore process. |
static String |
TMP_REFERENCED_NODES
Node which contains stubs for referenced nodes. |
static String |
VERSION_WORKSPACE
Name of the workspace. |
Constructor Summary | |
---|---|
BaseVersionManager()
|
Method Summary | |
---|---|
javax.jcr.version.Version |
addVersion(javax.jcr.Node node)
Add version of the specified node and all child nodes while ignoring the same node type. |
javax.jcr.version.Version |
addVersion(javax.jcr.Node node,
Rule rule)
Add version of the specified node and all child nodes while ignoring the same node type. |
protected void |
checkAndAddMixin(javax.jcr.Node node)
Verifies the existence of the mix:versionable and adds it if not. |
protected void |
createInitialStructure()
Create structure needed for version store workspace. |
protected javax.jcr.version.Version |
createVersion(Content node,
Rule rule)
Deprecated. since 4.5 use #createVersion(Node, Rule) instead |
protected javax.jcr.version.Version |
createVersion(javax.jcr.Node node,
Rule rule,
String userName)
Create version of the specified node and all child nodes based on the given Rule . |
javax.jcr.version.VersionIterator |
getAllVersions(javax.jcr.Node node)
Get all versions. |
javax.jcr.version.Version |
getBaseVersion(javax.jcr.Node node)
Returns the current base version of given node. |
protected javax.jcr.Session |
getSession()
Get version store hierarchy manager. |
protected javax.jcr.Node |
getSystemNode(javax.jcr.Node node)
Get the Magnolia system node created under the given node. |
protected Rule |
getUsedFilter(javax.jcr.Node versionedNode)
Get Rule used for this version. |
javax.jcr.version.Version |
getVersion(javax.jcr.Node node,
String name)
Get named version. |
javax.jcr.Node |
getVersionedNode(javax.jcr.Node node)
Get node from version store. |
protected javax.jcr.Node |
getVersionedNode(String uuid)
Get node from version store. |
javax.jcr.version.VersionHistory |
getVersionHistory(javax.jcr.Node node)
Get history of this node as recorded in the version store. |
abstract boolean |
isInvalidMaxVersions()
Check if version index is set to negative number. |
void |
removeVersionHistory(javax.jcr.Node node)
Removes all versions of the node associated with given UUID. |
void |
restore(Content node,
javax.jcr.version.Version version,
boolean removeExisting)
Deprecated. since 4.5 use restore(Node, Version, boolean) instead |
void |
restore(javax.jcr.Node node,
javax.jcr.version.Version version,
boolean removeExisting)
Restore specified version. |
abstract void |
setMaxVersionHistory(javax.jcr.Node node)
Set version history to max version possible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERSION_WORKSPACE
public static final String TMP_REFERENCED_NODES
protected static final String SYSTEM_NODE
public static final String PROPERTY_RULE
protected static final String ROOT_VERSION
Constructor Detail |
---|
public BaseVersionManager()
Method Detail |
---|
protected void createInitialStructure() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if unable to create magnolia system structurepublic javax.jcr.version.Version addVersion(javax.jcr.Node node) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
node
- to be versioned
UnsupportedOperationException
- if repository implementation does not support Versions API
javax.jcr.RepositoryException
- if any repository error occurs
javax.jcr.UnsupportedRepositoryOperationException
public javax.jcr.version.Version addVersion(javax.jcr.Node node, Rule rule) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
node
- to be versioned
UnsupportedOperationException
- if repository implementation does not support Versions API
javax.jcr.RepositoryException
- if any repository error occurs
javax.jcr.UnsupportedRepositoryOperationException
@Deprecated protected javax.jcr.version.Version createVersion(Content node, Rule rule) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
#createVersion(Node, Rule)
instead
Rule
.
node
- to be versionedrule
-
UnsupportedOperationException
- if repository implementation does not support Versions API
javax.jcr.RepositoryException
- if any repository error occurs
javax.jcr.UnsupportedRepositoryOperationException
protected javax.jcr.version.Version createVersion(javax.jcr.Node node, Rule rule, String userName) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
Rule
.
node
- to be versionedrule
- userName
-
UnsupportedOperationException
- if repository implementation does not support Versions API
javax.jcr.RepositoryException
- if any repository error occurs
javax.jcr.UnsupportedRepositoryOperationException
public abstract boolean isInvalidMaxVersions()
public javax.jcr.Node getVersionedNode(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Node getVersionedNode(String uuid) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public abstract void setMaxVersionHistory(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if failed to get VersionHistory or fail to removepublic javax.jcr.version.VersionHistory getVersionHistory(javax.jcr.Node node) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
node
-
UnsupportedOperationException
- if repository implementation does not support Versions API
javax.jcr.RepositoryException
- if any repository error occurs
javax.jcr.UnsupportedRepositoryOperationException
public javax.jcr.version.Version getVersion(javax.jcr.Node node, String name) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
UnsupportedOperationException
- if repository implementation does not support Versions API
javax.jcr.RepositoryException
- if any repository error occurs
javax.jcr.UnsupportedRepositoryOperationException
public javax.jcr.version.Version getBaseVersion(javax.jcr.Node node) throws UnsupportedOperationException, javax.jcr.RepositoryException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
UnsupportedOperationException
public javax.jcr.version.VersionIterator getAllVersions(javax.jcr.Node node) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
node
-
UnsupportedOperationException
- if repository implementation does not support Versions API
javax.jcr.RepositoryException
- if any repository error occurs
javax.jcr.UnsupportedRepositoryOperationException
@Deprecated public void restore(Content node, javax.jcr.version.Version version, boolean removeExisting) throws javax.jcr.version.VersionException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
restore(Node, Version, boolean)
instead
node
- to be restoredversion
- to be usedremoveExisting
-
javax.jcr.version.VersionException
- if the specified versionName
does not exist in this
node's version history
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.version.VersionException
javax.jcr.UnsupportedRepositoryOperationException
public void restore(javax.jcr.Node node, javax.jcr.version.Version version, boolean removeExisting) throws javax.jcr.version.VersionException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
node
- to be restoredversion
- to be usedremoveExisting
-
javax.jcr.version.VersionException
- if the specified versionName
does not exist in this
node's version history
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.version.VersionException
javax.jcr.UnsupportedRepositoryOperationException
public void removeVersionHistory(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if fails to remove versioned node from the version storeprotected void checkAndAddMixin(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Rule getUsedFilter(javax.jcr.Node versionedNode) throws IOException, ClassNotFoundException, javax.jcr.RepositoryException
versionedNode
-
IOException
ClassNotFoundException
javax.jcr.RepositoryException
protected javax.jcr.Node getSystemNode(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
-
javax.jcr.RepositoryException
- if failed to create system nodeprotected javax.jcr.Session getSession() throws javax.jcr.LoginException, javax.jcr.RepositoryException
javax.jcr.RepositoryException
javax.jcr.LoginException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |