* @throws ObjectNotFoundException
* @throws JDOMException
*/
public XMLValue computeVersionHistory(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, JDOMException {
XMLValue xmlValue = new XMLValue();
ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(nsaToken, revisionDescriptors, revisionDescriptor);
if (resourceKind instanceof Version) {
Element element = new Element(E_HREF, DNSP);
element.setText(WebdavUtils.getAbsolutePath (
revisionDescriptors.getUri(), contextPath,
servletPath, sConf));
xmlValue.add(element);
}
else if (resourceKind instanceof CheckedInVersionControlled) {
Element element = new Element(E_HREF, DNSP);
String checkedInHref = revisionDescriptor.getProperty(P_CHECKED_IN).getValue().toString();
String checkedInUri = ((Element)new XMLValue(checkedInHref).iterator().next()).getText();
UriHandler uriHandler = UriHandler.getUriHandler(checkedInUri);
element.setText (WebdavUtils.getAbsolutePath (
uriHandler.getAssociatedHistoryUri(),
contextPath, servletPath, sConf));
xmlValue.add(element);
}
else if (resourceKind instanceof CheckedOutVersionControlled) {
Element element = new Element(E_HREF, DNSP);
String checkedOutHref = revisionDescriptor.getProperty(P_CHECKED_OUT).getValue().toString();
String checkedOutUri = ((Element)new XMLValue(checkedOutHref).iterator().next()).getText();
UriHandler uriHandler = UriHandler.getUriHandler(checkedOutUri);
element.setText(WebdavUtils.getAbsolutePath (
uriHandler.getAssociatedHistoryUri(),
contextPath, servletPath, sConf));
xmlValue.add(element);
}
return xmlValue;
}