Index

DKDatastoreOD

Purpose:

This class is a specific version of dkDatastore to implement the OnDemand datastore. It provides documents storage, a retrieval mechanism as well as query and search abilities, along with other document processing features supported by the OnDemand datastore. The execute() and evaluate() functions of DKDatastoreOD take query strings expressed in SQL query language type as well as other query objects.

Class summary:

class DKEXPORT DKDatastoreOD: public dkDatastore
{  
      public:
    DKDatastoreOD();
    DKDatastoreOD(DKString configuration);
    virtual ~DKDatastoreOD();
 
    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, const DKNVPair* params = 0);
    virtual DKAny evaluate(dkQuery* query);
    virtual DKAny evaluate(DKCQExpr* qe);
    virtual DKAny evaluate(dkSearchTemplate* st);
    virtual dkResultSetCursor* execute(const char* command, const short commandLangType, const DKNVPair* params);
    virtual dkResultSetCursor* execute(dkSearchTemplate* st);
    virtual dkResultSetCursor* execute(dkSearchTemplate* st, const DKNVPair* params, const DKNVPair* options);
    virtual dkResultSetCursor* execute(dkQuery* query);
    virtual dkResultSetCursor* execute(DKCQExpr* cqe);
 
    virtual void executeWithCallback(const char* command, const short commandLangType, const DKNVPair* params, dkCallback* callbackObj);
    virtual void executeWithCallback(dkQuery* query, dkCallback* callbackObj);
    virtual void executeWithCallback(DKCQExpr* qe,                                     dkCallback* callbackObj);
    virtual void executeWithCallback(dkSearchTemplate* st, dkCallback* callbackObj);
    virtual void executeWithCallback(DKFolderOD* st, const DKNVPair* params, dkCallback* callbackObj);
 
    virtual dkQuery* createQuery(const char* command, const short commandLangType, const DKNVPair* params=0);
    virtual dkQuery* createQuery(DKCQExpr* qe);
    virtual void addObject(dkDataObject* ddo);
    virtual void deleteObject(dkDataObject* ddo);
    virtual void retrieveObject(dkDataObject* ddo);
    virtual void updateObject(dkDataObject* ddo);
 
    virtual void commit();
    virtual void rollback();
    virtual DKBoolean isConnected();
    virtual DKString datastoreName() const;
    virtual DKString datastoreType() const;
    virtual DKString userName() const;
    virtual DKHandle* connection();
    virtual DKHandle* handle(const char* type);
 
    virtual dkCollection* listDataSources();
    virtual DKString* listDataSourceNames(long& arraySize);
    virtual DKAny listServers();
    virtual DKAny listSchema();
    virtual DKAny listSchemaAttributes(const char* schemaEntry);
    virtual dkCollection* listSearchableEntities();
    virtual dkCollection* listEntities();
    virtual DKString* listEntityNames(long& arraySize);
    virtual dkCollection* listSearchTemplates();
    virtual dkCollection* listEntityAttrs(const char* entityName);
    virtual DKString* listEntityAttrNames(const char* entityName, long& arraySize);
    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);
 
    void changePassword(DKString userId, DKString oldPwd, DKString newPwd);
    DKCQExpr* translate(DKCQExpr* cqe);
};

Members:

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

Member functions

connect
Connects a datastore. Datastore name is the name of the database or library server. connect_string describes some selected options, supported by the specific implementation of the datastore. A connection string consists of keywords and value pairs separated by semicolon characters such as:
   keyword1=value1;keyword2=value2;keyword3=value3
 
Supported keywords and values for the connection string are: 
 
 

NPWD
The new password string.

ODPORT
The port number of the OnDemand server.

DK_OD_OPT_CONNECT
The current protocol setting. The valid values are:

DK_OD_CONNECT_TCPIP
(default value) Uses TCP/IP.

DK_OD_CONNECT_IPXSPX
Uses IPX/SPX. This option is not currently supported.

DK_OD_CONNECT_LOCAL
Uses the OnDemand local server protocol. This option is not currently supported.

DK_OD_CONNECT_LOCAL
Uses the OnDemand local server protocol. This option is not currently supported.

ODLOCAL
Defined the local directory used by OD local server. This option is not currently supported.
  void setDatastore(dkDatastore* ds);

CACHEAGS
Retrieves and retains all application groups from the OD server upon the first connect. It can potentially make the first search slower when running against an OD server with a larger number of application groups. Use this option only with pre-V2 OD/390 servers. Valid values are:
    
[1] This option is on. 
 
[Anything else] This option is off (default). 
 
 

STAYCONNECT
Instead of closing sockets at the end of transaction, keep the socket open and stay connected. Use this option only with older versions OD/400 servers. Ask your OD/400 administrator if you are not sure whether to use this option. Valid values are:
[1] This option is on. 
 
[Anything else] This option is off (default).
 

ODLOCAL
Defined the local directory used by OD local server.
   
This option is not currently supported. 
 
 

ENTITY_TYPE
Sets the native entity type.
   
The valid values are: 

DK_OD_BASE
The native entity type is OnDemand application group. (default)

DK_OD_TEMPLATES
The native entity type is OnDemand folder.

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

disconnect
Disconnects a datastore.
 
virtual void disconnect();
 
 

getOption
Gets a datastore option.
   
The valid options are: 
 

DK_OD_OPT_PORT
The current port number of the OnDemand server.

DK_OD_OPT_CONNECT
The current protocol setting.

DK_CM_OPT_CC2MIME
The current content class to MIME mapping setting.

DK_OD_OPT_ENTITY_TYPE
The current native entity type. virtual void getOption(long option, DKAny& value);

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

DK_OD_OPT_PORT
The current port number of the OnDemand server.

DK_OD_CONNECT_TCPIP
Use TCP/IP. (default value)

DK_OD_CONNECT_IPXSPX
Use IPX/SPX. This option is not currently supported.

DK_OD_CONNECT_LOCAL
Use the OnDemand local server protocol. This option is not currently supported.

DK_CM_OPT_CC2MIME
Any valid content class to MIME mapping string.

DK_OD_OPT_ENTITY_TYPE
The current native entity type.
   
 The valid values are: 
 
 

DK_OD_BASE
The native entity type is OnDemand application group. (default value)

DK_OD_TEMPLATES
The native entity type is OnDemand folder. virtual void setOption(long option, DKAny& value);

evaluate
Evaluates the query.
   
virtual DKAny evaluate(const char* command, const short commandLangType, const DKNVPair* params = 0);
 
virtual DKAny evaluate(dkQuery* query);
virtual DKAny evaluate(DKCQExpr* qe);
virtual DKAny evaluate(dkSearchTemplate* st);
 
 
 

execute
Executes the query.
   
virtual dkResultSetCursor* execute(const char* command, const short commandLangType, const DKNVPair* params);
 
virtual dkResultSetCursor* execute(dkSearchTemplate* st);
 
virtual dkResultSetCursor* execute(dkSearchTemplate* st, const DKNVPair* params, const DKNVPair* options);
virtual dkResultSetCursor* execute(dkQuery* query);
 
virtual dkResultSetCursor* execute(DKCQExpr* cqe);
 
 

executeWithCallback
Executes the query with a callback function.
   
virtual void executeWithCallback(const char* command, const short commandLangType, cnst DKNVPair* params, dkCallback* callbackObj);
 
virtual void executeWithCallback(dkQuery* query, dkCallback* callbackObj);
 
virtual void executeWithCallback(DKCQExpr* qe, dkCallback* callbackObj);
 
virtual void executeWithCallback(dkSearchTemplate* st, dkCallback* callbackObj);
 
virtual void executeWithCallback(DKFolderOD* st, const DKNVPair* params, dkCallback* callbackObj);
 
 

createQuery
Creates a query object. Only the commandLangType of DK_SQL_QL_TYPE is supported.
   
virtual dkQuery* createQuery(const char* command, const short commandLangType, const DKNVPair* params=0);
virtual dkQuery* createQuery(DKCQExpr* qe);
 
 

addObject
This function is not supported.
   
void addObject(dkDataObject* dataObject);
 
 

deleteObject
This function is not supported.
   
void deleteObject(dkDataObject* dataObject);
 
 

retrieveObject
Retrieves the DDO from this datastore.
   
void retrieveObject(dkDataObject* dataObject);

updateObject
This function is not supported.
   
void updateObject(dkDataObject* dataObject);

commit
This function is not supported.
   
virtual void commit ();
 
 

rollback
This function is not supported.
   
virtual void rollback ();

isConnected
Checks to see if the datastore is connected.
   
virtual DKBoolean isConnected();

connection
Gets the connection handle for a datastore.
   
virtual DKHandle* connection();

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

listDataSources
List the available datastore sources that can be used to connect with.
   
virtual dkCollection* listDataSources();

listDataSourceNames
List the available datastore source names that can be used to connect with.
   
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 listEntityAttributes.
   
virtual DKAny listSchemaAttributes(const char* schemaEntry);

listEntityNames
Gets a list of entity names from persistent datastore.
   
virtual DKString* listEntityNames(long& arraySize);

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

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

datstoredef
Gets the datastore definition.
   
virtual dkDatastoreDef* datastoreDef();
 

registerMapping
Registers mapping information to this datastore.
   
virtual DKString registerMapping(DKNVPair* sourceMap);

unRegisterMapping
Unregisters mapping information for this datastore.
   
virtual void unRegisterMapping(const char* mappingName);
 

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

getMapping
Get mapping information for this datastore.
   
virtual dkSchemaMapping* getMapping(const char* mappingName);

getExtension
Gets the extension object from a given extenstion name.
   
virtual dkExtension* getExtension(const char* extensionName);

addExtension
Adds a new extension object.
   
virtual void addExtension(const char* extensionName, dkExtension* extensionObj);
 

removeExtension
Removes an existing extension object.
   
virtual void removeExtension(const char* extensionName);

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

createDDO
Creates a new DDO with object type, properties and attributes set for a given content server.
   
virtual DKDDO* createDDO(const char* objectType, long Flags);
 
 

changePassword
Changes the password for a userid on an OnDemand server.
   
void changePassword(DKString userId, DKString oldPwd, DKString newPwd);

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

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