Integration: Image-Master 6 Direct DDE ControlOverviewImage-Master version 6 incorporated a substantial new functionality in the DDE/Automation control. You can directly control the behavior of the main UI, including sharing and handoff between the user and a control application (henceforth referred to as the "client"). This functionality is incorporated within the main Image-Master program, and is automatically activated and available whenever the main program is running. Either a client or the user can start Image-Master, and the client can terminate control with the user interface left at an appropriate place. The Image-Master control model is that of a state machine, with the program being in a specific state and able to respond to an appropriate subset of commands. There is a global state variable that a control application (client) can issue a request for that will return the current state. Since the user can also control the program and hence change its state, a third-party control application may want to query the current state to be certain of the environment before issuing commands. For example, a client requests a search on a database, which brings the Image-Master UI forward with the search results displayed. The user then make some selections and then decides to quit the Viewing Module out to Master Control. At this point the database is closed and the client can not assume that the Viewing Module is still active. In a future Image-Master release, the client will be able to disable certain navigation buttons so that the user can not exit the program or module prematurely. Image-Master States State Control Mode (Topics Allowed) A. Not Running n/a none - must use a ShellEx to invoke IMASTER.EXE B. Authentication 1 LOGON - must authenticate into Image-Master C. Master Control 2 CONTROL - database selection, module entry commands D. Viewing 10 VIEW - Search and document retrieval 11 VIEW - At the Search Results List Screen 12 VIEW - Performing an API based document export E. Scanning 20 SCAN - Scanning and filing tasks F. Import/Export IMPEXP There are currently no plans to expose the Database Configuration, Security Access, or Administration functions to clients. If you require access to these areas programmatically, it can be accomplished on an as-needed basis. Other useful notes about Image-Master states and the corresponding topics which are active:
Part 1: Transition from State A to State B
NOTE: It is legal to launch Image-Master with a window type of minimized. Image-Master will recognize this and will bring itself to the foreground and re-minimize itself as required. Part 2: Determining the Current Image-Master State
NOTE: If the request fails, Image-Master is not running and is considered to be in State A (n/a). Start Image-Master as described in Part 1 above. Once Image-Master is running, Part 2 can be retried to confirm that Image-Master can accept API commands. Part 3: Transition from State B to State C (Logon)
Part 4: Operations in State C (Master Control)
To quit and close Image-Master: End the conversation with the CONTROL topic. Part 5: Operations in State D (Viewing Module)
A simple example:
NOTE: name, and dob are fieldnames for this example. Name is a character type being compared to a literal, dob is a date or datetime type being compared to a specific date. .and. is the logical join, .or. And .not. Could be used as well. How this function returns results:
Using the QUERY request with conditions passed along does not alter or affect the Data Entry window nor the fields displayed. Therefore a user can make unrelated ad-hoc queries directly from Image-Master in tandem with client requests made using QUERY. The next set of commands integrate the client document search and retrieval functions more directly with the user interface. You can also perform a search and retrieval by loading the Data Entry fields with the appropriate values from the client and then either initiating a Standard/Extended search from the client or by letting the user do it (after possibly modifying or adding to the search conditions). In this mode, the client simply loads field values via character literals (no functions are permitted) and Image-Master handles the data type conversion and the SQL query string creation and execution. The user will be able to see and modify the search conditions both before and after they are used, and can perform derivative queries from the Viewing Module from base values provided by the client. To load a search field with a value:
To perform a STANDARD search: SEARCH
NOTE: If the standard search fails to return any documents, the client can then execute an extended search without reloading the field values. If multiple documents are returned, then once the user closes the Search Results list, the search conditions used in the search will be visible in the Data Entry window, and the user can modify or add to the search conditions and perform another search. To quit the Viewing Module and return to Master Control (Transition State D->C): simply end the conversation with the VIEW topic. To perform a GENFILE document export request.
GENFILE may take a few moments Part 6: Operations in State E (Scanning Module)
SCAN (attended scanning) and SCANB (fully automated scanning) support the loading of index filing fields prior to the scan request being initiated. The format is as follows: Loading of field(s) during scanning is purely optional. The syntax also supports a DOS batch file compatible form that encloses the index fields in quotes as in: SCAN="fieldname1=value1..." In all forms, the case of the commands and fieldnames are irrelevant, but the case of the values are preserved. NOTE: Fieldname123 is a literal which represents a valid, defined, index field from the currently selected database. If a third-party application tries to pass an undefined fieldname, the user will be advised and that field will be skipped. Any other valid fields will be loaded as expected. NOTE: Value123 is AN EXPRESSION! (one of FoxPro's greatest features) That means for simple literal assignments, the proper delimiters must be included around the value. For example: Storing a character literal: ADDRESS='123 Any Street' (note the SINGLE quotes around the value) Storing a date literal: TDATE={01/17/1996} (note the curly brackets around the value) and so on... NOTE: Since the value is an expression, more complex data can be exchanged. For example: Using an internal FoxPro function: TDATE=DATE() (This would store the current system date in the field.) Using a third-party data source: DEALER=EXTNFN()+'extra literal value' quite simply, any expression that evaluates to the correct data type would work. Another example:SCAN="COMPANY='Able Fish Industries',TELEPH='(819) 555-1864'" (This uses the DOS compatible method. The corresponding batch command for a DOS app might be.. ...DISP32.EXE ...\IMASTER.EXE,SCAN=%1 and then the passed parameter would be "COMPANY='Able Fish Industries',TELEPH='(819) 555-1864'") As mentioned earlier, the value(s) are loaded into the appropriate fields prior to the start of scanning. Therefore, the typical workflow would be for the third-party application to send the request, the scanning operator loads the document set into the scanner as instructed, scans and QC's the document set, fills in any remaining index fields, and then chooses done. To quit the Scanning Module and return to Master Control (Transition State E->C): end the conversation with the SCAN topic. Related Topics |