On Mon, Apr 22, 2013 at 11:32 AM, sthibaudeau <[email protected]> wrote:
Hi Marius,
Thanks for your answer. I've been explorer the XWikiDocument path but I wasn't able to easily extract the parser stuff and ended with almost all XWiki jars in my project build path.
My goal is to keep a lightweight approach so I started looking at the XWikiParser classes.
You mean the Rendering engine: http://rendering.xwiki.org/xwiki/bin/view/Main/WebHome
As for now I'm able to parse a page and know how many sections are in it. But I need to look at it more closely to be able to retrieve the whole sections contents without redefining every WemListener's methods.
IWikiParser parser = new XWikiParser(); parser.parse(new StringReader(page), new EmptyWemListener() {
@Override public void beginSection(int docLevel, int headerLevel, WikiParameters params) { System.out.println("section " + docLevel + "-" + headerLevel); System.out.println(params); }
@Override public void beginSectionContent(int docLevel, int headerLevel, WikiParameters params) { System.out.println("sectioncontent " + docLevel + "-" + headerLevel); System.out.println(params); }
});
If you have tips or advices, they're very welcome.
I'm not very familiar with the rendering code. Thomas or Vincent can help you with this.
Regards, Stephane
-- View this message in context: http://xwiki.475771.n2.nabble.com/Retrieve-modify-page-sections-with-Rest-or... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users