/** * Returns the prefixed JCR name for the namespace URI and local name * using the current namespace mappings. * * @param uri namespace URI * @param name namespace-local name * @return prefixed JCR name * @throws RepositoryException if an error occurs */ private String getName(String uri, String name) throws RepositoryException { String prefix = getSession().getNamespacePrefix(uri); if (prefix.length() > 0) { return prefix + ":" + name; } else { return name; } }
/** * Returns the prefixed JCR name for the namespace URI and local name * using the current namespace mappings. * * @param uri namespace URI * @param name namespace-local name * @return prefixed JCR name * @throws RepositoryException if an error occurs */ private String getName(String name) throws RepositoryException { return new NamespaceHelper(getSession()).getJcrName(name); }
/** * Returns the prefixed JCR name for the namespace URI and local name * using the current namespace mappings. * * @param uri namespace URI * @param name namespace-local name * @return prefixed JCR name * @throws RepositoryException if an error occurs */ private String getName(String name) throws RepositoryException { return new NamespaceHelper(getSession()).getJcrName(name); }
/** * Returns the prefixed JCR name for the namespace URI and local name * using the current namespace mappings. * * @param uri namespace URI * @param name namespace-local name * @return prefixed JCR name * @throws RepositoryException if an error occurs */ private String getName(String name) throws RepositoryException { return new NamespaceHelper(getSession()).getJcrName(name); }
/** * Returns the primary node type of this node. * <p> * The default implementation uses the value of the * <code>jcr:primaryType</code> property to look up the primary * node type from the {@link NodeTypeManager} of the current workspace. * * @return primary node type * @throws RepositoryException if an error occurs */ public NodeType getPrimaryNodeType() throws RepositoryException { NodeTypeManager manager = getSession().getWorkspace().getNodeTypeManager(); Property property = getProperty(getName("jcr:primaryType")); return manager.getNodeType(property.getString()); }
/** * Returns the primary node type of this node. * <p> * The default implementation uses the value of the * <code>jcr:primaryType</code> property to look up the primary * node type from the {@link NodeTypeManager} of the current workspace. * * @return primary node type * @throws RepositoryException if an error occurs */ public NodeType getPrimaryNodeType() throws RepositoryException { NodeTypeManager manager = getSession().getWorkspace().getNodeTypeManager(); Property property = getProperty(getName("jcr:primaryType")); return manager.getNodeType(property.getString()); }
/** * Returns the primary node type of this node. * <p> * The default implementation uses the value of the * <code>jcr:primaryType</code> property to look up the primary * node type from the {@link NodeTypeManager} of the current workspace. * * @return primary node type * @throws RepositoryException if an error occurs */ public NodeType getPrimaryNodeType() throws RepositoryException { NodeTypeManager manager = getSession().getWorkspace().getNodeTypeManager(); Property property = getProperty(getName("jcr:primaryType")); return manager.getNodeType(property.getString()); }
/** * Returns the primary node type of this node. * <p> * The default implementation uses the value of the * <code>jcr:primaryType</code> property to look up the primary * node type from the {@link NodeTypeManager} of the current workspace. * * @return primary node type * @throws RepositoryException if an error occurs */ public NodeType getPrimaryNodeType() throws RepositoryException { NodeTypeManager manager = getSession().getWorkspace().getNodeTypeManager(); Property property = getProperty(getName(JCR, "primaryType")); return manager.getNodeType(property.getString()); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given string value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value string value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, String value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given double value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value double value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, double value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given date value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value date value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, Calendar value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given boolean value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value boolean value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, boolean value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given binary value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value binary value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, InputStream value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given reference value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value reference value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, Node value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given string value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value string value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, String value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given reference value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value reference value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, Node value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given boolean value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value boolean value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, boolean value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given binary value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value binary value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, InputStream value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given binary value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value binary value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, InputStream value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }
/** * Sets the value of the named property. * <p> * The default implementation uses the {@link ValueFactory} of the * current {@link Session} to create a {@link Value} instance from * the given long value and forwards the call to the * {@link Node#setProperty(String, Value)} method. * * @param name property name * @param value long value * @return modified property * @throws RepositoryException if an error occurs */ public Property setProperty(String name, long value) throws RepositoryException { ValueFactory factory = getSession().getValueFactory(); return setProperty(name, factory.createValue(value)); }