Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

lock and unlock doc. with Domino Notes V5 (Web client)

Hi,

I want to lock and unlock doc to avoid save conflict.
I can use an lock document and remove it when the user save the normal document.
My question is how to indicate that the document is locked ?
Mask the modification link ?
Show a message but how (javascript ?)

I think is not trivial with web client.

Thanks for a quick answer.
0
didede
Asked:
didede
  • 2
1 Solution
 
bennyliawCommented:
You can have a field to hold the flag whether the document is locked, and another field to hold the user who lock it.
You can design such that the user will open the document in read mode first, click on "Edit Document" action hotspot to edit the document and submit the changes after that.

In the "Edit Document" hotspot instead using @Command( [EditDocument] ) you will call an agent and pass in the document unique id. In the agent you will need to check whether the document is locked, if it is not locked, the agent will lock the document and redirect to Edit Document url. Upon submission you will unlock the document using QuerySave agent. If the document is lock you can write a javascript alert to show the message and go back to the previous page (or you can also hide the modify link based on the setting in the lock flag)

One more think to take care is that you may want to have a function for the administrator to release the locked documents. Just in case the user lose the connection after locking a document. Or alternatively you can write an agent to unlock the locked documents that are not modified after certain time (say 2 hour or something)

That's just the idea. Let me know if you think that will work and if you need me to write the sample scripts.

--benny
0
 
didedeAuthor Commented:
Hi,

The idea seems good.
but i dont know how to link this steps

1. If the document is lock  - Domino Test !-
2. you can write a javascript alert to show the message - Javascript action !-
3. and go back to the previous page -Domino or Javascript action ?-.


Thanks

0
 
bennyliawCommented:
Ok,

Let say the edit document hotspot calls CheckIfLock Agent.
In CheckIfLock Agent you can have something like this:

' .... parse the query string to get DocUNID

' .... set doc to the document identified by DocUNID

if (doc.IsLocked(0) ="1") then '-->If the document is locked
  print "<script>alert('The document is being locked, please wait until it is released'); history.back(); </script>"     '-->javascript alert and back
else
  ' lock the document and modify it
  doc.IsLocked = "1"
  Call doc.Save( True, True )
  print "[/yourdb.nsf/yourview/yourDocUNID?EditDocument]"    '-->redirect
end if
0
 
stharrisCommented:
didede,

Domino.Doc is the best solution for documnet management with-in Lotus Domino.  Albeit, depending on the criticality of your need and the budget you have this might be a little overkill.


St. Harris
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now