use of de.symeda.sormas.api.externaljournal.PatientDiaryConfig in project SORMAS-Project by hzi-braunschweig.
the class StartupShutdownService method createOrUpdatePatientDiaryUser.
private void createOrUpdatePatientDiaryUser() {
PatientDiaryConfig patientDiaryConfig = configFacade.getPatientDiaryConfig();
UserConfig userConfig = patientDiaryConfig.getDefaultUser();
if (userConfig == null) {
logger.debug("Patient diary default user not configured");
return;
}
createOrUpdateDefaultUser(new HashSet<>(Arrays.asList(UserRole.REST_USER, UserRole.REST_EXTERNAL_VISITS_USER)), userConfig.getUsername(), userConfig.getPassword(), "Patient", "Diary");
}
use of de.symeda.sormas.api.externaljournal.PatientDiaryConfig in project SORMAS-Project by hzi-braunschweig.
the class ConfigFacadeEjb method getPatientDiaryConfig.
@Override
public PatientDiaryConfig getPatientDiaryConfig() {
PatientDiaryConfig config = new PatientDiaryConfig();
config.setUrl(getProperty(INTERFACE_PATIENT_DIARY_URL, null));
config.setProbandsUrl(getProperty(INTERFACE_PATIENT_DIARY_PROBANDS_URL, null));
config.setAuthUrl(getProperty(INTERFACE_PATIENT_DIARY_AUTH_URL, null));
config.setFrontendAuthUrl(getProperty(INTERFACE_PATIENT_DIARY_FRONTEND_AUTH_URL, null));
config.setTokenLifetime(Duration.ofSeconds(getLong(INTERFACE_PATIENT_DIARY_TOKEN_LIFETIME, 21600L)));
config.setEmail(getProperty(INTERFACE_PATIENT_DIARY_EMAIL, null));
config.setPassword(getProperty(INTERFACE_PATIENT_DIARY_PASSWORD, null));
config.setAcceptPhoneContact(getBoolean(INTERFACE_PATIENT_DIARY_ACCEPT_PHONE_CONTACT, true));
UserConfig userConfig = new UserConfig();
userConfig.setUsername(getProperty(INTERFACE_PATIENT_DIARY_DEFAULT_USER_USERNAME, null));
userConfig.setPassword(getProperty(INTERFACE_PATIENT_DIARY_DEFAULT_USER_PASSWORD, null));
if (StringUtils.isNoneBlank(userConfig.getUsername(), userConfig.getPassword())) {
config.setDefaultUser(userConfig);
}
return config;
}
Aggregations