23.10.2008
SnTT: Is database design hidden
>>Author: Bernd Hort
>>Ort: Hamburg
URL: http://www.assono.de/blog/d6plinks/Is-Design-HiddenCategory: Show-n-Tell Thursday, Lotus Notes, Entwicklung
If you export the design of an
Function
isDesignHidden(db
As NotesDatabase)
As Boolean
On Error Goto err_handler
Dim session As New NotesSession
Dim DXLExporter As NotesDXLExporter
Dim ncl As NotesNoteCollection
Dim dxlOutput As String
'Input
Set ncl = db.CreateNoteCollection(False)
ncl.SelectForms = True
Call ncl.BuildCollection
Set DXLExporter = session.CreateDXLExporter
DXLExporter.ExitOnFirstFatalError = True
dxlOutput = DXLExporter.Export(ncl)
If Instr(1, dxlOutput, "<form", 1) <> 0 Then
isDesignHidden = False
Else
isDesignHidden = True
End If
Exit Function
err_handler:
Messagebox "Upps! There was an error." & Chr$(10) & Chr$(10) & _
"Procedure: " & Getthreadinfo(1) & Chr$(10) & _
"Error nr.: " & Cstr(Err) & " / Line: " & Cstr(Erl) & Chr$(10) & _
Error, 16, "Error"
Resume err_resume
err_resume:
End
End Function
On Error Goto err_handler
Dim session As New NotesSession
Dim DXLExporter As NotesDXLExporter
Dim ncl As NotesNoteCollection
Dim dxlOutput As String
'Input
Set ncl = db.CreateNoteCollection(False)
ncl.SelectForms = True
Call ncl.BuildCollection
Set DXLExporter = session.CreateDXLExporter
DXLExporter.ExitOnFirstFatalError = True
dxlOutput = DXLExporter.Export(ncl)
If Instr(1, dxlOutput, "<form", 1) <> 0 Then
isDesignHidden = False
Else
isDesignHidden = True
End If
Exit Function
err_handler:
Messagebox "Upps! There was an error." & Chr$(10) & Chr$(10) & _
"Procedure: " & Getthreadinfo(1) & Chr$(10) & _
"Error nr.: " & Cstr(Err) & " / Line: " & Cstr(Erl) & Chr$(10) & _
Error, 16, "Error"
Resume err_resume
err_resume:
End
End Function
Instead of parsing the DXL we just search the string for "<form". This is much faster.

Comments
Just wondering, what happened to the HideDesign property of the Notesreplication class. As you can see in this article { Link } the HideDesign property has been an enhancement to Notes 5.
Maybe it never made it to the final version. I can't save an agent with notesRep.HideDesign. So it is not even an unsupported property.