Custom Attributes
Component
Section titled “Component”All the plug-in region attributes available in the Oracle APEX page designer are listed and described below.
Source
Section titled “Source”The attribute defines how Email Viewer Pro maintains documents. Depending on the attribute value, there are different implementations.
Default Table
Section titled “Default Table”When selected, Email Viewer Pro maintains documents using the UC_EMAIL_DEFAULT_FILES table.
Custom Table
Section titled “Custom 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
Custom PL/SQL
Section titled “Custom PL/SQL”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*
Table Name
Section titled “Table Name”| Type | Required | Dependent on |
|---|---|---|
| Text | Yes | Source \ 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:
| Description | Type |
|---|---|
| Column storing a document’s primary key | VARCHAR2 | NUMBER |
| Column storing a document’s filename | VARCHAR2 |
| Column storing a document’s MIME-type | VARCHAR2 |
| Column storing a document’s content | BLOB |
| Column storing a document’s last modification time | TIMESTAMP(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. |
Primary Key(s) Column(s)
Section titled “Primary Key(s) Column(s)”| Type | Required | Dependent on |
|---|---|---|
| Text | Yes | Source \ 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)”| Type | Required | Dependent on |
|---|---|---|
| Page Item(s) | Yes | None |
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.
Content Column
Section titled “Content Column”| Type | Required | Dependent on |
|---|---|---|
| Text | Yes | Source \ Custom Table |
A column name whose type is BLOB and stores a document’s file contents.
Filename Column
Section titled “Filename Column”| Type | Required | Dependent on |
|---|---|---|
| Text | Yes | Source \ Custom Table |
A column name whose type is VARCHAR2 and stores a document’s filename (including the file extension).
MIME Type Column
Section titled “MIME Type Column”| Type | Required | Dependent on |
|---|---|---|
| Text | Yes | Source \ Custom Table |
A column name whose type is VARCHAR2 and stores a document’s file MIME type.
Last Update Column
Section titled “Last Update Column”| Type | Required | Dependent on |
|---|---|---|
| Text | Yes | Source \ Custom Table |
A column name whose type is TIMESTAMP(6) and stores a document’s last modification time.
Custom PL/SQL Package Name
Section titled “Custom PL/SQL Package Name”| Type | Required | Dependent on |
|---|---|---|
| Text | No | None |
This package executes the additional procedures and functions defined in the Initialization PL/SQL Code attribute.
Initialization PL/SQL Code
Section titled “Initialization PL/SQL Code”| Type | Required | Dependent on |
|---|---|---|
| PL/SQL Code | No | None |
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.
Variables
Section titled “Variables”g_doc_getfileinfo
Section titled “g_doc_getfileinfo”| Type | Used when | Example |
|---|---|---|
| VARCHAR2(30) | Source = Custom PL/SQL Code | UC_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:
| Parameter | Type | NULL able | Description |
|---|---|---|---|
| p_application_id | NUMBER | No | An application ID in which Email Viewer Pro is running |
| p_page_id | NUMBER | No | An application page ID in which Email Viewer Pro is running |
| p_session_id | NUMBER | No | An application session ID in which Email Viewer Pro is running |
| p_file_id | VARCHAR2 | No | A 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_id | VARCHAR2 | No | An APEX application end-user username |
| p_out_content | BLOB | No | The requested document contents. |
| p_out_filename | VARCHAR2 | No | The requested document filename. |
| p_out_mime_type | VARCHAR2 | No | The requested document MIME-TYPE |
| p_out_last_update_date | TIMESTAMP | No | The requested document’s last modification as a TIMESTAMP |
g_doc_callback_read
Section titled “g_doc_callback_read”| Type | Used when | Required | Example |
|---|---|---|---|
| VARCHAR2(30) | Source = Default Table | Custom Table | Custom PL/SQL | No | UC_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:
| Parameter | NULL able | Description |
|---|---|---|
| p_application_id | No | An application ID in which Email Viewer Pro is running |
| p_page_id | No | An application page ID in which Email Viewer Pro is running |
| p_session_id | No | An application session ID in which Email Viewer Pro is running |
| p_user_id | No | An APEX application end-user username |
| p_file_id | No | The procedure receives the current document ID to be renamed. |
| p_file_content | No | The procedure receives the requested document contents as BLOB. |
| p_file_filename | No | The procedure receives a new filename and sets the OUT value if the procedure logic changes the filename. |
| p_file_mime_type | No | The procedure receives the current document MIME-TYPE. |
| p_file_last_update_date | No | The procedure receives a document’s last modification time and sets the OUT value with the current modification time as TIMESTAMP. |
Show Metadata Header
Section titled “Show Metadata Header”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];