Autor Thema: Replizierprotokoll einer DB auslesen  (Gelesen 1337 mal)

Offline rico

  • Frischling
  • *
  • Beiträge: 28
  • Geschlecht: Männlich
  • keep on keeping on...
Replizierprotokoll einer DB auslesen
« am: 15.06.04 - 14:58:18 »
Hi @all !

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

 ???

Gruss
Rico

Offline koehlerbv

  • Moderator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 20.460
  • Geschlecht: Männlich
Re:Replizierprotokoll einer DB auslesen
« Antwort #1 am: 15.06.04 - 15:25:28 »
API *könnte* gehen, LS und @functions bieten hierfür nichts.

Bernhard

Driri

  • Gast
Re:Replizierprotokoll einer DB auslesen
« Antwort #2 am: 15.06.04 - 15:42:49 »
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  

Offline koehlerbv

  • Moderator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 20.460
  • Geschlecht: Männlich
Re:Replizierprotokoll einer DB auslesen
« Antwort #3 am: 15.06.04 - 15:52:18 »
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

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz