org.modeshape.jcr
Class SystemFunctions.CreateVersionNodeFunction
java.lang.Object
org.modeshape.graph.request.function.Function
org.modeshape.jcr.SystemFunctions.VersionHistoryFunction
org.modeshape.jcr.SystemFunctions.CreateVersionNodeFunction
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- SystemFunctions
@Immutable
public static class SystemFunctions.CreateVersionNodeFunction
- extends SystemFunctions.VersionHistoryFunction
The Function
implementation that efficiently updates the JCR version history and storage with a new version of a
node being checked in. This function will correctly update the version storage and output the values for the
"mix:versionable" properties. Note, however, that the caller of this function must walk the children of the versionable
node and create version nodes appropriately.
Note that this function assumes that the version history already exists for the versionable node.
This function requires the following inputs:
- "
versionedNodeUuid
" - the UUID
of the node that is being versioned; may not be null
- "
versionHistoryPath
" - the Path
to the version history node under
"/jcr:system/jcr:versionStorage"
; may not be null
- "
versionName
" - the Name
of the new version node under the 'nt:versionHistory' node at
"versionHistoryPath"
; may be null if the current time should be used for the name
- "
primaryTypeName
" - the Name
of the primary type of the node being versioned; may not be null
- "
mixinTypeNameList
" - the List
of Name
objects for each of the mixin types for the node
being versioned; may be null or empty if there are no mixin types
- "
predecessorUuidList
" - the List
of UUID
s representing the predecessors for the existing
version node (see the "jcr:predecessors
" property on "mix:versionable
"); may not be null or empty
- "
versionPropertyList
" - the List
of Property
objects that should be included on the new "
nt:versionHistory
" node; may be null or empty
The function produces the following outputs:
- "
versionHistoryUuid
" - the UUID
of the new version history node; never null
- "
versionUuid
" - the UUID
of the new version node; never null
- "
versionPath
" - the Path
of the new version node; never null
- "
pathOfHighestModifiedNode
" - the Path
of the highest node that was modified by this operation;
never null
- See Also:
- Serialized Form
Method Summary |
void |
run(FunctionContext context)
The method called to invoke the function. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VERSION_NAME
public static final String VERSION_NAME
- See Also:
- Constant Field Values
VERSION_HISTORY_PATH
public static final String VERSION_HISTORY_PATH
- See Also:
- Constant Field Values
VERSIONED_NODE_UUID
public static final String VERSIONED_NODE_UUID
- See Also:
- Constant Field Values
PRIMARY_TYPE_NAME
public static final String PRIMARY_TYPE_NAME
- See Also:
- Constant Field Values
MIXIN_TYPE_NAME_LIST
public static final String MIXIN_TYPE_NAME_LIST
- See Also:
- Constant Field Values
PREDECESSOR_PROPERTY
public static final String PREDECESSOR_PROPERTY
- See Also:
- Constant Field Values
VERSION_PROPERTY_LIST
public static final String VERSION_PROPERTY_LIST
- See Also:
- Constant Field Values
VERSION_HISTORY_UUID
public static final String VERSION_HISTORY_UUID
- See Also:
- Constant Field Values
VERSION_UUID
public static final String VERSION_UUID
- See Also:
- Constant Field Values
VERSION_PATH
public static final String VERSION_PATH
- See Also:
- Constant Field Values
PATH_OF_HIGHEST_MODIFIED_NODE
public static final String PATH_OF_HIGHEST_MODIFIED_NODE
- See Also:
- Constant Field Values
SystemFunctions.CreateVersionNodeFunction
public SystemFunctions.CreateVersionNodeFunction()
run
public void run(FunctionContext context)
- The method called to invoke the function. The implementation can obtain from the supplied
FunctionContext
the
inputs to the function, a FunctionContext.builder()
that can be used to create and immediately execute other
requests, the context of execution
, the location in the graph
where the function is being applied, and other information needed during execution. The
implementation even uses the supplied FunctionContext to write output
parameters
.
- Specified by:
run
in class Function
- Parameters:
context
- the context in which the function is being invoked, and which contains the inputs, the outputs, and methods
to create and invoke other requests on the connector- See Also:
Function.run(org.modeshape.graph.request.function.FunctionContext)
Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.