本文整理了Java中javax.jcr.Item.getDepth()
方法的一些代码示例,展示了Item.getDepth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.getDepth()
方法的具体详情如下:
包路径:javax.jcr.Item
类名称:Item
方法名:getDepth
[英]Returns the depth of this Item
in the workspace item graph.
Item
.Item
在工作区项目图中的深度。Item
。代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector
/** {@inheritDoc} */
public int getDepth() throws RepositoryException {
return item.getDepth();
}
代码示例来源:origin: net.adamcin.oakpal/oakpal-core
@Override
public int getDepth() throws RepositoryException {
return delegate.getDepth();
}
代码示例来源:origin: net.adamcin.commons/net.adamcin.commons.jcr
public int getDepth() throws RepositoryException
{ return this.item.getDepth(); }
代码示例来源:origin: apache/jackrabbit
/** {@inheritDoc} */
public int getDepth() throws RepositoryException, RemoteException {
try {
return item.getDepth();
} catch (RepositoryException ex) {
throw getRepositoryException(ex);
}
}
代码示例来源:origin: brix-cms/brix-cms
public Integer execute() throws Exception {
return getDelegate().getDepth();
}
});
代码示例来源:origin: brix-cms/brix-cms
public int getDepth() throws RepositoryException {
return getDelegate().getDepth();
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr-commons
/**
* Matches if the given depth is greater or equal the minimum depth and
* less or equal the maximum depth and if the call to {@link #matches(Item)}
* returns <code>true</code>.
* @see Predicate#evaluate(java.lang.Object)
*/
public boolean evaluate(Object item) {
if ( item instanceof Item ) {
try {
final int depth = ((Item)item).getDepth();
return depth >= minDepth && depth <= maxDepth && matches((Item)item);
} catch (RepositoryException re) {
return false;
}
}
return false;
}
代码示例来源:origin: org.apache.jackrabbit/com.springsource.org.apache.jackrabbit.commons
/**
* Matches if the given depth is greater or equal the minimum depth and
* less or equal the maximum depth and if the call to {@link #matches(Item)}
* returns <code>true</code>.
* @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object)
*/
public boolean evaluate(Object item) {
if ( item instanceof Item ) {
try {
final int depth = ((Item)item).getDepth();
return depth >= minDepth && depth <= maxDepth && matches((Item)item);
} catch (RepositoryException re) {
return false;
}
}
return false;
}
代码示例来源:origin: apache/jackrabbit
/**
* Matches if the given depth is greater or equal the minimum depth and
* less or equal the maximum depth and if the call to {@link #matches(Item)}
* returns <code>true</code>.
* @see Predicate#evaluate(java.lang.Object)
*/
public boolean evaluate(Object item) {
if ( item instanceof Item ) {
try {
final int depth = ((Item)item).getDepth();
return depth >= minDepth && depth <= maxDepth && matches((Item)item);
} catch (RepositoryException re) {
return false;
}
}
return false;
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
/**
* Matches if the given depth is greater or equal the minimum depth and
* less or equal the maximum depth and if the call to {@link #matches(Item)}
* returns <code>true</code>.
* @see Predicate#evaluate(java.lang.Object)
*/
public boolean evaluate(Object item) {
if ( item instanceof Item ) {
try {
final int depth = ((Item)item).getDepth();
return depth >= minDepth && depth <= maxDepth && matches((Item)item);
} catch (RepositoryException re) {
return false;
}
}
return false;
}
代码示例来源:origin: org.onehippo.cms7/hippo-repository-deprecated-updater-module
if(origin.getDepth() > 0 && origin.getParent().isNodeType("mix:versionable")) {
if (!origin.getParent().isCheckedOut()) {
origin.getParent().checkout();
代码示例来源:origin: apache/jackrabbit
@Override
protected void initPropertyNames() {
super.initPropertyNames();
if (exists()) {
names.addAll(JcrDavPropertyNameSet.EXISTING_ITEM_BASE_SET);
try {
if (item.getDepth() > 0) {
names.add(JCR_PARENT);
}
} catch (RepositoryException e) {
log.warn("Error while accessing node depth: " + e.getMessage());
}
if (item.isNew()) {
names.add(JCR_ISNEW);
} else if (item.isModified()) {
names.add(JCR_ISMODIFIED);
}
} else {
names.addAll(JcrDavPropertyNameSet.ITEM_BASE_SET);
}
}
代码示例来源:origin: apache/jackrabbit
/**
* Fill the property set for this resource.
*/
@Override
protected void initProperties() {
super.initProperties();
if (exists()) {
try {
properties.add(new DefaultDavProperty<String>(JCR_NAME, item.getName()));
properties.add(new DefaultDavProperty<String>(JCR_PATH, item.getPath()));
int depth = item.getDepth();
properties.add(new DefaultDavProperty<String>(JCR_DEPTH, String.valueOf(depth)));
// add href-property for the items parent unless its the root item
if (depth > 0) {
String parentHref = getLocatorFromItem(item.getParent()).getHref(true);
properties.add(new HrefProperty(JCR_PARENT, parentHref, false));
}
} catch (RepositoryException e) {
// should not get here
log.error("Error while accessing jcr properties: " + e.getMessage());
}
}
}
代码示例来源:origin: apache/jackrabbit
private void checkHierarchy() throws PathNotFoundException, RepositoryException, ItemNotFoundException,
AccessDeniedException {
for (Iterator<ItemInfo> itemInfos = itemInfoStore.getItemInfos(); itemInfos.hasNext();) {
ItemInfo itemInfo = itemInfos.next();
String jcrPath = toJCRPath(itemInfo.getPath());
Item item = session.getItem(jcrPath);
assertEquals(jcrPath, item.getPath());
if (item.getDepth() > 0) {
Node parent = item.getParent();
if (item.isNode()) {
assertTrue(item.isSame(parent.getNode(item.getName())));
}
else {
assertTrue(item.isSame(parent.getProperty(item.getName())));
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!