SnTT: How can you tell if a view is used for soft deletions?

A Lotus Notes® database can be enabled to use soft deletions. This means that when a user deletes a document, it is moved to a special view for a period of time before it is actually deleted.

You create a view containing soft deletions by specifying its type as being “Shared, contains deleted documents” in the Create View dialog box. However, once created, there is no indication in Lotus Domino® Designer that the view has this purpose. How can you identify what views in a database are used for soft deletions?

A view used for soft deletions will have a $Flags value of “l” (lower case L). You can see this by right-clicking the view in Domino Designer and choosing Design Properties. Click the Design tab (third from left) and locate the $Flags field.

This and other $Flags values are undocumented and may change without notice.


SnTT: Is database design hidden (Notes API Solution)

Bernd Hort posted a tipp earlier today on how to programmatically check is the design of a database is hidden. Bernd said that there is no method in LotusScript to do such.

I did a little research and found an older DominoPower article. In Notes 5 IBM introduced some enhancements to the Notesreplication class. Amongst other methods and properties there was a HideDesign property. Anybody knows what has happened to this property?

And I found some Notes API calls to do the trick. I modified the code and here is my solution on how to programmatically check a databases design flag.

Const APIModule = "NNOTES" ' Windows/32 only
Const REPLFLG_HIDDEN_DESIGN = &H0020

Type ReplicaInfo
	ID(1) As Long
	Flags As Integer
	CutoffDays As Integer
	CutoffDate(1) As Long
End Type

Declare Function NSFDbOpen Lib APIModule Alias "NSFDbOpen" _
( Byval P As String, H As Long) As Integer
Declare Function NSFDbClose Lib APIModule Alias "NSFDbClose" _
( Byval H As Long) As Integer
Declare Function OSPathNetConstruct Lib APIModule Alias "OSPathNetConstruct" _
( Byval Z As Long, Byval S As String, Byval F As String, Byval P As String) As Integer
Declare Function NSFDbReplicaInfoGet Lib APIModule Alias "NSFDbReplicaInfoGet" _
( Byval H As Long, R As ReplicaInfo) As Integer
Declare Function NSFDbReplicaInfoSet Lib APIModule Alias "NSFDbReplicaInfoSet" _
( Byval H As Long, R As ReplicaInfo) As Integer

Function IsDesignHidden ( db As NotesDatabase ) As Boolean
	IsDesignHidden = False
	Dim hDB As Long
	Dim R As ReplicaInfo	
	p$ = Space(256)
	OSPathNetConstruct 0, db.Server, db.FilePath, p$
	NSFDbOpen p$, hDB
	NSFDbReplicaInfoGet hDB, R
	If ( Not R.Flags  And REPLFLG_HIDDEN_DESIGN) = 0 Then
		IsDesignHidden = True
	End If
	NSFDbClose hDB
End Function

Now you can call the function. It will return true is design is hidden and false if the database has open design.

Sub Click(Source As Button)
	Dim session As New NotesSession
	Dim db As NotesDatabase
	Dim rep As NotesReplication
	Set db = session.CurrentDatabase
	Msgbox IsDesignHidden(db)
End Sub