}
DavPropertyName propName = property.getName();
if (JCR_MIXINNODETYPES.equals(propName)) {
Node n = (Node) item;
try {
NodeTypeProperty mix = new NodeTypeProperty(property);
Set<String> mixins = mix.getNodeTypeNames();
for (NodeType existingMixin : n.getMixinNodeTypes()) {
String name = existingMixin.getName();
if (mixins.contains(name)){
// do not add existing mixins
mixins.remove(name);
} else {
// remove mixin that are not contained in the new list
n.removeMixin(name);
}
}
// add the remaining mixing types that are not yet set
for (String mixin : mixins) {
n.addMixin(mixin);
}
} catch (RepositoryException e) {
throw new JcrDavException(e);
}
} else if (JCR_PRIMARYNODETYPE.equals(propName)) {
Node n = (Node) item;
try {
NodeTypeProperty ntProp = new NodeTypeProperty(property);
Set<String> names = ntProp.getNodeTypeNames();
if (names.size() == 1) {
String ntName = names.iterator().next();
n.setPrimaryType(ntName);
} else {
// only a single node type can be primary node type.