@Override public Document createProxy(Document doc, Document folder) { Node folderNode = ((SQLDocument) folder).getNode(); Node targetNode = ((SQLDocument) doc).getNode(); Serializable targetId = targetNode.getId(); Serializable versionableId; if (doc.isVersion()) { versionableId = targetNode.getSimpleProperty(Model.VERSION_VERSIONABLE_PROP).getValue(); } else if (doc.isProxy()) { // copy the proxy targetId = targetNode.getSimpleProperty(Model.PROXY_TARGET_PROP).getValue(); versionableId = targetNode.getSimpleProperty(Model.PROXY_VERSIONABLE_PROP).getValue(); } else { // working copy (live document) versionableId = targetId; } String name = findFreeName(folderNode, doc.getName()); Node proxy = session.addProxy(targetId, versionableId, folderNode, name, null); return newDocument(proxy); }
protected Lock removeLock(Node node, String owner) { return session.removeLock(node.getId(), owner, false); }
protected Lock setLock(Node node, Lock lock) { return session.setLock(node.getId(), lock); }
protected Lock getLock(Node node) { return session.getLock(node.getId()); }