DAPI (Document Application Programming Interface) maintains a hierarchical database of nodes and their related attributes. Each node can have multiple versions of data, in the form of BLOBs (Binary Large Objects). A common form of versioned data stored at the nodes are electronic files of any format.

Node management is very much like a file system in that creation, updating, deleting, moving, and copying of nodes is supported.

DAPI protects access to all nodes through both the User, Group, System, World permissions and ACL (Access Control Lists).

DAPI supports for Aliases for nodes and Generations for versions. Aliases provide shortcuts to other nodes stored in the DAPI databases. Generations provide a reference to a specific version of a node.

Note: The DAPI category functionality supports the legacy node category features. Most of the current set of DAPI category attributes functions are not used for the current more sophisticated category features which are implemented in OScript. However, a few of the functions are used to support the additional node attributes feature.

The followings are types of DAPI object handles used with the DAPI functions:

- DAPISESSION
- DAPINODE
- DAPIVERSION
- DAPISTREAM

The DAPI Package contains a formidable number of functions. The following table describes the bulk of the functionality provided:

Create Get/Set/Count/List Move/Copy/Fetch Update Delete Special
Node AllocNode(), CreateNode(), CreateRootNode() GetNode(), GetNodeByID(), NumSubNodes() ListSubNodes(), ListContents() CopyNode(), CopyANode(), MoveNode() UpdateNode() DeleteNode() GetParentNode(), GetMultilingualName(), SetMultilingualName(), GetMultilingualComment(), SetMultilingualComment(), RenameNode(), ReserveNode(), UnreserveNode(), RefreshNode(), IsInTree()
Version AllocVersion(), AddVersion(), AddVersionFromStream(), AddValAsVersion() GetVersion(), GetVersionByID(), GetVersionByName(), NumVersions(), ListVersions() CopyVersion(), FetchVersion(), FetchVersionAsVal(), FetchVersionToStream(), FetchVersionRangeToStream(), FetchVersionRangesToStream() UpdateVersion() DeleteVersion(), PurgeVersions() LockVersion(), UnlockVersion(), RefreshVersion(), VersionFetchable(), MoveProviderData()
Rendition AddRendition(), AddRenditionFromStream() GetRendition(), NumRenditions(), ListRenditions() FetchRendition(), FetchRenditionToStream(), FetchRenditionRangeToStream(), FetchRenditionRangesToStream() DeleteRendition() GetOriginalNode()
Alias AliasNode() NumAliasNodes(), ListAliasNodes() GetOriginalNode()
Generation CreateGeneration() NumGenerations(), NumGensFromRelease(), NumGensFromVersion(), ListGenerations(), ListGensFromRelease(), ListGensFromVersion() GetOriginalNode()
Category AddCategory() ListCategories() CopyCategory() UpdCategory() DelCategory()
Category Attributes AddCategoryAttr(), AddAttrToCategory() ListCategoryAttrs() UpdCategoryAttr() DelCategoryAttr()
Permissions GetNodePermissions()
Rights AddNodeRight() GetNodeRight(), GetNodeRights() UpdateNodeRight() DeleteNodeRight()
User Attributes GetNodeUserAttr(), GetVersionUserAttr(), SetNodeUserAttr(), SetVersionUserAttr() CopyNodeUserAttrs(), CopyVersionUserAttrs()
Columns AddNodeUserColumn(), AddVersionUserColumn() GetNodeColumnNames(), GetVersionColumnNames()
Version Stream OpenReadVerStream(), OpenWriteVerStream() VerStreamLenGet(), VerStreamRead(), VerStreamWrite() VerStreamClose()

Class Attributes Index

 o ALIAS_NODE
The subtype of an alias node.
 o ALL_COLUMNS
Specify to include all columns, including the system and user columns.
 o ATTR_DATE
Specifies an attribute of type date.
 o ATTR_FCHAR
Specifies an attribute of type fixed length text.
 o ATTR_INT
Specifies an attribute of type Integer.
 o ATTR_LCHAR
Specifies an attribute of type long length text.
 o ATTR_REAL
Specifies an attribute of type Real.
 o ATTR_SET_ALL
Specify to include both the system and category attributes.
 o ATTR_SET_CAT
Specify to include only the category attributes.
 o ATTR_SET_SYS
Specify to include only the system attributes.
 o ATTR_VCHAR
Specifies an attribute of type variable length text.
 o AuditEventADDVERSION
The auditing event when a version is added to a node.
 o AuditEventALIAS
The auditing event when a node is aliased.
 o AuditEventATTRCHANGE
The auditing event when the system or category attributes of a node has changed.
 o AuditEventCDORDERED
The auditing event when the ordering of a compound document's child node has changed.
 o AuditEventCOPY
The auditing event when a node is copied.
 o AuditEventCREATE
The auditing event when a node is created.
 o AuditEventCREATEGEN
The auditing event when a generation is created for a node.
 o AuditEventCREATEREL
The auditing event when a release is created for a compound document.
 o AuditEventCREATEREND
The auditing event when a rendition is added to a version of a node.
 o AuditEventCREATEREV
The auditing event when a revision is created for a compound document.
 o AuditEventDELETE
The auditing event when a node is deleted.
 o AuditEventDELREL
The auditing event when a release of a compound document is deleted.
 o AuditEventDELREND
The auditing event when a rendition of a version is deleted.
 o AuditEventDELREV
The auditing event when a revision of a compound document is deleted.
 o AuditEventDELVERSION
The auditing event when a version of a node is deleted.
 o AuditEventFETCH
The auditing event when a version of a node is fetched.
 o AuditEventLOGIN
The auditing event when a user logs in to the system.
 o AuditEventLOGOUT
The auditing event when a user logs out of the system.
 o AuditEventMOVE
The auditing event when a node is moved.
 o AuditEventPERMCHANGE
The auditing event when the permissions of a node have changed.
 o AuditEventPURGE
The auditing event when versions of a node are purged.
 o AuditEventRENAME
The auditing event when a node is renamed.
 o AuditEventRESERVE
The auditing event when a node is reserved.
 o AuditEventUNRESERVE
The auditing event when a node is unreserved.
 o AuditSection
The auditing section identifier used in system initialization.
 o BLK_READ
A provider callback reason constant which indicates the reading of a block of blob data from the database.
 o BLK_WRITE
A provider callback reason constant which indicates the writing of a block of blob data to the database.
 o BY_DATAID
Specify to operate based unique node ID.
 o CANCEL
A return status constant used by the callback to cancel an operation without causing an error to occur.
 o CB_COPY_VERSION
A DAPI callback reason constant which indicates a version of a node will be copied.
 o CB_FILTER_NODES
A DAPI callback reason constant which indicates one or more nodes are fetched for application node filtering.
 o CB_DELETE_VERSION
A DAPI callback reason constant which indicates a version of a node will be deleted.
 o CB_NEW_VERSION
A DAPI callback reason constant which indicates a new version will be added to a node.
 o CB_UPDATE_NODE_USERID
A DAPI callback reason constant which indicates the owner of a node is updated.
 o CLOSE
A provider callback reason constant which indicates the closing of a blob after opening for reading or writing.
 o COPY_A_NODE
A copy option for copying only the specified node without copying its child nodes
 o COPY_CURRENTV
A copy option for copying only the current version of all nodes.
 o COPY_DST_CAT
A copy option indicating that the copied node will have the same category as the destination parent node.
 o COPY_DST_PERMS
A copy option indicating that the copied node will have the same permissions as the destination parent node.
 o COPY_DST_USERATTS
A copy option indicating that the copied node will have the same user attributes as the destination parent node.
 o COPY_NODE
A DAPI callback reason constant which indicates a node was encountered and will be copied.
 o COPY_NO_CAT
A copy option indicating that a node's category and its attributes should not be copied.
 o COPY_NO_USERATTS
A copy option indicating that a node's user attributes should not be copied.
 o COPY_NO_VER
A copy option indicating that version information should not be copied.
 o COPY_PUBLISHEDV
A copy option indicating that only the published version will be copied.
 o COPY_SET_CURRUSER
A copy option for setting the copied node's creator to the current user.
 o COPY_SPECIFICV
A copy option for copying a specific version of a node.
 o COPY_SRC_PERMS
A copy option indicating that the copied node will have the same permissions as the source node.
 o COPY_UNLOCKV
A copy option indicating that all copied versions will be unlocked.
 o COPY_UNRESERVE
A copy option indicating that all copied nodes will be unreserved.
 o DATA_DELETE
A permission bit which enables deletion of a version.
 o DATA_FETCH
A permission bit which enables access to a version's blob data contents.
 o DATA_READ
A permission bit which enables access of the version attributes.
 o DATA_USER1
Another permission bit for a custom defined version privileges.
 o DATA_USER2
A permission bit for a custom defined version privileges.
 o DATA_WRITE
A permission bit which enables the modification of the version attributes.
 o DELETE
A provider callback reason constant which indicates the deletion of a blob.
 o DELETE_NODE
A DAPI callback reason constant which indicates a node was encountered and will be deleted.
 o DELETE_NO_CHILD_COUNT_UPDATE
A delete option to skip child count updating.
 o DapiNodeType
The DapiNode type number.
 o DapiSessionType
The DapiSession type number.
 o DapiStreamType
The DapiStream type number.
 o DapiVersionType
The DapiVersion type number.
 o ERROR
A return status constant used by the callback to abort an operation.
 o FETCHABLE
A provider callback reason constant which indicates querying whether the blob content is fetchable.
 o FILE_GET
A provider callback reason constant which indicates the reading of a blob from the database.
 o FILE_PUT
A provider callback reason constant which indicates the writing of a blob from the database.
 o FULL_PERM_MASK
An Integer mask representing full permissions.
 o GENERATION_NODE
The subtype of a generation node.
 o LOCK_VERSION
The default version locked flag.
 o MOVE_NODE
A DAPI callback reason constant which indicates a node was encountered and will be moved.
 o MOVE_CB_PERM_CONTROLLER
A DAPI cbMoveOptions flag for moving items into a structure with permissions controllers.
 o MOVE_CB_PERM_CONTROLLER_SUBTREES
A DAPI cbMoveOptions flag for moving items within a structure with permissions controllers.
 o MOVE_ROOT_NODE
Internal usage.
 o MOVE_SUB_NODE
Internal usage.
 o NODE_ADD_CHILDREN
A permission bit which enables the addition of child nodes.
 o NODE_CONTROL
A permission bit which enables the a node's permissions to be viewed and edited.
 o NODE_DELETE
A permission bit which enables node deletion.
 o NODE_DEL_CHILDREN
A permission bit which enables the deletion of the child nodes.
 o NODE_MODIFY_ATTR
A permission bit which enables the modification of the category attributes of a node.
 o NODE_NODE
The default subtype of a node.
 o NODE_NOT_RESERVED
The default node unreserved flag.
 o NODE_READ
A permission bit which enables access of the content and attributes of a node.
 o NODE_READ_EXPLICIT
A permission bit which allows a user to see the node.
 o NODE_USER1
A permission bit for custom defined privileges.
 o NODE_USER2
A permission bit for custom defined privileges.
 o NOTIFY_ACL_ADD
The change notification constant for adding an ACL to a node.
 o NOTIFY_ACL_DELETE
The change notification constant for deleting an ACL from a node.
 o NOTIFY_ACL_UPDATE
The change notification constant for modifying an ACL of a node.
 o NOTIFY_COPY
The change notification constant for copying a node.
 o NOTIFY_CREATE
The change notification constant for creating a node.
 o NOTIFY_CREATE_ROOT
The change notification constant for creating a root node.
 o NOTIFY_DELETE
The change notification constant for deleting a node.
 o NOTIFY_DELETE_VERSION
The change notification constant for deleting a node version.
 o NOTIFY_MOVE
The change notification constant for moving a node.
 o NOTIFY_RENAME
The change notification constant for renaming a node.
 o NOTIFY_UPDATE
The change notification constant for modifying a node.
 o OK
The integer status indicating success.
 o OPEN_IN
A provider callback reason constant which indicates opening a blob data for reading.
 o OPEN_OUT
A provider callback reason constant which indicates opening a blob data for writing.
 o PERMTYPE_ACL
The permission type for ACL permissions.
 o PERMTYPE_GROUP
The permission type for group permissions.
 o PERMTYPE_SYSTEM
The permission type for system permissions.
 o PERMTYPE_USER
The permission type for user permissions.
 o PERMTYPE_WORLD
The permission type for world permissions.
 o PERM_DELETE
A permission level constant for permissions up to delete privileges.
 o PERM_SEE
A permission level constant for only see privilege.
 o PERM_SEECONTENTS
A permission level constant for permissions up to see contents privileges
 o PERM_TO_RWD
A return status constant used by the callback to change a node permissions in a RWD setting in a move operation.
 o PERM_WRITE
A permission level constant for permissions up to modify privileges.
 o PLATFORM_MAC
The Macintosh platform.
 o PLATFORM_MOTIF
The UNIX platform.
 o PLATFORM_UNKNOWN
An unknown platform.
 o PLATFORM_WINDOWS
The Windows platform.
 o RESERVE_NODE
The default node reserved flag.
 o SEEK
A provider callback reason constant which indicates setting the position of blob data.
 o SKIP
A return status constant used by the callback to skip a copy of a node in a copy operation without causing an error.
 o SYSTEM_COLUMNS
Specify to include system columns only.
 o UNUSED
An integer value indicating that an attribute is unused.
 o USER_COLUMNS
Specify to include user columns only.
 o VCOPY_ADDVER
A version copy option for setting the copied version's creator to the current user.
 o VCOPY_NO_USERATTS
A version copy option indicating that user attributes should not be copied.
 o VCOPY_RENDITIONS
A version copy option to copy the renditions with the version.
 o VCOPY_UNLOCK
A version copy option indicating that the copied version should be unlocked.
 o VersionNotYetLoaded
A return status constant used to indicate that a version's blob content has not yet been loaded.
 o VERSION_CREATE_MAJOR
A constant to indicate the creation of a major version.
 o VERSION_GET_CURRENT
A constant to indicate the retrieval of the current version.
 o VERSION_GET_CURRENT_MAJOR
A constant to indicate the retrieval of the current major version.
 o VERSION_GET_CURRENT_PUBLISHED
A constant to indicate tthe retrieval of the current published version.
 o VERSION_NOT_LOCKED
The default version unlocked flag.

Class Methods Index

 o AddAttrToCategory( DAPISESSION session, String category, String attribute, Boolean optFlag ) [Note]
Adds the specified attribute to the specified category.
 o AddCategory( DAPISESSION session, String category, String displayName, String tableName ) [Note]
Adds a new category.
 o AddCategoryAttr( DAPISESSION session, String attribute, Integer type, Integer length, [List extendList] ) [Note]
Adds a new category attribute.
 o AddNodeRight( DAPINODE node, Integer rightID, Integer permissions )
Adds a user or group access right to the specified node.
 o AddNodeUserColumn( DAPISESSION session, String columnName, String columnType )
Adds a new column to the DTree table.
 o AddProvider( DAPISESSION session, String provider, Boolean logical, Dynamic script, Dynamic object )
Adds a custom provider for blob data storage to the current session.
 o AddRendition( DAPIVERSION version, DAPIVERSION rendition, String provider, String localFilePath )
Adds a new rendition to the specified version.
 o AddRenditionFromStream( DAPIVERSION version, String renditionType, String provider, Socket aSocket, Assoc renditionAttr )
Adds a new rendition to the specified version by getting data from the specified Socket object.
 o AddValAsVersion( DAPINODE node, DAPIVERSION version, String provider, Dynamic value )
Adds a value as a version to the specified node.
 o AddVersion( DAPINODE node, DAPIVERSION version, String provider, String localFilePath )
Adds a version to the specified node.
 o AddVersionFromStream( DAPINODE node, DAPIVERSION version, String provider, Socket aSocket, Assoc versionAttr)
Adds a version to the specified node by getting data from the specified Socket object.
 o AddVersionUserColumn( DAPISESSION session, String columnName, String columnType )
Adds a new column to the DVersData table.
 o AliasNode( DAPINODE original, DAPINODE parent, DAPINODE new, [Boolean copyAcls] )
Creates a new node that is an alias of the specified node.
 o AllocNode( DAPISESSION session )
Allocates a new DAPINODE object in memory.
 o AllocSession( CAPILOGIN login, [Boolean notifyChange] )
Allocates a DAPISESSION object for a login user.
 o AllocVersion( DAPISESSION session )
Allocates a new DAPIVERSION object in memory.
 o Audit( Dynamic nodeOrSession, String userEvent, String description )
Records a custom auditing event.
 o MoveProviderData( DAPIVERSION version, String providerName )
Changes the data provider of the specified version.
 o CopyANode( DAPINODE original, DAPINODE parent, DAPINODE new, [Integer options], [Integer versionNum] )
Copies a node but not its child nodes.
 o CopyCategory( DAPINODE original, [DAPINODE node] ) [Note]
Copies the category and attributes of one node to another.
 o CopyNode( DAPINODE original, DAPINODE parent, [Integer options], [Dynamic newNames] )
Copies a node and its child nodes.
 o CopyNodeUserAttrs( DAPINODE original, DAPINODE node )
Copies the user attributes of one node to another.
 o CopyVersion( DAPIVERSION originalVersion, DAPINODE node, DAPIVERSION newVersion, [Integer options], [String provider] )
Copies a specified version as a new version of the specified node.
 o CopyVersionUserAttrs( DAPIVERSION original, DAPIVERSION version )
Copies the user attributes of one version to another.
 o CreateGeneration( DAPINODE original, DAPINODE parent, DAPINODE new, [Boolean rootOnly], [Boolean copyAcls])
Creates a new node that is a generation of the specified node.
 o CreateNode( DAPINODE new, DAPINODE parent, [Boolean copyAcls] )
Creates a new node.
 o CreateRootNode( DAPINODE new )
Creates a root node for a volume.
 o DelAttrFromCategory( DAPISESSION session, String category, String attribute ) [Note]
Deletes an attribute from a category.
 o DelCategory( DAPISESSION session, String category, Boolean dropTable ) [Note]
Deletes a category.
 o DelCategoryAttr( DAPISESSION session, String attribute, [Boolean checkUsage] ) [Note]
Deletes an attributes.
 o DeleteNode( DAPINODE node )
Deletes the specified node and its child nodes.
 o DeleteNodeRight( DAPINODE node, Integer rightID )
Deletes a user or group access right from the specified node.
 o DeleteRendition( DAPIVERSION version, String rendition )
Deletes the specified rendition of a specified version.
 o DeleteVersion( DAPIVERSION version )
Deletes the specified version.
 o FetchRendition( DAPIVERSION version, String renditionType, String localFilePath )
Copies the specified version rendition contents to a file on the local machine.
 o FetchRenditionRangeToStream( DAPIVERSION version, Socket aSocket, String renditionType, List rangeData )
Reads a portion of the version rendition contents and writes it to the specified Socket object.
 o FetchRenditionRangesToStream( DAPIVERSION version, Socket aSocket, String renditionType, List rangesData, String headerData)
Reads multiple portions of the version rendition contents and writes it to the specified Socket object.
 o FetchRenditionToStream( DAPIVERSION version, Socket aSocket, String renditionType )
Reads the version rendition contents and writes it to the specified Socket object.
 o FetchVersion( DAPIVERSION version, String localFilePath )
Copies the specified version contents to a file on the local host.
 o FetchVersionAsVal( DAPIVERSION version )
Retrieves the version of a node as a value.
 o FetchVersionRangeToStream( DAPIVERSION version, Socket aSocket, List rangeData )
Reads a portion of the version contents and writes it to the specified Socket object.
 o FetchVersionRangesToStream( DAPIVERSION version, Socket aSocket, List rangesData, String headerData )
Reads multiple portions of the version contents and writes it to the specified Socket object.
 o FetchVersionToStream( DAPIVERSION version, Socket aSocket )
Reads the version contents and writes it to the specified Socket object.
 o GetMultilingualComment( DAPINODE node, String languageCode )
Retrieves the comment of a DAPINODE for the specified language.
 o GetMultilingualName( DAPINODE node, String languageCode )
Retrieves the name of a DAPINODE for the specified language.
 o GetNode( String namePath, DAPINODE startNode, [Boolean autoExpand] )
Retrieves a node by specifying a name or a relative path.
 o GetNodeByID( DAPISESSION session, Integer volumeID/nodeID, [Integer nodeID], [Boolean autoExpand] )
Retrieves a node based on its unique ID.
 o GetNodeColumnNames( DAPISESSION session, Integer columnType )
Returns a List of column names in the DTree table.
 o GetNodePermissions( DAPINODE node )
Returns the permissions mask that the current user has on the specified node.
 o GetNodeRight( DAPINODE node, Integer rightID )
Returns a user or group access right for the specified node.
 o GetNodeRights( DAPINODE node )
Returns all user or group access rights for the specified node.
 o GetNodeUserAttr( DAPINODE node, String attrName, [Integer attrType] )
Returns a user attribute value for the specified node.
 o GetOriginalNode( DAPINODE node )
Retrieves the original node referenced by the specified alias or generation node.
 o GetParentNode( DAPINODE node )
Retrieves the parent node of the specified node.
 o GetRendition( DAPIVERSION version, String renditionType )
Retrieves a rendition of the specified version.
 o GetVersion( DAPINODE node, Integer versionNum )
Retrieves a specific version of the specified node.
 o GetVersionByID( Integer versionID, DAPISESSION session )
Retrieves a version based on unique ID.
 o GetVersionByName( DAPINODE node, String versionName )
Retrieves a version based on the unique version name of a node.
 o GetVersionColumnNames( DAPISESSION session, Integer columnType )
Returns a List of column names of the DVersData table.
 o GetVersionUserAttr( DAPIVERSION version, String attrName )
Returns a user attribute value for the specified version.
 o IsInTree( DAPINODE node, DAPINODE tree )
Checks if a node is a descendant of another.
 o ListAliasNodes( DAPINODE node, [Integer permissions] )
Returns a List of all the aliases to the specified node.
 o ListCategories( DAPISESSION session ) [Note]
Returns a RecArray containing information about all existing categories.
 o ListCategoryAttrs( DAPISESSION session, [String category] ) [Note]
Returns a RecArray containing information about attributes.
 o ListContents( DAPISESSION session, Integer volumeID, Integer nodeID, String viewName, [String query], [Integer permissions])
Returns a RecArray containing the child nodes Records of a specified node.
 o ListGenerations( DAPINODE node, [Integer permissions] )
Returns a List of all the generations of the specified node.
 o ListGensFromRelease( DAPINODE node, Integer major, Integer minor, [Integer permissions] )
Returns a List of all generations of the specified release or revision of a compound document.
 o ListGensFromVersion( DAPIVERSION version, [Integer permissions] )
Returns a List of all generations of the specified version.
 o ListRenditions( DAPIVERSION version )
Returns a List of all renditions of the specified version.
 o ListSubNodes( DAPINODE node, [String query], [String category], [String catAttrQuery], [Boolean autoExpand], [Integer permissions])
Returns a List of the child nodes of a specified node.
 o ListVersions( DAPINODE node )
Returns a List of all versions of the specified node.
 o LockVersion( DAPIVERSION version, Integer lockFlag )
Locks the specified version.
 o MoveNode( DAPINODE node, DAPINODE parent, [Dynamic newNames], [Boolean forceInheritPerm] )
Relocates the specified node and its child nodes.
 o NextOrderingPos( DAPINODE node )
Returns the next available ordering position in a compound document.
 o NumAliasNodes( DAPINODE node )
Returns the number of aliases to the specified node.
 o NumGenerations( DAPINODE node )
Returns the number of generations of the specified node.
 o NumGensFromRelease( DAPINODE node, Integer major, Integer minor )
Returns the number of generations of the specified release or revision of a compound document.
 o NumGensFromVersion( DAPIVERSION version )
Returns the number of generations of the specified version.
 o NumRenditions( DAPIVERSION version )
Returns the number of rendition types associated with a specified version.
 o NumSubNodes( DAPINODE node )
Returns the number of child nodes of the specified node.
 o NumVersions( DAPINODE node )
Returns the number of versions of the specified node.
 o OpenReadVerStream( DAPIVERSION version, [Boolean resourceFork] )
Opens a stream for reading the contents of the specified version.
 o OpenWriteVerStream( DAPINODE node, DAPIVERSION node, Integer dataLen, String provider, [Boolean resourceFork] )
Opens a stream for writing the contents of the specified version.
 o PurgeVersions( DAPINODE node, [Integer numToKeep] )
Deletes one or more versions from the specified node.
 o RefreshNode( DAPINODE node )
Forces a retrieval of the most recent node information from the database.
 o RefreshVersion( DAPIVERSION version )
Forces a retrieval of the most recent version information from the database.
 o RenameNode( DAPINODE node, Dynamic newNames )
Renames the specified node.
 o ReserveNode( DAPINODE node, Integer reserveFlag, [Integer userID] )
Reserves the specified node.
 o SetCallback( DAPISESSION session, Dynamic script, [Dynamic object] )
Establishes a callback script for node events.
 o SetDefaultProvider( DAPISESSION session, String provider )
Sets a default provider to use during a session.
 o SetMultilingualComment( DAPINODE node, String languageCode, String newValue )
Sets the comment of a DAPINODE for the specified language.
 o SetMultilingualName( DAPINODE node, String languageCode, String newValue )
Sets the name of a DAPINODE for the specified language.
 o SetNodeUserAttr( DAPINODE node, String attrName, Dynamic value, [Integer attrType] )
Assigns a value to the specified user attribute of the specified node.
 o SetVersionUserAttr( DAPIVERSION version, String attrName, Dynamic value )
Assigns a value to the specified user attribute of the specified version.
 o UnlockVersion( DAPIVERSION version )
Unlocks the specified version.
 o UnreserveNode( DAPINODE node )
Unreserves the specified node.
 o UpdCategory( DAPISESSION session, Record categoryRec ) [Note]
Updates a category.
 o UpdCategoryAttr( DAPISESSION session, Record attributeRec ) [Note]
Updates an attribute.
 o UpdateNode( DAPINODE node )
Updates modified node attributes of the specified node.
 o UpdateNodeRight( DAPINODE node, Integer rightID, Integer permissions )
Updates the user or group access right of the specified node.
 o UpdateVersion( DAPIVERSION version )
Updates modified version attributes of the specified version.
 o VersionFetchable( DAPIVERSION version )
Determines whether the specified version's blob content has been loaded.
 o VerStreamClose( DAPIVERSION version, DAPISTREAM stream )
Closes the specified open stream for reading or writing.
 o VerStreamLenGet( DAPISTREAM stream )
Returns the length of an opened version stream.
 o VerStreamRead( DAPISTREAM stream, Integer dataLen )
Reads a portion of data from an opened version stream.
 o VerStreamWrite( DAPISTREAM stream, Bytes theBytes )
Writes a portion of data to an opened version stream.

Class Attributes

 o ALIAS_NODE
 Integer ALIAS_NODE

The subtype of an alias node. The value is 1.

 o ALL_COLUMNS
 Integer ALL_COLUMNS

Specify to include all columns (both system and user columns). Used by DAPI.GetNodeColumnNames() and DAPI.GetVersionColumnNames().

 o ATTR_DATE
 Integer ATTR_DATE

Specifies that an attribute type is a Date. Used by DAPI.AddCategoryAttr().

 o ATTR_FCHAR
 Integer ATTR_FCHAR

Specifies that an attribute type is text of a fixed length. Used by DAPI.AddCategoryAttr().

 o ATTR_INT
 Integer ATTR_INT

Specifies that the attribute type is an Integer. Used by DAPI.AddCategoryAttr().

 o ATTR_LCHAR
 Integer ATTR_LCHAR

Specifies than an attribute type is long length text. Used by DAPI.AddCategoryAttr().

 o ATTR_REAL
 Integer ATTR_REAL

Specifies that the attribute type is a Real number. Used by DAPI.AddCategoryAttr().

 o ATTR_SET_ALL
 Integer ATTR_SET_ALL

Specify to include both the system and category attributes. Used by DAPI.GetNodeUserAttr() and DAPI.SetNodeUserAttr().

 o ATTR_SET_CAT
 Integer ATTR_SET_CAT

Specify to include only the category attributes. Used by DAPI.GetNodeUserAttr() and DAPI.SetNodeUserAttr().

 o ATTR_SET_SYS
 Integer ATTR_SET_SYS

Specify to include only the system attribute. Used by DAPI.GetNodeUserAttr() and DAPI.SetNodeUserAttr().

 o ATTR_VCHAR
 Integer ATTR_VCHAR

Specifies that the attribute type is variable length text. Used by DAPI.AddCategoryAttr().

 o AuditEventADDVERSION
 Integer AuditEventADDVERSION

The auditing event recorded when a version is added to a node, as with DAPI.AddVersion() or DAPI.AddValAsVersion().

 o AuditEventALIAS
 Integer AuditEventALIAS

The auditing event recorded when a node is aliased, as with DAPI.AliasNode().

 o AuditEventATTRCHANGE
 Integer AuditEventATTRCHANGE

The auditing event recorded when the system or category attributes of a node have changed, as with DAPI.SetNodeUserAttr() or DAPI.UpdateNode().

 o AuditEventCDORDERED
 Integer AuditEventCDORDERED

The auditing event recorded when the ordering of a compound document's child node has changed, as with DAPI.UpdateNode()

 o AuditEventCOPY
 Integer AuditEventCOPY

The auditing event recorded when a node is copied, as with DAPI.CopyNode().

 o AuditEventCREATE
 Integer AuditEventCREATE

The auditing event recorded when a node is created, as with DAPI.AliasNode() or DAPI.CreateNode().

 o AuditEventCREATEGEN
 Integer AuditEventCREATEGEN

The auditing event recorded when a generation is created for a node, as with DAPI.CreateGeneration().

 o AuditEventCREATEREL
 Integer AuditEventCREATEREL

The auditing event recorded when a release is created for a compound document, as with DAPI.CreateNode() called with a subtype of 138.

 o AuditEventCREATEREND
 Integer AuditEventCREATEREND

The auditing event recorded when a rendition is added to a version of a node, as with DAPI.AddRendition() or DAPI.AddRenditionFromStream().

 o AuditEventCREATEREV
 Integer AuditEventCREATEREV

The auditing event recorded when a revision is created for a compound document, as with DAPI.CreateNode() with a subtype of 139.

 o AuditEventDELETE
 Integer AuditEventDELETE

The auditing event recorded when a node is deleted, as with DAPI.DeleteNode().

 o AuditEventDELREL
 Integer AuditEventDELREL

The auditing event recorded when a release of a compound document is deleted, as with DAPI.DeleteNode() with a subtype of 138.

 o AuditEventDELREND
 Integer AuditEventDELREND

The auditing event recorded when a rendition of a version is deleted, as with DAPI.DeleteRendition().

 o AuditEventDELREV
 Integer AuditEventDELREV

The auditing event recorded when a revision of a compound document is deleted, as with DAPI.DeleteNode() with a subtype of 139.

 o AuditEventDELVERSION
 Integer AuditEventDELVERSION

The auditing event recorded when a version of a node is deleted, as with DAPI.DeleteVersion().

 o AuditEventFETCH
 Integer AuditEventFETCH

The auditing event recorded when a version of a node is fetched, as with DAPI.FetchVersion(), DAPI.FetchVersionToStream(), or DAPI.FetchVersionRangesToStream().

 o AuditEventLOGIN
 Integer AuditEventLOGIN

The auditing event recorded when a user logs in to the system. This event is not recorded by any DAPI function.

 o AuditEventLOGOUT
 Integer AuditEventLOGOUT

The auditing event recorded when a user logs out of the system. This event is not recorded by any DAPI function.

 o AuditEventMOVE
 Integer AuditEventMOVE

The auditing event recorded when a node is moved, as with DAPI.MoveNode().

 o AuditEventPERMCHANGE
 Integer AuditEventPERMCHANGE

The auditing event recorded when the permissions of a node has changed, as with DAPI.UpdateNode(), DAPI.AddNodeRight(), DAPI.UpdateNodeRight(), or DAPI.DeleteNodeRight().

 o AuditEventPURGE
 Integer AuditEventPURGE

The auditing event recorded when versions of a node is purged, as with DAPI.PurgeVersions().

 o AuditEventRENAME
 Integer AuditEventRENAME

The auditing event recorded when a node is renamed, as with DAPI.RenameNode().

 o AuditEventRESERVE
 Integer AuditEventRESERVE

The auditing event recorded when a node is reserved, as with DAPI.ReserveNode().

 o AuditEventUNRESERVE
 Integer AuditEventUNRESERVE

The auditing event recorded when a node is unreserved, as with DAPI.UnreserveNode().

 o AuditSection
 String AuditSection

The auditing section identifier used in system initialization. It is used to record the auditing events of a node type in the KIni table. The value of the identifier is 'Livelink.Auditing'

 o BLK_READ
 Integer BLK_READ

A provider callback reason constant which indicates the reading of a block of blob data from the database.

 o BLK_WRITE
 Integer BLK_WRITE

A provider callback reason constant which indicates the writing of a block of blob data to the database.

 o BY_DATAID
 Integer BY_DATAID

Specify to operate based on the unique node ID. Used by DAPI.GetNodeByID().

 o CANCEL
 Integer CANCEL

A return status constant used by the callback to cancel an operation without causing an error.

 o CB_COPY_VERSION
 Integer CB_COPY_VERSION

A DAPI callback reason constant which indicates a version of a node will be copied.

 o CB_FILTER_NODES
 Integer CB_FILTER_NODES

A DAPI callback reason constant which indicates one or more nodes are fetched for application node filtering.

 o CB_DELETE_VERSION
 Integer CB_DELETE_VERSION

A DAPI callback reason constant which indicates a version of a node will be deleted.

 o CB_NEW_VERSION
 Integer CB_NEW_VERSION

A DAPI callback reason constant which indicates a new version will be added to a node.

 o CB_UPDATE_NODE_USERID
 Integer CB_UPDATE_NODE_USERID

A DAPI callback reason constant which indicates the owner of a node is updated. This is when the pUserID field is updated by DAPI.UpdateNode().

 o CLOSE
 Integer CLOSE

A provider callback reason constant which indicates the closing of a blob after opening for reading or writing.

 o COPY_A_NODE
 Integer COPY_A_NODE

A copy option for copying only the specified node without copying its child nodes. Used by DAPI.CopyNode().

 o COPY_CURRENTV
 Integer COPY_CURRENTV

A copy option for copying only the current version of all nodes. Used by DAPI.CopyNode() and DAPI.CopyANode().

 o COPY_DST_CAT
 Integer COPY_DST_CAT

A copy option to indicate that the copied node will have the same category as the destination parent node. Used by DAPI.CopyANode().

 o COPY_DST_PERMS
 Integer COPY_DST_PERMS

A copy option indicating that the copied node will have the same permissions as the destination parent node. Used by DAPI.CopyANode().

 o COPY_DST_USERATTS
 Integer COPY_DST_USERATTS

A copy option indicating that the copied node will have the same user attributes as the destination parent node. Used by DAPI.CopyANode().

 o COPY_NODE
 Integer COPY_NODE

A DAPI callback reason constant indicating encountered nodes will be copied. The callback is issued by DAPI.CopyNode() and DAPI.CopyANode().

 o COPY_NO_CAT
 Integer COPY_NO_CAT

A copy option indicating that the category and its attributes should not be copied. Used by DAPI.CopyANode().

 o COPY_NO_USERATTS
 Integer COPY_NO_USERATTS

A copy option indicating that the user attributes should not be copied. Used by DAPI.CopyANode().

 o COPY_NO_VER
 Integer COPY_NO_VER

A copy option indicating that version information will not be copied. Used by DAPI.CopyANode().

 o COPY_PUBLISHEDV
 Integer COPY_PUBLISHEDV

A copy option indicating that only the published version will be copied. Used by DAPI.CopyNode().

 o COPY_SET_CURRUSER
 Integer COPY_SET_CURRUSER

A copy option which sets the copied node's creator to the current user. Used by DAPI.CopyANode().

 o COPY_SPECIFICV
 Integer COPY_SPECIFICV

A copy option for copying a specific version of a node. Used by DAPI.CopyANode().

 o COPY_SRC_PERMS
 Integer COPY_SRC_PERMS

A copy option indicating that the copied node will have the same permissions as the source node. Used by DAPI.CopyNode().

 o COPY_UNLOCKV
 Integer COPY_UNLOCKV

A copy option indicating that all copied versions will be unlocked. Used by DAPI.CopyANode().

 o COPY_UNRESERVE
 Integer COPY_UNRESERVE

A copy option indicating that all copied nodes will be unreserved. Used by DAPI.CopyNode() and DAPI.CopyANode().

 o DATA_DELETE
 Integer DATA_DELETE

A permission bit which enables version deletion.

 o DATA_FETCH
 Integer DATA_FETCH

A permission bit which enables access to a version's blob data contents.

 o DATA_READ
 Integer DATA_READ

A permission bit which enables access to version attributes.

 o DATA_USER1
 Integer DATA_USER1

A permission bit for custom version permission use.

 o DATA_USER2
 Integer DATA_USER2

A permission bit for custom version permission use.

 o DATA_WRITE
 Integer DATA_WRITE

A permission bit which enables modification of version attributes.

 o DELETE
 Integer DELETE

A provider callback reason constant which indicates the deletion of a blob.

 o DELETE_NODE
 Integer DELETE_NODE

A DAPI callback reason constant indicating the encountered node will be deleted. The callback is issued by DAPI.DeleteNode().

 o DELETE_NO_CHILD_COUNT_UPDATE
 Integer DELETE_NO_CHILD_COUNT_UPDATE

A delete option for DeleteNode() to skip the child count update.

 o DapiNodeType
 Integer DapiNodeType

The DapiNode type number.

 o DapiSessionType
 Integer DapiSessionType

The DapiSession type number.

 o DapiStreamType
 Integer DapiStreamType

The DapiStream type number.

 o DapiVersionType
 Integer DapiVersionType

The DapiVersion type number.

 o ERROR
 Integer ERROR

A return status constant used by a callback to abort an operation.

 o FETCHABLE
 Integer FETCHABLE

A provider callback reason constant which indicates querying whether the blob content is fetchable.

 o FILE_GET
 Integer FILE_GET

A provider callback reason constant which indicates the reading of a blob from the database.

 o FILE_PUT
 Integer FILE_PUT

A provider callback reason constant which indicates the writing of a blob from the database.

 o FULL_PERM_MASK
 Integer FULL_PERM_MASK

An Integer mask which represents full permissions.

 o GENERATION_NODE
 Integer GENERATION_NODE

The subtype of a generation node. The value is 2.

 o LOCK_VERSION
 Integer LOCK_VERSION

The default version locked flag. The value is 128.

 o MOVE_NODE
 Integer MOVE_NODE

A DAPI callback reason constant which indicates a node was encountered and will be moved. The callback is issued by DAPI.MoveNode().

 o MOVE_CB_PERM_CONTROLLER
 Integer MOVE_CB_PERM_CONTROLLER

If this flag is set in the cbMoveOptions returned to the DAPI move callback, nodes will not have their own perms after the move, but will instead be controlled by (have permID set to) the same node as the destination of the move if that destination node has a permID, and otherwise by: the target itself, if KAPI_MOVE_CB_PERM_CONTROLLER_SUBTREES is also set; or the node's parent, if KAPI_MOVE_CB_PERM_CONTROLLER_SUBTREES is not set. This flag is appropriate when a move occurs from an acl-controlled area into a permID-controlled area.

 o MOVE_CB_PERM_CONTROLLER_SUBTREES
 Integer MOVE_CB_PERM_CONTROLLER_SUBTREES

Similar to KAPI_MOVE_CB_PERM_CONTROLLER except that it handles subtrees, with their own perm-controlling roots, within the tree of moving nodes. This means that: A) forceInheritPerm is ignored. B) Nodes that do not have a perm-controller (i.e. have their own ACLs) before the move will not have their perms changed except for reparenting their ACLs if necessary. These nodes will be perm-controllers for their descendants. C) Nodes with a perm-controller before the move will also have one after the move. D) The default perm-controller is the perm-controller of the destination if present, or the target itself otherwise (as for this flag with KAPI_MOVE_CB_PERM_CONTROLLER) E) Each perm-controlled node after the move will be controlled by the closest ancestor in the moved tree which is a perm-controller, or by the default perm-controller if there is no such ancestor in the moved subtree. This flag should be set for all nodes when a move occurs within an area with one or more perm-controllers. Intuitively, its effect is to correctly maintain the structure of nested perm-controlled subtrees (where a "perm-controlled subtree" is a root node with ACLs and the descendants which have their permIDs set to that root).

 o MOVE_ROOT_NODE
 Integer MOVE_ROOT_NODE

Internal usage.

 o MOVE_SUB_NODE
 Integer MOVE_SUB_NODE

Internal usage.

 o NODE_ADD_CHILDREN
 Integer NODE_ADD_CHILDREN

A permission bit which enables the child node addition.

 o NODE_CONTROL
 Integer NODE_CONTROL

A permission bit which enables node permission viewing and editing.

 o NODE_DELETE
 Integer NODE_DELETE

A permission bit which enables deletion of the node.

 o NODE_DEL_CHILDREN
 Integer NODE_DEL_CHILDREN

A permission bit which enables deletion of child nodes for this node.

 o NODE_MODIFY_ATTR
 Integer NODE_MODIFY_ATTR

A permission bit which enables category attribute modification.

 o NODE_NODE
 Integer NODE_NODE

The default subtype of a node. The value is 0.

 o NODE_NOT_RESERVED
 Integer NODE_NOT_RESERVED

The default node unreserved flag. The value is 0.

 o NODE_READ
 Integer NODE_READ

A permission bit which enables access to the node's content and attributes.

 o NODE_READ_EXPLICIT
 Integer NODE_READ_EXPLICIT

A permission bit which enables a user to see the node.

 o NODE_USER1
 Integer NODE_USER1

A permission bit for a custom node permissions.

 o NODE_USER2
 Integer NODE_USER2

A permission bit for a custom node permissions.

 o NOTIFY_ACL_ADD
 Integer NOTIFY_ACL_ADD

The change notification constant for the addition of an ACL to a node. It is used in the NType column of the DTreeNotify table. The value is 8.

 o NOTIFY_ACL_DELETE
 Integer NOTIFY_ACL_DELETE

The change notification constant for the deleting of an ACL from a node. It is used in column NType of the DTreeNotify table. The value is 10.

 o NOTIFY_ACL_UPDATE
 Integer NOTIFY_ACL_UPDATE

The change notification constant for the modification of an ACL of a node. It is used in column NType of the DTreeNotify table. The value is 9.

 o NOTIFY_COPY
 Integer NOTIFY_COPY

The change notification constant for the copying of a node. It is used in column NType of the DTreeNotify table. The value is 2.

 o NOTIFY_CREATE
 Integer NOTIFY_CREATE

The change notification constant for the creation of a node. It is used in column NType of the DTreeNotify table. The value is 1.

 o NOTIFY_CREATE_ROOT
 Integer NOTIFY_CREATE_ROOT

The change notification constant for the creation of a root node. It is used in column NType of the DTreeNotify table. The value is 3.

 o NOTIFY_DELETE
 Integer NOTIFY_DELETE

The change notification constant for deleting a node. It is used in column NType of the DTreeNotify table. The value is 4.

 o NOTIFY_DELETE_VERSION
 Integer NOTIFY_DELETE_VERSION

The change notification constant for deleting a node version. It is used in column NType of the DTreeNotify table. The value is 2004.

 o NOTIFY_MOVE
 Integer NOTIFY_MOVE

The change notification constant for moving a node. It is used in column NType of the DTreeNotify table. The value is 5.

 o NOTIFY_RENAME
 Integer NOTIFY_RENAME

The change notification constant for renaming a node. It is used in column NType of the DTreeNotify table. The value is 6.

 o NOTIFY_UPDATE
 Integer NOTIFY_UPDATE

The change notification constant for the modification of a node. It is used in column NType of the DTreeNotify table. The value is 7.

 o OK
 Integer OK

The status constant indicating success. Returned by DAPI functions to indicate that a call was completed successfully. The value is 0.

 o OPEN_IN
 Integer OPEN_IN

A provider callback reason constant which indicates opening blob data for reading.

 o OPEN_OUT
 Integer OPEN_OUT

A provider callback reason constant which indicates the opening of blob data for writing.

 o PERMTYPE_ACL
 Integer PERMTYPE_ACL

The permission type enabling ACL permissions. It is used in column ACLType of the DTreeACL table. The value is 0.

 o PERMTYPE_GROUP
 Integer PERMTYPE_GROUP

The permission type enabling group permissions. It is used in column ACLType of the DTreeACL table. The value is 2.

 o PERMTYPE_SYSTEM
 Integer PERMTYPE_SYSTEM

The permission type enabling system permissions. It is used in column ACLType of the DTreeACL table. The value is 4.

 o PERMTYPE_USER
 Integer PERMTYPE_USER

The permission type enabling user permissions. It is used in column ACLType of the DTreeACL table. The value is 1.

 o PERMTYPE_WORLD
 Integer PERMTYPE_WORLD

The permission type enabling world permissions. It is used in column ACLType of the DTreeACL table. The value is 3.

 o PERM_DELETE
 Integer PERM_DELETE

A permission level constant enabling permissions up to, and including, deletion. It is used in the See column of the DTreeACL table. The value is 4.

 o PERM_SEE
 Integer PERM_SEE

A permission level constant enabling see privileges only. It is used in the See column of the DTreeACL table. The value is 1.

 o PERM_SEECONTENTS
 Integer PERM_SEECONTENTS

A permission level constant enabling permissions up to, and including, see contents privileges. It is used in the See column of the DTreeACL table. The value is 2.

 o PERM_TO_RWD
 Integer PERM_TO_RWD

A return status constant used by the callback to change a node permissions in a RWD setting in a move operation.

 o PERM_WRITE
 Integer PERM_WRITE

A permission level constant enabling permissions up to, and including, modify privileges. It is used in the See column of the DTreeACL table. The value is 3.

 o PLATFORM_MAC
 Integer PLATFORM_MAC

The Macintosh platform. This constant is used in the platform attribute of a version.

 o PLATFORM_MOTIF
 Integer PLATFORM_MOTIF

The UNIX platform. This constant is used in the platform attribute of a version.

 o PLATFORM_UNKNOWN
 Integer PLATFORM_UNKNOWN

An unknown platform. This constant is used in the platform attribute of a version.

 o PLATFORM_WINDOWS
 Integer PLATFORM_WINDOWS

The Windows platform. This constant is used in the platform attribute of a version.

 o RESERVE_NODE
 Integer RESERVE_NODE

The default node reserved flag. The value is 128.

 o SEEK
 Integer SEEK

A provider callback reason constant which indicates the setting of a blob data position.

 o SKIP
 Integer SKIP

A return status constant used by the callback to skip a copy of a node in a copy operation without causing an error.

 o SYSTEM_COLUMNS
 Integer SYSTEM_COLUMNS

Specify to include the system columns only. Used by DAPI.GetNodeColumnNames() and DAPI.GetVersionColumnNames().

 o UNUSED
 Integer UNUSED

An integer value indicating that an attribute is unused. The value is -1. For example, if a node does not contain any versions, the maximum number of versions is set to unused.

 o USER_COLUMNS
 Integer USER_COLUMNS

Specify to include the user columns only. Used by DAPI.GetNodeColumnNames() and DAPI.GetVersionColumnNames().

 o VCOPY_ADDVER
 Integer VCOPY_ADDVER

A version copy option for setting the copied version's creator to the current user. Used by DAPI.CopyVersion().

 o VCOPY_NO_USERATTS
 Integer VCOPY_NO_USERATTS

A version copy option indicating that user attributes should not be copied. Used by DAPI.CopyVersion().

 o VCOPY_RENDITIONS
 Integer VCOPY_RENDITIONS

A version copy option to copy the renditions with the version.

 o VCOPY_UNLOCK
 Integer VCOPY_UNLOCK

A version copy option indicating that the copied version will be unlocked. Used by DAPI.CopyVersion().

 o VersionNotYetLoaded
 Integer VersionNotYetLoaded

A return status constant which indicates that the version's blob content has not yet been loaded. Used by $WebDoc.WebDocUtils.NodeToWeb().

 o VERSION_CREATE_MAJOR
 Integer VERSION_CREATE_MAJOR

A constant to indicate the creation of a major version. A major version will be created if this constant is assigned to the pVerMajor field of a newly allocated DAPIVERSION handler used in DAPI.AddVersion() and DAPI.CopyVersion().

 o VERSION_GET_CURRENT
 Integer VERSION_GET_CURRENT

A constant to indicate the retrieval of the current version. It is used in DAPI.GetVersion() to get the current version of a standard versioning node or the current version (either major or minor) of a major and minor versioning node.

 o VERSION_GET_CURRENT_MAJOR
 Integer VERSION_GET_CURRENT_MAJOR

A constant to indicate the retrieval of the current major version. It is used in DAPI.GetVersion() to get the current major version of a major and minor versioning node.

 o VERSION_GET_CURRENT_PUBLISHED
 Integer VERSION_GET_CURRENT_PUBLISHED

A constant to indicate tthe retrieval of the current published version. It is used in DAPI.GetVersion() to get the current version of a standard versioning node or the current major version of a major and minor versioning node.

 o VERSION_NOT_LOCKED
 Integer VERSION_NOT_LOCKED

The default version unlocked flag. The value is 0.

Class Methods

 o AddAttrToCategory [Note]
 Integer AddAttrToCategory(
                  DAPISESSION session,
                  String category,
                  String attribute,
                  Boolean optFlag )

Adds the specified attribute to the specified category.

This inserts a row into the DCatAttrs table. Both the category and the attribute specified must exist or the function will fail. Attributes can be added to more than one category.

Parameters:
session  -  The DAPISESSION object handle.
category  -  The name of the category to which the attribute will be added. The category specified must have previously been created using DAPI.AddCategory().
attribute  -  The name of the attribute to add. The attribute specified must have previously been created using DAPI.AddCategoryAttr().
optFlag  -  TRUE to indicate that the specified attribute is required.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddCategory [Note]
 Integer AddCategory(
               DAPISESSION session,
               String category,
               String displayName,
               String tableName )

Adds a new category.

This inserts a row into the DCategories table and modifies the database schema by creating the table specified by tableName. The structure of this table is modified as attributes are added to the category using DAPI.AddAttrToCategory().

Parameters:
session  -  The DAPISESSION object handle.
category  -  The name of the new category.
displayName  -  The name to display when the category is used in the application.
tableName  -  The name of the table in which the attribute data associated with this category should be stored.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddCategoryAttr [Note]
 Integer AddCategoryAttr(
                 DAPISESSION session,
                 String attribute,
                 Integer type,
                 Integer length,
                [List extendList] )

Adds a new category attribute.

This inserts a row into the DAttributes table. New attributes must be added to a category before they can be used. An attribute can be added to more than one category, if desired.

Parameters:
session  -  The DAPISESSION object handle.
attribute  -  The name of the new attribute.
type  -  Specifies a constant indicating the DAPI attribute data type. Acceptable values are:
 DAPI.ATTR_DATE
 DAPI.ATTR_FCHAR
 DAPI.ATTR_INT
 DAPI.ATTR_LCHAR
 DAPI.ATTR_REAL
 DAPI.ATTR_VCHAR
length  -  An Integer indicating the length of the attribute. The type must be the DAPI.ATTR_FCHAR or DAPI.ATTR_VCHAR or it is ignored.
extendList  -  Specifies an optional List of extended argument values. The DAttributes table must first be modified (using interactive SQL) to accept the values specified in this List. The data types of the values in the List must correspond to the data types of the columns added to the DAttributes table.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddNodeRight
 Integer AddNodeRight(
                DAPINODE node,
                Integer rightID,
                Integer permissions )

Adds a user or group access right to the specified node.

This inserts a row into the DTreeACL table.

Parameters:
node  -  The DAPINODE object handle.
rightID  -  The user or group ID.
permissions  -  The permissions bit mask which is one or more node permission constants joined by bitwise OR operators.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddNodeUserColumn
 Integer AddNodeUserColumn(
                  DAPISESSION sesssion,
                  String columnName,
                  String columnType )

Adds a new column to the DTree table.

This is most often used during system configuration to properly set up the database.

Parameters:
session  -  The DAPISESSION object handle.
columnName  -  The name of the new column.
columnType  -  The data type of the new column.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddProvider
 Integer AddProvider(
               DAPISESSION session,
               String provider,
               Boolean logical,
               Dynamic script,
              [Dynamic object] )

Adds a custom provider for blob data storage to the current session.

Parameters:
session  -  The DAPISESSION object handle.
provider  -  The name of the custom provider.
logical  -  TRUE to indicate non-blob storage.
script  -  An OScript script reference. This script must contain functions to handle getting, writing, and deleting the blob data.
object   The specific OSpace object of the script.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddRendition
 Integer AddRendition(
                DAPIVERSION version,
                DAPIVERSION rendition,
                String provider,
                String localFilePath )

Adds a new rendition to the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
rendition  -  The newly allocated DAPIVERSION object handle. This allows file attributes to be pre-assigned to the rendition.
provider  -  The name of the provider. Defaults to the provider set by the DAPI.SetDefaultProvider() if it is an empty string.
localFilePath  -  The local file path of the rendition file.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddRenditionFromStream
 Integer AddRenditionFromStream(
                     DAPIVERSION version,
                     String renditionType,
                     String provider,
                     Socket aSocket,
                     Assoc renditionAttr )

Adds a new rendition to the specified version by getting data from the specified Socket object.

Parameters:
version  -  The DAPIVERSION object handle.
renditionType  -  The name of the new rendition.
provider  -  The name of the provider. Defaults to the provider set by the DAPI.SetDefaultProvider() if it is an empty string.
aSocket  -  The Socket object from which the rendition contents are read.
renditionAttr An Assoc object containing the file attributes of the rendition.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddValAsVersion
 Integer AddValAsVersion(
                 DAPINODE node,
                 DAPIVERSION version,
                 String provider,
                 Dynamic value )

Adds a value as a version to the specified node.

Parameters:
node  -  The DAPINODE object handle.
version  -  The newly allocated DAPIVERSION object handle. This allows file attributes to be pre-assigned to the version.
provider  -  The name of the provider. Defaults to the provider set by the DAPI.SetDefaultProvider() if it is an empty string.
value  -  The value to be store as a version. Acceptable values are Boolean, Date, Integer, List, Real, and String. The Assoc, RecArray, and Record data types are currently not supported.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddVersion
 Integer AddVersion(
               DAPINODE node,
               DAPIVERSION version,
               String provider,
               String localFilePath )

Adds a version to the specified node.

Parameters:
node  -  The DAPINODE object handle.
version  -  The newly allocated DAPIVERSION object handle. This allows file attributes to be pre-assigned to the version.
provider  -  The name of the provider. Defaults to the provider set by the DAPI.SetDefaultProvider() if it is an empty string.
localFilePath  -  The local file path of the file to be stored as a version.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddVersionFromStream
 Integer AddVersionFromStream(
                    DAPINODE node,
                    DAPIVERSION version,
                    String provider,
                    Socket aSocket,
                    Assoc versionAttr )

Adds a version to the specified node by retrieving data from the specified Socket object.

Parameters:
node  -  The DAPINODE object handle.
version  -  The newly allocated DAPIVERSION object handle. This allows file attributes to be pre-assigned to the version.
provider  -  The name of the provider. Defaults to the provider set by the DAPI.SetDefaultProvider() if it is an empty string.
aSocket  -  The Socket object from which the version contents are read.
versionAttr An Assoc object contains the file attributes of the version.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AddVersionUserColumn
 Integer AddVersionUserColumn(
                    DAPISESSION session,
                    String columnName,
                    String columnType )

Adds a new column to the DVersData table.

This is most often used during system configuration to properly set up the database.

Parameters:
session  -  The DAPISESSION object handle.
columnName  -  The name of the new column.
columnType  -  The data type of the new column.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AliasNode
 Integer AliasNode(
              DAPINODE original,
              DAPINODE parent,
              DAPINODE new,
             [Boolean copyAcls] )

Creates a new node that is an alias of the specified node.

A unique ID is automatically assigned to the new node if successful.

Parameters:
original  -  The DAPINODE object handle of the node for which an alias is created.
parent  -  The DAPINODE object handle of the node that will be the parent of the new alias node.
new  -  The newly allocated DAPINODE object handle. This allows node attributes to be pre-assigned to the node.
copyAcls  -  TRUE if the the alias will inherit the access control list (ACL) from the parent node; FALSE otherwise. FALSE is the default.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o AllocNode
 DAPINODE AllocNode(
               DAPISESSION session )

Allocates a new DAPINODE object in memory.

Once a new node object has been allocated, values can be assigned to the node properties before the actual creation of the node.

Parameters:
session  -  The DAPISESSION object handle.
Returns:
The DAPINODE object handle if successful; Error otherwise.
 o AllocSession
 DAPISESSION AllocSession(
                    CAPILOGIN login,
                   [Boolean notifyChange] )

Allocates a DAPISESSION object for a login user.

A DAPISESSION contains information pertaining node management. A DAPISESSION is a required argument for most DAPI functions.

Parameters:
login  -  The CAPILOGIN object handle specifically for the login user.
notifyChange  -  TRUE to enable the recording of node change events for text search indexing procedures, FALSE otherwise. The default is TRUE.
Returns:
The DAPISESSION object handle; Error otherwise.
 o AllocVersion
 DAPIVERSION AllocVersion(
                    DAPISESSION session )

Allocates a new DAPIVERSION object in memory.

Once a new version object has been allocated, values can be assigned to the version properties before the actual creation of the version.

Parameters:
session  -  The DAPISESSION object handle.
Returns:
The DAPIVERSION object handle if successful; Error otherwise.
 o Audit
 Integer Audit(
            Dynamic nodeOrSession,
            String userEvent,
            String description )

Records a custom auditing event.

This inserts a row in the DAudit table. If the first parameter is a DAPINODE object handle, then the ID and the name of the node will be recorded. If the first parameter is a DAPISESSION object handle, then the ID will be 0 and the name will be undefined.

Parameters:
nodeOrSession  -  The DAPINODE object handle or the DAPISESSION object handle.
userEvent  -  A string indicating the event.
description  -  A string giving a detailed description of the event.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o MoveProviderData
 Integer MoveProviderData(
               DAPIVERSION version,
               String providerName )

Changes the data provider storage of the specified version. Does not cause the version or node to be re-indexed. Does not update the modification date of the version or node.

Parameters:
version  -  The DAPIVERSION object handle.
providerName - The name of the provider.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CopyANode
 Integer CopyANode(
              DAPINODE original,
              DAPINODE parent,
              DAPINODE new,
             [Integer options],
             [Integer versionNum] )

Copies a node but not its child nodes.

DAPI will issue a callback for the node it copied by calling a script setup by DAPI.SetCallback().

Parameters:
original  -  The DAPINODE object handle of the node to copy.
parent  -  The DAPINODE object handle of the node that will be the parent of the copied node.
new  -  The newly allocated DAPINODE object handle. This allows node attributes to be pre-assigned to the node.
options  -  An optional flag for copy options. This flag can be joined by bitwise OR operators using the following constants:
 DAPI.COPY_UNRESERVE
 DAPI.COPY_CURRENTV
 DAPI.COPY_UNLOCKV
 DAPI.COPY_SPECIFICV
 DAPI.COPY_NO_VER
 DAPI.COPY_DST_PERMS
 DAPI.COPY_DST_CAT
 DAPI.COPY_NO_CAT
 DAPI.COPY_DST_USERATTS
 DAPI.COPY_NO_USERATTS
 DAPI.COPY_SET_CURRUSER
versionNum  -  The specific version to be copied with the node. Used only if the option DAPI.COPY_SPECIFICV is used in options.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CopyCategory [Note]
 Integer CopyCategory(
                DAPINODE original,
                DAPINODE node )

Copies the category and attributes of one node to another.

Call DAPI.UpdateNode() after this function to save the changes to the database.

Parameters:
original  -  The DAPINODE object handle of the node whose category attributes are to be copied.
node  -  The DAPINODE object handle of the node to which the original node's category attributes are to be copied.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CopyNode
 DAPINODE CopyNode(
               DAPINODE original,
               DAPINODE parent,
              [Integer options],
              [Dynamic newNames] )

Copies a node and its child nodes.

DAPI will issue a callback for each node it encounters by calling a script setup by DAPI.SetCallback().

Parameters:
original  -  The DAPINODE object handle of the node to copy.
parent  -  The DAPINODE object handle of the node that will be the parent of the copied node.
options  -  An optional flag for copy options. This flag can be joined by bitwise OR operators using the following constants:
 DAPI.COPY_A_NODE
 DAPI.COPY_CURRENTV
 DAPI.COPY_UNLOCKV
 DAPI.COPY_UNRESERVE
newNames  -  An optional String indicating a name for the copied node, or an Assoc of multilingual names, keyed by language code.
Defaults to the name of the original node if not specified.
Returns:
The DAPINODE object handle of the copied node if successful; Error otherwise.
 o CopyNodeUserAttrs
 Integer CopyNodeUserAttrs(
                  DAPINODE original,
                  DAPINODE node )

Copies the user attributes of one node to another.

Call DAPI.UpdateNode() after this function to save the changes to the database.

Parameters:
original  -  The DAPINODE object handle of the node whose user attributes are to be copied.
node  -  The DAPINODE object handle of the node to which the original node's user attributes are to be copied.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CopyVersion
 Integer CopyVersion(
               DAPIVERSION originalVersion,
               DAPINODE node,
               DAPIVERSION newVersion,
              [Integer options],
              [String provider] )

Copies a specified version as a new version of the specified node.

Parameters:
originalVersion  -  The DAPIVERSION object handle of the version to copy.
node  -  The DAPINODE object handle of the node where the new version is stored.
newVersion  -  The newly allocated DAPIVERSION object handle. This allows version attributes to be pre-assigned to the version.
options  -  An optional flag for copy options. This flag can be joined by bitwise OR operators using the following constants:
 DAPI.VCOPY_ADDVER
 DAPI.VCOPY_NO_USERATTR
 DAPI.VCOPY_UNLOCK
provider  -  The name of the provider. Defaults to the provider set by the DAPI.SetDefaultProvider() if it is an empty string.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CopyVersionUserAttrs
 Integer CopyVersionUserAttrs(
                    DAPIVERSION original,
                    DAPIVERSION version )

Copies the user attributes of one version to another.

Call DAPI.UpdateVersion() after the this function to save modifying the database.

Parameters:
original  -  The DAPIVERSION object handle of the version whose user attributes are to be copied.
version  -  The DAPIVERSION object handle of the version to which the original version's user attributes are to be copied.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CreateGeneration
 Integer CreateGeneration(
                  DAPINODE original,
                  DAPINODE parent,
                  DAPINODE new,
                 [Boolean rootOnly],
                 [Boolean copyAcls] )

Creates a new node that is a generation of the specified node.

A generation is a reference to the specific version, release, or revision of a node. It causes a system lock on the specific version, release, or revision. A unique ID is automatically assigned to the new node upon successful completion.

This function will create a generation of the current version, release, or revision unless the current version, major, or minor attributes are set in the newly allocated DAPINODE object.

Parameters:
original  -  The DAPINODE object handle of the node for which a new generation is created.
parent  -  The DAPINODE object handle of the node that will be the parent of the new generation node
new  -  The newly allocated DAPINODE object handle. This allows node attributes to be pre-assigned to the node.
rootOnly  -  An optional flag where TRUE indicates that only the root node is to be included in the creation of generations. Defaults to FALSE if not specified.
copyAcls  -  TRUE if the generation will inherit the access control list (ACL) from the parent node; FALSE otherwise. The default is FALSE
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CreateNode
 Integer CreateNode(
               DAPINODE new,
               DAPINODE parent,
              [Boolean copyAcls] )

Creates a new node.

A unique ID is automatically assigned to the new node upon successful completion.

Parameters:
new  -  The newly allocated DAPINODE object handle. This allows node attributes to be pre-assigned to the node.
parent  -  The DAPINODE object handle of the node that will be the parent of the new node.
copyAcls  -  TRUE if the new node will inherit the access control list (ACL) from the parent node; FALSE otherwise. The default is FALSE.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o CreateRootNode
 Integer CreateRootNode(
                 DAPINODE new )

Creates a root node for a volume.

A unique ID is automatically assigned to the new node upon successful execution of this function. To create a root node with a specific volume ID, preset the volume ID in the newly allocated DAPINODE object.

Parameters:
new  -  The newly allocated DAPINODE object handle. This allows node attributes to be pre-assigned to the node.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o DelAttrFromCategory [Note]
 Integer DelAttrFromCategory(
                   DAPISESSION session,
                   String category,
                   String attribute )

Deletes an attribute from a category.

This deletes a row from the DCatAttrs table.

Parameters:
session  -  The DAPISESSION object handle.
category  -  The name of the category from which the attribute is removed.
attribute  -  The name of the attribute to delete.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o DelCategory [Note]
 Integer DelCategory(
               DAPISESSION session,
               String category,
               Boolean dropTable )

Deletes a category.

This deletes a row from the DCategories table.

Parameters:
session  -  The DAPISESSION object handle.
category  -  The name of the category to delete.
dropTable  -  TRUE if the associated category table should be deleted upon successful deletion of the category.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o DelCategoryAttr [Note]
 Integer DelCategoryAttr(
                 DAPISESSION session,
                 String attribute,
                [Boolean checkUsage] )

Deletes an attributes.

This deletes a row in the DAttributes table.

Parameters:
session  -  The DAPISESSION object handle.
attribute  -  The name of the attribute to delete.
checkUsage  -  TRUE to force a check on the usage of this attribute so that the function will fail if it is used by any category.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o DeleteNode
 Integer DeleteNode(
               DAPINODE node, 
              [Integer options] )              

Deletes the specified node and its child nodes.

This will fail if the specified node (or any of its child nodes) are reserved, referenced by a generation, or contain locked versions.

DAPI will issue a callback for each node it encounters by calling a script setup by DAPI.SetCallback().

Parameters:
node  -  The DAPINODE object handle of the node to delete.
options  -  An optional flag for delete options. This flag can be joined by bitwise OR operators using the following constants:
 DAPI.DELETE_NO_CHILD_COUNT_UPDATE
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o DeleteNodeRight
 Integer DeleteNodeRight(
                 DAPINODE node,
                 Integer rightID )

Deletes a user or group access right from the specified node.

This deletes a row from the DTreeACL table.

Parameters:
node  -  The DAPINODE object handle.
rightID  -  The user or group ID.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o DeleteRendition
 Integer DeleteRendition(
                 DAPIVERSION version,
                 String renditionType )

Deletes the specified rendition of a specified version.

Parameters:
version  -  The DAPIVERSION object handle.
renditionType  -  The type of the rendition.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o DeleteVersion
 Integer DeleteVersion(
                DAPIVERSION version )

Deletes the specified version.

Parameters:
version  -  The DAPIVERSION object handle of the version to delete.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchRendition
 Integer FetchRendition(
                 DAPIVERSION version,
                 String renditionType,
                 String localFilePath )

Copies the specified version rendition contents to a file on the local host.

Parameters:
version  -  The DAPIVERSION object handle.
renditionType  -  The type of the rendition.
localFilePath  -  The local file path to which the rendition contents are copied.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchRenditionRangeToStream
 Integer FetchRenditionRangeToStream(
                       DAPIVERSION version,
                       Socket aSocket,
                       String renditionType,
                       List rangeData )

Writes a portion of the version rendition contents to the specified Socket object.

Parameters:
version  -  The DAPIVERSION object handle.
aSocket  -  The Socket object to which the rendition contents are written.
renditionType  -  The type of the rendition.
rangeData  -  A List of two integers representing the range. The first integer is the starting position and the second integer is the end position.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchRenditionRangesToStream
 Integer FetchRenditionRangesToStream(
                        DAPIVERSION version,
                        Socket aSocket,
                        String renditionType,
                        List rangesData,
                        String headerData )

Writes multiple portions of the version rendition contents to the specified Socket object.

Parameters:
version  -  The DAPIVERSION object handle.
aSocket  -  The Socket object to which the rendition contents are written.
renditionType  -  The type of the rendition.
rangesData  -  A List of entries in which each element is a List with two integers representing a range. The first integer is the starting position and the second integer is the end position.
headerData  -  An HTML header for the specified ranges.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchRenditionToStream
 Integer FetchRenditionToStream(
                     DAPIVERSION version,
                     Socket aSocket,
                     String renditionType )

Writes the version rendition contents to the specified Socket.

Parameters:
version  -  The DAPIVERSION object handle.
aSocket  -  The Socket object to which the rendition contents are written.
renditionType  -  The type of the rendition.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchVersion
 Integer FetchVersion(
                DAPIVERSION version,
                String localFilePath )

Copies the specified version contents to a file on the local host.

Parameters:
version  -  The DAPIVERSION object handle.
localFilePath  -  The local file path to which the version contents are copied.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchVersionAsVal
 Dynamic FetchVersionAsVal(
                  DAPIVERSION version )

Retrieves the value stored as the version of a node.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
The value stored for this version if successful; Error otherwise.
 o FetchVersionRangeToStream
 Integer FetchVersionRangeToStream(
                      DAPIVERSION version,
                      Socket aSocket,
                      List rangeData )

Writes a portion of the version contents to the specified Socket.

Parameters:
version  -  The DAPIVERSION object handle.
aSocket  -  The Socket object to which the version contents are written.
rangeData  -  A List of two integers representing the range. The first integer is the starting position and the second integer is the end position.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchVersionRangesToStream
 Integer FetchVersionRangesToStream(
                       DAPIVERSION version,
                       Socket aSocket,
                       List rangesData,
                       String headerData )

Writes multiple portions of the version contents to the specified Socket object.

Parameters:
version  -  The DAPIVERSION object handle.
aSocket  -  The Socket object to which the version contents are written.
rangesData  -  A List of entries in which each element is a List with two integers representing the range. The first integer is the starting position and the second integer is the end position.
headerData  -  An HTML header for the specified ranges.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o FetchVersionToStream
 Integer FetchVersionToStream(
                    DAPIVERSION version,
                    Socket aSocket )

Writes the version contents to the specified Socket object.

Parameters:
version  -  The DAPIVERSION object handle.
aSocket  -  The Socket object to which the version contents are written.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o GetMultilingualComment
 String GetMultilingualComment(
               DAPINODE node,
               String languageCode )

Gets the comment for a DAPINODE in the specified language.

Parameters:
node  -  The DAPINODE object handle.
languageCode  -  The language code of the desired comment.
Returns:
The comment if successful, an undefined value otherwise.
 o GetMultilingualName
 String GetMultilingualName(
               DAPINODE node,
               String languageCode )

Gets the name for a DAPINODE in the specified language.

Parameters:
node  -  The DAPINODE object handle.
languageCode  -  The language code of the desired name.
Returns:
The name if successful, an undefined value otherwise.
 o GetNode
 DAPINODE GetNode(
              String namePath,
              DAPINODE startNode,
             [Boolean autoExpand ] )

Retrieves as specified by name or relative path.

For example, get a child node named 'A' by specifying 'A' for namePath, or get a grandchild node named 'B', which is a child node of 'A', by specifying 'A:B' for namePath.

Parameters:
namePath  -  A String indicating the name or relative path (separated by colons) of the child node to retrieve from the specified parent node.
startNode  -  The DAPINODE object handle identifying the starting point parent node from which the child node is retrieved.
autoExpand  -  TRUE if all node attributes are fetched up front; FALSE otherwise. The default is TRUE.
Returns:
The DAPINODE object handle of the retrieved node if successful; Error otherwise.
 o GetNodeByID
 DAPINODE GetNodeByID(
                DAPISESSION session,
                Integer volumeID/nodeID,
               [Integer nodeID],
               [Boolean autoExpand] )

Retrieves a node based on its unique ID.

It is not necessary to specify the volume ID. Use the constant DAPI.BY_DATAID to fetch the node based on the unique node ID or simply specify the node ID in the second parameter.

Parameters:
session  -  The DAPISESSION object handle.
volumeID/nodeID  -  An Integer indicating the volume ID of the node or the unique node ID if the third parameter is not specified
nodeID  -  An Integer identifying the node ID.
autoExpand  -  TRUE if all node attributes are fetched up front; FALSE otherwise. The default is TRUE.
Returns:
The DAPINODE object handle of the retrieved node if successful; Error otherwise.
 o GetNodeColumnNames
 List GetNodeColumnNames(
                DAPISESSION session,
                Integer columnType )

Returns a List of column names in the DTree table.

Parameters:
session  -  The DAPISESSION object handle.
columnType  -  TRUE if the type of columns whose names will be returned.
 DAPI.ALL_COLUMNS
 DAPI.SYSTEM_COLUMNS
 DAPI.USER_COLUMNS
Returns:
The List of column names if successful; Error otherwise.
 o GetNodePermissions
 Integer GetNodePermissions(
                   DAPINODE node )

Returns the permissions mask that the current user has on the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
The permissions bit mask which is one or more node permission constants joined by bitwise OR operators if successful; Error otherwise.
 o GetNodeRight
 Integer GetNodeRight(
                DAPINODE node,
                Integer rightID )

Returns a user or group access right for the specified node.

Parameters:
node  -  The DAPINODE object handle.
rightID  -  The user or group ID.
Returns:
The permissions bit mask which is one or more node permission constants joined by bitwise OR operators if successful; Error otherwise.
 o GetNodeRights
 RecArray GetNodeRights(
                 DAPINODE node )

Returns all user or group access rights for the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
A RecArray containing the records of the DTreeACL table if successful; Error otherwise.
 o GetNodeUserAttr
 Dynamic GetNodeUserAttr(
                 DAPINODE node,
                 String attrName,
                [Integer attrType] )

Returns a user attribute value for the specified node.

Parameters:
node  -  The DAPINODE object handle.
attrName  -  The name of the attribute.
attrType  -  An integer indicating the attribute type:
 DAPI.ATTR_SET_ALL
 DAPI.ATTR_SET_CAT
 DAPI.ATTR_SET_SYS
The default value is DAPI.ATTR_SET_ALL If it is not specified.
Returns:
The value for the specific attribute if successful; Error otherwise.
 o GetOriginalNode
 DAPINODE GetOriginalNode(
                  DAPINODE node )

Retrieves the original node referenced by the specified alias or generation node.

Note that the specified node is returned if the specified node is not an alias or a generation.

Parameters:
arg1  -  The DAPINODE object handle of the possible alias or generation node.
Returns:
The DAPINODE object handle of the original node if successful; Error otherwise.
 o GetParentNode
 DAPINODE GetParentNode(
                 DAPINODE node )

Retrieves the parent node of the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
The DAPINODE object handle of the parent node if successful; Error otherwise. Note that it returns Error if the node is a root node.
 o GetRendition
 DAPIVERSION GetRendition(
                   DAPIVERSION version,
                   String renditionType )

Retrieves a rendition of the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
renditionType  -  The type of the rendition.
Returns:
The DAPIVERSION object handle of the retrieved rendition if successful; Error otherwise.
 o GetVersion
 DAPIVERSION GetVersion(
                   DAPINODE node,
                   Integer versionNum )

Retrieves a specific version of the specified node.

Parameters:
node  -  The DAPINODE object handle.
versionNum  -  An Integer identifying which version to retrieve or the following constants:
 DAPI.VERSION_GET_CURRENT
 DAPI.VERSION_GET_CURRENT_MAJOR
 DAPI.VERSION_GET_CURRENT_PUBLISHED
Returns:
The DAPIVERSION object handle of the retrieved version if successful; Error otherwise.
 o GetVersionByID
 DAPIVERSION GetVersionByID(
                     Integer versionID,
                     DAPISESSION session )

Retrieves a version based on its unique ID.

Parameters:
versionID  -  An integer indicating the version ID
session  -  The DAPISESSION object handle.
Returns:
The DAPIVERSION object handle of the retrieved version if successful; Error otherwise.
 o GetVersionByName
 DAPIVERSION GetVersionByName(
                      DAPINODE node,
                      String versionName )

Retrieves a version based on the unique version name of a node.

Parameters:
node  -  The DAPINODE object handle.
versionName  -  The unique name of the version.
Returns:
The DAPIVERSION object handle of the retrieved version if successful; Error otherwise.
 o GetVersionColumnNames
 List GetVersionColumnNames(
                 DAPISESSION session,
                 Integer columnType )

Returns a List of column names in the DVersData table.

Parameters:
session  -  The DAPISESSION object handle.
columnType  -  The type of columns whose names will be returned, which should be one of the following:
 DAPI.ALL_COLUMNS
 DAPI.SYSTEM_COLUMNS
 DAPI.USER_COLUMNS
Returns:
The List of column names if successful; Error otherwise.
 o GetVersionUserAttr
 Dynamic GetVersionUserAttr(
                   DAPIVERSION version,
                   String attrName )

Returns a user attribute value for the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
attrName  -  The name of the attribute.
Returns:
The value for the specific attribute if successful; Error otherwise.
 o IsInTree
 Boolean IsInTree(
              DAPINODE node,
              DAPINODE tree )

Checks if a node is a descendant of another.

This returns TRUE if node is a descendant of tree.

Parameters:
node  -  The DAPINODE object handle.
tree  -  The DAPINODE object handle of the node which may be a parent of node.
Returns:
A Boolean value if successful; Error otherwise.
 o ListAliasNodes
 List ListAliasNodes(
              DAPINODE node,
             [Integer permissions] )

Returns a List of all aliases of the specified node.

Parameters:
node  -  The DAPINODE object handle.
permissions  -  The permissions bit mask which is one or more node permission constants joined by bitwise OR operators.
Returns:
A List containing the DAPINODE object handles if successful; Error otherwise.
 o ListCategories [Note]
 RecArray ListCategories(
                  DAPISESSION session )

Returns a RecArray containing information about all existing categories.

This retrieves all rows from the DCategories table.

Parameters:
session  -  The DAPISESSION object handle.
Returns:
A RecArray if successful; Error otherwise.
 o ListCategoryAttrs [Note]
 RecArray ListCategoryAttrs(
                   DAPISESSION session,
                  [String category] )

Returns a RecArray containing information about attributes.

This retrieves rows from the DAttributes table.

Parameters:
session  -  The DAPISESSION object handle.
category  -  An optional String indicating a category association. If specified, information is only returned for attributes associated with the specified category. If not included, information is returned for all attributes.
Returns:
A RecArray if successful; Error otherwise.
 o ListContents
 RecArray ListContents(
                 DAPISESSION session,
                 Integer volumeID,
                 Integer nodeID,
                 String viewName,
                [String query],
                [Integer permissions] )

Returns a RecArray containing the child nodes of a specified node, in which each node is represented as a record.

Parameters:
session  -  The DAPISESSION object handle.
volumeID  -  An Integer indicating the volume ID of the node.
nodeID  -  An Integer identifying the node ID.
viewName  -  The name of the database table or database view to use.
query  -  An optional SQL clause to restrict the retrieval of the child nodes.
permissions  -  An optional permissions masks to restrict the retrieval of child nodes.
Returns:
A RecArray, containing records of child nodes if successful; Error otherwise. The Record fields will vary depending upon the table and view name specified.
 o ListGenerations
 List ListGenerations(
              DAPINODE node,
             [Integer permissions] )

Returns a List of all generations of the specified node.

Parameters:
node  -  The DAPINODE object handle.
permissions  -  The permissions bit mask which is one or more node permission constants joined by bitwise OR operators.
Returns:
A List containing the DAPINODE object handles if successful; Error otherwise.
 o ListGensFromRelease
 List ListGensFromRelease(
                DAPINODE node,
                Integer major,
                Integer minor,
               [Integer permissions] )

Returns a List of all generations of the specified release or revision of a compound document.

Parameters:
node  -  The DAPINODE object handle.
major  -  An Integer indicating the major release number.
minor  -  An Integer indicating the minor release number.
permissions  -  The permissions bit mask which is one or more node permission constants joined by bitwise OR operators.
Returns:
A List containing the DAPINODE object handles if successful; Error otherwise.
 o ListGensFromVersion
 List ListGensFromVersion(
                DAPIVERSION version,
               [Integer permissions] )

Returns a List of all generations of the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
permissions  -  The permissions bit mask which is one or more node permission constants joined by bitwise OR operators.
Returns:
A List containing the DAPINODE object handles if successful; Error otherwise.
 o ListRenditions
 List ListRenditions(
              DAPIVERSION version )

Returns a List of all renditions of the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
A List containing the DAPIVERSION object handles if successful; Error otherwise.
 o ListSubNodes
 List ListSubNodes(
             DAPINODE node,
            [String query],
            [String category],
            [String catAttrQuery],
            [Boolean autoExpand],
            [Integer permissions] )

Returns a List of the child nodes of a specified node.

Parameters:
node  -  The DAPINODE object handle.
query  -  An optional query String, phrased as the condition of a SQL clause, limiting which nodes are returned.
category  -  An optional String identifying a category. If present and defined, retrieval is restricted to include only those nodes whose category is this specific category value.
catAttrQuery  -  An optional String indicating an attribute query, phrased as the condition of a SQL clause, coupled with the category parameter, further restricting the retrieval to include only those nodes whose attributes contain a specific value.
autoExpand  -  TRUE if all node attributes are fetched up front; FALSE otherwise. FALSE is the default.
permissions  -  An optional permissions mask to restrict the retrieval by permission privileges.
Returns:
A List containing the DAPINODE object handles if successful; Error otherwise.
 o ListVersions
 List ListVersions(
             DAPINODE node )

Returns a List of all versions of the specified node.

Parameters:
node  -  The DAPINODE object handles.
Returns:
A List containing the DAPIVERSION object handles if successful; Error otherwise.
 o LockVersion
 Integer LockVersion(
               DAPIVERSION version,
               Integer lockFlag )

Locks the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
lockFlag  -  An Integer indicating the type of lock. A standard value to use is DAPI.LOCK_VERSION.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o MoveNode
 Integer MoveNode(
              DAPINODE node,
              DAPINODE parent,
             [Dynamic newNames],
             [Boolean forceInheritPerm] )

Relocates the specified node and all its child nodes.

DAPI will issue a callback for each node it encounters by calling a script setup by DAPI.SetCallback().

Parameters:
node  -  The DAPINODE object handle of the node to be relocated.
parent  -  The DAPINODE object handle of the node that will be the parent of the moved node.
newNames  -  An optional String indicating the new name for the moved node, or an Assoc containing multilingual names for the new node, keyed by language code.
forceInheritPerm  -  TRUE if the moved node and its child nodes will inherit permissions from the parent node, otherwise the permissions of the moved node and its child nodes will remain unchanged.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o NextOrderingPos
 Integer NextOrderingPos(
                 DAPINODE node )

Returns the next available ordering position in a compound document.

Parameters:
node  -  The DAPINODE object handle.
Returns:
The next available position (the maximum current child node position plus one) if successful; Error otherwise.
 o NumAliasNodes
 Integer NumAliasNodes(
                DAPINODE node )

Returns the number of aliases of the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
The number of aliases if successful; Error otherwise.
 o NumGenerations
 Integer NumGenerations(
                 DAPINODE node )

Returns the number of generations of the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
The number of generations if successful; Error otherwise.
 o NumGensFromRelease
 Integer NumGensFromRelease(
                   DAPINODE node,
                   Integer major,
                   Integer minor )

Returns the number of generations of the specified release or revision of a compound document.

Parameters:
node  -  The DAPINODE object handle.
major  -  the major release number.
minor  -  the minor release number.
Returns:
The number of generations if successful; Error otherwise.
 o NumGensFromVersion
 Integer NumGensFromVersion(
                   DAPIVERSION version )

Returns the number of generations of the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
The number of generations if successful; Error otherwise.
 o NumRenditions
 Integer NumRenditions(
                DAPIVERSION version )

Returns the number of rendition types associated with a specified version.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
The number of rendition types if successful; Error otherwise.
 o NumSubNodes
 Integer NumSubNodes(
               DAPINODE node )

Returns the number of child nodes of the specified node.

Note: this obtains the count by issuing a database query.

Parameters:
node  -  The DAPINODE object handle.
Returns:
The number of child nodes if successful; Error otherwise.
 o NumVersions
 Integer NumVersions(
               DAPINODE node )

Returns the number of versions of the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
The number of versions if successful; Error otherwise.
 o OpenReadVerStream
 DAPISTREAM OpenReadVerStream(
                     DAPIVERSION version,
                    [Boolean resourceFork] )

Opens a stream for reading the contents of the specified version.

Important: DAPI.VerStreamClose() must be called after reading.

Parameters:
version  -  The DAPIVERSION object handle.
resourceFork  -  TRUE to read the resource fork of the version contents, false to read the data fork. The default is FALSE.
Returns:
The DAPISTREAM object handle of the retrieved node if successful; Error otherwise.
 o OpenWriteVerStream
 DAPISTREAM OpenWriteVerStream(
                      DAPINODE node,
                      DAPIVERSION version,
                      Integer dataLength,
                      String provider,
                     [Boolean resourceFork] )

Opens a stream for writing the contents of the specified version.

Important: DAPI.VerStreamClose() must be called after writing.

Parameters:
node  -  The DAPINODE object handle.
version  -  The newly allocated DAPIVERSION object handle. This allows file attributes to be pre-assigned to the version.
dataLen  -  The total length of data, in Bytes, to be written.
provider  -  The name of the provider. Defaults to the provider set by the DAPI.SetDefaultProvider if it is an empty string.
resourceFork  -  TRUE to read the resource fork of the version contents, false to read the data fork. The default is FALSE.
Returns:
The DAPISTREAM object handle of the retrieved node if successful; Error otherwise.
 o PurgeVersions
 Integer PurgeVersions(
                DAPINODE node,
               [Integer numToKeep] )

Deletes one or more versions from the specified node.

Locked versions and versions that are referenced by generations are not included in the purging procedure.

Parameters:
node  -  The DAPINODE object handle.
numToKeep  -  The number of versions to be retained. Versions are deleted from oldest to most recent. Defaults to 1 if not specified.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o RefreshNode
 Integer RefreshNode(
               DAPINODE node )

Forces a retrieval of the most recent node information from the database.

Parameters:
node  -  The DAPINODE object handle.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o RefreshVersion
 Integer RefreshVersion(
                 DAPIVERSION version )

Forces a retrieval of the most recent version information from the database.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o RenameNode
 Integer RenameNode(
               DAPINODE node,
               Dynamic newNames )

Renames the specified node.

This is the only way to rename a node. Setting the pName and doing a DAPI.UpdateNode() will not work, nor will calling DAPI.SetMultilingualName() on a node that has already been created.

Parameters:
node  -  The DAPINODE object handle.
newNames  -  The new name for the node as a String, or a set of multilingual names for the new node as an Assoc, keyed by language code.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o ReserveNode
 Integer ReserveNode(
               DAPINODE node,
               Integer reserveFlag,
              [Integer userID] )

Reserves the specified node.

Parameters:
node  -  The DAPINODE object handle.
reserveFlag  -  An Integer indicating the type of lock. The standard value is DAPI.RESERVE_NODE.
userID  -  The user or group ID of the user or group for whom the node is being reserved. The default is the current user if unspecified.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o SetCallback
 Integer SetCallback(
               DAPISESSION session,
               Dynamic script,
              [Dynamic object] )

Establishes a callback script for node events.

The events include copying, moving, and deleting nodes.

Parameters:
session  -  The DAPISESSION object handle.
script  -  The script to run when node events occur.
object  -  The object containing the script feature.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o SetDefaultProvider
 Integer SetDefaultProvider(
                   DAPISESSION session,
                   String provider )

Sets a default provider to use during a session.

Most functions accepting the provider parameter will default to this provider. The default is the 'SQL' provider if unspecified.

Parameters:
session  -  The DAPISESSION object handle.
provider  -  The name of the provider name.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o SetMultilingualComment
 Integer SetMultilingualComment(
               DAPINODE node,
               String languageCode )
               String newValue )

Sets the comment for a DAPINODE in the specified language.

NOTE: This is an in-memory set only. Changes will not be saved to the database until DAPI.UpdateNode() is called.

Parameters:
node  -  The DAPINODE object handle.
languageCode  -  The language code for the comment.
newValue  -  The new comment for the node.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o SetMultilingualName
 Integer SetMultilingualName(
               DAPINODE node,
               String languageCode )
               String newValue )

Sets the name for a DAPINODE in the specified language.
This method cannot be called after a node has been created. To change a node's name after creation, use DAPI.RenameNode().

NOTE: This is an in-memory set only. Changes will not be saved to the database until DAPI.CreateNode() is called.

Parameters:
node  -  The DAPINODE object handle.
languageCode  -  The language code for the name.
newValue  -  The new name for the node.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o SetNodeUserAttr
 Integer SetNodeUserAttr(
                 DAPINODE node,
                 String attrName,
                 Dynamic value,
                [Integer attrType] )

Assigns a value to the specified user attribute of the specified node.

Call DAPI.UpdateNode() after this function to save the changes to the database.

Parameters:
node  -  The DAPINODE object handle.
attrName  -  The name of the attribute.
value  -  The value to be assigned to the specified attribute.
attrType  -  An integer indicating the attribute type:
DAPI.ATTR_SET_ALL
DAPI.ATTR_SET_CAT
DAPI.ATTR_SET_SYS
The default value is DAPI.ATTR_SET_ALL if unspecified.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o SetVersionUserAttr
 Integer SetVersionUserAttr(
                   DAPIVERSION version,
                   String attrName,
                   Dynamic value )

Assigns a value to the specified user attribute of the specified version.

Call DAPI.UpdateVersion() after this function to save the changes to the database.

Parameters:
version  -  The DAPIVERSION object handle.
attrName  -  The name of the attribute.
value  -  The value to be assigned to the specified attribute.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o UnlockVersion
 Integer UnlockVersion(
                DAPIVERSION version )

Unlocks the specified version.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o UnreserveNode
 Integer UnreserveNode(
                DAPINODE node )

Unreserves the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o UpdCategory [Note]
 Integer UpdCategory(
               DAPISESSION session,
               Record categoryRec )

Updates a category.

This updates a row of the DCategories table. The function fails if the specified category name does not exist.

Parameters:
session  -  The DAPISESSION object handle.
categoryRec  -  A category record. The columns must compatible with those in the DCategories table.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o UpdCategoryAttr [Note]
 Integer UpdCategoryAttr(
                 DAPISESSION session,
                 Record attributeRec )

Updates an attribute.

This updates a row of the DAttributes table. The function fails if the specified attribute name does not exist.

Parameters:
session  -  The DAPISESSION object handle.
attributeRec  -  An attribute record. The columns must compatible with those in the DAttributes table.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o UpdateNode
 Integer UpdateNode(
               DAPINODE node )

Updates modified node attributes of the specified node.

Parameters:
node  -  The DAPINODE object handle.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o UpdateNodeRight
 Integer UpdateNodeRight(
                 DAPINODE node,
                 Integer rightID,
                 Integer permissions )

Updates the user or group access right of the specified node.

Parameters:
node  -  The DAPINODE object handle.
rightID  -  The user or group ID.
permissions  -  The permissions bit mask which is one or more node permission constants joined by bitwise OR operators.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o UpdateVersion
 Integer UpdateVersion(
                DAPIVERSION version )

Updates modified version attributes for the specified version.

Note that the 3 version attributes, pID (VersionID), pNodeID (DocID), and pNumber (Version), are ignored by this function and cannot be updated for data integrity reason.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o VersionFetchable
 Boolean VersionFetchable(
                 DAPIVERSION version )

Determines whether the specified version's blob content has been loaded.

Parameters:
version  -  The DAPIVERSION object handle.
Returns:
TRUE if the version's content has been loaded, FALSE if it has not been loaded, or an Error if there was a problem determining fetchability.
 o VerStreamClose
 Integer VerStreamClose(
                 DAPIVERSION version,
                 DAPISTREAM stream )

Closes the specified open stream for reading or writing.

An opened DAPISTREAM must be closed when no longer in use.

Parameters:
version  -  The DAPIVERSION object handle.
stream  -  The DAPISTREAM object handle.
Returns:
DAPI.OK (Integer 0) if successful; Error otherwise.
 o VerStreamLenGet
 Integer VerStreamLenGet(
                 DAPISTREAM stream )

Returns the length of an opened version stream.

Parameters:
stream  -  The DAPISTREAM object handle.
Returns:
The length of the opened version stream if successful; Error otherwise.
 o VerStreamRead
 Bytes VerStreamRead(
              DAPISTREAM stream,
              Integer dataLen )

Reads a portion of data from an opened version stream.

The stream must be previously opened for reading using DAPI.OpenReadVerStream().

Parameters:
stream  -  The DAPISTREAM object handle.
dataLen  -  The length of data, in Bytes, to read.
Returns:
A Bytes value containing the read data if successful; Error otherwise.
 o VerStreamWrite
 Integer VerStreamWrite(
                 DAPISTREAM stream,
                 Bytes theBytes )

Writes a portion of data to an opened version stream.

The stream must be previously opened for writing using DAPI.OpenWriteVerStream().

Parameters:
stream  -  The DAPISTREAM object handle.
theBytes  -  A Bytes value containing the data to be written to the version.
Returns:
Number of bytes written, if successful; Error otherwise.