You only call getDocument in your example, if you want your document
to be saved then you need to save it. See saveDocument method in
XWiki.
On Tue, Feb 3, 2015 at 5:12 PM, carlez <senzacquacarlo(a)gmail.com> wrote:
How can I create spaces and pages from a component in
Java?
I've just tried with this code but doesn't work..
XWikiContext context = getXWikiContext();
XWiki wiki = context.getWiki();
DocumentReference doc = new
DocumentReference("Home","MySpace","MyPage");
try {
wiki.getDocument(doc, context);
return 0;
} catch (XWikiException e) {
e.printStackTrace();
return 1;
}
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Create-spaces-and-pages-from-a-component-…
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne