Lotus Notes — рабочий инструмент программиста.

Обсуждения программирования на Lotus Notes/Domino

Archive for Октябрь 29th, 2008

Приложение Lead Manager из IBM Lotus Notes V8: Краткий Ð¾Ð±Ð·Ð¾Ñ€

без комментариев

Узнайте, как можно объединять приложения Lotus Notes и другие технологии для создания унифицированного интерфейса, в котором пользователи могут более эффективно вести своё дело и внедрять в бизнес новаторские решения.

Original source : http://www.ibm.com/developerworks/ru/library/ls-no…

Написано lotusnotes

Октябрь 29, 2008 в 9:13

Опубликовано в Lotus Notes

Get Your Enterprise NAB from the current database ( shorten your code )

без комментариев

Function GetEnterpriseNAB( default As String ) As NotesDatabase
‘ returns the NAB from the server the current Db is on
‘ written by Mike Mortin
Dim s As New NotesSession
Dim db As NotesDatabase
Dim server As String
Dim nname As NotesName ‘ set the default
If default = "" Then default = "Admin01/Operations/CA" ‘ get our parent server to get the NAB
Set db = s.CurrentDatabase
Set nname = New NotesName(db.Server)
server = nname.Common ‘ now, use default server if we are local
If server = "" Then server = default ‘ finally, grab names.nsf from that server
Set GetEnterpriseNAB = New NotesDatabase(server, "names.nsf")
End Function

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Октябрь 29, 2008 в 9:13

Опубликовано в Lotus Notes

Immediate If

без комментариев

Function IIf (condition As Variant, trueCondition As Variant, falseCondition As Variant) As Variant
‘ such a basic function for all other programming languages … stands for "Immediate IF"
‘ written by Mike Mortin
If condition Then
If Isobject(TrueCondition) Then
Set IIf = trueCondition
Else
IIf = trueCondition
End If
Else
If Isobject(TrueCondition) Then
Set IIf = falseCondition
Else
IIf = falseCondition
End If
End If
End Function

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Октябрь 29, 2008 в 9:13

Опубликовано в Lotus Notes

Get all the servers in a cluster

без комментариев

Function GetClusterServers(server As String, getAllServers As Boolean) As Variant
Dim s as New NotesSession
Dim cluster As String
Dim serverDoc As NotesDocument
Dim serverName As NotesName
Dim key(1 To 2) As Variant
Dim navdoc As NotesViewEntry
Dim nav As NotesViewNavigator ‘ define domain and name as per the default "Servers" view
Set serverName = New NotesName(server)
key(1) = serverName.Organization
key(2) = serverName.Abbreviated
Set serverDoc = GetDocFromDb(s.CurrentDatabase, "Servers", key, True) ‘ get a list of servers in the same cluster
cluster = serverDoc.ClusterName(0)
Set nav = GetCategoryDocsFromDb(currentDb, "Clusters", cluster) ‘ go through the category, add names to replica list
Set navdoc = nav.GetFirstDocument()
While Not navdoc Is Nothing
Set serverDoc = navdoc.Document
If serverDoc.ServerName(0) <> server Or getAllServers Then
Set serverName = New NotesName(serverDoc.ServerName(0))
GetClusterServers = GetClusterServers & serverName.Abbreviated & ","
End If
Set navdoc = nav.GetNextDocument(navdoc)
Wend ‘ tighten up the list
GetClusterServers = Split(GetClusterServers, ",")
GetClusterServers = Fulltrim(GetClusterServers)
End Function

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Октябрь 29, 2008 в 9:13

Опубликовано в Lotus Notes

grab category docs from a database ( shorten your code )

без комментариев

Function GetCategoryDocsFromDb( db As NotesDatabase, viewName As String, category As String ) As NotesViewNavigator
‘ returns all docs from a given category
‘ written by Mike Mortin Dim view As NotesView ‘ get the view
Set view = db.GetView(viewName) ‘ get the docs from the cateogry
Set GetCategoryDocsFromDb = view.CreateViewNavFromCategory( category )
End Function

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Октябрь 29, 2008 в 9:13

Опубликовано в Lotus Notes

grab a document from a database ( shorten your code )

без комментариев

Public Function GetDocFromDb( db As NotesDatabase, viewName As String, key() As Variant, exact As Boolean ) As NotesDocument
‘ returns the first doc based on a search key
‘ written by Mike Mortin
Dim view As NotesView ‘ get the view
Set view = db.GetView(viewName) ‘ get the doc from the key
Set GetDocFromDb = view.GetDocumentByKey(key, exact)
End Function

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Октябрь 29, 2008 в 9:13

Опубликовано в Lotus Notes

returns a date the document/email should be considered created

без комментариев

Public Function GetEmailCreatedDate(doc As NotesDocument) As String
‘ returns a date the document/email should be considered created
‘ written by Mike Mortin 20080625
If doc.DeliveredDate(0) <> "" Then
GetEmailCreatedDate = doc.DeliveredDate(0)
Elseif doc.PostedDate(0) <> "" Then
GetEmailCreatedDate = doc.PostedDate(0)
Else
GetEmailCreatedDate = doc.Created
End If
End Function

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Октябрь 29, 2008 в 9:13

Опубликовано в Lotus Notes