Ways to do Version Controlling/Tracking

Version tracking is a feature that allows you to maintain the history of changes made in a document. And is another interview question.

Version tracking can be achieved in 2 ways. First through the Form properties and the Second is by using the reserved field $VersionOpt.


A. To achieve version tracking through form you need to designate the form as version-tracking form. When you design the form, in the Form Properties > Form Info tab, you can see a section called Versions. It has two drop downs to select. The first one is Versioning with the values as:

i.           New versions become responses
ii.          Prior versions become responses
iii.         New versions become siblings

These descriptions are self-explanatory. After you select a value another drop down, Create versions, will be enabled with the following values:
a. Manual – File, New Version
b. Automatic – File, Save


This would enable the form for version tracking and any changes made to the documents out of this form would be saved as responses / siblings as per the selection made.

B. The other way of enabling version tracking/control is to use the reserved field $VersionOpt.

$VersionOpt field allows you to have version control facility. It allows users to create new version of edited documents on a document-by-document basis.

You make this field as either Editable or Computed. The Computed for display / Computed when composed field types do not work for this reserved field.

If you want all documents created from a form to have same version control option then make it as Computed Text field and specify the Value as any of the numbers from 0 to 6.

The numbers are values for different types of version tracking; i.e.

0 ~ No version tracking
1 ~ New versions become responses if users choose File - Save As New Version when saving
2 ~ New versions automatically become responses when saved
3 ~ Prior versions become responses if users choose File - Save As New Version when saving
4 ~ Prior versions become responses when saved
5 ~ New versions become siblings if users choose File - Save As New Version when saving
6 ~ New versions automatically become siblings when saved

If you want users to have different version methods for different documents created from the same form, then have this field as Editable and select field type as Dialogue List. In the Control tab select Choices as Enter choices (one per line) and add the options 0 to 6 with the user understandable descriptions; e.g.

Don't track versions | 0
Create response if File - Save as New Version is used | 1
Create response automatically | 2
Promote to main document if File - Save as New Version is used | 3
Promote to main document automatically | 4
Create additional main document if File - Save as New Version is used | 5
Create additional main document automatically | 6

Thus, user can make a selection for the type of version controlling that she wants.

Replicate or copy documents and $KeepPrivate

a> How to stop users from creating local replicas or local copies?

b> How to stop users from copying / printing / forwarding any documents from the database?

c> How to stop users from copying / forwarding / printing an e-mail that you sent?

The answer of the questions a>, b> is: Deselect the option Replicate or copy documents privilege from the ACL for the users, groups etc.

This option when selected/deselected allows/prohibits respectively the following:

  1. Users to create local replicas or local copies of a database.
  2. Select content from a document opened in read mode.
  3. Copying, printing, or forwarding documents in the database.
  4. Controls the replication of the documents with $KeepPrivate.
Deselecting the option prohibits users from printing, copying, forwarding documents. However, still there are chances that user may take a print screen and print the data from the image file. They can also copy the data from the document to the clipboard and save it as word file or text file and print that.

That’s how you can control this via design specifications i.e. through ACL in a particular database.

Now, how to restrict the user from copying / forwarding / printing the documents / e-mails that you sent to another database / someone’s mailbox? They have usually manager access to their mailbox; in that case you cannot make the change in their mailbox directly. Doing so would stop them from creating their archive databases too.

To answer the above question (c>) all you have to do is, before sending your e-mail,

  1. Click on the Delivery Options… button.
  2. In the Delivery Options dialogue box, in the Basic tab, you will see a check box Prevent copying.
  3. Select that option and press OK. Send your e-mail now.
Now the recipient would not be able to copy / forward that particular e-mail. The print option will also be disabled for the e-mail.

However, the recipient may still use print screen option or may use some script to reset the option.

Now, how do you reset the restriction / prohibition?

When you select the “Replicate or copy documents” option in the ACL, any documents created by people / groups that do not have this option checked will then be marked with a reserved field $KeepPrivate. $KeepPrivate field is set to “1” in that case; thus, prohibiting the documents from getting copied/forwarded/printed.

The same happens in case of selecting the “Prevent copying” check box in Delivery Options dialogue box.

You must have guessed by now that if you want to get rid of the prohibition, then you need to either reset the $KeepPrivate field or need to remove it completely from the document.

To reset the field here’s the code:
@If(@IsAvailable($KeepPrivate);
      @If($KeepPrivate = "1";
            @Do(
                     @SetField("$KeepPrivate";"0");
                     @Prompt([Ok];"Copy/Print/Forward Enabled";
                                    "The selected message can now be forwarded/copied!")
             );
            @Prompt([Ok];"Restriction is already disabled";
                           "The selected e-mail does not seem to have printing/forwarding/copying disabled.")
       );
      @Prompt([Ok];"No Restriction Found";
      "The selected e-mail doesn't seem to have any restriction at all.")
);
SELECT @All

To remove the field completely:
FIELD $KeepPrivate := @Unavailable;
SELECT @All

The above settings are applicable only to the Notes Client application and not to the Notes Web application.

Lotus Notes designers if you want to put this restriction through the design, then you can add a hidden field with the name $KeepPrivate and set it's Default Value as "1". Otherwise if you want some already created documents to be prohibited, then add the $KeepPrivate through an agent:
FIELD $KeepPrivate := "1";
SELECT @All

Beside this we can restrict documents created with certain forms from being printed/copied/forwarded. This we can achieve by selecting the option "Disable printing/forwarding/copying to clipboard" in Form properties > Security Tab.

In case you know any other way then do let me know.

Authors vs Readers

Readers and Authors fields - a common interview question. I remember whatever interviews I have given in any organisation or who ever I have interviewed I have always asked them questions related to Readers and Authors field with lot of permutation and combination. Today I thought of documenting whatever I know about these fields, so I can refer to it whenevevr I want and brush up my brain a little if I have forget anything in future. 

Basics about Authors and Readers field
Authors
Authors field works in conjuction with Author access i.e. it controls only people with Author access in the ACL.

If you have only Author access you can Read, but you cannot Edit that document.

However, if you have Author access and your name is listed in the Authors field of that document, then you can edit that document.

Authors field affects only users who have Author access in the ACL. If you have Read access in ACL and your name is in Authors field, then you cannot edit the documents. Thus, Authors field cannot override the ACL.

Editor access or higher access in ACL are not affected by the Authors field.


Readers
Readers field controls who can read the documents. Readers field doesn't give you more access than what you are given in the ACL. 

If you have No Access and are listed in the Readers field then you cannot read the document.

However, if you have Editor or higher access and your name is not listed in the Readers field then even if you have Editor or higher access you are not be allowed to read the documents.

If you have Editor or higher access and you want to read the documents with Readers field in it then have your name listed in the Form Properties > Security Tab > Default read access for documents created with this form >
a. have your name added to the ACL and tick the All readers and above checkbox.
b. have your name added to the ACL and tick the names who should read documents cerated with that form.
c. have your name added to the Readers field in the form design.

It doesn't affect the read access list or the ACL. Readers field can control/restrict the access of the document before it is created. Readers field also affects the Replication of the documents.



Authors & Readers
Authors field doesn't affect Edit Access or higher. Readers field does affect Edit Access or higher.

Authors field overrides the Readers field. i.e. if your name is not there in the Readers field, but is there in the Authors field of that same document, then you will be able to read the document.

A Readers field with a blank value mean that everyone can Read the document.

However, an Authors field with a blank value doesn't allow anyone to Edit the document.

"*" value in the Readers / Authors field enables everyone to Read / Edit, respectively, the documents.

If you go to the Document properties and check the Fields Tab, you can see the Field Flags.
The Readers field shows field flags as: READ-ACCESS NAMES
The Authors field shows field flags as: READ/WRITE-ACCESS NAMES


Things need to be taken care of while creating Readers/Author field
The right way of adding values to the Readers / Authors fields are:
a. Use canonical form of the name, i.e. CN=Gayatri Gouda/OU=IND/O=CS.
b. Use roles with the square brackets, i.e. [HelpdeskAnalyst].
c. Do not use the Domain name with the canonical name i.e. no @DOMINO.
d. Avoid any extra spaces before or after or in between the names in quotes. Use @Trim.
The field type of these fields should be Editable / Computed / Computed when composed.
e. Do not make these fields as Computed for Display. Otherwise the notes document would fail to calculate your access.
f. If you want multiple users to edit or read the documents, in the field properties, you must tick the Allow multiple values in the field properties. This stores the names and the roles as a Text-list and in the form of:
"CN=Gayatri Gouda/OU=IND/O=CS":"CN=Suchi Gouda/OU=IND/O=CS":"[HelpdeskAnalyst]"
g. Use colon (:) to separate values and not semicolon (;) or any other character.
h. Enclose the values in parenthesis ("").

Manager vs Designer

Manager

  1. Can modify the database ACL.
  2. Can encrypt the database.
  3. Can modify replication settings.
  4. Has the right to delete the database.
  5. Can perform all tasks that are allowed to the lower accesses; i.e. Designer, Editor, Author, Reader, Depositor.
Designer

  1. Can modify all the design elements in the database.
  2. Can create a full-text search index in the database properties.
  3. Can perform all the tasks that are allowed to the lower accesses; i.e. Editor, Author, Reader, Depositor.

Ways to Create Response Document

There are 3 ways to create a response document. Each way is in different language. In all the cases both documents remain in/must be in the same database. This is one of the interview question I was asked once.

1 > In Formula Language:
a. @Command([ComposeWithReference]; server : database; form; flags)
- form is the name of the form used to create the response document with and this form must have a rich text field with name as Body.
- This command is called usually from a form action or view action.
- So that it takes the reference of the currently open document or the selected document in the view.

click here for more details.
2 > In Java:
a. public void makeResponse(Document doc) throws NotesException
i.e. responseDoc.makeResponse(parentDoc);
click here for more details
3 > In LotusScript:
a. Call responseDocument.MakeResponse( parentDocument )
click here for more details.