Database Functions | ||
---|---|---|
Previous | Next | |
Crawler Definition | Domains |
Several components of iKnowBase can be configured to use database functions (written in Oracle PL/SQL) for customization. Rather than specify the names of the functions at each use, they are collected in this module.
Database functions come in several flavors, depending on their intended usage scenarios.
This section describes the properties of a database function, as shown on the corresponding Edit pane.
Property | Description |
---|---|
Subsystem |
Select the subsystem the profile belongs to |
Context |
Select the appropriate context for which you want to call the PL/SQL command. Available values are:
|
Name |
Type the name of the database function. |
PL/SQL Command |
Type the PL/SQL command that you want to call from the iKnowBase Oracle database. |
Description |
Type a description for this database function. |
Package/Procedure info |
Displays info about the database object like owner, object type, status, created date and last ddl time. |
Procedure signature |
Displays the signature of the function/procedure. |
<package>.<procedure name> (
p_event_params in ot_eventparams,
p_old_record in ot_document
);
<package>.<procedure name> (
p_event_params in ot_eventparams,
p_old_record in ot_user
);
<package>.<procedure name> (
p_event_params in ot_eventparams,
p_old_record in ot_group
);
<package>.<procedure name> (
p_event_params in ot_eventparams,
p_old_record in ot_acl
);
<package>.<procedure name> (
p_event_params in ot_eventparams,
p_old_record in ot_upload_temp_document
);
The function names must support two methods: if p_method=BUILD then you will receive a set of values and return the values to be shown in the URL. p_method=PARSE must do the opposite.
Function <function name> (
p_method in varchar2,
p_target_guid in varchar2,
p_fragments in ct_portlet_runtime_fragments default ct_portlet_runtime_fragments())
return ct_portlet_runtime_fragments;
<package>.<procedure name>;
<package>.<procedure name> (
p_style_id in number
p_document_id in number,
p_parent_id in number,
p_site_id in number,
p_reference_path in varchar2,
p_page_url in varchar2,
p_back_url in varchar2
);
<package>.<procedure name> (
p_back_url IN VARCHAR2,
p_site_id IN NUMBER,
p_style_id IN NUMBER,
p_request IN VARCHAR2 DEFAULT 'save',
p_page_url IN VARCHAR2 DEFAULT NULL,
p_document_id IN NUMBER DEFAULT NULL,
p_parent_id IN NUMBER DEFAULT NULL,
p_document_type_id IN NUMBER DEFAULT NULL,
p_title IN VARCHAR2 DEFAULT NULL,
p_acl_id IN NUMBER DEFAULT NULL,
p_url IN VARCHAR2 DEFAULT NULL,
p_description_array IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_text_array IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_long_text_ids IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_long_text_arrays IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_valid_from IN VARCHAR2 DEFAULT NULL,
p_valid_to IN VARCHAR2 DEFAULT NULL,
p_status_id IN NUMBER DEFAULT NULL,
p_external_key IN VARCHAR2 DEFAULT NULL,
p_file IN VARCHAR2 DEFAULT NULL,
p_document_format IN VARCHAR2 DEFAULT NULL,
p_attrib_value IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_old_attrib_value IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_attribute_id IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_line_no IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_line_no_ref IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_external IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_dav_external_guid IN VARCHAR2 DEFAULT NULL,
p_template IN NUMBER DEFAULT NULL,
p_document_id_ref IN NUMBER DEFAULT NULL,
p_attachment IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_task_guid IN VARCHAR2 DEFAULT NULL,
p_task_step_guid IN VARCHAR2 DEFAULT NULL,
p_version IN VARCHAR2 DEFAULT NULL,
p_version_no IN NUMBER DEFAULT NULL,
p_version_comment IN VARCHAR2 DEFAULT NULL,
p_handle_redirect_local IN BOOLEAN DEFAULT FALSE,
p_reference_path IN VARCHAR2 DEFAULT NULL,
p_session_id IN VARCHAR2 DEFAULT NULL,
p_return_type IN VARCHAR2 DEFAULT NULL,
p_callback_function IN VARCHAR2 DEFAULT NULL,
p_attribute_file_ident IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_attribute_file IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_files_guid_remove IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr,
p_files_attribute_remove IN ikb_portal_api.vc_arr DEFAULT ikb_portal_api.empty_vc_arr
);
<package>.<procedure name>;
<package>.<function name> (
p_site_id IN NUMBER,
p_document_id IN NUMBER,
p_attribute_id IN NUMBER,
p_page_url IN VARCHAR2,
p_back_url IN VARCHAR2,
p_reference_path IN VARCHAR2,
p_language_id IN VARCHAR2,
p_version_no IN NUMBER
)
RETURN VARCHAR2
<package>.<function name> (
p_solr_message in ot_solr_message,
p_indexerType in varchar2 default 'SOLR')
return ct_solr_rows;
<package>.<Procedure name> (
p_document_id in number,
p_attribute in ot_document_attribute default null,
p_solr_data in out ct_solr_rows default ct_solr_rows())
);
Advanced function has two variants depending on the datasource in the presentation style. If the datasource is set to DOCUMENT use this signature:
<package>.<function name> (
p_site_id IN NUMBER,
p_document_id IN NUMBER,
p_attribute_id IN NUMBER,
p_page_url IN VARCHAR2,
p_back_url IN VARCHAR2,
p_reference_path IN VARCHAR2,
p_language_id IN VARCHAR2
) RETURN VARCHAR2
and if the datasource is VERSIONED_DOCUMENT, this is the correct signature:
<package>.<function name> (
p_site_id IN NUMBER,
p_document_id IN NUMBER,
p_attribute_id IN NUMBER,
p_page_url IN VARCHAR2,
p_back_url IN VARCHAR2,
p_reference_path IN VARCHAR2,
p_language_id IN VARCHAR2,
p_version_no IN NUMBER
) RETURN VARCHAR2
A good advice is to use the latest one so it can be used for both datasource. You must then make a test in the function to check if its a version or not you are working with.
Simple functions doesn’t take any parameters (e.g. dbms_random.random).
<package>.<function name> or <sql-function>
Use an SQL-function like char/date-functions, arithmetic functions or SQL built ins. #value will be substituted with the attribute value. Examples:
to_char(#value,'hh24.mi');
dbms_random.random;
<package>.<procedure name>;
You must register database functions, which will be called through the URL in iKnowBase Page Engine. For Custom Save Functions (used in forms) this will be done automatically for you. If you need to verify/register manually, use the screen for Package Aliases.
Previous | Top | Next |
Crawler Definition | Domains |