Fix for LongText display problem (in AceBrowser)

Keith Bradnam keith at thale.nott.ac.uk
Mon Jan 15 11:01:02 EST 2001


Hi all,

The default display of LongText objects using AceBrowser isn't very
pretty.  Any formatting of spaces and tabs are lost as text is converted
to HTML (which doesn't allow multiple spaces).  A lot of acedb databases 
- including ours - contain the original EMBL entries of sequences as 
LongText objects and they look terrible unless you try viewing them as a
graphic.

E.g. try looking at this WormBase record:

http://www.wormbase.org/perl/ace/elegans/misc/etree?name=EMBL%3AAB006659&class=LongText


A quick fix can be made though by editing the AceBrowser 'tree' script
which handles the initial display of most acedb objects. Find the line in
the tree script which starts:

print  $obj->asHTML(\&to_href) || strong('No more text... 


This is the line which normally displays the contents of any object using
the 'asHTML' function.  Replace this line with:


if ($class eq 'LongText'){
    print $obj->asHTML(\&format_longtext);  
  }
else{
    print  $obj->asHTML(\&to_href) || strong('No more text information
    about this object in the database'), "\n";
  }


You will also need to add a subroutine somewhere in the tree script.  This
is simply:

sub format_longtext{
  my $obj = shift;
  return pre($obj);
}


Basically you are telling AceBrowser to check whether the object is a
LongText object and if so display it using the 'format_longtext'
subroutine which does nothing but return the text using the equivalent of
the HTML <PRE> tag (which preserves formatting).  If it isn't a LongText
object, the object is displayed as normal.

There is probably an even simpler way of getting around this, but this
method seems to work and might be helpful for people who use AceBrowser.


Keith



~  Keith Bradnam - UK CropNet (http://ukcrop.net) webmaster and
~  Arabidopsis Genome Resource  (http://ukcrop.net/agr) developer.
~
~  Nottingham Arabidopsis Stock Centre, University Park,
~  University of Nottingham, NG7 2RD, UK.  Tel: (0115) 951 3091 









More information about the Acedb mailing list