Hi Roger,

On Thu, 2008-02-21 at 17:36 +0000, Roger Hull wrote:
> Hi,
> 
> I am in the process of adding some preformed queries to MartView. The
> user will select from a list of queries, possibly enter some
> parameters (depending upon the query), and I have code (either perl or
> javascript) which will send the query to MartView using a Mart URL
> Request. This works fine for my first test query. This is implemented
> in javascript added to header.tt and footer.tt.
> 
> My main problem is how best to find out using javascript what query
> was requested when I come back into the martview page (so I can
> reselect the user's canned query and re-enter the parameters). Can you
> suggest how I could do this, minimising the changes to the biomart
> code as far as possible?
> 
> One idea I had is to handle the generation of the query URL from perl,
> and store the canned query somewhere (in a session parameter maybe).
> Then when I come back to the martview page, use an ajax request to
> find out the details of the canned query.

by storing a 'canned query' in session param, what exactly do you intend
to store ? is it just like an XML query  which our XML button
generates ? then of course write a simple AJAX javascript request and
ask from XML query. Currently, if you see the code behind OnClick() of
XML button, it asks for XML by setting the target to a new window, you
can call it exactly the same way and just avoid the target window bit.
AJAX code is already available in javascript 'martview.js' which can be
reused. 


> This seems rather complicated, but could all be done without changing
> any biomart code, just adding javascript to header.tt, and some extra
> scripts on my server to handle the requests. But if you can suggest
> something better (simpler :-) ) I would be grateful.
> 
> Also, do you have handy perl and/or javascript functions to convert
> between a query in xml format (for MartService) and URL format? It
> would be convenient to store the canned queries as xml templates
> (ready to fill in parameters), then convert the completed xml into a
> URL query. I guess I can write such a function if necessary, but don't
> want to re-invent the wheel.

I am afraid, we never felt a need to do this conversion, please feel
free to write such a conversion function. This may help other users in
the future.

good luck!

cheers
syed


> 
> Regards,
> 
> Roger
> 
> 

Reply via email to