use of org.obiba.mica.micaConfig.domain.DataAccessConfig in project mica2 by obiba.
the class DataAccessConfigService method save.
public void save(@NotNull @Valid DataAccessConfig config) {
DataAccessConfig savedConfig = getOrCreateConfig();
BeanUtils.copyProperties(config, savedConfig, "id", "version", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate");
dataAccessConfigRepository.save(savedConfig);
eventBus.post(new DataAccessConfigUpdatedEvent(savedConfig));
}
use of org.obiba.mica.micaConfig.domain.DataAccessConfig in project mica2 by obiba.
the class DataAccessEntityService method sendSubmittedNotificationEmail.
protected void sendSubmittedNotificationEmail(T request) {
DataAccessConfig dataAccessConfig = dataAccessConfigService.getOrCreateConfig();
if (dataAccessConfig.isNotifySubmitted()) {
Map<String, String> ctx = getNotificationEmailContext(request);
String prefix = getTemplatePrefix(ctx);
mailService.sendEmailToUsers(mailService.getSubject(dataAccessConfig.getSubmittedSubject(), ctx, DataAccessRequestUtilService.DEFAULT_NOTIFICATION_SUBJECT), prefix + "SubmittedApplicantEmail", ctx, request.getApplicant());
mailService.sendEmailToGroups(mailService.getSubject(dataAccessConfig.getSubmittedSubject(), ctx, DataAccessRequestUtilService.DEFAULT_NOTIFICATION_SUBJECT), prefix + "SubmittedDAOEmail", ctx, Roles.MICA_DAO);
}
}
use of org.obiba.mica.micaConfig.domain.DataAccessConfig in project mica2 by obiba.
the class DataAccessEntityService method sendOpenedNotificationEmail.
protected void sendOpenedNotificationEmail(T request) {
DataAccessConfig dataAccessConfig = dataAccessConfigService.getOrCreateConfig();
if (dataAccessConfig.isNotifyReopened()) {
Map<String, String> ctx = getNotificationEmailContext(request);
String prefix = getTemplatePrefix(ctx);
mailService.sendEmailToUsers(mailService.getSubject(dataAccessConfig.getReopenedSubject(), ctx, DataAccessRequestUtilService.DEFAULT_NOTIFICATION_SUBJECT), prefix + "ReopenedApplicantEmail", ctx, request.getApplicant());
}
}
use of org.obiba.mica.micaConfig.domain.DataAccessConfig in project mica2 by obiba.
the class DataAccessRequestUtilService method addNextSubmittedStatus.
private void addNextSubmittedStatus(List<DataAccessEntityStatus> to) {
to.add(DataAccessEntityStatus.OPENED);
DataAccessConfig dataAccessConfig = dataAccessConfigService.getOrCreateConfig();
if (dataAccessConfig.isWithReview()) {
to.add(DataAccessEntityStatus.REVIEWED);
} else {
to.add(DataAccessEntityStatus.APPROVED);
to.add(DataAccessEntityStatus.REJECTED);
if (dataAccessConfig.isWithConditionalApproval())
to.add(DataAccessEntityStatus.CONDITIONALLY_APPROVED);
}
}
use of org.obiba.mica.micaConfig.domain.DataAccessConfig in project mica2 by obiba.
the class DataAccessRequestUtilService method addNextReviewedStatus.
private void addNextReviewedStatus(List<DataAccessEntityStatus> to) {
to.add(DataAccessEntityStatus.APPROVED);
to.add(DataAccessEntityStatus.REJECTED);
DataAccessConfig dataAccessConfig = dataAccessConfigService.getOrCreateConfig();
if (dataAccessConfig.isWithConditionalApproval())
to.add(DataAccessEntityStatus.CONDITIONALLY_APPROVED);
else
to.add(DataAccessEntityStatus.OPENED);
}
Aggregations