Version: 3.1
LEA Object Wizard version 2.3
Back to:
Lynx Exploration Archivist applications are able to access, catalogue and manipulate many different types of data file via the concept of a Lynx Exploration Archive Object. Lynx Exploration Archive Objects are designed as a framework to classify and access data by useage rather than by file format. For an end-user, the physical file format of exploration data should not be relevant: the information contained is important. LEA Objects enable applications to access the varous file-types encountered in exploration data archives (including seismic, well, location, raster, document and other spcialised formats) in a consistent and uniform manner.
The framework is designed to be customisable by users, so that
additional formats and attributes can be added to existing LEA Object types,
and new user-defined LEA Object types added which extend the
functionality of Lynx Exploration Archivist applications.
The
LEA Object Wizard can be used to edit existing LEA
Object types, and add new types, with user-defined formats and attributes.
A file format is a definition of the layout of the binary
information in a file. A proper file format is independent of the computer
system on which the file is stored. In other words, the format definition
should specify the byte order of integer and floating point types, the
delimiters used in text files etc - in fact a complete definition at the
bit level.
The LEA Object framework is designed to allow users to redefine
the method used to recognise a particular file format used by an LEA Object
type, or to add new formats to an LEA Object type, using local COM
servers, script files or dynamic link libraries (see
LEA Object Implementation below).
Every LEA Object type has a set of attributes. An attribute is
one of the items of data present in the conceptual definition of a particular
LEA Object type. For example the attribute "number of traces" is an attribute
shared by all seismic files. This does not mean, of course that an actual
seismic format implementation will necessarily define a place to put this
attribute.
As with formats, the mechanisms used to read attribute values can
be redefined, and extra attributes can be added to existing LEA Object types by
defining their characteristics and access methods in script files or DLLs (see
LEA Object Implementation below).
All LEA Objects are accessed through the same interface, which is provided by the ILEAObject interface in the LEA system file LEAOBCOM.DLL. This provides for
Each LEA Object type is defined in its own INI file. This INI file describes the file formats which each LEA object can recognise, and the attributes to read, display, and (in some cases) edit. The format-recognition and attribute access for these types is implemented in one of two ways:
Standard LEA Object types may contain mechanisms to read and write data as well as attribute values, however, data input/output is not part of the LEA Object defintion. Additional LEA Object types can be defined by creating a COM server that implemets the LEA Object interfaces required. See Implementing LEA Objects as COM Servers below
The LEA Object Wizard can be used to edit existing and create new LEA Object types.
On startup, the wizard reads the LEAOBJ.INI file, and loads a list of the current LEA Object types from the [COM_CLASSES] section of this file.
The wizard has the following menu commands:
This page (displayed above) allows you to edit the general properties of the LEA Object.
This name is used in LEA catalogues for reconciling objects and their locations, and when selecting LEA Object types (for example in Dougal). The name should be short but descriptive. If no name is supplied, the name of the LEA Object's INI file is used by default.
This field is stored as the value of the name key in the [OBJECT_DESCRIPTION] section of the LEA Object INI file.
This description is used when selecting LEA Object types (for example in Dougal), and also in the LEA Object Attribute Display dialogue and the LEA Object Attribute Editor.
This field is stored as the value of the description key in the [OBJECT_DESCRIPTION] section of the LEA Object INI file.
The name of the DLL file that contains the COM server which implements the LEA Object. If the LEA Object is implemented by script definitions, the entry here will be the LEA Object system library LEAOBCOM.DLL. Click the Browse button to display a file selection dialogue. If the file name specified does not include a directory path, then the file will be searched for in the following directories:
This field is stored as the value of the dll key in the [OBJECT_DESCRIPTION] section of the LEA Object INI file.
- The user's CUSTOM directory
- The directory containing the wizard's executable
- The LYNXSYS directory
- The Windows SYSTEM32 and SYSTEM directories
- The WINDOWS directory
- Directories listed in the PATH environment variable
The class name is used internally by the LEA application to create an instance of the LEA Object. This value is stored in the Windows registry, and is used to look up information about the object required by Windows in order to create it. The class name is referred to as the progid in Windows documentation. Select the correct value from the drop-down list, which is read from the DLL file specified above. If the LEA Object is implemented by script definitions, the entry here will be the base LEA Object LEAObCom.FileObject. See LEA Object Implementation above for more details.
This field is stored as the value of the com_class key in the [OBJECT_DESCRIPTION] section of the LEA Object INI file.
This edit field can contain the default program to use to view objects of this type. Click the Browse button to display a file selection dialogue. If the file name specified does not include a directory path, then the file will be searched for in the standard system search path. You can also specify different viewers to be used for specific formats in the Format Definition below.
This field is stored as the value of the default viewer key in the [FORMAT_VIEWERS] section of the LEA Object INI file.
This edit field contains an optional name of a help file for the LEA Object. Click the Browse button to display a file selection dialogue. If the file name specified does not include a directory path, then the file will be searched for in the standard LEA help directory (usually a subdirectory of the LYNXSYS directory).
This field is stored as the value of the helpfile key in the [HELP] section of the LEA Object INI file.
This is used to check compatibility at runtime between the LEA Object described in the INI file, and the version of the base LEA Object compiled into the executable file. You should not normally edit this field.
This field is stored as the value of the version key in the [LYNX] section of the LEA Object INI file.
Each LEA Object type can recognise a number of distinct file formats. A method of format recognition recognition must be defined, a (language-dependent) format name, and a list of common file extensions for this format.
This page displays all the formats defined for the current LEA Object.
Format definitions can be edited by double-clicking on the entry in the
list (or selecting the Entry-Edit
menu option) and
new format definitions can also be added (Entry-Add
menu option) - see format defintion parameters and
options below.
Format defintions can also be removed from the list (Entry-Delete
menu option).
The order in which formats are checked can be changed by
dragging items in the list, or by using the Entry-Move up
and Entry-Move down menu options.
The order in which formats appear in the list is reflected in the order
in which the LEA Object will check each format when attempting to
recognise the format of a data file.
For instance, if you have two
formats, where format 1 is recognised by the string lynx at the
start of the file, and format 2 is recognised by the string lynx
information systems at the start of the file, format 2 must appear
in the list before format 1, otherwise format 2 will never
be detected.
The following parameters are displayed in a PrmEdit wizard when you edit an existing format definition or add a new format defintion.
Code
Each format defined for an LEA Object must have a unique
numeric code which is used internally by the LEA Object as the format
identifier. For formats which use the INTERNAL Format Recognition (see below),
this code should match the integer argument passed to the format recognition
function of the ILEAFileRecognition interface (see Implementing LEA Objects as COM Servers (below)). When you add
a new format, a unique code is determined automatically. There should be no
need to alter this value unless you wish this value to match the value returned
from a pre-defined DLL format recognition function.
The value -999 is
reserved for use by the base LEA Object, and should not be used.
Name
This should be a short descriptive name for the format. Each
format defined in an LEA Object should have a unique name.
Extensions
A list of common file extensions for the format, separated by
commas. Extensions may include wildcards such as ? and *.
Matching the file extension is one of the methods that can be used for
format recognition (see below), and in some cases can be used to
override the specified format recognition method when attempting to open
a data file.
A list of file extensions is optional, but must be
present if the format recognition method is
EXTENSION.
Format Recognition
This defines the mechanism by which files of this format will
be detected.
Select one of the following options:
- INTERNAL - The recognition of files of this format is
dealt with internally by the COM class defined on the Object Description tab of the wizard.
- SCRIPT - This enables further
parameter pages, which allows you to define a DLL function or a pattern to
search for within the file. This information is saved in a separate
script file.
- EXTENSION(default for new format definitions) - The format
can be recognised from the file extension. Each format may have a
set of extensions (see above). It is possible that
a given extension may be shared by more than one format, so that this is not an
unambiguous way of recognising a file. However, it is fast and serves as a way
of including files which are of the correct type, but are not recognised for
some reason by other methods.
Attribute Access
This defines the mechanism by which the attribute values are
read for files of this format. Standard LEA Object types with pre-defined
formats have a number of built-in attributes. Reading (and writing) these
attributes is dealt with by COM libraries. For user-defined LEA Objects, or
additional user-defined formats and attributes, a script defines the
mechanism used to read attribute values.
- NULL (default for new format definitions) - Attribute
values cannot be accessed for LEA Objects of this format. All attribute values
will be returned as null values.
- INTERNAL - Attribute access for LEA Objects of this format
is dealt with by the COM class defined on the Object
Description tab of the wizard.
- SCRIPT - The attribute access for LEA Objects of this
format is defined in a separate script, defined in a
further parameter page.
Format Viewer
Specify a program that will be used to view LEA Objects of
this format. This is used in preference to the default viewer specified on the
Object Description tab page (see
above).
This parameter page is activated if the Format Recognition on the Format Definition page is set to SCRIPT.
Script file name
Enter a name for the script file. You can use the same file
to store all the script entries for different format recognition methods and
attribute access methods within an LEA Object, but you should not use the same
script file for two different LEA Objects.
If the file name entered
contains no directory path, then the script file will be searched for at
run-time in the standard LEA directories:
ie
- LEA user's CUSTOM directory
- The directory containing the application's EXE file
- The LEA System directory (specified by the syspath key in
LEASTART.INI and usually called LYNXSYS)
Script section
Enter a name for the section within the script file.
Script files are formatted similar to INI files, and the information
they contain is divided into sections.
The default name for this section is
FORMATS.
All formats can have an entry within the same section, as
the entry for each format is keyed by the format
code (see above), which is unique for each format defined by the LEA
Object.
Recognition Method
This parameter defines the mechanism by which a format will
be detected when using a script file (see also the Format Definition - Format Recognition parameter.
Select one of the following options:
- INTERNAL - This corresponds to the INTERNAL method for format recognition defined on
the initial Format Defintion page. The recognition of files of this format is
dealt with by the COM class specified on the Object
Description tab page.
- DLL - This enables a further
parameter page to define a function from a DLL as the method of format
recognition.
A DLL (Dynamic Link Library) is a compiled collection of
functions that can be accessed by Windows applications. See Using Dynamic Link Libraries (below) for details of how to
create a DLL that can be used by an LEA Object.
- FIND - This enables a further
parameter page. This is the easiest way for you to customise LEA Objects by
adding new formats. Many file formats can be recognised by distinctive
byte-sequences or values at specified byte-offsets within the file. For
example, TIFF files all start with the hex byte sequence 49 49 or 4D 4D. The
next parameter page allows you to specify a number of the byte-offsets, the
types of variable to read, and a range of possible values to accept for this
variable.
This parameter page defines the DLL function used for format
recognition, and is activated when the Recognition
Method parameter on the Script Format
Recognition page is set to DLL.
For more details of using a DLL
for format recognition, see Using Dynamic Link Libraries
- Format Recognition (below).
File Name
Enter the name of the dynamic link library to use. If the
file name entered contains no directory path, then the DLL will be searched for
at run-time in the standard directories searched by Windows (see
DLL Search Sequence below).
Function Name
The name of the function within the DLL. This is matched
case-sensitively. If you are unsure of the exact function name, use the
Quick View utility to examine the exported function names.
Return Format Code
Select one of the following options:
- NO - the format recognition function will return the value
specified by the Return Value parameter (below) to
indicate that the data file currently being tested is of this format.
- YES (default) - the format recognition function returns
the value which is used as the Format Code. This
requires design synchronisation between the DLL and the LEA Object, but makes
adding new formats to the DLL quicker.
Return Value
This parameter is enabled if the Return Format Code parameter (above) is NO.
The format recognition function will return this value to indicate that the
data file currently being tested is of this format.
This parameter page defines the DLL function used for format
recognition, and is activated when the Recognition
Method parameter on the Script Format
Recognition page is set to SCRIPT.
Many file formats can be
identified by distinctive byte-sequences or values at specified byte-offsets
within the data file. This parameter page allows you to specify the
byte-offset, the type of variable to read and a range of possible values to
accept for this variable.
You can specify up to four such searches (use the
Mutiple Page toolbar displayed at the base of the page), which will be
combined using the Condition parameter below to
create a flexible format defintion.
Condition
This parameter is used to combine the results of each
offset-value search.
Select one of the following options:
- AND (default) - The value specified in this search must be
found in the data file. If it is not found, then the entire search will
fail.
- OR - If the value specified in this search is not found,
then continue with the next search
- NOT - If the value specified in this search is found, then
the entire search will fail.
Offset
The number of bytes from the start of the file at which to
search.
Value Type
This option specifies the generic type of the value to read.
Select from:
- BYTESEQ - Read a byte-sequence from the data file. If the
speed of the format recognition by script is an issue, then this is the fastest
method.
- STRING - A sequence of ANSI characters.
- INTEGER - An integer numerical value (whole number).
Note: not a string representation of an integer.
- TRUE/FALSE - A boolean/logical value.
- FLOAT - A floating-point (fractional) numerical
value.
- DATE/TIME - A date and/or time value.
The option chosen here determine which of the parameters below are
enabled.
The following 2 parameters are enabled if the Value Type is BYTESEQ
Byte conversion
Select either of the following options:
- DEC - Each byte specified in your byte sequence(s) below
is to be translated as a decimal value.
- HEX - Each byte specified in your byte sequence(s) below
is to be translated as a hexadecimal value.
Match byte sequence(s)
This field should contain the byte sequence that you wish to match
in the data file. Each byte value in the sequence should be spearated by
spaces. You can specify a number of alternative byte sequences to check for at
the same byte offset by separating multiple byte sequences with commas.
For example
AA AA, BB BB
will check for the either of the hexadecimal byte sequences AA AA or
BB BB.
The longest byte-sequence in the list specifies the number of bytes
read from the data file.
The following 2 parameters are enabled if the Value Type is STRING
String conversion
This option determines how the characters read from the data
file are translated before comparing them to the string(s) below:
- ASCII (default) - The characters to be read require no
translation
- EBCDIC - Data from the file will be read as EBCDIC
characters.
- UNICODE_INTEL - Data from the file will be read as a
Unicode string and translated into ANSI.
- UNICODE_REV - Data from the file will be read,
byte-swapped, and translated from Unicode to ANSI.
Match string(s)
This field specifies alternative strings to match. Strings
containing spaces must be quoted using the double-quote ( " )
character. Separate each string from the next with a comma. The longest string
in the list specifies the number of bytes to be read from the
file.
The following 2 parameters are enabled if the Value Type is INTEGER
Integer conversion
This option determines how an integer value should be read
from the data file.
- INT1 - A single-byte value
- INT2 - A 2-byte value in Intel byte-order
- INT2_REV - A 2-byte value in Reverse-Intel byte-order,
will be byte-swapped.
- INT4 (default) - a 4-byte value in Intel byte-order.
- INT4_REV - A 4-byte value in Reverse-Intel byte-order,
will be byte-swapped.
Min,Max or list of distinct alternatives
This field should specify a number of integer values, separated by
commas.
If the list contains two fields, these are taken as the
minimum and maximum values accepted.
If the list does not contain two
fields, then each field is taken as a distinct alternative value for the
integer value read from the data file.
The following 2 parameters are enabled if the Value Type is TRUE/FALSE
True/false conversion
This option determines how a logical value should be read
from the data file.
A value of zero is interpreted as false and a
non-zero value is interpreted as true.
- BYTE1 (default) - A single-byte value
- BYTE2 - A 2-byte value in Intel byte-order
- BYTE2_REV - A 2-byte value in Reverse-Intel byte-order,
will be byte-swapped.
- BYTE4 (default) - a 4-byte value in Intel byte-order.
- BYTE4_REV - A 4-byte value in Reverse-Intel byte-order,
will be byte-swapped.
Value
This field contains the logical value which must be read from the
data file - either TRUE or FALSE.
The following 3 parameters are enabled if the Value Type is FLOAT
Float conversion
This option determines how a floating-point value should be
read from the data file.
- IEEE (default) - A 4-byte value in IEEE format (Intel
default format)
- IEEE_REV - A 4-byte value in Reverse-Intel IEEE format,
will be byte-swapped.
- ANSI - A 4-byte value in ANSI format. This conversion is
undefined at present.
- VAX - A 4-byte value in VAX format.
- IBM - A 4-byte value in IBM format
- IBM_REV - A 4-byte value in Reverse-Intel IBM format, will
be byte-swapped.
- BORLAND6 - A 6-byte Borland 'Real' value.
Because of the rounding errors inherent in
floating point formats, direct comparisons of the equality of floating point
values are unreliable. You can therefore check the value read from from the
data file against a range of values:
Min - the minimum acceptable value.
Max - the maximum acceptable value.
The following 3 parameters are enabled if the Value Type is DATE/TIME
Date/time conversion
Date/time values can be stored in files in a variety of ways.
At present there is only one type of date/time value that can be interpreted by
LEA Objects:
- MICROSOFT - An 8-byte value which can store a date and/or
time.
Min - the minimum acceptable date/time value
Max - the maximum acceptable date/time value.
See LEA Date/Time string
representation (below) for details of how to specify the date/time
values.
This page is activated when the Attribute Access parameter on the Format Defintion page is SCRIPT.
Script file name
Enter a name for the script file. You can use the same file
to store all the script entries for different format recognition methods and
attribute access methods within an LEA Object, but you should not use the same
script file for two different LEA Objects.
If the file name entered
contains no directory path, then the script file will be searched for at
run-time in the standard LEA directories:
ie
- The user's CUSTOM directory (specified by the
networkpath or localpath key in LEASTART.INI)
- The directory containing the application's EXE file
- The LEA System directory (specified by the syspath key in
LEASTART.INI and usually called LYNXSYS)
Script Section
Enter a name for the section within the script file.
Script files are formatted similar to INI files, and the
information they contain is divided into sections.
Usually, each format
should have its own attribute access section, as the attribute access method
may be different for each format. However, if two different formats use the
same method to read attributes (such as calling the same DLL function with the
same arguments, then they can share the same script section, but bear in mind
that the attribute access methods for all attributes must be
identical.
If the Wizard detects that the script section name you have
entered matches one already in use for the attribute access methods of another
format, you will be warned of this, and asked whether you wish to edit this
script section name.
The method used to read the value of each attribute can be edited in the Attribute Access tab page.
LEA Objects have a number of attributes defined. An attribute is one of the items of data present in the conceptual definition of a particular LEA Object type. For example the attribute "number of traces" is an attribute shared by all seismic files. This does not mean, of course that an actual seismic format implementation will necessarily define a place to put this attribute.
Attributes are read from a data file after the format of the file has
been determined (using the format recognition
method detailed above). If the attribute is present in the recognised format,
then it is read from the file.
The built-in LEA Object types have a number
of pre-defined attributes. These can be added to by users with the LEA
Object Wizard.
This page displays all the attributes defined for the current LEA Object. Attribute definitions can be edited by double-clicking on the entry in the list (or selecting the Entry-Edit menu option). New attribute definitions can also be added (Entry-Add). The order in which attributes are displayed can be changed by dragging items in the list, or by using the Entry-Move up and Entry-Move down menu options.
This page displays all the attributes defined for the current LEA
Object.
Attribute definitions can be edited by double-clicking on the
entry in the list (or selecting the Entry-Edit menu option) and new attributes can also be
added (Entry-Add
menu option) - see attribute defintion
parameters below.
Attributes can also be removed from the list (Entry-Delete menu option).
The order in
which attributes are displayed in the LEA Object Attribute Display dialogue and
the Attribute Editor can be changed by dragging items in the list, or by
using the Entry-Move up and Entry-Move
down menu
options.
The following parameters are displayed in a PrmEdit wizard when you edit an existing attribute defintion or add a new attribute defintion.
Code
Each attribute has a unique numeric code, which is used
internally by the LEA Object to identify the attribute. For attributes read by
the INTERNAL mechanism (see Format Definition above),
this code is used as the attribute identifier within the COM class. For a new
attribute this number will be determined automatically, so there should be no
need to edit this field, unless you wish this value to match the identifier
used in a DLL attribute access function.
Name
Each attribute must have a name. The name is
language-dependent, and should be unique within the LEA Object.
The
attribute name is used by the LEA Cataloguing Utilities in database tables. To
maintain compatibility across the widest range of database formats, it is
advised that the name should be no more than 10 characters long, contain no
spaces, and contain only upper case characters A-Z and digits 0-9. For more
details see Database Table Field Name
Restrictions (in Database Utilities).
Description
As well as a name, each attribute can also have a
description. This is a more verbose explanation of the attribute, which is used
in the LEA Object Attribute dialogue and the LEA Object Attribute
Editor.
Type
This specifies the data-type of the attribute. Select one of
the following options:
TYPE
Keyword
Description
Range
STRING
standard text
255 characters
INTEGER
whole numbers (32-bit)
-2147483648 to 2147483647
FLOAT
fractional numbers (64-bit)
5.0 x 10-324 to 1.7 x 10308 with 15-16 significant digits
DATETIME
a date and/or time value
TRUEFALSE
a logical true/false or yes/no
value
Width
This parameter must be specified for STRING and
FLOAT attribute types; for other types the value is ignored.
For
STRING attribute types, this parameter specifies the maximum number of
characters in the string.
For FLOAT attribute types, this parameter
specifies the number of decimal places to display.
Editable
YES or NO
This flag specifies whether the
attribute value can be edited and written back to the LEA Object data file. At
present this option only applies to attributes handled by the INTERNAL
attribute access method (see Format Definition -
Attribute Access method and Attribute Script
Method).
Cumulative
YES or NO
This flag specifies whether the
attribute value can usefully be totalled across a group of LEA Objects, and is
only valid for INTEGER and FLOAT attribute types.
Key Attribute
YES or NO
This flag specifies whether the
attribute should be treated as a Key Attribute
(see below).
Once a file has been recognised as having a particular format, the LEA Object will read the values of all attributes using the mechanism defined for that format (see Format Definition - Attribute Access Method).
For standard LEA Objects with pre-defined formats and attributes, reading (and writing) these attributes is dealt with internally. For user-defined LEA Objects, or additional user-defined formats and attributes, you must also define a mechanism to read each attribute.
This page displays the a grid representing the method used to read each attribute for each format defined in the LEA Object. If the attribute access method specified in the format definition is not SCRIPT then the entry will be greyed out and cannot be edited here.
Note that the attributes and the formats are displayed in the grid in the order in which they appear in the defintion lists on the Format Definition tab page and the Attribute Definition tab page.
Edit an access method by double-clicking the entry in the grid
(or using the Entry-Edit menu option)
Edit all attributes for a format,
or all (available) formats for an attribute by double clicking the
row/column header (or using the Entry-Edit All
Attributes and
Entry-Edit All Formats menu options). These options can be
useful if the access methods for all formats or all formats use the same DLL
function, for example.
You can only
successfully Edit All Formats if at least one of the
format definitions has its attribute access method
set to SCRIPT.
The following parameters are displayed in a PrmEdit wizard when you edit an attribute access method.
Method
Select one of the following methods of reading the attribute
value:
- NULL (default) - The attribute is not present, or cannot
be read, from data files of this format.
- INTERNAL - This option is only valid for pre-defined
attributes in standard LEA Object types implemented by COM classes.
- FIND - The attribute value will be read from a specified
byte-offset within the data file. Further parameter pages are activated to
allow you to specify the byte-offset, the type of variable to read and an
optional range of acceptable values.
- DLL - The attribute value is retrieved via a DLL function.
See Using Dynamic Link Libraries - Attribute
Access. Further parameter pages are activated to allow you to specify the
DLL and function name to use.
This parameter page is activated when the Attribute Access Method parameter is FIND.
Byte Offset
The number of bytes from the start of the file at which to
read the attribute value.
Value Type
This specifies the generic type of the value to be read. If
this type is different to the attribute type (see Attribute Defintion - Attribute Type), then the value
will be converted if possible, according to the table below:
Generic value type
read from data file
Conversion to
attribute type
STRING
A
sequence of ANSI characters.
- INTEGER - value is converted to an integer
- FLOAT - value is converted to a floating point
number
- TRUEFALSE -
string value is converted to an integer. If this suceeds and
this integer value is zero then the result is 'false', or if the value is
non-zero then the result is 'true',
- DATETIME -
string value is
assumed to be in the form specified in the locale-independent
LEA date/time string format.
INTEGER
An integer numerical value (whole number) - note, not a string
representation of an integer
- STRING - the value is converted to a string
representation
- FLOAT - the value is converted to a floating point
number
- TRUEFALSE - if the value is zero, the result is
'false', otherwise the result is 'true'
- DATETIME - an integer value cannot be converted into
a date/time value
FLOAT
A
floating-point (fractional) numerical value
- STRING - the value is converted into a string
representation.
- INTEGER - the value is rounded to an integer
- TRUEFALSE- the value is rounded to an integer.
If this value is zero then the result is 'false',
otherwise the result is 'true'
- DATETIME - the value is treated as a
MICROSOFT date/time value
TRUEFALSE
A boolean/logical value
- STRING - the result will be a 'true' or 'false'
string. (Boolean string values are read from the [LABELS] section of the
LEAOBJ.INI file
- INTEGER - if the value is 'true' the result will be
'1', otherwise the result will be '0'
- FLOAT - if the value is 'true' the result will be
'1.0', otherwise the result will be '0.0'
- DATETIME - true/false values cannot be converted
into date/time values
DATETIME
A date and/or time value
- STRING - the value is converted into an
LEA date/time string
- INTEGER - date/time values cannot be converted into
integers
- FLOAT - the value is treated as an 8-byte floating
point value
- TRUEFALSE - date/time values cannot be converted to
true/false values
The option chosen here determines which of the parameters
below are enabled.
The following 2 parameters are enabled if the Value Type is STRING
String conversion
This option determines how the characters read from the data
file are translated:
- ASCII - The characters to be read require no
translation
- EBCDIC - Data from the file will be read as EBCDIC
characters.
- UNICODE_INTEL - Data from the file will be read as a
Unicode string and translated into ANSI.
- UNICODE_REV - Data from the file will be read,
byte-swapped, and translated from Unicode to ANSI
Match string(s)
You can specifies a list of alternative values to accept (strings
that contain spaces should be quoted using the double-quote ( " )
character, and separated from each other with commas), or leave this field
blank to accept whatever is read from the file (in this case, the number of
characters read from the file is determined by the Attribute Width parameter in the Attribute
defintion.
The following 2 parameters are enabled if the Value Type is INTEGER
Integer conversion
This option determines how an integer value should be read
from the data file.
- INT1 - A single-byte value
- INT2 - A 2-byte value in Intel byte-order
- INT2_REV - A 2-byte value in Reverse-Intel byte-order,
will be byte-swapped
- INT4 - A 4-byte value in Intel byte-order
- INT4_REV - A 4-byte value in Reverse-Intel byte-order,
will be byte-swapped
Min,Max or list of distinct alternatives
If this field is blank, then any integer value read from the
specified byte-offset is valid. Otherwise, this field should specify a number
of integer values, separated by commas. If the list contains two fields,
these are taken as the minimum and maximum values accepted. If the list does
not contain two fields, then each field is taken as a distinct alternative
value for the integer value read from the data file.
The following parameter is enabled if the Value Type is TRUE/FALSE
True/false conversion
This option determines how a logical value should be read
from the data file.
A value of zero is interpreted as false and a non-zero
value is interpreted as true.
- BYTE1 - A single-byte value
- BYTE2 - A 2-byte value in Intel byte-order
- BYTE2_REV - A 2-byte value in Reverse-Intel byte-order,
will be byte-swapped
- BYTE4 a 4-byte value in Intel byte-order
- BYTE4_REV - A 4-byte value in Reverse-Intel byte-order,
will be byte-swapped
The following 3 parameters are enabled if the Value Type is FLOAT
Float conversion
This option determines how a floating-point value should be
read from the data file.
- IEEE - A 4-byte value in IEEE format
- IEEE_REV - A 4-byte value in Reverse-Intel IEEE format,
will be byte-swapped
- ANSI - A 4-byte value in ANSI format. Conversion undefined
at present.
- VAX - A 4-byte value in VAX format
- IBM - A 4-byte value in IBM format
- IBM_REV - A 4-byte value in Reverse-Intel IBM format, will
be byte-swapped
- BORLAND6 - A 6-byte Borland 'Real' value
If both the Min and Max are set to zero, then
any float value read from the specified byte-offset is valid, otherwise these
parameters specify the acceptable range of values.
The following 3 parameters are enabled if the Value Type is DATE/TIME
Date/time conversion
Date/time values can be stored in files in a variety of ways.
At present there is only one type of date/time value that can be
interpreted by LEA Objects:
- MICROSOFT - An 8-bye value which can store a date and/or
time
The Min and Max fields can be left blank to
accept any value read from the specified byte-offset, or you can specify the
range of acceptable values. Date/time values must be specified in LEA
locale-independent format - see LEA Data/Time
strings (below).
This parameter page is activated when the Attribute Access Method parameter is
DLL.
For more details on using a DLL to retrieve attribute values,
see Using Dynamic Link Libraries - Attribute
Access (below).
File Name
Enter the name of the dynamic link library to use. If the
file name entered contains no directory path, then the DLL will be searched for
at run-time in the standard directories searched by Windows (see
DLL Search Sequence below).
Function Name
The name of the function within the DLL. This is matched
case-sensitively.
If you are unsure of the exact function name, use the
Quick View utility to examine the exported function names.
Pass Attribute Code
Select one of the following options:
- NO - the attribute argument value is specified below.
- YES (default) - the attribute code (see
Attribute Defintion) is passed to the DLL function as
the attribute argument value. This requires design synchronisation between the
DLL and the LEA Object, but makes adding attributes more straightforward.
Attribute argument
This parameter is enabled if the Pass Attribute Code parameter (above) is
NO
The value specified will be used as the argument passsed to the
attribute access function. See Using Dynamic Link
Libraries - Attribute Access (below) for more details.
Pass format code
Select one of the following options:
- NO - the format argument value is specified below.
- YES (default) - the format code (see Format definition) is passed to the DLL function as the
format argument value. This requires design synchronisation between the DLL and
the LEA Object, but makes adding attributes and formats more straightforward.
Format argument
This parameter is enabled if the Pass Attribute Code parameter (above) is
NO
The value specified will be used as the argument passsed to the
attribute access function. See Using Dynamic Link
Libraries - Attribute Access (below) for more details.
This parameter page is activated when the Attribute Access Method parameter is
FIND.
See Using Dynamic Link Libraries -
Attribute Access (below) for more details.
Open function
The name of the DLL function used to open the data
file.
Close function
The name of the DLL function used to close the data
file.
Verify function
The name of the DLL function used to verify that this
attribute is supported.
Script files can be used to add new file formats and attributes to LEA
Object types.
See Format Recognition and
Attribute Access above.
A script file is a text file in INI format with the entry
TYPE=SCRIPT
in the [LYNX] section, which defines the file as an LEA script file.
An LEA Object INI file may specify a script for format recognition or attribute access instead of using a COM library or DLL function. The named script file will be loaded from the first directory in which it is found from the list below:
The script may specify either a value to read from a specified offset within the file, or a DLL function to call. The syntax of both these methods is discussed later.
Script files use separator characters to parse script entries (see Script Entries below).
A script file can contain an optional [SEPARATORS] section, which can contain the following keys:
Word Separator=,
Clause Separator=;
Quote Char="
These keys can specify any single character that is part of the ANSI
character set. The three keys must all specify different characters. If this
section is not present, or if any of the keys are missing, then the default
values specified above are used.
This delimits the SEARCHTYPE keyword from the INFO string, and also separates subsequent INFO strings. The character chosen as the Clause Separator must not occur anywhere else in the strings it is delimiting, not even in quoted strings.
This delimits individual fields in the INFO string(s). See Script Entries below.
This is used to surround strings that contain spaces or Word Separator characters The script file is divided into sections which can contain entries for format recognition and attribute access. For descriptions of the syntax to use in script files, see Format Recognition and Attribute Access below.
Script entries are of the form:
n=SEARCHTYPE;INFO
where:
See Format Recognition and Attribute Access for more details on the syntax to use in script files.
A dynamic link library is a compiled collection of functions that can be accessed by Windows applications. DLLs can be written in many programming languages, such as Delphi, C and C++. You can specify custom functions for file format recognition and attribute access which match the function prototypes which the LEA Object expects. These are defined below. All the functions used by the LEA Object within the DLL must use the stdcall calling convention (the same calling convention as Windows API functions).
The DLL file name in the script file will not usually include path information. If the path is not specified then the following directories will be searched for the DLL
The format recognition function should accept a Windows file handle as its single argument and return an integer which equals the value specified in the script file as the return value if the file is of the required format.
The function exported from the DLL should match the description below:
int __stdcall xxxx(HANDLE hFile); C++ prototype function xxxx(hFile: THandle): integer; stdcall; Pascal forward declaration
If the same DLL function is used to recognise multiple file formats in the LEA Object, the function will be called only once for each file, and the result compared with each expected return value in turn.
See Script file format recognition entry layout for details of how to specify a DLL function for format recognition in a script file.
Attribute values can be read from LEA Object files using a custom DLL function. To use a DLL for LEA Object attribute access, the DLL must export initialisation functions which correspond to the prototypes below.
The function names in the script file are matched case-sensitively with the function names from the DLL.
This function will be called once, when the LEA Object file is opened. .
HANDLE __stdcall xxxx(char* filename); C++ prototype function xxxx(filename: pchar): THandle; stdcall; Pascal forward declaration
This function should return an open Windows file handle to the LEA
Object file. Since the file may already be open within the LEA Object, the
share mode used must not be exclusive. The file handle returned by this
function will be passed as an argument to the attribute reading function
(below).
This function can be used to read the attribute values into local
variables, or to allocate local resources used in the file access.
This function will be called once when the LEA Object file is closed
void __stdcall xxxx(HANDLE fHandle); C++ prototype procedure xxxx(fHandle: THandle); stdcall; Pascal forward declaration
The file handle passed as an argument is the handle returned from the open function above. This function should close the file handle and dispose of any local resources allocated when the file was opened.
This function will be called for each attribute when the DLL function is linked into the LEA Object, to verify that the attribute is supported.
bool __stdcall xxxx(int iattr); C++ prototype function xxxx(iattr: integer): boolean; stdcall; Pascal forward declaration
This function verifies that the attribute is supported by the DLL. The interface to this function may change in later versions of the LEA Object. This function should return true (not zero) for all attribute numbers supported by this DLL.
The function specified in the attribute access section of the script file is called to return the value of the attribute for the current file. If necessary, different attributes may use different functions within the DLL to return their value, or even different DLLs (in which case each DLL must have its own set of open, verify and close functions
void* __stdcall xxxx(HANDLE fHandle, int iformat, int iattr); C++ prototype function xxxx(THandle: fHandle; iformat, iattr: integer): pointer; stdcall; Pascal forward declaration
The type of pointer returned must match the type of the variable specified in the LEA Object INI file:
LEA Object attribute type | Pointer return type |
---|---|
STRING | null-terminated single-byte character array |
INTEGER | 4-byte integer |
FLOAT | 8-byte floating point value |
TRUEFALSE | single-byte value (0=false) |
DATETIME | 8-byte Microsoft DATETIME value |
Each DLL referenced in an attribute access section of a script file must also have an initialisation section which lists the function names of the open, verify and close functions:
[DLLNAME]
open=OPENFUNCNAME
close=CLOSEFUNCNAME
verify=VERIFYFUNCNAME
where:
DLLNAME is the file name of the DLL, which must match exactly the DLL name specified in the attribute access script entry.
OPENFUNCNAME, CLOSEFUNCNAME, and VERIFYFUNCNAME are the names of the initialisation functions within the DLL, as described above. Note that these function names should match exactly the function names explorted from the DLL. You can examine the exported function names using a utility such as QuickView.
The standard LEA Objects are implemented using COM Automation interfaces. This enables each LEA Object to act as a 'plug-in' component.
The standard LEA Objects are each implemented by a single COM class that supports a number of predefined interfaces:
These interfaces are defined in the LEAOBCOM.DLL type library
IDL definition of ILEAFileRecognition interface:
[ uuid(A65472A0-5323-11D4-B3F3-444553540000), version(1.0), dual, oleautomation ] interface ILEAFileRecognition: IDispatch { [id(0x00000001)] HRESULT _stdcall FileIsFormat([in] BSTR filename, [in] long ifmt, [out, retval] VARIANT_BOOL * Value ); };This interface contains one method - FileIsFormat - which is called to determine whether the file specified by filename is of the format specified by ifmt - the format code. This method may be called multiple times with the same filename argument for different format codes.
This interface must be implemented if the format recognition method for any of the defined formats is INTERNAL (see Format Defintion above)
IDL definition of ILEAReadAttributes interface:
[ uuid(48A50CE2-518A-11D4-B3F3-444553540000), version(1.0), helpstring("Interface to be implemented by derived LEA Objects"), dual, oleautomation ] interface ILEAReadAttributes: IDispatch { [id(0x00000003)] HRESULT _stdcall OpenFile([in] BSTR filename, [in] long ifmt, [in] VARIANT_BOOL writeable ); [id(0x00000004)] HRESULT _stdcall GetMaxLogicalFiles([in] BSTR filename, [out, retval] long * Value ); [id(0x00000005)] HRESULT _stdcall OpenLogicalFile([in] BSTR filename, [in] long ilogfilenum ); [id(0x00000006)] HRESULT _stdcall GetAttribute([in] BSTR filename, [in] long ilogfilenum, [in] long iattr, [out] TAttrStatus * Status, [out, retval] VARIANT * Value ); [id(0x00000008)] HRESULT _stdcall CloseFile([in] BSTR filename ); [id(0x00000009)] HRESULT _stdcall GetObjName([in] BSTR filename, [in] long ilogfilenum, [out, retval] BSTR * Value ); [id(0x0000000A)] HRESULT _stdcall GetObjShape([in] BSTR filename, [in] long ilogfilenum, [out, retval] TLEAShape * Value ); };This interface must be implemented if the attribute access method for any of the defined formats is INTERNAL (see Format Defintion above).
When an input file is opened as an LEA Object, the ILEAReadAttributes methods will be called in the following order:
After the format of the file has been verified (via either the ILEAFileRecognition interface, through file extension matching, or a script entry), the OpenFile method is called: ifmt is the format code, and writeable specifies whether the file should be opened read-only (false) or read-write (true). Use this method to allocate resources that will be required when reading the input file.
GetMaxLogicalFiles. This method should return the index number of the last conceptual logical file contained within the input file (ie if there are three logical files, the first logical file is index 0, and the last is index two). If there are no logical files, set Value to zero.
OpenLogicalFile will be called for the logical file index number to open. This function could be used to read the attribute values into internal variables If there are no conceptual logical files, this function can do nothing.
GetObjName is called for the specified logical file number ilogfilenum. The object name is one of the LEA Base Attributes (see below) and is retrieved from the file using this method.
GetObjShape is called for the specified logical file number. The object shape is one of the LEA Base Attributes. This determines the geographical extent of the object referred to by the file. Set Value to one of the TLEAShape constants defined in the LEAOBCOM type library:[ uuid(35211F00-519F-11D4-B3F3-444553540000), version(1.0) ] typedef enum tagTLEAShape { shpUNKNOWN = 0, shpPOINT = 1, shpLINE = 2, shpPOLYGON = 3 } TLEAShape;GetAttribute is called for each of the defined attributes for which the access method for the current file format is INTERNAL. iattr is the Attribute Code (defined above - see Attribute definition). Value should be set to the value of the attribute, bearing in mind that the value must be converted from an VARIANT type into either a STRING, INTEGER, FLOAT, BOOLEAN or DATETIME type.Status should be set to one of the TAttrStatus constants defined in the LEAOBCOM type library:
[ uuid(8DB6BA2B-4CDE-11D4-B3F3-444553540000), version(1.0) ] typedef enum tagTAttrStatus { asUNDEFINED = 0, /* attribute value is undefined for this format */ asOK = 1, /* attribute value is OK */ asCONV = 2, /* error converting attribute value into required type */ asRANGE = 3, /* attribute value out of range */ asABSENT = 4 /* attribute is absent */ } TAttrStatus;CloseFile is called once when the input file is closed. This method can be used to free resources allocated in the OpenFile method.
IDL definition of ILEAReadSubObject interface:
[ uuid(B017372B-D0C0-4315-A6FF-A0BF567C8575), version(1.0), helpstring("Interface used for multiple objects per logical file"), dual, oleautomation ] interface ILEAReadSubObject: IDispatch { [id(0x00000001)] HRESULT _stdcall GetSubObjectCount([in] BSTR filename, [in] long ilogfilenum, [out, retval] long * Value ); [id(0x00000002)] HRESULT _stdcall GetSubObjectAttribute([in] BSTR filename, [in] long ilogfilenum, [in] long isubobj, [in] long iattr, [out] TAttrStatus * Status, [out, retval] VARIANT * Value ); };This interface is optional and should only be implemented if the LEA Object contains conceptual sub objects (see base attributes below)
If this interface is implemented by the object, the GetSubObjectCount method is called after ILEAReadAttributes::OpenFile and ILEAReadAttributes::OpenLogicalFile methods have be called. This method should return the index number of the last conceptual sub-object (the index of the first sub-object is zero).
The GetSubObjectAttribute method replaces the ILEAReadAttributes::GetAttribute method: isubobj is the index of the sub-object.
All LEA Objects have the following attributes:
These attribute names and descriptions are listed in the INI file LEAOBJ.INI which can be found in the LYNXSYS directory. All LEA Objects inherit these attributes. The Base LEA Object (described in BASEOBJ.INI, implemented by COM Object LEAObCom.FileObject accepts all file formats, and will display these attributes for any file-system file.
LEA Object types all have key attributes which are the essential pieces of information for the particular object type. LEA applications use these key attributes to provide database indices (see Dougal and Florence - the LEA Data Catalogue Designer and Builder).
The default key attributes for the base object are:
There are almost limitless ways to represent date and time values as a
string. The default format used on each PC varies according to the
locale and the Regional Settings (specified via the Control Panel).
LEA applications present date/time values in the form described below, and
expect input strings containing date/time values also to be in this form.
A string representing a date and/or time value will be of the form:
(DD/MM/YYYY) (hh:mm:ss)
where:
Either the date or time section of the string is optional
The date components must be separated by slash (' / ') characters and the time components must be spearated by colon (' : ') characters.
DD is the day number (1-31).
MM is the month number (1-12).
YYYY is the four-digit year number (0000-9999).
hh is the hour number (00-23) - note the use of 24-hour clock.
mm is the minute number (00-59) - note leading zero for single-digit numbers
ss is the seconds number (00-59) - note leading zero for single-digit numbers.
Some examples follow:
All LEA INI (and parameter) files expect the floating-point numbers they contain to use the dot ( ' . ' ) character as the decimal separator. Floating point values will usually be displayed to you in LEA applications using the local decimal separator specified in the Regional Settings of the Control Panel on each PC. However, when editing INI files directly, it is important to remember to use dot characters to specify floating-point numbers.
Listed below are the error messages that may be generated as the LEA
Object's INI file is read. All these errors will cause the initialisation of
the LEA Object to fail.
These errors all imply that the INI file format is
incorrect or out of sync with the DLL libraries used by applications - the file
may have been accidentally edited by hand, the Object Wizard may have failed to
save a file correctly due to errors, or a new installation may have failed to
upgrade the correct files.
The named section is missing from the named INI file.
The named file is not recognised as an LEA Object INI file.
LEA Object INI files must have a [LYNX] section with the entryTYPE=LEAOBJECTThis error may be generated when attempting to create a user-defined LEA Object type.
In order to create COM objects from a DLL, the progid must be read from the LEA Object INI file. This progid is looked up in the registry to find the identifier of the COM class to create. The progid is usually the name of the DLL containing the COM class, followed by a period and the name of the CoClass to create.
For LEA Objects defined solely by scripts, the progid should be LEAObCom.FileObject.
There is a mismatch between the version range specified in the INI file, and the version number retrieved from the compiled code.
The specified progid does not exist in any registered COM server, or in the DLL specified by the dll key from the [OBJECT_DESCRIPTION] section of the LEA Object INI file.
Before a COM server can be used, it must be registered on the local PC. This error may occur if you do not have permission to write keys to the registry.
The format names used by LEA Objects are language-dependent. The actual names of language-dependent sections in the INI file depends on the language prefix used for the current language. The error message text will display the name of the section it is looking for.
The method used to recognise each format must be specified from a list of valid keywords. See Format Recognition above.
The method used to read attributes for each format must be specified from a list of valid keywords. See Attribute Access above.
The attribute names used by LEA Objects are language-dependent. The actual names of language-dependent sections in the INI file depends on the language prefix used for the current language. The error message text will display the name of the section it is looking for.
The type of each attribute must be specified from a list of valid keywords. See Attribute Definition above.
The named script file specified in one of the format recognition or attribute access INI file entries could not be found. See Script Files above for details of the directories searched for script files, and Format Recognition and Attribute Access for details of how to specify the script to use.
The named file is not recognised as an LEA Object script file.
The file should be an ASCII file with an INI-style layout (divided into named sections, with the section names delimited by [ and ].
The first section in the script file must be [LYNX] with an entryTYPE=SCRIPTdenoting that the file is an LEA Object script file.
The specified section is missing from the script file. See Format Recognition and Attribute Access for details of how to specify the script to use.
There is no entry for the specified attribute/format number in the named section of the script file.
For Format Recognition, the file and section containing the format recognition script are specified for each format.
For Attribute Access, the file and section containing the attribute access scripts are specified on a per format basis, and each attribute must have an entry in the specified script section.
Each variable type has a list of valid conversion types. See Format Recognition Scripts and Attribute Access Scripts for valid combinations.
The LIMITS string is a list of fields which define either a range of alternative acceptable values, or the minimum and maximum acceptable values. The meaning of the fields depends on the variable type. See Format Recognition Scripts and Attribute Access Scripts.
For format recognition scripts, a list of alternative or minimum and maximum acceptable values must be supplied.
The search string must be specified from a list of valid keywords.
See Format Recognition Scripts and Attribute Access Scripts.
The INFO string associated with the FIND keyword for the specified attribute/format number is invalid. There is probably a field missing from the string. Check that the string matches the definition for Format Recognition scripts or Attribute Access scripts.
The DLL specified in a script entry or as a COM server could not be found. If the specified DLL name does not contain a directory path, the following locations are searched for the DLL:
- The directory containing the application's EXE file
- The application's current directory
- The Windows System directory (usually
C:\WINDOWS\SYSTEM on Windows 95/98 machines, andC:\WINNT\SYSTEM32 on NT machines)- The 16-bit System directory (Windows NT only, usually C:\WINNT\SYSTEM)
- The Windows directory (usually C:\WINDOWS on Windows 95/98 and C:\WINNT on NT machines
- The directories specified by the PATH environment variable.
See Format Recognition using a DLL,Attribute Access via DLL and Implementing LEA Objects as COM servers.
The specified function is not present in, or is not exported from the specified DLL. The functions exported by a DLL can be listed using the Quick View utility (by right-clicking on the file in an Explorer window).
See Format Recognition using a DLL and Attribute Access via DLL.
Listed below are error messages that may occur during the normal use of LEA Objects.
The file specifed for opening does not exist.
The specified file could not be recognised as any of the formats for the current LEA Object type. Formats and the method used to recognise them are listed in the [FORMAT_RECOGNITION] section of the LEA Object's INI file.
An attempt was made to write attribute data back to the LEA Object file, when it was opened in read-only mode, or the file has the read-only flag set
See also:
[Dougal - LEA
Catalogue Designer]