congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Property.getParent
Code IndexAdd Tabnine to your IDE (free)

How to use
getParent
method
in
javax.jcr.Property

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: ModeShape/modeshape

  private String getNameOfDdlContent( Property inputProperty ) throws RepositoryException {
    Node parentNode = inputProperty.getParent();
    if (JcrConstants.JCR_CONTENT.equalsIgnoreCase(parentNode.getName())) {
      parentNode = parentNode.getParent();
    }
    return parentNode.getName();
  }
}
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: apache/jackrabbit

/**
 * Tests if getParent() returns parent node
 */
public void testGetParent() throws RepositoryException {
  assertTrue("getParent() of a property must return the parent node.",
      testRootNode.isSame(property.getParent()));
}
origin: org.onehippo.cms7/hippo-cms-console-frontend

  @Override
  public Time lastModifiedTime() {
    try {
      final Node node = model.getProperty().getParent();
      return Time.valueOf(JcrUtils.getDateProperty(node, "jcr:lastModified", Calendar.getInstance()).getTime());
    } catch (RepositoryException e) {
      log.error("Unexpected exception while determining last modified date", e);
    }
    return Time.valueOf(new Date());
  }
}
origin: org.onehippo.cms7/hippo-repository-engine

  protected boolean skip(final Property prop) throws RepositoryException {
    final String primaryNodeTypeName = prop.getParent().getPrimaryNodeType().getName();
    if (primaryNodeTypeName.equals(NT_FACETSEARCH) && HIPPO_COUNT.equals(prop.getName())) {
      return true;
    }
    if (prop.getName().equals(HIPPO_PATHS)) {
      return true;
    }
    return false;
  }
}
origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape

public static Node getParent(Property prop) {
  try {
    return prop.getParent();
  } catch (AccessDeniedException e) {
    log.debug("Access denied", e);
    throw new AccessControlException(e.getMessage());
  } catch (RepositoryException e) {
    throw new MetadataRepositoryException("Failed to get the parent node of the property: " + prop, e);
  }
}
origin: net.adamcin.commons/net.adamcin.commons.jcr

public Property getProperty(String s) throws RepositoryException {
  Property property = this.item.getProperty(s);
  Node parent = property.getParent();
  return new PropertyProxy(property, item == parent ? this : new NodeProxy(parent));
}
origin: Adobe-Consulting-Services/acs-aem-commons

public CurrentEvolutionEntryImpl(Property property, EvolutionConfig config) {
  try {
    this.config = config;
    this.type = EvolutionEntryType.PROPERTY;
    this.name = property.getName();
    this.depth = EvolutionPathUtil.getLastDepthForPath(property.getPath());
    this.path = property.getParent().getName();
    this.value = config.printProperty(property);
  } catch (Exception e) {
    log.error("Could not inititalize VersionEntry", e);
  }
}
origin: info.magnolia/magnolia-core

@Override
public boolean evaluateProperty(Property property) {
  try {
    return evaluateNode(property.getParent()) && propertyPredicate.evaluate(property);
  } catch (RepositoryException e) {
    throw new RuntimeRepositoryException(e);
  }
}
origin: org.fcrepo/modeshape-jcr

@Override
public final boolean isSame( Item otherItem ) throws RepositoryException {
  checkSession();
  if (otherItem instanceof Property) {
    Property otherProperty = (Property)otherItem;
    // The nodes that own the properties must be the same ...
    if (!getParent().isSame(otherProperty.getParent())) return false;
    // The properties must have the same name ...
    return getName().equals(otherProperty.getName());
  }
  return false;
}
origin: ModeShape/modeshape

@Override
public final boolean isSame( Item otherItem ) throws RepositoryException {
  checkSession();
  if (otherItem instanceof Property) {
    Property otherProperty = (Property)otherItem;
    // The nodes that own the properties must be the same ...
    if (!getParent().isSame(otherProperty.getParent())) return false;
    // The properties must have the same name ...
    return getName().equals(otherProperty.getName());
  }
  return false;
}
origin: info.magnolia.templating/magnolia-templating-essentials-imaging

@Override
public boolean shouldRegenerate(Property cachedBinary, ParameterProvider<ThemeAwareParameter> parameterProvider) throws RepositoryException {
  final Calendar cacheLastMod = NodeTypes.LastModified.getLastModified(cachedBinary.getParent().getParent());
  final Calendar srcLastMod = NodeTypes.LastModified.getLastModified(parameterProvider.getParameter().getNode());
  return cacheLastMod.before(srcLastMod);
}
origin: info.magnolia/magnolia-core

@Test
public void testWorkspaceReturnsLogicalName4() throws RepositoryException {
  // GIVEN
  Node root = MgnlContext.getJCRSession("magnolia-mgnlSystem").getRootNode();
  root.addNode("test", NodeTypes.ContentNode.NAME).setProperty("testProp", "testVal");
  root.getSession().save();
  // WHEN
  String name = root.getNode("test").getProperty("testProp").getParent().getSession().getWorkspace().getName();
  // THEN
  assertTrue(name.equals("magnolia-mgnlSystem"));
}
origin: ModeShape/modeshape

private Property updateProperty( Property property,
                 JSONObject jsonItem ) throws RepositoryException, JSONException {
  String propertyName = property.getName();
  String jsonPropertyName = jsonItem.has(propertyName) ? propertyName : propertyName + BASE64_ENCODING_SUFFIX;
  Node node = property.getParent();
  setPropertyOnNode(node, jsonPropertyName, jsonItem.get(jsonPropertyName));
  return property;
}
origin: info.magnolia/magnolia-core

public Link(Property property) {
  try {
    setJCRNode(property.getParent());
    setWorkspace(property.getSession().getWorkspace().toString());
    setProperty(property);
    setPropertyName(property.getName());
  } catch (RepositoryException e) {
    throw new RuntimeRepositoryException(e);
  }
}
origin: org.fcrepo/fcrepo-kernel-modeshape

@SuppressWarnings("unchecked")
private static Stream<Property> getMembershipContext(final FedoraResource resource) throws RepositoryException {
  return iteratorToStream(getJcrNode(resource).getReferences(LDP_MEMBER_RESOURCE))
        .filter(UncheckedPredicate.uncheck((final Property p) -> {
          final Node container = p.getParent();
          return container.isNodeType(LDP_DIRECT_CONTAINER)
            || container.isNodeType(LDP_INDIRECT_CONTAINER);
        }));
}
origin: info.magnolia/magnolia-module-standard-templating-kit

@Override
public boolean shouldRegenerate(Property cachedBinary, ParameterProvider<STKParameter> parameterProvider) throws RepositoryException {
  final Calendar cacheLastMod = NodeTypes.LastModified.getLastModified(cachedBinary.getParent().getParent());
  final Calendar srcLastMod = NodeTypes.LastModified.getLastModified(parameterProvider.getParameter().getNodeData().getParent().getJCRNode());
  return cacheLastMod.before(srcLastMod);
}
origin: apache/jackrabbit-oak

@Test
public void setPropertyAgain() throws RepositoryException {
  Session session = getAdminSession();
  Property p1 = session.getProperty("/foo/stringProp");
  Property p2 = p1.getParent().setProperty("stringProp", "newValue");
  Property p3 = session.getProperty("/foo/stringProp");
  assertEquals("newValue", p1.getString());
  assertEquals("newValue", p2.getString());
  assertEquals("newValue", p3.getString());
}
origin: info.magnolia/magnolia-core

@Test
public void testPropertyFromNodeReturnedFromPropertyIsWrapped() throws Exception {
  MockSession session = new MockSession("sessionName");
  Node rootNode = session.getRootNode();
  Node foo = rootNode.addNode("foo");
  foo.setProperty("text", "<html/>");
  HTMLEscapingNodeWrapper wrapper = new HTMLEscapingNodeWrapper(foo, false);
  Property property = wrapper.getProperty("text").getParent().getProperty("text");
  assertTrue(property instanceof HTMLEscapingPropertyWrapper);
  assertEquals("&lt;html/&gt;", property.getString());
}
origin: info.magnolia/magnolia-core

  @Test
  public void testExecute() throws RepositoryException, TaskExecutionException {
    // GIVEN
    Property property1 = NodeUtil.createPath(session.getRootNode(), "/demo-project/about/subsection-articles/article", NodeTypes.ContentNode.NAME).setProperty("someProperty", "someValue");

    Task task = new RemovePropertyTask("name", property1.getParent().getPath(), "someProperty");

    // WHEN
    task.execute(ctx);

    // THEN
    assertFalse("Property should have been removed", session.propertyExists("/demo-project/about/subsection-articles/article/someProperty"));
    assertEquals("Remove property 'config:/demo-project/about/subsection-articles/article/someProperty'.", task.getDescription());
  }
}
javax.jcrPropertygetParent

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().
  • remove
  • 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
  • getLong,
  • getDefinition,
  • setValue,
  • getPath,
  • getNode,
  • getLength,
  • getDouble,
  • getStream,
  • getSession

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Collectors (java.util.stream)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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