Skip to main content

Using the plug-in PL/SQL API only

When application development involves procedures and functions stored in database packages rather than adhering strictly to low-code principles, the plug-in PL/SQL API emerges as an enticing avenue for handling CLOB data with the Rich Text Editor Pro. This API exposes a range of procedures and functions designed to facilitate interaction with the plug-in session state, especially in cases where Oracle APEX session state lacks native support for CLOB values within page items.

The forthcoming instructions delineate a step-by-step approach for creating a report that features rich text documents linked with a modal page powered by the Rich Text Editor Pro.

Prerequisites

Before implementing the plug-in please read the implementation prerequisites described in parent document.

Create report page with modal page

In the application builder home page click Create Page button.

image-20240204175232511

In the Create Page wizard step select Form and click the Next button.

image-20240204185856802

In the Create Page wizard step select Report with Form and click the Next button.

image-20240204185940986

In the Create Report with Form (Page Attributes) wizard step:

  1. Set Report Type to Interactive Report
  2. Set Report Page Number to 4
  3. Set Report Page Name to PL/SQL API only - report
  4. Set Form Page Number to 5
  5. Set Form Page Name to PL/SQL API only - modal
  6. Set Form Page Mode to Modal Dialog
  7. Click Next button

image-20240204190052497

In the Create Report with Form (Navigation Menu) wizard step:

  1. Set Navigation Preference to Create a new navigation menu entry
  2. Set New Navigation Menu Entry to PL/SQL API only
  3. Click Next button

image-20240204190136201

In the Data Source (Data Source) wizard step:

  1. Set Data Source to Local Database
  2. Set Source Type to Table
  3. Set Table / View Name to UC_FROALA_SAMPLE_CLOBS
  4. In Select Columns to be shown in the report select ID, DESCRIPTION and CLOB_CONTENT

image-20240204190235977

In the Create Form - Columns and Primary Key (Form Page) wizard step:

  1. In Select Columns to be shown in the form select ID, DESCRIPTION and CLOB_CONTENT
  2. Set Primary Key Column to ID (Number)
  3. Click Create button

image-20240204190333114

New pages are created with all required components. Navigate to page 4 (PL/SQL API only - report and hide column CLOB_CONTENT so it won't raise interactive report error when CLOB content exceeds VARCHAR2 limitation.

Follow these steps:

  1. Select Report 1
  2. Expand Columns
  3. Select column CLOB_CONTENT and set Identification \ Type to Hidden Column

image-20240204190427529

Remove form components

about this step

Removed processes in this step are native form component processes loading, creating, updating and deleting rows in the database table. These components were created by APEX wizard and they will be replaced with custom PL/SQL processes implementing the plug-in PL/SQL API.

Navigate to page 5 PL/SQL API only - modal and remove form components.

  1. Select before header and processing processes and using DELETE key remove these processes.
  2. Select region PL/SQL API only - modal and change Type to Static Content

image-20240204190545433

Enable page item plug-in

about this step

Enabling plug-in uploading images is optional, not uploaded images remain in a document as is without modyfing document HTML.

Navigate to page 5 PL/SQL API only - modal and update page item P5_CLOB_CONTENT by following these steps:

  1. Set Identification \ Type to UC - Rich Text Editor Pro [Plug-in].
  2. Set Appearance \ Template to Optional \ Above
  3. Set Settings \ Upload Image(s) on Request(s) to SAVE,CREATE

image-20240204194304282

Page processes

Once, the native Form component is removed from the APEX page, the CLOB operations (create, update and delete) must be re-implemented using the plug-in PL/SQL API.

Before header - load a document

Create a new Pre-Rendering \ Before Header process named Load CLOB from the database and

  1. Set Identification \ Type to PL/SQL Code
  2. Set Source \ PL/SQL Code
  3. Set Success Message to Rich text document (&P5_ID.) loaded using PL/SQL API.
  4. Set Server-side Condition \ Type to Item is NOT NULL
  5. Set Server-side Condition \ Item to P5_ID

image-20240205183243813

Processing - create a document

Create a new Processing \ Processes process named Create CLOB in the database and

  1. Set Identification \ Type to PL/SQL Code
  2. Set Source \ PL/SQL Code
  3. Set Success Message to A new rich text document (&P5_ID.) created using PL/SQL API.
  4. Set Server-side Condition \ When Button Pressed to CREATE

image-20240205183610045

Processing - update a document

Create a new Processing \ Processes process named Update CLOB in the database and

  1. Set Identification \ Type to PL/SQL Code
  2. Set Source \ PL/SQL Code
  3. Set Success Message to Rich text document (&P5_ID.) updated using PL/SQL API.
  4. Set Server-side Condition \ When Button Pressed to SAVE

image-20240205184148965

Processing - delete a document

Create a new Processing \ Processes process named Delete CLOB in the database and

  1. Set Identification \ Type to PL/SQL Code
  2. Set Source \ PL/SQL Code
  3. Set Success Message to Rich text document (&P5_ID.) removed.
  4. Set Server-side Condition \ When Button Pressed to DELETE

image-20240205184303181

Update Close dialog execution sequence so it's the last process to be executed.

image-20240205185843348

Test it

This simple and easy to implement instruction showcase how easy is utilizing the plug-in PL/SQL API to load, create and update rich text documents using the plug-in in.

To test the implementation using interactive report and modal page implementing the plug-in run page 4 - Rich Text documents (PL/SQL API).

image-20240604145913347

Test the implementation on-line

The plug-in sample application showcase this implementation in the example page Handle CLOB using the plug-in PL/SQL API.