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;
}
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);
}
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);
}
Aggregations