if (isVersionControlled()) {
// workspace property already set in AbstractResource.initProperties()
try {
// DAV:version-history (computed)
String vhHref = getLocatorFromItem(n.getVersionHistory()).getHref(true);
properties.add(new HrefProperty(VERSION_HISTORY, vhHref, true));
// DAV:auto-version property: there is no auto version, explicit CHECKOUT is required.
properties.add(new DefaultDavProperty(AUTO_VERSION, null, false));
String baseVHref = getLocatorFromItem(n.getBaseVersion()).getHref(true);
if (n.isCheckedOut()) {
// DAV:checked-out property (protected)
properties.add(new HrefProperty(CHECKED_OUT, baseVHref, true));
// DAV:predecessors property
if (n.hasProperty(JcrConstants.JCR_PREDECESSORS)) {
Value[] predec = n.getProperty(JcrConstants.JCR_PREDECESSORS).getValues();
addHrefProperty(PREDECESSOR_SET, predec, false);
}
// DAV:auto-merge-set property. NOTE: the DAV:merge-set
// never occurs, because merging without bestEffort flag
// being set results in an exception on failure.
if (n.hasProperty(JcrConstants.JCR_MERGEFAILED)) {
Value[] mergeFailed = n.getProperty(JcrConstants.JCR_MERGEFAILED).getValues();
addHrefProperty(AUTO_MERGE_SET, mergeFailed, false);
}
// todo: checkout-fork, checkin-fork
} else {
// DAV:checked-in property (protected)
properties.add(new HrefProperty(CHECKED_IN, baseVHref, true));
}
} catch (RepositoryException e) {
log.error(e.getMessage());
}
}