|
||||||||||
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(Content node)
Add version of the specified node and all child nodes while ignoring the same node type. |
javax.jcr.version.Version |
addVersion(Content node,
Rule rule)
Add version of the specified node and all child nodes while ignoring the same node type. |
protected void |
checkAndAddMixin(Content 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)
Create version of the specified node and all child nodes based on the given Rule . |
protected List |
getAccessManagerPermissions()
Get access manager permission list. |
javax.jcr.version.VersionIterator |
getAllVersions(Content node)
Get all versions. |
javax.jcr.version.Version |
getBaseVersion(Content node)
Returns the current base version of given node. |
protected HierarchyManager |
getHierarchyManager()
Get version store hierarchy manager. |
protected Content |
getSystemNode(Content node)
Get the Magnolia system node created under the given node. |
protected Rule |
getUsedFilter(Content versionedNode)
Get Rule used for this version. |
javax.jcr.version.Version |
getVersion(Content node,
String name)
Get named version. |
Content |
getVersionedNode(Content node)
Get node from version store. |
protected Content |
getVersionedNode(String uuid)
Get node from version store. |
javax.jcr.version.VersionHistory |
getVersionHistory(Content node)
Get history of this node as recorded in the version store. |
protected void |
impersonateAccessManager(List permissions)
Impersonate to be access manager with system rights. |
abstract boolean |
isInvalidMaxVersions()
Check if version index is set to negative number. |
void |
removeVersionHistory(String uuid)
Removes all versions of the node associated with given UUID. |
void |
restore(Content node,
javax.jcr.version.Version version,
boolean removeExisting)
Restore specified version. |
protected void |
revertAccessManager(List permissions)
Revert access manager permissions. |
abstract void |
setMaxVersionHistory(Content 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(Content 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(Content 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
protected javax.jcr.version.Version createVersion(Content node, Rule rule) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
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
public abstract boolean isInvalidMaxVersions()
public Content getVersionedNode(Content node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Content getVersionedNode(String uuid) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public abstract void setMaxVersionHistory(Content node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if failed to get VersionHistory or fail to removepublic javax.jcr.version.VersionHistory getVersionHistory(Content 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(Content 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(Content node) throws UnsupportedOperationException, javax.jcr.RepositoryException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
UnsupportedOperationException
public javax.jcr.version.VersionIterator getAllVersions(Content 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 void restore(Content 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(String uuid) throws javax.jcr.RepositoryException
uuid
-
javax.jcr.RepositoryException
- if fails to remove versioned node from the version storeprotected void checkAndAddMixin(Content node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Rule getUsedFilter(Content versionedNode) throws IOException, ClassNotFoundException, javax.jcr.RepositoryException
versionedNode
-
IOException
ClassNotFoundException
javax.jcr.RepositoryException
protected Content getSystemNode(Content node) throws javax.jcr.RepositoryException
node
-
javax.jcr.RepositoryException
- if failed to create system nodeprotected void impersonateAccessManager(List permissions)
permissions
- protected void revertAccessManager(List permissions)
permissions
- protected List getAccessManagerPermissions()
protected HierarchyManager getHierarchyManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |