5 Jan
2010
5 Jan
'10
3:50 p.m.
Hi, Is it possible to write XWiki components that create new pages without having as a dependency the old xwiki core? Let's say the component currently has the following code snippet: XWiki xwiki = xwikiContext.getWiki(); XWikiDocument newDocument = new XWikiDocument(); newDocument.setFullName(documentName, xwikiContext); newDocument.setContent(templateDoc.getContent()); newDocument.setSyntaxId("xwiki/2.0"); newDocument.setCreator(xwikiContext.getLocalUser()); newDocument.setAuthor(xwikiContext.getLocalUser()); newDocument.setTitle(someString); xwiki.saveDocument(newDocument, xwikiContext); How should the code be written so it will be easier to change when the code refactoring comes to an end? Thanks, Anamaria