/** * Writes the contents of this item definition to the given tree node. * Used when registering new node types. * * @param tree an {@code nt:propertyDefinition} or * {@code nt:childNodeDefinition} node * @throws RepositoryException if this definition could not be written */ void writeTo(Tree tree) throws RepositoryException { if (!residual) { String oakName = getOakName(); if (oakName == null) { throw new RepositoryException("Unnamed item definition"); } tree.setProperty(JCR_NAME, oakName, Type.NAME); } else { tree.removeProperty(JCR_NAME); } // TODO avoid (in validator?) unbounded recursive auto creation. // See 3.7.2.3.5 Chained Auto-creation (OAK-411) tree.setProperty(JCR_AUTOCREATED, isAutoCreated); tree.setProperty(JCR_MANDATORY, isMandatory); tree.setProperty(JCR_PROTECTED, isProtected); tree.setProperty( JCR_ONPARENTVERSION, OnParentVersionAction.nameFromValue(onParentVersion)); }
/** * Writes the contents of this item definition to the given tree node. * Used when registering new node types. * * @param tree an {@code nt:propertyDefinition} or * {@code nt:childNodeDefinition} node * @throws RepositoryException if this definition could not be written */ void writeTo(Tree tree) throws RepositoryException { if (!residual) { String oakName = getOakName(); if (oakName == null) { throw new RepositoryException("Unnamed item definition"); } tree.setProperty(JCR_NAME, oakName, Type.NAME); } else { tree.removeProperty(JCR_NAME); } // TODO avoid (in validator?) unbounded recursive auto creation. // See 3.7.2.3.5 Chained Auto-creation (OAK-411) tree.setProperty(JCR_AUTOCREATED, isAutoCreated); tree.setProperty(JCR_MANDATORY, isMandatory); tree.setProperty(JCR_PROTECTED, isProtected); tree.setProperty( JCR_ONPARENTVERSION, OnParentVersionAction.nameFromValue(onParentVersion)); }
/** * Writes the contents of this item definition to the given tree node. * Used when registering new node types. * * @param tree an {@code nt:propertyDefinition} or * {@code nt:childNodeDefinition} node * @throws RepositoryException if this definition could not be written */ void writeTo(Tree tree) throws RepositoryException { if (!residual) { String oakName = getOakName(); if (oakName == null) { throw new RepositoryException("Unnamed item definition"); } tree.setProperty(JCR_NAME, oakName, Type.NAME); } else { tree.removeProperty(JCR_NAME); } // TODO avoid (in validator?) unbounded recursive auto creation. // See 3.7.2.3.5 Chained Auto-creation (OAK-411) tree.setProperty(JCR_AUTOCREATED, isAutoCreated); tree.setProperty(JCR_MANDATORY, isMandatory); tree.setProperty(JCR_PROTECTED, isProtected); tree.setProperty( JCR_ONPARENTVERSION, OnParentVersionAction.nameFromValue(onParentVersion)); }