use of org.apache.openmeetings.db.entity.basic.Configuration in project openmeetings by apache.
the class TestOldBackups method tearDown.
@After
public void tearDown() {
Configuration cfg = cfgDao.get(CONFIG_CRYPT);
assertNotNull("Not null config should be returned", cfg);
cfg.setValue(cryptClass);
cfgDao.update(cfg, null);
}
use of org.apache.openmeetings.db.entity.basic.Configuration in project openmeetings by apache.
the class ImportInitvalues method addCfg.
private static void addCfg(List<Configuration> list, String key, String value, Configuration.Type type, String comment, String fromVersion) {
Configuration c = new Configuration();
c.setType(type);
c.setKey(key);
c.setValue(value);
c.setComment(comment);
c.setFromVersion(fromVersion);
list.add(c);
}
use of org.apache.openmeetings.db.entity.basic.Configuration in project openmeetings by apache.
the class ConfigForm method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
add(new DropDownChoice<>("type", Arrays.asList(Type.values()), new IChoiceRenderer<Type>() {
private static final long serialVersionUID = 1L;
@Override
public String getIdValue(Type rt, int index) {
return rt.name();
}
@Override
public Object getDisplayValue(Type rt) {
return rt.name();
}
@Override
public Type getObject(String id, IModel<? extends List<? extends Type>> choices) {
for (Type rt : choices.getObject()) {
if (rt.name().equals(id)) {
return rt;
}
}
return null;
}
}).setLabel(Model.of(getString("45"))).add(new AjaxFormComponentUpdatingBehavior("change") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
update(target);
}
}));
add(new RequiredTextField<String>("key").setLabel(Model.of(getString("265"))).add(new IValidator<String>() {
private static final long serialVersionUID = 1L;
@Override
public void validate(IValidatable<String> validatable) {
Configuration c = cfgDao.forceGet(validatable.getValue());
if (c != null && !c.isDeleted() && !c.getId().equals(ConfigForm.this.getModelObject().getId())) {
validatable.error(new ValidationError(getString("error.cfg.exist")));
}
}
}));
add(valueS.setLabel(Model.of(getString("271"))).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
add(valueN.setLabel(Model.of(getString("271"))).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
add(valueB.setLabel(Model.of(getString("271"))).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
}
use of org.apache.openmeetings.db.entity.basic.Configuration in project openmeetings by apache.
the class ConfigForm method onDeleteSubmit.
@Override
protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
cfgDao.delete(getModelObject(), WebSession.getUserId());
setModelObject(new Configuration());
target.add(listContainer);
refresh(target);
}
use of org.apache.openmeetings.db.entity.basic.Configuration in project openmeetings by apache.
the class ConfigForm method onSaveSubmit.
@Override
protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
Configuration c = cfgDao.forceGet(getModelObject().getKey());
if (c != null && c.isDeleted() && !c.getId().equals(getModelObject().getId())) {
getModelObject().setId(c.getId());
}
setModelObject(cfgDao.update(getModelObject(), WebSession.getUserId()));
hideNewRecord();
target.add(listContainer);
refresh(target);
}
Aggregations