Domino 9 und frühere Versionen > Entwicklung

Replizierprotokoll einer DB auslesen

(1/1)

rico:
Hi @all !

Kennt jemand von euch eine Möglichkeit das ReplProtokoll ein DB per Script / Formel auszulesen?

 ???

Gruss
Rico

koehlerbv:
API *könnte* gehen, LS und @functions bieten hierfür nichts.

Bernhard

Driri:
Hi,

das hier hab ich in meiner Tipps-Datenbank gefunden, liest aber scheinbar nicht das Protokoll aus, aber paßt ja so in etwa in die Richtung. Evtl. gibts da wirklich ne Lösung über API zu.





--- Code: ---Creates a list of replication settings. Modify to suit your needs.

Code

Paste this into a Declarations section:

Type DBREPLICAINFO
ID As Double
Flags As Integer
CutoffInterval As Integer
Cutoff As Double
End Type

Dim db As NotesDatabase
Dim doc As NotesDocument
Dim RepInfoStruct As DBREPLICAINFO

Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval
dbName As String, hdb As Long ) As Integer
Declare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" ( Byval hdb
As Long ) As Integer
Declare Function W32_NSFDbReplicaInfoGet Lib "nnotes.dll" Alias
"NSFDbReplicaInfoGet" ( Byval hdb As Long, replInfoStruct As DBREPLICAINFO ) As
Integer

Const REPLFLG_DISABLE% = &H0004 '*** Disable replication */
Const REPLFLG_IGNORE_DELETES% = &H0010 '*** Don't propagate deleted notes when
Const REPLFLG_CUTOFF_DELETE% = &H0080 '*** Auto-Delete documents prior to
cutoff date */

Lotus Script Function:

Function GetRepInfo( TargetServer As String, TargetDb As String ) As String

Dim tempws As New NotesUIWorkspace
Dim Tdb As String
Dim hdb As Long

'*** Build the path for target database.
If TargetServer$ = "" Then
Tdb$ = TargetDb$
Else
Tdb$ = TargetServer$ & "!!" & TargetDb$
End If

status% = W32_NSFDbOpen( Tdb$, hdb& )
If status% <> 0 Then
Messagebox "Couldn't open database."
Call W32_NSFDbClose ( hdb& )
Exit Function
End If

status% = W32_NSFDbReplicaInfoGet( hdb&, RepInfoStruct)
If RepInfoStruct.CutOffInterval<>90 Then
IMsg$=" Cutoff Interval is"&Str(RepInfoStruct.CutOffInterval)&"
days." & Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_DISABLE% Then
RMsg$=" Replication is disabled."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_IGNORE_DELETES% Then
RMsg$=" Deleted documents are not replicated."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_CUTOFF_DELETE% Then
RMsg$=" Documents past cutoff date are deleted."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_DISABLE%+REPLFLG_IGNORE_DELETES% Then
RMsg$=" Replication is disabled."&Chr(13)&" Deleted documents are
not replicated."&Chr(13)
End If

If RepInfoStruct.Flags = REPLFLG_DISABLE%+REPLFLG_CUTOFF_DELETE% Then
RMsg$=" Replication is disabled."&Chr(13)&" Documents past cutoff
date are deleted."&Chr(13)
End If

If RepInfoStruct.Flags =
REPLFLG_DISABLE%+REPLFLG_IGNORE_DELETES%+REPLFLG_CUTOFF_DELETE% Then
RMsg$=" Replication is disabled."&Chr(13)&" Deleted documents are
not replicated."&Chr(13)&" Documents past cutoff date are deleted."&Chr(13)
End If

Call W32_NSFDbClose ( hdb& )
GetRepInfo=IMsg$&RMsg$

End Function  

--- Ende Code ---

koehlerbv:
Jo, sollte gehen über API:

NSFDbGetReplHistorySummary - Return the replication history summary information.
----------------------------------------------------------------------------------------------------------

#include <nsfdb.h>

STATUS LNPUBLIC NSFDbGetReplHistorySummary(
   DBHANDLE  hDb,
   DWORD  Flags,
   HANDLE *rethSummary,
   DWORD *retNumEntries);

Description :

   This function returns the replication history summary information in an array of REPLHIST_SUMMARY structures.  The array of  REPLHIST_SUMMARY structures is followed by the packed server and database filename data.  This data is in the format, <server name>!!<database filename>, with a NULL terminator at the end of the database filename.

If there is no summary information, this function returns ERR_SPECIAL_ID.

This function returns information that is also available from the Notes user interface via the File/Replication/History menu item selection.

Bernhard

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln