How to force Editor to unlock a file

Submitted by: Liz Fraley Last Updated: 2010-08-09

=Problem=

Arbortext Editor ties up directory of last file edited

=Solutions=

Originally posted by Meghan Fiero

PTC provided a diagnostic ACL file called doc_close2. We ended up being able to solve the problem by replacing the code we used to use to close the file in the editor's checkout directory. The old file closing code was:

if(doc_window(doc) > 0) { file_close( doc_window(doc) ); } Now instead of file_close, we call a new ACL file: if(doc_window(doc) > 0) {doc_close_unlock(doc); } Here is doc_close_unlock.acl: function doc_close_unlock(doc = current_doc) { local path = doc_path(doc); if (!path) {     message = "Document id $doc has no associated path.  Document not closed!\n\n"; }   else {     local count = 0; while (doc_valid(doc)) {       #doc_close(doc); file_close( doc_window(doc)); }     local dobj = dobj_construct(path); if (dobj_valid(dobj)) {       if (dobj_is_my_lock(dobj)) {         #message .= "\n\nDocument is still locked by some document object; even after closing"; # Forcibly close this reference. dobj_unlock(dobj); }        # Release the dobj we created above. dobj_close(dobj); }    }  }
 * 1) Routine adapted from PTC's diagnostic routine; need to close and unlock the XML file upon check-in or ###
 * 2) cancel check-in, in order for java to be able to remove the file from the checkout folder ###############