@NotNull @Override public NodeType perform() throws RepositoryException { Tree tree = node.getTree(); String primaryTypeName = getPrimaryTypeName(tree); if (primaryTypeName != null) { return getNodeTypeManager().getNodeType(sessionContext.getJcrName(primaryTypeName)); } else { throw new RepositoryException("Unable to retrieve primary type for Node " + getNodePath()); } } });
@Nonnull @Override public NodeType perform() throws RepositoryException { Tree tree = node.getTree(); String primaryTypeName = getPrimaryTypeName(tree); if (primaryTypeName != null) { return getNodeTypeManager().getNodeType(sessionContext.getJcrName(primaryTypeName)); } else { throw new RepositoryException("Unable to retrieve primary type for Node " + getNodePath()); } } });
@NotNull @Override public NodeType perform() throws RepositoryException { Tree tree = node.getTree(); String primaryTypeName = getPrimaryTypeName(tree); if (primaryTypeName != null) { return getNodeTypeManager().getNodeType(sessionContext.getJcrName(primaryTypeName)); } else { throw new RepositoryException("Unable to retrieve primary type for Node " + getNodePath()); } } });
@Override public final NodeTypeIterator registerNodeTypes( NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException { Root root = getWriteRoot(); try { Tree tree = getOrCreateNodeTypes(root); for (NodeTypeDefinition ntd : ntds) { NodeTypeTemplateImpl template; if (ntd instanceof NodeTypeTemplateImpl) { template = (NodeTypeTemplateImpl) ntd; } else { // some external template implementation, copy before proceeding template = new NodeTypeTemplateImpl(getNamePathMapper(), ntd); } template.writeTo(tree, allowUpdate); } root.commit(); refresh(); List<NodeType> types = new ArrayList<NodeType>(ntds.length); for (NodeTypeDefinition ntd : ntds) { types.add(getNodeType(ntd.getName())); } return new NodeTypeIteratorAdapter(types); } catch (CommitFailedException e) { String message = "Failed to register node types."; throw e.asRepositoryException(message); } }
@Override public final NodeTypeIterator registerNodeTypes( NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException { Root root = getWriteRoot(); try { Tree tree = getOrCreateNodeTypes(root); for (NodeTypeDefinition ntd : ntds) { NodeTypeTemplateImpl template; if (ntd instanceof NodeTypeTemplateImpl) { template = (NodeTypeTemplateImpl) ntd; } else { // some external template implementation, copy before proceeding template = new NodeTypeTemplateImpl(getNamePathMapper(), ntd); } template.writeTo(tree, allowUpdate); } root.commit(); refresh(); List<NodeType> types = new ArrayList<NodeType>(ntds.length); for (NodeTypeDefinition ntd : ntds) { types.add(getNodeType(ntd.getName())); } return new NodeTypeIteratorAdapter(types); } catch (CommitFailedException e) { String message = "Failed to register node types."; throw e.asRepositoryException(message); } }
@Override public final NodeTypeIterator registerNodeTypes( NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException { Root root = getWriteRoot(); try { Tree tree = getOrCreateNodeTypes(root); for (NodeTypeDefinition ntd : ntds) { NodeTypeTemplateImpl template; if (ntd instanceof NodeTypeTemplateImpl) { template = (NodeTypeTemplateImpl) ntd; } else { // some external template implementation, copy before proceeding template = new NodeTypeTemplateImpl(getNamePathMapper(), ntd); } template.writeTo(tree, allowUpdate); } root.commit(); refresh(); List<NodeType> types = new ArrayList<NodeType>(ntds.length); for (NodeTypeDefinition ntd : ntds) { types.add(getNodeType(ntd.getName())); } return new NodeTypeIteratorAdapter(types); } catch (CommitFailedException e) { String message = "Failed to register node types."; throw e.asRepositoryException(message); } }
private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException { // TODO: figure out the right place for this check NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found if (nt.isAbstract() || nt.isMixin()) { throw new ConstraintViolationException(getNodePath()); } // TODO: END PropertyState state = PropertyStates.createProperty( JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME); dlg.setProperty(state, true, true); dlg.setOrderableChildren(nt.hasOrderableChildNodes()); }
private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException { // TODO: figure out the right place for this check NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found if (nt.isAbstract() || nt.isMixin()) { throw new ConstraintViolationException(getNodePath()); } // TODO: END PropertyState state = PropertyStates.createProperty( JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME); dlg.setProperty(state, true, true); dlg.setOrderableChildren(nt.hasOrderableChildNodes()); }
private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException { // TODO: figure out the right place for this check NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found if (nt.isAbstract() || nt.isMixin()) { throw new ConstraintViolationException(getNodePath()); } // TODO: END PropertyState state = PropertyStates.createProperty( JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME); dlg.setProperty(state, true, true); dlg.setOrderableChildren(nt.hasOrderableChildNodes()); }