Procedures
The plug-in package UC_FROALA_RTE exposes PL/SQL procedures to be used in custom development.
clear
The procedure flushes the plug-in session state for the given page item implementing the plug-in.
- Syntax
- Parameters
- Example Code #1
- Example Code #2
UC_FROALA_RTE.clear(
p_item_name in varchar2,
p_set_session_state in boolean default false
);
Argument | Type | Description |
---|---|---|
p_item_name | VARCHAR2 | An item name implementing the plug-in. |
p_set_session_state | BOOLEAN | When set to true procedures set page item session state to NULL using APEX_UTIL.SET_SESSION_STATE . |
begin
UC_FROALA_RTE.clear(
p_item_name => 'P1_UC_RTE_PRO'
);
end;
Clear rich text document in the plug-in session state only.
begin
UC_FROALA_RTE.clear(
p_item_name => 'P1_UC_RTE_PRO',
p_set_session_state => true
);
end;
Clear rich text document in the plug-in session state and clear page item value in the APEX session state.
clobDisplay
Signature 1
The procedure displays the given CLOB
value 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.clobDisplay(
p_clob in clob,
p_include_css in boolean defeault true
);
Argument | Type | Default |
---|---|---|
p_clob | VARCHAR2 | NULL |
p_include_css | Boolean | true |
declare
v_clob clob;
begin
v_clob clob := UC_FROALA_RTE.getValue('P1_ITEM_NAME');
UC_FROALA_RTE.clobDisplay(
p_clob => v_clob
);
end;
The example code prints to the browser the following HTML:
<div class="uc-froala--container uc-froala--readonly fr-view">
{CLOB}
</div>
where {CLOB}
is the given CLOB value.
The plug-in CSS files are added to the bottom of the page using the Oracle APEX API APEX_CSS.ADD_FILE
. See the code below to see what files are added.
<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">
The {URL}
is the current URL to the plug-in files generated by the plug-in.
declare
v_clob clob;
begin
v_clob clob := UC_FROALA_RTE.getValue('P1_ITEM_NAME');
UC_FROALA_RTE.clobDisplay(
p_clob => v_clob,
p_include_css => false
);
end;
The example code prints to the browser only the CLOB HTML without additional CSS files and outer container:
{CLOB}
Where {CLOB}
is the given CLOB
value without any modifications.
Signature 2
The procedure displays a CLOB
value of the given 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.clobDisplay(
p_item_name in varchar2
p_include_css in boolean defeault true
);
Argument | Type | Description |
---|---|---|
p_item_name | VARCHAR2 | An item name implementing the plug-in. |
begin
UC_FROALA_RTE.clobDisplay(
p_item_name => 'P1_ITEM_NAME'
);
end;
The example code prints to the browser the following HTML:
<div class="uc-froala--container uc-froala--readonly fr-view">
{CLOB}
</div>
where {CLOB}
is the given page item value in fetched from the plug-in session state.
The plug-in CSS files are added to the bottom of the page using the Oracle APEX API APEX_CSS.ADD_FILE
.
<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">
The {URL}
is the current URL to the plug-in files generated by the plug-in.
begin
UC_FROALA_RTE.clobDisplay(
p_item_name => 'P1_ITEM_NAME'
p_include_css => false
);
end;
The example code prints to the browser a page item CLOB
value without additional CSS files and outer container:
{CLOB}
Where {CLOB}
is rich text editor HTML without any modifications.
manageClearCache
Since the plug-in version v23.2.3, the procedure is no longer required to clear page item session state value when APEX URL syntax is used in Oracle APEX 22.2 onwards. The procedure is mandatory for prior APEX versions.
The procedures clears the plug-in and page item session state based on the current URL syntax. The procedure is mandatory for Oracle APEX not supporting CLOB
values in APEX session state (Oracle APEX prior 22.2).
- Syntax
- Parameters
- Example Code
UC_FROALA_RTE.manageClearCache;
None
The procedure has to be implemented as an application process (Shared Components \ Application Processes) with the execution point set to On Load: Before Header (page template header).
begin
UC_FROALA_RTE.manageClearCache;
end;
setValue
The procedure sets the plug-in draft CLOB value in the plug-in collection based on the given CLOB
value. The procedure updates the given page item session state to the given CLOB
value, respecting Oracle APEX limitations for CLOB
support in the session state.
- Syntax
- Parameters
- Example Code
UC_FROALA_RTE.setValue(
p_item_name in varchar2,
p_value in CLOB
);
Argument | Type | Description |
---|---|---|
p_item_name | VARCHAR2 | An item name implementing the plug-in. |
p_value | CLOB | A CLOB value for a rich text document. |
declare
v_clob clob;
begin
UC_FROALA_RTE.setValue(
p_item_name => 'P1_UC_RTE_PRO',
p_value => v_clob
);
end;
toolbar_init_group
The procedures defines buttons available in specified toolbar group. The procedure can be used only in the plug-in page item attribute Initialization PL/SQL Code.
- Syntax
- Parameters
- Example Code
procedure toolbar_init_group(
p_responsive in varchar2 default c_toolbar_responsive_sd,
p_group in varchar2,
p_visible_buttons in integer,
p_align in varchar2,
p_buttons in apex_t_varchar2
);
Argument | Type | Description |
---|---|---|
p_responsive | VARCHAR2 | The toolbar responsive definition threshold. When NULL , the procedure define group buttons using toolbarbuttons option for standard screen devices (with 1200px or larger). |
p_group | VARCHAR2 | The toolbar group to be defined. |
p_visible_buttons | INTEGER | A number of buttons visible in the given group. |
p_align | VARCHAR2 | Group alignment in toolbar. |
p_buttons | apex_t_varchar2 | A list of buttons available in specified group. |
The parameter p_responsive accepts the following values:
- UC_FROALA_RTE.c_toolbar_responsive_sd
- UC_FROALA_RTE.c_toolbar_responsive_md
- UC_FROALA_RTE.c_toolbar_responsive_sm
- UC_FROALA_RTE.c_toolbar_responsive_xs
The parameter p_groups accepts the following values:
- UC_FROALA_RTE.c_toolbar_group_paragraph
- UC_FROALA_RTE.c_toolbar_group_text
- UC_FROALA_RTE.c_toolbar_group_rich
- UC_FROALA_RTE.c_toolbar_group_misc
The parameter p_align accepts the following values:
The parameter p_buttons accepts button IDs listed here.
UC_FROALA_RTE.toolbar_init_group(
p_group => UC_FROALA_RTE.c_toolbar_group_paragraph,
p_visible_buttons => 1,
p_align => UC_FROALA_RTE.c_toolbar_align_left,
p_buttons => apex_t_varchar2('bold', 'italic')
);