/** * @param node the node to check * @return whether the node is virtual * @throws RepositoryException */ public static boolean isVirtual(Node node) throws RepositoryException { return node instanceof HippoNode && ((HippoNode) node).isVirtual(); }
/** * Determine whether node in question is a virtual node. * * @param node the node to check for virtuality * @return whether the node is a virtual node or not */ public static boolean isVirtualNode(Node node) throws RepositoryException { return node instanceof HippoNode && ((HippoNode) node).isVirtual(); }
protected boolean isVirtual(final Node node) throws RepositoryException { return ((HippoNode) node).isVirtual(); }
private boolean isVirtual(final Node node) throws RepositoryException { return node instanceof HippoNode && ((HippoNode) node).isVirtual(); }
@Override public boolean isVirtual(final IJcrTreeNode jcrNode) { try { HippoNode hippoNode = (HippoNode) jcrNode; return hippoNode.isVirtual(); } catch (RepositoryException e) { log.info("Cannot determine whether node '{}' is virtual, assuming it's not", JcrUtils.getNodePathQuietly((Node) jcrNode), e); return false; } }
@Override public int getChildCount() { Node jcrNode = this.nodeModel.getObject(); if (jcrNode instanceof HippoNode) { try { final HippoNode hippoNode = (HippoNode) jcrNode; // do not count for virtual nodes w.r.t performance if (hippoNode.isVirtual()) { return 0; } } catch (RepositoryException e) { log.warn("Unable to get child count", e); } } return super.getChildCount(); }
/** * Checks if the wrapped jcr node is a virtual node * * @return true if the node is virtual else false */ public boolean isVirtual(IJcrTreeNode node) { IModel<Node> nodeModel = node.getNodeModel(); if (nodeModel == null) { return false; } Node jcrNode = nodeModel.getObject(); if (jcrNode == null || !(jcrNode instanceof HippoNode)) { return false; } try { HippoNode hippoNode = (HippoNode) jcrNode; return hippoNode.isVirtual(); } catch (RepositoryException e) { log.info("Cannot determine whether node '{}' is virtual, assuming it's not", JcrUtils.getNodePathQuietly(jcrNode), e); return false; } }
/** * Checks if the wrapped jcr node is a virtual node * @return true if the node is virtual else false */ public boolean isVirtual(IJcrTreeNode node) { IModel<Node> nodeModel = node.getNodeModel(); if (nodeModel == null) { return false; } Node jcrNode = nodeModel.getObject(); if (jcrNode == null || !(jcrNode instanceof HippoNode)) { return false; } HippoNode hippoNode = (HippoNode) jcrNode; try { return hippoNode.isVirtual(); } catch (RepositoryException e) { log.debug("Cannot determine whether node '{}' is virtual, assuming it's not", JcrUtils.getNodePathQuietly(hippoNode), e); return false; } }
@Override public void visit(final Node node) throws RepositoryException { if (!((HippoNode)node).isVirtual()) { final String childPath = node.getPath(); if (!autoExportConfig.isExcludedPath(childPath) && ConfigurationItemCategory.SYSTEM != autoExportConfig.getCategoryForItem(childPath, false, currentModel)) { contentPaths.add(node.getPath()); for (Node child : new NodeIterable(node.getNodes())) { child.accept(this); } } } } @Override
private void check(Node node) throws RepositoryException { if (log.isTraceEnabled()) { log.trace("traverse: {}", node.getPath()); } if (node instanceof HippoNode) { final HippoNode hippoNode = (HippoNode) node; if (hippoNode.isVirtual()) { return; } } if (node.getPath().equals("/jcr:system")) { return; } for (NodeIterator iter = node.getNodes(); iter.hasNext();) { Node child = iter.nextNode(); if (child != null) { check(child); } } for (PropertyIterator iter = node.getProperties(); iter.hasNext();) { iter.nextProperty(); } } }
for (Node child : new NodeIterable(node.getNodes())) { if (child instanceof HippoNode) { if (((HippoNode) child).isVirtual()) { continue;
Node canonical; boolean copyChildren = true; if (srcNode instanceof HippoNode && ((HippoNode) srcNode).isVirtual()) { copyChildren = false;