Page 1 of 1
Lock opened files
Posted: Mon Aug 20, 2012 12:38 pm
by patrick
Hi,
is there a possibility to add a "lock" to opened files, so other users get a warning if there also try to open/edit an already opened file? This would be very useful if files are stored on a network share without a versioning system and multiple users have to edit them.
Thanks
Patrick
Re: Lock opened files
Posted: Mon Aug 20, 2012 12:59 pm
by Radu
Hi Patrick,
We have API like:
Code: Select all
AuthorEditorAccess.setEditable(boolean editable)
But Oxygen does not know if the file was already opened by other users.
Do you have this information on your side?
Also if you set a file as read-only on the network share (or on the local drive) Oxygen would show a small "lock" icon for it and show a warning when the user attempts to save it. This behavior is controlled by a checkbox in the Oxygen Preferences->"Editor" page called "Can edit read-only files":
http://www.oxygenxml.com/doc/ug-oxygen/ ... files.html
So another approach would be for the user who wants to edit a file to change its read-only flag using the Windows Explorer. Then after finishing, to reset the flag and save the modifications to it.
Regards,
Radu
Re: Lock opened files
Posted: Mon Aug 20, 2012 2:54 pm
by patrick
No I have no information filesystem side, its a normal windows share. The workflow does not allow to set a file as readonly.
Oxygen could generate a second hidden file (sth. like filename.ext.lock) on open and delete it on closing a document. But if there are not such an option at this time, I try to find another solution.
Re: Lock opened files
Posted: Mon Aug 20, 2012 3:07 pm
by Radu
Hi Patrick,
Oxygen could generate a second hidden file (sth. like filename.ext.lock) on open and delete it on closing a document.
How about if you generate the extra file when Oxygen opens a document?
Our plugins SDK allows you to create a "Workspace Access" plugin:
http://www.oxygenxml.com/oxygen_sdk.htm ... er_Plugins
Such a plugin would allow you to set a listener (
ro.sync.exml.workspace.api.listeners.WSEditorChangeListener) which is notified before an URL is opened. Then you can check if there is a lock file next to it (and if so issue a warning that somebody is editing the file).
If there is no lock file next to it you create it and continue to open the URL.
Of course Oxygen also has an SVN client embedded so if you want true collaboration with file change history, check in and update capabilities + the possibility to tag certain releases, maybe you should consider installing an SVN server.
Regards,
Radu