use of com.evolveum.midpoint.web.page.admin.server.dto.TaskAddResourcesDto in project midpoint by Evolveum.
the class ResourceRelatedHandlerDto method fillInResourceReference.
private void fillInResourceReference(TaskType task, PageBase pageBase, Task opTask, OperationResult result) {
ObjectReferenceType ref = task.getObjectRef();
if (ref != null && ResourceType.COMPLEX_TYPE.equals(ref.getType())) {
resourceRef = new TaskAddResourcesDto(ref.getOid(), taskDto.getTaskObjectName(task, pageBase, opTask, result));
}
updateObjectClassList(pageBase);
}
use of com.evolveum.midpoint.web.page.admin.server.dto.TaskAddResourcesDto in project midpoint by Evolveum.
the class ResourceRelatedHandlerPanel method createResourceList.
private List<TaskAddResourcesDto> createResourceList() {
OperationResult result = new OperationResult(OPERATION_LOAD_RESOURCES);
Task task = parentPage.createSimpleTask(OPERATION_LOAD_RESOURCES);
List<PrismObject<ResourceType>> resources = null;
List<TaskAddResourcesDto> resourceList = new ArrayList<>();
try {
resources = parentPage.getModelService().searchObjects(ResourceType.class, new ObjectQuery(), null, task, result);
result.recomputeStatus();
} catch (Exception ex) {
result.recordFatalError("Couldn't get resource list.", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get resource list", ex);
}
if (resources != null) {
ResourceType item = null;
for (PrismObject<ResourceType> resource : resources) {
item = resource.asObjectable();
resourceList.add(new TaskAddResourcesDto(item.getOid(), WebComponentUtil.getOrigStringFromPoly(item.getName())));
}
}
return resourceList;
}
Aggregations