Hi All,
I am copying pages from one channel to another.
while doing properties are not getting copied by default, Manually am trying to set those.
while setting those properties am getting below exception
ERROR 2020-02-20 15:04:55 Updating /hst:hst/hst:configurations/cmsdigitalcontent failed - javax.jcr.nodetype.ConstraintViolationException: Unable to perform operation. Node is protected.
code snippet:
for(NodeIterator i = resultdkNode.getNodes(); i.hasNext();){
Node nodeR = i.nextNode()
log.info(“Query1-----”+rowNode.getName())
rowNode.addNode(nodeR.getName(), “hst:component”)
// session.save()
Node targetNode = rowNode.getNode(nodeR.getName())
for(PropertyIterator p = nodeR.getProperties(); p.hasNext();){
Property prop = p.nextProperty();
if(!"jcr:uuid".equals(prop.getName())){
if(prop.isMultiple())
targetNode.setProperty(prop.getName(), prop.getValues())
else
targetNode.setProperty(prop.getName(), prop.getValue())
log.info(" Property info----"+prop.getName())
}
}
/*for(NodeIterator p = nodeR.getProperties(); p.hasNext();){
}*/
log.info("Completed-----1--")
}
thanks & regards
Ganesh