Skip to content

Commit

Permalink
Merge branch 'support-3.8' of https://github.com/Evolveum/midpoint in…
Browse files Browse the repository at this point in the history
…to support-3.8
  • Loading branch information
KaterynaHonchar committed Oct 12, 2018
2 parents c298e96 + 8eb1e1e commit 10bd351
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Expand Up @@ -411,7 +411,6 @@ public PrismContainerValue<C> createContainerValueAddDelta() throws SchemaExcept
} else {

PropertyOrReferenceWrapper propOrRef = (PropertyOrReferenceWrapper) item;
ItemPath path = propOrRef.getPath();
ItemDelta itemDelta = collectAddModifications(propOrRef);

ItemPath itemPath = itemDelta.getParentPath().remainder(getContainer().getPath());
Expand Down
Expand Up @@ -250,7 +250,14 @@ private <C extends Containerable> List<ContainerValueWrapper<C>> createContainer
}

container.getValues().forEach(pcv -> {
ContainerValueWrapper<C> containerValueWrapper = createContainerValueWrapper(cWrapper, pcv, cWrapper.getObjectStatus(), cWrapper.getStatus() == ContainerStatus.ADDING ? ValueStatus.ADDED : ValueStatus.NOT_CHANGED, pcv.getPath(), task);
ValueStatus status = ValueStatus.NOT_CHANGED;
ItemPath pcvPath = pcv.getPath();
if (cWrapper.getStatus() == ContainerStatus.ADDING) {
status = ValueStatus.ADDED;
pcvPath = cWrapper.getPath();
}

ContainerValueWrapper<C> containerValueWrapper = createContainerValueWrapper(cWrapper, pcv, cWrapper.getObjectStatus(), status, pcvPath, task);
containerValueWrappers.add(containerValueWrapper);
});

Expand Down Expand Up @@ -388,7 +395,7 @@ private <T, C extends Containerable> PropertyWrapper<T> createPropertyWrapper(
PrismProperty<T> newProperty = def.instantiate();
// We cannot just get path from newProperty.getPath(). The property is not added to the container, so it does not know its path.
// Definitions are reusable, they do not have paths either.
ItemPath propPath = containerValue.getPath().subPath(newProperty.getElementName());
ItemPath propPath = cWrapper.getPath().subPath(newProperty.getElementName());
return new PropertyWrapper(cWrapper, newProperty, propertyIsReadOnly, ValueStatus.ADDED, propPath);
}
return new PropertyWrapper(cWrapper, property, propertyIsReadOnly, cWrapper.getStatus() == ValueStatus.ADDED ? ValueStatus.ADDED: ValueStatus.NOT_CHANGED, property.getPath());
Expand Down Expand Up @@ -420,9 +427,9 @@ private <C extends Containerable> ReferenceWrapper createReferenceWrapper(PrismR
if (QNameUtil.match(AbstractRoleType.F_APPROVER_REF, def.getName()) || QNameUtil.match(AbstractRoleType.F_APPROVER_REF, def.getName())) {
refWrapper.setTargetTypes(Arrays.asList(FocusType.COMPLEX_TYPE, OrgType.COMPLEX_TYPE));
} else {

QName targetType = def.getTargetTypeName();

if (targetType == null || ObjectType.COMPLEX_TYPE.equals(targetType)) {
refWrapper.setTargetTypes(WebComponentUtil.createObjectTypeList());
} else if (AbstractRoleType.COMPLEX_TYPE.equals(targetType)) {
Expand Down
Expand Up @@ -1379,10 +1379,10 @@ private <T, O extends ObjectType> boolean validateValue(PrismObject<O> object, V

private <O extends ObjectType> AbstractValuePolicyOriginResolver<O> getOriginResolver(PrismObject<O> object) {
if (object != null && UserType.class.equals(object.getCompileTimeClass())) {
new UserValuePolicyOriginResolver((PrismObject<UserType>) object, objectResolver);
return (AbstractValuePolicyOriginResolver) new UserValuePolicyOriginResolver((PrismObject<UserType>) object, objectResolver);
}

//TODO not supported yet
//TODO not supported yet, throw exception instead of null???
return null;
}

Expand Down

0 comments on commit 10bd351

Please sign in to comment.