use of com.axelor.app.AppSettings in project axelor-open-suite by axelor.
the class UserBaseRepository method save.
@Override
public User save(User user) {
try {
AppSettings appSettings = AppSettings.get();
String defaultLanguage = appSettings.get("application.locale");
if (user.getId() == null && !(defaultLanguage == null || "".equals(defaultLanguage)) && (user.getLanguage() == null || "".contentEquals(user.getLanguage()))) {
user.setLanguage(appSettings.get("application.locale"));
}
if (user.getPartner() != null && user.getPartner().getEmailAddress() != null && StringUtils.notBlank(user.getPartner().getEmailAddress().getAddress()) && !user.getPartner().getEmailAddress().getAddress().equals(user.getEmail())) {
user.setEmail(user.getPartner().getEmailAddress().getAddress());
}
user = super.save(user);
if (StringUtils.notBlank(user.getTransientPassword())) {
Beans.get(UserService.class).processChangedPassword(user);
}
return user;
} catch (Exception e) {
TraceBackService.traceExceptionFromSaveMethod(e);
throw new PersistenceException(e.getMessage(), e);
}
}
use of com.axelor.app.AppSettings in project axelor-open-suite by axelor.
the class UserController method setDefaultUserMethod.
public void setDefaultUserMethod(ActionRequest request, ActionResponse response) {
try {
AppSettings appSettings = AppSettings.get();
response.setValue("language", appSettings.get("application.locale"));
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.app.AppSettings in project axelor-open-suite by axelor.
the class DeclarationOfExchangesExporter method getExportDir.
protected String getExportDir() {
AppSettings appSettings = AppSettings.get();
String exportDir = appSettings.get("data.export.dir");
if (exportDir == null) {
throw new IllegalArgumentException(I18n.get("Export directory is not configured."));
}
return exportDir;
}
use of com.axelor.app.AppSettings in project axelor-open-suite by axelor.
the class ExternalReportSettings method addAxelorReportPath.
private ReportSettings addAxelorReportPath(String rptdesign) {
AppSettings appsSettings = AppSettings.get();
String defaultUrl = appsSettings.getBaseURL();
defaultUrl = defaultUrl.substring(0, defaultUrl.lastIndexOf('/'));
defaultUrl += "/" + BIRT_PATH;
this.birtViewerUrl = appsSettings.get("axelor.report.engine", defaultUrl);
String resourcePath = appsSettings.get("axelor.report.resource.path", "report");
resourcePath = resourcePath.endsWith("/") ? resourcePath : resourcePath + "/";
this.url += birtViewerUrl + "/frameset?__report=" + resourcePath + rptdesign;
return this;
}
use of com.axelor.app.AppSettings in project axelor-open-suite by axelor.
the class ReportSettings method useIntegratedEngine.
public static boolean useIntegratedEngine() {
AppSettings appsSettings = AppSettings.get();
String useIntegratedEngine = appsSettings.get("axelor.report.use.embedded.engine", "true");
return "true".equals(useIntegratedEngine);
}
Aggregations