On Apr 6, 2009, at 11:46 AM, Anca Paula Luca wrote:
Anca Paula Luca wrote:
Hi developers,
I would like to refactor
String getURL(String documentName, String action, String
queryString, String
anchor)
in the DocumentAccessBridge (whose documentName is actually used as
a document
fullName) to
String getURL(DocumentName documentName, String action, String
queryString,
String anchor)
and implement multiwiki support for it, since now it uses
XWiki.getURL() which
uses current context wiki to generate the URL.
it does actually work for
multiwiki, through
XWikiDocument.setFullName() which
parses the fullName as a full reference (wiki too), which we should
probably
also refactor to use the new DocumentNameFactory() for parsing.
I left it voluntarily untouched. The factory doesn't do exactly as
setFullName() does since it fixes several bugs of setFullName(). I
think it's dangerous to touch setFullName(). Thus if there's code
expecting the call to fail under some circumstances it won't work
anymore since it won't fail with the factory.
But for the purpose of the proposed bridge refactor, I think it's safe to
consider that all calls to getURL(String) don't expect setFullName() to fail and
can be replaced by getURL(factory.createDocumentName(String)).
BTW, do we overload functions in the bridge? as in leave the old function in and
just forward the call to the new function, preceded by a reference parse
(I'd -0 for this, except that it's a safer refactor before the release).
Thanks,
Anca Luca
Some examples that are failing in setFullName (there are more):
hello.world:something
hello:world
hello:
-Vincent
The calls
to current function would be transformed in:
DocumentNameFactory docNameFactory = ...
getURL(docNameFactory.createDocumentName(fullName), ...)
which will have the same result as before.
Since we will need to change all internal reference to documents in
DocumentNames instead of fullNames as Strings, this would be a step
in this
direction, facilitated by the new DocumentNameSerializer and
DocumentNameFactory.
Here's my +1
WDYT?
Thanks,
Anca Luca
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs