Changing a Lotus Notes view’s status from private to shared
We recently received an interesting question from one of our customers:
“Is it possible to toggle the private/public setting for views using Ytria viewEZ?”
Sadly, the answer is no.
The only way to change a view from private to public (or vice-versa) is to create a new view in Domino Designer with the desired private/public setting and then delete the original.
But here’s a little background on why our tools can’t do this:
The Anatomy of a Private View
There are three key things involved in making a view ‘private.’
1) There must be a “V” in the view’s $Flag field.
$Flag value for a private views (shown in scanEZ)
2) There must be a $Readers field and an $Authors field with the name of the private view’s ‘owner.’
3) And finally, there must be a special “View Private” Class (if you want to get technical: 1008 in hexadecimal–‘8′ means “view” and “1000” indicates “private”).
It’s condition number three that prevents us from easily toggling the private/shared status. It’s impossible to modify a note’s class; you absolutely must create a new note if you want to define a class.
Why Agents and not Views?
Our scanEZ tool has a ‘Share/UnShare’ button for agents which works by replacing the original agent with a copy that is identical except for its new Private/Shared Class status and its UNID (we of course pop up a warning about that UNID change).
So, you might be wondering, why couldn’t we just do the same thing for views and folders?
The problem is that views (and folders) are just so darn complex. There’s a lot of stuff under the hood of a view (or a folder) that could be implicated in such an operation. Depending on your circumstances, a view or folder could contain an utterly enormous index. Deleting and regenerating these indexes is a heavy operation that can bring a production server to its knees—so we decided that having a shiny Share/UnShare toggle button for views and folders was too problematic.
What to do?
So back to the original issue: You’ve got a private view and you want to make it shared (or vice-versa).
We think the best way to go about this would be as follows:
- Choose the New View option in Domino Designer.
- Click the Copy From option button to choose view you want to replace.
- Fill in the view name (you’ll probably want it to be the same as the view you’re replacing).
- Pick the appropriate View type then click OK.
5. Now that you’ve created a replacement view, you just need to delete the original. This is where Ytria viewEZ may come in handy: You can use its Actions>Purge View Index option to get rid of the old view’s index without tying up your Designer Client.
Nice article. The info about what makes a view private is also useful. I’ve spent some time (not much admittedly) looking for a stable and consistent method to delete ‘shared private on first use’ views (so they can be rebuilt with a new design) and have not found a combination of $Flag values that do this. They seem to change across versions. I might be bale to do it by looking at the Class and $Reader and $Author fields.
Any tips on that?
Paul
Hi Paul,
Thanks for the kind words.
Your question inspired a new post. Check it out here.
Have a nice day.