Functions
The plug-in package UC_FROALA_RTE exposes PL/SQL functions to be used in custom development.
access_token_validate
The function validates the encoded access token string and returns true
if a given string is a valid access token encoded string. Otherwise, the function returns false
.
- Syntax
- Parameters
- Example Code
UC_FROALA_RTE.access_token_validate (
p_access_token in varchar2
) return boolean;
Argument | Type | Description |
---|---|---|
p_access_token | VARCHAR2 | The current value of the encoded access token. |
declare
v_result boolean;
v_access_token_string varchar2(32767);
begin
v_result := UC_FROALA_RTE.access_token_validate(v_access_token_string);
end;
Use the access token type member or static function is_valid to validate encoded access token in RESTful service handlers.
clobGetHTML
Signature 1
The function returns the given CLOB
value with optional extra HTML code, ensuring that rich text formatting is the same as in the plug-in editor.
- Syntax
- Parameters
- Example Code #1
- Example Code #2
UC_FROALA_RTE.clobGetHTML(
p_clob in CLOB,
p_include_css in BOOLEAN default false
) return CLOB;
Argument | Type | Default | Description |
---|---|---|---|
p_clob | CLOB | A CLOB value to be displayed. | |
p_include_css | Boolean | false | When set to true , returned CLOB is computed to include the plug-in CSS files. Otherwise, the returned CLOB is the given |
declare
v_clob clob;
begin
v_clob := UC_FROALA_RTE.getValue('P1_ITEM_NAME');
v_clob := UC_FROALA_RTE.clobGetHTML(v_clob);
end;
In the result of executing the example code, the variable v_clob
is assigned with a new CLOB
value including the given CLOB
value embedded in additional div container. See the HTML code below for reference:
<div class="uc-froala--container uc-froala--readonly fr-view">
{CLOB}
</div>
Where {CLOB}
is the plug-in session state CLOB
value.
declare
v_clob clob;
begin
v_clob := UC_FROALA_RTE.clobGetHTML(
p_clob => v_clob,
p_include_css => true
);
end;
In the result of executing the example code, the variable v_clob
is assigned a new CLOB
value, including
- the plug-in CSS files preserving the editor's look and feel for rich text document
- the given
CLOB
value embedded in additional div container. See the HTML code below for reference:
<link rel="stylesheet" href="{URL}uc.froala.css" type="text/css">
<link rel="stylesheet" href="{URL}css/froala_editor.pkgd.min.css" type="text/css">
<div class="uc-froala--container uc-froala--readonly fr-view">
{CLOB}
</div>
Where
{URL}
is the current URL to the plug-in files{CLOB}
is the plug-in session stateCLOB
value.
Signature 2
The function returns the value of the given page item with extra HTML code, ensuring that rich text formatting is the same as in the plug-in editor.
- Syntax
- Parameters
- Example Code #1
- Example Code #2
UC_FROALA_RTE.clobGetHTML(
p_item_name in VARCHAR2,
p_include_css in BOOLEAN default false
) return CLOB;
Argument | Type | Default | Description |
---|---|---|---|
p_item_name | VARCHAR2 | An item name implementing the plug-in. | |
p_include_css | Boolean | false | When set to true the result CLOB includes links to the plug-in CSS files. |
declare
v_clob clob;
begin
v_clob := UC_FROALA_RTE.clobGetHTML('P1_ITEM_NAME');
end;
The example code assigns a new CLOB
value with extra div container enclosing the page item P1_ITEM_NAME fetched from the plug-in session state.
See the HTML code below for reference:
<div class="uc-froala--container uc-froala--readonly fr-view">
{CLOB}
</div>
Where
{CLOB}
is the plug-in session stateCLOB
value.
declare
v_clob clob;
begin
v_clob := UC_FROALA_RTE.clobGetHTML(
p_item_name => 'P1_ITEM_NAME',
p_include_css => true
);
end;
In the result of executing the example code, the variable v_clob
is assigned a new CLOB
value, including:
- the plug-in CSS files preserving the editor's look and feel for rich text document
- the page item P1_ITEM_NAME value fetched from the plug-in session state embedded in an additional div container.
See the HTML code below for reference:
<link rel="stylesheet" href="{URL}uc.froala.css" type="text/css">
<link rel="stylesheet" href="{URL}css/froala_editor.pkgd.min.css" type="text/css">
<div class="uc-froala--container uc-froala--readonly fr-view">
{CLOB}
</div>
Where
{URL}
is the current URL to the plug-in files{CLOB}
is the plug-in session stateCLOB
value
getChecksum
The function calculates and returns the current checksum for the given CLOB value.
- Syntax
- Parameters
- Example Code
UC_FROALA_RTE.getChecksum(
p_clob IN CLOB
) return number;
Argument | Type | Description |
---|---|---|
p_clob | CLOB | The CLOB of which checksum will be returned. |
declare
v_clob clob;
v_checksum number;
begin
v_checksum := UC_FROALA_RTE.getChecksum(
p_clob => v_clob
);
end;
getValue
Function returns rich text document currently stored as draft CLOB in the plug-in session state. Function accepts only one argument - APEX page item name.
- Syntax
- Parameters
- Example Code
UC_FROALA_RTE.getValue(
p_item_name in VARCHAR2
) return CLOB;
Argument | Type | Description |
---|---|---|
p_item_name | VARCHAR2 | An item name implementing the plug-in. |
declare
v_clob clob;
begin
v_clob := UC_FROALA_RTE.getValue(
p_item_name => 'P1_PAGE_ITEM'
);
end;
Learn more about draft CLOB in About \ Concepts \ Session State \ Draft CLOB.
setValue
Signature 1
The function sets the draft CLOB value in the plug-in session state and attempts to set a page item value in the APEX session state (using APEX_UTIL.SET_SESSION_STATE
). The function returns the checksum of the given CLOB
.
Learn more about draft CLOB in plug-in session state.
- Syntax
- Parameters
- Example Code
UC_FROALA_RTE.setValue(
p_item_name in varchar2,
p_value in CLOB
) return varchar2;
Argument | Type | Description |
---|---|---|
p_item_name | VARCHAR2 | An item name implementing the plug-in. |
p_value | CLOB | A document HTML content. |
declare
v_checksum number;
v_clob clob;
begin
v_checksum := UC_FROALA_RTE.setValue(
p_item_name => 'P1_PAGE_ITEM',
p_value => v_clob
);
end;
Signature 2
The function sets the on-load or draft CLOB value in the plug-in session state based on the given CLOB
value and page item. The function returns the checksum of the given CLOB
.
Learn more about differences between on-load and draft CLOB in plug-in session state.
- Syntax
- Parameters
- Example Code
UC_FROALA_RTE.setValue(
p_item_name in varchar2,
p_type in varchar2,
p_value in CLOB,
p_set_session in boolean default true
) return varchar2;
Argument | Type | Description |
---|---|---|
p_item_name | VARCHAR2 | An item name implementing the plug-in. |
p_type | VARCHAR2 | The CLOB type to be set in the plug-in session state. Accepted values are the following: UC_FROALA_RTE.c_clob_type_draft and UC_FROALA_RTE.c_clob_type_onload |
p_value | CLOB | The value of the CLOB to be set in the plug-in session state. |
p_set_session_state | Boolean | When true , the page item session state is set to the given CLOB value using native Oracle APEX PL/SQL API. |
declare
v_clob clob;
v_checksum number;
begin
v_checksum := UC_FROALA_RTE.setValue(
p_item_name => 'P1_PAGE_ITEM',
p_type => UC_FROALA_RTE.c_clob_type_draft,
p_value => v_clob,
p_set_session => true
);
end;