use of com.evolveum.prism.xml.ns._public.types_3.ItemPathType in project midpoint by Evolveum.
the class Mapping method parseTarget.
private void parseTarget() throws SchemaException {
VariableBindingDefinitionType targetType = mappingType.getTarget();
if (targetType == null) {
outputDefinition = defaultTargetDefinition;
outputPath = defaultTargetPath;
} else {
ItemPathType itemPathType = targetType.getPath();
if (itemPathType == null) {
outputDefinition = defaultTargetDefinition;
outputPath = defaultTargetPath;
} else {
ItemPath path = itemPathType.getItemPath();
outputDefinition = ExpressionUtil.resolveDefinitionPath(path, variables, targetContext, "target definition in " + getMappingContextDescription());
if (outputDefinition == null) {
throw new SchemaException("No target item that would conform to the path " + path + " in " + getMappingContextDescription());
}
outputPath = path.stripVariableSegment();
}
}
if (stringPolicyResolver != null) {
stringPolicyResolver.setOutputDefinition(outputDefinition);
stringPolicyResolver.setOutputPath(outputPath);
}
}
use of com.evolveum.prism.xml.ns._public.types_3.ItemPathType in project midpoint by Evolveum.
the class QNameEditorPanel method getModel.
@Override
public IModel<ItemPathType> getModel() {
IModel<ItemPathType> model = super.getModel();
ItemPathType modelObject = model.getObject();
// TODO consider removing this
if (modelObject == null) {
model.setObject(new ItemPathType());
}
return model;
}
use of com.evolveum.prism.xml.ns._public.types_3.ItemPathType in project midpoint by Evolveum.
the class ItemWrapperFactoryImpl method determineShowInVirtualContainer.
private boolean determineShowInVirtualContainer(IW itemWrapper, WrapperContext context) {
Collection<VirtualContainersSpecificationType> virtualContainers = context.getVirtualContainers();
if (virtualContainers == null) {
return false;
}
for (VirtualContainersSpecificationType virtualContainer : virtualContainers) {
for (VirtualContainerItemSpecificationType item : virtualContainer.getItem()) {
ItemPathType itemPathType = item.getPath();
if (itemPathType == null) {
LOGGER.error("Bad virtual item specification, missing path. Skipping virtual item settings for {}", itemWrapper);
continue;
}
ItemPath itemPath = itemPathType.getItemPath();
if (itemPath.equivalent(itemWrapper.getPath())) {
return true;
}
}
}
return false;
}
use of com.evolveum.prism.xml.ns._public.types_3.ItemPathType in project midpoint by Evolveum.
the class InducedEntitlementsValidator method validateInducement.
private Collection<SimpleValidationError> validateInducement(AssignmentType assignment) {
List<SimpleValidationError> errors = new ArrayList<>();
// TODO impelemnt findContainer(ItemPath)
com.evolveum.midpoint.prism.Item<PrismContainerValue<ResourceObjectAssociationType>, PrismContainerDefinition<ResourceObjectAssociationType>> association = assignment.asPrismContainerValue().findItem(ItemPath.create(AssignmentType.F_CONSTRUCTION, ConstructionType.F_ASSOCIATION));
if (association != null && !association.getValues().isEmpty()) {
for (PrismContainerValue<ResourceObjectAssociationType> associationValue : association.getValues()) {
PrismContainer<MappingType> outbound = associationValue.findContainer(ResourceObjectAssociationType.F_OUTBOUND);
if (outbound == null || outbound.getValues().isEmpty()) {
SimpleValidationError error = new SimpleValidationError();
error.setMessage(PageBase.createStringResourceStatic(null, "InducedEntitlementsPanel.validator.message").getString());
ItemPathType path = new ItemPathType();
path.setItemPath(ItemPath.create(AbstractRoleType.F_INDUCEMENT, AssignmentType.F_CONSTRUCTION, ConstructionType.F_ASSOCIATION, ResourceObjectAssociationType.F_OUTBOUND));
error.setAttribute(path);
errors.add(error);
}
}
}
return errors;
}
use of com.evolveum.prism.xml.ns._public.types_3.ItemPathType in project midpoint by Evolveum.
the class SchemaDebugUtil method prettyPrint.
public static String prettyPrint(PropertyReferenceListType reflist) {
if (reflist == null) {
return "null";
}
StringBuilder sb = new StringBuilder("[");
Iterator<ItemPathType> iterator = reflist.getProperty().iterator();
while (iterator.hasNext()) {
ItemPathType xpath = iterator.next();
sb.append(xpath.toString());
if (iterator.hasNext()) {
sb.append(",");
}
}
sb.append("]");
return sb.toString();
}
Aggregations