Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext


sabitha reddi 29.Dec.08 12:42 AM a Web browser
Toolkits All Releases Linux - SuSE


Hi all,

I have written a small code to trap note open call at server side in linux. But I dont see it getting executed and dont understand how to debug it. I have compiled and included .so name in notes.ini at domino exe directory.please can anyone suggest me what's wrong with my code?.

TExtensionInfo ExtensionHookTable[] =
{
{EM_NSFNOTEOPENEXTENDED, EM_REG_BEFORE, 0, FALSE, "EM_NSFNOTEOPENEXTENDED"},
{EM_NSFNOTEOPEN, EM_REG_BEFORE, 0, FALSE, "EM_NSFNOTEOPEN"},
{0, 0, 0, 0, NULL}
};

extern "C" STATUS LNPUBLIC MainEntryPoint()
{
STATUS LNPUBLIC (*ghandler)(EMRECORD FAR *);
error = NOERROR;
ghandler=EMHandlerProc;
Logevent("main entry point loaded");

if (gHooksRegistered)
{
return NOERROR;
}

gHooksRegistered = TRUE;
Logevent("notes hook loaded");

error=EMCreateRecursionID(&gRecursionID);
if(error)
{
Logevent("EMCreateRecursionID() failed.");
}

for(x=0; ExtensionHookTable[x].pName != NULL; x++) {
error=EMRegister(ExtensionHookTable[x].Identifier,
ExtensionHookTable[x].Notification,
(EMHANDLER)ghandler,
gRecursionID,
&ExtensionHookTable[x].RegistrationHandle);

if (error)
{
Logevent("Error registering extension hook(s).");
break;
}
}
}

STATUS LNPUBLIC EMHandlerProc(EMRECORD FAR *pExRecord)
{
NOTEHANDLE hNote = NULL;

switch (pExRecord->EId)
{
case EM_NSFNOTEOPEN:
case EM_NSFNOTEOPENEXTENDED:
{
if (pExRecord->NotificationType == EM_BEFORE)
{
VARARG_PTR ap = pExRecord->Ap;
DBHANDLE hDB = VARARG_GET(ap, DBHANDLE);
NOTEID NoteID = VARARG_GET(ap, NOTEID);
DWORD OpenFlags = VARARG_GET(ap, DWORD);

if ((OpenFlags & OPEN_MARK_READ) || // open mail in Notes/admin program
(OpenFlags == 0x03000000) || // web mail access for Domino 6.x
(OpenFlags == 0x13000000)) // web mail access for Domino 7.x and 8.x
{

NSFNoteOpen(hDB, NoteID, 0, &hNote);
Logevent("notes open trapped");

}

} // if (pExRecord->NotificationType == EM_BEFORE)
Logevent("handle completed...deregister");
for(x=0; ExtensionHookTable[x].pName != NULL; x++) {
error=EMDeregister(ExtensionHookTable[x].RegistrationHandle);
if (error)
{
Logevent("Error deregistering extension hook(s).");
break;
}
}

break;
} // case EM_NSFNOTEOPENEXTENDED:

default:
break;
} // switch (pExRecord->EId)

return ERR_EM_CONTINUE;
}

void Logevent(char *formatstring)
{
if (formatstring == NULL)
{
return;
}

gFStream = __OpenFile(LogFileName, APPEND_PERMISSION);
fprintf(gFStream, formatstring);
if (gFStream)
{
__CloseFile(gFStream);
gFStream = (__FILE*)0;
}
}






NSFNOTEOPENEXTENDED-linux (sabitha reddi 29.Dec.08)
. . RE: NSFNOTEOPENEXTENDED-linux (Rob Goudvis 29.Dec.08)
. . . . RE: NSFNOTEOPENEXTENDED-linux (sabitha reddi 29.Dec.08)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite