use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class TaskWfChildPanel method initLayout.
private void initLayout(final IModel<TaskDto> taskDtoModel) {
changesModel = new PropertyModel<>(taskDtoModel, TaskDto.F_CHANGE_BEING_APPROVED);
TaskChangesPanel changesPanel = new TaskChangesPanel(ID_CHANGES, changesModel);
changesPanel.setOutputMarkupId(true);
add(changesPanel);
final ItemApprovalHistoryPanel history = new ItemApprovalHistoryPanel(ID_HISTORY, new PropertyModel<>(taskDtoModel, TaskDto.F_WORKFLOW_CONTEXT), UserProfileStorage.TableId.PAGE_TASK_HISTORY_PANEL, (int) parentPage.getItemsPerPage(UserProfileStorage.TableId.PAGE_TASK_HISTORY_PANEL));
history.setOutputMarkupId(true);
add(history);
add(WebComponentUtil.createHelp(ID_HISTORY_HELP));
WebMarkupContainer workItemsContainer = new WebMarkupContainer(ID_CURRENT_WORK_ITEMS_CONTAINER);
final ISortableDataProvider<WorkItemDto, String> provider = new ListDataProvider(this, new PropertyModel<List<WorkItemDto>>(taskDtoModel, TaskDto.F_WORK_ITEMS));
final WorkItemsPanel workItemsPanel = new WorkItemsPanel(ID_CURRENT_WORK_ITEMS, provider, UserProfileStorage.TableId.PAGE_TASK_CURRENT_WORK_ITEMS_PANEL, (int) parentPage.getItemsPerPage(UserProfileStorage.TableId.PAGE_TASK_CURRENT_WORK_ITEMS_PANEL), WorkItemsPanel.View.ITEMS_FOR_PROCESS);
workItemsPanel.setOutputMarkupId(true);
workItemsContainer.add(workItemsPanel);
workItemsContainer.setOutputMarkupId(true);
workItemsContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return provider.size() > 0;
}
});
workItemsContainer.add(WebComponentUtil.createHelp(ID_CURRENT_WORK_ITEMS_HELP));
add(workItemsContainer);
final PropertyModel<List<ProcessInstanceDto>> relatedRequestsModel = new PropertyModel<>(taskDtoModel, TaskDto.F_WORKFLOW_REQUESTS);
WebMarkupContainer relatedRequestsContainer = new WebMarkupContainer(ID_RELATED_REQUESTS_CONTAINER);
relatedRequestsContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(relatedRequestsModel.getObject());
}
});
relatedRequestsContainer.setOutputMarkupId(true);
add(relatedRequestsContainer);
ISortableDataProvider<ProcessInstanceDto, String> requestsProvider = new ListDataProvider(this, relatedRequestsModel);
relatedRequestsContainer.add(new ProcessInstancesPanel(ID_RELATED_REQUESTS, requestsProvider, null, 10, ProcessInstancesPanel.View.TASKS_FOR_PROCESS, null));
relatedRequestsContainer.add(WebComponentUtil.createHelp(ID_RELATED_REQUESTS_HELP));
add(new AjaxFallbackLink(ID_SHOW_PARENT) {
public void onClick(AjaxRequestTarget target) {
String oid = taskDtoModel.getObject().getParentTaskOid();
if (oid != null) {
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, oid);
((PageBase) getPage()).navigateToNext(PageTaskEdit.class, parameters);
}
}
});
add(WebComponentUtil.createHelp(ID_SHOW_PARENT_HELP));
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class TaskWfParentPanel method initLayout.
private void initLayout(final IModel<TaskDto> taskDtoModel) {
final PropertyModel<List<ProcessInstanceDto>> requestsModel = new PropertyModel<>(taskDtoModel, TaskDto.F_WORKFLOW_REQUESTS);
final ISortableDataProvider<ProcessInstanceDto, String> requestsProvider = new ListDataProvider<>(this, requestsModel);
processInstancesPanel = new ProcessInstancesPanel(ID_REQUESTS, requestsProvider, null, 10, ProcessInstancesPanel.View.TASKS_FOR_PROCESS, null);
processInstancesPanel.setOutputMarkupId(true);
add(processInstancesPanel);
add(WebComponentUtil.createHelp(ID_REQUESTS_HELP));
changesContainer = new WebMarkupContainer(ID_CHANGES_CONTAINER);
for (int i = 1; i <= CHANGES_NUMBER; i++) {
final int index = i;
final String changesId = ID_CHANGES_PREFIX + i;
final String changesContentId = changesId + ID_CHANGES_CONTENT_SUFFIX;
final WebMarkupContainer changes = new WebMarkupContainer(changesId);
final IModel<TaskChangesDto> changesModel = new AbstractReadOnlyModel<TaskChangesDto>() {
@Override
public TaskChangesDto getObject() {
return taskDtoModel.getObject().getChangesForIndex(index);
}
};
final TaskChangesPanel changesPanel = new TaskChangesPanel(changesContentId, changesModel);
changes.add(changesPanel);
changes.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return changesModel.getObject() != null;
}
});
changesContainer.add(changes);
}
changesContainer.setOutputMarkupId(true);
add(changesContainer);
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class ActionsExecutedInformationPanel method initLayout.
protected void initLayout() {
WebMarkupContainer tableLinesContainer = new WebMarkupContainer(ID_OBJECTS_TABLE_LINES_CONTAINER);
ListView tableLines = new ListView<ActionsExecutedObjectsTableLineDto>(ID_OBJECTS_TABLE_LINES, new AbstractReadOnlyModel<List<ActionsExecutedObjectsTableLineDto>>() {
@Override
public List<ActionsExecutedObjectsTableLineDto> getObject() {
final ActionsExecutedInformationDto modelObject = getModelObject();
if (modelObject == null) {
return new ArrayList<>();
}
if (showResultingActionsOnly) {
return modelObject.getUniqueObjectsTableLines();
} else {
return modelObject.getObjectsTableLines();
}
}
}) {
protected void populateItem(final ListItem<ActionsExecutedObjectsTableLineDto> item) {
item.add(new Label(ID_OBJECT_TYPE, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
String key = item.getModelObject().getObjectTypeLocalizationKey();
if (key != null) {
return createStringResource(key).getString();
} else {
return item.getModelObject().getObjectType().getLocalPart();
}
}
}));
item.add(new Label(ID_OPERATION, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return createStringResource(item.getModelObject().getOperation()).getString();
}
}));
item.add(new Label(ID_CHANNEL, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
String channel = item.getModelObject().getChannel();
if (channel != null && !channel.isEmpty()) {
String key = "Channel." + channel;
return createStringResource(key).getString();
} else {
return "";
}
}
}));
item.add(new Label(ID_SUCCESS_COUNT, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_SUCCESS_COUNT)));
item.add(new Label(ID_LAST_SUCCESS_OBJECT, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_LAST_SUCCESS_OBJECT)));
item.add(new Label(ID_LAST_SUCCESS_TIMESTAMP, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_LAST_SUCCESS_TIMESTAMP)));
item.add(new Label(ID_FAILURE_COUNT, new PropertyModel<String>(item.getModel(), ActionsExecutedObjectsTableLineDto.F_FAILURE_COUNT)));
}
};
tableLinesContainer.add(tableLines);
tableLinesContainer.setOutputMarkupId(true);
add(tableLinesContainer);
final Label showResultingActionsOnlyLabel = new Label(ID_SHOW_RESULTING_ACTIONS_ONLY_LABEL, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return showResultingActionsOnly ? createStringResource("ActionsExecutedInformationPanel.showingResultingActionsOnly").getString() : createStringResource("ActionsExecutedInformationPanel.showingAllActions").getString();
}
});
showResultingActionsOnlyLabel.setOutputMarkupId(true);
add(showResultingActionsOnlyLabel);
add(new AjaxFallbackLink<String>(ID_SHOW_RESULTING_ACTIONS_ONLY_LINK) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
showResultingActionsOnly = !showResultingActionsOnly;
ajaxRequestTarget.add(ActionsExecutedInformationPanel.this);
}
});
add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getModelObject() != null;
}
});
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class SynchronizationInformationPanel method initLayout.
protected void initLayout(final boolean useAfter) {
WebMarkupContainer titleBefore = new WebMarkupContainer(ID_TITLE_BEFORE);
titleBefore.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !useAfter;
}
});
add(titleBefore);
WebMarkupContainer titleAfter = new WebMarkupContainer(ID_TITLE_AFTER);
titleAfter.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return useAfter;
}
});
add(titleAfter);
Label aProtected = new Label(ID_PROTECTED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_PROTECTED));
add(aProtected);
Label noSync = new Label(ID_NO_SYNCHRONIZATION_POLICY, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_NO_SYNCHRONIZATION_POLICY));
add(noSync);
Label syncDisabled = new Label(ID_SYNCHRONIZATION_DISABLED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_SYNCHRONIZATION_DISABLED));
add(syncDisabled);
Label notAppl = new Label(ID_NOT_APPLICABLE_FOR_TASK, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_NOT_APPLICABLE_FOR_TASK));
add(notAppl);
Label deleted = new Label(ID_DELETED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_DELETED));
add(deleted);
Label disputed = new Label(ID_DISPUTED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_DISPUTED));
add(disputed);
Label linked = new Label(ID_LINKED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_LINKED));
add(linked);
Label unlinked = new Label(ID_UNLINKED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_UNLINKED));
add(unlinked);
Label unmatched = new Label(ID_UNMATCHED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_UNMATCHED));
add(unmatched);
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class TaskBasicTabPanel method initLayoutBasic.
private void initLayoutBasic() {
// Name
WebMarkupContainer nameContainer = new WebMarkupContainer(ID_NAME_CONTAINER);
RequiredTextField<String> name = new RequiredTextField<>(ID_NAME, new PropertyModel<String>(taskDtoModel, TaskDto.F_NAME));
name.add(parentPage.createEnabledIfEdit(new ItemPath(TaskType.F_NAME)));
name.add(new AttributeModifier("style", "width: 100%"));
name.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
nameContainer.add(name);
nameContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_NAME)));
add(nameContainer);
// Description
WebMarkupContainer descriptionContainer = new WebMarkupContainer(ID_DESCRIPTION_CONTAINER);
TextArea<String> description = new TextArea<>(ID_DESCRIPTION, new PropertyModel<String>(taskDtoModel, TaskDto.F_DESCRIPTION));
description.add(parentPage.createEnabledIfEdit(new ItemPath(TaskType.F_DESCRIPTION)));
// description.add(new AttributeModifier("style", "width: 100%"));
// description.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
descriptionContainer.add(description);
descriptionContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_DESCRIPTION)));
add(descriptionContainer);
// OID
Label oid = new Label(ID_OID, new PropertyModel(getObjectWrapperModel(), ID_OID));
add(oid);
// Identifier
WebMarkupContainer identifierContainer = new WebMarkupContainer(ID_IDENTIFIER_CONTAINER);
identifierContainer.add(new Label(ID_IDENTIFIER, new PropertyModel(taskDtoModel, TaskDto.F_IDENTIFIER)));
identifierContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_TASK_IDENTIFIER)));
add(identifierContainer);
// Category
WebMarkupContainer categoryContainer = new WebMarkupContainer(ID_CATEGORY_CONTAINER);
categoryContainer.add(new Label(ID_CATEGORY, WebComponentUtil.createCategoryNameModel(this, new PropertyModel(taskDtoModel, TaskDto.F_CATEGORY))));
categoryContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_CATEGORY)));
add(categoryContainer);
// Parent
WebMarkupContainer parentContainer = new WebMarkupContainer(ID_PARENT_CONTAINER);
final LinkPanel parent = new LinkPanel(ID_PARENT, new PropertyModel<String>(taskDtoModel, TaskDto.F_PARENT_TASK_NAME)) {
@Override
public void onClick(AjaxRequestTarget target) {
String oid = taskDtoModel.getObject().getParentTaskOid();
if (oid != null) {
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, oid);
getPageBase().navigateToNext(PageTaskEdit.class, parameters);
}
}
};
parentContainer.add(parent);
parentContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_PARENT)));
add(parentContainer);
// Owner
WebMarkupContainer ownerContainer = new WebMarkupContainer(ID_OWNER_CONTAINER);
final LinkPanel owner = new LinkPanel(ID_OWNER, new PropertyModel<String>(taskDtoModel, TaskDto.F_OWNER_NAME)) {
@Override
public void onClick(AjaxRequestTarget target) {
String oid = taskDtoModel.getObject().getOwnerOid();
if (oid != null) {
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, oid);
getPageBase().navigateToNext(PageUser.class, parameters);
}
}
};
ownerContainer.add(owner);
ownerContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_OWNER_REF)));
add(ownerContainer);
// Handler URI
ListView<String> handlerUriContainer = new ListView<String>(ID_HANDLER_URI_CONTAINER, new PropertyModel(taskDtoModel, TaskDto.F_HANDLER_URI_LIST)) {
@Override
protected void populateItem(ListItem<String> item) {
item.add(new Label(ID_HANDLER_URI, item.getModelObject()));
}
};
handlerUriContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_HANDLER_URI), new ItemPath(TaskType.F_OTHER_HANDLERS_URI_STACK)));
add(handlerUriContainer);
// Execution
WebMarkupContainer executionContainer = new WebMarkupContainer(ID_EXECUTION_CONTAINER);
Label execution = new Label(ID_EXECUTION, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
TaskDtoExecutionStatus executionStatus = taskDtoModel.getObject().getExecution();
if (executionStatus != TaskDtoExecutionStatus.CLOSED) {
return getString(TaskDtoExecutionStatus.class.getSimpleName() + "." + executionStatus.name());
} else {
return getString(TaskDtoExecutionStatus.class.getSimpleName() + "." + executionStatus.name() + ".withTimestamp", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (taskDtoModel.getObject().getCompletionTimestamp() != null) {
// todo correct formatting
return new Date(taskDtoModel.getObject().getCompletionTimestamp()).toLocaleString();
} else {
return "?";
}
}
});
}
}
});
executionContainer.add(execution);
Label node = new Label(ID_NODE, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
TaskDto dto = taskDtoModel.getObject();
if (!TaskDtoExecutionStatus.RUNNING.equals(dto.getExecution())) {
return null;
}
return parentPage.getString("pageTaskEdit.message.node", dto.getExecutingAt());
}
});
executionContainer.add(node);
executionContainer.add(parentPage.createVisibleIfAccessible(new ItemPath(TaskType.F_EXECUTION_STATUS), new ItemPath(TaskType.F_NODE_AS_OBSERVED)));
add(executionContainer);
}
Aggregations