use of org.orcid.pojo.ajaxForm.ExternalIdentifierForm in project ORCID-Source by ORCID.
the class WorkspaceController method updateExternalIdentifierJson.
/**
* Update the visibility of the given external identifeirs
*/
@RequestMapping(value = "/my-orcid/externalIdentifiers.json", method = RequestMethod.POST)
@ResponseBody
public ExternalIdentifiersForm updateExternalIdentifierJson(HttpServletRequest request, @RequestBody ExternalIdentifiersForm externalIdentifiersForm) {
externalIdentifiersForm.setErrors(new ArrayList<String>());
// Validate visibility is not null
if (externalIdentifiersForm != null && externalIdentifiersForm.getExternalIdentifiers() != null) {
for (ExternalIdentifierForm extId : externalIdentifiersForm.getExternalIdentifiers()) {
// Validate visibility is not null
validateVisibility(extId);
copyErrors(extId, externalIdentifiersForm);
}
}
if (!externalIdentifiersForm.getErrors().isEmpty()) {
return externalIdentifiersForm;
}
PersonExternalIdentifiers externalIdentifiers = externalIdentifiersForm.toPersonExternalIdentifiers();
externalIdentifiers = externalIdentifierManager.updateExternalIdentifiers(getCurrentUserOrcid(), externalIdentifiers);
return externalIdentifiersForm;
}
Aggregations