Skip to content

Commit

Permalink
setting readonly state recursively for ContainerValueWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 23, 2018
1 parent 18e4df9 commit e8a0f42
Showing 1 changed file with 9 additions and 5 deletions.
Expand Up @@ -232,7 +232,6 @@ public <C extends Containerable> ContainerWrapper<C> createContainerWrapper(Obje
List<ContainerValueWrapper<C>> containerValues = createContainerValues(cWrapper, path, task);
cWrapper.setProperties(containerValues);
cWrapper.computeStripes();


return cWrapper;
}
Expand All @@ -244,23 +243,28 @@ private <C extends Containerable> List<ContainerValueWrapper<C>> createContainer
if (container.getValues().isEmpty() && container.isSingleValue()) {
PrismContainerValue<C> pcv = container.createNewValue();
ContainerValueWrapper<C> containerValueWrapper = createContainerValueWrapper(cWrapper, pcv, cWrapper.getObjectStatus(), ValueStatus.ADDED, cWrapper.getPath(), task);

if (cWrapper.isReadonly()) {
containerValueWrapper.setReadonly(cWrapper.isReadonly(), true);
}
containerValueWrappers.add(containerValueWrapper);
return containerValueWrappers;
}

container.getValues().forEach(pcv -> {
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);
if (cWrapper.isReadonly()) {
containerValueWrapper.setReadonly(cWrapper.isReadonly(), true);
}
containerValueWrappers.add(containerValueWrapper);
});


return containerValueWrappers;
}
Expand Down

0 comments on commit e8a0f42

Please sign in to comment.