A process type plug-in extends the functionality of a page process. This can be anything but it is typically used for APEX built-ins or Internet functionalities like e-mail sender or Twitter update. The benefit of this is that the process type plug-ins can be reused. We will create a process type plug-in which changes the language by using the APEX_UTIL.SET_SESSION_LANG
built-in. There are more ways to change the session language but in this recipe, we will use this built-in in a page process to demonstrate how it works.
function set_language ( p_process in apex_plugin.t_process, p_plugin in apex_plugin.t_plugin ) return apex_plugin.t_process_exec_result is Dynamic Attribute mapping l_language varchar2(50) := p_process.attribute_01; l_result apex_plugin.t_process_exec_result; begin Set session language apex_util.set_session_lang(l_language); Set success message l_result.success_message := 'Session language switched to '||l_language; return l_result; end set_language; [set_language.sql]
The function starts with two arguments, which are necessary but have a default value. The return type is apex_plugin.t_process_exec_result
. The actual switch is done by APEX_UTIL.SET_SESSION_LANG
.
3.144.17.128