Hi,
ArielWang wrote:
It's me again.
As I mentioned before, $request.getContextPath() and $context.getDatabase()
cannot be parsed correctly.
So I changed them into fixed value in resources/js/xwiki/xwiki.js as below:
/**
* XWiki namespace.
* TODO: move everything in it.
*
* @type object
*/
var XWiki = {
constants: {
/**
* Current wiki.
*/
//currentWiki: "$context.getDatabase()",
currentWiki: "xwiki",
/**
* Main wiki.
*/
mainWiki: "$context.getMainWikiName()",
/**
* Context path.
*/
//contextPath: "$request.getContextPath()",
contextPath: "https://www.denver.com/xwiki"
And now I can get the tree, but also one error message displayed:
http://n2.nabble.com/file/n3261097/image003.jpg
You made the editor request a resource from a different domain than the
one from where the editor was loaded, thus breaking the same origin
policy. Is the edited page loaded using HTTPS protocol? Have you tried
to set the contextPath to only "/xwiki" as told in the error message?
I have no idea about the error and the point why
$request.getContextPath()
and $context.getDatabase() cannot be parsed.
Check how xwiki.js is imported (look in templates/javascript.vm). It
should be like this:
<script type="text/javascript"
src="$xwiki.getSkinFile("js/xwiki/xwiki.js",
true)"></script>
Notice the "true" parameter passed to the getSkinFile method. It ensures
that the specified file is parsed for velocity expressions.
Hope this helps,
Marius
Thanks so much!