Using process plug-in
In Oracle APEX 19.2, the Rich Text Editor Pro offers seamless integration with the supporting process plug-in, enabling developers to efficiently manage CLOB values in the database. This feature empowers developers to store, retrieve, and update rich text documents exceeding the VARCHAR2 limitation (32,767 characters), providing enhanced flexibility and scalability in document management.
In this guidelines, developers are guided through the process of implementing plug-in processes loading, inserting and updating documents in the database.
Before implementing the plug-in please read the implementation prerequisites described in parent document.
Create report page linked with modal page
Click Create Page button.
In modal Create a Page select Form and click Next button.
In modal Create Page select Report with Form and click Next button.
In APEX wizard Create Report with Form (Page attributes):
- Set Report Type to Interactive Report
- Set Report Page Number to
6
- Set Report Page Name to
Process plug-in - report
- Set Form Page Number to
7
- Set Form Page Name to
Process plug-in - modal
- Set Form Page Mode to Modal Dialog
- Click Next button
In wizard Create Report with Form (Navigation Menu):
- Set Navigation Preference to Create a new navigation menu entry
- Set New Navigation Menu Entry to
Process plug-in
- Click Next button
In wizard Create Report with Form (Data Source):
- Set Data Source to Local Database
- Set Source Type to Table
- Set Table / View Name to
UC_FROALA_SAMPLE_CLOBS
- In Select Columns to be shown in the report select
ID
,DESCRIPTION
andCLOB_CONTENT
In wizard Create Report with Form (Form page):
- In Select Columns to be shown in the form select
ID
,DESCRIPTION
andCLOB_CONTENT
- Set Primary Key Column to ID (Number)
- Click Create button
New pages are created with all required components. Navigate to page 6 Process plug-in - report and hide column CLOB_CONTENT so it won't raise interactive report error when CLOB value exceeds VARCHAR2 limitation. Follow the following steps:
- Select Report 1
- Expand Columns
- Select column CLOB_CONTENT
- Set Identification \ Type to Hidden Column
Remove form components
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 page processes implementing the supporting process plug-in.
Navigate to page 7 Process plug-in - modal, and
- select before header process and using
DELETE
key remove these processes. - select processing process and using
DELETE
key remove these processes. - select region Process plug-in - modal and change Type to
Static Content
- Before header
- Processing
- Form region
Enable page item plug-in
Enabling plug-in uploading images is optional, not uploaded images remain in a document as is without modyfing document HTML.
Navigate to page 7 Process plug-in - modal and update page item P7_CLOB_CONTENT by following these steps:
- Set Identification \ Type to UC - Rich Text Editor Pro [Plug-in].
- Set Appearance \ Template to Optional \ Above
- Set Settings \ Upload Image(s) on Request(s) to
SAVE,CREATE
Page processes
This guidelines showcase the supporting process plug-in loading, inserting and updating documents in the database using a developer's specific PL/SQL Code. The implementation guidelines for native form showcase the supporting process plug-in using table specification.
Before header - load a document
Create a new Before Header page process named Load rich text document and:
- Set Identification \ Type to UC - Rich Text Editor Pro (Process) [Plug-in]
- Set Settings \ Type to Load CLOB (Function Body returning CLOB)
- Set Settings \ Item to
P7_CLOB_CONTENT
- Set Settings \ Function Body returning CLOB
- Set Success Message to
Rich text document &P7_ID. loaded.
- Set Server-side Condition \ Type to Item is NOT NULL
- Set Server-side Condition \ Item to
P7_ID
- Save page changes
- Page designer
- PL/SQL Code
declare
v_clob_row UC_FROALA_SAMPLE_CLOBS%ROWTYPE;
begin
select * into v_clob_row from UC_FROALA_SAMPLE_CLOBS where id = :P7_ID;
:P7_DESCRIPTION := v_clob_row.DESCRIPTION;
return v_clob_row.CLOB_CONTENT;
end;
Processing - create a document
Create a new Processing process named Create rich text document and:
- Set Identification \ Type to UC - Rich Text Editor Pro (Process) [Plug-in]
- Set Settings \ Type to Update CLOB (PL/SQL Code)
- Set Settings \ Item to
P7_CLOB_CONTENT
- Set Settings \ PL/SQL Code
- Set Success Message to
Rich text document &P3_ID. updated.
- Set erver-side Condition \ Type to Request = Value
- Set erver-side Condition \ Value to
CREATE
- Save page changes
- Page designer
- PL/SQL Code
insert into #OWNER#.UC_FROALA_SAMPLE_CLOBS(
CLOB_CONTENT,
DESCRIPTION,
SESSION_ID
) values(
:CONTENT,
:P7_DESCRIPTION,
:APP_SESSION
) returning id into :P7_ID;
Processing - update a document
Create a new Processing process named Update rich text document and:
- Set Identification \ Type to UC - Rich Text Editor Pro (Process) [Plug-in]
- Set Settings \ Type to Update CLOB (PL/SQL Code)
- Set Settings \ Item to
P7_CLOB_CONTENT
- Set Settings \ PL/SQL Code
- Set Success Message to
Rich text document &P3_ID. updated.
- Set Server-side Condition \ Type to Request = Value
- Set Server-side Condition \ Value to
SAVE
- Save page changes
- Page designer
- PL/SQL Code
update
#OWNER#.UC_FROALA_SAMPLE_CLOBS
set
CLOB_CONTENT = :CONTENT,
DESCRIPTION = :P7_DESCRIPTION
where
id = :P7_ID
;
Processing - delete a document
Create a new Processing process named Delete CLOB in the database and
- Set Identification \ Type to PL/SQL Code
- Set Source \ PL/SQL Code
- Set Success Message to
Rich text document (&P7_ID.) removed.
- Set Server-side Condition \ When Button Pressed to DELETE
- Page designer
- PL/SQL Code
delete from UC_FROALA_SAMPLE_CLOBS where id = :P7_ID;
Update Close dialog execution sequence so it's the last process to be executed.
Test it
This simple and easy to implement instruction showcased how easy is utilizing the supporting process plug-in to load, create and update rich text documents.
To test the implementation using interactive report and modal page implementing the plug-in run page 6 - Process plug-in - report.
- Interactive report preview
- Form preview
The plug-in sample application showcase this instructions implemention in example page Handle CLOB using the plug-in PL/SQL API.