use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugConfDialogDto in project midpoint by Evolveum.
the class PageDebugList method deleteSelectedConfirmed.
private void deleteSelectedConfirmed(AjaxRequestTarget target, List<DebugObjectItem> items) {
DebugConfDialogDto dto = confDialogModel.getObject();
OperationResult result = new OperationResult(OPERATION_DELETE_OBJECTS);
for (DebugObjectItem bean : items) {
WebModelServiceUtils.deleteObject(dto.getType(), bean.getOid(), ModelExecuteOptions.createRaw(), result, this);
}
result.computeStatusIfUnknown();
RepositoryObjectDataProvider provider = getTableDataProvider();
provider.clearCache();
showResult(result);
target.add((Component) getListTable());
target.add(getFeedbackPanel());
}
use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugConfDialogDto in project midpoint by Evolveum.
the class PageDebugList method deleteSelected.
private void deleteSelected(AjaxRequestTarget target, DebugObjectItem item) {
List<DebugObjectItem> selected = getSelectedData(target, item);
if (selected.isEmpty()) {
return;
}
DebugSearchDto searchDto = searchModel.getObject();
DebugConfDialogDto dto = new DebugConfDialogDto(DebugConfDialogDto.Operation.DELETE_SELECTED, selected, searchDto.getType().getClassDefinition());
confDialogModel.setObject(dto);
showMainPopup(getDeleteConfirmationPanel(), target);
}
use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugConfDialogDto in project midpoint by Evolveum.
the class PageDebugList method createDeleteConfirmString.
private IModel<String> createDeleteConfirmString() {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
DebugConfDialogDto dto = confDialogModel.getObject();
switch(dto.getOperation()) {
case DELETE_ALL_TYPE:
String key = ObjectTypeGuiDescriptor.getDescriptor(dto.getType()).getLocalizationKey();
String type = createStringResource(key).getString();
return createStringResource("pageDebugList.message.deleteAllType", type).getString();
case DELETE_SELECTED:
List<DebugObjectItem> selectedList = dto.getObjects();
if (selectedList.size() > 1) {
return createStringResource("pageDebugList.message.deleteSelectedConfirm", selectedList.size()).getString();
}
DebugObjectItem selectedItem = selectedList.get(0);
return createStringResource("pageDebugList.message.deleteObjectConfirm", selectedItem.getName()).getString();
case DELETE_RESOURCE_SHADOWS:
DebugSearchDto search = searchModel.getObject();
return createStringResource("pageDebugList.messsage.deleteAllResourceShadows", search.getResource().getName()).getString();
}
return "";
}
};
}
use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugConfDialogDto in project midpoint by Evolveum.
the class PageDebugList method deleteAllShadowsOnResource.
private void deleteAllShadowsOnResource(AjaxRequestTarget target) {
DebugSearchDto dto = searchModel.getObject();
if (dto.getResource() == null) {
error(getString("pageDebugList.message.resourceNotSelected"));
target.add(getFeedbackPanel());
return;
}
LOGGER.debug("Displaying delete all shadows on resource {} confirmation dialog", dto.getResource().getName());
DebugConfDialogDto dialogDto = new DebugConfDialogDto(DebugConfDialogDto.Operation.DELETE_RESOURCE_SHADOWS, null, null);
confDialogModel.setObject(dialogDto);
showMainPopup(getDeleteConfirmationPanel(), target);
}
use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugConfDialogDto in project midpoint by Evolveum.
the class PageDebugList method getDeleteConfirmationPanel.
private Popupable getDeleteConfirmationPanel() {
return new ConfirmationPanel(getMainPopupBodyId(), createDeleteConfirmString()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
DebugConfDialogDto dto = confDialogModel.getObject();
switch(dto.getOperation()) {
case DELETE_ALL_TYPE:
deleteAllTypeConfirmed(target);
break;
case DELETE_SELECTED:
deleteSelectedConfirmed(target, dto.getObjects());
break;
case DELETE_RESOURCE_SHADOWS:
deleteAllShadowsOnResourceConfirmed(target);
break;
}
}
}
@Override
public boolean getLabelEscapeModelStrings() {
return false;
}
};
}
Aggregations