On Dec 11, 2009, at 1:46 PM, Vincent Massol wrote:
On Dec 11, 2009, at 1:42 PM, Sergiu Dumitriu wrote:
On 12/11/2009 12:59 PM, Thomas Mortagne wrote:
On Fri, Dec 11, 2009 at 12:52, Vincent
Massol<vincent(a)massol.net>
wrote:
Hi,
I have the need to get the current wiki (which is different from
the
wiki defined in the current doc for my use case).
I'd like to add a DAB.getCurrentWiki().
Here's my +1
+0.5 (for once, current wiki is a very core information so component
should have access to it). It's not a full +1 because it's not
really
document related actually so it should goes in another API but
create
one just for that... and since getCurrentUser is already in DAB it's
kind of ok.
Why not in the ExecutionContext?
Indeed, EC is the correct place but we'll need several things before
we can use it:
1) Agree on its content. We need to design its content since it's
not been discussed/defined yet
2) The idea was to use the Model module to set the current wiki,
current document but the Model module isn't there yet
3) We need to modify all places that sets the current wiki in the
XWikiContext and make it set it in the EC too
In the meantime I can do this:
// TODO: Since the current wiki is not currently set in the
Execution Context, we have to get it from the
// old XWiki Context.
Map xwikiContext = (Map)
this.execution.getContext().getProperty("xwikicontext");
return (String) xwikiContext.get("wiki");
But I thought it was cleaner to have a getCurrentWiki() in the DAB.
thanks
-Vincent