Purpose:
The DKDatastoreICM class is the IBM Content Manager Version 8 and later implementation of the abstract class dkDatastore. Use this class to represent a Content Manager content server in your program. For earlier versions of Content Manager, use DKDatastoreDL.
This class provides facilities to query, retrieve, update, store, and manage content stored in a Content Manager datastore. Additional functions are provided by some associated classes, such as the following:
The methods add, retrieve, update, delete, and moveObject are persistent operations on a DDO representing an item or its components.
At this time, DKDatastoreICM is not thread-safe. You should not create more than one thread to call methods on the same instance of the datastore.
Since: Version 8
Class summary:
class DKEXPORT DKDatastoreICM : public dkDatastore { public: DKDatastoreICM(); DKDatastoreICM(const char* configuration); virtual ~DKDatastoreICM(); 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_XQPE_QL_TYPE, const DKNVPair* parms = 0); virtual DKAny evaluate (DKCQExpr* cqe); virtual dkResultSetCursor* execute (const char* command, const short commandLangType = DK_CM_XQPE_QL_TYPE, const DKNVPair* parms = 0); virtual dkResultSetCursor* execute (DKCQExpr* cqe); virtual void executeWithCallback (const char* command, const short commandLangType, const DKNVPair* parms, dkCallback* callbackObj); virtual void executeWithCallback (DKCQExpr* cqe, dkCallback* callbackObj); virtual void validate (const char* xqpe_query); virtual void addObject(dkDataObject* dataobj); virtual void addObject(dkDataObject* dataobj, long option); virtual void addObjects(dkCollection * ddoCollection); virtual void addObjects(dkCollection * ddoCollection, long option); virtual void deleteObject(dkDataObject* dataobj, long option); virtual void deleteObject(dkDataObject* dataobj); virtual void deleteObjects(dkCollection *ddoColl, long option); virtual void deleteObjects(dkCollection *ddoColl); virtual void retrieveObject(dkDataObject* dataobj); virtual void retrieveObject(dkDataObject* dataobj,long option); virtual void retrieveObject(dkDataObject* dataobj, const DKNVPair* parms, long arraySize); virtual void retrieveObjects( dkCollection *ddoColl); virtual void retrieveObjects( dkCollection *ddoColl, int option); virtual void retrieveObjects( dkCollection *ddoColl, const DKNVPair* parms, long arraySize); virtual void updateObject(dkDataObject* dataobj); virtual void updateObject(dkDataObject* dataobj, long option); virtual void commit (); virtual void rollback (); virtual DKBoolean isConnected(); virtual DKHandle* connection(); virtual DKHandle* handle(const char* type); virtual dkCollection* listDataSources(); virtual DKString* listDataSourceNames(long& arrarySize); virtual dkCollection* listEntities(); virtual DKString* listEntityNames(long& arraySize); 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); virtual DKDDO* createDDO(DKString pidString); virtual DKDDO* createDDO(DKPidICM * pid); virtual DKDDO* createChildDDO(DKString objectType, DKString componentName); virtual void checkIn(dkDataObject* item); virtual void checkOut(dkDataObject* item); virtual void unlockCheckedOut(dkDataObject* dataObject); virtual void startTransaction(); virtual DKBoolean adminDomainEnabled(); virtual DKBoolean informationMiningEnabled(); virtual DKBoolean LDAPEnabled(); virtual short platform(); virtual DKBoolean textSearchEnabled(); virtual DKBoolean workflowEnabled(); virtual DKBoolean isCheckedOut(dkDataObject* dobj); virtual DKString checkedOutUserid(dkDataObject* dobj); DKString schemaName(); dkCollection* listEvents(const char* itemId, short maxResults); dkCollection* listAdminEvents(short maxResults); dkCollection* retrieveEvent(long eventCode); void writeEvent(DKEventDefICM* aEvent); virtual void moveObject(dkDataObject* sourceDDO, dkDataObject* destinationDDO, long options=0); virtual void moveObject(dkDataObject* ddo, const char* destinationItemType); dkXDO* retrieveFormOverlay(DKString name); virtual void changePassword(const char* userId,const char* oldPwd,const char* newPwd); virtual DKBoolean setLocaleAndCodePage(char * locale, char * codePage); virtual void getLocaleAndCodePage(DKString & locale, DKString & codePage); };
Members:
DKDatastoreICM()
Constructs the datastore and initializes with the default configuration.
DKDatastoreICM(const char* configuration)
Constructs the datastore object and initializes it using the supplied configuration stringParameters: configuration - configuration string used for initialization. The configuration string is a sequence of name/value pairs separated by semi-colons. - DSNAME = datastore_name; Supplies the datastore name. Optional. -DBAUTH = SERVER|CLIENT; Indicates whether user authentication is done on the client or on the server. SERVER authentication is the default. Optional - LDAPORG = LDAP organization Specifies the LDAP organization providing the directory information. This can be used when the list of datasources is in IBM Secure Way. Optional - LANCACHE = YES|NO; Determines whether LANCACHE is enabled or disabled. Default value is NO (LANCACHE disabled)
virtual ~DKDatastoreICM()
Destructor for this object.
Parameters: datastore_name - the datastore name used for connection. user_name - the user name used for connection.authentication - the authentication used for connection. connect_string - the connect string used for connection. This is used to provide additional connection options. Valid connect_string name/value pairs separated by semi colons.
The default trace level for the server is 0 (ICMTRACE_OFF).
ICM trace flags:
0 ICMTRACE_OFF
1 ICMTRACE_BASIC
2 ICMTRACE_DETAILED
4 ICMTRACE_DATA
8 ICMTRACE_PERFORMANCE
16 ICMTRACE_PARSEBUILD
32 ICMTRACE_MEMDEBUG
256 ICMTRACE_CACHE_TRACE
512 ICMTRACE_CACHE_ALLOC
1024 ICMTRACE_CACHE_MGT
Trace level is constructed by adding the numbers above. For example, a common tracing level is 15 (calculated by adding ICMTRACE_BASIC, ICMTRACE_DETAILED, ICMTRACE_DATA, and ICMTRACE_PERFORMANCE).
Throws:DKException - if a problem is encountered.
virtual void connect (const char* datastore_name, const char* user_name = "", const char* authentication = "", const char* connect_string = "");
Exceptions: DKException if a problem is encountered.
virtual void disconnect();
Content Manager V8 Datastore Options: DK_ICM_OPT_LAN_CACHE option to indicate lan cache.The valid values are: DK_CM_TRUE lan cache true. DK_CM_FALSE lan cache false. DK_CM_OPT_CACHE To indicate if caching is enabled for schema information. ex: itemTypes, attributes, etc. DK_CM_TRUE cache true. DK_CM_FALSE cache false.
virtual void getOption(long option, DKAny& value);
Parameters: option - the option identifier. value - the option value.
Exceptions: DKException if a problem is encountered.
virtual void setOption(long option, DKAny& value);
DKString query = "/Journal/Journal_Article[contains-text(@Title, \" 'Design' & 'Index' \")=1] SORTBY (@Title)"; DKNVPair options[3]; options[0].setName (DK_CM_PARM_MAX_RESULTS); options[0].setValue (DKAny (DKString ("50"))); options[1].setName (DK_CM_PARM_RETRIEVE); options[1].setValue (DKAny(DK_CM_CONTENT_ATTRONLY| DK_CM_CONTENT_LINKS_OUTBOUND)); options[2].setName (DK_CM_PARM_END); DKAny queryResults = dsICM->evaluate(query, DK_CM_XQPE_QL_TYPE, options); DKResults* results = (DKResults*)(dkCollection*) queryResults.value(); // Display results in the collection. dkIterator* iter = results->createIterator(); cout << " Number of Results: " << results->cardinality() << endl; DKDDO* ddo = 0; DKAny* element = 0; DKString itemId = ""; while(iter->more()) { element = (DKAny*) iter->next(); ddo = (DKDDO*) element->value(); itemId = ((DKPidICM*)ddo->getPidObject())- >getItemId(); cout << " - Item ID: " << itemId << " (" << ddo->getPidObject()->getObjectType() << ")" << endl; delete ddo; }
Parameters:command - a query string commandLangType - a type of query (must be DK_CM_XQPE_QL_TYPE) parms - additional query options in the form of name/value pairs (refer to the execute method for more details). Returns: a collection of results for this query
virtual DKAny evaluate(const char* command, const short commandLangType = DK_CM_ICM_QL_TYPE,const DKNVPair* parms = 0);
Parameters: cqe - a combined query expression object
Returns: a collection of results for this query
virtual DKAny evaluate (DKCQExpr* cqe);
DKString query = "/Journal[@NumPages > 50]"; DKNVPair options[3]; options[0].setName (DK_CM_PARM_MAX_RESULTS); options[0].setValue (DKAny (DKString ("100"))); options[1].setName (DK_CM_PARM_RETRIEVE); options[1].setValue(DKAny(DK_CM_CONTENT_CHILDREN) ); options[2].setName (DK_CM_PARM_END); dkResultSetCursor* cursor = dsICM->execute(query, DK_CM_XQPE_QL_TYPE, options); DKDDO* ddo = 0; DKString itemId = ""; // Display results using a result set cursor. while((ddo = cursor->fetchNext()) != 0){ itemId = ((DKPidICM*)ddo->getPidObject())->getItemId(); cout << " - Item ID: " << itemId << " (" << ddo->getPidObject()->getObjectType() << ")" << endl; delete ddo; } // VERY IMPORTANT STEP: cursor->destroy(); // Close & destroy cursor, ending implicit transaction.
Parameters:command - a query string commandLangType - a type of query (must be DK_CM_XQPE_QL_TYPE) params - additional query options in the form of name/value pairs Description of query options:
Parameters: cqe- a combined query expression object Returns: a datastore result set cursor to the results of the query
virtual dkResultSetCursor* execute (DKCQExpr* cqe);
DKString query = "/Journal/Journal_Article[@VERSIONID = latest-version(.)]"; DKNVPair options[2]; options[0].setName (DK_CM_PARM_RETRIEVE); options[0].setValue (DKAny(DK_CM_CONTENT_ITEMTREE)); options[1].setName (DK_CM_PARM_END); // Create Callback Object (any object implementing dkCallback interface). SSearchCallbackObjectICM callbackObject; dsICM->executeWithCallback(query, DK_CM_XQPE_QL_TYPE, options, (dkCallback*)&callbackObject); // Wait for Callback Object to receive all results. // This thread would normally do other work instead of simply waiting. DKBoolean isDone = FALSE; while(isDone == FALSE) { cout << "Waiting..."; Sleep(100); isDone = callbackObject.isDone(); if(callbackObject.error()) { cout << callbackObject.getFirstException(); } } // Method in the callback object's class // that is called for every block of results. virtual DKBoolean dataCallback (dkCollection* ddoList, DKBoolean resultsComplete) {serverIsDone = resultsComplete; // Save the indication of whether or not the server is done. try { if (ddoList != NULL) { dkIterator* iter = ddoList >createIterator(); DKDDO* ddo = 0; DKAny* element = 0; DKString itemId = ""; while (iter->more()) { element = (DKAny*) iter->next(); ddo = (DKDDO*)(dkDataObjectBase*) element->value(); results->addElement (ddo); // Save the result for later itemId = ((DKPidICM*)ddo->getPidObject())->getItemId(); cout << "Callback Object: - Item ID: " << itemId << " (" << ddo->getPidObject()->getObjectType() << ")" << endl; } } } catch (DKException e) { printException (e); if (firstException == NULL) firstException = new DKException (e); // If it is the first failure, save it } if (userRequestsCancel) { // If the user requests to cancel the query, // report to server. return(true); } else { // Otherwise, return whether or not the server // has indicated that it is done. return (serverIsDone); } }
Parameters: command - a query string commandLangType - a type of query (must be DKConstant.DK_CM_XQPE_QL_TYPE) parms - additional query options in the form of name/value pairs callbackObj - an object that will be called by this method for every block of results.
virtual void executeWithCallback( const char* command, const short commandLangType, const DKNVPair* parms, dkCallback* callbackObj);
Parameters: cqe - a combined query expression object. callbackObj - an object that will be called by this method for every block of results.
virtual void executeWithCallback(DKCQExpr* cqe, dkCallback* callbackObj);
Parameters: xqpe_query - an XML-based query string that would also be passed to the evaluate, execute, and executeWithCallback methods.
virtual void validate(const char* xqpe_query);
// Given a connected DKDatastoreICM* object named 'dsICM' DKDDO* ddo = dsICM->createDDO("myItemType",DK_CM_DOCUMENT); short dataId= ddo->dataId("myAttr"); ddo->setData(dataId,DKString("My Attribute Value")); dsICM.addObject(ddo);
Parameters: ddoObject - data object for the root component of the item to be added.
Returns: None
Memory management: The input DDO object should be deleted by the caller.
virtual void addObject(dkDataObject* ddoObject);
// Given a connected DKDatastoreICM* object named 'dsICM' DKDDO* ddo = dsICM->createDDO("myItemType",DK_CM_DOCUMENT); short dataId= ddo->dataId("myAttr"); ddo->setData(dataId,DKString("My Attribute Value")); dsICM.addObject(ddo);
Parameters: ddoObject - DDO to be added option - DK_CM_CHECKIN or 0 (default) Check in (unlock) the item and DK_CM_CHECKOUT Check out (lock) the item.
Returns: None
Memory management: The input DDO object should be deleted by the caller.
virtual void addObject(dkDataObject* dataobj, long option);
// Given a connected DKDatastoreICM* object named 'dsICM' DKDDO* ddo1 = dsICM->createDDO("myItemType",DK_CM_DOCUMENT); DKDDO* ddo2 = dsICM->createDDO("myItemType",DK_CM_ITEM); DKDDO* ddo3 = dsICM->createDDO("myItemType",DK_CM_FOLDER); short dataId1= ddo1->dataId("myAttr"); short dataId2= ddo2->dataId("myAttr"); short dataId3= ddo3->dataId("myAttr"); ddo1->setData(dataId1,DKString("My Attribute Value")); ddo2->setData(dataId2,DKString("My Attribute Value")); ddo3->setData(dataId3,DKString("My Attribute Value")); dkCollection* coll = new DKSequentialCollection(); coll->addElement((dkDataObjectBase*)ddo1); coll->addElement((dkDataObjectBase*)ddo2); coll->addElement((dkDataObjectBase*)ddo3); dsICM->addObjects(coll);
Parameters: ddoCollection - collection of root component DDOs for the items to be added. The dkCollection may be created using a DKSequentialCollection object.
Returns: None
Memory management: The input DDO collection and the DDO objects in the collection should be deleted by the caller.
virtual void addObjects(dkCollection * ddoCollection);
Parameters: ddoCollection - collection of root component DDOs for the items to be added. The dkCollection may be created using a DKSequentialCollection object. option - DK_CM_CHECKIN or 0 (default) to check in (unlock) the item or DK_CM_CHECKOUT to check out (lock) the item
Returns: None
Memory management: The input DDO collection and the DDO objects in the collection should be deleted by the caller.
virtual void addObjects(dkCollection * ddoCollection, long option);
Parameters: dataObj - the root component DDO for the item version to be deleted from this datastore.
Returns: None
Memory management: The input DDO object should be deleted by the caller.
virtual void deleteObject(dkDataObject* dataObject);
Parameters: dataObj - the root component DDO for the item version to be deleted from this datastore.
Options: 0 (zero) default - Perform a regular delete, deleting the item version represented by this DDO. DKConstantICM.DK_ICM_DELETE_ALL_VERSIONS - Delete all versions of the item.
Returns: None
Memory management: The input DDO object should be deleted by the caller.
virtual void deleteObject(dkDataObject* dataObject,option);
Parameters: ddoCollection - the collection of root component DKDDO objects representing items versions to be deleted from this persistent store.
Returns: None
Memory management: The input DDO collection and the DDO objects in the collection should be deleted by the caller.
virtual void deleteObjects(dkCollection *ddoColl);
ddoCollection - - the collection of root component DKDDO objects representing items versions to be deleted from this persistent store. option - delete option: 0 (zero) default - Perform a regular delete, deleting the item version represented by this DDO. DKConstantICM.DK_ICM_DELETE_ALL_VERSIONS - Delete all versions of the item.
virtual void deleteObjects(ddoColl*option);
Parameters:ddoObject - DDO to be retrieved Exceptions:DKDataObjectNotFound
Memory management: The DDO object retrieved should be deleted by the caller.
virtual void retrieveObject(dkDataObject* dataObject);
Parameters: dataobj - DDO to be retrieved. options - retrieve options are described below:
The default retrieve option is DK_CM_CONTENT_ONELEVEL. Exceptions:DKDataObjectNotFound
Returns: None
Memory management: The DDO object retrieved should be deleted by the caller.
virtual void retrieveObject(dkDataObject* dataobj,long option);
Parameters:dataObj - DDO to be retrieved parms - name/value pair options. See getOption for valid values arraySize - number of name/value pair options in the array
Returns: None
Memory management: The DDO object retrieved should be deleted by the caller.
virtual void retrieveObject(dkDataObject* dataobj, const DKNVPair* parms, long arraySize);
Parameters:ddoColl - collection of DDOs to be retrieved. The dkCollection object may be obtained from a search results (DKResults), from a child collection of a parent DDO (DKChildCollection), from the collection of folder contents (DKFolder), from a document parts collection (DKParts), or you may create a collection separately using the DKSequentialCollection object.
Returns: None
Memory management: The DDO object in the collection and the collection itself are to be deleted by the caller.
virtual void retrieveObjects( dkCollection *ddoColl);
Parameters: ddoCollection - Collection of DDOs to be retrieved. The dkCollection object my be obtained from a search results (DKResults), from a child collection of a parent DDO (DKChildCollection), from the collection of folder contents (DKFolder), from a document parts collection (DKParts), or you may create a collection separately using the DKSequentialCollection object. options - retrieve options are described below:
The default retrieve option is DK_CM_CONTENT_ONELEVEL. Exceptions:DKDataObjectNotFound
Returns: None
Memory management: The DDO objects in the collection and the collection itself are to be deleted by the caller.
virtual void retrieveObjects( dkCollection *ddoColl, int option);
Memory management: The DDO objects in the collection and the collection itself are to be deleted by the caller. The DDNVPair objects are to be deleted by the caller.
virtual void retrieveObjects( dkCollection *ddoColl, const DKNVPair* parms, long arraySize);
The default behavior of updateObject is not to check in the item after update. Parameters:dataObject - root component DDO for the item version to be updated.
Returns: None
Memory management: The input DDO object should be deleted by the caller.
virtual void updateObject(dkDataObject* dataObject);
The default behavior of updateObject is not to check in the item after the update. Parameters:dataObj - the item DDO to be updated option - update options Valid values are: DK_CM_CHECKIN: check in the item after the update. Default is not to check in the item DK_CM_VERSION_LATEST: update the latest version DK_CM_VERSION_NEW: create a new version of this item. This is only applicable if the version control on the item type is set to version the item or to application controlled. If that is not the case, the item is updated and no error is returned, but a new version is not created.
Returns: None
Memory management: The input DDO object should be deleted by the caller.
virtual void updateObject(dkDataObject* dataobj, long option);
Parameters: None
Returns: None
virtual void startTransaction();
Parameters: None
Returns: None
virtual void commit ();
Parameters: None
Returns: None
virtual void rollback ();
Returns: TRUE if the datastore object has been connected, FALSE otherwise.
Parameters: None
virtual DKBoolean isConnected();
Parameters: None
Returns: Connection handle as an instance of DKHandle
virtual DKHandle* connection();
Returns: Collection of data sources as instances of dkServerDef.
Parameters: None
Memory management: The server def objects in the collection and the collectino itself are to be deleted by the caller.
virtual dkCollection* listDataSources();
Parameters: arraySize - size of the returned array Returns: List of data source names as an array of DKString variables.
Memory management: The DKString array returned is to be deleted by the caller.
virtual DKString* listDataSourceNames(long& arrarySize);
Parameters: type - type of datastore handle wanted. Various Types - DK_ICM_CONNECT_HANDLE Returns:Aa datastore handle
virtual DKHandle* handle(const char* type);
Parameters: None
Returns: Collection of entity definitions as instances of dkEntityDef.
Memory management: The entity objects in the collection and the collection itself are to be deleted by the caller.
virtual dkCollection* listEntities();
Parameters: arraySize - size of the retrieved array. Returns: array of entity names as instances of DKString.
Memory management: The DKString array returned is to be deleted by the caller.
virtual DKString* listEntityNames(long& arraySize);
Parameters: entityName - name of the entity for which attributes have to be retrieved. Returns: list of attribute definitions as instances of DKAttrDefICM.
Memory management: The attribute objects in the collectin and the collectiion itself are to be deleted by the caller.
virtual dkCollection* listEntityAttrs(const char* entityName);
Parameters: entityName - name of the entity that owns the attributes. arraySize - size of the retrieved array. Returns: an array of attribute names.
Memory management: The DKString array is to be deleted by the caller.
virtual DKString* listEntityAttrNames(const char* entityName,long& arraySize);
Returns: Collection of attribute as instances of DKAttrDefICM.
Memory management: The attribute objects and the collection itself are to be deleted by the caller.
virtual dkCollection* listAttrs();
Parameters: arraySize - size of attribute name arrays Returns: array of attribute names as DKString variables
Memory management: The DKString array returned is to be deleted by the caller.
virtual DKString* listAttrNames(long& arraySize);
Parameters: dataObject - root component DDO for the item to check if the item is checked. out.Returns: TRUE if the specified DDO is checked out; FALSE otherwise.
Memory management: The input DDO object should be deleted by the caller.
virtual DKBoolean isCheckedOut(dkDataObject* dataObject);
Parameters: dataObject - root component DDO of the item to to check. Returns: User ID who has checked out the specified DDO as a DKString variable
Memory management: The input DDO object should be deleted by the caller.
virtual DKString checkedOutUserid(dkDataObject* dataObject);
Parameters: dataObject - root component DDO for the item to be checked out (locked). Throws: DKException if a problem is encountered
Memory management: The input DDO object should be deleted by the caller.
virtual void checkOut(dkDataObject* dataObject);
Parameters: dataObject - root component DDO fo the item to be checked in (unlocked).
Memory management: The input DDO object should be deleted by the caller.
virtual void checkIn(dkDataObject* dataObject);
Returns: datastore definition object as instance of DKDatastoreDefICM.Each call to this method will return the same object. See also: DKDatastoreDefICM
virtual dkDatastoreDef* datastoreDef();
Parameters: sourceMap - source name and mapping information. The name part of the NVPair specifies the source of mapping information. A string literal "SCHEMA" indicates that the mapping information is provided in the value part in the form of the schema mapping object. Returns: mapping name for the mapping information as an instance of DKString.
virtual DKString registerMapping(DKNVPair* sourceMap);
Parameters: mappingName - name of the mapping information to be unregistered.
virtual void unRegisterMapping(const char* mappingName);
Parameters: arraySize - size of returned mapping names array. Returns: array of names of the registered mapping information.
Memory management: The DKString array returned is to be deleted by the caller.
virtual DKString* listMappingNames(long& arraySize);
Parameters: mappingName - name of the schema mapping information. Returns: schema mapping as an instance of dkSchemaMapping.
virtual dkSchemaMapping* getMapping(const char* mappingName);
DKDatastoreExtICM* dsExtICM = (DKDatastoreExtICM*) dsICM->getExtension(DK_CM_DATASTORE_EXT);
Parameters: extensionName - name of the extension object to be retrieved. For the DKDatastoreExtICM object, use DK_CM_DATASTORE_EXT. Returns: extension object as an instance of dkExtension.
virtual dkExtension* getExtension(const char* extensionName);
Parameters: extensionName - name of the new extension object. extensionObj - extension object to be added.
virtual void addExtension(const char* extensionName,dkExtension* extensionObj);
Parameters: extensionName - name of extension object ot be removed.
virtual void removeExtension(const char* extensionName);
Parameters: arraySize - size of extension object name array. Returns: array of extension object names as DKString variables.
Memory management: The DKString array returned is to be deleted by the caller.
virtual DKString* listExtensionNames(long& arraySize);
Parameters: pidString - string returned from DKPidICM.pidString() method Returns: created DDO as instance of DKDDO object
Memory management: The returned DDO should be deleted by the caller.
virtual DKDDO* createDDO(DKString pidString);
Parameters: pid - valid PID as instance of DKPidICM. Returns: created DDO as instance of DKDDO object.
Memory management: The returned DDO and the input DKPidICM object should be deleted by the caller.
virtual DKDDO* createDDO(DKPidICM * pid);
Creates a new DDO with object type, properties and attributes set according to the definition of the corresponding item type in this datastore. The flag indicates additional properties that need to be set. This is the recommended way to create items. This method will create a new root item of the specified item type. This method will allow the system to automatically setup important information in the DKDDO structure, which allows for easier and greater functionality, such as resources, Content Manager document model, and folders. The DDO returned will have the appropriate properties and attributes setup to fit the corresponding item type definition.
Resource items: The item type definition determines what type of DDO is created. If it is a resource, the correct XDO is returned, depending on the XDO Class specified in the item type definition. The returned DDO may be cast to the correct structure, since it is setup correctly according to the item type definition. For more information, please refer to the "Returns" documentation.
Item property types: An item or DDO must have a generic "type" property associated with it. This generic type of the DDO is document, folder, or item. When creating items, the item property must be specified as the second parameter of the datastore's createDDO function.
The value is stored in the DDO's property named, "DK_CM_PROPERTY_ITEM_TYPE", which should not be confused with the overall item type definition that describes the the structure of this item. "PROPERTY_ITEM_TYPE" refers to the "item property", not the item type definition, something specific to the ICM connector.
Available item property types:
Table 1. Item type property definitions
Property type | Constant | Definition |
---|---|---|
Document | DK_CM_DOCUMENT | Item represents a document or stored data. The information contained in this item might form a document. This item can be considered a common document since it does not rigidly mean an implementation of a specific document model. |
Folder | DK_CM_FOLDER | Item represents an object containing or referencing contents or objects. This item can be considered a common folder since it does not rigidly mean an implementation of a specific document model. |
Item (default) | DK_CM_ITEM | Generic item. This item does not fit system defined or user defined semantic types. |
Semantic type: When creating Items, a semantic type can be specified as the second parameter of the Datastore's createDDO function. A semantic type in general is a metaphor for an item. It gives it an enforceable characteristic for basic operations. Where applicable, semantic types are enforced within EIP OOAPI and can be enforced externally as you see fit.
The value is stored in the DDO's property DKConstantICM.DK_ICM_PROPERTY_SEMANTIC_TYPE, which in many cases may contain the same value as the Item Property Type.
Available semantic types:
Table 2. Pre-defined semantic types
Semantic type | Constant | Definition |
---|---|---|
Document | DK_ICM_SEMANTIC_TYPE _Document | Indicates that this item is a document |
Folder | DK_ICM_SEMANTIC_TYPE _Folder | Indicates that this item is a folder |
Annotation | DK_ICM_SEMANTIC_TYPE _Annotation | Indicates that this item or part is an annotation to the base part |
Container | DK_ICM_SEMANTIC_TYPE _Container | Indicates that this item is a container, which can contains other items. The container-containee relationship is represented using links. |
History | DK_ICM_SEMANTIC_TYPE _History | Indicates that this item or part is a history of the base part. |
Note | DK_ICM_SEMANTIC_TYPE _Note | Indicates that this item or part is a note to the base part. |
Base | DK_ICM_SEMANTIC_TYPE _Base | Indicates that this item or part is the base part that may have an annotation, note, or history associated with it. |
User defined | User defined | A user defined semantic type interpreted by the application. |
Notes:
|
Parameters: objectType - - the name of the Item Type defined in this datastore. The first parameter takes the name of the Item Type that defines the entire Item. This may also be considered the Root Item Type, since the DDO returned is the Root Component DDO. The Item Type definition should be defined at design-time in this datastore through the System Administration Client or API. flags - - indicates additional properties of the DDO. This is the Item Property/Semantic Type. The second parameter determines the Item Property and Semantic Type of the DDO, such as Document, Folder, Item, or User-Defined.
Returns: The DDO returned is a new DKDDO of the Root Component. If the Item Type defines extended functionality such as XDO Resource functionality, the returned DKDDO is the correct derived descendent from DKDDO, such as DKLobICM, DKTextICM, DKImageICM, DKStreamICM, and DKVideoStreamICM and may be cast to those types.
Throws: DKException - If errors are detected such as the following:
The Item Type name given does not exist in this datastore.
The Semantic Type specified is incompatible with the Item Type specified.
Child Component Type name specified instead of a Root Item Type name.
Other Usage Errors
Memory Management: The returned DDO should be deleted by the caller.
virtual DKDDO* createDDO(const char* objectType, long Flags);
virtual DKDDO* createDDO(DKPidICM *pid, DKString *fedAttrList, long numOfFedAttrs);
Parameters: objectType - name of the root item type componentName - name of the child component based oon which this DDO is to be created Returns: DDO object representing the child component
Memory management: If returned DDO is not a child collection, it should be deleted by the caller.
virtual DKDDO* createChildDDO(DKString objectType, DKString componentName);
Returns: Returns TRUE if the adminstration domain is enabled for this datastore; FALSE otherwise
virtual DKBoolean adminDomainEnabled();
Returns: Returns TRUE if the information mining is enabled for this datastore; FALSE otherwise
virtual DKBoolean informationMiningEnabled();
Returns: TRUE if LDAP is enabled for this datastore; FALSE otherwise
virtual DKBoolean LDAPEnabled();
Returns: platform code. Valid return values are: DK_CM_PLATFORM_WINDOWS DK_CM_PLATFORM_AIX DK_CM_PLATFORM_SUN DK_CM_PLATFORM_390
virtual short platform();
Returns: TRUE if text search is enabled, FALSE otherwise
virtual DKBoolean textSearchEnabled();
Returns: TRUE if the workflow service is enabled; FALSE otherwise
virtual DKBoolean workflowEnabled();
virtual void getLocaleAndCodePae(DKString & locale, DKString & codePage);
virtual DKBoolean setLocaleAndCodePage(char * locale, char * codePage);
Returns: schema name as instance of DKString
DKString schemaName();
Parameters: itemId - an item id . maxResults - the maxium number of DKEventDefICM objects to be returned in the collection. Returns: Returns a collection of DKEventDefICM objects. Throws: DKException if a problem is encountered.
Memory management: The DKEventDefICM objects in the collection and the collection itself are to be deleted by the caller.
dkCollection* listEvents(const char* itemId, short maxResults);
Parameters: maxResults - the maxium number of events to retrieve. 0 means no limits. Returns: Returns a collection of DKEventDefICM objects. Throws: DKException if a problem is encountered.
Memory management: The DKEventDefICM objects in the collection and the collection itself are to be deleted by the caller.
dkCollection* listAdminEvents(short maxResults);
Parameters: eventCode - event code to retrieve event information for Returns: collection of event objects as instances of DKEventDefICM
Returns: Collection of even objects as instnces of DKEventDefICM
Memory management: The DKEventDefICM objects in the collection and the collection itself are to be deleted by the caller.
dkCollection* retrieveEvent(long eventCode);
Parameters: aEvent - event to be written
void writeEvent(DKEventDefICM* aEvent);
Parameters: name - name of form overlay object Returns: form overlay as an XDO object
dkXDO* retrieveFormOverlay(DKString name);
Parameters: ddo - the data-object to be moved destinationItemType - the destination item type to move this data-object to. Throws: DKException - if a problem is encountered.
virtual moveObject(dkDataObject* ddo, const char* destinationItemType);
Parameters: sourceDDO - the data-object to be moved destinationDDO - the template of destination data-objectoptions - valid options are
Throws: DKException - if a problem is encountered.
virtual void moveObject(dkDataObject* sourceDDO, dkDataObject* destinationDDO, long options=0);
Data type Conversion:
Class library type | Content Manager server data type |
---|---|
DKString | VARCHAR |
DKString | CHAR |
short | SHORT |
long | INTEGER |
DKDecimal | DECIMAL |
DKDate | DATE |
DKTime | TIME |
DKTimestamp | TIMESTAMP |
DKByteArray | BLOB,DBCLOB |
DKString | CLOB |
Note that each piece of data is transfered into and out of the Content Manager server as a character string representation of its value. The only exception to this rule is the BLOB data type; this data type is transfered in its native binary mode.
(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.