Overview | Package | Object Type | Deprecated | Index | Help
| Oracle Application Server Portal PL/SQL API Reference - 10.1.4
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES
SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE

## Package wwlog_api

This package contains methods to log events.

For more information, see
- Events, event logging, and event properties
- Using the event logging service
- Event log record
- Secured logging views

Scope:
  Public
Since:
  Oracle Portal 3.0.6.6.5

Exception Summary
`CANNOT_CREATE_LOG` A temporary log record cannot be created.
`CANNOT_INSERT_LOG` A log record cannot be inserted into database.
`CANNOT_UPDATE_LOG` The log cannot be updated.
`UNABLE_TO_PURGE_LOG` The log cannot be purged.

Type Summary
`g_log_registry_array` A structure to hold log registry records. | `table`
`g_log_registry_record` A structure to hold log registry records. | `subtype`

Constant Summary
`ACTION_ADD_TO_GROUP` | `varchar2(20)`
`ACTION_ADD_TO_PAGE` | `varchar2(20)`
`ACTION_CHECKIN` | `varchar2(20)`
`ACTION_CHECKOUT` | `varchar2(20)`
`ACTION_CREATE` | `varchar2(20)`
`ACTION_CUSTOMIZE` | `varchar2(20)`
`ACTION_DEBUG` | `varchar2(20)`
`ACTION_DELETE` | `varchar2(20)`
`ACTION_DELETE_FROM_GROUP` | `varchar2(20)`
`ACTION_DELETE_FROM_PAGE` | `varchar2(20)`
`ACTION_EDIT` | `varchar2(20)`
`ACTION_ERROR` | `varchar2(20)`
`ACTION_GATHER` | `varchar2(20)`
`ACTION_GET_PORTLET` | `varchar2(20)`
`ACTION_HIDE` | `varchar2(20)`
`ACTION_LOGIN` | `varchar2(20)`
`ACTION_LOGOUT` | `varchar2(20)`
`ACTION_MOVE` | `varchar2(20)`
`ACTION_PORTLET` | `varchar2(20)`
`ACTION_PROVIDER` | `varchar2(20)`
`ACTION_SEARCH` | `varchar2(20)`
`ACTION_SHOW` | `varchar2(20)`
`ACTION_VIEW` | `varchar2(20)`
`DOMAIN_WWC` | `varchar2(12)`
`DOMAIN_WWF` | `varchar2(12)`
`DOMAIN_WWS` | `varchar2(12)`
`DOMAIN_WWV` | `varchar2(12)`
`SUBDOMAIN_CATEGORY` | `varchar2(12)`
`SUBDOMAIN_DOCUMENT` | `varchar2(12)`
`SUBDOMAIN_FOLDER` | `varchar2(12)`
`SUBDOMAIN_GROUP` | `varchar2(12)`
`SUBDOMAIN_ITEM` | `varchar2(12)`
`SUBDOMAIN_MOBILE` | `varchar2(12)`
`SUBDOMAIN_PAGE` | `varchar2(12)`
`SUBDOMAIN_PERSPECTIVE` | `varchar2(12)`
`SUBDOMAIN_PORTLET` | `varchar2(12)`
`SUBDOMAIN_PROVIDER` | `varchar2(12)`
`SUBDOMAIN_SEARCH` | `varchar2(12)`
`SUBDOMAIN_STATISTICS` | `varchar2(12)`
`SUBDOMAIN_USER` | `varchar2(12)`

Function/Procedure Summary
`get_log_registry` Retrieves an array of all existing log registry records. | `g_log_registry_array`
`log` Inserts an event record with specified values. | ``
`start_log` Starts a logging event and returns its log ID. | `integer`
`stop_log` Stops a logging event that was started with the start_log function. | ``
`update_log_information` Updates the information column for an existing event log record. | ``

Exception Detail

### CANNOT_CREATE_LOG

    CANNOT_CREATE_LOG exception

  A temporary log record cannot be created.

### CANNOT_INSERT_LOG

    CANNOT_INSERT_LOG exception

  A log record cannot be inserted into database.

### CANNOT_UPDATE_LOG

    CANNOT_UPDATE_LOG exception

  The log cannot be updated.

### UNABLE_TO_PURGE_LOG

    UNABLE_TO_PURGE_LOG exception

  The log cannot be purged.

Type Detail

### g_log_registry_array

    type g_log_registry_array is table of g_log_registry_record index by binary_integer

  A structure to hold log registry records.

### g_log_registry_record

    subtype g_log_registry_record is wwlog_registry$%rowtype

  A structure to hold log registry records.

Constant Detail

### ACTION_ADD_TO_GROUP

    ACTION_ADD_TO_GROUP constant varchar2(20) := 'add_to_group'

### ACTION_ADD_TO_PAGE

    ACTION_ADD_TO_PAGE constant varchar2(20) := 'add_to_page'

### ACTION_CHECKIN

    ACTION_CHECKIN constant varchar2(20) := 'checkin'

### ACTION_CHECKOUT

    ACTION_CHECKOUT constant varchar2(20) := 'checkout'

### ACTION_CREATE

    ACTION_CREATE constant varchar2(20) := 'create'

### ACTION_CUSTOMIZE

    ACTION_CUSTOMIZE constant varchar2(20) := 'customize'

### ACTION_DEBUG

    ACTION_DEBUG constant varchar2(20) := 'debug'

### ACTION_DELETE

    ACTION_DELETE constant varchar2(20) := 'delete'

### ACTION_DELETE_FROM_GROUP

    ACTION_DELETE_FROM_GROUP constant varchar2(20) := 'delete_from_group'

### ACTION_DELETE_FROM_PAGE

    ACTION_DELETE_FROM_PAGE constant varchar2(20) := 'delete_from_page'

### ACTION_EDIT

    ACTION_EDIT constant varchar2(20) := 'edit'

### ACTION_ERROR

    ACTION_ERROR constant varchar2(20) := 'error'

### ACTION_GATHER

    ACTION_GATHER constant varchar2(20) := 'gather'

### ACTION_GET_PORTLET

    ACTION_GET_PORTLET constant varchar2(20) := 'get_portlet'

### ACTION_HIDE

    ACTION_HIDE constant varchar2(20) := 'hide'

### ACTION_LOGIN

    ACTION_LOGIN constant varchar2(20) := 'login'

### ACTION_LOGOUT

    ACTION_LOGOUT constant varchar2(20) := 'logout'

### ACTION_MOVE

    ACTION_MOVE constant varchar2(20) := 'move'

### ACTION_PORTLET

    ACTION_PORTLET constant varchar2(20) := 'portlet'

### ACTION_PROVIDER

    ACTION_PROVIDER constant varchar2(20) := 'provider'

### ACTION_SEARCH

    ACTION_SEARCH constant varchar2(20) := 'search'

### ACTION_SHOW

    ACTION_SHOW constant varchar2(20) := 'show'

### ACTION_VIEW

    ACTION_VIEW constant varchar2(20) := 'view'

### DOMAIN_WWC

    DOMAIN_WWC constant varchar2(12) := 'wwc'

### DOMAIN_WWF

    DOMAIN_WWF constant varchar2(12) := 'wwf'

### DOMAIN_WWS

    DOMAIN_WWS constant varchar2(12) := 'wws'

### DOMAIN_WWV

    DOMAIN_WWV constant varchar2(12) := 'wwv'

### SUBDOMAIN_CATEGORY

    SUBDOMAIN_CATEGORY constant varchar2(12) := 'category'

### SUBDOMAIN_DOCUMENT

    SUBDOMAIN_DOCUMENT constant varchar2(12) := 'document'

### SUBDOMAIN_FOLDER

    SUBDOMAIN_FOLDER constant varchar2(12) := 'folder'

### SUBDOMAIN_GROUP

    SUBDOMAIN_GROUP constant varchar2(12) := 'group'

### SUBDOMAIN_ITEM

    SUBDOMAIN_ITEM constant varchar2(12) := 'item'

### SUBDOMAIN_MOBILE

    SUBDOMAIN_MOBILE constant varchar2(12) := 'mobile'

### SUBDOMAIN_PAGE

    SUBDOMAIN_PAGE constant varchar2(12) := 'page'

### SUBDOMAIN_PERSPECTIVE

    SUBDOMAIN_PERSPECTIVE constant varchar2(12) := 'perspective'

### SUBDOMAIN_PORTLET

    SUBDOMAIN_PORTLET constant varchar2(12) := 'portlet'

### SUBDOMAIN_PROVIDER

    SUBDOMAIN_PROVIDER constant varchar2(12) := 'provider'

### SUBDOMAIN_SEARCH

    SUBDOMAIN_SEARCH constant varchar2(12) := 'search'

### SUBDOMAIN_STATISTICS

    SUBDOMAIN_STATISTICS constant varchar2(12) := 'statistics'

### SUBDOMAIN_USER

    SUBDOMAIN_USER constant varchar2(12) := 'user'

Function/Procedure Detail

### get_log_registry

    function get_log_registry
    return g_log_registry_array

  Retrieves an array of all existing log registry records.

  Call this function to retrieve an array containing all existing log registry records.

  Note: The log registry table is useful for determining those logging calls that are actually recorded in the activity log.

  Example:

          g_log_registry_array := wwlog_api.get_log_registry;

  Returns:
    log registry records in the array g_log_registry_array
  Since:
    Oracle Portal 3.0.6.6.5

### log

    procedure log(
        p_domain in varchar2,
        p_subdomain in varchar2,
        p_name in varchar2,
        p_action in varchar2 default null,
        p_information in varchar2 default null,
        p_url in varchar2 default null,
        p_row_count in integer default 0,
        p_elapsed_time in number default 0,
        p_key_1 in varchar2 default null,
        p_key_2 in varchar2 default null,
        p_key_3 in varchar2 default null,
        p_key_4 in varchar2 default null,
        p_key_5 in varchar2 default null,
        p_autonomous in boolean default false
    )

  Inserts an event record with specified values.

  Call this procedure to insert an event record with specified values into the log table. Any user can use the log procedure.

  The parameters p_domain, p_subdomain, and p_name are required. Use of the remaining parameters is optional.

  Note: This procedure does not calculate elapsed time. To do this, use the methods wwlog_api.start_log and wwlog_api.stop_log.

  Example:

          wwlog_api.log
          (
             p_domain    => wwlog_api.Research&Development,
             p_subdomain => 'Expense_items',
             p_name      => '/SE_region/Incidental/Week1',
             p_action    => 'view',
             p_information   => 'Week1 included Memorial Day picnic',
             p_url       => 'tools.rd_main.main?p_cornerid=772',
             p_row_count => 34,
             p_elapsed_time  => .45
          );

  Parameters:
    `p_domain` - the domain of the object being logged
    `p_subdomain` - the subdomain of the object being logged
    `p_name` - the name of the object against which the event is logged. Note that a name can be, but is not required to be, a non-translatable string value.
    `p_action` - the action being performed on the object. A value for this string must be provided. Note that an action can be, but is not required to be, a non-translatable string value.
    `p_information` - a comment string that can be included in the logging record.
    `p_url` - a URL string used to redirect the browser back to the object that was logged
    `p_row_count` - the number of rows operated on, or retrieved
    `p_elapsed_time` - the time, in seconds, between the start_log call and the stop_log call
    `p_key_1` - a discretionary value for key_1
    `p_key_2` - a discretionary value for key_2
    `p_key_3` - a discretionary value for key_3
    `p_key_4` - a discretionary value for key_4
    `p_key_5` - a discretionary value for key_5
  Exceptions:
    `UNABLE_TO_PURGE_LOG` - if the log cannot be purged
    `CANNOT_CREATE_LOG` - if a temporary log record cannot be created
    `CANNOT_INSERT_LOG` - if a log record cannot be inserted into a database
  Since:
    Oracle Portal 3.0.6.6.5

### start_log

    function start_log(
        p_domain in varchar2,
        p_subdomain in varchar2,
        p_name in varchar2,
        p_action in varchar2 default null,
        p_information in varchar2 default null,
        p_url in varchar2 default null,
        p_deferred in boolean default true,
        p_key_1 in varchar2 default null,
        p_key_2 in varchar2 default null,
        p_key_3 in varchar2 default null,
        p_key_4 in varchar2 default null,
        p_key_5 in varchar2 default null
    ) return integer

  Starts a logging event and returns its log ID.

  Call this function to initialize a log entry and return its record ID. Any user can use this function.

  Note: The elapsed time for an action being logged is the difference (to 1/100 of a second) between the time that this method is called and the time that wwlog_api.stop_log is called.

  Example:

          l_logid := wwlog_api.start_log
          (
             p_domain    => Research&Development,
             p_subdomain => 'Expenses',
             p_name      => '/SE_region/Incidental/Week1'',
             p_action    => 'view',
             p_information => 'Week1 included Memorial Day picnic',
             p_url       => 'tools.rd_main.main?p_cornerid=772',
             p_deferred  => true,
             p_key_1     => '1',
             p_key_2     => '7334',
             p_key_3     => null,
             p_key_4     => null,
             p_key_5     => null
          );

  Parameters:
    `p_domain` - the domain of the object being logged
    `p_subdomain` - the subdomain of the object being logged
    `p_name` - the name of the instance of the object against which the event is logged. Note that a name can be, but is not required to be, a non-translatable string value.
    `p_action` - the name of the action being performed on the object. A value for this string must be provided. Note that this parameter is a non-translatable string value.
    `p_information` - a comment string that can be included in the logging record
    `p_url` - a URL string used to redirect the browser back to the object that was logged
    `p_deferred` - indicates whether the database record should be created by the start_log, or the stop_log call. Set p_deferred to TRUE if you want the logging action to insert a record into the log table only when the wwlog_api.stop_log command is called. To do this, wwlog_api.stop_log must be called with the same p_deferred value. Set p_deferred to FALSE when you want the wwlog_api.start_log function to insert a log record and wwlog_api.stop_log to update the record with the elapsed time.
    `p_key_1` - a discretionary value for key_1
    `p_key_2` - a discretionary value for key_2
    `p_key_3` - a discretionary value for key_3
    `p_key_4` - a discretionary value for key_4
    `p_key_5` - a discretionary value for key_5
  Returns:
    number the ID for the log entry that it starts if p_deferred is TRUE
  Exceptions:
    `UNABLE_TO_PURGE_LOG` - if the log cannot be purged
    `CANNOT_CREATE_LOG` - if a temporary log record cannot be created
    `CANNOT_INSERT_LOG` - if a log record cannot be inserted into the database
  Since:
    Oracle Portal 3.0.6.6.5

### stop_log

    procedure stop_log(
        p_id in integer,
        p_row_count in integer default 0,
        p_deferred in boolean default true
    )

  Stops a logging event that was started with the start_log function.

  Call this procedure to end a logging event that was started by wwlog_api.start_log. Any user can use the stop_log procedure.

  Notes:
  - If the log was started with p_deferred set to TRUE (in start_log), then the stop_log call creates a record in the log table.
  - If p_deferred was set to FALSE, then the record exists and is updated with the elapsed time, i.e. from the time the start_log function was called to the time the stop_log function is called.

  Example:

          wwlog_api.stop_log
          (
            p_id        => l_logid,
            p_row_count => 34,
            p_deferred  => true
          );

  Parameters:
    `p_id` - a unique identifier for the logged event
    `p_row_count` - the number of table rows acted upon, or retrieved by the stop_log call
  Exceptions:
    `UNABLE_TO_PURGE_LOG` - if the log cannot be purged
    `CANNOT_UPDATE_LOG` - if a temporary log record cannot be updated
    `CANNOT_INSERT_LOG` - if a log record cannot be inserted into database
  Since:
    Oracle Portal 3.0.6.6.5

### update_log_information

    procedure update_log_information(
        p_id in integer,
        p_information in varchar2
    )

  Updates the information column for an existing event log record.

  Call this procedure to update the log table 'information' column for an event record saved in the database. Any user can use the update_log_information procedure.

  Example:

          wwlog_api.update_log_information
          (
             p_id          => l_logid,
             p_information => 'New data for information column'
          );

  Parameters:
    `p_id` - passes the ID of the log entry to modify
    `p_information` - passes the new value for the log table information column
  Exceptions:
    `CANNOT_UPDATE_LOG` - if the log cannot be updated
  Since:
    Oracle Portal 3.0.6.6.5

Overview | Package | Object Type | Deprecated | Index | Help
| Oracle Application Server Portal PL/SQL API Reference - 10.1.4
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES
SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE