I got stuck with customized validation for XWikiUsers class using XWiki
5.2. I have custom sheet with validation with following code excerpt:
public class PersonValidation implements XWikiValidationInterface {
public boolean validateDocument(XWikiDocument doc, XWikiContext
context) {
// Validation result
def res = true;
// User settings from the session context
def session=context.getRequest().getSession();
def user = context.getUser();
def userObj=context.getWiki().getDocument(user,
context).getObject('XWiki.XWikiUsers');
if(true) {
XWikiValidationStatus.addErrorToContext('NMPDtools.UserClass',
'', '', 'E-mail is '+userObj.getStringValue('email'),
context);
res = false;
}
return res;
}
public boolean validateObject(BaseObject object, XWikiContext context)
{
return true;
}
}
In difference with first_name, last_name, phone, etc. This method
doesn't return property value.
I noted, that using passed XWiki context, BaseObject is retured in
difference with Object for inline scripts, where get... methods works
properly.
If nothing else, is there is way to get Object from BaseObject?
Any suggestions ar welcome!
Valdis