pluggable url factory

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

pluggable url factory

Matthew Conway
I'd like to be able to use my own URLFactory in an xwiki instance, so  
I thought the cleanest way to do this would be within an xwiki plugin  
by calling context.setUrlFactory from within a plugin method early in  
the request/response cycle.  However, context.getURLFactory() seems  
to get called before any of the plugin methods, so I can't do it this  
way without a code modification.

Thus my options are to either add a new method to the plugin which  
gets called early in the cycle (beginRequest(request,  
context) ...? ), or make a modification to the xwiiki code base to  
allow a URLFactory class to be chosen from xwiki.cfg.

I'm leaning towards the plugin interface modification, but before I  
do this, I wanted to see if anyone has any suggestions.

Thanks,

Matt




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: pluggable url factory

Ludovic Dubost

Hi Matthew,

I would lean towards allowing to override the URLFactory in xwiki.cfg
the same way we override the Auth or Groups services.
Otherwise the  public String startRenderingHandler(String line,
XWikiContext context) method gets called before the rendering loop..
This could work depending on which URL you want to have rewritten (only
the one in the page content or also the ones in the UI)

Adding request to the plugin API is also a solution, though I would like
to have a system that keeps track of which plugin have an implementation
of each method so that we reduce the loops on all the plugins.. Maybe by
keeping a hashtable per method call.. Otherwise I'm afraid the plugin
loops are going to end up being expensive..

Ludovic

Matthew Conway wrote:

> I'd like to be able to use my own URLFactory in an xwiki instance, so  
> I thought the cleanest way to do this would be within an xwiki plugin  
> by calling context.setUrlFactory from within a plugin method early in  
> the request/response cycle.  However, context.getURLFactory() seems  
> to get called before any of the plugin methods, so I can't do it this  
> way without a code modification.
>
> Thus my options are to either add a new method to the plugin which  
> gets called early in the cycle (beginRequest(request,  context) ...?
> ), or make a modification to the xwiiki code base to  allow a
> URLFactory class to be chosen from xwiki.cfg.
>
> I'm leaning towards the plugin interface modification, but before I  
> do this, I wanted to see if anyone has any suggestions.
>
> Thanks,
>
> Matt
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws