}
private void writeSupportedLockElements( ITransaction transaction,
XMLWriter generatedXML,
String path ) {
LockedObject lo = resourceLocks.getLockedObjectByPath(transaction, path);
generatedXML.writeElement("DAV::supportedlock", XMLWriter.OPENING);
if (lo == null) {
// both locks (shared/exclusive) can be granted
generatedXML.writeElement("DAV::lockentry", XMLWriter.OPENING);
generatedXML.writeElement("DAV::lockscope", XMLWriter.OPENING);
generatedXML.writeElement("DAV::exclusive", XMLWriter.NO_CONTENT);
generatedXML.writeElement("DAV::lockscope", XMLWriter.CLOSING);
generatedXML.writeElement("DAV::locktype", XMLWriter.OPENING);
generatedXML.writeElement("DAV::write", XMLWriter.NO_CONTENT);
generatedXML.writeElement("DAV::locktype", XMLWriter.CLOSING);
generatedXML.writeElement("DAV::lockentry", XMLWriter.CLOSING);
generatedXML.writeElement("DAV::lockentry", XMLWriter.OPENING);
generatedXML.writeElement("DAV::lockscope", XMLWriter.OPENING);
generatedXML.writeElement("DAV::shared", XMLWriter.NO_CONTENT);
generatedXML.writeElement("DAV::lockscope", XMLWriter.CLOSING);
generatedXML.writeElement("DAV::locktype", XMLWriter.OPENING);
generatedXML.writeElement("DAV::write", XMLWriter.NO_CONTENT);
generatedXML.writeElement("DAV::locktype", XMLWriter.CLOSING);
generatedXML.writeElement("DAV::lockentry", XMLWriter.CLOSING);
} else {
// LockObject exists, checking lock state
// if an exclusive lock exists, no further lock is possible
if (lo.isShared()) {
generatedXML.writeElement("DAV::lockentry", XMLWriter.OPENING);
generatedXML.writeElement("DAV::lockscope", XMLWriter.OPENING);
generatedXML.writeElement("DAV::shared", XMLWriter.NO_CONTENT);
generatedXML.writeElement("DAV::lockscope", XMLWriter.CLOSING);
generatedXML.writeElement("DAV::locktype", XMLWriter.OPENING);
generatedXML.writeElement("DAV::" + lo.getType(), XMLWriter.NO_CONTENT);
generatedXML.writeElement("DAV::locktype", XMLWriter.CLOSING);
generatedXML.writeElement("DAV::lockentry", XMLWriter.CLOSING);
}
}