Search in sources :

Example 6 with LdapConfig

use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.

the class LdapForm method onRefreshSubmit.

@Override
protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
    LdapConfig ldapConfig = this.getModelObject();
    if (ldapConfig.getId() != null) {
        ldapConfig = ldapDao.get(ldapConfig.getId());
    } else {
        ldapConfig = new LdapConfig();
    }
    this.setModelObject(ldapConfig);
    target.add(this);
    reinitJs(target);
}
Also used : LdapConfig(org.apache.openmeetings.db.entity.server.LdapConfig)

Example 7 with LdapConfig

use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.

the class LdapsPanel method onInitialize.

@Override
protected void onInitialize() {
    SearchableDataView<LdapConfig> dataView = new SearchableDataView<LdapConfig>("ldapList", new SearchableDataProvider<>(LdapConfigDao.class)) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(final Item<LdapConfig> item) {
            final LdapConfig lc = item.getModelObject();
            item.add(new Label("id"));
            item.add(new Label("name"));
            item.add(new Label("configFileName"));
            item.add(new AjaxEventBehavior(EVT_CLICK) {

                private static final long serialVersionUID = 1L;

                @Override
                protected void onEvent(AjaxRequestTarget target) {
                    form.setModelObject(lc);
                    form.hideNewRecord();
                    target.add(form, listContainer);
                    reinitJs(target);
                }
            });
            item.add(AttributeModifier.replace(ATTR_CLASS, getRowClass(lc.getId(), form.getModelObject().getId())));
        }
    };
    add(listContainer.add(dataView).setOutputMarkupId(true));
    PagedEntityListPanel navigator = new PagedEntityListPanel("navigator", dataView) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onEvent(AjaxRequestTarget target) {
            target.add(listContainer);
        }
    };
    DataViewContainer<LdapConfig> container = new DataViewContainer<>(listContainer, dataView, navigator);
    container.addLink(new OmOrderByBorder<>("orderById", "id", container)).addLink(new OmOrderByBorder<>("orderByName", "name", container)).addLink(new OmOrderByBorder<>("orderByFile", "configFileName", container));
    add(container.getLinks());
    add(navigator);
    form = new LdapForm("form", listContainer, new LdapConfig());
    form.showNewRecord();
    add(form);
    super.onInitialize();
}
Also used : AjaxEventBehavior(org.apache.wicket.ajax.AjaxEventBehavior) Label(org.apache.wicket.markup.html.basic.Label) LdapConfig(org.apache.openmeetings.db.entity.server.LdapConfig) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) SearchableDataView(org.apache.openmeetings.web.admin.SearchableDataView) Item(org.apache.wicket.markup.repeater.Item) PagedEntityListPanel(org.apache.openmeetings.web.common.PagedEntityListPanel) OmOrderByBorder(org.apache.openmeetings.web.data.OmOrderByBorder) LdapConfigDao(org.apache.openmeetings.db.dao.server.LdapConfigDao) DataViewContainer(org.apache.openmeetings.web.data.DataViewContainer)

Aggregations

LdapConfig (org.apache.openmeetings.db.entity.server.LdapConfig)7 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1 LdapConfigDao (org.apache.openmeetings.db.dao.server.LdapConfigDao)1 OAuthServer (org.apache.openmeetings.db.entity.server.OAuthServer)1 User (org.apache.openmeetings.db.entity.user.User)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 AjaxEventBehavior (org.apache.wicket.ajax.AjaxEventBehavior)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 Label (org.apache.wicket.markup.html.basic.Label)1 Item (org.apache.wicket.markup.repeater.Item)1