use of org.akaza.openclinica.ws.validator.StudyEventDefinitionRequestValidator in project OpenClinica by OpenClinica.
the class StudyEventDefinitionEndpoint method getStudyList.
/**
* if NAMESPACE_URI_V1:getStudyListRequest execute this method
*
* @return
* @throws Exception
*/
@PayloadRoot(localPart = "listAllRequest", namespace = NAMESPACE_URI_V1)
public Source getStudyList(@XPathParam("//sed:studyEventDefinitionListAll") NodeList studyNodeList) throws Exception {
ResourceBundleProvider.updateLocale(new Locale("en_US"));
Element studyRefElement = (Element) studyNodeList.item(0);
// StudyEventDefinitionRequestBean studyEventDefinitionRequestBean = unMarshallRequest(studyRefElement);
BaseStudyDefinitionBean studyEventDefinitionRequestBean = unMarshallRequest(studyRefElement);
DataBinder dataBinder = new DataBinder((studyEventDefinitionRequestBean));
Errors errors = dataBinder.getBindingResult();
StudyEventDefinitionRequestValidator studyEventDefinitionRequestValidator = new StudyEventDefinitionRequestValidator(dataSource);
studyEventDefinitionRequestValidator.validate((studyEventDefinitionRequestBean), errors);
if (!errors.hasErrors()) {
return new DOMSource(mapConfirmation(getStudy(studyEventDefinitionRequestBean), messages.getMessage("studyEventDefinitionEndpoint.success", null, "Success", locale)));
} else {
return new DOMSource(mapFailConfirmation(messages.getMessage("studyEventDefinitionEndpoint.fail", null, "Fail", locale), errors));
}
}
Aggregations