use of org.orcid.pojo.ajaxForm.RedirectUri in project ORCID-Source by ORCID.
the class ResultContainer method updateClient.
@RequestMapping(value = "/update-client.json", method = RequestMethod.POST)
@ResponseBody
public Client updateClient(@RequestBody Client client) {
// Clean the error list
client.setErrors(new ArrayList<String>());
// Validate fields
groupAdministratorController.validateDisplayName(client);
groupAdministratorController.validateWebsite(client);
groupAdministratorController.validateShortDescription(client);
groupAdministratorController.validateRedirectUris(client, true);
copyErrors(client.getDisplayName(), client);
copyErrors(client.getWebsite(), client);
copyErrors(client.getShortDescription(), client);
if (client.getAuthenticationProviderId() != null) {
validateIdP(client);
copyErrors(client.getAuthenticationProviderId(), client);
}
for (RedirectUri redirectUri : client.getRedirectUris()) {
copyErrors(redirectUri, client);
}
if (client.getErrors().isEmpty()) {
org.orcid.jaxb.model.v3.dev1.client.Client modelObject = clientManager.edit(client.toModelObject(), true);
client = Client.fromModelObject(modelObject);
membersManager.clearCache();
}
return client;
}
use of org.orcid.pojo.ajaxForm.RedirectUri in project ORCID-Source by ORCID.
the class ClientsController method getEmptyClient.
@RequestMapping(value = "/client.json", method = RequestMethod.GET)
@ResponseBody
public Client getEmptyClient() {
Client emptyClient = new Client();
emptyClient.setDisplayName(new Text());
emptyClient.setWebsite(new Text());
emptyClient.setShortDescription(new Text());
emptyClient.setClientId(new Text());
emptyClient.setClientSecret(new Text());
emptyClient.setType(new Text());
emptyClient.setAllowAutoDeprecate(Checkbox.valueOf(false));
ArrayList<RedirectUri> redirectUris = new ArrayList<RedirectUri>();
RedirectUri emptyRedirectUri = new RedirectUri();
emptyRedirectUri.setValue(new Text());
emptyRedirectUri.setType(Text.valueOf(RedirectUriType.DEFAULT.value()));
emptyRedirectUri.setActType(Text.valueOf(""));
emptyRedirectUri.setGeoArea(Text.valueOf(""));
redirectUris.add(emptyRedirectUri);
emptyClient.setRedirectUris(redirectUris);
return emptyClient;
}
use of org.orcid.pojo.ajaxForm.RedirectUri in project ORCID-Source by ORCID.
the class DeveloperToolsController method getEmptyClient.
@RequestMapping(value = "/client.json", method = RequestMethod.GET)
@ResponseBody
public Client getEmptyClient(HttpServletRequest request) {
Client emptyObject = new Client();
emptyObject.setClientSecret(Text.valueOf(StringUtils.EMPTY));
RedirectUri redirectUri = new RedirectUri();
redirectUri.setValue(new Text());
redirectUri.setType(Text.valueOf(RedirectUriType.SSO_AUTHENTICATION.value()));
List<RedirectUri> set = new ArrayList<RedirectUri>();
set.add(redirectUri);
emptyObject.setRedirectUris(set);
return emptyObject;
}
Aggregations