*/
protected void initProperties() {
super.initProperties();
if (exists()) {
try {
properties.add(new DefaultDavProperty(JCR_NAME, item.getName()));
properties.add(new DefaultDavProperty(JCR_PATH, item.getPath()));
properties.add(new DefaultDavProperty(JCR_DEPTH, String.valueOf(item.getDepth())));
// add href-property for the items parent unless its the root item
if (item.getDepth() > 0) {
String parentHref = getLocatorFromItem(item.getParent()).getHref(true);
properties.add(new HrefProperty(JCR_PARENT, parentHref, false));
}
// 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());
}
properties.add(new DefaultDavProperty(JCR_DEFINITION, val, true));
} catch (RepositoryException e) {
// should not get here
log.error("Error while accessing jcr properties: " + e.getMessage());
}
// transaction resource additional protected properties
if (item.isNew()) {
properties.add(new DefaultDavProperty(JCR_ISNEW, null, true));
} else if (item.isModified()) {
properties.add(new DefaultDavProperty(JCR_ISMODIFIED, null, true));
}
}
// observation resource
SubscriptionDiscovery subsDiscovery = subsMgr.getSubscriptionDiscovery(this);