Hello again,
I'm still playing with the content of the page and I'm trying to use
$xwiki.parseContent($doc.content)
as Sergiu advised me. On the page I have just simple form with one submit
button and some text. My plugin is called after submitting the form
#if($request.Send)
$xwiki.myPlugin.operate($xwiki.parseContent($doc.content))
#end
And in the plugin Api I have just this
public void operate(String source){
System.out.println(source);
}
I know this is pretty useless, but it doesn't matter... The output of this
method is this (line 9 in my source of the page is
"$xwiki.myPlugin.operate($xwiki.parseContent($doc.content))":
[ERROR] Method parseContent threw exception for reference $xwiki in template
Main.try at [9,21]
[ERROR] Method parseContent threw exception for reference $xwiki in template
Main.try at [9,1]
org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with
id [Main.try]
at
org.xwiki.velocity.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187)
at
org.xwiki.velocity.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:143)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:107)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:84)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.interpret(XWikiVelocityRenderer.java:51)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:269)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.interpretText(DefaultXWikiRenderingEngine.java:175)
at com.xpn.xwiki.XWiki.parseContent(XWiki.java:1557)
at com.xpn.xwiki.api.XWiki.parseContent(XWiki.java:569)
...
...
...
Caused by: org.apache.velocity.exception.MethodInvocationException:
Invocation of method 'parseContent' in class com.xpn.xwiki.api.XWiki threw
exception java.lang.StackOverflowError @ Main.try[9,28]
...
...
...
Error number 4001 in 4: Error while parsing velocity page Main.try
Wrapped Exception: Failed to evaluate content with id [Main.try]
com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing
velocity page Main.try
Wrapped Exception: Failed to evaluate content with id [Main.try]
...
...
...
Instead of "..." there are error messages. And after this there is the
correct output, but for so many times (at least 50 by estimation). The all
output has almost 8500 lines :-( Does anyone know what am I doing wrong?
Thank you
--
View this message in context:
http://n2.nabble.com/How-to-get-%22real%22-content-of-wiki-page-in-plugin-A…
Sent from the XWiki- Users mailing list archive at
Nabble.com.