javax.jcr.Property.getPath()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(85)

本文整理了Java中javax.jcr.Property.getPath()方法的一些代码示例,展示了Property.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.getPath()方法的具体详情如下:
包路径:javax.jcr.Property
类名称:Property
方法名:getPath

Property.getPath介绍

暂无

代码示例

代码示例来源:origin: org.onehippo.cms7/hippo-cms-api

public JarExpander(Node node) throws RepositoryException {
  this.node = node;
  prop = node.getProperty("jcr:data");
  path = prop.getPath();
}

代码示例来源:origin: org.apache.sling/org.apache.sling.scripting.javascript

public String jsGet_path() {
  try {
    return property.getPath();
  } catch (RepositoryException e) {
    return property.toString();
  }
}

代码示例来源:origin: Adobe-Consulting-Services/acs-aem-commons

PageCompareDataLineImpl(Property property, String basePath, int depth) throws RepositoryException {
  this.path = property.getPath().replace(basePath, "");
  this.name = property.getName();
  this.value = EvolutionConfig.printProperty(property);
  this.depth = depth;
}

代码示例来源:origin: org.fcrepo/fcrepo-kernel-modeshape

@Override
  public String getExternalIdentifier() {
    try {
      return "/" + FileSystemConnector.class.getName() + ":projections:" + property().getPath();
    } catch (final RepositoryException e) {
      throw new RepositoryRuntimeException(e);
    }
  }
}

代码示例来源:origin: apache/jackrabbit

protected void setUp() throws Exception {
  super.setUp();
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  testNodePath = n.getPath();
  Value v = getJcrValue(superuser, RepositoryStub.PROP_PROP_VALUE1, RepositoryStub.PROP_PROP_TYPE1, "test");
  Property p = n.setProperty(propertyName1, v);
  testPropertyPath = p.getPath();
  testRootNode.getSession().save();
  readOnlySession = getHelper().getReadOnlySession();
}

代码示例来源:origin: apache/jackrabbit

/**
 * Tests if getPath() returns the correct path.
 */
public void testGetPath()
    throws NotExecutableException, RepositoryException {
  assertEquals("getPath returns wrong result",
      testRoot + "/" + property.getName(),
      property.getPath());
}

代码示例来源:origin: apache/jackrabbit

/**
 * Test if Item.isNew() returns true direct after a new PropertyItem is set
 * (before node is saved (transient)).
 *
 * @see javax.jcr.Item#isNew()
 */
public void testTransientPropertyItemIsNew () throws RepositoryException {
  Property testProperty = testNode.setProperty(propertyName1, "test");
  Item testPropertyItem = superuser.getItem(testProperty.getPath());
  // check testPropertyItem.isNew() before save
  assertTrue("Item.isNew() must return true directly after a new Property is set (before current node is saved)", testPropertyItem.isNew());
}

代码示例来源: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: apache/jackrabbit

public void testSingleValueWithName() throws RepositoryException {
  Value weakRef = vf.createValue(target, true);
  referring.setProperty(propertyName1, weakRef);
  superuser.save();
  PropertyIterator it = target.getWeakReferences(propertyName1);
  assertTrue("no weak references returned", it.hasNext());
  Property p = it.nextProperty();
  assertEquals("wrong weak reference property", referring.getProperty(propertyName1).getPath(), p.getPath());
  assertFalse("no more weak references expected", it.hasNext());
}

代码示例来源:origin: apache/jackrabbit

public void testMultiValues() throws RepositoryException {
  Value weakRef = vf.createValue(target, true);
  Value[] refs = new Value[]{weakRef, weakRef};
  referring.setProperty(propertyName1, refs);
  superuser.save();
  PropertyIterator it = target.getWeakReferences();
  assertTrue("no weak references returned", it.hasNext());
  Property p = it.nextProperty();
  assertEquals("wrong weak reference property", referring.getProperty(propertyName1).getPath(), p.getPath());
  assertFalse("no more weak references expected", it.hasNext());
}

代码示例来源:origin: apache/jackrabbit

public void testMultiValuesWithName() throws RepositoryException {
  Value weakRef = vf.createValue(target, true);
  Value[] refs = new Value[]{weakRef, weakRef};
  referring.setProperty(propertyName1, refs);
  superuser.save();
  PropertyIterator it = target.getWeakReferences(propertyName1);
  assertTrue("no weak references returned", it.hasNext());
  Property p = it.nextProperty();
  assertEquals("wrong weak reference property", referring.getProperty(propertyName1).getPath(), p.getPath());
  assertFalse("no more weak references expected", it.hasNext());
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void testRootPropertyPath() throws RepositoryException {
  Property property = getAdminSession().getRootNode().getProperty("jcr:primaryType");
  assertEquals("/jcr:primaryType", property.getPath());
}

代码示例来源:origin: apache/jackrabbit-oak

private static Set<String> getReferencingPaths(Node n)
      throws RepositoryException {
    Set<String> refs = Sets.newHashSet();
    PropertyIterator it = n.getReferences();
    while (it.hasNext()) {
      refs.add(it.nextProperty().getPath());
    }
    return refs;
  }
}

代码示例来源:origin: apache/jackrabbit-oak

private static void checkReferences(String msg, PropertyIterator refs, String ... expected) throws RepositoryException {
  List<String> paths = new LinkedList<String>();
  while (refs.hasNext()) {
    paths.add(refs.nextProperty().getPath());
  }
  checkEquals(msg, paths, expected);
}

代码示例来源:origin: apache/jackrabbit

public void testTransientRententionPolicy2() throws RepositoryException, NotExecutableException {
  retentionMgr.setRetentionPolicy(testNodePath, getApplicableRetentionPolicy());
  assertNoEffect((Node) otherS.getItem(testNodePath), nodeName3, propertyName2);
  assertNoEffect((Node) otherS.getItem(childN.getPath()), nodeName3, propertyName2);
  assertNoEffect((Property) otherS.getItem(childP.getPath()));
}

代码示例来源:origin: apache/jackrabbit

public NodeIterator execute() throws Exception {
    Node n = getNode();
    String value = getRandomText(5);
    String path = n.setProperty(name, value).getPath();
    log.info(path + ": " + value);
    return wrapWithIterator(getNode());
  }
}

代码示例来源:origin: ModeShape/modeshape

private RestProperty createRestProperty( Session session,
                     Property property,
                     String baseUrl ) throws RepositoryException {
  List<String> values = restPropertyValues(property, baseUrl, session);
  String url = RestHelper.urlFrom(baseUrl, ITEMS_METHOD_NAME, encodedPath(property.getPath()));
  String parentUrl = RestHelper.urlFrom(baseUrl, ITEMS_METHOD_NAME, encodedPath(property.getParent().getPath()));
  boolean multiValued = property.isMultiple();
  return new RestProperty(property.getName(), url, parentUrl, values, multiValued);
}

代码示例来源:origin: apache/jackrabbit

public void testGetPropertyOrNullExisting() throws RepositoryException {
  JackrabbitSession js = (JackrabbitSession) superuser;
  Property property = js.getPropertyOrNull(PATH_EXISTING_PROPERTY);
  assertNotNull(property);
  assertEquals(property.getPath(), PATH_EXISTING_PROPERTY);
}

代码示例来源: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 getProperty() throws RepositoryException {
  Property property = getProperty("/foo/stringProp");
  assertNotNull(property);
  assertEquals("stringProp", property.getName());
  assertEquals("/foo/stringProp", property.getPath());
  Value value = property.getValue();
  assertNotNull(value);
  assertEquals(PropertyType.STRING, value.getType());
  assertEquals("stringVal", value.getString());
}

相关文章