예제 #1
0
 @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);
 }
예제 #2
0
 protected Lock removeLock(Node node, String owner) {
   return session.removeLock(node.getId(), owner, false);
 }
예제 #3
0
 protected Lock setLock(Node node, Lock lock) {
   return session.setLock(node.getId(), lock);
 }
예제 #4
0
 protected Lock getLock(Node node) {
   return session.getLock(node.getId());
 }