@Override public void init(Map<String, Object> params) { getDialogOptions().setHeight("400px"); StringBuilder sb = new StringBuilder(); for (AppPropertyEntity entity : exported) { sb.append("insert into SYS_CONFIG (ID, CREATE_TS, CREATED_BY, VERSION, NAME, VALUE_)\n"); sb.append("values ('").append(entity.getId()) .append("', current_timestamp, '") .append(uss.getUserSession().getUser().getLogin()) .append("', 0, '") .append(entity.getName()) .append("', '") .append(entity.getCurrentValue()).append("');\n\n"); } scriptArea.setValue(sb.toString()); } }
public void ok() { AppPropertyEntity appPropertyEntity = appPropertyDs.getItem(); // Save property through the client-side cache to ensure it is updated in the cache immediately Configuration configuration = AppBeans.get(Configuration.class); ConfigStorageService configStorageService = ((ConfigurationClientImpl) configuration).getConfigStorageService(); configStorageService.setDbProperty(appPropertyEntity.getName(), appPropertyEntity.getCurrentValue()); close(COMMIT_ACTION_ID); }
v = entity.getDefaultValue(); datatype.parse(v); v = entity.getCurrentValue(); datatype.parse(v); } catch (ParseException e) {
return createLookupField(Arrays.asList(item.getEnumValues().split(",")), item.getCurrentValue()); } else { if (datatype instanceof BooleanDatatype) { return createLookupField(Arrays.asList(Boolean.TRUE.toString(), Boolean.FALSE.toString()), item.getCurrentValue()); } else { if (Boolean.TRUE.equals(item.getSecret())) { PasswordField passwordField = uiComponents.create(PasswordField.class); passwordField.setValue(item.getCurrentValue()); passwordField.addValueChangeListener(e -> { appPropertyDs.getItem().setCurrentValue(e.getValue()); } else { TextField<Object> textField = uiComponents.create(TextField.NAME); textField.setValue(item.getCurrentValue()); datatype.parse(item.getCurrentValue(), userSessionSource.getLocale()); textField.setDatatype(datatype); } catch (ParseException e) { log.trace("Localized parsing by datatype cannot be used for value {}", item.getCurrentValue());
public void editValue() { AppPropertiesEdit editor = (AppPropertiesEdit) openWindow("appPropertyEditor", OpenType.DIALOG, ParamsMap.of("item", paramsDs.getItem())); editor.addCloseWithCommitListener(() -> { List<AppPropertyEntity> entities = paramsDs.loadAppPropertyEntities(); for (AppPropertyEntity entity : entities) { if (entity.getName().equals(paramsDs.getItem().getName())) { paramsDs.getItem().setCurrentValue(entity.getCurrentValue()); paramsDs.getItem().setUpdateTs(entity.getUpdateTs()); paramsDs.getItem().setUpdatedBy(entity.getUpdatedBy()); break; } } }); }