Option Public Option Declare '/**------------------------------------------------------------------------------------------ ' * Object DbPickList ' * @author Pierre Koerber ' * @version 1.0 - 07.09.2009 ' * ' * Allows to easily create picklist on a database ' * ' * History : ' */------------------------------------------------------------------------------------------ Class DbPickList Private se As notessession Private db As notesdatabase Private ws As NotesUIWorkspace Private dc As notesdocumentcollection Private sView As String Private sTitle As String Private sPhrase As String Private sCat As String Private iPickListMultiple As Integer '*--------------------------------------------------------------------------------------- '* CONSTRUCTOR / DESTRUCTOR '*--------------------------------------------------------------------------------------- Sub new(pdb As notesdatabase) Set se = New notessession Set ws = New notesuiworkspace If pdb Is Nothing Then Set db = se.currentdatabase End If End Sub '*--------------------------------------------------------------------------------------- '* Virual function to override '*--------------------------------------------------------------------------------------- Public Function getSingleDocument() As notesdocument Call unsetMultiple() If sView = "" Then Exit Function If db.GetView(sView) Is Nothing Then Exit Function Call do_pickList() If dc Is Nothing Then Exit Function If dc.count = 0 Then Exit Function Set getSingleDocument = dc.GetFirstDocument End Function Public Function getMultipleDocuments() As notesdocumentcollection Call setMultiple() If sView = "" Then Exit Function If db.GetView(sView) Is Nothing Then Exit Function Call do_pickList() If dc Is Nothing Then Exit Function Set getMultipleDocuments = dc End Function '*--------------------------------------------------------------------------------------- '* PickList functions for dc '*--------------------------------------------------------------------------------------- Private Function do_pickList() As notesdocumentcollection Dim pickPara(3) As String pickPara(0) = sView pickPara(1) = getTitle() pickPara(2) = getPhrase() pickPara(3) = sCat Set dc = ws.PickListCollection(PICKLIST_CUSTOM, iPickListMultiple, db.Server, db.FilePath, pickPara(0), pickPara(1), pickPara(2),pickPara(3) ) Set do_pickList = dc End Function '*--------------------------------------------------------------------------------------- '* Getters / Setters '*--------------------------------------------------------------------------------------- Public Function setView(psView As String) As Integer sView = psView End Function '*--------------------------------------------------------------------------------------- '* Getters / Setters '*--------------------------------------------------------------------------------------- Public Function setCategory(psCat As String) As Integer sCat = psCat End Function Public Function unsetMultiple() As Integer iPickListMultiple = False End Function Public Function setMultiple() As Integer iPickListMultiple = True End Function Public Function setTitle(psTitle As String) As Integer sTitle = psTitle End Function Public Function getTitle() As String If sTitle = "" Then sTitle = db.Title End If getTitle = sTitle End Function Public Function setPhrase(psPh As String) As Integer sPhrase = psPh End Function Public Function getPhrase() As String If sPhrase = "" Then sPhrase = " " End If getPhrase = sPhrase End Function End Class