Subject: RE: Is there a Java equivalent of “C API SECRefreshIdFile”?
Thanks guys for the quick response. I have Lotus Notes Client 7.0.2 (however our Domino Server version is 6.5.5). I wrote a C program to refresh the ID file as follows:
#include <stdio.h>
#include <string.h>
/* Include the header files that we will need from the Lotus C API for Notes/Domino */
#include <global.h>
#include <nsfdb.h>
#include <nif.h>
#include <osmem.h>
#include <miscerr.h>
#include <kfm.h>
#include <osmisc.h>
/* Functions defined in this file */
void APIErrHandler (STATUS);
/* The main() function */
int main(int argc, char *argv){
/* Local variables */
char *serverName = "10.xxx.xxx.xx";
char idFilePath[256] = "";
char password[256] = "";
DWORD retFlags;
STATUS error = NOERROR; /*return status from API calls */
/* Initialize the Notes/Domino runtime */
if (error = NotesInitExtended (argc, argv)){
printf("\nError: Unable to initialize Notes.\n");
return (1);
}
printf("\nNotes init done.\n");
/* Make sure we have the needed arguements */
if (argc != 3){
printf("\nUsage: LotusNotesIdRefresh.exe <idfilepath> <password>");
NotesTerm();
return (1);
}else{
printf("\nDoing a string copy.\n");
/* Concatenate the arguements to form the key */
strcpy_s(idFilePath, 256, argv[1]);
strcpy_s(password, 256, argv[2]);
printf("\nDone with string copy.\n");
}
printf("\nRefreshing the ID file.\n");
if(error = SECRefreshIdFile(
idFilePath,
password,
serverName,
&retFlags,
0,
NULL)){
APIErrHandler (error);
NotesTerm();
return (1);
}
printf("\nID file successfully refreshed.\n");
/* Shutdown the Notes runtime and exit the function */
NotesTerm();
return (0);
}
/* The error handler function */
void APIErrHandler (STATUS error)
{
STATUS errorid = ERR(error);
char errormsg[200];
WORD len;
/* Obtain the error message*/
len = OSLoadString (NULLHANDLE,
errorid,
errormsg,
sizeof(errormsg));
/* Print it. */
printf ("Error : %s", errormsg);
}
The ID file is manually copied to e:\idstore directory. The fullname, firstname, lastname in person document in NAB is changed. I than run this program as follows:
E:\LotusNotesIdRefresh\Debug>LotusNotesIdRefresh.exe “E:/idstore/hntest24.id” password
The following is the program output:
Notes init done.
Doing a string copy.
Done with string copy.
Refreshing the ID file.
The ID file being used is: F:\Program Files\lotus\notes\data\mytest.id
Enter password (press the Esc key to abort):
ID file successfully refreshed.
Problem:
I don’t see the ID file E:/idstore/hntest24.id being updated. The timestamp of this file on the file system is not changed.
Am I missing something? I would appreciate it if someone can tell me if I am missing anything.
Thanks,
Neville