Search in sources :

Example 11 with Configuration

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);
}
Also used : Configuration(org.apache.openmeetings.db.entity.basic.Configuration) After(org.junit.After)

Example 12 with Configuration

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);
}
Also used : Configuration(org.apache.openmeetings.db.entity.basic.Configuration)

Example 13 with Configuration

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));
}
Also used : IChoiceRenderer(org.apache.wicket.markup.html.form.IChoiceRenderer) AjaxFormComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior) IModel(org.apache.wicket.model.IModel) Configuration(org.apache.openmeetings.db.entity.basic.Configuration) IValidatable(org.apache.wicket.validation.IValidatable) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Type(org.apache.openmeetings.db.entity.basic.Configuration.Type) IValidator(org.apache.wicket.validation.IValidator) List(java.util.List) ValidationError(org.apache.wicket.validation.ValidationError)

Example 14 with Configuration

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);
}
Also used : Configuration(org.apache.openmeetings.db.entity.basic.Configuration)

Example 15 with Configuration

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);
}
Also used : Configuration(org.apache.openmeetings.db.entity.basic.Configuration)

Aggregations

Configuration (org.apache.openmeetings.db.entity.basic.Configuration)17 Test (org.junit.Test)3 Serializer (org.simpleframework.xml.Serializer)3 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 List (java.util.List)1 Locale (java.util.Locale)1 OpenJPAConfiguration (org.apache.openjpa.conf.OpenJPAConfiguration)1 UserConverter (org.apache.openmeetings.backup.converter.UserConverter)1 ConfigurationDao (org.apache.openmeetings.db.dao.basic.ConfigurationDao)1 Type (org.apache.openmeetings.db.entity.basic.Configuration.Type)1 User (org.apache.openmeetings.db.entity.user.User)1 InstallationConfig (org.apache.openmeetings.installation.InstallationConfig)1 SearchableDataView (org.apache.openmeetings.web.admin.SearchableDataView)1 PagedEntityListPanel (org.apache.openmeetings.web.common.PagedEntityListPanel)1 DataViewContainer (org.apache.openmeetings.web.data.DataViewContainer)1 OmOrderByBorder (org.apache.openmeetings.web.data.OmOrderByBorder)1