Links to Netscape web pages from ACEDB.


Topics


It is now possible to link web pages to your ACEDB database. Although netscape must be available on the machine that you chose to run xace on, as it is the only web browser that ACEDB will be able to call on your system.

Changes to models.wrm and options.wrm to enable your ACEDB database to bring up netscape pages are as follows -

Essentially you must have a ?Url class, this will allow you to bring up netscape pages from ?Url objects. Each of the tags in this class is a magic tag so you must enter the ?Url class as outlined below in your databases wspec/models.wrm file.

?Url    Url UNIQUE Text // Simple, text of URL
        Template UNIQUE ?Url // use this object as a generic template
        Reference_tag UNIQUE Text // look for this tag in the reffing object for url
        Remove_prefix UNIQUE Text // prefix to remove to make url
        Remove_postfix UNIQUE Text // postfix to remove to make url
        Prepend UNIQUE Text // then add this to the beginning
        Append UNIQUE Text // then add this to the end

N.B. Remarks after // are coments to help you understand the purpose of the tags.

In order to display a member of the ?Url class in netscape you must also add this line to your databases wspec/options.wrm file -

_VUrl           -V -D WWW
After you have made the above changes to your models.wrm and options.wrm files you must restart your database and choose "read models" from the ACEDB main window pull-down menu, the save these changes by choosing "save" from the same menu as "read models".


Entering URL's

Having made the above changes to your options.wrm and models.wrm file you can now enter URL's into your database interactively or via .ace files.

e.g. If you wanted to be able to call netscape to show the sanger home page you could read in a .ace file containing the following information -

Url : "SANGER_HOME_PAGE"
Url "http:\/\/www.sanger.ac.uk"
N.B. In .ace files it is always best to protect backslashes (/) in url address` by forward slashes (\) to enable the file to be read in correctly.

You could also create the "SANGER_HOME_PAGE" ?Url object using the "Add-alias-rename" function from the ACEDB main window pull-down menu.

Once you have entered a ?Url object into your database you can then display its netscape page by selecting Url from the class list and then clicking on the object e.g. "SANGER_HOME_PAGE" in the main keyset window (assuming "Show_as : Graph" is selected as the choice of display using the "Show_as" button on the menu bar of the main keyset window). ACEDB will then fire up or use an existing netscape session and find the appropriate Url as long as it exists.


Advanced URL entry

Entering a full URL as part of an object.

If you wish to call the sanger home page on netscape from another object you can make a reference to the ?Url class in another class. e.g. For an author that works at the sanger center you could add the following line to the ?Author class in you models.wrm file.

Work_url ?Url

N.B this is not a magic tag, so any reference to the Url class can be under any tag name you choose.

Therefore whilst viewing members of the author class a user can click on a ?Url object in order to link to the web page appropriate for that author.

Using object names in URLs

It is also possible to use part or all of an existing object name as part of a URL. e.g. if you already store GDB ids in a GDB_id class where object names are of the format GDB:gdb_number (for example - GDB:1221597) the following line should be added to the ?GDB_id class in your models.wrm file -

Template UNIQUE  ?Url

The template tag exists in the ?Url class and is a magic tag, therefore the tag MUST be called template. All members of the GDB_id class can reference a single ?Url object which uses the GDB_id object names to formulate a web address for each member of the GDB_id class.

e.g. all GDB_id (which refer to amplimers) could contain the following line - Template GDB, where GDB is the ?Url object.

The Url object can then contain the rest of the information used generate full URL using the remove_prefix, remove_postfix, prepend and append tags in the Url class. The remove_prefix and postfix tags apply to the GDB_id objects name, in this example it is not neccesary but if you wanted to remove the "GDB:" from the front of the GDB_id to use just the gdb_number in a URL, it would be neccesary to fill in the remove_prefix tag in GDB ?Url object e.g. Remove_prefix "GDB:".

In this example GDB addresses are of the format - http://www.hgmp.mrc.ac.uk/gdb-bin/genera/genera/hgd/Amplimer?!key=GDB:1221597&!sub=0 therefore the GDB ?Url object would be entered as follows in a .ace file -

Url : "GDB"
Prepend "http:\/\/www.hgmp.mrc.ac.uk\/gdb-bin\/genera\/genera\/hgd\/Amplimer?!key="
Append "&!sub=0"

The missing part of the URL is filled in by the objects name, due to the template tag, when you click on the "GDB" reference in a GDB_id object.

Displaying any object as its web page.

Objects in any class can have their display changed to netscape (assuming "Show as : graph" is selected). e.g. you may wish all GDB_id's to link directly to their web pages from their object names in the main keyset window. This can be easily achieved by stating the default display is WWW in your options.wrm file. e.g. Using the GDB_id class example if each member of the GDB_id class contains the information - Template "GDB", where GDB is defined in the ?Url class as above, the line _VGDB_id -V -D WWW should be added/modified in your options.wrm file. Therefore as long as the choosen display is "graph" in ACEDB each member of the GDB_id class will appear in your netscape browser at the appropriate page for that GDB_id.


NOTES

1) After you have clicked on a URL in ACEDB "clickability" should return within a few seconds whether netscape can locate the URL you have stored in ACEDB or not. Also this means you can carry on browsing ACEDB whilst netscape is loading a page e.g.you do not need to wait for a page to finish downloading before you can resume browsing ACEDB.

2) If a netscape session is already running on your machine or ACEDB has fired up a version of netscape, subsequent calls for netscape page will use the existing netscape session and will not start up a new netscape session each time.

3) Many web addresses contain characters as their corresponding values in the lex-hash table e.g. the colon ":" in a GDB_id address becomes "%3A". ACEDB should be able to cope with either version in a Url.

4) Links to web pages from ACEDB are only available for users with running netscape web browsers.


carol - 4.8.97


Caveat from Jean

From BIOSCI-REQUEST@net.bio.net Mon Oct 27 07:06:10 1997
To: acedb@net.bio.net
From: Danielle et jean Thierry-Mieg 
Subject: acedb to netscape

the document /acedocs/ace97/ACEDB_2_WWW.html
does NOT YET corresponds to the distributed acedb

upto and including acedb.4_5, use the generic external
call mechanism

in any class, add a line
Pick_me_to_call Text Text

and in the object
Pick_me_to_call  Mosaic "http:\/\/www.truc.fr/ici/machin.html"

en cliquant Pick_me_to_call il y  a lancement de l'exe
 wscripts/Mosaic avec le param  "http:\/\/www.truc.fr/ici/machin.html"

an peut de cette amniere appleler n'importe quoi
 text1; nom du script
 text2 = ligne de commande du script