AtNotes Übersicht Willkommen Gast. Bitte einloggen oder registrieren.
17.06.19 - 17:10:02
Übersicht Hilfe Regeln Glossar Suche Einloggen Registrieren
News:
Schnellsuche:
+  Das Notes Forum
|-+  Neueste Beiträge
Seiten: [1] 2 3 ... 10

 1 
 am: Heute um 16:38:39 
Begonnen von Strunz - Letzter Beitrag von Pfefferminz-T
Na ja, ein gutes Nachschlagewerk inklusive Volltextindex wird beim Admin&Designer-Client gleich mitgeliefert - die Admin Hilfe. Ist auch über mehrere Webseiten online verfügbar :-)

 2 
 am: Heute um 16:28:50 
Begonnen von eknori - Letzter Beitrag von eknori
Die @DNUG_Infos Fachgruppe „Development“ plant für Ende September 2019 einen eintägigen Workshop zum Thema „#Lotusscript für Einsteiger und Azubis“ im Raum Rhein / Ruhr.

Durch die IBM Domino Mobile App rückt LotusScript wieder in den Focus. Wir möchten allen jenen eine Chance geben, die sich bisher noch nicht ab das Thema heran getraut haben. Selbstverständlich richtet sich das Angebot auch an Administratoren.

Um abschätzen zu können, was wir an Ressourcen einplanen müssen, brauchen wir ein wenig Rückmeldung bezüglich „Ja, das is5 was für mich“ und „Mich interessiert besonders ... „.

Ihr könnt mir dazu gerne per PM antworten, wenn ihr es nicht öffentlich tun möchtet.

Also, dann lasst mal hören.

 3 
 am: Heute um 09:58:55 
Begonnen von Strunz - Letzter Beitrag von habemehl
Was hättest du auch großartig über 9.x schreiben wollen. Und mal ehrlich. Wer zieht sich 1.600 Seiten drögen Stoff über Serveradministration rein?

z.B. Studenten in Ihren wissenschaftlichen Arbeiten, weil auch im Ende des 2. Jahrzent des 21. Jh. Universitäten "Büchern" als Quelle mehr "glauben" schenken, als irgendwelchen FAQ, Hersteller Internetseiten etc. pp.  Ahnungslos

 4 
 am: Heute um 08:06:39 
Begonnen von fritandr - Letzter Beitrag von fritandr
Lieber Detlef,

Alles Gute zum Geburtstag.
Ich hoffe, du hast Zeit, zufeiern und dich ein wenig verwöhnen zu lassen.

Viele Grüße
Andreas

 5 
 am: 16.06.19 - 09:14:29  
Begonnen von SD - Letzter Beitrag von eknori
Die negativen Werte für die handles sind übrigens nicht das Problem. Ich habe es mit ähnlichem Code probiert, der die Werte für den FTIndex ausließt. Auch hier liefert das LockObject negative Werte, und der Code kackt nicht ab, wenn anschließend mit memcpy gearbeitet wird.


 6 
 am: 15.06.19 - 17:26:39  
Begonnen von Strunz - Letzter Beitrag von eknori
Was hättest du auch großartig über 9.x schreiben wollen. Und mal ehrlich. Wer zieht sich 1.600 Seiten drögen Stoff über Serveradministration rein?


 7 
 am: 15.06.19 - 14:26:07  
Begonnen von Strunz - Letzter Beitrag von Pyewacket
Ich hab mich mal umgeschaut, anscheinend ist die Welt der Fachbücher mit Notes 8.5.3 stehengeblieben :-(


 8 
 am: 15.06.19 - 12:16:48  
Begonnen von SD - Letzter Beitrag von eknori
Und damit es richtig Spaß macht, hier noch eine Variante, die die unterschiedlichen ODS Versionen berücksichtigt

main.h

Code:
#ifndef _MAIN_H_
#define _MAIN_H_

#include <string>

#if defined (_MSC_VER) && !defined(ND64)
#pragma pack(push, 1)
#endif
#include <global.h>
#include <miscerr.h>
#include <addin.h>
#if defined (_MSC_VER) && !defined (ND64)
#pragma pack(pop)
#endif

#include "cNotesFramework.h"
#include "cmdline.h"

#if defined (W64)
#define HANDLE DHANDLE
#undef NOTEHANDLE
#define NOTEHANDLE DHANDLE
#else
#define DHANDLE HANDLE
#undef NOTEHANDLE
#define NOTEHANDLE HANDLE
#endif

#define ADDIN_STATUS_LINE "UA"
#define APP_NAME "UA: "
#undef MSG
#define MSG(fmt) APP_NAME fmt
#define ERROR -1
using namespace std;

STATUS error = NOERROR;

DBACTIVITY DbSummaryActivity;
DBACTIVITYEXTENDED DbSummaryActivityExt;

DBACTIVITY_ENTRY  *pDbUserActivity, DbUserActivity;
DBACTIVITY_ENTRY_EXTENDED *pDbUserActivityExt, DbUserActivityExt;

DHANDLE hDbUserActivity;
DHANDLE hDbUserActivityExt;

WORD wUserCount;
char *szUserName;
char far szTimedate[1000];
LONG lRptPeriod;
WORD far wLen;
int i;
WORD minor = 0;
WORD major = 0;

// prototypes
STATUS get_user_activity(DHANDLE hDb);
STATUS get_user_activity_extended(DHANDLE hDb);
#endif


main.cpp

Code:
/*
* copyright (c) 2019 Ulrich Krause www.eknori.de
*/

#pragma warning(disable:4005)

#include "main.h"

STATUS LNPUBLIC AddInMain (HMODULE hModule, int argc, char *argv[]) {

HANDLE hStatusLine;
HANDLE hStatusLineDesc;
HMODULE hMod;

AddInQueryDefaults (&hMod, &hStatusLine);
AddInDeleteStatusLine (hStatusLine);
hStatusLineDesc = AddInCreateStatusLine(ADDIN_STATUS_LINE);
AddInSetDefaults (hMod, hStatusLineDesc);
AddInSetStatusText("Initialising");

CmdLine *cmdline = new CmdLine();

cmdline->addUsage("  user activity, V1.0.0.0, (c) 2019, Ulrich Krause\n");
cmdline->addUsage("Usage: lo ua [options] [flags]\n");

cmdline->addUsage( "Options:\n" );
cmdline->addUsage( "-d    --db\t\tdatabase path" );
cmdline->addUsage( "" );
cmdline->addUsage( "Flags:\n" );
cmdline->addUsage( "-h    --help\t\tPrints this help" );

cmdline->setOption( "db", 'd' );
cmdline->setFlag ( "help", 'h' );

cmdline->processCommandArgs( argc, argv );

if( ! cmdline->hasOptions()) {
cmdline->printUsage2();
delete cmdline;
return ERROR;
}

if( cmdline->getFlag( "help" )
|| cmdline->getFlag( 'h' ) ) {
cmdline->printUsage2();
return NOERROR;
}

string file_path;
if( cmdline->getValue( 'd' ) != NULL 
|| cmdline->getValue( "db" ) != NULL  ){
file_path = cmdline->getValue( 'd' );
}

cNotesDatabase db;

try{

db.open(file_path.c_str());

AddInLogMessageText(
MSG("DbTitle: %s\n"),
NOERROR, db.title().c_str());

// get ODS
NSFDbMajorMinorVersionGet(db.h, &major, &minor);
AddInLogMessageText(MSG("ODS: %d\n"), NOERROR, major);
if(major < 43) {
error = get_user_activity(db.h);
}
else {
error = get_user_activity_extended(db.h);
}

} catch (cNotesErr& err) {
delete cmdline;
db.close();
LAPI_RETURN (ERR(error));

} catch (...) {
delete cmdline;
db.close();
AddInLogMessageText(
"Unexpected Error\n", NOERROR);

LAPI_RETURN (ERR(error));
}

delete cmdline;
db.close();
LAPI_RETURN (ERR(error));
}

STATUS get_user_activity(DHANDLE hDb){

error = NSFDbGetUserActivity (hDb, 0L, &DbSummaryActivity,
&hDbUserActivity, &wUserCount);

if (error)
{
return error;
}

pDbUserActivity = OSLock (DBACTIVITY_ENTRY, hDbUserActivity);

for (i = 0; i < wUserCount; i++)
{
DbUserActivity = pDbUserActivity[i];
error = ConvertTIMEDATEToText (NULL, NULL, &(DbUserActivity.Time),
szTimedate, MAXALPHATIMEDATE, &wLen);
if (error)
{
OSUnlock (hDbUserActivity);
OSMemFree (hDbUserActivity);
return error;
}

szTimedate[wLen] = '\0';
szUserName = NSFDbGetActivityUserNamePtr (pDbUserActivity, i);

if (DbUserActivity.Reads)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate, szUserName, DbUserActivity.Reads);
if (DbUserActivity.Writes)
AddInLogMessageText(
MSG("%s  %s wrote %d\n"),
NOERROR, szTimedate, szUserName,
DbUserActivity.Writes);
}

OSUnlock (hDbUserActivity);
OSMemFree (hDbUserActivity);

AddInLogMessageText("                 Uses         Reads        Writes\n", NOERROR);
AddInLogMessageText(
MSG("Last Day        %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivity.PrevDayUses,DbSummaryActivity.PrevDayReads,
DbSummaryActivity.PrevDayWrites);
AddInLogMessageText(
MSG("Last Week       %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivity.PrevWeekUses,DbSummaryActivity.PrevWeekReads,
DbSummaryActivity.PrevWeekWrites);
AddInLogMessageText(
MSG("Last Month      %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivity.PrevMonthUses,DbSummaryActivity.PrevMonthReads,
DbSummaryActivity.PrevMonthWrites);
lRptPeriod = TimeDateDifference (&(DbSummaryActivity.Last),
&(DbSummaryActivity.First));

if (lRptPeriod % (60*60*24))
lRptPeriod = lRptPeriod / (60*60*24) + 1;
else
lRptPeriod = lRptPeriod / (60*60*24);

AddInLogMessageText(
MSG("Last %lu days   %5d         %5d         %5d\n"),
NOERROR, lRptPeriod,
DbSummaryActivity.Uses,DbSummaryActivity.Reads,
DbSummaryActivity.Writes);

return error;
}

STATUS get_user_activity_extended(DHANDLE hDb){
error = NSFDbGetUserActivityExtended (
hDb, 0L,
&DbSummaryActivityExt,
&hDbUserActivityExt, &wUserCount);
if (error)
{
return error;
}

pDbUserActivityExt = OSLock (DBACTIVITY_ENTRY_EXTENDED, hDbUserActivityExt);

for (i = 0; i < wUserCount; i++)
{
DbUserActivityExt = pDbUserActivityExt[i];
error = ConvertTIMEDATEToText (NULL, NULL, &(DbUserActivityExt.Time),
szTimedate, MAXALPHATIMEDATE, &wLen);
if (error)
{
OSUnlock (hDbUserActivityExt);
OSMemFree (hDbUserActivityExt);
return error;
}

szTimedate[wLen] = '\0';
szUserName = NSFDbGetActivityUserNamePtr (pDbUserActivityExt, i);

if (DbUserActivityExt.AEDetails.DataAdds)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataAdds);

if (DbUserActivityExt.AEDetails.DataDeletes)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataDeletes);

if (DbUserActivityExt.AEDetails.DataReads)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataReads);

if (DbUserActivityExt.AEDetails.DataUpdates)
AddInLogMessageText(
MSG("%s  %s wrote %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataUpdates);

// NON-DATA
if (DbUserActivityExt.AEDetails.NonDataAdds)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataAdds);

if (DbUserActivityExt.AEDetails.NonDataDeletes)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataDeletes);

if (DbUserActivityExt.AEDetails.NonDataReads)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataReads);

if (DbUserActivityExt.AEDetails.NonDataUpdates)
AddInLogMessageText(
MSG("%s  %s wrote %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataUpdates);
}

OSUnlock (hDbUserActivityExt);
OSMemFree (hDbUserActivityExt);

AddInLogMessageText("                 Uses         Reads        Writes        Adds\n", NOERROR);
AddInLogMessageText(
MSG("Last Day        %5d         %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivityExt.PrevDayUses,
DbSummaryActivityExt.PrevDayReads,
DbSummaryActivityExt.PrevDayUpdates,
DbSummaryActivityExt.PrevDayAdds);

AddInLogMessageText(
MSG("Last Week       %5d         %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivityExt.PrevWeekUses,
DbSummaryActivityExt.PrevWeekReads,
DbSummaryActivityExt.PrevWeekUpdates,
DbSummaryActivityExt.PrevWeekAdds);

AddInLogMessageText(
MSG("Last Month      %5d         %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivityExt.PrevMonthUses,
DbSummaryActivityExt.PrevMonthReads,
DbSummaryActivityExt.PrevMonthUpdates,
DbSummaryActivityExt.PrevMonthAdds);

lRptPeriod = TimeDateDifference (&(DbSummaryActivityExt.Last),
&(DbSummaryActivityExt.First));

if (lRptPeriod % (60*60*24))
lRptPeriod = lRptPeriod / (60*60*24) + 1;
else
lRptPeriod = lRptPeriod / (60*60*24);

AddInLogMessageText(
MSG("Last %lu days   %5d         %5d         %5d         %5d\n"),
NOERROR,
lRptPeriod,
DbSummaryActivityExt.Uses,
DbSummaryActivityExt.Reads,
DbSummaryActivityExt.Writes,
DbSummaryActivityExt.Adds);

return error;
}

 9 
 am: 15.06.19 - 09:47:35  
Begonnen von SD - Letzter Beitrag von eknori
Der Vollständigkeit halber, das Ganze noch einmal mit NSFDbGetUserActivityExtended

Code:
/*
* copyright (c) 2019 Ulrich Krause www.eknori.de
*/

#pragma warning(disable:4005)

#include "main.h"

STATUS LNPUBLIC AddInMain (HMODULE hModule, int argc, char *argv[]) {

STATUS error = NOERROR;
HANDLE hStatusLine;
HANDLE hStatusLineDesc;
HMODULE hMod;

AddInQueryDefaults (&hMod, &hStatusLine);
AddInDeleteStatusLine (hStatusLine);
hStatusLineDesc = AddInCreateStatusLine(ADDIN_STATUS_LINE);
AddInSetDefaults (hMod, hStatusLineDesc);
AddInSetStatusText("Initialising");

CmdLine *cmdline = new CmdLine();

cmdline->addUsage("  user activity, V1.0.0.0, (c) 2019, Ulrich Krause\n");
cmdline->addUsage("Usage: lo ua [options] [flags]\n");

cmdline->addUsage( "Options:\n" );
cmdline->addUsage( "-d    --db\t\tdatabase path" );
cmdline->addUsage( "" );
cmdline->addUsage( "Flags:\n" );
cmdline->addUsage( "-h    --help\t\tPrints this help" );

cmdline->setOption( "db", 'd' );
cmdline->setFlag ( "help", 'h' );

cmdline->processCommandArgs( argc, argv );

if( ! cmdline->hasOptions()) {
cmdline->printUsage2();
delete cmdline;
return ERROR;
}

if( cmdline->getFlag( "help" )
|| cmdline->getFlag( 'h' ) ) {
cmdline->printUsage2();
return NOERROR;
}

string file_path;
if( cmdline->getValue( 'd' ) != NULL 
|| cmdline->getValue( "db" ) != NULL  ){
file_path = cmdline->getValue( 'd' );
}

DBACTIVITYEXTENDED DbSummaryActivityExt;
DBACTIVITY_ENTRY_EXTENDED *pDbUserActivityExt, DbUserActivityExt;

DHANDLE hDbUserActivityExt;
WORD wUserCount;
char *szUserName;
char far szTimedate[1000];
LONG lRptPeriod;
WORD far wLen;
int i;

cNotesDatabase db;

try{

db.open(file_path.c_str());

AddInLogMessageText(
MSG("DbTitle: %s\n"),
NOERROR, db.title().c_str());

error = NSFDbGetUserActivityExtended (
db.h, 0L,
&DbSummaryActivityExt,
&hDbUserActivityExt, &wUserCount);
if (error)
{
delete cmdline;
db.close();
LAPI_RETURN (ERR(error));
}

pDbUserActivityExt = OSLock (DBACTIVITY_ENTRY_EXTENDED, hDbUserActivityExt);

for (i = 0; i < wUserCount; i++)
{
DbUserActivityExt = pDbUserActivityExt[i];
error = ConvertTIMEDATEToText (NULL, NULL, &(DbUserActivityExt.Time),
szTimedate, MAXALPHATIMEDATE, &wLen);
if (error)
{
OSUnlock (hDbUserActivityExt);
OSMemFree (hDbUserActivityExt);
delete cmdline;
db.close();
LAPI_RETURN (ERR(error));
}

szTimedate[wLen] = '\0';
szUserName = NSFDbGetActivityUserNamePtr (pDbUserActivityExt, i);

if (DbUserActivityExt.AEDetails.DataAdds)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataAdds);

if (DbUserActivityExt.AEDetails.DataDeletes)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataDeletes);

if (DbUserActivityExt.AEDetails.DataReads)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataReads);

if (DbUserActivityExt.AEDetails.DataUpdates)
AddInLogMessageText(
MSG("%s  %s wrote %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.DataUpdates);

// NON-DATA
if (DbUserActivityExt.AEDetails.NonDataAdds)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataAdds);

if (DbUserActivityExt.AEDetails.NonDataDeletes)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataDeletes);

if (DbUserActivityExt.AEDetails.NonDataReads)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataReads);

if (DbUserActivityExt.AEDetails.NonDataUpdates)
AddInLogMessageText(
MSG("%s  %s wrote %d\n"),
NOERROR, szTimedate,
szUserName, DbUserActivityExt.AEDetails.NonDataUpdates);
}

OSUnlock (hDbUserActivityExt);
OSMemFree (hDbUserActivityExt);

AddInLogMessageText("                 Uses         Reads        Writes        Adds\n", NOERROR);
AddInLogMessageText(
MSG("Last Day        %5d         %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivityExt.PrevDayUses,
DbSummaryActivityExt.PrevDayReads,
DbSummaryActivityExt.PrevDayUpdates,
DbSummaryActivityExt.PrevDayAdds);

AddInLogMessageText(
MSG("Last Week       %5d         %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivityExt.PrevWeekUses,
DbSummaryActivityExt.PrevWeekReads,
DbSummaryActivityExt.PrevWeekUpdates,
DbSummaryActivityExt.PrevWeekAdds);

AddInLogMessageText(
MSG("Last Month      %5d         %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivityExt.PrevMonthUses,
DbSummaryActivityExt.PrevMonthReads,
DbSummaryActivityExt.PrevMonthUpdates,
DbSummaryActivityExt.PrevMonthAdds);

lRptPeriod = TimeDateDifference (&(DbSummaryActivityExt.Last),
&(DbSummaryActivityExt.First));

if (lRptPeriod % (60*60*24))
lRptPeriod = lRptPeriod / (60*60*24) + 1;
else
lRptPeriod = lRptPeriod / (60*60*24);

AddInLogMessageText(
MSG("Last %lu days   %5d         %5d         %5d         %5d\n"),
NOERROR,
lRptPeriod,
DbSummaryActivityExt.Uses,
DbSummaryActivityExt.Reads,
DbSummaryActivityExt.Writes,
DbSummaryActivityExt.Adds);

} catch (cNotesErr& err) {
delete cmdline;
db.close();
LAPI_RETURN (ERR(error));

} catch (...) {
delete cmdline;
db.close();
AddInLogMessageText(
"Unexpected Error\n", NOERROR);

LAPI_RETURN (ERR(error));
}

delete cmdline;
db.close();
LAPI_RETURN (ERR(error));
}

 10 
 am: 15.06.19 - 06:40:14  
Begonnen von SD - Letzter Beitrag von eknori
Habe zum Testen das Ganze mal in ein kleines server addin verpackt. Funktioniert einwandfrei.
Ist im Großen und Ganzen das Beispiel, das in der cApi Dokumentation zu NSFDbGetUserActivity steht.

Code:
/*
* copyright (c) 2019 Ulrich Krause www.eknori.de
*/

#pragma warning(disable:4005)

#include "main.h"

STATUS LNPUBLIC AddInMain (HMODULE hModule, int argc, char *argv[]) {

STATUS error = NOERROR;
HANDLE hStatusLine;
HANDLE hStatusLineDesc;
HMODULE hMod;

AddInQueryDefaults (&hMod, &hStatusLine);
AddInDeleteStatusLine (hStatusLine);
hStatusLineDesc = AddInCreateStatusLine(ADDIN_STATUS_LINE);
AddInSetDefaults (hMod, hStatusLineDesc);
AddInSetStatusText("Initialising");

CmdLine *cmdline = new CmdLine();

cmdline->addUsage("  user activity, V1.0.0.0, (c) 2019, Ulrich Krause\n");
cmdline->addUsage("Usage: lo ua [options] [flags]\n");

cmdline->addUsage( "Options:\n" );
cmdline->addUsage( "-d    --db\t\tdatabase path" );
cmdline->addUsage( "" );
cmdline->addUsage( "Flags:\n" );
cmdline->addUsage( "-h    --help\t\tPrints this help" );

cmdline->setOption( "db", 'd' );
cmdline->setFlag ( "help", 'h' );

cmdline->processCommandArgs( argc, argv );

if( ! cmdline->hasOptions()) {
cmdline->printUsage2();
delete cmdline;
return ERROR;
}

if( cmdline->getFlag( "help" )
|| cmdline->getFlag( 'h' ) ) {
cmdline->printUsage2();
return NOERROR;
}

string file_path;
if( cmdline->getValue( 'd' ) != NULL  
|| cmdline->getValue( "db" ) != NULL  ){
file_path = cmdline->getValue( 'd' );
}

DBACTIVITY DbSummaryActivity;
DBACTIVITY_ENTRY  *pDbUserActivity, DbUserActivity;
DHANDLE hDbUserActivity;
WORD wUserCount;
char *szUserName;
char far szTimedate[1000];
LONG lRptPeriod;
WORD far wLen;
int i;

cNotesDatabase _NotesDatabase;

try{

_NotesDatabase.open(file_path.c_str());
AddInLogMessageText(MSG("DbTitle: %s\n"),
NOERROR, _NotesDatabase.title().c_str());

error = NSFDbGetUserActivity (_NotesDatabase.h, 0L, &DbSummaryActivity,
&hDbUserActivity, &wUserCount);

if (error)
{
delete cmdline;
_NotesDatabase.close();
LAPI_RETURN (ERR(error));
}

pDbUserActivity = OSLock (DBACTIVITY_ENTRY, hDbUserActivity);

for (i = 0; i < wUserCount; i++)
{
DbUserActivity = pDbUserActivity[i];
error = ConvertTIMEDATEToText (NULL, NULL, &(DbUserActivity.Time),
szTimedate, MAXALPHATIMEDATE, &wLen);
if (error)
{
OSUnlock (hDbUserActivity);
OSMemFree (hDbUserActivity);
delete cmdline;
_NotesDatabase.close();
LAPI_RETURN (ERR(error));
}

szTimedate[wLen] = '\0';
szUserName = NSFDbGetActivityUserNamePtr (pDbUserActivity, i);

if (DbUserActivity.Reads)
AddInLogMessageText(
MSG("%s  %s read %d\n"),
NOERROR, szTimedate, szUserName, DbUserActivity.Reads);
if (DbUserActivity.Writes)
AddInLogMessageText(
MSG("%s  %s wrote %d\n"),
NOERROR, szTimedate, szUserName,
DbUserActivity.Writes);
}

OSUnlock (hDbUserActivity);
OSMemFree (hDbUserActivity);

AddInLogMessageText("                 Uses         Reads        Writes\n", NOERROR);
AddInLogMessageText(
MSG("Last Day        %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivity.PrevDayUses,DbSummaryActivity.PrevDayReads,
DbSummaryActivity.PrevDayWrites);
AddInLogMessageText(
MSG("Last Week       %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivity.PrevWeekUses,DbSummaryActivity.PrevWeekReads,
DbSummaryActivity.PrevWeekWrites);
AddInLogMessageText(
MSG("Last Month      %5d         %5d         %5d\n"),
NOERROR,
DbSummaryActivity.PrevMonthUses,DbSummaryActivity.PrevMonthReads,
DbSummaryActivity.PrevMonthWrites);
lRptPeriod = TimeDateDifference (&(DbSummaryActivity.Last),
&(DbSummaryActivity.First));

if (lRptPeriod % (60*60*24))
lRptPeriod = lRptPeriod / (60*60*24) + 1;
else
lRptPeriod = lRptPeriod / (60*60*24);

AddInLogMessageText(
MSG("Last %lu days   %5d         %5d         %5d\n"),
NOERROR, lRptPeriod,
DbSummaryActivity.Uses,DbSummaryActivity.Reads,
DbSummaryActivity.Writes);

} catch (cNotesErr& err) {
delete cmdline;
_NotesDatabase.close();
return ERROR;

} catch (...) {
delete cmdline;
_NotesDatabase.close();

AddInLogMessageText("Unexpected Error\n", NOERROR);
return ERROR;
}

delete cmdline;
_NotesDatabase.close();
return error;
}


Seiten: [1] 2 3 ... 10


Einloggen mit Benutzername, Passwort und Sitzungslänge

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006, Simple Machines Prüfe XHTML 1.0 Prüfe CSS
Impressum Atnotes.de - Powered by Syslords Solutions - Datenschutz | Partner: