Email:   
Home
In This Issue
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.
Advanced encryption techniques (continued)

FIGURE B

The Current Salary form holds the current salary information for each employee. Click 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. Click 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. Click 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




[ Prev | Next ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

2-Minute Tutorials
How do I...

  • integrate MS Office or OpenOffice with Notes?
  • create cross-tab reports and charts?
  • print serial letters and mailing labels?
  • create PDFs in Lotus Notes?


Check out the 2-minute tutorials here.
-- Advertisement --

Virtual Meeting - Integrating Sharepoint With Lotus Notes: Strategic Coexistence
No more hassles accessing SharePoint documents from Notes! Mainsoft SharePoint Integrator combines SharePoint document sharing, collaboration, and record management capabilities with Notes emails. Preview version 1.5 during our October 7th Virtual Meeting. Learn to incorporate Notes emails and attachments into a MOSS-based record management site, without migrating to Outlook.

Register to attend today.
Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login