Revision 59190
Added by Antonis Lempesis over 3 years ago
RepositoryServiceImpl.java | ||
---|---|---|
552 | 552 |
public RepositoryInterface addRepositoryInterface(String datatype, |
553 | 553 |
String repoId, |
554 | 554 |
String registeredBy, |
555 |
RepositoryInterface repositoryInterface) throws Exception { |
|
555 |
String comment, RepositoryInterface repositoryInterface) throws Exception {
|
|
556 | 556 |
try { |
557 | 557 |
Repository e = this.getRepositoryById(repoId); |
558 | 558 |
repositoryInterface = createRepositoryInterface(e,repositoryInterface,datatype); |
... | ... | |
568 | 568 |
|
569 | 569 |
ResponseEntity responseEntity = restTemplate.postForObject(uriComponents.toUri(),httpEntity,ResponseEntity.class); |
570 | 570 |
|
571 |
if(responseEntity.getStatusCode().equals(HttpStatus.OK)) { |
|
572 |
emailUtils.sendAdminRegisterInterfaceEmail(e, repositoryInterface, SecurityContextHolder.getContext().getAuthentication()); |
|
573 |
emailUtils.sendUserRegisterInterfaceEmail(e, repositoryInterface, SecurityContextHolder.getContext().getAuthentication()); |
|
571 |
if (responseEntity.getStatusCode().equals(HttpStatus.OK)) {
|
|
572 |
emailUtils.sendAdminRegisterInterfaceEmail(e, comment, repositoryInterface, SecurityContextHolder.getContext().getAuthentication());
|
|
573 |
emailUtils.sendUserRegisterInterfaceEmail(e, comment, repositoryInterface, SecurityContextHolder.getContext().getAuthentication());
|
|
574 | 574 |
|
575 | 575 |
submitInterfaceValidation(e, registeredBy, repositoryInterface, false); |
576 | 576 |
return repositoryInterface; |
... | ... | |
589 | 589 |
@Override |
590 | 590 |
public RepositoryInterface updateRepositoryInterface(String repoId, |
591 | 591 |
String registeredBy, |
592 |
RepositoryInterface repositoryInterface) throws Exception { |
|
592 |
String comment, RepositoryInterface repositoryInterface) throws Exception {
|
|
593 | 593 |
|
594 | 594 |
this.updateBaseUrl(repoId,repositoryInterface.getId(),repositoryInterface.getBaseUrl()); |
595 | 595 |
this.updateCompliance(repoId,repositoryInterface.getId(),repositoryInterface.getCompliance()); |
596 | 596 |
this.updateValidationSet(repoId,repositoryInterface.getId(),repositoryInterface.getAccessSet()); |
597 | 597 |
|
598 | 598 |
Repository e = this.getRepositoryById(repoId); |
599 |
emailUtils.sendAdminUpdateInterfaceEmail(e, repositoryInterface, SecurityContextHolder.getContext().getAuthentication()); |
|
600 |
emailUtils.sendUserUpdateInterfaceEmail(e, repositoryInterface, SecurityContextHolder.getContext().getAuthentication()); |
|
599 |
emailUtils.sendAdminUpdateInterfaceEmail(e, comment, repositoryInterface, SecurityContextHolder.getContext().getAuthentication());
|
|
600 |
emailUtils.sendUserUpdateInterfaceEmail(e, comment, repositoryInterface, SecurityContextHolder.getContext().getAuthentication());
|
|
601 | 601 |
submitInterfaceValidation(getRepositoryById(repoId),registeredBy,repositoryInterface,true); |
602 | 602 |
|
603 | 603 |
return repositoryInterface; |
Also available in: Unified diff
added the option to send emails to users