[Midas] how to get item content

Zach Mullen zach.mullen at kitware.com
Sun Jul 8 14:35:29 EDT 2012


On Sun, Jul 8, 2012 at 1:59 PM, Mona Wong <mona at sdsc.edu> wrote:

>
> Sorry I forgot to respond to the list for future references...it is
> included below...
>
> Zach, you are right about my download controller action and
> midas.bitstream.download taking similar amount of time.
>
> The performance/time saving I was talking about is to keep Annio from
> having to make so many web api calls before it even gets to the image
> bitstream.  As I started this, I discovered that Annio has to call
> midas.get.item to get the info about the JSON file, then
> midas.item.download to retrieve its content, then midas.folder.children to
> get a listing of all the images in that directory, then midas.get.item for
> each of the images files (we could have 1000+ image files per volume
> dataset) and then finally to midas.bitstream.download to get the actual
> image bits.  So I HOPE that perhaps writing my own controller action to
> group some of the above steps together on the server will save some time.
>
Right; if you can reduce the need for all these other calls, you will save
a bunch of time.

>
> Now if I am mistaken about the time saving and/or there is a better way to
> do the above, please let me know.
>
> cheers,
> Mona
>
>
> On Jul 8, 2012, at 10:32 AM, Zach Mullen wrote:
>
> It's basically the same as the web API; the web API is just more
> structured in that it always outputs JSON or XML, whereas controllers are
> allowed to either render views or output machine-readable data.  Either
> way, you are just calling a URL and expecting some output, so it is
> ostensibly the same.
>
> In your controller, you will encounter similar overhead time per request
> as if you called the bitstream download controller, I would guess.  The
> best thing to do to improve response time is to minimize the number of
> requests by batching requests where possible.  Calling into any controller
> usually takes a set amount of time due to the overhead of the request and
> the logic that happens on the server for each request.
>
>
> On Sun, Jul 8, 2012 at 1:19 PM, Mona Wong <mona at sdsc.edu> wrote:
>
>>
>> Hi Zach:
>>
>> Thanks for the code!
>>
>> One issue that I ran into is the slow performance in retrieving images
>> from the server and I had thought that one way to speed it up would be to
>> minimize the number of calls to the server.  So I was thinking of passing
>> some information from the server when launching Annio via either form field
>> post or cookies instead of the URL (I didn't like the visibility of the
>> URL).  So, as part of that effort, I thought perhaps the server module can
>> read the very small JSON file that was generated for the dataset and sent
>> that info to Annio.  But alas I couldn't get either form field post or the
>> cookie to work ):
>>
>> So I've changed my plan...I'm gonna write a controller that basically
>> does what midas.bitstream.download does but takes different arguments to
>> specify the image filename rather than itemid and download the bits to
>> Annio.  I am HOPING that this will speed things up a bit.
>>
>> Question, writing my own controller & action is essentially a web api
>> method right?  Is there anything special or different I have to do to allow
>> Annio to call it like the Midas web api?
>>
>> Mona
>>
>
>  *********************************************
>     Mona Wong
>     Web & iPad Application Developer
>     San Diego Supercomputer Center
>
>     You are the light you wish to see.
> *********************************************
>
>
>
>
> _______________________________________________
> Midas mailing list
> Midas at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/midas
>
>


-- 
Zach Mullen
R & D Engineer
Kitware Inc.
919-869-8858
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20120708/59e6b904/attachment.html>


More information about the Midas mailing list