|
Hi all. I posted a topic a while ago regarding the messiness of private views in a Notes Client. After quite a bit of research, and some queries to IBM themselves, I've managed to find a middle ground when it comes to viewing private data.
First thing's first. The solution I at last found to work properly, is private folders. Just to recap from my last argument....private Views returned dodgy results, and always seemed to be inconsistent. The alternatives were to use either embedded views that show data using a Single Category, or @SetViewInfo. While this sort of worked, you had the problem of "Select All", searching, slow indexing, etc.
With Private Folders, i managed to eliminate the slow indexing, return the selection and searching capabilities, and most importantly, confirm that they work when the design of the Lotus Notes Application is hidden.
Before I explain how to implement this, I want to make sure everyone understands why we are going this route. One of my projects last year, was to implement a HR Solution that is used by 4000 odd employees. The views in this HR Solution had very technical access rights that needed to be assigned to them. Let's say you have a Salaries View, and when opened, needs to return documents based on usernames and roles. (i.e. only show entries in this view if you have the HRAdmin or Director Role, if it's your own salary Document, or if it's entries of those that work underneath you). Immediately, you can see that setting the Access in the View Properties is out of the question, and the need for a Private View is in order. Readers and Authors fields are also not an option, as you need to see personal details in that associate document. Encrypting fields becomes messy, and annoys users with the prompts, etc. Finally, because private views are somewhat unstable, Private folders need to be implemented.
Now, to implement a Private Folder in your solution, you will need a backend view that categorizes all relevant documents by Usernames that are stored in the names fields in the Notes Form. This view will be used to feed data into the private folder when in use. In the Query Open Event of the Private Folder, you will run a "RunAgent" or "ToolsRunMacro" command, that will initiate an agent that searches the backend view by Username, and populates the data into the Private Folder. Please note, you cannot use LotusScript in the QueryOpen or QueryClose event of the Private Folder, as the Lotusscript will not run when the design of the database is hidden. I learned this the hard way.
Please take note of the following:
1. The Folders you create for the users need to be "Shared, Private on First Use". 2. Users and Groups affected, need to have "Create Personal Folders/View" checked/enabled in the Database's ACL.
Finally, I would suggest adding the code below to the "QueryClose" event in the Database Script. This code will delete all Private Folders for the user, so as to allow new design changes made to the folders reflect immediately. It also keep the database design as clean as posssible. This code is generic, and need not be modified.
I hope this is not too technical, and I hope you get the value from it that I have gotten. I will be more than happy to answer any questions regarding this. You can either leave comments here, or e-mail me at john.jardin@gmail.com
Cheers John
Sub Queryclose(Source As Notesuidatabase, Continue As Variant) ' VARIABLES Dim ss As New NotesSession Dim db As NotesDatabase Dim notecol As NotesNoteCollection Dim doc As NotesDocument Dim nid As String Dim nextid As String Dim i As Integer ' CODE Set db = ss.CurrentDatabase Set notecol = db.CreateNoteCollection(False) notecol.SelectFolders = True Call notecol.BuildCollection nid = notecol.GetFirstNoteId For i = 1 To notecol.Count nextid = notecol.GetNextNoteId(nid) Set doc = db.GetDocumentByID(nid) If Not( doc Is Nothing ) Then If doc.hasItem("$Flags") Then If Instr(doc.~$flags(0),"FYV") Then If doc.~$Readers(0) = ss.UserName Then Call doc.RemovePermanently(True) End If End If End If End If nid = nextid Next Print "Private Folders Deleted" End Sub
|
Ratings
0
|
|
Hi There.
I'm busy with an HR Application, and decided not long ago to use Private Views to sort out my View Access Problems. Basically, I needed to use @Username in my View Selection.
What I found out at the end of the day, is that Private Views, in my opinion, are not the way to go for the following reasons:
1. In most cases, private views are stored in the user's Desktop.dsk file, which means maintenance on these views becomes very messy. 2. When modifications are made to the Private View Design, these changes are not replicated to the user's Private View instances. The solution here is for the user to delete their private views. Now you can see where it gets messy. 3. After attempting to auto delete Private views in about 7 different ways, the result was that private views are never guaranteed to be deleted. There is always a scenario where one of the user's private views decided to stick around. 4. Private Views are very, very slow, because they need to be re-built on every open, so as to collect the latest information from the server. 5. The parameter "Evaluate Actions for every document change" doesn't work in Private Views. 6. Finally, for this blog entry at least, Private views do not work properly with @UserName. I have users who open Private views, and instead of seen 55 that they have access to, they land up seen less. This is different per user. The big kicker here, is that if they delete their private view, all 55 entries return, until the next day when some dissappear again.
I have spent months trying to find help and solutions regarding this. Thanks to Nathan T Freeman for suggesting @SetViewInfo as an alternative. I am currently implementing this in the application in place of the private views, and will definitely provide feedback here.
I hope this entry was not too negative for everyone. The idea is to fish out a positive solution to this, which I've spent months trying to find.
Cheers All, and I wait in anticipation for everyone's feedback.
Modified 2008/10/21 07:00pm - Added another entry to the cons list of using private views.
|
Ratings
0
|
|
Greetings and Salutations to All on BleedYellow. I have the privilege and honor of been part of this site. My name is John Jardin, and I'm born and bred in Joburg, South Africa. i am a huge fan of Lotus Notes Development, amongst other types of coding scenarios.
I am a musician or sorts. I felt this was important to mention, as Nathan Freeman, (AKA - Mr T) so accurately commented recently that there is a mysterious link between music and programming. I play guitar mostly, and also enjoy recording.
Back to the matter at hand:
I would like this opportunity to share my experiences and knowledge on this Blog, more from a coding perspective, as I'm not really regarded as a PRO administrator as yet. I believe there is a ton I can learn from this site, and would in turn, love to give my share.
Anyways, I will be posting my next entry soon, and will try my best to make it a good one. I will always welcome comments and feedback just so everyone knows.
Thanks and hope to hear feedback from anyone out there. Anyone at all.
John
|
Ratings
0
|