Wiki source code of AddObjects
Last modified by Thomas Mortagne on 2014/06/30 08:43
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{velocity}} | ||
2 | #set($tagsDocument = $xwiki.getDocument('Test.TagsDocument')) | ||
3 | |||
4 | ## Create an object | ||
5 | #set($obj = $tagsDocument.newObject("XWiki.TagClass")) | ||
6 | $obj.set("tags", "tag0") | ||
7 | |||
8 | #set($obj = $tagsDocument.newObject("XWiki.TagClass")) | ||
9 | $obj.set("tags", "tag1") | ||
10 | |||
11 | #set($obj = $tagsDocument.newObject("XWiki.TagClass")) | ||
12 | $obj.set("tags", "tag2") | ||
13 | |||
14 | ## Save the object in the page | ||
15 | $tagsDocument.save() | ||
16 | {{/velocity}} |