« Return to Thread: XQueryURLRewrite implementation change proposal

Relative module import and controller.xql , was: XQueryURLRewrite implementation change proposal

by thomas.0007 :: Rate this Message:

Reply to Author | View in Thread

Wolfgang,

The implementation of the multiple controller.xql is really useful. The only
small inconvenience to use this feature is the fact the if any modules are
imported by controller.xql, we still need to specify the full path of the
module relative to webapps. It would have been much easier if the controller
picks up the modules from the same directory.
The good news is that the relative import paths already have been
implemented (Patch #2812962) and I was wandering if there is any chance to
include the relative module import in the coming release.

Regards,
Thomas


"Wolfgang Meier" <wolfgang@...> wrote in message
news:19f274050906300047y3d850ee7r1329a1610e0b2a49@......
> I would like to propose a small extension in the logic of how
> XQueryURLRewrite finds the file with redirection rules.
> The idea is to search for controller.xql first in the sub-directories
> matching the URL structure and if not such file is found then execute the
> main webapp/controller.xql.

I implemented your proposal in rev 9247. XQueryURLRewrite can now scan
the directory or collection hierarchy to find a controller.xql which
matches the request path. For example, if the requested path is
/exist/a/b, XQueryURLRewrite will check the directories webapp/a and
webapp/a/b for an XQuery file called controller.xql and executes the
last one it finds.

The start point for the search is determined by configuration
parameter "base" in web.xml. This parameter can also point to a
collection in the db, causing XQueryURLRewrite to search the
collection hierarchy instead of the file system.

    <filter>
        <filter-name>XQueryURLRewrite</filter-name>
        <filter-class>org.exist.http.urlrewrite.XQueryURLRewrite</filter-class>
        <init-param>
            <param-name>base</param-name>
            <param-value>xmldb:exist:///db</param-value>
        </init-param>
    </filter>

Wolfgang

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open




------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

 « Return to Thread: XQueryURLRewrite implementation change proposal