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