On Sep 27, 2009, at 5:18 AM, sdumitriu (SVN) wrote:
Author: sdumitriu
Date: 2009-09-27 05:18:20 +0200 (Sun, 27 Sep 2009)
New Revision: 24079
Modified:
platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/doc/
XWikiDocument.java
Log:
XWIKI-4416: Add getPrefixedFullName in XWikiDocument
Done.
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/
xwiki/doc/XWikiDocument.java
===================================================================
--- platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/doc/
XWikiDocument.java 2009-09-27 02:37:41 UTC (rev 24078)
+++ platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/doc/
XWikiDocument.java 2009-09-27 03:18:20 UTC (rev 24079)
@@ -651,12 +651,20 @@
public String getFullName()
{
StringBuffer buf = new StringBuffer();
- buf.append(getSpace());
- buf.append(".");
+ buf.append(getSpace()).append(".");
buf.append(getName());
return buf.toString();
}
+ public String getPrefixedFullName()
+ {
+ StringBuffer buf = new StringBuffer();
+ buf.append(getDatabase()).append(":");
+ buf.append(getSpace()).append(".");
+ buf.append(getName());
+ return buf.toString();
+ }
Shouldn't users of this method instead use DocumentName?
Couldn't we instead introduce a getDocumentName() in XWikiDocument.
Of course if the calling code needs a string (which it shouldn't
except in very rare cases but right now it's possible it needs one
because not all our api are using DocumentName) then it can use the
DocumentNameSerializer.
ok maybe it's not easy to do but at the very least I'd like a javadoc
on this new method to explain that it shouldn't be used and that
DocumentName should be used instead.
-Vincent