Author: tmortagne
Date: 2007-10-05 17:12:57 +0200 (Fri, 05 Oct 2007)
New Revision: 5300
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java
Log:
XWIKI-1779: Add getWikiName and getPrefixedFullName in
com.xpn.xwiki.api.Document
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java
2007-10-05 00:44:29 UTC (rev 5299)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java
2007-10-05 15:12:57 UTC (rev 5300)
@@ -112,7 +112,7 @@
/**
* return the name of the space of the document
*
- * for exemple if the fullName of a document is "MySpace.Mydoc", the name
is MySpace
+ * for example if the fullName of a document is "MySpace.Mydoc", the name
is MySpace
*
* @return the name of the space of the document
*/
@@ -122,6 +122,14 @@
}
/**
+ * @return the name of the wiki where this document is stored.
+ */
+ public String getWikiName()
+ {
+ return doc.getDatabase();
+ }
+
+ /**
* return the name of the space of the document
*
* for exemple if the fullName of a document is "MySpace.Mydoc", the name
is MySpace
@@ -134,7 +142,7 @@
}
/**
- * return the fullName of a doucment
+ * return the fullName of a document
*
* if a document has for name "MyDoc" and space "MySpace", the fullname is
"MySpace.MyDoc" In a
* wiki, all the documents have a different fullName.
@@ -144,6 +152,15 @@
return doc.getFullName();
}
+ /**
+ * @return the real full name of a document containing wiki name where
document is stored.
+ * For document in "xwiki" wiki, with name "MyDoc" and space "MySpace" the
extended full name is "xwiki:MySpace.MyDoc".
+ */
+ public String getPrefixedFullName()
+ {
+ return getWikiName() + ":" + getFullName();
+ }
+
public Version getRCSVersion()
{
return doc.getRCSVersion();
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications