Index

DKDatastoreV4

Purpose:

DKDatastoreV4 provides methods to store, manage, query, and retrieve digital documents stored on the VisualInfo for AS/400 servers.

Class summary:

class DKDatastoreV4 : public dkDatastore
{
  public:
   DKDatastoreV4();
   DKDatastoreV4(const char* configuration);
   virtual ~DKDatastoreV4();
   virtual void connect (const char* datastore_name,
                         const char* user_name = "",
                         const char* authentication = "",
                         const char* connect_string = "");
   virtual void disconnect();
   virtual void getOption(long option, DKAny& value);
   virtual void setOption(long option, DKAny& value);
   virtual DKAny evaluate(const char* command,
                          const short commandLangType =
                          DK_CM_PARAMETRIC_QL_TYPE,
                          const DKNVPair* parms = 0);
   virtual DKAny evaluate( dkQuery* query);
   virtual DKAny evaluate(DKCQExpr* qe);
   virtual dkResultSetCursor* execute( const char* command,
                                       const short commandLangType =
                                         DK_CM_PARAMETRIC_QL_TYPE,
                                       const DKNVPair* parms = 0);
   virtual dkResultSetCursor* execute( dkQuery* query);
   virtual dkResultSetCursor* execute( DKCQExpr* qe);
   virtual void executeWithCallback( const char* command,
                                     const short commandLangType,
                                     const DKNVPair* parms,
                                     dkCallback* callbackObj);
   virtual void executeWithCallback( dkQuery* query,
                                     dkCallback* callbackObj);
   virtual void executeWithCallback( DKCQExpr* qe,
                                     dkCallback* callbackObj);
   virtual dkQuery*  createQuery(const char* command,
                                 const short commandLangType =
                                   DK_CM_PARAMETRIC_QL_TYPE,
                                 const DKNVPair* parms=0);
   virtual dkQuery*  createQuery(DKCQExpr* qe); 
 
   virtual void addObject(dkDataObject* dataObject);
   virtual void deleteObject(dkDataObject* dataObject);
   virtual void retrieveObject(dkDataObject* dataObject);
   virtual void updateObject(dkDataObject* dataObject);
 
   virtual DKBoolean isConnected();
   virtual DKHandle* connection();
   virtual DKHandle* transactionConnection();
   virtual DKHandle* handle(const char* type);
   virtual dkCollection* listDataSources();
   virtual DKString* listDataSourceNames(long& arrarySize);
   virtual DKAny listServers();
   virtual DKAny listSchema();
   virtual DKAny listSchemaAttributes(const char* schemaEntry);
   virtual dkCollection* listEntities();
   virtual DKString* listEntityNames(long& arraySize);
   virtual dkCollection* listEntityAttrs(const char* entityName);
   virtual DKString* listEntityAttrNames(const char* entityName,
                                         long& arraySize);
 
   virtual void addFolderItem(const char* folderId, const char* memberId);
   virtual void removeFolderItem(const char* folderId, const char* memberId);
   
   virtual DKBoolean isCheckedOut(dkDataObject* dataObject);
   virtual DKString checkedOutUserid(dkDataObject* dataObject);
   virtual void unlockCheckedOut(dkDataObject* dataObject);
   
   virtual void checkOut(dkDataObject* dataObject);
   virtual void checkIn(dkDataObject* dataObject);
   
   virtual dkDatastoreDef* datastoreDef();
   virtual DKString registerMapping(DKNVPair* sourceMap);
   virtual void unRegisterMapping(const char* mappingName);
   virtual DKString* listMappingNames(long& arraySize);
   virtual dkSchemaMapping* getMapping(const char* mappingName);
   virtual dkExtension* getExtension(const char* extensionName);
   virtual void addExtension(const char* extensionName,
                             dkExtension* extensionObj);
   virtual void removeExtension(const char* extensionName);
   virtual DKString* listExtensionNames(long& arraySize);
   virtual DKDDO* createDDO(const char* objectType, long Flags);
   virtual DKCQExpr* translate(DKCQExpr* cqe);
   DKString getPrivilegeString();
 
};

Members:

Constructors and destructor
   DKDatastoreV4();
   DKDatastoreV4(const char* configuration);
   virtual ~DKDatastoreV4();
 

Member functions

connect
Connects to the datastore.

Parameters

datastore_name
The name of the database or library server.

connect_string
Describes some selected options (supported by the specific implementation of the datastore).

   virtual void connect (const char* datastore_name,
                         const char* user_name = "",
                         const char* authentication = "",
                         const char* connect_string = "");
 

disconnect
Disconnects from the datastore.
   virtual void disconnect();
 

getOption
Gets the datastore option. The valid options and values for getting options are the same as for setOption.
   virtual void getOption(long option, DKAny& value);
 

setOption
Sets a datastore option. The valid options and values are as follows:

DK_V4_OPT_DELETE_OPTION

The valid values are:

  • DK_V4_DELETE_ITEM: Delete item if no more part left in the item.
  • DK_V4_DELETE_OBJECT_ONLY(default if not set): Don't delete the item, even if there is no more part left in the item.

DK_V4_OPT_RETRIEVAL_ACTION

The valid values are:

  • DK_V4_RETRIEVAL_GET_IT
  • DK_V4_RETRIEVAL_GET_IT_PREFETCH
  • DK_V4_RETRIEVAL_NO_MOUNT
  • DK_V4_RETRIEVAL_NO_MOUNT_PREFETCH
  • DK_V4_RETRIEVAL_STAGE_IT
  • DK_V4_RETRIEVAL_STAGE_IT_PREFETCH

DK_V4_OPT_FORCE_UPDATE

DK_CM_TRUE
If XDO has not changed, an update will be performed.

DK_CM_False
If XDO has not changed, an update will NOT be performed. (default)

   virtual void setOption(long option, DKAny& value);
 

evaluate
Evaluates a query and returns the result as a Object containing dkQueryableCollection. The second form takes a query object. The third form takes a compound query expression as an alternate form of a query string.
   virtual DKAny evaluate(const char* command,
                          const short commandLangType =
                            DK_CM_PARAMETRIC_QL_TYPE,
                          const DKNVPair* parms = 0);
   virtual DKAny evaluate( dkQuery* query);
   virtual DKAny evaluate(DKCQExpr* qe);
 

execute
Executes a command to the datastore and returns a result set cursor. The second form takes a query object, and the third form takes a compound query expression.
   virtual dkResultSetCursor* execute( const char* command,
                                       const short commandLangType =
                                         DK_CM_PARAMETRIC_QL_TYPE,
                                       const DKNVPair* parms = 0);
   virtual dkResultSetCursor* execute( dkQuery* query);
   virtual dkResultSetCursor* execute( DKCQExpr* qe);
 

executeWithCallback
Executes a query with a callback function. callbackObj is a dkCallback object and qe is a compound query expression object.
   virtual void executeWithCallback( const char* command,
                                     const short commandLangType,
                                     const DKNVPair* parms,
                                     dkCallback* callbackObj);
   virtual void executeWithCallback( dkQuery* query,
                                     dkCallback* callbackObj);
   virtual void executeWithCallback( DKCQExpr* qe,
                                     dkCallback* callbackObj);
 

createQuery
Creates a query object using the given parameters. The second form takes a compound query expression as an alternate form of a query string.
   virtual dkQuery*  createQuery(const char* command,
                                 const short commandLangType =
                                   DK_CM_PARAMETRIC_QL_TYPE,
                                 const DKNVPair* parms=0);
   virtual dkQuery*  createQuery(DKCQExpr* qe);      

addObject
Adds a data object to the persistent datastore.
   virtual void addObject(dkDataObject* dataObject);
 

deleteObject
Deletes the data object from the persistent datastore. The in-memory copy of the data object is not affected.
   virtual void deleteObject(dkDataObject* dataObject);
 

retrieveObject
Retrieves the data object from the persistent datastore into memory.
   virtual void retrieveObject(dkDataObject* dataObject);
 

updateObject
Updates the persistent datastore with the new value of this data object.
   virtual void updateObject(dkDataObject* dataObject);
 

isConnected
Returns TRUE if it is connected to the datastore.
   virtual DKBoolean isConnected();
 

connection
Returns the connection handle of this datastore.
   virtual DKHandle* connection();
 

handle
Gets a datastore handle.
   virtual DKHandle* handle(const char* type);
 

listDataSources
Returns a list of valid servers to connect to. The return value is a collection of server definition objects decribing the server. The object will be specific for each datastore implementation.
   virtual dkCollection* listDataSources();
 

listDataSourceNames
Returns an array of valid server names to connect to.
   virtual DKString* listDataSourceNames(long& arrarySize);
 

listServers
listServers has been deprecated and replaced by listDataSources.
   virtual DKAny listServers();
 

listSchema
listSchema has been deprecated and replaced by listEntities.
   virtual DKAny listSchema();
 

listSchemaAttributes
listSchemaAttributes has been deprecated and replaced by listEntityAttrs.
   virtual DKAny listSchemaAttributes(const char* schemaEntry);
 

listEntities
Gets the list of entities defined in this datastore. Returns a collection of dkEntityDef objects.
   virtual dkCollection* listEntities();
 

listEntityNames
Gets the list of entity names defined in this datastore. Returns an array of entity names.
   virtual DKString* listEntityNames(long& arraySize);
 

listEntityAttrs
Gets the list of attributes for a given entity name.
   virtual dkCollection* listEntityAttrs(const char* entityName);
 

listEntityAttrNames
Gets the list of attribute names for a given entity name.
   virtual DKString* listEntityAttrNames(const char* entityName,
                                         long& arraySize);
 

addFolderItem
Adds the specified item to the specified folder.
   virtual void addFolderItem(const char* folderId, 
                              const char* memberId);
 

removeFolderItem
Removes the specified item from the specified folder.
   virtual void removeFolderItem(const char* folderId, 
                                 const char* memberId);
 

isCheckedOut
Checks whether a document of folder item is checked out from the datastore.
   virtual DKBoolean isCheckedOut(dkDataObject* dataObject);
 

checkedOutUserid
Lists the user ID that checked out the document or folder.
   virtual DKString checkedOutUserid(dkDataObject* dataObject);
 

unlockCheckedOut
Unlocks the checked-out document or folder item.
   virtual void unlockCheckedOut(dkDataObject* dataObject);
 

checkOut
Checks out (and locks) a document or folder item from the datastore.
   virtual void checkOut(dkDataObject* dataObject);
 

checkIn
Checks in ( and unlocks) a document or folder item to the datastore.
   virtual void checkIn(dkDataObject* dataObject);
 

datastoreDef
Gets the datastore definition. Returns the meta data of this datastore, a dkDatastoreDef object.
   virtual dkDatastoreDef* datastoreDef();
 

registerMapping
Registers a mapping definition to this datastore.

Parameters

sourceMap
An NVPair with the following possible values:

SCHEMA
The reference to the object containing the mapping.

   virtual DKString registerMapping(DKNVPair* sourceMap);
 

unRegisterMapping
Unregisters a mapping definition from this datastore.

Parameters

mappingName
The name of the mapping definition.

   virtual void unRegisterMapping(const char* mappingName);
 

listMappingNames
Gets the list of registered mappings for this datastore.
   virtual DKString* listMappingNames(long& arraySize);
 

getMapping
Gets the mapping object with the given name.

Parameters

mappingName
The name of the mapping definition.

   virtual dkSchemaMapping* getMapping(const char* mappingName);
 

getExtension
Gets the extension object of the given extension name.

Parameters

extensionName
The name of the extension object.

   virtual dkExtension* getExtension(const char* extensionName);
 

addExtension
Adds a new extension object providing a set of new functions. For example, a text search engine service can be added as an extension object to support text search in this datastore.

Parameters

extensionName
The name of the extension object.

extensionObj
The extension object providing the services.

   virtual void addExtension(const char* extensionName,
                             dkExtension* extensionObj);
 

removeExtension
Removes an existing extension object.

Parameters

extensionName
The name of the extension object.

   virtual void removeExtension(const char* extensionName);
 

listExtensionNames
Gets the list of available extension names.
   virtual DKString* listExtensionNames(long& arraySize);
 

createDDO
Creates a new dynamic data object (DDO) with properties and attributes set to represent an object of the given type.

Parameters

objectType
the object type of the DDO you want to create

Flags
Used to indicate various options for specifying more detailed characteristics of the dynamic data object (DDO) being created. For example, it may be a directive to create a document dynamic data object (DDO) or a folder.

   virtual DKDDO* createDDO(const char* objectType, long Flags);
 

translate
Translates a query expression into a native query expression that can be processed by this datastore.
   virtual DKCQExpr* translate(DKCQExpr* cqe);
 

getPrivilegeString
Returns the privilege string of the user with respect to the work flow.
   DKString getPrivilegeString();
 

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.