Revision 36605
Added by Antonis Lempesis over 9 years ago
modules/uoa-goldoa-service/trunk/src/main/java/eu/dnetlib/goldoa/service/PersonManagerImpl.java | ||
---|---|---|
130 | 130 |
|
131 | 131 |
try { |
132 | 132 |
personDAO.getPersonByEmail(person.getEmail()); |
133 |
|
|
134 | 133 |
throw new PersonManagerException(PersonManagerException.ErrorCause.ALREADY_EXISTS); |
135 |
} catch (PersonManagerException e) { |
|
136 |
if (!PersonManagerException.ErrorCause.NOT_EXISTS.equals(e.getErrorCause())) |
|
137 |
throw e; |
|
134 |
} catch (EmptyResultDataAccessException e) { |
|
135 |
} catch (PersonManagerException e) { |
|
136 |
throw e; |
|
137 |
} catch (RuntimeException e) { |
|
138 |
e.printStackTrace(); |
|
139 |
throw e; |
|
138 | 140 |
} |
139 | 141 |
|
140 | 142 |
this.savePerson(person); |
modules/uoa-goldoa-service/trunk/src/main/java/eu/dnetlib/goldoa/service/dao/PersonDAO.java | ||
---|---|---|
425 | 425 |
|
426 | 426 |
person.setRoles(new ArrayList<PersonRole>()); |
427 | 427 |
for (String rString : (String[]) rs.getArray("roles").getArray()) { |
428 |
String[] parts = rString.split("\\|\\|"); |
|
429 |
String role = parts[0]; |
|
430 |
boolean approved = Boolean.parseBoolean(parts[1]); |
|
428 |
if (rString != null) { |
|
429 |
String[] parts = rString.split("\\|\\|"); |
|
430 |
String role = parts[0]; |
|
431 |
boolean approved = Boolean.parseBoolean(parts[1]); |
|
431 | 432 |
|
432 |
person.getRoles().add(new PersonRole(person, getRole(role), approved)); |
|
433 |
person.getRoles().add(new PersonRole(person, getRole(role), approved)); |
|
434 |
} |
|
433 | 435 |
} |
434 | 436 |
|
435 | 437 |
return person; |
Also available in: Unified diff
properly handling existing registration requests