Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.jcr
Class SystemFunctions.InitializeVersionHistoryFunction

    java.lang.Object
      org.modeshape.graph.request.function.Function
          org.modeshape.jcr.SystemFunctions.VersionHistoryFunction
              org.modeshape.jcr.SystemFunctions.InitializeVersionHistoryFunction

All Implemented Interfaces:
  Serializable

Enclosing class:
  SystemFunctions

    @Immutable
    public static class SystemFunctions.InitializeVersionHistoryFunction

extends SystemFunctions.VersionHistoryFunction

The `Function` implementation that efficiently ensures that the JCR version history and storage for a node exist. This function will correctly initialize the version storage and output the values for the "mix:versionable" properties.

Note that this function will work correctly even if there is already an existing version history for the UUID. This is useful in situations like importing content, where an existing node might be deleted from the content and replaced with a new node with the same UUID, where the version history of the older node is to be kept.

This function requires the following inputs:

- "`versionedNodeUuid`" - the `UUID` of the node that is being versioned; may not be null
- "`originalUuid`" - the `UUID` of the node that was copied; may be null if not a copy operation
- "`versionHistoryPath`" - the `Path` to the version history node under `"/jcr:system/jcr:versionStorage"`; may not be null
- "`versionHistoryUuid`" - the proposed `UUID` for the version history node; may be null if a new UUID should be generated
- "`versionedUuid`" - the proposed `UUID` of the first version node; may be null if a new UUID should be generated
- "`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

The function produces the following outputs:

- "`predecessorUuidList`" - the `List` of `UUID`s representing the predecessors for the versioned node (see the " `jcr:predecessors`" property on "`mix:versionable`"); never null
- "`versionHistoryUuid`" - the `UUID` of the version history node (see the " `jcr:versionHistory`" property on "`mix:versionable`"); never null
- "`baseVersionUuid`" - the `UUID` of the versionable node's base version (see the " `jcr:baseVersion`" property on "`mix:versionable`"); never null
- "`pathOfHighestModifiedNode`" - the `Path` of the highest node that was modified by this operation; or null if no nodes were modified

See Also:
  Serialized Form

Field Summary
`static String` | `BASE_VERSION_UUID`
`static String` | `MIXIN_TYPE_NAME_LIST`
`static String` | `ORIGINAL_UUID`
`static String` | `PATH_OF_HIGHEST_MODIFIED_NODE`
`static String` | `PREDECESSOR_UUID_LIST`
`static String` | `PRIMARY_TYPE_NAME`
`static String` | `VERSION_HISTORY_PATH`
`static String` | `VERSION_HISTORY_UUID`
`static String` | `VERSION_UUID`
`static String` | `VERSIONED_NODE_UUID`

Constructor Summary
`SystemFunctions.InitializeVersionHistoryFunction()`

Method Summary
`void` | `run(FunctionContext context)` The method called to invoke the function.

Methods inherited from class org.modeshape.jcr.SystemFunctions.VersionHistoryFunction
`createPropertyIfDifferent, initializeVersionStorage, versionHistoryLocationFor`

Methods inherited from class org.modeshape.graph.request.function.Function
`isReadOnly`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### VERSIONED_NODE_UUID

    public static final String VERSIONED_NODE_UUID

See Also:
  Constant Field Values

### ORIGINAL_UUID

    public static final String ORIGINAL_UUID

See Also:
  Constant Field Values

### VERSION_HISTORY_PATH

    public static final String VERSION_HISTORY_PATH

See Also:
  Constant Field Values

### VERSION_UUID

    public static final String VERSION_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_UUID_LIST

    public static final String PREDECESSOR_UUID_LIST

See Also:
  Constant Field Values

### VERSION_HISTORY_UUID

    public static final String VERSION_HISTORY_UUID

See Also:
  Constant Field Values

### BASE_VERSION_UUID

    public static final String BASE_VERSION_UUID

See Also:
  Constant Field Values

### PATH_OF_HIGHEST_MODIFIED_NODE

    public static final String PATH_OF_HIGHEST_MODIFIED_NODE

See Also:
  Constant Field Values

Constructor Detail

### SystemFunctions.InitializeVersionHistoryFunction

    public SystemFunctions.InitializeVersionHistoryFunction()

Method Detail

### 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)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.