use of com.evolveum.midpoint.web.session.TasksStorage in project midpoint by Evolveum.
the class PageTasks method searchFilterPerformed.
private void searchFilterPerformed(AjaxRequestTarget target) {
TasksSearchDto dto = searchModel.getObject();
// ObjectQuery query = createTaskQuery(dto.getStatus(), dto.getCategory(), dto.isShowSubtasks());
ObjectQuery query = createTaskQuery();
Table panel = getTaskTable();
DataTable table = panel.getDataTable();
TaskDtoProvider provider = (TaskDtoProvider) table.getDataProvider();
provider.setQuery(query);
table.setCurrentPage(0);
TasksStorage storage = getSessionStorage().getTasks();
storage.setTasksSearch(dto);
target.add(getFeedbackPanel());
target.add((Component) getTaskTable());
}
use of com.evolveum.midpoint.web.session.TasksStorage in project midpoint by Evolveum.
the class PageTasks method clearSearchPerformed.
private void clearSearchPerformed(AjaxRequestTarget target) {
TasksSearchDto tasksSearchDto = new TasksSearchDto();
tasksSearchDto.setCategory(ALL_CATEGORIES);
tasksSearchDto.setStatus(TaskDtoExecutionStatusFilter.ALL);
searchModel.setObject(tasksSearchDto);
Table panel = getTaskTable();
DataTable table = panel.getDataTable();
TaskDtoProvider provider = (TaskDtoProvider) table.getDataProvider();
provider.setQuery(null);
TasksStorage storage = getSessionStorage().getTasks();
storage.setTasksSearch(searchModel.getObject());
panel.setCurrentPage(storage.getPaging());
target.add((Component) panel);
}
use of com.evolveum.midpoint.web.session.TasksStorage in project midpoint by Evolveum.
the class PageTasks method loadTasksSearchDto.
private TasksSearchDto loadTasksSearchDto() {
TasksStorage storage = getSessionStorage().getTasks();
TasksSearchDto dto = storage.getTasksSearch();
if (dto == null) {
dto = new TasksSearchDto();
dto.setShowSubtasks(false);
}
if (getPageParameters() != null) {
StringValue category = getPageParameters().get(SELECTED_CATEGORY);
if (category != null && category.toString() != null && !category.toString().isEmpty()) {
dto.setCategory(category.toString());
}
}
if (dto.getStatus() == null) {
dto.setStatus(TaskDtoExecutionStatusFilter.ALL);
}
return dto;
}
use of com.evolveum.midpoint.web.session.TasksStorage in project midpoint by Evolveum.
the class PageTasks method initLayout.
private void initLayout() {
refreshPanel = new AutoRefreshPanel(ID_REFRESH_PANEL, refreshModel, this, false);
add(refreshPanel);
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
List<IColumn<TaskDto, String>> taskColumns = initTaskColumns();
TaskDtoProviderOptions options = TaskDtoProviderOptions.minimalOptions();
options.setGetNextRunStartTime(true);
options.setUseClusterInformation(true);
options.setResolveObjectRef(true);
TaskDtoProvider provider = new TaskDtoProvider(PageTasks.this, options) {
@Override
protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
TasksStorage storage = getSessionStorage().getTasks();
storage.setPaging(paging);
}
@Override
public TaskDto createTaskDto(PrismObject<TaskType> task, Task opTask, OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException {
TaskDto dto = super.createTaskDto(task, opTask, result);
addInlineMenuToTaskRow(dto);
return dto;
}
};
provider.setQuery(createTaskQuery());
BoxedTablePanel<TaskDto> taskTable = new BoxedTablePanel(ID_TASK_TABLE, provider, taskColumns, UserProfileStorage.TableId.PAGE_TASKS_PANEL, (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_TASKS_PANEL)) {
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new SearchFragment(headerId, ID_TABLE_HEADER, PageTasks.this, searchModel);
}
@Override
protected WebMarkupContainer createButtonToolbar(String id) {
String fileName = "TaskType_" + createStringResource("MainObjectListPanel.exportFileName").getString();
CSVDataExporter csvDataExporter = new CSVDataExporter();
ResourceStreamResource resource = (new ResourceStreamResource() {
protected IResourceStream getResourceStream() {
return new ExportToolbar.DataExportResourceStreamWriter(csvDataExporter, getTaskTable().getDataTable());
}
}).setFileName(fileName + "." + csvDataExporter.getFileNameExtension());
AbstractLink exportDataLink = (new ResourceLink(id, resource)).setBody(csvDataExporter.getDataFormatNameModel());
exportDataLink.add(new AttributeAppender("class", " btn btn-primary btn-sm"));
return exportDataLink;
}
};
taskTable.setOutputMarkupId(true);
TasksStorage storage = getSessionStorage().getTasks();
taskTable.setCurrentPage(storage.getPaging());
mainForm.add(taskTable);
List<IColumn<NodeDto, String>> nodeColumns = initNodeColumns();
BoxedTablePanel nodeTable = new BoxedTablePanel(ID_NODE_TABLE, new NodeDtoProvider(PageTasks.this) {
@Override
public NodeDto createNodeDto(PrismObject<NodeType> node) {
NodeDto dto = super.createNodeDto(node);
addInlineMenuToNodeRow(dto);
return dto;
}
}, nodeColumns, UserProfileStorage.TableId.PAGE_TASKS_NODES_PANEL, (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_TASKS_NODES_PANEL));
nodeTable.setOutputMarkupId(true);
nodeTable.setShowPaging(false);
mainForm.add(nodeTable);
initDiagnosticButtons();
}
Aggregations