Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

suvorina_tv_razrabotka-podsistemy-monitoringa-sistemy-elektronnogo-dokumentooborota-companymedia-4x_31656

.pdf
Скачиваний:
11
Добавлен:
14.01.2018
Размер:
1.35 Mб
Скачать

ErrorВ 1, "

настройкеСМ -агентанеуказанкод репликибазыСтруктураСистемы." ' "no

system database replica id" Else

Set sysDb = GetDatabaseByReplicaID (startAgentServer.Canonical, sysReplicaId)

If sysDb Is Nothing

Then

ErrorНе 1, "

найденабазаСтруктураСистемыкодом

реплики" + sysReplicaId ' "no system database " + sysReplicaId

Else

Set sysView = sysDb.GetView ("(BySORepIDAndPPRepID)")

Is Nothing Then

 

If

sysView

 

 

 

 

ErrorВбазеСтру1, "

 

 

 

ктура

Системыненайденвид

 

 

 

 

 

(BySORepIDAndPPRepID)"

'

"system

database

structure

 

error:

no

(BySORepIDAndPPRepID) view"

 

 

 

 

End If

End If

 

 

End If

 

 

 

 

 

 

 

 

 

Let

orgReplicaId

=

setupAgentNote.GetItemValue

 

 

("OrgDBReplID") (0)

 

 

 

 

 

If orgReplicaId = "" Then

 

 

Error

В

1,

"

настройкеСМ

-агентанеуказанкод

 

 

 

репликибазыСтруктураОрганизации." '

 

 

 

 

"no organization database replica id in " + setupAgentNote.ParentDatabase.ReplicaID

Else

Set orgDb = GetDatabaseByReplicaID (startAgentServer.Canonical, orgReplicaId)

If orgDb Is Nothing

Then

ErrorНе 1, "

найденабазаСтруктураОрганизациис

кодомреплики" + orgReplicaId ' "no organization database " + orgReplicaId

Else

If Not

GetOrgSettings (startAgentServer.Canonical, orgReplicaId) = sysReplicaId Then

ErrorНесовместимыебазы1, " СтруктураСистемы" + sysReplicaId + "

СтруктураОрганизации" + orgReplicaId +

"" ' "system database " + sysReplicaId + " and organization database " + orgReplicaId + " conflict"

End If

End If

End If

Let targetReplicaId = setupAgentNote.GetItemValue ("DBReplID")

(0)

If targetReplicaId = "" Then ErrorВ 1, "

настройкеСМ -агентанеуказанкод репликицелевойбазы." ' "no target database replica id"

Else

Set targetDb = GetDatabaseByReplicaID (startAgentServer.Canonical, targetReplicaId)

If targetDb Is

Nothing Then

ErrorНе 1, "

найденацелеваябазаскодомреплики"

+ targetReplicaId ' "no target database " + targetReplicaId

End If

End If

%REM

If Iselement (cmagmaAgentList (startAgentName)) Then

'запускаетсяиз

CMAgMa

End If

%END REM

Let targetType = setupAgentNote.GetItemValue ("TypeDB")

(0)

If targetType = "1" Then 'SS If Not sysView Is

Nothing And Not targetReplicaId = "" Then Set

targetProgramNote = sysView.GetDocumentByKey (orgReplicaId + "%" + targetReplicaId)

If targetProgramNote Is Nothing Then

'Error 1, "no target database registration in system database"

'Error 1, "no target database '" + orgReplicaId + "%" + targetReplicaId + "' in

61

system database " + sysDb.Server + ", " + sysDb.Filepath + ", view " + sysView.Name

ErrorВуказбазе1,нной" СтруктураСисотсутствуетемы регистрацияцелевойбазы."

End If

End If

End If

End If ExitSub:

Exit Sub ErrorHandler:

'HandleProcedureError

Call ReportProblem (out, setupAgentNote, GetSimpleErrorMessage)

Resume ExitSub End Sub

Private Sub ProcessCMAgMaDbNote (cmagmaDbNote As NotesDocument, out As DocumentProcessor)

Dim cmagmaDbServer As NotesName

Dim cmagmaDbFilepath As String Dim cmagmaDbReplicaID As String Dim cmagmaDb As NotesDatabase Dim cmagmaAgents As Variant

Dim setupAgentCollection As NotesDocumentCollection

Dim setupAgentNote As NotesDocument

Dim v As Variant

On Error Goto ErrorHandler

Set cmagmaDbServer = New NotesName (cmagmaDbNote.GetItemValue ("Server") (0))

Let cmagmaDbFilepath = cmagmaDbNote.GetItemValue ("Pathname") (0)

Let cmagmaDbReplicaID = Evaluate0 ({@ReplaceSubstring (@Text (ReplicaID; "*"); ":"; "")}, cmagmaDbNote)

If Not session.IsOnServer Or cmagmaDbServer.Canonical = currentServer.Canonical Then

If cmagmaDbReplicaID = ""

Then

ErrorНеткода1, "

репликивзаписиобазевкаталоге" ' "No

replica id in catalog note " + cmagmaDbNote.UniversalID

End If

Set cmagmaDb = GetDatabaseByReplicaID (cmagmaDbServer.Canonical, cmagmaDbReplicaID)

If cmagmaDb Is Nothing

Then

ErrorНе 1, "

найденабазаCMAgMaскодомреплики"

+ cmagmaDbReplicaID ' "No CMAgMa database " + cmagmaDbReplicaID

End If

Call ProcessCMAgMaDb (cmagmaDb, "", out)

End If ExitSub:

Exit Sub ErrorHandler:

'HandleProcedureError

Call ReportProblem (out, cmagmaDbNote, GetSimpleErrorMessage)

Resume ExitSub End Sub

Private Function GetDatabaseByReplicaID (server As String, replicaID As String) As NotesDatabase

Static dbCache List As NotesDatabase

Dim db As NotesDatabase Dim tag As String

On Error Goto ErrorHandler

Let tag = replicaID + " on " + Lcase

(server)

If Not Iselement (dbCache (tag))

Then

Set db = New NotesDatabase ("", "")

If db.OpenByReplicaID (server, replicaID) Then

Set dbCache (tag) =

db

Else

Set dbCache (tag) =

Nothing

End If

End If

Set GetDatabaseByReplicaID = dbCache (tag)

Exit Function ErrorHandler:

HandleProcedureError End Function

Private Function Evaluate0 (formula As String, context As Variant) As Variant

Dim v As Variant

Let v = Evaluate (formula, context)

62

Let Evaluate0 = v (0) End Function

Private Function GetOrgSettings (server As String, replicaID As String) As String

Static settingsCache List As String Dim db As NotesDatabase

Dim tag As String

Dim orgDb As NotesDatabase

Dim orgSettingsView As notesView Dim orgSettingsNote As

NotesDocument

On Error Goto ErrorHandler

Let tag = replicaID + " on " + Lcase

(server)

If Not Iselement (settingsCache (tag)) Then

Let settingsCache (tag) = "" Set orgDb = GetDatabaseByReplicaID (server, replicaID)

If orgDb Is Nothing Then 'Error 1, "no org

database " + replicaID

ErrorНе 1, "

найденабазаСтруктураОрганизации" + replicaID

Else

Set orgSettingsView = orgDb.GetView ("(Settings)")

If orgSettingsView

Is Nothing Then

'Error 1, "no (Settings) view in org database " + replicaID

Error 1,Не"

найденвид(Settings)вбазеСтруктура Организации" + replicaID

Else

Set orgSettingsNote = orgSettingsView.GetFirstDocument

If orgSettingsNote Is Nothing Then

'Error 1, "no settings document in

org database " + replicaID

 

 

ErrorНенайдендокумент1, "

 

 

настроеквбазеСтруктураОрганизации"

 

 

+ replicaID

 

Else

 

 

 

 

Let

settingsCache

(tag)

=

orgSettingsNote.GetItemValue ("SSRepID")

(0)

If

settingsCache (tag) = "" Then

'Error 1, "no system replica id in settings document in org database " + replicaID

ErrorНеткодарелики1,базы" СтруктураСистемывнастройкахбазы СтруктураОрганизации" + replicaID

End

If

End If

End If

End If

End If

Let GetOrgSettings = settingsCache

(tag)

Exit Function

ErrorHandler:

HandleProcedureError

End Function

Private Sub ProcessCMAgMaDb (cmagmaDb As NotesDatabase, startAgentName As String, out As DocumentProcessor)

Dim cmagmaDbServer As NotesName

'Dim cmagmaDbFilepath As String 'Dim cmagmaDbReplicaID As String 'Dim cmagmaDb As NotesDatabase Dim cmagmaAgents As Variant Dim agentList List As String

'Dim cmagmaAgentList List As NotesAgent

Dim setupAgentCollection As NotesDocumentCollection

Dim setupAgentNote As NotesDocument

Dim v As Variant

On Error Goto ErrorHandler

Forall a In afserverAgentList agentList (Listtag (a)) = a

End Forall

Set cmagmaDbServer = New NotesName (cmagmaDb.Server)

If startAgentName = "" Then

Let cmagmaAgents = cmagmaDb.Agents

63

If Isarray (cmagmaAgents)

Then

Forall agent In

cmagmaAgents

If agent.Trigger = TRIGGER_SCHEDULED And agent.IsEnabled Then

agentList (agent.Name + "@" + agent.ServerName) = agent.Name + "@" + agent.ServerName

End If End Forall Erase

cmagmaAgents

End If

Forall a In agentList Set

setupAgentCollection = cmagmaDb.Search ({Form = "SetupAgent" & ! Met = "1" & NameAgent + "@" + StartServer = "} + a + {"}, Nothing, 0)

Set setupAgentNote = setupAgentCollection.GetFirstDocument

Do Until setupAgentNote Is Nothing

Call ProcessSetupAgentNote (setupAgentNote, out)

Set setupAgentNote = setupAgentCollection.GetNextDocument (setupAgentNote)

Loop End Forall

Else

Set setupAgentCollection = cmagmaDb.Search ({Form = "SetupAgent" & NameAgent = "} + startAgentName + {"}, Nothing, 0)

Set setupAgentNote = setupAgentCollection.GetFirstDocument

Do Until setupAgentNote Is

Nothing

Call ProcessSetupAgentNote (setupAgentNote, out)

Set setupAgentNote = setupAgentCollection.GetNextDocument (setupAgentNote)

Loop

End If

ExitSub:

Exit Sub

ErrorHandler: HandleProcedureError

End Sub

Private Sub ProcessAFServerProcessNote (afsAFServerProcessNote As NotesDocument, out As DocumentProcessor)

Dim cmagmaDbServer As NotesName

Dim cmagmaDbFilepath As String Dim cmagmaDbReplicaID As String Dim cmagmaDb As NotesDatabase Dim startAgentName As String

Dim cmagmaAgents As Variant

Dim setupAgentCollection As NotesDocumentCollection

Dim setupAgentNote As NotesDocument

Dim v As Variant

On Error Goto ErrorHandler

Set cmagmaDbServer = New NotesName (afsAFServerProcessNote.GetItemValue ("Process_Server") (0))

Let cmagmaDbReplicaID = afsAFServerProcessNote.GetItemValue ("CMAgMa_ReplicaId") (0)

Let startAgentName = afsAFServerProcessNote.GetItemValue ("StartAgentName") (0)

If Not session.IsOnServer Or cmagmaDbServer.Canonical = currentServer.Canonical Then

If cmagmaDbReplicaID = ""

Then

'Error 1, "No replica id in process note " + afsAFServerProcessNote.UniversalID

ErrorНеуказан1, "

кодрепликибазыCMAgMaвдокументе

процессаAFServer: " + afsAFServerProcessNote.GetItemValue ("Process_Name") (0)

64

End If

Set cmagmaDb = GetDatabaseByReplicaID (cmagmaDbServer.Canonical, cmagmaDbReplicaID)

If cmagmaDb Is Nothing

Then

Error 1, "No CMAgMa database " + cmagmaDbReplicaID

End If

If startAgentName = "" Then Error 1, "No start

agent name " + cmagmaDbReplicaID End If

Call ProcessCMAgMaDb (cmagmaDb, startAgentName, out)

End If

ExitSub:

Exit Sub

ErrorHandler:

'HandleProcedureError

Call ReportProblem (out, afsAFServerProcessNote, GetSimpleErrorMessage)

Resume ExitSub End Sub

Private Sub SearchInCatalog (db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

Dim catalogDb As NotesDatabase Dim processCollection As

NotesDocumentCollection

Dim processNote As NotesDocument

Dim cmagmaDbCollection As NotesDocumentCollection

Dim cmagmaDbNote As NotesDocument

On Error Goto ErrorHandler

Set session = New NotesSession Set currentServer = New

NotesName (db.Server)

Set afserverDb = New NotesDatabase (currentServer.Canonical, "afserver.nsf")

Set processCollection = afserverDb.Search ({Form = "Process" & ProcessSwitch="1"}, Nothing, 0)

Set processNote = processCollection.GetFirstDocument

Do Until processNote Is Nothing Call

ProcessAFServerProcessNote (processNote, out)

Set processNote = processCollection.GetNextDocument (processNote)

Loop

Set catalogDb = db

Set cmagmaDbCollection = catalogDb.Search ( _

{@Contains (@LowerCase (Title : Pathname : DbTemplateName : DbInheritTemplateName); "cmagma")}, Nothing, 0)

Set cmagmaDbNote = cmagmaDbCollection.GetFirstDocument

Do Until cmagmaDbNote Is Nothing

Call ProcessCMAgMaDbNote (cmagmaDbNote, out)

'If problemCount >= 50

Then Exit Sub

Set cmagmaDbNote = cmagmaDbCollection.GetNextDocument (cmagmaDbNote)

Loop

'Call out.ProcessDocument (document) method for all source documents

Exit Sub

ErrorHandler: HandleProcedureError

End Sub

Private Sub SearchInCMAgMa (db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

Dim catalogDb As NotesDatabase Dim afserverDb As NotesDatabase Dim processCollection As

NotesDocumentCollection

Dim processNote As NotesDocument

65

Dim processKey As String

Dim cmagmaDbCollection As NotesDocumentCollection

Dim cmagmaDbNote As NotesDocument

On Error Goto ErrorHandler

If session Is Nothing Then

Set session = New

NotesSession

If session.IsOnServer Then Set currentServer =

New NotesName (session.UserName)

Else

Set currentServer = New NotesName (session.CurrentDatabase.Server)

End If

Set afserverDb = New NotesDatabase (currentServer.Canonical, "afserver.nsf")

If afserverDb.IsOpen Then Set

processCollection = afserverDb.Search ({Form = "Process" & ProcessSwitch="1"}, Nothing, 0)

Set processNote = processCollection.GetFirstDocument

Do Until

processNote Is Nothing

Let

processKey = _

processNote.GetItemValue ("StartAgentName") (0) + "@" + _

processNote.GetItemValue ("Process_Server") (0)

Let afserverAgentList (processKey) = processKey

Set processNote = processCollection.GetNextDocument (processNote)

Loop

End If

End If

Call ProcessCMAgMaDb (db, "",

out)

Exit Sub

ErrorHandler:

HandleProcedureError

End Sub

Probe Uniqueness of DocID

Public Sub Search (db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

Dim session As New NotesSession

Dim view As NotesView

Dim note1 As NotesDocument

Dim note2 As NotesDocument

Dim value1 As Variant

Dim value2 As Variant

Dim equalCount As Long

On Error Goto ErrorHandler

Set view = db.GetView ("(AllById)") If view Is Nothing Then

MessageboxВбазе'" + " db.неTitleнайденвид(AllById)",+ "' 16, session.CurrentDatabase.Title

Exit Sub

End If

Set note1 = view.GetFirstDocument Do Until note1 Is Nothing

Let value1 = note1.ColumnValues (0)

If Not note2 Is Nothing Then If value2 = value1

Or equalCount > 0 Then

Call

out.ProcessDocument (note2) End If

If value2 = value1

Then

Let

equalCount = equalCount + 1 Else

Let

equalCount = 0

End If

End If

Set note2 = note1 Let value2 = value1

Set note1 = view.GetNextDocument (note2)

Loop

If equalCount > 0 Then

Call out.ProcessDocument

(note2)

End If Exit Sub

66

ErrorHandler:

Error Err, Error + " (" + Cstr

(Getthreadinfo (1)) + " " + Cstr (Erl) + ")"

End Sub

Probe Uniqueness of ReplicaID

Option Declare

Use "DocumentProcessor" Use "ErrorHandler"

Use "Utilities"

Public Sub Search (db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

Dim view As NotesView

Dim note1 As NotesDocument Dim note2 As NotesDocument Dim value1 As Variant

Dim value2 As Variant Dim equalCount As Long

Set view = db.GetView ("($ReplicaID)")

Set note1 = view.GetFirstDocument Do Until note1 Is Nothing

Let value1 = note1.ColumnValues (0) + " on " + note1.GetItemValue ("Server") (0)

If Not note2 Is Nothing Then If value2 = value1

Or equalCount > 0 Then

Call

out.ProcessDocument (note2) End If

If value2 = value1

Then

Let

equalCount = equalCount + 1 Else

Let

equalCount = 0

End If

End If

Set note2 = note1 Let value2 = value1

Set note1 = view.GetNextDocument (note2)

Loop End Sub

Probe Uniqueness of TemplateName

Option Declare

Use "DocumentProcessor"

Use "ErrorHandler"

Use "Utilities"

Public Sub Search (db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

Dim view As NotesView

Dim note1 As NotesDocument Dim note2 As NotesDocument Dim value1 As Variant

Dim value2 As Variant Dim equalCount As Long

Set view = db.GetView ("($DbTemplateName)")

If view Is Nothing Then ErrorНенайденвид1, "

($DbTemplateName)в базе" + db.Title End If

Set note1 = view.GetFirstDocument Do Until note1 Is Nothing

Let value1 = note1.ColumnValues (0) + " on " + note1.ColumnValues (1)

If Not note2 Is Nothing Then If value2 = value1

Or equalCount > 0 Then

Call

out.ProcessDocument (note2) End If

If value2 = value1

Then

Let

equalCount = equalCount + 1 Else

Let

equalCount = 0

End If

End If

Set note2 = note1 Let value2 = value1

Set note1 = view.GetNextDocument (note2)

Loop

End Su

Probe Database Changes

Option Declare

Use "DocumentProcessor" Use "ErrorHandler"

Public Sub Search (db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

Dim dbCollection As NotesDocumentCollection

67

Dim dbNote As NotesDocument

Dim n As Long

Dim k As Long

On Error Goto ErrorHandler

Set session = New NotesSession Set currentServer = New

NotesName (db.Server)

Set dbCollection = db.Search ({Form = "Notefile" & DbNumDocuments >= } + Cstr (paramNote.GetItemValue ("MinTotalCount") (0)) + {}, Nothing, 0)

Let n = dbCollection.Count

Set dbNote = dbCollection.GetFirstDocument

Do Until dbNote Is Nothing

Let k = k + 1

Call ProcessCatalogDbNote (dbNote, paramNote, out)

Set dbNote = dbCollection.GetNextDocument (dbNote)

Loop Exit Sub

ErrorHandler: HandleProcedureError

End Sub

Public Sub Search (db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

Dim dbCollection As NotesDocumentCollection

Dim dbNote As NotesDocument Dim n As Long

Dim k As Long

On Error Goto ErrorHandler

Set session = New NotesSession Set currentServer = New

NotesName (db.Server)

Set dbCollection = db.Search ({Form = "Notefile" & DbNumDocuments >= } + Cstr (paramNote.GetItemValue ("MinTotalCount") (0)) + {}, Nothing, 0)

Let n = dbCollection.Count

Set dbNote = dbCollection.GetFirstDocument

Do Until dbNote Is Nothing

Let k = k + 1

Call ProcessCatalogDbNote (dbNote, paramNote, out)

Set dbNote = dbCollection.GetNextDocument (dbNote)

Loop Exit Sub

ErrorHandler: HandleProcedureError

End Sub

Private Function GetDatabaseByReplicaID (server As String, replicaID As String) As NotesDatabase

Static dbCache List As NotesDatabase

Dim db As NotesDatabase Dim tag As String

On Error Goto ErrorHandler

Let tag = replicaID + " on " + Lcase

(server)

If Not Iselement (dbCache (tag))

Then

Set db = New NotesDatabase ("", "")

If db.OpenByReplicaID (server, replicaID) Then

Set dbCache (tag) =

db

Else

Set dbCache (tag) =

Nothing

End If

End If

Set GetDatabaseByReplicaID = dbCache (tag)

Exit Function

ErrorHandler: HandleProcedureError

End Function

Private Sub ProcessCatalogDbNote (dbNote As NotesDocument, paramNote As NotesDocument, out As DocumentProcessor)

Dim session As NotesSession Dim db As NotesDatabase

Dim currentTime As NotesDateTime Dim cutoffTime As NotesDateTime Dim collection1 As

NotesDocumentCollection

Dim collection2 As NotesDocumentCollection

68

On Error Goto ErrorHandler

Set currentTime = New NotesDateTime ("")

Call currentTime.SetNow

Set cutoffTime = New NotesDateTime ("")

Call cutoffTime.SetNow

Call cutoffTime.AdjustDay (-1)

Set db = TryOpenDb (dbNote.GetItemValue ("Server") (0), dbNote.GetItemValue ("Pathname") (0))

If Not db Is Nothing Then

Set collection1 = db.AllDocuments

Set collection2 = db.Search ({@All}, cutoffTime, 0)

If collection2.Count * 100 >= collection1.Count * paramNote.GetItemValue ("MinChangesPercentage") (0) Then

Call dbNote.ReplaceItemValue ("tmpTotalCount", collection1.Count)

Call dbNote.ReplaceItemValue ("tmpChangedCount", collection2.Count)

Call out.ProcessDocument (dbNote)

End If

End If Exit Sub

ErrorHandler: HandleProcedureError

End Sub

Private Function TryOpenDb (server As String, filepath As String) As NotesDatabase Dim db As NotesDatabase

On Error Goto ErrorHandler

Set db = New NotesDatabase ("", "") If db.Open (server, filepath) Then

Set TryOpenDb = db

End If

ExitFunction:

Exit Function

ErrorHandler:

Resume ExitFunction

End Function

Private Sub ProcessCatalogDbNote (dbNote As NotesDocument, paramNote As NotesDocument, out As DocumentProcessor)

Dim session As NotesSession Dim db As NotesDatabase

Dim currentTime As NotesDateTime Dim cutoffTime As NotesDateTime Dim collection1 As

NotesDocumentCollection

Dim collection2 As NotesDocumentCollection

On Error Goto ErrorHandler

Set currentTime = New NotesDateTime ("")

Call currentTime.SetNow

Set cutoffTime = New NotesDateTime ("")

Call cutoffTime.SetNow

Call cutoffTime.AdjustDay (-1)

Set db = TryOpenDb (dbNote.GetItemValue ("Server") (0), dbNote.GetItemValue ("Pathname") (0))

If Not db Is Nothing Then

Set collection1 = db.AllDocuments

Set collection2 = db.Search ({@All}, cutoffTime, 0)

If collection2.Count * 100 >= collection1.Count * paramNote.GetItemValue ("MinChangesPercentage") (0) Then

Call dbNote.ReplaceItemValue ("tmpTotalCount", collection1.Count)

Call dbNote.ReplaceItemValue ("tmpChangedCount", collection2.Count)

Call out.ProcessDocument (dbNote)

End If

End If Exit Sub

Probe Uniqueness

Option Declare

Use "DocumentProcessor" Use "ErrorHandler"

Use "Utilities"

Public Sub Search (db As NotesDatabase, dbType As String, paramNote As

69

NotesDocument, out As DocumentProcessor)

Dim viewServer As NotesName Dim viewFilepath As String Dim viewName As String

Dim viewColumns As Variant Dim viewDb As NotesDatabase Dim view As NotesView

Dim viewColumnIndexes As Variant Dim curNote As NotesDocument Dim prevNote As NotesDocument Dim curDigest As String

Dim prevDigest As String Dim curValue As Variant Dim prevValue As Variant Dim isEqual As Boolean Dim equalCount As Long Dim n As Integer

Set viewServer = New NotesName (paramNote.GetItemValue ("View.Server") (0))

Let viewFilepath = paramNote.GetItemValue ("View.Filepath")

(0)

Let viewName = paramNote.GetItemValue ("View.Name") (0)

Let viewColumnIndexes = paramNote.GetItemValue ("View.Columns")

(0)

Set viewDb = New NotesDatabase (viewServer.Canonical, viewFilepath)

Set view = viewDb.GetView (viewName)

Set curNote = view.GetFirstDocument

Do Until curNote Is Nothing Let curDigest = ""

If Not prevNote Is Nothing

Then

Let isEqual = True Forall index In

viewColumnIndexes

Let prevValue = CArr (prevNote.ColumnValues (index))

Let curValue = CArr (curNote.ColumnValues (index))

If Lbound (prevValue) <> Lbound (curValue) Or Ubound (prevValue) <> Ubound (curValue) Then

Let

isEqual = False

Else

For n = Lbound (curValue) To Ubound (curValue)

If Not curDigest = "" Then Let curDigest = curDigest + ", "

Let curDigest = curDigest + Trim (Cstr (curValue (n)))

If Not Datatype (prevValue (n)) =

Datatype (curValue (n)) Then

Let isEqual = False

Elseif Not prevValue (n)= curValue

(n) Then

Let

isEqual = False

End If

Next

End If End Forall

If isEqual Then Call

prevNote.ReplaceItemValue ("Tmp.Digest", prevDigest)

Call out.ProcessDocument (prevNote)

End If

If Not isEqual Then If

equalCount > 1 Then

End If

End If

End If

Set prevNote = curNote

Set curNote = view.GetNextDocument (prevNote)

Loop

End Sub

Probe StayInGateWay

Option Public Option Declare

Use "DocumentProcessor"

Public Sub Search (db As NotesDatabase, dbType As String, paramNote As

70