Guide of the GLU system
CDS - P.Fernique - march 99

Table of contents


1  What is GLU ?

The URL is a very simple and powerful tool to ``connect'' several information services. Generally, to use them, one must harcode in his/her HTML pages or CGI scripts the hostnames, directories, filenames,(ie URLs)... of other servers. The creation of such links is very easy but not their maintenance ?!

The GLU system (Générateur de Liens Uniformes) gives a global solution to avoid this problem, using symbolic names of resources; the URLs will be generated on the fly and always with the last definition. These definitions are maintained by the managers of the participating remote services.

The GLU system has other functionalities as:

A basic difference with similar tools (such PURL tool or URN concepts) is that the resolution of URL is done when the HTML pages are generated and not when the user clicks on the links. This reduces the response time to a minimum and increases security in order to link efficiently databases.

The GLU system has been developed by CDS (Centre de Données astronomique de Strasbourg ). Demos and documentation can be found on the CDS httpd server at this address : Comments and questions can be send at

2  Glu concepts and vocabulary

3  Installation notes

The GLU package has been successfully tested on the three types of Unix Os (SVR4, BSD and POSIX).
The distribution package contains:

To install the GLU system, you have two possibilities: either you launch the installation script (./ or you try yourself following the directives below:

  1. Gunzip and untar the GLU package
  2. Edit GLUHOME variable in Makefile if you want another installation directory instead of `/usr/local/glu' and create this directory if necessary
  3. Configure the other Makefile variables according to your system
  4. Execute: `make' to compile the GLU package
  5. Execute: `make install' to install it
  6. Copy the glud configuration file (`examples/glud.conf') in the installation directory and modify it according to your own configuration.
  7. To install GLU additional tools (into tools directory), copy them in cgi-bin directory of your httpd server (only if you have it on the same host).

3.1  The GLU daemon

The GLU daemon (called glud) is used to maintain a database of GLU records among all GLU members. These data are called GLU dictionary.

3.2  Mirror GLU: using the GLU without daemon

The GLU system implements an alternative mechanism to obtain a GLU dictionary without using the GLU daemon: the mirror GLU capability.

This method is recommended in two cases:

  1. If you're only a client glud and if you need exactly the same view of GLU dictionary than an other GLU member.
  2. If you want to test GLU functionalities without launching a GLU daemon.

To do that, just use the gluc command with the following parameters:

            gluc mirror  host
Where host is the GLU member for which you ask a GLU dictionary copy. The configuration file (glud.conf) of this host has to mention that your host is allowed to use the mirror functionality on itself. For that, your hostname has to match atleast one of its AllowedMirror specifications (wildcard words or regular expressions). For example:
    AllowedMirror  	/.*glu.*/
    AllowedMirror	*    

WARNING: in mirror GLU functionality, it's your responsability to ask regularly a copy by putting this command in your crontab.

4  Using the GLU records

To access to the URL definitions stored in the GLU dictionary, you have to define GLU tags in your HTML pages or cgi scripts.

4.1  Syntax of GLU tags

The GLU tags follow this syntax:

           <&action_id,options param1 param2... |anchor_text>


       <&cdsbib 1996A&A...123..34>
       <&CDS'smbmgr'simq 'HD1'>
       <&ADS'bibmgr'abstract 1995PASP...123..18|reference>
       <&getabs,rpn 1994A%26A...110..45 'T A K'>
       <&heasarc '%B1950:10 12 32.23 -10 23 20.5'|click here>

An other syntax of GLU tags is possible. Instead of defining the action you can specify (by a GLU identifier), you just indicate the data type of an object. In the GLU dictionary, the definition of this data type will specify the default GLU action to be taken.

          <%data_type[,opt] object|anchor_text>

Nota: for a simple data conversion, the option 'c' must be specified. just after the data type. In this case the default action isnot taken into account.


      <%I HD1>
      <%R 1994A&A...134..23>
      <%E IV/25/|POSS Plate Date>
      <%J2000,c '%B1950:10 11 12.2 +3 4 45'>

4.2  Translation of GLU tags into URLs and HTML anchors

There are two ways to resolve GLU tags : use the glufilter command or use a GLU library (libglu.a for C language or for Perl language.

  1. glufilter : is a classic unix filter. It accepts from stdin a ASCII or GML (HTML text with GLU tags) text, and prints the result on stdout.

  2. libglu.a for C sources: You must include the glu.h file, and you can use these three functions:
    1. int glu_init(char *adddic,char *pathdic) : load the GLU dictionary ;
      • adddic : NULL or pathnames of application GLU dictionaries (separated by ':')
      • pathdic : NULL or pathname of alternative global GLU dictionary (if you don't use /usr/local/glu/glu.dic)
      It returns 1 in success, otherwise 0.
    2. char *glu_filter(char *) : resolve text containing glu tags ;
      (never free the returned pointer)
    3. void glu_close() : free all memory used by the GLU and update the GLU statistics. for Perl sources (only under SunOs.2.x):
    The file is required in your Perl sources, and you can use these four functions:

    1. &glu_init($adddic,$pathdic,$prefix,$options) : load the GLU dictionary ;
      • altdic : '' or pathnames of application GLU dictionaries (separated by ':')
      • pathdic : '' or pathname of alternative global GLU dictionary (if you don't use /usr/local/glu/glu.dic)
      • prefix : '' or default prefix of GLU identifiers in case of ambiguity. It can be a domain name (ex: "CDS"), or a service name (ex: "'smbmgr'") or both (ex: "CDS'smbmgr").
      • options : '' or a letter list. d - for debug mode, e - to generate error message in case of no resolution of GLU tags.
      It returns 1 in success, otherwise 0.
    2. &glu_filter($s) : resolve text containing glu tags ;
    3. &glu_resolver($id,$options,$parameters,$anchor_text) : resolve a GLU identifier ;
      • id : a GLU identifier (eventually precedeed by the service name, and the domain name - separated by "'" - ex: "CDS'smbmgr'simbad") ;
      • options : treatement options specified by a letter list. (see the syntax of GLU tags).
      • parameters : parameter list for the URL resolution (see the syntax of GLU tags).
      • anchor_text : text of the generated anchor
    4. &glu_close() : free all memory used by the GLU and update the GLU statistics.

Automatic translation by httpd server:

It is very efficient to use the Action functionality of the httpd apache server to filter automatically .gml files by the glufilter when they are called by a http browser.

If you want to implemente this functionality, follow the directives below (under Apache 1.2.x):

  • In the mime.types file, put this line:
  • mime.types:text/gml gml

  • In the srm.conf or access.conf file, put this line:
  • Action text/gml /cgi-bin/gml2html

  • In the cgi-bin directory of the httpd server, create the following script (called gml2html):
  • #!/usr/bin/csh
    echo "Content-type: text/html"
    echo ""
    /usr/local/glu/glufilter $PATH_TRANSLATED

    In the same way, but for cgi scripts generating directly GML in output:
    (we suppose that these GML scripts are under /cgi-bin/cgigml directory of the httpd server)

  • In the access.conf file, put this paragraph:
  • <Location /cgi-bin/cgigml>
    SetHandler application/gml

  • In the srm.conf or access.conf file, put this line:
  • Action application/gml /cgi-bin/cgigml2html

  • In the cgi-bin directory of the httpd server, create the following script (called cgigml2html):
  • #!/usr/bin/csh
    $PATH_TRANSLATED | /usr/local/glu/glufilter

    5  Creating your own GLU records

    You can find below several examples of GLU records.

    1. Simple URL definition, call by <&nameA> or <&srv'nameA> GLU tags:
           %ActionName         nameA			      
           %Description        one line short description    
           %Owner              srv			      
           %DistribDomain      dom                           
           %Url                http://server/dir/file.html   

    2. URL with parameters, call by <&nameB param1 'param 2'> tag:
           %ActionName         nameB                        
           %Description        one line short description   
           %Owner              srv			     
           %DistribDomain      dom                          
           %Url                http://server/dir/cgi?p1=$1&otherparam=$2

    3. Data type definition, call by <%nameC object> tag:
           %DatatypeName       nameC              
           %Description        one line short description    
           %Owner              srv			      
           %DistribDomain      dom                           
           %DefaultAction      nameB			      

    4. Clone management, call by <&nameD param> tag:
           %ActionName         nameD                         
           %Description        one line short description    
           %Owner              srv			      
           %DistribDomain      dom                           
           %SeeAlso            nameD1                        
           %SeeAlso            nameD2                        
           %ActionName         nameD1                        
           %Description        one line short description    
           %Owner              srv			      
           %DistribDomain      dom                           
           %Url                http://server1/dir/cgi?p1=$1  
           %ActionName         nameD2                        
           %Description        one line short description    
           %Owner              srv			      
           %DistribDomain      dom                           
           %Url                http://server2/dir/cgi?p1=$1  

    5. Returned HTML anchor or code, call by <&nameE param> tag:
           %ActionName         nameE                         
           %Description        one line short description    
           %Owner              srv			      
           %DistribDomain      dom                           
           %Url                http://server/dir/cgi?p1=$1   
           %FullTextResult     Clic on &lt;A HREF=$1>this&lt;/A>   

    6. Recursive action record, call by <&nameF param> tag:
           %ActionName          nameF                      
           %Description         one line short description  
           %Owner               srv			     
           %DistribDomain       dom                           
           %FullTextResult      for $1 click on &lt;&nameA> or &lt;&nameE>

    5.1  Explanation of all GLU record fields

    You can find below short explanations for all GLU record fields.

    The manual of GLU record fields can be found at the address:

    6  Others GLU commands

    7  Others GLU tools

    © UDS/CNRS