The other day I had to find out whether the design of an database
application is hidden. Unfortunatly there is no property in LotusScript
for that. In the end DXL did the trick.
If you export the design of an database
application with hidden design only the base information about the database
will be there. No single design element is listed. So just be searching
for an entry "<form>" can be figured out whether the design
is hidden. The only false possitiv will be Notes databases
applications without any form at all. But I think that is unlikely.
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
Instead of parsing the DXL we just search
the string for "<form". This is much faster.