use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.
the class TaskErrorsTabPanel method initLayout.
private void initLayout(final IModel<TaskDto> taskDtoModel, PageBase pageBase) {
ObjectDataProvider<TaskErrorDto, ObjectType> provider = new ObjectDataProvider<TaskErrorDto, ObjectType>(TaskErrorsTabPanel.this, ObjectType.class) {
private static final long serialVersionUID = 1L;
@Override
public TaskErrorDto createDataObjectWrapper(PrismObject<ObjectType> obj) {
return convertToTaskErrorDto(obj.asObjectable(), taskDtoModel);
}
@Override
public void setQuery(ObjectQuery query) {
super.setQuery(query);
}
@Override
public ObjectQuery getQuery() {
return createContentQuery(taskDtoModel.getObject().getOid(), pageBase);
}
};
TablePanel resultTablePanel = new TablePanel<>(ID_TASK_ERRORS, provider, initColumns());
resultTablePanel.setStyle("padding-top: 0px;");
resultTablePanel.setShowPaging(false);
resultTablePanel.setOutputMarkupId(true);
add(resultTablePanel);
}
use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.
the class PageCertCampaigns method deleteCampaignsPerformed.
private void deleteCampaignsPerformed(AjaxRequestTarget target, List<CertCampaignListItemDto> itemsToDelete) {
if (itemsToDelete.isEmpty()) {
warn(getString("PageCertCampaigns.message.noCampaignsSelected"));
target.add(getFeedbackPanel());
return;
}
OperationResult result = new OperationResult(OPERATION_DELETE_CAMPAIGNS);
for (CertCampaignListItemDto itemToDelete : itemsToDelete) {
try {
Task task = createSimpleTask(OPERATION_DELETE_CAMPAIGNS);
ObjectDelta<AccessCertificationCampaignType> delta = getPrismContext().deltaFactory().object().createDeleteDelta(AccessCertificationCampaignType.class, itemToDelete.getOid());
getModelService().executeChanges(MiscUtil.createCollection(delta), null, task, result);
} catch (Exception ex) {
result.recordPartialError(createStringResource("PageCertCampaigns.message.deleteCampaignsPerformed.partialError").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't delete campaign", ex);
}
}
result.recomputeStatus();
if (result.isSuccess()) {
result.recordStatus(OperationResultStatus.SUCCESS, createStringResource("PageCertCampaigns.message.deleteCampaignsPerformed.success").getString());
}
Table campaignsTable = getCampaignsTable();
ObjectDataProvider provider = (ObjectDataProvider) campaignsTable.getDataTable().getDataProvider();
provider.clearCache();
WebComponentUtil.safeResultCleanup(result, LOGGER);
showResult(result);
target.add(getFeedbackPanel(), (Component) campaignsTable);
}
use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.
the class OrgUnitAddDeletePopup method setState.
public void setState(ActionState state, AjaxRequestTarget target) {
this.state = state;
AjaxButton actionButton = (AjaxButton) getContent().get(ID_BUTTON_ACTION);
actionButton.setModel(createActionButtonStringResource());
actionButton.add(new AttributeAppender("class", getActionButtonClass()));
target.add(actionButton);
TablePanel panel = getTable();
DataTable table = panel.getDataTable();
ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
provider.setQuery(getDataProviderQuery());
target.add(panel);
}
Aggregations