Domino Document Locking Class 1.1
Bookmark :
Updated version of Document Locking Class is now available.
Here is an update to the Document Locking Class:
Updated version of Document Locking Class is now available.
Here is an update to the Document Locking Class:
Public Sub new( inDoc As Variant )
Public Sub SetCurrentUser( user As String )
Public Function hasDocument()
Public Sub setDocument( inDoc As NotesDocument )
Public Sub setUIDocument( inUIDoc As NotesUIDocument )
Public Property Get toString As String
Public Property Get ShowPrompts As Boolean
Public Property Set ShowPrompts As Boolean
Public Function LockingEnabled() As Boolean
Public Function IsLockedByCurrentUser () As Boolean
Public Function IsDocumentLockedByCurrentUser (doc As NotesDocument ) As Boolean
Public Function IsUIDocumentLockedByCurrentUser ( uiDoc As NotesUIDocument ) As Boolean
Public Function LockedBy ( ) As String
Public Function IsLocked ( ) As Boolean
Public Function IsDocumentLocked ( doc As NotesDocument ) As Boolean
Public Function IsUIDocumentLocked (uiDoc As NotesUIDocument ) As Boolean
Public Function Lock() As Boolean
Public Function LockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function LockDocument (doc As NotesDocument ) As Boolean
Public Function UnLock () As Boolean
Public Function UnLockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function UnLockDocument (doc As NotesDocument ) As Boolean
Public Sub SetCurrentUser( user As String )
Public Function hasDocument()
Public Sub setDocument( inDoc As NotesDocument )
Public Sub setUIDocument( inUIDoc As NotesUIDocument )
Public Property Get toString As String
Public Property Get ShowPrompts As Boolean
Public Property Set ShowPrompts As Boolean
Public Function LockingEnabled() As Boolean
Public Function IsLockedByCurrentUser () As Boolean
Public Function IsDocumentLockedByCurrentUser (doc As NotesDocument ) As Boolean
Public Function IsUIDocumentLockedByCurrentUser ( uiDoc As NotesUIDocument ) As Boolean
Public Function LockedBy ( ) As String
Public Function IsLocked ( ) As Boolean
Public Function IsDocumentLocked ( doc As NotesDocument ) As Boolean
Public Function IsUIDocumentLocked (uiDoc As NotesUIDocument ) As Boolean
Public Function Lock() As Boolean
Public Function LockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function LockDocument (doc As NotesDocument ) As Boolean
Public Function UnLock () As Boolean
Public Function UnLockUIDocument (uiDoc As NotesUIDocument ) As Boolean
Public Function UnLockDocument (doc As NotesDocument ) As Boolean







Comments
I would like to see it implemented using a role. If the current user is apart of '[Unlock Document]' then continue into edit mode after the document is unlocked. This role should be set by the application, so in another application it could be '[admin]' or '[developer]'. I could see having a default role of something like '[Unlock Document]'.
Have you done any coding for this?
Posted by Chad Schelfhout At 09:32:37 PM On 04/27/2006 | - Website - |
I did find one thing that may be useful to add. For dbs where I use doc locking, I add a scheduled agent that removes the locks from documents that have been locked for more than a specified # of hours. The agent would be running with an ID defined as Manager in the ACL. However, your code only unlocks a doc if the current user is listed as a lock owner.
What I'm thinking is that it would be useful to have a "manager override" flag, where a document could be unlocked even if the current user isn't listed as a lock owner. This special flag would also work if the database owner needed to unlock a document on an emergency basis, and isn't a lock owner. What do you think?
Posted by Michael Sobczak At 02:10:58 PM On 04/27/2006 | - Website - |
Yes the 4 digit validation is easier, thanks.
Posted by Chad Schelfhout At 07:45:15 PM On 06/04/2006 | - Website - |
Sorry for one more question
I used the class in the webquery open like
flag = DocLock.IsDocumentLocked (wdoc)
it is giving "False" if the document is opened in web by user and is not locked
I am locking it by "Call DocLock.LockDocument(wdoc)" in the same webqueryopen agent
if is save i can unlock it like "call DocLock.UnLockDocument(wdoc) in webquerysave but how can i unlock if i just close the document without saving
Please help
Posted by IKram At 04:25:06 AM On 05/07/2006 | - Website - |
My idea was to query the current user's access level for the current db (using notesDatabase.CurrentAccessLevel). Based on the way doc locking works, anyone designated as a Manager in the ACL would be able to unlock any document. So, I'm not sure if adding a role would add any value, since a person could be included in the role but not able to unlock documents they haven't locked, if they weren't defined as a Manager.
I'll probably look into modifying your code next week. I can send you what I come up with when I'm done, if you like.
Posted by Michael Sobczak At 06:15:43 AM On 04/28/2006 | - Website - |
I finally turned off document locking to avoid this issue which appears to be a bug within Domino. It occured whenever a record was updated on the server using document locking in a clustered environment when there were also replicas existing on workstations.
Even though the documents were not updated on the workstations, whenever they replicated to the cluster it generates a series of replication conflicts....
With messages like
Changes made to database 'database title goes here' have not been incorporated into the database. There was a conflict detected. Your changes may be found in body of this message......
I finally removed all code (bypassed actually) that performed locking and turned off the document locking for the database.
Just curious if you ever experienced this error...
Posted by Mark Ryan At 07:36:11 AM On 08/01/2006 | - Website - |
Since we have been in contact with Lotus and they have produced a hotfix for us.
Sorry I could not be of more help.
Posted by Chad Schelfhout At 07:41:17 PM On 08/01/2006 | - Website - |