congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Property.remove
Code IndexAdd Tabnine 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)

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

@Override
public void delete() throws RepositoryException {
  if (isExist()) {
    getJCRProperty().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

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

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JFrame (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now