qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] re: XqlServlet and Communication between XQL scripts


From: Ivelin Ivanov
Subject: Re: [Qexo-general] re: XqlServlet and Communication between XQL scripts
Date: Wed, 29 Jan 2003 23:21:23 -0600

I like the CallContext idea as well.
Attached is a possible implementation which works.


I am not sure yet what the semantics of base-uri() should be.
If the currently executed servlet is
http://localhost/xquery/testservlet.xql

shoud the value be "http://localhost/xquery/testservlet.xql"; ?

If so then the implementation may be simple.

public URL CallContext.getBaseUri()

In the ServletCallContext case it will be
request.getServletPath()
while in the default CallContext it might be just
System.getProperty("user.dir")


-=Ivelin=-
----- Original Message -----
From: "Tom Reilly" <address@hidden>
To: "'Per Bothner'" <address@hidden>; "Ivelin Ivanov" <address@hidden>
Cc: <address@hidden>
Sent: Wednesday, January 29, 2003 1:13 PM
Subject: RE: [Qexo-general] re: XqlServlet and Communication between XQL
scripts


>
> +1 on CallContext having the ability to override the current
> directory.
>
> It might also be considered to get rid of the notion of a "current
> directory" and have the CallContext API be something like:
>
> URL getResource(String)
>
> One example where this would be handy is a web application wrapped
> in war where the URL may point to a jar entry.
>
> > -----Original Message-----
> > From: Per Bothner [mailto:address@hidden
> > Sent: Wednesday, January 29, 2003 12:49 PM
> > To: Ivelin Ivanov
> > Cc: address@hidden
> > Subject: Re: [Qexo-general] re: XqlServlet and Communication
> > between XQL scripts
> >
> >
> > Per Bothner wrote:
> > > Presumably URLs should be relative to the "web-app", but I'm not
> > > sure whether they currently are.  I thought they were ...
> >
> > Ivelin Ivanov wrote:
> > > Just noticed that you actually use a special QEXO function
> > to prepend the
> > > absolute path to the relative:
> > >  request-servlet-path(). This in effect reads the content
> > of the file, but
> > > will not evaluate it if it is an XQL script, because it
> > will not go through
> > > the servlet engine.
> >
> > I had thought perhaps the servlet engine would change the "current
> > directory" for different web applications?  I guess not, since then
> > it would have to modify the user.dir system property, which is a
> > global property.
> >
> > I though about this some.  I think we need semantics more-or-less
> > like you propose - I'm assuming that means the relative URIs are
> > resolved relative to the web application root?
> >
> > However, there are problems with the implementation.  For one,
> > it makes Document depend on servlets.  For another, I think
> > we need something more general.  Specifically that the "current
> > directory" should be part of the per-thread state.  In Kawa
> > that means hanging it off the current CallContext.  If the
> > CallContext does not have current directory set, then we need to
> > fall back to the global user.dir.  There are some complications
> > dealing with thread inheritance, and it might make sense to
> > also have an optional per-Interpreter current directory.  But
> > perhaps those refinements can wait.
> >
> > I also think I should implement the fn:base-uri(node) function.
> > I've though about how to represent this information in a TreeList,
> > and as soon as I have a breather I'll implement it.  Then we can
> > implement the two-operand 'document', which will also help with
> > this problem, especially if we also add a 'current-base-uri'
> > (or whatever) function.
> > --
> > --Per Bothner
> > address@hidden   http://www.bothner.com/per/
> >
> >
> >
> > _______________________________________________
> > Qexo-general mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/qexo-general
> >

Attachment: qexo-patch.zip
Description: Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]