use of org.apache.jackrabbit.webdav.jcr.nodetype.ItemDefinitionImpl in project jackrabbit by apache.
the class AbstractItemResource method getProperty.
@Override
public DavProperty<?> getProperty(DavPropertyName name) {
DavProperty prop = super.getProperty(name);
if (prop == null) {
if (JCR_DEFINITION.equals(name)) {
if (exists()) {
try {
// protected 'definition' property revealing the item definition
ItemDefinitionImpl val;
if (item.isNode()) {
val = NodeDefinitionImpl.create(((Node) item).getDefinition());
} else {
val = PropertyDefinitionImpl.create(((Property) item).getDefinition());
}
prop = new DefaultDavProperty<ItemDefinitionImpl>(JCR_DEFINITION, val, true);
} catch (RepositoryException e) {
// should not get here
log.error("Error while accessing item definition: " + e.getMessage());
}
}
} else if (JCR_ISNEW.equals(name)) {
// transaction resource additional protected properties
if (exists() && item.isNew()) {
prop = new DefaultDavProperty<String>(JCR_ISNEW, null, true);
}
} else if (JCR_ISMODIFIED.equals(name)) {
// transaction resource additional protected properties
if (exists() && item.isModified()) {
prop = new DefaultDavProperty<String>(JCR_ISMODIFIED, null, true);
}
} else if (ObservationConstants.SUBSCRIPTIONDISCOVERY.equals(name)) {
// observation resource
prop = subsMgr.getSubscriptionDiscovery(this);
}
}
return prop;
}
Aggregations