To get the current document's revision number, try this:

${doc.getVersion()}

The variable doc is initialized by some of the core scripts in XWiki, and represents the current document object. Therefore, you do not have to initialize a new object, you just reference "doc". Following are just a few other interesting calls you can make against the doc object. Paste this little snippet in  document as a reference:

SNIP -----------------------------------------

1.1 Methods that take no parameters as input and return Strings

* doc.getCreator() ~~returns~~
** ${doc.getCreator()}
* doc.getFullName() ~~returns~~
** ${doc.getFullName()}
* doc.getName() ~~returns~~
** ${doc.getName()}
* doc.getParent() ~~returns~~
** ${doc.getParent()}
* doc.getParentURL() ~~returns~~
** ${doc.getParentURL()}
* doc.getVersion() ~~returns~~
** ${doc.getVersion()}
* doc.getWeb() ~~returns~~
** ${doc.getWeb()}

There are other methods that take no parameters as input and return Strings. This is just a basic example. There are also methods that take parameters as input. There are also methods that return different datatypes (but we'd have to study Velocity to understand how to work with those different data types).

END SNIP --------------------------------------
==================================
Cody Burleson





"Duke Tantiprasut" <duke@resolve-systems.com>

08/30/2005 05:49 AM
Please respond to
xwiki-users@objectweb.org

To
<xwiki-users@objectweb.org>
cc
Subject
[xwiki-users] revision number





Hi All,

Quick question, how do you get the revision number for a wiki doc?

Thanks.

Duke



--
You receive this message as a subscriber of the xwiki-users@objectweb.org mailing list.
To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws