1. Command line options
xtme is started by issuing a command to the operating system.
Its behavior is controlled primarily through X resources,
which may be specified on the command line but which are
generally stored in an disk file in the user's home directory.
To edit an existing metadata file, give its name on the
command line as an argument.
2. X resources
Standard X resources can be specified to govern the behavior of the
Athena Widgets used by xtme. In addition, the following resources
can be used to affect the behavior of xtme.
configFile
This resource identifies the configuration file used for specifying
input options and local extensions. The default value for this
resource is .mprc, so xtme will look in the current directory for
a file with that name.
helpFile
This resource identifies the file containing text intended to assist
the user in filling in element values, respectively. The default
value for this resource is xtme.hlp, so xtme will look in the
current directory for a file with that name.
keyboardFocusPolicy
By default, it matters where the pointer is when you press keys. If
you like pointer focus in your window manager, you are probably
comfortable moving the mouse around a lot while typing. But if,
like me, you prefer click-to-type windows, then you will want to
change this value to Explicit. Letter case doesn't matter.
Actions for event translations
The following actions are available for use in translation
tables.
save Write the current file to disk
save-as Save the current file under a different name
quit Exit the editor without saving
ok-save Accept the name given in the save-as dialog
cancel-save Cancel the save-as dialog
cut Remove the current node, making it the X selection
copy Copy the current node, making it the X selection
paste Paste metadata from this or another file
clear Remove scalar children in the current subtree
duplicate Create a copy of the current element
help Display guide information for the current element
dismiss Dismiss the guide information window
hide Conceal elements below the current node
show Reveal elements below the current node
collapse Conceal all elements at a given level
expand Reveal all elements at a given level
list-home Move to the root node of the metadata
list-up Move up one element in the list
list-down Move down one element in the list
list-pageup Move up one screen-full in the list
list-pagedown Move down one screen-full in the list
Some of these actions are the same as menu items, while others are
not. There are no menu items that invoke the actions list-home,
list-up, list-down, list-pageup, and list-pagedown. The list-
actions are accomplished using the mouse in the scrollbar of the
list window.
3. Input file format
Since the FGDC Content Standards for Digital Geospatial
Metadata, as the name implies, specifies only the contents of
metadata files and not their encoding, it is necessary to
choose or devise a specification for metadata encoding in
order to create formal metadata. The encoding format interpreted
and produced by this editor is the same as that used by mp.
Interested users are referred to the documentation for mp
for details on this file format.
4. Configuration file format
The configuration file should be laid out exactly as for mp.
5. Local extensions
Local extensions, element names not found in the FGDC standard
and the relationships among them, are described in a text file
laid out exactly as for mp.
6. Help file format
A help file is provided with the editor. It contains brief
descriptions of the standard elements, with the syntactical
structure of compound elements described using the production
rules of the standard. Additional elements can be added to
this file. To add another element, place its name at the
beginning of a line. The text describing the element should be
placed on lines following the element name but in each of these
lines the first character must be a space or tab. Elements
can be added in any order.
7. Output file format
The metadata are output using the same encoding format as input,
but on output the indentation is standardized at two spaces per
level in the hierarchy.
8. Operation
The editor can be invoked with no arguments. In that case,
the metadata will be saved as "Untitled" unless the name is
changed using the Save As option in the File menu. If a file
name is given on the command line, that file will be opened
and its contents will be interpreted as metadata. If the file
does not exist or is empty, a Metadata node will be created
to which the user may add appropriate elements.
The display consists of three parts: a menu bar at the top,
a scrolling list widget containing the structural elements
of the current metadata, and a text widget containing the
contents of the currently selected element.
To add an element to the metadata, select the parent element
in the list widget, then choose the appropriate component
from the Add menu. Note that the Add menu changes to reflect
the components permitted under each element. When a scalar
element (that is, one not composed of other elements) is
selected, the Add menu will urge the user to enter the text
in the text widget. The insertion caret will then be visible
and text can be entered. Note that text can be inserted using
the standard X selection (cut-and-paste) function.
To delete an element of the metadata, select it in the list widget,
and choose Cut from the Edit menu. Note that this removes the
entire subtree (that is, the element, its components, and their
components). The Cut option in the Edit menu makes the subtree
available through the X selection mechanism, and the subtree can
be pasted into another application. At this writing, the paste
operation will convert the subtree to indented text.
The Copy option of the Edit menu also makes the current subtree
available to the X selection mechanism, but does not remove the
subtree from the current tree.
The Clear option of the Edit menu removes the scalar data from
the current element, its components, and their components. This
allows the user to retain the structure of a subtree but replace
the information it contains.
The Paste option of the Edit menu causes xtme to attempt to
insert the subtree most recently cut or copied. The subtree
is inserted as a child of the current element if that is
permitted by the standard. If the first node of the subtree
is not a child of the current element, xtme looks up the
tree towards the root node for an element into which the subtree
can be inserted. If there is no such element, the subtree
is not inserted.
To insert a section of metadata from another file or application,
select it in the other application and invoke the paste action
(by default, pressing the middle mouse button in the list window).
The data are expected to be ASCII, indented using the same rules as
for mp and xtme, so you can select a section of indented text using
a text editor or use Cut or Copy from xtme.
------------------------------------------------------------
I have tried to make the paste menu item operate the same way as
the paste action, but I have been unable to make it work without
crashing. The problem appears to lie with the time value passed
to XtGetSelectionValue; when the paste function is invoked through
an action procedure, the time can be taken from the event that
precipitated the action or from XtLastTimestampProcessed and the
selection value is obtained quickly and correctly. But when the
function is invoked through the menu item's callback procedure, the
time obtained from XtLastTimestampProcessed, while apparently a
legitimate time value, is somehow not correct, because the program
freezes for a while, then dumps core. If you know a lot about Xt
programming and are willing to assist with this problem, please
send email to pschweitzer@usgs.gov.
------------------------------------------------------------
The Duplicate option of the Edit menu causes xtme to create an
empty copy of the current element immediately following the
current element, at the same level in the hierarchy.
The Swap option of the Edit menu moves the element that is
currently selected up in the list of components of its parent.
This allows you to reorder the components of a compound
element.
The View menu allows the user to control the display of elements
in the list widget. Options are as follows:
All levels Make the entire hierarchy visible.
1 level Conceal all elements below the first level.
2 levels Conceal all elements below the second level.
3 levels Conceal all elements below the third level.
Hide Conceal all components of the current element.
Show Reveal all components of the current element.
Normally choosing "1 level" makes the components of Metadata
visible but their components invisible.
When an element's components are hidden, a plus sign is shown
at its left side in the list widget.
The Help menu has three options. Each causes text to be displayed
in a popup window. To remove the popup window, choose its Dismiss
button. The text widget is configured to wrap the text by default,
but this can be changed by choosing the Wrap button.
Version displays the version number and date of xtme. Element
displays information specific to the element currently selected
in the list widget. This information is updated every time you
select a different element in the structure. Output displays the
complete metadata record, with textual values in the indented
hierarchical format. Note that the popup shows the metadata as it
was when the Output option was selected and is not updated
automatically. To display later changes, choose Output again from
the Help menu.
To exit the editor without saving changes to the metadata, choose
Quit from the File menu. To save the metadata at any time, choose
Save. To exit the program, saving the changes, choose Close. To
save the metadata under a new name, choose Save As; a popup dialog
permits entry of the new name.
9. Known bugs
When pasting in a subtree from another application, xtme will
crash if a line in a textual value in the pasted subtree begins
with a recognized element and is indented relative to the text
immediately following it.