- IS_DEVELOPER Function
- IS_DEVELOPER_YN Function
- IS_SESSION_VALID Function
- IS_SESSION_VALID_YN Function
- CREATE_SESSION Procedure
- JOIN_SESSION Procedure
- TRIM_PAGE_ITEMS Procedure
- IS_PAGE_ITEM_RENDERED Function
Returns true/false if APEX developer is enable
Supports both APEX 4 and 5
Can be used in APEX to declaratively determine if in development mode.
function is_developer
return boolean
Name | Description |
---|---|
return | boolan True: Developer has an active session in Application Builder |
begin
if oos_util_apex.is_developer then
dbms_output.put_line('Developer mode');
else
dbms_output.put_line('Non-Dev mode');
end if;
end;
Returns Y/N if APEX developer is enable
See is_developer
for details
function is_developer_yn
return varchar2
Name | Description |
---|---|
return | Y or N |
begin
if oos_util_apex.is_developer_yn = 'Y' then
dbms_output.put_line('Developer mode');
else
dbms_output.put_line('Non-Dev mode');
end if;
end;
Checks if APEX session is still active/valid
function is_session_valid(
p_session_id in apex_workspace_sessions.apex_session_id%type)
return boolean
Name | Description |
---|---|
p_session_id |
APEX session ID |
return | true/false |
begin
if oos_util_apex.is_session_valid(p_session_id => :app_session) then
dbms_output.put_line('Session is active');
else
dbms_output.put_line('Session is inactive');
end if;
end;
Checks if session is still active
function is_session_valid_yn(
p_session_id in apex_workspace_sessions.apex_session_id%type)
return varchar2
Name | Description |
---|---|
p_session_id |
APEX session ID |
return | Y/N |
begin
if oos_util_apex.is_session_valid_yn(p_session_id => :app_session) = 'Y' then
dbms_output.put_line('Session is active');
else
dbms_output.put_line('Session is inactive');
end if;
end;
Creates a new APEX session.
Useful when testing APEX functionality in PL/SQL or using apex_mail etc
Can only create one per Oracle session. To connect to a different APEX session, reconnect the Oracle session
Notes:
- Content taken from:
procedure create_session(
p_app_id in apex_applications.application_id%type,
p_user_name in apex_workspace_sessions.user_name%type,
p_page_id in apex_application_pages.page_id%type default null,
p_session_id in apex_workspace_sessions.apex_session_id%type default null)
Name | Description |
---|---|
p_app_id |
|
p_user_name |
|
p_page_id |
Page to try and register for post login. Recommended to leave null |
p_session_id |
Session to re-join. Recommended leave null |
begin
oos_util_apex.create_session(
p_app_id => :app_id,
p_user_name => :app_user,
p_page_id => :app_page_id);
);
end;
Join an existing APEX session
Notes:
v('P1_X')
won't work. Useapex_util.get_session_state('P1_X')
instead
procedure join_session(
p_session_id in apex_workspace_sessions.apex_session_id%type,
p_app_id in apex_applications.application_id%type default null)
Name | Description |
---|---|
p_session_id |
The session you want to join. Must be an existing active session. |
p_app_id |
Use if multiple applications are linked to the same session. If null, last used application will be used. |
begin
oos_util_apex.join_session(
p_session_id => :app_session,
p_app_id => :app_id
);
end;
Trims whitespace APEX page items (before and after).
Useful when submitting a page to trim all items.
Notes:
- Suggested to run submit page process application wide
- Excludes inputs that users shouldn't modify and password fields
- Ex: select list, hidden values, files
procedure trim_page_items(
p_page_id in apex_application_pages.page_id%type default apex_application.g_flow_step_id)
Name | Description |
---|---|
p_page_id |
Items on this page will be trimmed. |
begin
oos_util_apex.trim_page_items(p_page_id => :app_page_id);
end;
Returns true/false if page item was rendered
Notes:
- This should only run on a page submit process otherwise it won't work. An error is raised otherwise
function is_page_item_rendered(
p_item_name in apex_application_page_items.item_name%type)
return boolean
Name | Description |
---|---|
return | true/false |
begin
if oos_util_apex.is_page_item_rendered(p_item_name => 'P1_EMPNO') then
dbms_output.put_line('P1_EMPNO rendered');
else
dbms_output.put_line('P1_EMPNO was not rendered');
end if;
end;