Search in sources :

Example 1 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class PageReports method clearSearchPerformed.

private void clearSearchPerformed(AjaxRequestTarget target) {
    searchModel.setObject(new ReportSearchDto());
    Table panel = getReportTable();
    DataTable table = panel.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
    provider.setQuery(createQuery());
    ReportsStorage storage = getSessionStorage().getReports();
    storage.setReportSearch(searchModel.getObject());
    storage.setPaging(null);
    panel.setCurrentPage(null);
    target.add((Component) panel);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ReportSearchDto(com.evolveum.midpoint.web.page.admin.reports.dto.ReportSearchDto) Table(com.evolveum.midpoint.web.component.data.Table) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ReportsStorage(com.evolveum.midpoint.web.session.ReportsStorage) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider)

Example 2 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class PageReports method searchPerformed.

private void searchPerformed(AjaxRequestTarget target) {
    ObjectQuery query = createQuery();
    ObjectDataProvider provider = getDataProvider();
    provider.setQuery(query);
    ReportsStorage storage = getSessionStorage().getReports();
    storage.setReportSearch(searchModel.getObject());
    storage.setPaging(null);
    Table table = getReportTable();
    table.setCurrentPage(null);
    target.add((Component) table);
    target.add(getFeedbackPanel());
}
Also used : Table(com.evolveum.midpoint.web.component.data.Table) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ReportsStorage(com.evolveum.midpoint.web.session.ReportsStorage) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider)

Example 3 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class PageAccounts method initLayout.

private void initLayout() {
    Form form = new Form(ID_MAIN_FORM);
    form.setOutputMarkupId(true);
    add(form);
    Form accForm = new Form(ID_FORM_ACCOUNT);
    accForm.setOutputMarkupId(true);
    add(accForm);
    Form searchForm = new Form(ID_SEARCH_FORM);
    initSearchForm(searchForm);
    searchForm.setOutputMarkupPlaceholderTag(true);
    searchForm.setOutputMarkupId(true);
    searchForm.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return resourceModel.getObject() != null;
        }
    });
    add(searchForm);
    DropDownChoice<ResourceItemDto> resources = new DropDownChoice<>(ID_RESOURCES, resourceModel, resourcesModel, new ChoiceableChoiceRenderer<ResourceItemDto>());
    form.add(resources);
    initLinks(form, accForm);
    initTotals(form);
    final AjaxDownloadBehaviorFromFile ajaxDownloadBehavior = new AjaxDownloadBehaviorFromFile(true) {

        @Override
        protected File initFile() {
            return downloadFile;
        }
    };
    ajaxDownloadBehavior.setRemoveFile(false);
    form.add(ajaxDownloadBehavior);
    WebMarkupContainer filesContainer = new WebMarkupContainer(ID_FILES_CONTAINER);
    filesContainer.setOutputMarkupId(true);
    accForm.add(filesContainer);
    ModalWindow resultPopup = createModalWindow(ID_RESULT_DIALOG, createStringResource("PageAccounts.result.popoup"), 1100, 560);
    resultPopup.setContent(new AceEditorDialog(resultPopup.getContentId()));
    add(resultPopup);
    filesModel = createFilesModel();
    ListView<String> files = new ListView<String>(ID_FILES, filesModel) {

        @Override
        protected void populateItem(final ListItem<String> item) {
            AjaxLink file = new AjaxLink(ID_FILE) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    downloadPerformed(target, item.getModelObject(), ajaxDownloadBehavior);
                }
            };
            file.add(new Label(ID_FILE_NAME, item.getModelObject()));
            item.add(file);
        }
    };
    files.setRenderBodyOnly(true);
    filesContainer.add(files);
    WebMarkupContainer accountsContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
    accountsContainer.setOutputMarkupId(true);
    accForm.add(accountsContainer);
    ObjectDataProvider provider = new ObjectDataProvider(this, ShadowType.class);
    provider.setOptions(SelectorOptions.createCollection(GetOperationOptions.createRaw()));
    provider.setQuery(ObjectQuery.createObjectQuery(createResourceQueryFilter()));
    TablePanel accounts = new TablePanel(ID_ACCOUNTS, provider, createAccountsColumns(), UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS, getItemsPerPage(UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS));
    accounts.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return resourceModel.getObject() != null;
        }
    });
    accounts.setItemsPerPage(50);
    accountsContainer.add(accounts);
}
Also used : Form(org.apache.wicket.markup.html.form.Form) AjaxDownloadBehaviorFromFile(com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile) Label(org.apache.wicket.markup.html.basic.Label) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) ResourceItemDto(com.evolveum.midpoint.web.page.admin.configuration.dto.ResourceItemDto) ListView(org.apache.wicket.markup.html.list.ListView) AceEditorDialog(com.evolveum.midpoint.web.page.admin.configuration.component.AceEditorDialog) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) ListItem(org.apache.wicket.markup.html.list.ListItem) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 4 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class PageAccounts method searchPerformed.

private void searchPerformed(AjaxRequestTarget target) {
    refreshSyncTotalsModels();
    ObjectQuery query = createObjectQuery();
    TablePanel panel = getAccountsTable();
    DataTable table = panel.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
    provider.setQuery(query);
    ConfigurationStorage storage = getSessionStorage().getConfiguration();
    storage.setAccountSearchDto(searchModel.getObject());
    storage.setAccountDetailsPaging(null);
    panel.setCurrentPage(null);
    target.add(getTotalsPanel());
    target.add(getFeedbackPanel());
    target.add(getAccountsContainer());
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ConfigurationStorage(com.evolveum.midpoint.web.session.ConfigurationStorage) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 5 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class PageAccounts method clearSearchPerformed.

private void clearSearchPerformed(AjaxRequestTarget target) {
    refreshSyncTotalsModels();
    searchModel.setObject(new AccountDetailsSearchDto());
    TablePanel panel = getAccountsTable();
    DataTable table = panel.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
    provider.setQuery(ObjectQuery.createObjectQuery(createResourceQueryFilter()));
    ConfigurationStorage storage = getSessionStorage().getConfiguration();
    storage.setAccountSearchDto(searchModel.getObject());
    storage.setAccountDetailsPaging(null);
    panel.setCurrentPage(storage.getAccountDetailsPaging());
    target.add(getTotalsPanel());
    target.add(getSearchPanel());
    target.add(getAccountsContainer());
}
Also used : AccountDetailsSearchDto(com.evolveum.midpoint.web.page.admin.configuration.dto.AccountDetailsSearchDto) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ConfigurationStorage(com.evolveum.midpoint.web.session.ConfigurationStorage) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Aggregations

ObjectDataProvider (com.evolveum.midpoint.web.component.data.ObjectDataProvider)23 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)13 DataTable (org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable)12 Table (com.evolveum.midpoint.web.component.data.Table)5 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)4 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)4 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ObjectSearchDto (com.evolveum.midpoint.web.page.admin.configuration.dto.ObjectSearchDto)2 ConfigurationStorage (com.evolveum.midpoint.web.session.ConfigurationStorage)2 ReportsStorage (com.evolveum.midpoint.web.session.ReportsStorage)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)2 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)2 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)2 Form (org.apache.wicket.markup.html.form.Form)2 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 Task (com.evolveum.midpoint.task.api.Task)1 AjaxDownloadBehaviorFromFile (com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile)1