On Fri, Mar 28, 2014 at 2:55 PM, DeHaynes <ew1560(a)wayne.edu> wrote:
I don't understand.
All of the following pieces of data are being pulled from source variable,
which is passed in by the XWiki system as a parameter in the onEvent method:
* The wiki document
* The value of the processName field in the wiki document.
* The wiki document's name.
* The document Title
* The documents Dirty flags.
* The URL for the document.
And what I think you are telling me is that the source
is not a reliable
place for getting the document space, because in the future sub-wikis will
cause an issue. Is that right?
No! My comment was only about:
// Build the new name for the document in the format of "SpaceName.PageName".
def FullDocumentName = source.getSpaceName() + "." + NewDocumentName;
The format you are referring to is called "document reference". It's
actually a string representation of a document reference. It's no
recommended to build the string representation of a document reference
manually by concatenating strings. The space or page name could
contain a dot (in which case it would need to be escaped). Or the
format could be changed at some point. That's why I recommended you to
use a document reference instead. Note that the rename method that
accepts a string (which you are using) is deprecated in favor of the
signature that accepts a document reference. So you just have to
replace FullDocumentName with a document reference.
Hope this helps,
Marius
If that is right, then wouldn't I need change where I get the data in the
list above also?
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Looking-for-help-with-groovy-tp7589782p75…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs