Hi,

instead of using a plugin i want to create my own base webservice.

This service is almost working, except for one point. Where i want to get
the url where the data files are located.

So, i can get the project, experiment and the data from the experiment. Now
i want to send all information about the data:name, id, description and the
url where the client, calling the service, can download the files from.

What i tried is:

public String getCelFiles(int experimentId)
    {
        Experiment experiment = experimentVector.get(experimentId-1);

        System.out.println("RawBioAssays of exp: "+experiment.getName());

        ItemResultIterator<RawBioAssay> rawBioAssays;

        String rbas = "<RawBioAssays>";

        try
        {
            dc = sc.newDbControl();

            ItemQuery<RawBioAssay> query = experiment.getRawBioAssays();
            System.out.println("nr of raw bioassays: "+query.count(dc));

            rawBioAssays = query.iterate(dc);

            if (rawBioAssays != null)
            {
                RawBioAssay item = null;
                String name = "";
                String loc ="";
                String url ="";
                int id=0;
                File file = null;
                String path = "";

                while (rawBioAssays.hasNext())
                {
                    item = rawBioAssays.next();
                    name = item.getName();

                    rbas += "<RawBioAssay>";
                    rbas += "<Name>"+name+"</Name>";

                    id = item.getId();
                    file = Affymetrix.getCelFile(item);
                    path = file.getPath().toString();

                    rbas += "<Id>"+id+"</Id>";

                    loc = HTML.urlEncode(path);
                    url = fileUrl+"-"+sessionId+"-"+loc;

                    rbas += "<Url>"+url+"</Url>";
                    rbas += "</RawBioAssay>";
                }

            }
            dc.close();

        }
        catch(Exception e)
        {
            System.out.println("e:"+e);
        }
        rbas += "</RawBioAssays>";

        return rbas;
    }

This returns a the string:
<RawBioAssays><RawBioAssay><Name>1.1_2</Name><Id>90</Id><Url>
http://nbx8.nugo.org/nutriBASE/filemanager/files/view/-42d47d6797b7b05c-/home/PeterMertens/raw+data/test/1.1_2.CEL
</Url></RawBioAssay><RawBioAssay><Name>1.2</Name><Id>92</Id><Url>
http://nbx8.nugo.org/nutriBASE/filemanager/files/view/-42d47d6797b7b05c-/home/PeterMertens/raw+data/test/1.2.CEL
</Url></RawBioAssay></RawBioAssays>

If i try to download the files (while the session is still active) using the
url's i get a http 500 response.
I suppose that the part /filemanager/files/view/ is not correct since the
fileview.jsp is not loaded, but i don't have a clue how to do it correctly.

A possible solution would be to download the files to a folder in the
webserver's directory and than ... . This is not a very nice solution for
this problem so i hope somebody can help getting the url of the files on the
base server.

thanks,

Peter




2007/9/27, Nicklas Nordborg <[EMAIL PROTECTED]>:
>
> Peter Mertens wrote:
> > Dear list,
> >
> > i'm working on a plugin that gives the possibility to run the analysis
> > on another machine (not the one base is installed on).
>
> Have you checked out the possiblitity to use Job agents? They can be
> used to execute any plug-in on a different server. See
> http://base.thep.lu.se/chrome/site/trunk/html/admindoc/plugin_installation/plugins.jobagents.html
>
> for more information.
>
> > In order to download the files (cel and cdf) over http, i need the to
> > retrieve the URL's.
> > Can somebody tell me how to get this?
>
> The file URL depends on the sesssion ID of the logged in user. Plug-ins
> are executed in a different session with a different ID, so I am not
> sure it will work since the web server may know about the session ID
> used by the plug-in. It is not possible for the plug-in to get the
> session ID for the user. In fact, the user may already have logged out
> before the plug-in is executed.
>
> I think it is better if your plug-in call File.getDownloadStream()
> and copies the file to the machine where you are going to run the
> analysis program.
>
> > In the documentation i found that all files have method "getLocation".
> > But it is not mentioned what kind of location this is.
> > Also the code of this method did not tell me more.
>
> This method can return 3 different values: OFFLINE, PRIMARY and
> SECONDARY. If it returns OFFLINE the file is not stored at all on the
> BASE server. The SECONDARY location is a backup location and the file
> can't be accessed. You should check that the getLocation() method
> returns PRIMARY or you can't use the file.
>
> /Nicklas
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> basedb-devel mailing list
> basedb-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/basedb-devel
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel

Reply via email to