23.10.2008

SnTT: Is database design hidden

>>Author:  Bernd Hort
>>Ort:     Hamburg
        
URL: http://www.assono.de/blog/d6plinks/Is-Design-Hidden

Category: Show-n-Tell Thursday, Lotus Notes, Entwicklung


Show-n-Tell Thursday
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.

Comments

#1 >> Leider gibt es in LotusScript keine Eigenschaft

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.
Gravatar Image
#2 There is nothing about that in the help file. Emoticon
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.
Gravatar Image
#3 Here is another solution using Notes API { Link } Gravatar Image

Post A Comment

Comments

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Tags

Deutsche RSS-Feeds (German)

Custom Button Custom Button

English RSS feeds

Custom Button Custom Button