use of org.apache.jackrabbit.webdav.ordering.OrderingType in project jackrabbit by apache.
the class DefaultItemCollection method getProperty.
@Override
public DavProperty<?> getProperty(DavPropertyName name) {
DavProperty prop = super.getProperty(name);
if (prop == null && exists()) {
Node n = (Node) item;
// add node-specific resource properties
try {
if (JCR_INDEX.equals(name)) {
prop = new DefaultDavProperty<Integer>(JCR_INDEX, n.getIndex(), true);
} else if (JCR_REFERENCES.equals(name)) {
prop = getHrefProperty(JCR_REFERENCES, n.getReferences(), true);
} else if (JCR_WEAK_REFERENCES.equals(name)) {
prop = getHrefProperty(JCR_WEAK_REFERENCES, n.getWeakReferences(), true);
} else if (JCR_UUID.equals(name)) {
if (isReferenceable()) {
prop = new DefaultDavProperty<String>(JCR_UUID, n.getUUID(), true);
}
} else if (JCR_PRIMARYITEM.equals(name)) {
if (hasPrimaryItem()) {
Item primaryItem = n.getPrimaryItem();
prop = getHrefProperty(JCR_PRIMARYITEM, new Item[] { primaryItem }, true);
}
} else if (OrderingConstants.ORDERING_TYPE.equals(name) && isOrderable()) {
// property defined by RFC 3648: this resource always has custom ordering!
prop = new OrderingType(OrderingConstants.ORDERING_TYPE_CUSTOM);
} else if (SecurityConstants.SUPPORTED_PRIVILEGE_SET.equals(name)) {
prop = new JcrSupportedPrivilegesProperty(getRepositorySession(), n.getPath()).asDavProperty();
} else if (SecurityConstants.CURRENT_USER_PRIVILEGE_SET.equals(name)) {
prop = new JcrUserPrivilegesProperty(getRepositorySession(), n.getPath()).asDavProperty();
}
} catch (RepositoryException e) {
log.error("Failed to retrieve node-specific property: " + e);
}
}
return prop;
}
Aggregations