ImgQuery Method

Example-VB Example-VC++

Performs a query on a 1.x or 3.x document repository.

Available With

Ö Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0

Applies To

Image Admin control

Syntax

object.ImgQuery(vScope,szQueryTerms,iDispatch)

Arguments

Parameter Data Type Description

vScope Variant For a 1.x server, vScope is:

a string that identifies a 1.x server and virtual volume

"DMVOLUMES", if all Document Manager (DM) volume names in the 1.x domain are to be returned

"IFSVOLUMES", if all Imaging File System (IFS) volume names in the 1.x domain are to be returned

For a 3.x server, vScope is a Boolean value that indicates the scope of the query.

False = only the Domain will be queried.

True = both the Domain and the Archive will be queried

szQueryTerms String A pointer to a string containing the query terms, expressed in syntax appropriate to the server being queried
iDispatch Object The address of an IDispatch pointer that points to a CCollection object which will contain the query results

Remarks

The method ImgQueryEnd must be called after ImgQuery to free up associated resources.

1.x Query Forms

Valid 1.x server query term string forms are:

null or null string

"findIFS path"

where path is a fully qualified path name from the virtual volume to the container to be enumerated

"findcabinets"

"finddrawers cabinet=cabinetname"

where cabinetname is the name of a cabinet

"findfolders cabinet=cabinet"

where cabinet is the name of a cabinet

"findfolders cabinet=cabinetname;drawer=drawername"

lists folders that are resident in a drawer, which is contained in a cabinet. You can supply names for the variables cabinetname and drawername

Querying 1.x documents

You can query 1.x documents by name, date modified, location, and/or keywords. The syntax for this type of query is:

      “finddocs [NAME_TERM] [DATE_EXPR] [KEYWORD_TERM]”

The syntax used by each parameter is shown below. Reserved words appear in bold.

[NAME_TERM] = <name rel_op qstring | name like qstring |
      name between qstring and qstring>

[DATE_EXPR] = <date_name date_rel_op qdate | date_name between
      qdate and qdate>

[KEYWORD_TERM] = <keyword_expr bool_op keyword_expr>

Variable definitions for these parameters are:

rel_op:  = | eq | < | lt | > | gt | <= | le | >= | ge

date_timecreated | modified

date_rel_opbefore | after | on | rel_op

bool_opand | or

qdate:  Julian date in the format AYYYDDD

qstring: ASCII string

keyword_expr: keyword rel_op qstring | keyword like qstring | keyword between qstring and qstring

The 1.x reserved words cabinet, drawer, folder, document, and modified can be used only once in a querystring. The reserved word keyword can be used up to two times.

Sample 1.x DM queries

To find all documents with the keyword “insurance”:

      finddocs keyword=insurance

To find all documents in a folder named “ROOT DRAWER”:

      finddocs drawer=”ROOT DRAWER”

Note that ROOT DRAWER must be enclosed by quotation marks to preserve the space between the two words.

3.x Query Forms

Valid 3.x server query term string forms are:

null or null string

returns the names of all documents

NAME=name

where name is the name of the document to be found.

OBJECT_CLASS=class

where class is a valid class name

FIELDS=fieldname:value,fieldname:value,…;

where fieldname is the name of a field defined in the class's form, and value is the value of the field in the documents to be found

Query Results

Query results are BSTR variants that take different forms, depending on the type of query made. In the sample forms shown below, generic names (such as server, cabinet, drawer, and so on) are used as placeholders.

1.x DM document query
If a query is made to a folder contained by a drawer, the result will be in the form:
Image://server\volume:\cabinet\drawer\folder\document
If a query is made to a folder contained by a cabinet, the result will be in the form:
Image://server\volume:\cabinet\folder\document
If a 1.x cabinet, drawer, or folder enumeration is requested, the result will be a fully qualified path describing the item. For example,
Image://server\volume:\cabinet
  or
Image://server\volume:\cabinet\drawer
  or
Image://server\volume:\cabinet\drawer\folder
1.x Filesystem (IFS) query
A 1.x IFS query result is returned in the form:
[f]Image://server\volume:/directory/directory/.../file
  or
[d]Image://server\volume:/directory/directory/.../directory

Where [f] means the item found was a file, and [d] means that it is a directory.

3.x document query
A document query to a 3.x server is returned in the form:
Imagex://document