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);
}
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());
}
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);
}
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());
}
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());
}
Aggregations