Purpose:
This class implements the Content Manager datastore. It provides document, part and folder storage, and a retrieval mechanism as well as query and search abilities, along with other document processing features supported by the Content Manager datastore.
The execute() and evaluate() methods of DXDatastoreDL take parametric query strings expressed in parametric query language type. The syntax of this query string is described below. DXParametericQueryDL object accepts queries in this syntax; the DXParametricQuery object delegates the low level query processing tasks to DXDatastoreDL.
By itself, DXDatastoreDL only supports parametric queries. Integration with other search engines, such as SearchManager/Text Search Engine or Image Search/QBIC, gives DXDatastoreDL the ability to index texts and images, and collectively process combined queries. Combined query processing is done by the DXCombinedQuery class, with the help of the associated datastore classes (DXDatastoreDL, TS or QBIC, for some examples).
Methods:
connect(LPCTSTR datastoreName, LPCTSTR userName, LPCTSTR authentication [, VARIANT connectString]);
This connects to the datastore. The datastore name is the name of the library server, all other parameters are optional. The connect string, if specified, is used to change the password.
To change the password of a user ID, you must set the DXDatastoreDL option DX_DL_OPT_ACCESS to DX_DL_SS_CONFIG, and enter in a connect string with the new password. Below is a sample of a connect string an end-user may supply:
Connect String:
NPWD=NEWPASSWORD
disconnect();
setOption(long option, VARIANT value);
Sets a datastore option. The valid options and values are as follows:
The valid values for media objects are:
getOption(long option, VARIANT* value);
Gets the datastore option. The valid options and values for getting options are the same as for setting options.
BSTR datastoreName();
BSTR datastoreType();
BSTR userName();
VARIANT evaluate(LPCTSTR command, short commandLangType [,VARIANT paramList]); VARIANT evaluateQuery(LPDISPATCH query);
Evaluates a query using a command. The parameter list is in the form of an array of DXNVPairDL objects. The value of the returned VARIANT is a DXResultsDL object. The second form takes a query object. The value of the returned VARIANT is a DXResultsDL object. The input parameter LPDISPATCH pointer contains a DXParametricQueryDL object.
LPDISPATCH execute(LPCTSTR command, short commandLangType [,VARIANT paramList]); LPDISPATCH executeQuery(LPDISPATCH query);
Executes a query using a command. The parameter list is in the form of an array of DXNVPairDL objects. The returned LPDISPATCH pointer contains a DXResultSetCursorDL object. The second form takes a query object. The input parameter LPDISPATCH pointer contains a DXParametricQueryDL object. The returned LPDISPATCH pointer contains a DXResultSetCursorDL object.
LPDISPATCH createQuery(LPCTSTR command, short commandLangType [,VARIANT paramList]);
Creates a query object using a command. The parameter list is in the form of an array of DXNVPairDL objects. The returned LPDISPATCH pointer contains a DXParametricQueryDL object.
addObject(LPDISPATCH ddobase);
Adds the data object to the datastore. The input parameter LPDISPATCH pointer contains a DXDDODL object.
deleteObject(LPDISPATCH ddobase);
Deletes the data object from the datastore. The input parameter LPDISPATCH pointer contains a DXDDODL object.
retrieveObject(LPDISPATCH ddobase);
Retrieves the data object from the datastore. The input parameter LPDISPATCH pointer contains a DXDDODL object.
updateObject(LPDISPATCH ddobase);
Updates the datastore with this data object. The input parameter LPDISPATCH pointer contains a DXDDODL object.
commit();
rollback();
BOOL isConnected();
LPDISPATCH listDataSources();
Gets a list of servers. The returned LPDISPATCH pointer contains a DXSequentialCollectionDL object.
VARIANT listDataSourceNames(long* arraySize);
Gets a list of server names. The output parameter arraySize is the size of the array.
LPDISPATCH listEntities();
Gets a list of entities. The returned LPDISPATCH pointer contains a DXSequentialCollectionDL object.
VARIANT listEntityNames(long* arraySize);
Gets a list of entity names. The output parameter arraySize is the size of the array.
LPDISPATCH listEntityAttrs(LPCTSTR entityName);
Gets a list of entity attributes. The returned LPDISPATCH pointer contains a DXSequentialCollectionDL object.
VARIANT listEntityAttrNames(LPCTSTR entityName, long* arraySize);
Gets a list of entity attribute names. The output parameter arraySize is the size of the array.
LPDISPATCH datastoreDef();
Gets the datastore definition. The returned LPDISPATCH pointer contains a DXDatastoreDefDL object.
startTransaction();
Start a transaction; you can user-commit or rollback to end the transaction.
invokeSearchEngine(LPCTSTR searchEngine, LPCTSTR searchIndex);
Notify the search service program that there's indexing work to be done.
The searchEngine is the search engine name (for example, QBIC) and the searchIndex is the search index identifier (for example, QBICDB-QBICCAT-QBICSRV, where QBICDB = an image search database name, QBICCAT = an image search catalog name, and QBICSRV = an image search alias for an image search server).
checkOut(LPDISPATCH dataObject);
This checks out a document or folder item from the datastore. You will have exclusive updating privileges to the item while other users are allowed read access only, until you check it back in. The input parameter LPDISPATCH pointer contains a DXDDDODL object.
Error messages
checkIn(LPDISPATCH dataObject);
This checks in a document or folder item previously checked out from the datastore. You release all write privileges with this method. The input parameter LPDISPATCH pointer contains a DXDDDODL object.
Error messages
LPDISPATCH createWorkFlowService();
Creates a workflow service object. The returned LPDISPATCH pointer contains a DXWorkFlowServiceDL object.
Content Manager parametric query string
The syntax of the Content Manager parametric query string is as follows:
Content Manager parametric query syntax
SEARCH=([INDEX_CLASS=index_class_name,] [MAX_RESULTS=maximum_results,] COND=(conditional_expression) [; ...] ); [OPTION=([CONTENT=yes_no_attronly,] [TYPE_QUERY=type_of_query,] [TYPE_FILTER=doc_and_or_folder] [WIPSTATUS=work_in_process_filter,] [SUSPEND=suspension_status_filter] )]
Words in uppercase are keywords. Lowercase words are parameters supplied by users; they are described below. Note that DBCS (double-byte character set) attribute names are in SBCS (single-byte character set) single quotes; DBCS (double-byte character set) attribute values can also be specified in SBCS double quotes. All other characters are SBCS.
Logical operators are NOT (or ^), AND (or &), and OR (or |). Relational operators are EQ (or ==), LEQ (or <=), GEQ (or >=), LT (or <), GT (or >), NEQ (or
), IN, NOTIN, LIKE, NOTLIKE, BETWEEN, and NOTBETWEEN. These last two operators take a pair of attribute values as a range.
An example of a conditional expression is:
(DLSEARCH_Date >= "1990") AND (DLSEARCH_Date <= "1993") AND (DLSEARCH_Volume BETWEEN 1 3)
Attribute names with spaces must be enclosed within single quotes. For example:
('last name' == "Smith") AND ('first name'
"Joe")
Attribute values with DBCS characters must be enclosed within double quotes.
The sequence of INDEX_CLASS, MAX_RESULTS, and COND can be repeated for other index classes to formulate a parametric query using multiple criteria. Each sequence should be separated by a semicolon.
If the user wishes to search for a apostrophe (') in a string, the apostrophe is specified as follows:
If the user wishes to search for a quotation marks (") in a string, the quotation marks can be specified in two ways.
For example, content value YES would cause the resulting document or folder DDOs to have their PID, object type, properties and all attributes set. This option also causes the DXParts attribute to be set to a collection of parts with no content. Similarly, the DXFolder attribute is also set to a collection of DDOs with NO content. If the CONTENT value is ATTRONLY, the resulting document or folder DDOs PID, object type, properties, and all attributes are set. If the CONTENT value is NO, the resulting document or folder DDOs PID, object type, and properties are set. The part or DDO content can be retrieved explicitly when needed.
(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.