Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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


« Previous  ·  1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Strategies > Security (19 articles)
   Incident report: denial of service attack against ConnectedPhotographer.com
   Centralised email encryption at the Domino server level
   Analysis: Spying Chinese temptress steals senior Brit's BlackBerry
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login