IUBio Biosequences .. Software .. Molbio soft .. Network News .. FTP

Registering queries within a session from a layout script

"benedict arnold JIC benedict.arnold at bbsrc.ac.uk
Tue Jul 15 08:57:30 EST 2003


Hi James,

you're not trying to do the impossible, but the work around will probably mean hacking the standard release page code ;-)

As far as I recall, even though you are using $CurrSession, queries from within a layout script aren't registered in the session object (the reason being that some fools (ie me amongst others) use large numbers of queries in layouts) unless queryName is specified. What you might want to do in your layout script is print out the session info where you'll be able to see what the last query done was ... the queryName attribute will give the query a name, however, SRS in it's infinite wisdom rarely uses this to track which query it is on, it uses the queryN attribute of the $UPQ object that refers to query for that results set. 

I think what you need to do is find out what the queryN is for the query you've just done, something like

$query=$s.queryList[$s.queryList.len:[]]

will give you the query object, then you can access the queryN attribute using

$qn=$query.queryN

or you can get it using

$qn=$s.queryList[$s.queryList.len:[]].queryN

you'll then have to modify all instances where javascript calls like:

"javascript:subgif(document.forms[0], '@wwwPageName~@qResult at queryFrom~@viewWith at queryNumber~@22')" 

occur so that the reflect the query number you want to use. 

I suspect you may have to do the query you want to use in the page somewhere in the page generation code rather than in the layout, as most of the javascript calls wil have been formed before the layout script is called, so you'll probably have to edit the resultpage.i file and in the context attribute section of the $Page object do the query you want to do and the redo the

$qRes=$SpGetQueryResult 

call. This will set the queryN to the correct value for the query you do in the layout script. At that point you don't need to redo the query with a query string just use :

$set=$s.query:[queryName:XXXXX] where XXXXX is the query name you used in the context section. You may be lucky and get $entries reset to the set you want if you use a loader in the contexts chunk of the page.

hope that makes sense and you're brave enough to play with the guts of pages :-)

all the best

Ben

---





More information about the Bio-srs mailing list

Send comments to us at biosci-help [At] net.bio.net