|
|
|
|
|
|
|
|
|
|
|
|
|
|
Advanced encryption techniques (continued)
FIGURE B
 
The Current Salary form holds the current salary information for each employee. Roll over picture for a larger image.
The Salary Range form will have three fields, Name, SalaryRangeLow, and SalaryRangeHigh, as shown in Figure C. SalaryRangeLow and SalaryRangeHigh are encrypted. Here, again, the Name field acts as a foreign key back to the Employee form for lookups.
FIGURE C
 
The Salary Range form contains salary range information for each employee. Roll over picture for a larger image.
The Employee form will have Computed For Display versions of the three encrypted fields. The idea is that Mary will be able to see all three fields together on the Employee form. When John and Lisa want to change the values of these fields, they will do so on the two new forms. Simply set up encryption on the new forms as explained in my September article. Note that the fields on the Employee form will not be encrypted. There's no need since they're Computed For Display fields.
Having the information stored on different forms allows us to use different encryption keys. John will have an encryption key for the Salary Range form. Lisa will have a key for the Current Salary form. Mary will have both keys. You will need to create these keys if they don't already exist. Again, refer back to my September articlefor details.
Now, all we need to do is have the encrypted information show up in the Computed For Display fields on the Employee documents. To do so we'll need to write some LotusScript. In particular, we'll add code to the Queryopen event on the Employee form, as shown in Figure D.
FIGURE D
 
Add code to the Queryopen event on the Employee form. Roll over picture for a larger image.
Here's the complete script text:
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim thisDoc As NotesDocument
Dim currentSalaryDoc As NotesDocument
Dim salaryRangeDoc As NotesDocument
Dim currentSalaryView As NotesView
Dim salaryRangeView As NotesView
Dim item As NotesItem
Dim encrItem As NotesItem
If (Source.IsNewDoc) Then
' There's no back end document yet... nothing to do.
Exit Sub
End If
Set thisDoc = Source.Document
Set db = s.CurrentDatabase
' Get the current salary and plug it in
Set currentSalaryView = db.GetView ("Current Salaries")
Set currentSalaryDoc = currentSalaryView.GetDocumentByKey (thisDoc.GetItemValue ("Name"))
If (Not currentSalaryDoc Is Nothing) Then
Set encrItem = currentSalaryDoc.GetFirstItem ("CurrentSalary")
If (Not encrItem Is Nothing) Then
Set item = New NotesItem (thisDoc, "CurrentSalary", encrItem.Values (0))
item.SaveToDisk = False
End If
End If
' Get the salary range values and plug them in
Set salaryRangeView = db.GetView ("Salary Ranges")
Set salaryRangeDoc = salaryRangeView.GetDocumentByKey (thisDoc.GetItemValue ("EmpNum"))
If (Not salaryRangeDoc Is Nothing) Then
Set encrItem = salaryRangeDoc.GetFirstItem ("SalaryRangeLow")
If (Not encrItem Is Nothing) Then
Set item = New NotesItem (thisDoc, "SalaryRangeLow", encrItem.Values (0))
item.SaveToDisk = False
End If
Set encrItem = salaryRangeDoc.GetFirstItem ("SalaryRangeHigh")
If (Not encrItem Is Nothing) Then
Set item = New NotesItem (thisDoc, "SalaryRangeHigh", encrItem.Values (0))
item.SaveToDisk = False
End If
End If
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|