Tabnine Logo
Property.getNode
Code IndexAdd Tabnine to your IDE (free)

How to use
getNode
method
in
javax.jcr.Property

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

origin: net.adamcin.oakpal/oakpal-core

@Override
public Node getNode() throws RepositoryException {
  Node internalNode = delegate.getNode();
  return NodeFacade.wrap(internalNode, session);
}
origin: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public Node getNode() throws ValueFormatException, RepositoryException {
  return factory.getNodeDecorator(session, property.getNode());
}
origin: org.fcrepo/fcrepo-kernel-modeshape

  @Override
  public FedoraResource getOriginalResource() {
    try {
      final Property originalProperty = node.getProperty(MEMENTO_ORIGINAL);
      final Node originalNode = originalProperty.getNode();

      return Optional.of(originalNode).map(nodeConverter::convert).orElse(null);
    } catch (final RepositoryException e) {
      throw new RepositoryRuntimeException(e);
    }
  }
}
origin: com.btmatthews.atlas/atlas-jcr

public Node getReferenceProperty(final Node node, final String name, final Node defaultValue) {
  try {
    return node.getProperty(name).getNode();
  } catch (final PathNotFoundException e) {
    return defaultValue;
  } catch (final RepositoryException e) {
    throw new RepositoryAccessException(e.getMessage(), e);
  }
}
origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape

@Override
public ObligationBuilder<ServiceLevelAgreementBuilder> obligationBuilder(Condition condition) {
  try {
    Node groupNode = this.slaNode.getProperty(JcrServiceLevelAgreement.DEFAULT_GROUP).getNode();
    groupNode.setProperty(JcrObligationGroup.CONDITION, condition.name());
    Node obNode = groupNode.addNode(JcrObligationGroup.OBLIGATIONS, JcrObligationGroup.OBLIGATION_TYPE);
    return new ObligationBuilderImpl<ServiceLevelAgreementBuilder>(obNode, this);
  } catch (RepositoryException e) {
    throw new MetadataRepositoryException("Failed to build the obligation group node", e);
  }
}
origin: apache/jackrabbit

/**
 * @see Node#getBaseVersion()
 */
public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException {
  checkIsVersionable();
  return (Version) getProperty(NameConstants.JCR_BASEVERSION).getNode();
}
origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape

public static <T extends JcrObject> T getReferencedObject(Node node, String property, JcrObjectTypeResolver<T> typeResolver) {
  try {
    Property prop = node.getProperty(property);
    return createJcrObject(prop.getNode(), typeResolver.resolve(prop.getNode()));
  } catch (AccessDeniedException e) {
    log.debug("Access denied", e);
    throw new AccessControlException(e.getMessage());
  } catch (RepositoryException e) {
    throw new MetadataRepositoryException("Failed to dereference object of type using: " + typeResolver, e);
  }
}
origin: org.apache.jackrabbit/jackrabbit-jcr2spi

/**
 * @see Node#getBaseVersion()
 */
public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException {
  checkIsVersionable();
  return (Version) getProperty(NameConstants.JCR_BASEVERSION).getNode();
}
origin: apache/jackrabbit

/**
 * @see Node#getVersionHistory()
 */
public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException {
  checkIsVersionable();
  return (VersionHistory) getProperty(NameConstants.JCR_VERSIONHISTORY).getNode();
}
origin: info.magnolia/magnolia-core

@Override
protected Content getContentFromJCRReference() throws RepositoryException {
  return getHierarchyManager().getContent(getJCRProperty().getNode().getPath());
}
origin: apache/jackrabbit

/**
 * Test the persistence of a property modified with an Node parameter and
 * saved from the Session Requires a Node value (node)
 */
public void testNodeSession() throws RepositoryException, NotExecutableException {
  property1.setValue(node);
  superuser.save();
  assertTrue("Reference property not saved", node.isSame(property1.getNode()));
}
origin: brix-cms/brix-cms

public Node getNode(Property property) throws RepositoryException {
  if (getPrevious() != null) {
    return getPrevious().getNode(property);
  } else {
    return property.getNode();
  }
}
origin: apache/jackrabbit

public void testCreateConfiguration() throws Exception {
  Node config = vm.createConfiguration(versionableNode.getPath());
  assertNotNull(config);
  NodeType nt = config.getPrimaryNodeType();
  assertTrue("created node must be subtype of nt:configuration", nt.isNodeType(ntConfiguration));
  // check if the configuration points to the versionable
  assertTrue("jcr:root property of the configuration must reference the versionable node",
      config.getProperty("jcr:root").getNode().isSame(versionableNode));
  // check if the versionable points to the configuration
  assertTrue("jcr:configuration property of the versionable node must reference the configuration",
      versionableNode.getProperty("jcr:configuration").getNode().isSame(config));
}
origin: apache/jackrabbit

public void testResolvedIdentifierBasedPropertyValue() throws RepositoryException {
  ValueFactory vf = superuser.getValueFactory();
  Value pathValue = vf.createValue("[" +identifier+ "]", PropertyType.PATH);
  Property p = testRootNode.setProperty(propertyName1, pathValue);
  assertTrue("Identifier-based PATH value must resolve to the Node the identifier has been obtained from.",
      testRootNode.isSame(p.getNode()));
}
origin: apache/jackrabbit-oak

public void testMultipleReferencesOnSameNode() throws RepositoryException {
  Node ref = testRootNode.addNode(nodeName2, testNodeType);
  ref.addMixin(mixReferenceable);
  superuser.save();
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  n.setProperty("myref0", ref);
  n.setProperty("myref1", ref);
  superuser.save();
  assertEquals("ref", ref.getPath(), n.getProperty("myref0").getNode().getPath());
  assertEquals("ref", ref.getPath(), n.getProperty("myref1").getNode().getPath());
  checkReferences("refs", ref.getReferences(), n.getPath() + "/myref0", n.getPath() + "/myref1");
}
origin: apache/jackrabbit

/**
 * Test the persistence of a property modified with an Node parameter and
 * saved from the parent Node Requires a Node value (node)
 */
public void testNodeParent() throws RepositoryException {
  property1.setValue(node);
  node.save();
  assertTrue("Reference property not saved", node.isSame(property1.getNode()));
}
origin: apache/jackrabbit-oak

public void testSimpleReferences() throws RepositoryException {
  Node ref = testRootNode.addNode(nodeName2, testNodeType);
  ref.addMixin(mixReferenceable);
  superuser.save();
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  n.setProperty("myref", ref);
  superuser.save();
  assertEquals("ref", ref.getPath(), n.getProperty("myref").getNode().getPath());
  checkReferences("refs", ref.getReferences(), n.getPath() + "/myref");
  checkReferences("refs", ref.getWeakReferences());
}
origin: apache/jackrabbit-oak

public void testSimpleWeakReferences() throws RepositoryException {
  Node ref = testRootNode.addNode(nodeName2, testNodeType);
  ref.addMixin(mixReferenceable);
  superuser.save();
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  n.setProperty("myref", superuser.getValueFactory().createValue(ref, true));
  superuser.save();
  assertEquals("ref", ref.getPath(), n.getProperty("myref").getNode().getPath());
  checkReferences("refs", ref.getReferences());
  checkReferences("refs", ref.getWeakReferences(), n.getPath() + "/myref");
}
origin: info.magnolia/magnolia-core

@Test
public void testSetReferenceProperty() throws Exception {
  final String reference2bPropertyName = "reference2b";
  Node a = root.addNode("a");
  Node b = root.addNode("b");
  a.setProperty(reference2bPropertyName, b);
  Node referencedByPropertyB = a.getProperty(reference2bPropertyName).getNode();
  assertEquals(b, referencedByPropertyB);
}
origin: info.magnolia/magnolia-core

@Test
public void testNodeReturnedFromPropertyIsWrapped() throws Exception {
  MockSession session = new MockSession("sessionName");
  Node rootNode = session.getRootNode();
  Node referredTo = rootNode.addNode("referredTo");
  referredTo.setProperty("text", "<html/>");
  Node referrer = rootNode.addNode("referrer");
  referrer.setProperty("reference", referredTo);
  HTMLEscapingNodeWrapper wrapper = new HTMLEscapingNodeWrapper(referrer, false);
  Property property = wrapper.getProperty("reference").getNode().getProperty("text");
  assertTrue(property instanceof HTMLEscapingPropertyWrapper);
  assertEquals("&lt;html/&gt;", property.getString());
}
javax.jcrPropertygetNode

Javadoc

If this property is of type REFERENCE, WEAKREFERENCE or PATH (or convertible to one of these types) this method returns the Node to which this property refers.

If this property is of type PATH and it contains a relative path, it is interpreted relative to the parent node of this property. For example "." refers to the parent node itself, ".." to the parent of the parent node and "foo" to a sibling node of this property.

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,
  • getParent,
  • getPath,
  • getLength,
  • getDouble,
  • getStream,
  • getSession

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Kernel (java.awt.image)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • String (java.lang)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • From CI to AI: The AI layer in your organization
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