use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto in project midpoint by Evolveum.
the class PageDebugList method deleteAllTypeConfirmed.
private void deleteAllTypeConfirmed(AjaxRequestTarget target) {
DebugSearchDto dto = searchModel.getObject();
LOGGER.debug("Deleting all of type {}", dto.getType());
OperationResult result = new OperationResult(OPERATION_DELETE_OBJECTS);
String taskOid = null;
try {
ObjectQuery query = null;
if (ObjectTypes.USER.equals(dto.getType())) {
query = createDeleteAllUsersQuery();
}
QName type = dto.getType().getTypeQName();
taskOid = deleteObjectsAsync(type, query, true, "Delete all of type " + type.getLocalPart(), result);
info(getString("pageDebugList.messsage.deleteAllOfType", dto.getType()));
} catch (Exception ex) {
result.recomputeStatus();
result.recordFatalError("Couldn't delete objects of type " + dto.getType(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't delete objects of type " + dto.getType(), ex);
}
showResult(result);
if (taskOid != null) {
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, taskOid);
navigateToNext(PageTaskEdit.class, parameters);
} else {
navigateToNext(PageTasks.class);
}
target.add(getFeedbackPanel());
}
use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto in project midpoint by Evolveum.
the class PageDebugList method initInlineMenu.
private List<InlineMenuItem> initInlineMenu() {
List<InlineMenuItem> headerMenuItems = new ArrayList<>();
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.exportSelected"), true, new HeaderMenuAction(this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
exportSelected(target, null);
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.exportAllSelectedType"), true, new HeaderMenuAction(this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
exportAllType(target);
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.exportShadowsOnResource"), new Model(true), new AbstractReadOnlyModel<Boolean>() {
@Override
public Boolean getObject() {
DebugSearchDto dto = searchModel.getObject();
return ObjectTypes.SHADOW.equals(dto.getType());
}
}, false, new HeaderMenuAction(this) {
@Override
public void onClick(AjaxRequestTarget target) {
exportAllShadowsOnResource(target);
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.exportAll"), true, new HeaderMenuAction(this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
exportAll(target);
}
}));
headerMenuItems.add(new InlineMenuItem());
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.deleteSelected"), true, new HeaderMenuAction(this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
deleteSelected(target, null);
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.deleteAllType"), true, new HeaderMenuAction(this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
deleteAllType(target);
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.deleteShadowsOnResource"), new Model(true), new AbstractReadOnlyModel<Boolean>() {
@Override
public Boolean getObject() {
DebugSearchDto dto = searchModel.getObject();
return ObjectTypes.SHADOW.equals(dto.getType());
}
}, false, new HeaderMenuAction(this) {
@Override
public void onClick(AjaxRequestTarget target) {
deleteAllShadowsOnResource(target);
}
}));
headerMenuItems.add(new InlineMenuItem());
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.deleteAllIdentities"), true, new HeaderMenuAction(this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
deleteAllIdentities(target);
}
}));
return headerMenuItems;
}
use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto 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.DebugSearchDto in project midpoint by Evolveum.
the class PageDebugList method exportAllShadowsOnResource.
private void exportAllShadowsOnResource(AjaxRequestTarget target) {
DebugSearchDto dto = searchModel.getObject();
if (dto.getResource() == null) {
error(getString("pageDebugList.message.resourceNotSelected"));
target.add(getFeedbackPanel());
return;
}
ObjectQuery objectQuery = QueryBuilder.queryFor(ShadowType.class, getPrismContext()).item(ShadowType.F_RESOURCE_REF).ref(dto.getResource().getOid()).build();
initDownload(target, dto.getType().getClassDefinition(), objectQuery);
}
use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto 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);
}
Aggregations