 |
|
Changes in this release wrt 980225 are as Follows:
Simon Kelly has made changes to the URL code as follows.
Magic tags for WWW display method.
----------------------------------
This has got rather complicated, but general and useful. Below
describes how it works and what it can do:
When an object to displayed as WWW an Url is generated from the
displayed object, and then the Url is passed on to the external
Brower. Here are the magic tags in the object that matter:
Url Text if this tag exists the Text is used as the Url, no further
processing occurs.
Web_Location ?Class
The processing is transfered to the object to the right of the
tag, the From Object (qv) becomes object containing the
Web_Location tag. This may happen recursively.
*** Note *** from now on the "From Object" is important. This is a
general concept in acedb, and is the object from which the displayed
object reference was picked. So for instance if I generate a tree
display of Object A and click on a link to Object B, I display object
B, with From Object equals object A.
If From object = object, and no Url tag is present, the display
operation fails.
----------------------------------------------------------------------------
The next stage is to generation a string which will be used to create
the Url. First use magic tag
Reference_tag Text UNIQUE Text // Tagname (optional) Classname
Look for a Tag in the from Object which matches the first Text. (if
the second Text field is present, only match if the from object is of
the correct class) Repeat for all reference_tag until a match is
found: on match the Url string becomes the text to the right of the
matching tag in the from Object. If no match look for the Magic tag
Use_name Text // (optional) Classname
if this is present and the Classname Text (if present) matches the
class of the From Object The Url string becomes the name of the
>From Object, otherwise the display operation fails.
-----------------------------------------------------------------------------
The final stage is to modify the Url string to turn it into the
Url. This is controlled by the Magic tag.
Rewrite Text UNIQUE Text Text UNIQUE Text
// prepend append old_prefix old suffix
the lines are matched in turn for an {old_prefix, old_suffix} pair
which matches the Url string, and the first to match is then used to
replace the old prefix and suffix with the prepend and append strings.
Any of the text fields can br empty or none-existant: these match any
Url string.
****Note*****
This is complex enough: anyone who can't do what they want with this
should add a facility to pipe the Url string through sed or perl.
*************
At this point any characters in the URL string which are not valid in
cgi arguments are escaped. (these are ?=+/#&% and space). this only
occurs in the original Url string, not the prepend and append strings.
Finally, the completed Url is sent off to your favourite browser.
----------------------------------------------------------------------------
Examples:
To make the above seem quite sensible really.
The problem:
In our sequence class, we have object with names like:
EM:xxxxxxx
IN:xxxxxxx
for sequences from embl and our internal database. We want to be able
to hyperlink them to an SRS server.
To do this:
1) Put
Web_location my-srs-server
in each sequence object
2) my-srs-server is of class WWW_server and looks like
Use_name
Rewrite
http://bio1.hexagen.co.uk/srs/wgetz?-e+[libs%3d{emblnew%20embl}-ID: ]
EM:
http://bio1.hexagen.co.uk/srs/wgetz?-e+[INTERNAL-ID: ] IN:
So all the information about the web server is localised in one
object. Note the hex values for space and = in the prepend string to
avoid getting them mangles by the web server. This is done
autometically for the data part of the string, but has to be done by
you for these parts, as there are also web-metachars in there that
_can't_ be escaped.
We could make another web-server object called (eg) embl-srs
which looked things up at the ebi server, and have links to that too:
so in a sequence have:
Web_location my-srs-server
embl-srs
Now set up options.wrm so that class WWW_server displays by default as
WWW. Open a sequence object, a click on my-srs-server will display the
srs version of that object at Hexagen, a click on embl-srs will
display it at the embl srs server.
A final wrinkle.
In displays.wrm, add
-m Web Page
to the WWW entry. Now the keyset window will allow one to
display as web page. Get up a keyset of sequences, select display as
web page, and double click on one. Because the the WWW display code
follows Web_location tags, the srs enry for that object will be
shown. (at the first server in the list, if there's more than one.)
2) Improved messages for checking the lock state.
3) lexHashInsert bug fixed.