Page 1 sur 1
Propriétés de réplication

Publié:
30 Mars 2006 à 09:06
par goonie
Bonjour,
Lors de la création d'une réplique (en code LS), il n'y a pas de paramètres pour définir les propriétés "Send" et "Receive" ?
Est-on obligé de venir decocher la non souhaitée dans le replicator ?
Merci

Publié:
30 Mars 2006 à 09:20
par Stephane Maillard
Salut,
En LS pur je ne pense pas, par contre en API tu as NSFDbReplicaInfoSet avec les flags suivant :
REPLFLG_DISABLE - If set, the Server's Replicator Task ignores this database. Enable replication by clearing this bit.
REPLFLG_IGNORE_DELETES - If set, don't propogate deleted notes (deletion stubs), when replicating from this database. Enable propogation by clearing this bit.
REPLFLG_HIDDEN_DESIGN - If set, hide the design of this database. Disable hide design by clearing this bit.
REPLFLG_DO_NOT_CATALOG - If set, Server's Catalog Task will not add this database to CATALOG.NSF. Enable cataloging by clearing this bit.
REPLFLG_CUTOFF_DELETE - If set, the Server's Replicator Task automatically deletes notes that are older than the cutoff date. Disable automatic document deletions by clearing this bit.
REPLFLG_NEVER_REPLICATE - If set, the Server's Replicator Task Ignores this database. Enable replication by clearing this bit. Since this can only be done programatically, it is a more bullet-proof method than REPLFLG_DISABLE, which can be modified from the user interface.
REPLFLG_ABSTRACT - If set, truncate large documents and remove attachments. Disable truncation by clearing this bit.
REPLFLG_DO_NOT_BROWSE - If set, do not list in Open Database dialog box. Enable listing in Open Database dialog box by clearing this bit.
REPLFLG_NO_CHRONOS - If set, disable background macros for this database. Enable background macros by clearing this bit.
REPLFLG_IGNORE_DEST_DELETES - If set, don't replicate deleted notes
into destination database.
REPLFLG_MULTIDB_INDEX - Include in Multi Database indexing.
REPLFLG_PRIORITY_LOW - If set, replicator has low priority.
REPLFLG_PRIORITY_MED - If set, replicator has medium priority.
REPLFLG_PRIORITY_HI - If set, replicator has high priority.
REPLFLG_PRIORITY_SHIFT - Shift count for prioirty field within the WORD member.
REPLFLG_PRIORITY_MASK - Mask for priority field after shifting.
REPLFLG_PRIORITY_INVMASK - Mask for clearing the priority field.
REPLFLG_USED_MASK - Mask for determining whether any of the replication flags are set.
REPLFLG_UNREADIFFNEW - If set, modified documents are not marked as unread.

Publié:
30 Mars 2006 à 09:36
par goonie
Merci
Mais ces flags de l'API sont ceux de la classe Replication. Je n'y vois pas la propriété cherchée.
Je vais regarder un peu plus côté API Notes.
@+

Publié:
30 Mars 2006 à 09:41
par Stephane Maillard
Re,
Exact je me suis planté d'API il faut prendre ReplicateWithServer qui permet de changer le Receive et le Send, je suis en train de faire un exemple.

Publié:
30 Mars 2006 à 09:44
par goonie
Ouah Merci d'avance !

Publié:
30 Mars 2006 à 09:45
par Stephane Maillard
Re,
Ca doit donner untruc du style.
- Code : Tout sélectionner
Option Public
%INCLUDE "LSERR.LSS"
Type ReplicationFileStats
TotalFiles As Long
FilesCompleted As Long
NotesAdded As Long
NotesDeleted As Long
NotesUpdated As Long
Successful As Long
Failed As Long
NumberErrors As Long
End Type
Type ReplicationServerStats
Pull As ReplicationFileStats
Push As ReplicationFileStats
StubsInitialized As Long
TotalUnreadExchanges As Long
NumberErrors As Long
LastError As Integer
End Type
Declare Function W32_ReplicateWithServer Lib "nnotes.dll" Alias "ReplicateWithServer" _
(Byval portname As String, Byval servername As String, Byval opt As Long, Byval num As Long, Byval dbname As String, statistics As ReplicationServerStats ) As Integer
Const REPL_OPTION_RCV_NOTES = 1
Sub Initialize
Dim portname As String
Dim servername As String
Dim opt As Long
Dim num As Long
Dim dbname As String
Dim statistics As ReplicationServerStats
portname = "NULL"
servername = "Serveur/Organisation"
opt = REPL_OPTION_RCV_NOTES
num = 1
dbname = "data\BaseTest.nsf " & Chr(0)
rc = W32_ReplicateWithServer(portname,servername,opt,num,dbname,statistics)
Msgbox Cstr(rc)
End Sub
A tester !

Publié:
30 Mars 2006 à 09:56
par Stephane Maillard
Re,
Oups, j'ai oublier de te mettre les options de la réplication :
Private Const REPL_OPTION_RCV_NOTES = &H1 ' Receive notes from server (pull)
Private Const REPL_OPTION_SEND_NOTES = &H2 ' Send notes to server (push)
Private Const REPL_OPTION_CLOSE_SESS = &H40 ' Close sessions when done
Un exemple en C :
memset( &retStats, '\0', sizeof(REPLSERVSTATS) );
error = ReplicateWithServer(
PORTNAME,
ServerName,
REPL_OPTION_RCV_NOTES | REPL_OPTION_SEND_NOTES, /* pull, push */
1,
DBName,
&retStats))

Publié:
30 Mars 2006 à 10:45
par goonie
Cette fonction elle réplique ou elle créé la réplication ?
Elle réplique il me semble ?

Publié:
30 Mars 2006 à 10:48
par Stephane Maillard
Re,
Voici le texte de l'API Guide :
#include <repl.h>
STATUS LNPUBLIC ReplicateWithServer(
char far *PortName,
char far *ServerName,
WORD Options,
WORD NumFiles,
const char far *FileList,
REPLSERVSTATS far *retStats);
Description :
This routine replicates Domino database files on the local system with a specified server. Either all common files can be replicated or a specified list of files can be replicated. The number of file names is specified in the parameter NumFiles. The file names must be concatenated into a single list, with each name terminated by a NUL ('\0') character.
Replication can be performed in either direction or both directions (push, pull, or both).
Note:
The REPLSERVSTATS data structure must be initialized to zeros to get the correct results; see example below.
Parameters :
Input :
PortName - Name of the port on which to access the server. Specify NULL to allow Domino or Notes to use the "most available" port to the given server.
ServerName - Name of server to replicate with. A hierarchical server name needs to be specified in the abbreviated hierarchical name format (such as ServerC/Operations/Acme).
Options - Replication options. These options are defined in REPL_OPTION_xxx and may be bitwise or'ed together for combined functionality. If the option REPL_OPTION_ALL_DBS is specified, all local Domino database files are added to the list of names (if used). If the option REPL_OPTION_ALL_NTFS is specified, all local Domino template files are added to the list of names. If the option REPL_OPTION_ALL_FILES is specified, both database and template files are added. The priority flags, REPL_OPTION_PRI_LOW, REPL_OPTION_PRI_MED, and REPL_OPTION_PRI_HI, are only meaningful if one of the flags REPL_OPTION_ALL_DBS, REPL_OPTION_ALL_NTFS, or REPL_OPTION_ALL_FILES is specified.
NumFiles - Number of files in the file list. If no file names are specified, this parameter should be set to 0.
FileList - (Optional) A pointer to the concatenated null-terminated database filenames to replicate; may be NULL.
Output :
(routine) - Return status from this call:
NOERROR - Data replication succeeded.
ERR_xxx - Errors returned by lower level functions. Call to OSLoadString to interpret the error status as a string that you may display/log for the user.
retStats - Pointer to the returned replication statistics structure.

Publié:
30 Mars 2006 à 10:55
par goonie
Merci c'est plus clair.
Bon, je m'y mets.

Publié:
30 Mars 2006 à 10:56
par Stephane Maillard
Re,
Les options :
#include <repl.h>
Symbolic Values :
REPL_OPTION_RCV_NOTES - Receive notes from server (pull).
REPL_OPTION_SEND_NOTES - Send notes to server (push).
REPL_OPTION_ALL_DBS - Replicate all database (NSF) files, as well as files named in the file list argument.
REPL_OPTION_CLOSE_SESS - Close sessions when done.
REPL_OPTION_ALL_NTFS - Replicate all template (NTF) files, as well as files named in the file list argument.
REPL_OPTION_PRI_LOW - Replicate low, medium, and high priority database.
REPL_OPTION_PRI_MED - Replicate medium and high priority databases only.
REPL_OPTION_PRI_HI - Replicate high priority databases only.
REPL_OPTION_PRIVATE - (For use with ReplicateWithServerExt only) Replicate private documents even if not selected by default.
REPL_OPTION_ALL_FILES - Replicate all database (NSF) and all template (NTF) files.
REPL_OPTION_ABSTRACT_RTF - (For use with ReplicateWithServerExt only) Abstract/truncate docs to receive summary and 40KB of rich text only.
REPL_OPTION_ABSTRACT_SMRY - (For use with ReplicateWithServerExt only) Abstract/truncate docs to summary only data.
Description :
These are the options used when calling ReplicateWithServer and ReplicateWithServerExt. They may be bitwise or'ed together for combined functionality. Note: these options are now 32-bits.

Publié:
30 Mars 2006 à 10:58
par Stephane Maillard
Re,
La version 32 bits :
#include <repl.h>
STATUS LNPUBLIC ReplicateWithServerExt(
char far *PortName,
char far *ServerName,
DWORD Options,
WORD NumFiles,
const char far *FileList,
REPLEXTENSIONS far *ExtendedOptions,
REPLSERVSTATS far *retStats);
Description :
This routine replicates Domino database files on the local system with a specified server. Either all common files can be replicated or a specified list of files can be replicated. The number of file names is specified in the parameter NumFiles. The file names must be concatenated into a single list, with each name terminated by a NUL ('\0') character.
Replication can be performed in either direction or both directions (push, pull, or both).
For Release 4.0, this new function has been added to allow additional information to be supplied. The additional information may be passed in the REPLEXTENSIONS structure. If no extended information is to be supplied, a NULL may be passed for the ExtendedOptions argument.
Note:
The REPLSERVSTATS data structure must be initialized to zeros to get the correct results; see example below.
Parameters :
Input :
PortName - Name of the port on which to access the server. Specify NULL to allow Domino or Notes to use the "most available" port to the given server.
ServerName - Name of server to replicate with. A hierarchical server name needs to be specified in the abbreviated hierarchical name format (such as ServerC/Operations/Acme).
Options - Replication options. These options are defined in REPL_OPTION_xxx and may be bitwise or'ed together for combined functionality. If the option REPL_OPTION_ALL_DBS is specified, all local Domino database files are added to the list of names (if used). If the option REPL_OPTION_ALL_NTFS is specified, all local Domino template files are added to the list of names. If the option REPL_OPTION_ALL_FILES is specified, both database and template files are added. The priority flags, REPL_OPTION_PRI_LOW, REPL_OPTION_PRI_MED, and REPL_OPTION_PRI_HI, are only meaningful if one of the flags REPL_OPTION_ALL_DBS, REPL_OPTION_ALL_NTFS, or REPL_OPTION_ALL_FILES is specified. NOTE: These options are now 32-bits.
NumFiles - Number of files in the file list. If no file names are specified, this parameter should be set to 0.
FileList - (Optional) A pointer to the concatenated null-terminated database filenames to replicate; may be NULL.
ExtendedOptions - Pointer to extended parameter block, or NULL if no extended parameters are provided.
Output :
(routine) - Return status from this call:
NOERROR - Data replication succeeded.
ERR_xxx - Errors returned by lower level Notes functions. Call to OSLoadString to interpret the error status as a string that you may display/log for the user.
retStats - Pointer to the returned replication statistics structure.
Sample Usage :
REPLEXTENSIONS extData;
/* Only allow 5 minutes for replication */
extData.Size = sizeof (REPLEXTENSIONS);
extData.TimeLimit = 5;
memset(&retStats, '\0', sizeof(REPLSERVSTATS));
error = ReplicateWithServerExt(
PORTNAME,
ServerName,
REPL_OPTION_RCV_NOTES | REPL_OPTION_SEND_NOTES, /* pull, push */
1,
DBName,
&extData,
&retStats);
Les REPLEXTENSIONS :
#include <repl.h>
Definition :
typedef struct {
WORD Size; /* sizeof(REPLEXTENSIONS), allows for future
expansion */
WORD TimeLimit; /* If non-zero, number of minutes replication
is allowed to execute before cancellation.
If not specified, no limit is imposed */
} REPLEXTENSIONS;
Description :
To allow upwardly compatible changes with arbitrary additional parameters in ReplicateWithServer. Only TimeLimit is defined for Release 4. The parameter corresponding to this structure in ReplicateWithServerExt(), ExtendedOptions, may be set to NULL as a shorthand for passing a completely zeroed structure.
Voilà je crois que tu devrais t'en sortir avec tout ça.

Publié:
30 Mars 2006 à 12:49
par goonie
OK cela fonctionne.
Juste selon erreur 2597 (site ibm), il faut déclarer portname en long et passer 0 et pas Null.
@+
Merci

Publié:
30 Mars 2006 à 12:51
par Stephane Maillard
Re,
Exact je n'ai pas modifier la source.

Publié:
30 Mars 2006 à 13:03
par Stephane Maillard
Re,
Passe ton post en Réglé