Skip to content

Custom Attributes

All the plug-in region attributes available in the Oracle APEX page designer are listed and described below.

The attribute defines how Email Viewer Pro maintains documents. Depending on the attribute value, there are different implementations.

When selected, Email Viewer Pro maintains documents using the UC_EMAIL_DEFAULT_FILES table.

When selected, Email Viewer Pro maintains documents using a table specification provided by a developer via the Email Viewer Pro region attributes. A developer has to provide a table specification, including:

  • Table name
  • Primary key(s) column(s)
  • Column name for a document BLOB content
  • Column name for a document filename
  • Column name for a document MIME Type
  • Column name for a document’s last modification time

When selected, Email Viewer Pro maintains documents using PL/SQL code provided by a developer. A developer has to create a package containing the required procedures for handling documents operations, such as:

  • UC_EMAIL_VIEWER.g_doc_getfileinfo - fetching a document meta-data

The package name has to be entered into the Custom PL/SQL Package Name attribute, and procedure names must be provided using variables in the Initialization PL/SQL Code attribute. *Learn more in Custom Attributes \ Initialization PL/SQL Code*

TypeRequiredDependent on
TextYesSource \ Custom Table

A custom table name where documents are stored. The table name can be prefixed with #OWNER# to reference the current parsing schema, ie. #OWNER#.UC_EMAIL_DEFAULT_FILES.

A custom table must have (at least) the following types of columns:

DescriptionType
Column storing a document’s primary keyVARCHAR2 | NUMBER
Column storing a document’s filenameVARCHAR2
Column storing a document’s MIME-typeVARCHAR2
Column storing a document’s contentBLOB
Column storing a document’s last modification timeTIMESTAMP(6)
Multiple Primary Keys
A custom table can use multiple primary keys to identify a document. Comma-delimited column names must be set using the Primary Key(s) Column(s) attribute.
TypeRequiredDependent on
TextYesSource \ Custom Table

Specify a comma-delimited list of column names used as primary keys for a document in the custom table.

Item(s) Containing Primary Key(s) Value(s)

Section titled “Item(s) Containing Primary Key(s) Value(s)”
TypeRequiredDependent on
Page Item(s)YesNone

A given APEX page item(s) is (are) used to identify a document to load from the database table. When any APEX item specified as the primary key is set to NULL, the Email Viewer Pro shows the document creation panel or read-only panel, depending on the plug-in attributes.

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is BLOB and stores a document’s file contents.

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is VARCHAR2 and stores a document’s filename (including the file extension).

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is VARCHAR2 and stores a document’s file MIME type.

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is TIMESTAMP(6) and stores a document’s last modification time.

TypeRequiredDependent on
TextNoNone

This package executes the additional procedures and functions defined in the Initialization PL/SQL Code attribute.

TypeRequiredDependent on
PL/SQL CodeNoNone

The attribute sets additional configuration options using the variables described below. The provided PL/SQL code is evaluated when the Email Viewer Pro is rendered.

TypeUsed whenExample
VARCHAR2(30)Source = Custom PL/SQL CodeUC_EMAIL_VIEWER.g_doc_getfileinfo := 'uc_email_viewer_custom_getfileinfo';

Provide a procedure name that fetches information about the currently requested document.

The given procedure must:

  • be declared in the package provided via the Custom PL/SQL Package Name attribute
  • accept the defined arguments
  • return OUT parameters describing the requested document

The procedure specification is:

procedure uc_email_viewer_custom_getfileinfo(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id in varchar2,
p_out_content out blob,
p_out_filename out varchar2,
p_out_mime_type out varchar2,
p_out_last_update_date out timestamp
);

The procedure parameters are:

ParameterTypeNULL ableDescription
p_application_idNUMBERNoAn application ID in which Email Viewer Pro is running
p_page_idNUMBERNoAn application page ID in which Email Viewer Pro is running
p_session_idNUMBERNoAn application session ID in which Email Viewer Pro is running
p_file_idVARCHAR2NoA document ID. When Email Viewer Pro uses a custom table and multiple primary keys, the value contains a comma-separated list of primary keys values
p_user_idVARCHAR2NoAn APEX application end-user username
p_out_contentBLOBNoThe requested document contents.
p_out_filenameVARCHAR2NoThe requested document filename.
p_out_mime_typeVARCHAR2NoThe requested document MIME-TYPE
p_out_last_update_dateTIMESTAMPNoThe requested document’s last modification as a TIMESTAMP
TypeUsed whenRequiredExample
VARCHAR2(30)Source = Default Table | Custom Table | Custom PL/SQLNoUC_EMAIL_VIEWER.g_doc_callback_read := 'uc_email_viewer_callback_read';

Provide a procedure name to be executed a document’s contents are read. If not provided, Email Viewer Pro does not perform the callback.

The given procedure must be:

  • declared in the package provided via Custom PL/SQL Package Name attribute
  • accepting the defined arguments

The procedure specification is the following:

procedure uc_email_viewer_callback_read(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id in varchar2,
p_file_content in blob,
p_file_filename in varchar2,
p_file_mime_type in varchar2,
p_file_last_update_date in timestamp
);

The procedure parameters are:

ParameterNULL ableDescription
p_application_idNoAn application ID in which Email Viewer Pro is running
p_page_idNoAn application page ID in which Email Viewer Pro is running
p_session_idNoAn application session ID in which Email Viewer Pro is running
p_user_idNoAn APEX application end-user username
p_file_idNoThe procedure receives the current document ID to be renamed.
p_file_contentNoThe procedure receives the requested document contents as BLOB.
p_file_filenameNoThe procedure receives a new filename and sets the OUT value if the procedure logic changes the filename.
p_file_mime_typeNoThe procedure receives the current document MIME-TYPE.
p_file_last_update_dateNoThe procedure receives a document’s last modification time and sets the OUT value with the current modification time as TIMESTAMP.

If you want to show an outlook like email header with the subject, sender, date, receiver… you can enable this option. Because this all the code is contained in a shadowroot div, you can style it as you like, without affecting the rest of the page. The way you do this is the following:

const shadowRoot = element.attachShadow({ mode: 'open' });
const sheet = new CSSStyleSheet();
sheet.replaceSync(`
// Your CSS here
`);
shadowRoot.adoptedStyleSheets = [sheet];

Show Metadata Header