The Interrupt Modes [ HP DeskManager Customization ] MPE/iX 5.0 Documentation
HP DeskManager Customization
The Interrupt Modes
Information is passed from the application to HP Desk and from HP Desk to
the application via an Extra Data Segment (XDS) shared by the two
processes.
There are sixteen Interrupt Modes (seventeen if you include Mode 0).
Information concerning the Interrupt Modes is passed to HP Desk via the
XDS. The Interrupt Mode required is written to the HPDESKPROCCONTROL JCW.
The format of the XDS is given in this chapter together with the XDS
fields which must be filled in for each of the sixteen Modes.
In addition to the 16 Interrupt Modes described here, a value of 0 (zero)
is also valid. A value of zero signals to HP Desk that it must terminate
the son process (the application) if it has not already terminated.
HP Desk always sets the Mode value in the HPDESKPROCCONTROL JCW to zero
after an interrupt to avoid accidentally going into another Mode if the
application fails to set it to 0 when exiting.
A List of the Interrupt Modes
Below is a list of the Interrupt Modes and their basic functions:
Mode number Function
---------------------------------------------------------------------------------------
0 Kill the son process
1 General interrupt (equivalent to pressing the Suspend key)
2 Copy a file from MPE to HP Desk using the Clipboard
3 Copy a file to MPE from HP Desk using the Clipboard
4 Pass a file from MPE to the Work Area
5 Get a file from the Work Area
6 Replace an item in the Work Area
7 Initialize Forms data processing
8 Get next Forms data file
9 Catalog files directly into HP File/Library
10 Convert files
11 Access an HP Desk Help page
12 Get an item from the current area using its item number
13 Get an item from the current area using its subject name
14 Check whether new mail has arrived
15 Execute an MPE file as a script
16 Close down or sign off HP Desk
Each Mode is explained in detail below.
Mode 0 - Kill Son Process
This Mode is not really an Interrupt Mode, but it is used to request that
HP Desk kills the son process that set the JCW. This provides a way for
applications that suspend (in the MPE sense) to be sure that they can be
killed. HP Desk always sets the Mode value to zero (0) after an
interrupt.
Mode 1 - General Interrupt (Suspend key)
Function
This is the equivalent of pressing the Suspend key when running normally
in HP Desk. It allows the application to temporarily return control to
HP Desk so that the user can carry out normal HP Desk functions, for
example sending messages or accessing their Diary. This Mode should be
included in all applications that are interactive with the user. It has
the same restrictions as the Suspend key. If you suspend the use of HP
File/Library to run an application you will not be allowed to suspend the
program to enter the Library again. You are also not allowed to suspend
from a program to HP File/Library if the program was started while you
were in Suspend mode. The user is returned to the application when they
press the Resume key or type RESUME.
Fields in XDS which Must be Filled in
None.
Optional Fields in XDS
None.
XDS Values Returned to Application
None.
Mode 2 - Copy File to HP Desk Using the Clipboard
Function
This provides the most flexible way of returning data to HP Desk as the
user decides exactly where the data is to go. For example, a returned
file can be included directly in a message that is mailed by typing SEND,
filling in the normal details and then copying from the Clipboard.
The file is copied onto the Clipboard by HP Desk. The user is placed in
Suspend mode after an optional message giving instructions. COPY FROM
CLIPBOARD should be used to place the item in any area of HP Desk that
can receive new items.
A returned file can be included into a message to be mailed. The user
types SEND, fills in the normal details and then copies the item from the
Clipboard.
If the user resumes the application without copying from the Clipboard,
the application is informed by the setting of an error value in the
HPDESKERR JCW. During this interrupt, the user may also perform other
tasks in HP Desk that are not related to the item being passed. However,
they cannot use the Clipboard for any other purpose.
Fields in XDS which Must be Filled in
filename.
Optional Fields in XDS
subject, instructions, text_type, user_interaction.
XDS Values Returned to Application
None.
Mode 3 - Copy File from HP Desk Using the Clipboard
Function
This allows a user to select an item within HP Desk to be returned to the
application.
The user is placed in Suspend mode after an optional message giving
instructions. COPY TO CLIPBOARD should be used to identify the item to
be passed to the application. The user can look in any HP Desk area for
the item, including searching the Library. Only simple items can be
returned in this way, for example, HP Word, HP Slate, HP Draw documents,
or MPE or text files, but not messages or packages.
The application will be told if the user resumes and does not select an
item, using the HPDESKERR JCW. During this interrupt the user may also
perform other tasks in HP Desk that are not related to the item being
passed, but may not use the Clipboard for anything else.
Fields in XDS which Must be Filled in
None.
Optional XDS Fields
instructions.
XDS Values Returned to Application
filename, subject, date_yymmdd, time_hhmm, creator_name, creator_node,
filecode.
Mode 4 - Pass File to HP Desk Work Area
Function
This allows the application to pass an item directly to the user's Work
Area, without the user seeing it happen. The application should be able
to manipulate and use the information and items in the Work Area. This
may be used for example, to format a report or even to create a new
report from a database then return that report to the Work Area.
The application puts the name of the file into the XDS. If the file to be
copied is an HP Word, HP Slate, or HP Draw document, the subject of the
item is taken from the subject field of the document. If there is no
subject, the subject is taken from the subject field in the XDS. If this
is blank and user interaction is allowed, the user is prompted for the
subject. If user interaction is not allowed, the fully qualified file
name is used as the subject.
The application determines whether user interaction is allowed by setting
the user_interaction flag in the XDS.
Fields in XDS Which Must be Filled in
filename.
Optional XDS Fields
subject, text_type, user_interaction.
XDS Values Returned to Application
None.
Mode 5 - Get File from Work Area
Function
This allows the application to get a file from the user's Work Area. The
application puts the subject of the item is taken from the subject field
of the XDS. If there is more than one item with the same subject in the
Work Area, then provided that no user interaction is allowed, the first
matching item is taken. If user interaction is allowed, the user is
offered a choice.
Fields in XDS which Must be Filled in
subject.
Optional XDS Fields
user_interaction.
XDS Values Returned to Application
filename, subject, date_yymmdd, time_hhmm, creator_name, creator_node,
item_type.
Mode 6 - Replace Work Area Item
Function
This allows the application to replace an item in the HP Desk Work Area.
If its subject is not unique (passed by the document subject or the XDS
subject field) and user interaction is allowed, the user is given a
choice as to which of the items with the same subject in the Work Area is
to be updated. Otherwise, the first matching item is replaced.
Fields in XDS which Must be Filled in
subject (if not provided in document), filename.
Optional XDS Fields
user_interaction, text_type.
XDS Values Returned to Application
None.
Mode 7 - Initialize Forms Data Processing
Function
The SENDFORM and REPLYFORM commands allow users to mail out and complete
forms. A forms package can be built that contains the VPLUS/3000 file
and the associated batch data files, either by hand or using ACK 6.
Obviously, there must be something that the user can do with the batch
file data apart from reading it. An application could perform
statistical analysis on the data contained in a number of the batch files
(maybe even returning a report to the Work Area using Interrupt Mode 4!).
An application may be written to process the completed forms in some way.
Interrupt Mode 7 initializes processing of a forms package. In other
words, it checks that the user really is in a forms package and builds up
a list of all the data items in it. The user must have opened the
package containing the forms to be processed before starting the
application, that is the forms package is the user's current area. This
interrupt can be used more than once if the application wants to
reprocess the data files from the start.
Any Mode 8 interrupts following a Mode 7 will get the individual forms.
Fields in XDS which Must be Filled in
None.
Optional XDS Fields
None.
XDS Values Returned to Application
None.
Mode 8 - Get Next Forms Data File
Function
This allows the application, once it has initialized via Mode 7, to loop
around returning the next valid forms data file, which may then be
processed by the application program.
Interrupt Mode 7 may be called at any time to reposition back to the
first forms data file.
Any other items contained in the forms package will be skipped and the
application informed when all files have been processed. Interrupt Mode
7 may be called at any time to reposition back to the starting forms data
file. Any other Interrupt Modes may be interleaved between the
processing of forms data files. If any of these interrupts cause the
package currently being worked on to be updated, the change is not
recognized until after the next initialization (Mode 7). Even if some
items are deleted, they are still made available to the application.
Any other Interrupt Modes may be interleaved between the processing of
forms data files. If any of these interrupts cause the package currently
being worked on to be updated, the change is not recognized until after
the next initialize (Mode 7). Even if some items have been deleted since
the previous Mode 7, they are still available to the application.
The two Modes are required so that the application can "rewind" the
access to the list of forms data files in the forms package. There is
obviously a case for only reading through the list once, but it is
reasonable to allow the list to be re-scanned.
During the processing of the batch files, there may be need to return a
file of intermediate results to the Work Area. This can be done via any
appropriate mode without disturbing the sequence of Mode 8s which are
scanning the batch data files.
Fields in XDS which Must be Filled in
None.
Optional XDS Fields
None.
XDS Values Returned to Application
filename, subject, date_yymmdd, time_hhmm, creator_name, creator_node,
filecode.
Mode 9 - Catalog Files Directly into the Library
Function
For sites with the HP File/Library, this Interrupt Mode allows an
application to pass a file to HP Desk to be catalogued directly into the
Library (with comments and other information if required). The subject
of the item and the catalog where it is to be stored, are normally taken
from information supplied by the application in the XDS. If a subject is
not given, either the document subject (for HP Word, HP Slate or HP Draw
documents) or the fully qualified filename is used. (If the user
interaction flag is set, the user is prompted instead of the filename
being used.) If the catalog name is not given or is not unique, the user
is always prompted. This is a good way to load up the Library when you
first create it.
Fields in XDS which Must be Filled in.
filename, catalog_name.
Optional XDS Fields.
subject, creator_name, creator_node, user_interaction, text_type,
cat_keywords, cat_keywords_len, cat_comments, cat_comments_len.
XDS Values Returned to Application
None.
Mode 10 - Convert File
Function
This allows the application to request that a file is converted from one
document format to another. The possible conversions will depend on the
product options installed at your site but are the same as those
available from the normal HP Desk user interface.
Fields in XDS which Must be Filled in
filecode, filename.
Optional XDS Fields.
None.
XDS values Returned to Application.
filename.
Mode 11 - Access the HP Desk Help Subsystem
Function
This is the easiest way to provide an application with a flexible and
standard Help sub-system. The general features available in the HP Desk
Help sub-system are security, hierarchic menus, dynamic updates to the
terminal, and capability dependencies. There is no need for the
application to have its own Help system.
The application must provide the starting Help page number via the XDS.
The normal security provisions apply to the Help pages that the user may
see. All the usual Help facilities can be used within the Help
sub-system, including printing pages and navigation through the Help
hierarchy. See Chapter 6 for more information.
Fields in XDS which Must be Filled in
help_page.
Optional XDS Fields
None.
XDS Values Returned to Application
None.
Mode 12 - Get Item from Current Area by Number
Function
This is a simple way of addressing the area that the application was
first started from. It allows the application to get an item from the
user's current area, referenced by the item's number (the number the item
has when you list the area). The application specifies the number in the
XDS.
Fields in XDS which Must be Filled in
env_item_number.
Optional XDS Fields.
None.
XDS Values Returned to Application
filename, subject, date_yymmdd, time_hhmm, creator_name, creator_node,
filecode.
Mode 13 - Get Item from Current Area by Subject
Function
This allows the application to get an item from the user's current area,
referenced by the item's subject. The subject is taken from the subject
field specified by the application in the XDS. If it is not a unique
subject in the current area, then either the first matching item is taken
(if no user interaction is allowed) or the user is offered a choice.
This is a simple way of addressing the area that the application was
first started from.
Fields in XDS which Must be Filled in
subject.
Optional XDS Fields
user_interaction.
XDS Values Returned to Application.
filename, subject, date_yymmdd, time_hhmm, creator_name, filecode.
Mode 14 - New Mail Check
Function
This allows the application to pick up new mail notifications from HP
Desk.
If more than one New Mail notification has arrived, the interrupt will
pick up the oldest one.
Every time a New Mail notification is picked up, it is removed from the
New Mail notification queue. It is therefore possible to do repeated
Mode 14 interrupts until no more notifications are left.
If a Mode 14 interrupt finds no notification it returns an error value in
the HPDESKERR JCW.
Fields in XDS which Must be Filled in
None.
Optional XDS Fields
None.
XDS Values Returned to Application
subject, effective_gmt, gmt_offset, date_yymmdd, time_hhmm, creator_name,
creator_node, item_type, urgent_message.
Mode 15 - Execute MPE File as a Script
Function
This is similar to Interrupt Mode 1. It Suspends the application and
returns control to HP Desk. The difference between Mode 15 and Mode 1 is
that Mode 15 causes a script to run as soon as control has returned to HP
Desk.
When the script has finished, control remains with HP Desk, you are not
returned to the application. To return to the application automatically,
you have to include RESUME within the script file.
The name of the script to be run is passed to HP Desk by the application
in the filename field of the XDS.
The MPE file must be a fixed record length ASCII text file, that is it
must have a filecode of 0 or 1167.
Fields in XDS which Must be Filled in
filename.
Optional XDS Fields
None.
XDS Values Returned to Application
None.
Mode 16 - Close Down/Sign Off HP Desk
Function
The effect of this interrupt is similar to that produced by a value of 0
in the HPDESKPROCCONTROL JCW. They both cause the son process to
terminate. However, in addition Interrupt Mode 16 also asks HP Desk to
close down.
When HP Desk closes down following a Mode 16, a JCW called MAILBADLOCK is
set to 1. The HP Desk UDC can be modified to test this JCW and log the
user off it if it is set to 1. This is a good way of providing extra
security.
Fields in XDS which Must be Filled in
None.
Optional XDS Fields
None.
XDS Values Returned to Application
None.
MPE/iX 5.0 Documentation