- Print
- DarkLight
- PDF
C Plug-In Callback Interface
All plug-ins have access to the ResolveName
and ApplyTranslation
callback functions. The log file fields that can be accessed using the ResolveName
function and the modifications that can be performed using the ApplyTranslation
function depend on the object that the plug-in works with.
The following sections describe the ResolveName
and ApplyTranslation
functions which are defined in translate.h
file.
ResolveName
Your plug-in can use the ResolveName
callback function to request the value of a particular log file object from Webtrends.
Parameters
lpszName
This parameter indicates which part of the log file record the plug-in wants Webtrends to return. The argument lpszName
may contain multiple names separated by commas. The first one that resolves is returned. For more information about valid values, see “Parameter Values,” below.
lpDetails
The opaque pointer that is passed to the plug-in’s xltTranslate
, XltTranslateVisitorHit
, and xltTranslateVisitorSession
callback functions.
lpsrResult
The string returned to the plug-in from Webtrends. Because the value may or may not be null-terminated, you should only refer to lpsrResult->GetLength()
characters starting at lpsrResult->GetData()
.
Return Values
XLTOK
The function returns XLTOK
if the value identified by the lpszName
parameter is returned.
XLTERR
The function returns XLTERR
if the value identified by the lpszName
parameter is not returned.
Function Specification
int ResolveName (const char *lpszName, void *lpDetails, StringRef
*lpsrResult);
ApplyTranslation
The ApplyTranslation
callback function modifies the value of the object requested by the ResolveName
function and sends it back to Webtrends to use in the analysis.
Arguments
lpDetails
The opaque pointer that is passed to the plug-in’s xltTranslate
, XltTranslateVisitorHit
, and xltTranslateVisitorSession
functions.
lpszName
The portion of the log file record to act upon.
lpszAction
The action to take. You can replace
the value or append
to the existing value.
lpszNewString
The value that you want to replace or append to the log file object specified.
Return Values
The ApplyTranslation
function returns true
if the lpszName
is resolved; false
if the name cannot be resolved.
Function Specification
int ApplyTranslation(void *lpDetails, const char* lpszName, const char*
lpszAction, const char* lpszNewString);
Parameter Values
The following tables show the possible values of lpszName
, the possible values of lpszAction
, and the maximum replacement string length. The values of lpszName
(object parameter name) and lpszAction
(action parameter name) are not case-sensitive.
xltTranslate Parameters
You can use the following parameter values with the xltTranslate()
function.
lpszName Parameters | ResolveName() | ApplyTranslation() | Maximum string replacement length | lpszAction Parameters | Valid for Basic Analysis Profiles |
---|---|---|---|---|---|
"url" | Yes | Yes | "replace" | Yes | |
"urlstem" | Yes | Yes | "replace" | Yes | |
"urlandparams" | Yes | Yes | "replace" | Yes | |
"params" | Yes | Yes | Entire parameter string "replace" or "append" | Yes | |
"cookie" | Yes | Yes | Entire cookie string "replace" | Yes | |
"authuser" | Yes | Yes | "replace" | Yes | |
"referer" | Yes | Yes | "replace" | Yes | |
"referrer" | Yes | Yes | "replace" | Yes | |
"referrer-domain" | Yes | No | "replace" | No | |
"datetime" | Yes | Yes | "replace" | Yes | |
"host" | Yes | Yes | Less than 103 characters | "replace" | Yes |
"rawlogline" | Yes | No | "replace" | No | |
"sessionid" | Yes | Yes | Less than 128 characters | "replace" | No |
"method" | Yes | Yes | "replace" | Yes | |
"status" | Yes | Yes | "replace" | Yes | |
"agent" | Yes | Yes | "replace" | Yes | |
"client" | Yes | Yes | "replace" | Yes | |
"duration" | Yes | Yes | "replace" | No | |
"protocol" | Yes | Yes | "replace" | No | |
"oneparam:name" | Yes | Yes | Specify individual parameter name for name "replace" | Yes | |
"onecookie:name" | Yes | Yes | Specify individual cookie name for name "replace" | Yes | |
"delparam:name" | No | Yes | Specify individual parameter name for name "replace" | Yes | |
"delcookie:name" | No | Yes | Specify individual cookie name for name "replace" | Yes | |
"search-engine" | Yes | No | "replace" | No | |
"search-phrase" | Yes | No | "replace" | No |
xltTranslateVisitorHit Parameters
The following parameters are valid only for use within the xltTranslateVisitorHit()
method.
lpszName Parameters | ResolveName() | ApplyTranslation() | lpszAction Parameters |
---|---|---|---|
"vr-oneparam:name" | Yes | Yes | Specify individual parameter name for name "replace" |
"vr-onecookie:name" | Yes | Yes | Specify individual cookie name for name "replace" |
"vr-delparam:name" | No | Yes | Specify individual parameter name for name "replace" |
"vr-delcookie:name" | No | Yes | Specify individual cookie name for name "replace" |
xltTranslateVisitorSession Parameters
The following parameters are only valid for use within the xltTranslateVisitorSession()
function.
lpszName Parameters | ResolveName() | TranslateName() | lpszAction Parameters |
---|---|---|---|
"datetime" | Yes | No | Time the session occurred |
"visittime" | Yes | No | Number of seconds attributed to the session |