Search in sources :

Example 6 with TaskAddResourcesDto

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);
}
Also used : ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) TaskAddResourcesDto(com.evolveum.midpoint.web.page.admin.server.dto.TaskAddResourcesDto)

Example 7 with TaskAddResourcesDto

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;
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) Task(com.evolveum.midpoint.task.api.Task) ArrayList(java.util.ArrayList) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) TaskAddResourcesDto(com.evolveum.midpoint.web.page.admin.server.dto.TaskAddResourcesDto) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery)

Aggregations

TaskAddResourcesDto (com.evolveum.midpoint.web.page.admin.server.dto.TaskAddResourcesDto)7 ArrayList (java.util.ArrayList)5 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)4 Task (com.evolveum.midpoint.task.api.Task)4 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)4 PrismObject (com.evolveum.midpoint.prism.PrismObject)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 ShadowKindType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType)3 QName (javax.xml.namespace.QName)3 RefinedResourceSchema (com.evolveum.midpoint.common.refinery.RefinedResourceSchema)2 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)2 ResourceSchema (com.evolveum.midpoint.schema.processor.ResourceSchema)2 SystemException (com.evolveum.midpoint.util.exception.SystemException)2 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)2 TaskAddDto (com.evolveum.midpoint.web.page.admin.server.dto.TaskAddDto)2 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)2 List (java.util.List)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 AjaxFormComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior)2 AutoCompleteSettings (org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings)2