Codota Logo
Property.remove
Code IndexAdd Codota to your IDE (free)

How to use
remove
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.remove (Showing top 20 results out of 666)

  • Common ways to obtain Property
private void myMethod () {
Property p =
  • Codota IconNode node;String name;String value;node.setProperty(name, value)
  • Codota IconNode node;String relPath;node.getProperty(relPath)
  • Codota IconPropertyIterator iter;iter.nextProperty()
  • Smart code suggestions by Codota
}
origin: apache/jackrabbit-oak

@Override
public void runTest() throws Exception {
  Node node = session.getRootNode().getNode(ROOT_NODE_NAME);
  for (int i = 1; i < CHILD_COUNT; i++) {
    node.getNode("node" + i).setProperty("foo", "bar");
    session.save();
    node.getNode("node" + i).getProperty("foo").remove();
    node.getNode("node0").setProperty("foo", i);
    session.save();
  }
}
origin: info.magnolia/magnolia-core

/**
 * remove specified property.
 *
 * @param name of the property to be removed
 * @throws PathNotFoundException if property does not exist
 * @throws RepositoryException if unable to remove
 */
public void removeProperty(String name) throws PathNotFoundException, RepositoryException {
  this.node.getProperty(this.getInternalPropertyName(name)).remove();
}
origin: info.magnolia/magnolia-core

  @Override
  public void remove() throws VersionException, LockException, ConstraintViolationException, AccessDeniedException, RepositoryException {
    getWrappedProperty().remove();
  }
}
origin: info.magnolia/magnolia-core

@MgnlDeprecated(since = "5.6.2", description = "No need to call since #addComment should not be called.")
@Deprecated
protected void cleanComment(final Node node) throws RepositoryException {
  synchronized (ExclusiveWrite.getInstance()) {
    if (node.hasProperty(NodeTypes.Versionable.COMMENT)
        && !StringUtils.EMPTY.equals(node.getProperty(NodeTypes.Versionable.COMMENT).getString())) {
      node.getProperty(NodeTypes.Versionable.COMMENT).remove();
      node.getSession().save();
    }
  }
}
origin: org.apache.jackrabbit/jackrabbit-jcr-commons

public void removeProperty(String key) throws RepositoryException {
  Node parent = getParent(key);
  Property p = parent.getProperty(key);
  p.remove();
  treeManager.join(this, parent, p);
  if (autoSave) {
    parent.getSession().save();
  }
}
origin: org.onehippo.cms7/hippo-repository-api

protected void setStringsProperty(String relPath, String[] values) throws RepositoryException {
  if (hasNode()) {
    Node node = getCheckedOutNode();
    if (values == null) {
      if (node.hasProperty(relPath)) {
        node.getProperty(relPath).remove();
      }
    } else {
      node.setProperty(relPath, values);
    }
  }
}
origin: org.onehippo.cms7/hippo-repository-api

protected void setStringProperty(String relPath, String value) throws RepositoryException {
  if (hasNode()) {
    Node node = getCheckedOutNode();
    if (value == null) {
      if (node.hasProperty(relPath)) {
        node.getProperty(relPath).remove();
      }
    } else {
      node.setProperty(relPath, value);
    }
  }
}
origin: apache/jackrabbit

private void assertNoEffect(Node target, String childName, String propName) throws RepositoryException {
  Session s = target.getSession();
  Node n = target.addNode(childName);
  Value v = getJcrValue(s, RepositoryStub.PROP_PROP_VALUE2, RepositoryStub.PROP_PROP_TYPE2, "test");
  Property p = target.setProperty(propName, v);
  n.remove();
  p.remove();
}
origin: apache/jackrabbit

public void removeProperty(String key) throws RepositoryException {
  Node parent = getParent(key);
  Property p = parent.getProperty(key);
  p.remove();
  treeManager.join(this, parent, p);
  if (autoSave) {
    parent.getSession().save();
  }
}
origin: info.magnolia/magnolia-core

  @Override
  protected void operateOnNode(InstallContext installContext, Node node) {
    try {
      node.getProperty("icon").remove();
    } catch (RepositoryException e) {
      installContext.warn(String.format("The legacy icon property couldn't be removed for the following node: %s", NodeUtil.getNodePathIfPossible(node)));
    }
  }
}
origin: org.apache.jackrabbit/jackrabbit-jcr-commons

/**
 * Move <code>property</code> to the new <code>parent</code>.
 */
protected void move(Property property, Node parent) throws RepositoryException {
  parent.setProperty(property.getName(), property.getValue());
  property.remove();
}
origin: info.magnolia/magnolia-core

public static Property renameProperty(Property property, String newName) throws RepositoryException {
  // Do nothing if the property already has this name, otherwise we would remove the property
  if (property.getName().equals(newName)) {
    return property;
  }
  Node node = property.getParent();
  Property newProperty = node.setProperty(newName, property.getValue());
  property.remove();
  return newProperty;
}
origin: info.magnolia/magnolia-core

@Override
public void delete() throws RepositoryException {
  if (isExist()) {
    getJCRProperty().remove();
  }
}
origin: info.magnolia/magnolia-core

public static void moveProperty(Property source, Node targetNode) throws RepositoryException {
  // JCR props can't be moved, we gotta recreate w/ same value and delete
  if (source.isMultiple()) {
    targetNode.setProperty(source.getName(), source.getValues());
  } else {
    targetNode.setProperty(source.getName(), source.getValue());
  }
  source.remove();
}
origin: info.magnolia/magnolia-i18n

private void handleNode(Node node, String[] properties) throws RepositoryException {
  PropertyIterator propertyIterator = node.getProperties(properties);
  while (propertyIterator.hasNext()) {
    Property property = propertyIterator.nextProperty();
    if (DEPRECATED_I18N_PROPERTIES.contains(property.getName())) {
      log.info("SiteMap i18n property removed: '{}' ", property.getPath());
      property.remove();
    }
  }
}
origin: info.magnolia/magnolia-core

protected void purgeContent(Node node) throws RepositoryException {
  // delete paragraphs & collections
  for (Iterator<Node> iter = new FilteringNodeIterator(node.getNodes(), new RuleBasedNodePredicate(getRule())); iter.hasNext(); ) {
    iter.next().remove();
  }
  // delete properties (incl title ??)
  for (Iterator<Property> iter = new FilteringPropertyIterator(node.getProperties(), new JCRMgnlPropertyHidingPredicate()); iter.hasNext(); ) {
    Property property = iter.next();
    property.remove();
  }
}
origin: apache/jackrabbit

public void testRemovedNewProperty() throws RepositoryException, LockException, ConstraintViolationException, VersionException {
  Property p = testRootNode.setProperty(propertyName1, testValue);
  p.remove();
  testRootNode.refresh(false);
  try {
    p.getString();
    fail("Refresh 'false' must not bring a removed new child property back to life.");
  } catch (InvalidItemStateException e) {
    // ok
  }
  assertFalse("Refresh 'false' must not bring a removed new child property back to life.", testRootNode.hasProperty(propertyName1));
}
origin: apache/jackrabbit-oak

@Test
public void descendantSuggestionRequirePathRestrictionIndex() throws Exception {
  Node rootIndexDef = root.getNode("oak:index/sugg-idx");
  rootIndexDef.getProperty(EVALUATE_PATH_RESTRICTION).remove();
  rootIndexDef.setProperty(REINDEX_PROPERTY_NAME, true);
  session.save();
  //Without path restriction indexing, descendant clause shouldn't be respected
  validateSuggestions(
    createSuggestQuery(NT_OAK_UNSTRUCTURED, "te", "/content1"),
    newHashSet("test1", "test2", "test3", "test4", "test5", "test6"));
}
origin: apache/jackrabbit-oak

@Test
public void accessRemovedProperty() throws RepositoryException {
  Node foo = getNode("/foo");
  Property p = foo.setProperty("name", "value");
  p.remove();
  try {
    p.getPath();
    fail("Expected InvalidItemStateException");
  }
  catch (InvalidItemStateException expected) {
  }
}
origin: apache/jackrabbit-oak

@Test
public void testMoveAndRemovePropertyAtSource2() throws Exception {
  setupMovePermissions();
  allow(childNPath, privilegesFromName(PrivilegeConstants.REP_REMOVE_PROPERTIES));
  testSession.move(nodePath3, siblingDestPath);
  Node n = testSession.getNode(childNPath);
  assertTrue(n.hasProperty(propertyName1));
  n.getProperty(propertyName1).remove();
  testSession.save();
}
javax.jcrPropertyremove

Popular methods of Property

  • getString
    Returns a String representation of the value of this property. A shortcut for Property.getValue().g
  • getValues
    Returns an array of all the values of this property. Used to access multi-value properties. The arra
  • getValue
    Returns the value of this property as a Value object. The object returned is a copy of the stored va
  • getName
  • getType
    Returns the type of this Property. One of: * PropertyType.STRING * PropertyType.BINARY * Property
  • getBinary
    Returns a Binary representation of the value of this property. A shortcut for Property.getValue().g
  • getBoolean
    Returns a boolean representation of the value of this property. A shortcut for Property.getValue().
  • isMultiple
    Returns true if this property is multi-valued andfalse if this property is single-valued.
  • getDate
    Returns a Calendar representation of the value of this property. A shortcut for Property.getValue()
  • getLong
    Returns a long representation of the value of this property. A shortcut for Property.getValue().get
  • getDefinition
    Returns the property definition that applies to this property. In some cases there may appear to be
  • setValue
    Sets the value of this property to the values array. If this property's property type is not constra
  • getDefinition,
  • setValue,
  • getParent,
  • getPath,
  • getNode,
  • getLength,
  • getDouble,
  • getStream,
  • getSession

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • BoxLayout (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now