IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Lotus Notes Discussion :

Récupérer l'historique de réplication


Sujet :

Lotus Notes

  1. #1
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut Récupérer l'historique de réplication
    Bonjour

    j'ai besoin de récupérer l'historique de réplication en Lotus script (ou en Java)

    les seules méthodes que j'ai trouvé passent pas des API, mais aucuen ne fonctionnent sur des serveur en 64 bits...

    Merci

  2. #2
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut Euh
    Pourquoi les appels à l’api ne fonctionneraient? Pas eu de pbs de 853 à la 10 sous win64 et centos64? Tu as quoi comme erreur?

  3. #3
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    ben euh... justement j'ai pas d'erreur...

    le code ne renvois juste rien quand il tourne sur serveur et quelque chose quand je le lance à la main...

    vla le bazar

    Code VBA : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    Public Function ReplicationHistory_API(wServer As String, wPathFile As String) As Variant
     
    	Dim fullPath As String*256
    	Dim nbHandleDB As Long
    	Dim nbHandleLock As Long
    	Dim nbHandleReplique As Long
    	Dim nbReturn As Long
    	Dim nbEntries As Long
    	Dim nbEntries2 As Long
    	Dim i As Long
    	Dim j As Long
    	Dim entry() As HIST_ENTRY
    	Dim summary As REPLHIST_SUMMARY
    	Dim eTemp As HIST_ENTRY
    	Dim TexteRetour As String*81
    	Dim nbLen As Integer
    	Dim Hold As String
    	Dim Temp As String
    	Dim lstRetour List As String
    	Dim nbPos As Long
    	Dim nmServer As NotesName
    	Dim ErrorText As String
     
    	%REM
    		Public Type TIMEDATE
    innards (1) As Long
    End Type
     
    Type HIST_ENTRY
    RepTime As Variant
    ServerName As Variant
    FileName As String
    Direction As Integer
    DirectionLabel As String
    End Type
     
    Type REPLHIST_SUMMARY
    ReplicationTime As TIMEDATE
    AccessLevel As Integer
    AccessFlags As Integer
    Direction As Integer
    ServerNameOffset As Long
    ServerNameLength As Integer
    FileNameLength As Integer
    Spare1 As Long
    Spare2 As Long
    End Type
    		Declare Function W32_OSPathNetConstruct Lib "nnotes.dll" Alias "OSPathNetConstruct"(ByVal portName As Integer, ByVal serverName As String, ByVal fileName As String,ByVal pathName As String) As Integer
    		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 NSFDbGetReplHistorySummary Lib "NNOTES" Alias "NSFDbGetReplHistorySummary" (ByVal H As Long, ByVal F As Long, retSum As Long, retNum As Long) As Integer
    		Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As REPLHIST_SUMMARY, ByVal pSource As Long, ByVal dwLength As Long)
    		Declare Sub CopyMemoryStr Lib "kernel32" Alias "RtlMoveMemory" (ByVal pDest As String, ByVal pSource As Long, ByVal dwLength As Long)
    		Declare Function OSLockObject Lib "NNOTES" Alias "OSLockObject" (ByVal H) As Long
    		Declare Sub OSUnlockObject Lib "NNOTES" Alias "OSUnlockObject" (ByVal H)
    		Declare Function OSMemFree Lib "NNOTES" Alias "OSMemFree" (ByVal H As Long) As Integer
    	Declare Function ConvertTIMEDATEToText Lib "NNOTES" (ByVal IntlFormat As Integer, ByVal TimeFormat As Integer, InputTime As TIMEDATE, ByVal retTextBuffer As String, ByVal TextBufferLength As Integer, retTextLength As Integer) As Integer
    	%END REM
     
    	Const DIRECTION_NEVER=0
    	Const DIRECTION_SEND=1
    	Const DIRECTION_RECEIVE=2
    	Const Separator = "|"
     
    	On Error GoTo CatchError
     
    	ReplicationHistory_API = Null
     
    	If Trim(wPathFile) = "" Then
    		REM Error 9999,"wPathFile is Empty"
    		Exit Function
    	End If
     
    	If Trim(wServer) = "" Then
    		ErrorText= " (Local!!"+Trim(wPathFile)+")"
    	Else
    		Set nmServer = New NotesName(Trim(wServer))
    		ErrorText= " ("+nmServer.Abbreviated+"!!"+Trim(wPathFile)+")"
    		Set nmServer = Nothing
    	End If
     
    	Call W32_OSPathNetConstruct(0, Trim(wServer),Trim(wPathFile), fullPath)
    	nbReturn = NSFDbOpen(fullPath, nbHandleDB)
    	If nbReturn <> 0 Then		
    		Error 9999,"Couldn't open database"
    		Exit Function
    	End If
     
    	nbReturn = NSFDbGetReplHistorySummary(nbHandleDB, 0, nbHandleReplique, nbEntries) 
    	If nbReturn <> 0 Then
    		If nbHandleDB <> 0 Then
    			nbReturn = NSFDbClose(nbHandleDB)	
    		End If	
    		REM Error 9999,"Couldn't open replication history on database"
    		Exit Function
    	End If
     
    	If nbEntries > 0 Then
    		nbEntries2 = nbEntries - 1
    		ReDim entry(0 To nbEntries2)
    		nbHandleLock=OSLockObject(nbHandleReplique)
    		For i=0 To nbEntries2
    			CopyMemory summary, nbHandleLock, LenB(summary)		
     
    			nbLen =0
     
    			nbReturn = ConvertTIMEDATEToText(0, 0, summary.ReplicationTime, TexteRetour, Len(TexteRetour)-1, nbLen)		
    			entry(i).RepTime = Left$(TexteRetour, nbLen)
     
    			Select Case summary.Direction
    			Case 0
    				entry(i).Direction=DIRECTION_NEVER
    				entry(i).DirectionLabel="Never"
    			Case 1
    				entry(i).Direction=DIRECTION_SEND
    				entry(i).DirectionLabel="Send"
    			Case 2
    				entry(i).Direction=DIRECTION_RECEIVE
    				entry(i).DirectionLabel="Receive"
    			Case Else
    				entry(i).Direction=-1
    				entry(i).DirectionLabel=""
    		End Select 
    			nbHandleLock=nbHandleLock+Lenb(summary)
    		Next
     
    		Hold = ""
    		Temp = String(1, 0) 
    		i=0 
    		Do While i < nbEntries
    			Call CopyMemoryStr (temp,nbHandleLock,1)
    			If Temp = Chr(0) Then		
    			REM And (InStr(1, Hold, "!!") <> 0		
    				nbPos=InStr(1, Hold, "!!")-1						
    				Set nmServer = New NotesName(Left(Hold, nbPos))
    				entry(i).ServerName=nmServer.canonical
    				entry(i).FileName=Right(Hold, Len(Hold)-nbPos)
    				Hold=""
    				i=i + 1
    			Else
    				Hold=Hold + Temp
    			End If
    			nbHandleLock = nbHandleLock + 1
    		Loop
     
    		OSUnlockObject(nbHandleReplique)
    		nbEntries2 = nbEntries - 2
    		Do
    			j=0
    			For i=0 To nbEntries2
    				If entry(i).RepTime < entry(i+1).RepTime Then
    					j=j+1
    					eTemp=entry(i)
    					entry(i)=entry(i+1)
    					entry(i+1)=eTemp
    				ElseIf entry(i).RepTime = entry(i+1).RepTime Then
    					If entry(i).ServerName > entry(i+1).ServerName Then
    						j=j+1
    						eTemp=entry(i)
    						entry(i)=entry(i+1)
    						entry(i+1)=eTemp
    					End If
    				End If
    			Next
    		Loop While j > 0
    		nbEntries2 = nbEntries - 1
    		For i=0 To nbEntries2
    			lstRetour(i) = Trim(CStr(entry(i).RepTime))+(Separator)_
    			+Trim(CStr(entry(i).Direction))+(Separator)_
    			+Trim(CStr(entry(i).DirectionLabel))+(Separator)_
    			+Trim(CStr(entry(i).ServerName))+(Separator)_
    			+Trim(CStr(entry(i).FileName))
    		Next
    		ReplicationHistory_API = lstRetour
    		Erase lstRetour
    	End If
     
    	Erase entry
     
    	If nbHandleReplique > 0 Then
    		OSUnlockObject(nbHandleReplique)
    	rem	OSMemFree (nbHandleReplique)
    	End If
    	nbReturn = NSFDbClose(nbHandleDB) 
    	REM OSMemFree (nbHandleDB)
    	If nbReturn <> 0 Then		
    		Error 9999,"Couldn't close database"
    		Exit Function
    	End If
    	Exit Function
    CatchError:
    	MsgBox "("+Structure_Log+" : "+Cstr(GetThreadInfo (1))+" Call by "+Cstr(GetThreadInfo(10))+")"+Chr(10)+"Error " + CStr(Err) + " : "+Chr(10) + CStr(Error)+". "+Chr(10)+"Line # "+Cstr(Erl),16," ERROR !"
    	Call ErreurGestion(ErrorAction,"", "","",Nothing,"","", Structure_Log, CStr(GetThreadInfo(10)), CStr(GetThreadInfo (1)), CStr(Err),CStr(Error),CStr(Erl),Nothing,"",False)
    	ReplicationHistory_API = Null
    	On Error Resume Next
    	If nbHandleReplique > 0 Then
    		OSUnlockObject(nbHandleReplique)
    	rem	OSMemFree (nbHandleReplique)
    	End If
    	If nbHandleDB <> 0 Then
    		nbReturn = NSFDbClose(nbHandleDB)	
    		REM OSMemFree (nbHandleDB)
    	End If	
     
    	Exit Function
    End Function

  4. #4
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    je me disais, il n'y aurait pas moyen de récupérer le bazar en xml ?

    parceque a première vue c'est les appel d'api version 32 dans un environement 64 qui posent soucis

  5. #5
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut
    A mon avis du long et de l'integer tu vas dans le mur sur la plateforme 64, utiliser l'alignement sur 8 avec Double

    Pour l'api c il y a un petit chapitre la dessus: http://www-12.lotus.com/ldd/doc/domi...c?OpenDocument

  6. #6
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    Merci, mais je crois que je vais laisser tomber cette voie, je risque de faire planter tous les serveurs de prods...

    tu ne connaitrais pas un autre moyen de récupérer les historiques de réplication ?

  7. #7
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut
    Demande à l'admin d'activer la journalisation des activités en choisissant d'activer l'option Domino.REPLICA, ensuite dans la base par ID réplique tu as les infos, octets écrits/octets lus


    Sinon dans la base log.nsf, (usage -> par base) ou autre

    Mais comme je ne sais pas ce que tu veux avoir comme info.....

  8. #8
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    ok merci, je vais voir avec ça

  9. #9
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    Bon après quelques plantages serveurs

    le problème ne vient pas de l'API-C Notes mais des appel aux API system genre : Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"

    au mieux ça récupère n'importe quoi au pire ça plante le serveur.

    selon google le moyen de rendre l'appel compatible en VB7 est d'utiliser "PtrSafe" dans la déclaration : Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"

    mais biensur c'est pas reconnu en lotusscript une idée de comment utiliser ce bazar ?

    Merci

  10. #10
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut
    Je ne pense pas que copymemory soit utilisé dans les exemples avec l'api C de Domino, prends plutôt memcpy.

  11. #11
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    j'ai le même effet...

    pour ceux qui parlent allemand (ou qui ont google translate) => https://atnotes.de/index.php?topic=6...7877;topicseen

    le probleme viendrait de oslockobjet

  12. #12
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut
    regarde xOSlockObject (LS2CAPI)

    http://www.ls2capi.com/web/ls2capi/l...2?OpenDocument


    Sinon je te fais le code, mais pas avant juillet, suis un peu débordé ;-)

  13. #13
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut Sinon exemple de déclaration w32/w64 en LS
    En pj
    Fichiers attachés Fichiers attachés

  14. #14
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    Merci Jérome

    j'avais trouvé le fichier sur le forum russe => https://codeby.net/threads/portirova...d-win64.62514/

    maintenant je plante plus le serveur, je progresse. par contre la récupération des infos en mémoire c'est du grand n'importe quoi. a premiere vue en VB7 il faut rajouter ptrsafe a la déclaration pour qua ça functionne, mais en Ls ya pas... je vais bien finir par y arriver

    un exemple de ce que je récupère en 64bit

    12/07/3182 **:**:** PM;-1;;;
    07/03/2019 06:45:33 AM;2;Receive;;‡
    04/09/**** 02:00:00 AM;-1;;;
    ;-1;;;
    ;-1;;;
    ;-1;;;
    ;-1;;;
    ;0;Never;;

  15. #15
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    l'utilisation de memcpy ne change rien au probleme même résultat, je me fait insulter en martien

  16. #16
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    IBM a ouvert un SPR, mais en gros le niveau de priorité est négatif...

  17. #17
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut
    Maintenant c’est HCL :-) ça bouge plus

Discussions similaires

  1. Réponses: 6
    Dernier message: 28/09/2007, 16h33
  2. [msn et skype] Récupérer l'historique aprés installation de vista
    Par najeh79 dans le forum Messagerie instantanée
    Réponses: 0
    Dernier message: 19/09/2007, 11h51
  3. [Cookies] récupérer l'historique de plusieurs page
    Par chorokari dans le forum Langage
    Réponses: 2
    Dernier message: 27/11/2006, 21h39
  4. récupérer l'historique affiché par "Mozilla fireFox" pour exportation
    Par bnadem35 dans le forum Dépannage et Assistance
    Réponses: 4
    Dernier message: 04/08/2006, 13h05

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo