Search in sources :

Example 6 with CapabilityDto

use of com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto in project midpoint by Evolveum.

the class AddCapabilityDialog method loadModel.

private List<CapabilityDto<CapabilityType>> loadModel(IModel<CapabilityStepDto> capabilityModel) {
    List<Class<? extends CapabilityType>> existingCapabilityClasses = new ArrayList<>();
    for (CapabilityDto cap : capabilityModel.getObject().getCapabilities()) {
        existingCapabilityClasses.add(cap.getCapability().getClass());
    }
    List<CapabilityDto<CapabilityType>> rv = new ArrayList<>();
    for (Capability supportedCapability : Capability.values()) {
        if (!existingCapabilityClasses.contains(supportedCapability.getClazz())) {
            // 'among natives' doesn't matter here
            rv.add(new CapabilityDto<>(CapabilityStep.fillDefaults(supportedCapability.newInstance()), false));
        }
    }
    return rv;
}
Also used : CapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CapabilityType) Capability(com.evolveum.midpoint.web.component.wizard.resource.dto.Capability) CapabilityDto(com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto) ArrayList(java.util.ArrayList)

Example 7 with CapabilityDto

use of com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto in project midpoint by Evolveum.

the class CapabilityScriptPanel method prepareOnResourceModel.

private IModel prepareOnResourceModel() {
    CapabilityDto dto = (CapabilityDto) getModel().getObject();
    ScriptCapabilityType script = (ScriptCapabilityType) dto.getCapability();
    for (ScriptCapabilityType.Host host : script.getHost()) {
        if (ProvisioningScriptHostType.RESOURCE.equals(host.getType())) {
            return new PropertyModel<List<String>>(host, "language");
        }
    }
    List<String> emptyList = new ArrayList<>();
    return Model.of(emptyList);
}
Also used : ScriptCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType) CapabilityDto(com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto) PropertyModel(org.apache.wicket.model.PropertyModel) ArrayList(java.util.ArrayList)

Example 8 with CapabilityDto

use of com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto in project midpoint by Evolveum.

the class CapabilityScriptPanel method prepareOnConnectorModel.

private IModel prepareOnConnectorModel() {
    CapabilityDto dto = (CapabilityDto) getModel().getObject();
    ScriptCapabilityType script = (ScriptCapabilityType) dto.getCapability();
    for (ScriptCapabilityType.Host host : script.getHost()) {
        if (ProvisioningScriptHostType.CONNECTOR.equals(host.getType())) {
            return new PropertyModel<List<String>>(host, "language");
        }
    }
    List<String> emptyList = new ArrayList<>();
    return Model.of(emptyList);
}
Also used : ScriptCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType) CapabilityDto(com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto) PropertyModel(org.apache.wicket.model.PropertyModel) ArrayList(java.util.ArrayList)

Aggregations

CapabilityDto (com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto)8 PrismObject (com.evolveum.midpoint.prism.PrismObject)3 ArrayList (java.util.ArrayList)3 PropertyModel (org.apache.wicket.model.PropertyModel)3 CapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CapabilityType)2 ScriptCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)2 RefinedResourceSchema (com.evolveum.midpoint.common.refinery.RefinedResourceSchema)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 NonEmptyLoadableModel (com.evolveum.midpoint.gui.api.model.NonEmptyLoadableModel)1 ModelService (com.evolveum.midpoint.model.api.ModelService)1 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)1 ObjectClassComplexTypeDefinition (com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition)1 ResourceAttributeDefinition (com.evolveum.midpoint.schema.processor.ResourceAttributeDefinition)1 ResourceSchema (com.evolveum.midpoint.schema.processor.ResourceSchema)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1 CommonException (com.evolveum.midpoint.util.exception.CommonException)1