How to prevent users from cutting documents in a view?

Hi!

A questions that I´m dealing with already a few months:

How can I protect client-users against cutting (CTRL-X) documents from a view?

I use the “QueryPaste” event in particular views to avoid “wild” copying of documents, but if a users presses CTRL-X by mistake, there is no possibility to paste the document back.

Any suggestions, or maybe ran into the same problem?

Thankx

Rolf

Subject: How to prevent users from cutting documents in a view?

Rolf,

do your users really need the right to delete ANY documents in that database?

In a well-designed app, users in general only have Author rights, so they at least can’t delete anything else than their own documents (which is sometimes bad enough).

By the way, if a user presses CTRL-X, then the document is actually copied to the clipboard, and if the user has the right to create new documents, he can re-insert it. However, it’s a new document then, and response-hierarchies and other workflow stuff will be lost.

If you even don’t want users to COPY documents, you could use the ND6 ACL. There is a new right named “replicate or copy documents”. This however applies to all documents in the database.

Another approach is the database script. There is a QUERYDOCUMENTDELETE event which is programmable. This gets triggered at CTRL-X.

You could write some code which then asks the user for confirmation on the delete event.

I hope one of these options is a good choice for you …

Stephan Holowaty

Principal Certified Lotus Instructor SA&AD

IBM Certified Instructor Websphere App Server (SA)

IBM Certified Instructor Websphere Portal Server (SA)

mailto:stephan.holowaty@holowaty.de

Subject: RE: How to prevent users from cutting documents in a view?

Hello Stephan!

  1. Our Users usually only have author-access but they mostly work on a tree-structure of response-documents, so the main problem appears if they CTRL-X a document that has responses - as you mentioned, all the parent-child references get lost if they paste the documents back.

  2. Unchecking the ND6 ACL right “replicate or copy documents” also disallows a user to copy text from a RTF to the clipboard - not a good feature, because our application is used as a web content management system :frowning:

Maybe the last suggestion is a good one - using the Querydocumentdelete Event from DatabaseScript. I will explore this solution, in detail, concerning the response-references.

Thinking one step further - is there a possibility to use some kind of C/C++ API functionality to catch the clipboard-events?

I´m not afraid of getting my hands dirty with hard-core-programming :slight_smile:

Thank you very much

Rolf

Subject: RE: How to prevent users from cutting documents in a view?

Hi Rolf,

ok, I understand from your application logic’s point of view that you would not want to go for the ACL stuff.

I then strongly suggest staying with the Database Script solution. The QUERYDOCUMENTDELETE event is fired as soon as you delete a document in the UI - let it be by pressing the DELETE button or by cutting the document to the clipboard. You could then do some basic Lotusscript, prompting the user and asking to acknowledge the deletion.

A very good example on how things could look like is in the SENT view of your mail database. Just try to cut a document from there.

You’ll find the associated code in the Database Script, QUERYDOCUMENTDELETE event, below a section commented as

“’ We are deleting from the Sent view; see if the user wants to delete or remove”

This might be the way to go.

I am only roughly familiar with all the API stuff, but from my understanding there is no feasible way other than the Database Script to catch the DELETE event in Notes.

From my understanding, you don’t actually want to catch the clipboard event (users are allowed to copy / paste data to the clipboard) but the CUT event (copy to clipboard and then delete the source).

Hope this will work for you.

Stephan Holowaty

Principal Certified Lotus Instructor SA&AD

IBM Certified Instructor Websphere App Server (SA)

IBM Certified Instructor Websphere Portal Server (SA)

mailto:stephan.holowaty@holowaty.de