[xwiki-dev] [API] New Api.getContext() method?
Vincent Massol
vincent at massol.net
Fri Feb 2 21:55:49 CET 2007
On Feb 2, 2007, at 9:43 PM, Sergiu Dumitriu wrote:
> I think you should reconsider this, if I understood things correctly.
>
> Api.getContext is a method that can be called from any velocity
> code, and the XWikiContext class should NOT be freely available.
Right. Ok, so what you're saying is that getContext should be
protected instead of public?
I thought about this before implementing it but then the Api
constructor is public and takes a XWikiContext object. Thus I guess
what we are really saying is that either we should use Context
instead of XWikiContext and leave everything public or make the
constructor and the getContext method protected.
BTW c.x.XWiki and c.x.XWikiContext are already available from
velocity/groovy through c.x.api.XWiki.getWiki() and
c.x.api.Context.getContext(), but I guess this is not right too and
needs to be fixed.
Actually this is something we'll need to discuss too (the impedance
mismatch between c.x.api.* and c.x.* classes).
-Vincent
>
> On 2/2/07, Vincent Massol <vincent at massol.net> wrote:
> ok, I've added the new getContext() method and moved all core code to
> use it. I've not modified the plugins in xwiki-plugins that are not
> part of the build yet.
>
> Now we need to decide if we want to move the Api.context variable
> from protected to private (as it should be to force the usage of the
> accessor).
>
> The only issue is that existing plugins will fail to work against the
> new version. They'll need to be modified to use getContext().
>
> WDYT?
>
> Note that we cannot put a deprecation on this unfortunately...
>
> Thanks
> -Vincent
>
> On Feb 2, 2007, at 1:22 PM, Vincent Massol wrote:
>
> > Hi,
> >
> > I'd like to propose adding a new Api.getContext() method. Plugins
> > are currently using this.context to get access to it. I'd like to
> > add this method and make the context instance variable private.
> >
> > This is pretty minor and I don't see any negative point of doing it
> > as it's already there, just not explicit.
> >
> > Let me know.
> >
> > Thanks
> > -Vincent
>
>
>
>
>
>
> ______________________________________________________________________
> _____
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et
> son interface révolutionnaire.
> http://fr.mail.yahoo.com
>
>
>
> --
> You receive this message as a subscriber of the xwiki-
> dev at objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-dev-unsubscribe at objectweb.org
> For general help: mailto: sympa at objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/
> wws
>
>
>
>
> --
> http://purl.org/net/sergiu
>
> --
> You receive this message as a subscriber of the xwiki-
> dev at objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-dev-unsubscribe at objectweb.org
> For general help: mailto:sympa at objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/
> wws
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xwiki.org/pipermail/devs/attachments/20070202/a1f0651e/attachment.html
More information about the devs
mailing list