/** * @param in * @throws IOException * @throws InvalidNodeTypeDefException */ public void load(InputStream in) throws IOException, InvalidNodeTypeDefException, RepositoryException { QNodeTypeDefinition[] types = NodeTypeReader.read(in); for (QNodeTypeDefinition type : types) { add(type); } }
/** * @param in * @throws IOException * @throws InvalidNodeTypeDefException */ public void load(InputStream in) throws IOException, InvalidNodeTypeDefException, RepositoryException { QNodeTypeDefinition[] types = NodeTypeReader.read(in); for (QNodeTypeDefinition type : types) { add(type); } }
customNTDefs.add(ntd); persistCustomNodeTypeDefs(customNTDefs);
customNTDefs.add(ntd); persistCustomNodeTypeDefs(customNTDefs);
/** * Loads node types from a CND stream. * * @param in reader containing the nodetype definitions * @param systemId optional name of the stream * * @throws IOException if an I/O error during reading occurs * @throws InvalidNodeTypeDefException if the CND cannot be parsed */ public void loadCND(Reader in, String systemId) throws IOException, InvalidNodeTypeDefException { try { CompactNodeTypeDefReader<QNodeTypeDefinition, NamespaceMapping> r = new CompactNodeTypeDefReader<QNodeTypeDefinition, NamespaceMapping>( in, systemId, new QDefinitionBuilderFactory()); for (QNodeTypeDefinition qdef: r.getNodeTypeDefinitions()) { add(qdef); } } catch (ParseException e) { throw new InvalidNodeTypeDefException("Unable to parse CND stream.", e); } }
/** * Loads node types from a CND stream. * * @param in reader containing the nodetype definitions * @param systemId optional name of the stream * * @throws IOException if an I/O error during reading occurs * @throws InvalidNodeTypeDefException if the CND cannot be parsed */ public void loadCND(Reader in, String systemId) throws IOException, InvalidNodeTypeDefException { try { CompactNodeTypeDefReader<QNodeTypeDefinition, NamespaceMapping> r = new CompactNodeTypeDefReader<QNodeTypeDefinition, NamespaceMapping>( in, systemId, new QDefinitionBuilderFactory()); for (QNodeTypeDefinition qdef: r.getNodeTypeDefinitions()) { add(qdef); } } catch (ParseException e) { throw new InvalidNodeTypeDefException("Unable to parse CND stream.", e); } }
/** * Internal implementation of {@link #registerNodeTypes(Collection)} * * @param ntDefs a collection of <code>QNodeTypeDefinition<code> objects * @param external whether this invocation should be considered external * @throws InvalidNodeTypeDefException if the given node type definition is invalid. * @throws RepositoryException if a repository error occurs. */ private void registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean external) throws InvalidNodeTypeDefException, RepositoryException { synchronized (this) { // validate and register new node type definitions internalRegister(ntDefs, external); // persist new node type definitions for (QNodeTypeDefinition ntDef: ntDefs) { customNTDefs.add(ntDef); } persistCustomNodeTypeDefs(customNTDefs); // notify listeners for (QNodeTypeDefinition ntDef : ntDefs) { notifyRegistered(ntDef.getName()); } } // inform cluster if this is not an external invocation if (!external && eventChannel != null) { eventChannel.registered(ntDefs); } }
/** * Internal implementation of {@link #registerNodeTypes(Collection)} * * @param ntDefs a collection of <code>QNodeTypeDefinition<code> objects * @param external whether this invocation should be considered external * @throws InvalidNodeTypeDefException if the given node type definition is invalid. * @throws RepositoryException if a repository error occurs. */ private void registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean external) throws InvalidNodeTypeDefException, RepositoryException { synchronized (this) { // validate and register new node type definitions internalRegister(ntDefs, external); // persist new node type definitions for (QNodeTypeDefinition ntDef: ntDefs) { customNTDefs.add(ntDef); } persistCustomNodeTypeDefs(customNTDefs); // notify listeners for (QNodeTypeDefinition ntDef : ntDefs) { notifyRegistered(ntDef.getName()); } } // inform cluster if this is not an external invocation if (!external && eventChannel != null) { eventChannel.registered(ntDefs); } }
customNTDefs.add(ntd);
customNTDefs.add(ntd);
store.add(repRootNodeTypeDefBuilder.build());