in vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewImporter.java [357:424]
public void startDocViewNode(@NotNull String nodePath, @NotNull DocViewNode2 docViewNode, @NotNull Optional<DocViewNode2> parentDocViewNode, int line, int column) throws IOException, RepositoryException {
stack.addName(docViewNode.getSnsAwareName());
Node node = stack.getNode();
if (node == null) {
stack = stack.push();
DocViewAdapter xform = stack.getAdapter();
if (xform != null) {
xform.startNode(docViewNode);
} else {
log.trace("Skipping ignored node {}", docViewNode); // TODO: clarify what this means
}
} else {
if (docViewNode.getProperties().isEmpty()) {
// only ordering node. skip
log.trace("Skipping empty node {}", nodePath);
stack = stack.push();
return;
} else if (docViewNode.getIndex() > 1 && !isSnsSupported) {
//skip SNS nodes with index > 1
log.warn("Skipping unsupported SNS node with index > 1. Some content will be missing after import: {}", nodePath);
stack = stack.push();
return;
}
try {
// is policy node?
if (docViewNode.getPrimaryType().filter(aclManagement::isACLNodeType).isPresent()) {
AccessControlHandling acHandling = getAcHandling(docViewNode.getName());
if (acHandling != AccessControlHandling.CLEAR && acHandling != AccessControlHandling.IGNORE) {
log.trace("Access control policy element detected. starting special transformation {}/{}", node.getPath(), docViewNode.getName());
if (aclManagement.ensureAccessControllable(node, npResolver.getJCRName(docViewNode.getName()))) {
log.debug("Adding access control policy element to non access-controllable parent - adding mixin: {}", node.getPath());
}
stack = stack.push();
if (NameConstants.REP_REPO_POLICY.equals(docViewNode.getName())) {
if (node.getDepth() == 0) {
stack.adapter = new JackrabbitACLImporter(session, acHandling);
stack.adapter.startNode(docViewNode);
} else {
log.debug("ignoring invalid location for repository level ACL: {}", node.getPath());
}
} else {
stack.adapter = new JackrabbitACLImporter(node, acHandling);
stack.adapter.startNode(docViewNode);
}
} else {
stack = stack.push();
}
} else if (userManagement != null && docViewNode.getPrimaryType().filter(userManagement::isAuthorizableNodeType).isPresent()) {
// is authorizable node?
handleAuthorizable(node, docViewNode);
} else {
// regular node
stack = stack.push(addNode(docViewNode));
}
} catch (RepositoryException | IOException e) {
if (e instanceof ConstraintViolationException && wspFilter.getImportMode(nodePath) != ImportMode.REPLACE) {
// only warn in case of constraint violations for mode != replace (as best effort is used in that case)
log.warn("Error during processing of {}: {}, skip node due to import mode {}", nodePath, e.toString(), wspFilter.getImportMode(nodePath));
importInfo.onNop(nodePath);
} else {
log.error("Error during processing of {}: {}", nodePath, e.toString());
importInfo.onError(nodePath, e);
}
stack = stack.push();
}
}
}