Guillaume,
You said that $msg.get("translation") would render a message.
But, how do I know what are the otehr strings (like "translation") that I
can use to render appropriate messages. Is there a lsit of these somewhere
in the code or on xwiki.org?
Thanks
On Wed, Apr 16, 2008 at 1:28 PM, Kamna Jain <kammy.scorpi(a)gmail.com> wrote:
Hello Devs,
In the past few days, I have been looking a lot at the Velocity templates
and the Xwiki core code.
There are a few things I am not able to understand.
1) Where is $msg variable defined in the core code? I see it a lot in the
scripts. Is it a hashtable for messages. Where is it defined?
2) what is referred to by "xpage","xredirect"
For eg. in the following mehtod from Utils.java
public static String getPage(XWikiRequest request, String defaultpage)
{
String page;
page = request.getParameter("xpage");
if ((page == null) || (page.equals(""))) {
page = defaultpage;
}
return page;
}
does this mean, that if a page with that name exists in the template
directory(xpage), it will be returned. But, what is defaultpage?
Currently the login page does not show any error if the provided
credentials are wrong. (authentication with LDAP)
A look at the LoginErrorAction.java in the Web package revealed that it
returns the same string as the LoginAction - "login"
so, if I created anither loginerror.vm in teh templates folder and
returned "loginerror" in the render function of this LoginErrorAction.java
class, it would run the new script.
But, at this stage I do not know what would be the content of the
loginerror.vm....
#xwikimessageboxstart($msg.get("error") $msg.get("notallowed")) -
would
this work?
I picked this up from accessdenied.vm ...
Thanks for all help
Thanks