How can I control accessing and updating one document in muliuser enviroment via WEB?

Hi ,

I would like to allow reading document by many user but updating should be for ONLY one user, if another user try to update the process should not be allowed ?

NOTE : server 5

thanks and regards

Subject: how can I control accessing and updating one document in muliuser enviroment via WEB?

Hi

I simple solution could:

  • set a lock flag when going into editmode.

  • remove flag when saving

  • Make an scheduled agent which removes old stuck locks

regards

Jesper Kiaer

http://www.jezzper.com

Subject: RE: how can I control accessing and updating one document in muliuser enviroment via WEB?

Hi again ,

could you please explain more ?

how can I set lock flag ?

if this lock flag is on can other user read the document but not editing it ?

Thanks

Subject: an example…

Hi

this is just a quick example to point you the right way:

  • Create a form

  • ad a text field called “lockfield”

  • create two agents “UnLockAgent” and ad it to Webquerysave and “LockAgent” in Webqueryopen

using formular @If(@IsDocBeingEdited;(@Command([ToolsRunMacro]; “LockDocAgent”));“”)

and

@If(@IsDocBeingEdited;(@Command([ToolsRunMacro]; “UnLockDocAgent”));“”)

Example agent Lockagent:

Dim session As NotesSession

Set session = New NotesSession

Dim doc As NotesDocument



Set doc = session.DocumentContext



If Not (doc.IsNewNote) Then

	doc.lockfield="Locked"

	Call doc.save(True,False)

End If

example “Unlockagent”

Dim session As NotesSession

Set session = New NotesSession

Dim doc As NotesDocument



Set doc = session.DocumentContext



If Not (doc.IsNewNote) Then

	doc.lockfield="UnLocked"

	Call doc.save(True,False)

End If

You could the have 2 subforms in the form.

One loads if the unlocked field is “Unlocked” showing editabl fields

One showing “computed for display” fields if document is locked.

The rest is up to you ! :slight_smile:

regards

Jesper Kiaer

http://www.jezzper.com

Subject: RE: an example…

to avoid “save conflicts” you should keep the lock field in separate document and not in the same document.

Have the lockfield in the original document make a lookup in the lock document instead.

You could use the uniqueID from original document as a key for the lockdocument

regards

Jesper Kiaer

http://www.jezzper.com

Subject: how can I control accessing and updating one document in muliuser enviroment via WEB?

Maybe http://www.xetrion.com can help you.