« Domino Document Locking Class | Main| Domino Document Locking Class 1.3 »

Domino Document Locking Class 1.1

Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

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


Domino Document Locking

Select All


Comments

1 - I can see where other people would have the same need.

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?

2 - Chad, this class is excellent! I just incorporated it into a web app I'm currently working on.

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?

3 - Great to see that it will be used.

Yes the 4 digit validation is easier, thanks.

4 - Chad

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

5 - Not yet, but I'll need to do something relatively soon.

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.

6 - Has anybody experienced the replication conflict issue when using document locking in combination with server and local based replicas?

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...

7 - Mark, I have not experienced those messages. I ran into some problems with clustering and documented it here:http://www.chadsmiley.com/chadsmiley/home.nsf/d6plinks/Documents_Stay_Locked

Since we have been in contact with Lotus and they have produced a hotfix for us.

Sorry I could not be of more help.