I used the following command to find implicit context references and I have filled in the
mappings
which I determined manually
user@debo8:~/wrk/xwiki.clone/xwiki/platform/web/trunk/standard/src/main/webapp/templates$
find ./
-name '*.vm' -exec grep '$xcontext\.[a-zA-Z0-9]*[^a-zA-Z0-9\(]' {} \; |
sed -n -e
's/\($xcontext\.[a-zA-Z0-9]*[^a-zA-Z0-9(]\)/\n\1\n/p' | grep '^$xcontext'
| sort
$xcontext.action=
$xcontext.action=
$xcontext.action=
$xcontext.action
$xcontext.action
$xcontext.action
$xcontext.action
$xcontext.action
$xcontext.action
$xcontext.action
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action,
$xcontext.action.
$xcontext.action)
^-- maps to Context.getAction()
$xcontext.database
$xcontext.database)
$xcontext.database)
$xcontext.database)
$xcontext.database)
$xcontext.database)
$xcontext.database)
^-- maps to Context.getDatabase()
$xcontext.language"
$xcontext.language"
$xcontext.language"
^-- maps to Context.getLanguage()
$xcontext.tocData
^-- this line is broken entirely, it maps to context.get('tocData') but the line
is:
#set ($xcontext.tocData = $tocData) which is simply invalid and I can't even
figure
out what it would do.
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user,
$xcontext.user.
$xcontext.user.
$xcontext.user.
$xcontext.user"
$xcontext.user"
$xcontext.user)
$xcontext.user)
$xcontext.user)
$xcontext.user)
$xcontext.user)
^-- Maps to $xcontext.getUser()
$xcontext.wiki,
$xcontext.wiki,
$xcontext.wiki,
^-- Maps to $xcontext.get('wiki') I think this is the source of most of the
messages and since it
appears to be relatively new code, it convinces me that the $context.blah pattern is
simply
unsafe and should be abandoned at least for the xcontext object.
I would like to fix these now and establish a best practice of avoiding the use of these
in the
future for $xcontext. I myself avoid this pattern entirely but I do not have a compelling
reason to
propose it as a best practice except for $context.
WDYT?
Caleb
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org