|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.graph.request.function.Function
org.modeshape.jcr.SystemFunctions.VersionHistoryFunction
@Immutable public abstract static class SystemFunctions.VersionHistoryFunction

An abstract Function subclass that contains some helper methods related to version storage and version history.
| Constructor Summary | |
|---|---|
SystemFunctions.VersionHistoryFunction()
|
|
| Method Summary | |
|---|---|
protected Property |
createPropertyIfDifferent(Map<Name,Property> properties,
Name name,
Object expectedValue,
PropertyFactory propFactory,
ValueFactory<?> valueFactory)
A utility method that will create a new Property instance if there is not already an existing single-valued
property with the supplied name and expected values. |
protected Path |
initializeVersionStorage(UUID versionableNodeUuid,
Name primaryTypeName,
List<Name> mixinTypeNames,
Location versionHistoryLocation,
UUID originalVersionUuid,
UUID rootVersionUuid,
ExecutionContext context,
RequestBuilder system,
String workspace,
DateTime now)
Create and initialize the version history structure for a versionable node with the supplied UUID. |
protected Location |
versionHistoryLocationFor(Path versionHistoryPath,
UUID possibleVersionHistoryUuid,
RequestBuilder system,
String workspace)
Verify whether the version history exists within version storage, and if so return its actual Location. |
| Methods inherited from class org.modeshape.graph.request.function.Function |
|---|
isReadOnly, run |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SystemFunctions.VersionHistoryFunction()
| Method Detail |
|---|
protected Location versionHistoryLocationFor(Path versionHistoryPath,
UUID possibleVersionHistoryUuid,
RequestBuilder system,
String workspace)
Location. If a
possible UUID is provided, this method first looks for a version history node with the specified UUID at the specified
path; if none is found, then this method looks for a version history at the specified path (ignoring the supplied
UUID).
versionHistoryPath - the path to the version history node; may not be nullpossibleVersionHistoryUuid - the possible UUID for the existing version history node; may be null if this is not
knownsystem - the builder for creating and executing requests against the connector; may not be
nullworkspace - the name of the system workspace
protected Property createPropertyIfDifferent(Map<Name,Property> properties,
Name name,
Object expectedValue,
PropertyFactory propFactory,
ValueFactory<?> valueFactory)
Property instance if there is not already an existing single-valued
property with the supplied name and expected values.
properties - the existing properties, keyed by name; may not be nullname - the name of the property; may not be nullexpectedValue - the expected value of the property; may not be nullpropFactory - the factory for creating new Property instances; may not be nullvalueFactory - the factory for transforming the existing value into an object that can be compared to the expected
value
protected Path initializeVersionStorage(UUID versionableNodeUuid,
Name primaryTypeName,
List<Name> mixinTypeNames,
Location versionHistoryLocation,
UUID originalVersionUuid,
UUID rootVersionUuid,
ExecutionContext context,
RequestBuilder system,
String workspace,
DateTime now)
The initial version history structure for the versioned node with UUID "e41075cb-a09a-4910-87b1-90ce8b4ca9dd" is as follows:
+ jcr:system
+ jcr:versionStorage {jcr:primaryType = mode:versionStorage}
+ e4 {jcr:primaryType = mode:versionHistoryFolder}
+ 10 {jcr:primaryType = mode:versionHistoryFolder}
+ 75 {jcr:primaryType = mode:versionHistoryFolder}
+ cb {jcr:primaryType = nt:versionHistory}
+ a09a-4910-87b1-90ce8b4ca9dd {jcr:primaryType = nt:versionHistory}
+ jcr:versionLabels {jcr:primaryType = nt:versionLabels}
+ jcr:rootVersion {jcr:primaryType = nt:version}
- jcr:uuid = ...
- jcr:created = ...
+ jcr:frozenNode {jcr:primaryType = nt:frozenNode}
- jcr:frozenUuid
- jcr:frozenPrimaryType
- jcr:frozenMixinTypes
Note that the path between "/jcr:system/jcr:versionStorage" and the "nt:versionHistory" node is shown as being
hiearchical, but it is also possible to be
flat (which is less efficient and generally slower performing:
+ jcr:system
+ jcr:versionStorage {jcr:primaryType = mode:versionStorage}
+ e41075cb-a09a-4910-87b1-90ce8b4ca9dd {jcr:primaryType = nt:versionHistory}
+ jcr:versionLabels {jcr:primaryType = nt:versionLabels}
+ jcr:rootVersion {jcr:primaryType = nt:version}
- jcr:uuid = ...
- jcr:created = ...
+ jcr:frozenNode {jcr:primaryType = nt:frozenNode}
- jcr:frozenUuid
- jcr:frozenPrimaryType
- jcr:frozenMixinTypes
The flat structure was used originally and was less efficient and slower performing with larger numbers of versionable
nodes. The actual structure is set with the JcrRepository.Option.VERSION_HISTORY_STRUCTURE repository option,
but now defaults to hierarchical.
versionableNodeUuid - the UUID of the versionable node for which the history is to be created; may not be nullprimaryTypeName - the name of the primary type of the versionable node; may not be nullmixinTypeNames - the names of the mixin types for the versionable node; may be null or emptyversionHistoryLocation - the path and UUID of the version history node; may not be nulloriginalVersionUuid - the UUID of the original node from which the new versionable node was copied; may be nullrootVersionUuid - the UUID of the "jcr:rootVersion" node in the version history; may not be nullcontext - the execution context; may not be nullsystem - the RequestBuilder that can be used to create and execute additional requests; may not be nullworkspace - the name of the workspace; may not be nullnow - the current date time; may not be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||