String msg = "Unable to deliver node type operation: " + e.getMessage(); log.error(msg); } catch (RepositoryException e) {
/** * Reads a node type definition file. The file contents are read from * the given input stream and the parsed node type definitions are * returned. * * @param xml XML input stream * @return node type definitions * @throws IOException if the node type definitions * cannot be read * @throws InvalidNodeTypeDefException if the node type definition * format is invalid */ public static QNodeTypeDefinition[] read(InputStream xml) throws IOException, InvalidNodeTypeDefException { try { NodeTypeReader reader = new NodeTypeReader(xml); return reader.getNodeTypeDefs(); } catch (NameException e) { throw new InvalidNodeTypeDefException( "Invalid namespace reference in a node type definition", e); } catch (NamespaceException e) { throw new InvalidNodeTypeDefException( "Invalid namespace reference in a node type definition", e); } }
ntreg.registerNodeTypes(ntDefCollection); } catch (InvalidNodeTypeDefException e) { assertFalse(e.getMessage(), true); e.printStackTrace(); } catch (RepositoryException e) { assertFalse(e.getMessage(), true);
ntreg.registerNodeTypes(ntDefCollection); } catch (InvalidNodeTypeDefException e) { assertFalse(e.getMessage(), true); e.printStackTrace(); } catch (RepositoryException e) { assertFalse(e.getMessage(), true);
String msg = "Unable to deliver node type operation: " + e.getMessage(); log.error(msg); } catch (RepositoryException e) {
/** * Reads a node type definition file. The file contents are read from * the given input stream and the parsed node type definitions are * returned. * * @param xml XML input stream * @return node type definitions * @throws IOException if the node type definitions * cannot be read * @throws InvalidNodeTypeDefException if the node type definition * format is invalid */ public static QNodeTypeDefinition[] read(InputStream xml) throws IOException, InvalidNodeTypeDefException { try { NodeTypeReader reader = new NodeTypeReader(xml); return reader.getNodeTypeDefs(); } catch (NameException e) { throw new InvalidNodeTypeDefException( "Invalid namespace reference in a node type definition", e); } catch (NamespaceException e) { throw new InvalidNodeTypeDefException( "Invalid namespace reference in a node type definition", e); } }
/** * Test for writing a node type definition file. Writing is tested * by writing and re-reading the test node types using an internal * byte array. The resulting node type map is then compared to the * original test node types. * * @throws IOException on IO errors * @throws RepositoryException on repository errors */ public void testWrite() throws IOException, RepositoryException { try { ByteArrayOutputStream xml = new ByteArrayOutputStream(); NodeTypeWriter.write(xml, types, registry); byte[] bytes = xml.toByteArray(); QNodeTypeDefinition[] output = NodeTypeReader.read(new ByteArrayInputStream(bytes)); assertTrue("write output", Arrays.equals(types, output)); } catch (InvalidNodeTypeDefException e) { fail(e.getMessage()); } }
throw new InvalidNodeTypeDefException("circular inheritance detected: " + buf.toString()); String msg = "unknown supertype: " + nt; log.debug(msg); throw new InvalidNodeTypeDefException(msg, nsnte);
throw new InvalidNodeTypeDefinitionException(e.getMessage(), e);
throw new InvalidNodeTypeDefException("circular inheritance detected: " + buf.toString()); String msg = "unknown supertype: " + nt; log.debug(msg); throw new InvalidNodeTypeDefException(msg, nsnte);
throw new InvalidNodeTypeDefinitionException(e.getMessage(), e);
private EffectiveNodeType internalRegister(QNodeTypeDefinition ntd) throws InvalidNodeTypeDefException, RepositoryException { Name name = ntd.getName(); if (name != null && registeredNTDefs.containsKey(name)) { String msg = name + " already exists"; log.debug(msg); throw new InvalidNodeTypeDefException(msg); } ntd = checkNtBaseSubtyping(ntd, registeredNTDefs); EffectiveNodeType ent = validateNodeTypeDef(ntd, entCache, registeredNTDefs, nsReg, false); // store new effective node type instance entCache.put(ent); registeredNTDefs.put(name, ntd); return ent; }
private EffectiveNodeType internalRegister(QNodeTypeDefinition ntd) throws InvalidNodeTypeDefException, RepositoryException { Name name = ntd.getName(); if (name != null && registeredNTDefs.containsKey(name)) { String msg = name + " already exists"; log.debug(msg); throw new InvalidNodeTypeDefException(msg); } ntd = checkNtBaseSubtyping(ntd, registeredNTDefs); EffectiveNodeType ent = validateNodeTypeDef(ntd, entCache, registeredNTDefs, nsReg, false); // store new effective node type instance entCache.put(ent); registeredNTDefs.put(name, ntd); return ent; }
buf.append("node type "); buf.append(nt); throw new InvalidNodeTypeDefException("circular node auto-creation detected: " + buf.toString()); + " defines invalid default node type for child node " + nodeDef.getName(); log.debug(msg); throw new InvalidNodeTypeDefException(msg, nsnte);
buf.append("node type "); buf.append(nt); throw new InvalidNodeTypeDefException("circular node auto-creation detected: " + buf.toString()); + " defines invalid default node type for child node " + nodeDef.getName(); log.debug(msg); throw new InvalidNodeTypeDefException(msg, nsnte);
String msg = name + " already exists locally"; log.debug(msg); throw new InvalidNodeTypeDefException(msg);
String msg = name + " already exists locally"; log.debug(msg); throw new InvalidNodeTypeDefException(msg);
/** * 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); } }
queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_LIKE); } else { throw new InvalidNodeTypeDefException("'" + op + "' is not a valid query operator"); type, constraint.trim(), resolver)); } catch (InvalidConstraintException e) { throw new InvalidNodeTypeDefException( "Invalid value constraint " + constraint, e); values.add((InternalValue) ValueFormat.getQValue(v, resolver, qValueFactory)); } catch (RepositoryException e) { throw new InvalidNodeTypeDefException( "Unable to create default value: " + value, e);
String msg = "no name specified"; log.debug(msg); throw new InvalidNodeTypeDefException(msg); + supertype + " (infinite recursion))"; log.debug(msg); throw new InvalidNodeTypeDefException(msg); + supertype; log.debug(msg); throw new InvalidNodeTypeDefException(msg); String msg = "[" + name + "] primaryItemName is already specified by a supertype and must therefore not be overridden."; log.debug(msg); throw new InvalidNodeTypeDefException(msg); String msg = "[" + name + "] failed to validate supertypes"; log.debug(msg); throw new InvalidNodeTypeDefException(msg, ntce); } catch (NoSuchNodeTypeException nsnte) { String msg = "[" + name + "] failed to validate supertypes"; log.debug(msg); throw new InvalidNodeTypeDefException(msg, nsnte); + "] invalid declaring node type specified"; log.debug(msg); throw new InvalidNodeTypeDefException(msg); + "] auto-created properties must specify a name";