From: Fraser H. <fra...@gm...> - 2009-10-09 10:56:43
|
The numbers are actually strings in the context of the url and if needed I use xs:integer($number) within the function to convert it to a number, as is the case for the dimensions of 200 by 200. I don't understand what the risk is. Thanks, Fraser On Fri, Oct 9, 2009 at 12:41 PM, Vyacheslav Sedov < vya...@gm...> wrote: > by the way - using # in URL is not good - user-agent behavior > unpredictable in this case > > On Fri, Oct 9, 2009 at 2:23 PM, Fraser Hore <fra...@gm...> wrote: > > The parameters are "ordered" parameters based upon the function being > > referenced and are part of the url path info: > > > > index.xq / siteaccess / module / function / parameters > > > > or > > > > index.xq / website / content / getImage / 5 / resource1.xml / 200 / 200 > > > > My parsing functions parse the path info into tokens to find the module, > > fuction and parameters required to call the function. > > > > token[1] = siteaccess = website > > token[2] = module = content > > token[3] = function = getImage > > > > By looking up the function it knows that there should be four paramters > > passed to the function. So it considers tokens 4 through 7 to be those > > parameters. If there are parameters mission in the path info, then it > puts > > in a blank string instead. Unordered parameters can be added using the > > traditional approach of "?parameter1 = value & parameter2 = value. > > > > I just thought this made the URL cleaner and easier to work with, and > would > > differentiate core function parameters from any unordered parameters the > > user may want to add. > > > > Cheers, > > > > Fraser > > > > > > > > On Fri, Oct 9, 2009 at 11:59 AM, Dmitriy Shabanov <sha...@gm...> > > wrote: > >> > >> On Thu, 2009-10-08 at 18:20 +0200, Fraser Hore wrote: > >> > Below is my approach in case it is of use or interest to anyone. One > >> > big advantage is that with a get request I can just put the details of > >> > the function in a url. So for example you can do: > >> > > >> > <img src="{concat($url:indexPath, '/', $url:siteAccess, > >> > '/content/getImage/', $objectID, '/', $filename, '/200/200')}"/> > >> > > >> > It's also really handy for testing because I can try out any of my > >> > functions just by putting it in a url in the address bar. > >> > >> The url getImage.xql?url=some;size=200x200 have params url = some & size > >> = 200x200. In your example I don't see how do you send parameters. > >> > >> -- > >> Cheers, > >> > >> Dmitriy Shabanov > >> > > > > > > > ------------------------------------------------------------------------------ > > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > > is the only developer event you need to attend this year. Jumpstart your > > developing skills, take BlackBerry mobile applications to market and stay > > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > > http://p.sf.net/sfu/devconference > > _______________________________________________ > > Exist-open mailing list > > Exi...@li... > > https://lists.sourceforge.net/lists/listinfo/exist-open > > > > > |