<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><span class="Apple-tab-span" style="white-space:pre"> </span>Sorry I forgot to respond to the list for future references...it is included below...<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Zach, you are right about my download controller action and midas.bitstream.download taking similar amount of time.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Now if I am mistaken about the time saving and/or there is a better way to do the above, please let me know.</div><div><br></div><div>cheers,</div><div>Mona</div><div><br></div><div><br></div><div><div><div>On Jul 8, 2012, at 10:32 AM, Zach Mullen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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.<div>
<br></div><div>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.<br>
<div><br></div><div><br><div class="gmail_quote">On Sun, Jul 8, 2012 at 1:19 PM, Mona Wong <span dir="ltr"><<a href="mailto:mona@sdsc.edu" target="_blank">mona@sdsc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div style="word-wrap:break-word"><div><br></div><div>Hi Zach:</div><div><br></div><div><span style="white-space:pre-wrap"> </span>Thanks for the code!</div><div><br></div><div><span style="white-space:pre-wrap"> </span>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 ):</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>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.</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>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?</div>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>Mona</div></font></span></div></blockquote></div></div></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">*********************************************<br> Mona Wong<br> Web & iPad Application Developer</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "> San Diego Supercomputer Center<br><br> You are the light you wish to see.<br>*********************************************<br><br><br></div></span></span>
</div>
<br></div></body></html>