Databases Reference
In-Depth Information
At this point the base of the plug-in has been created and all of the regions of the Create/Edit page
should be visible. Before continuing with the plug-in, let's walk through the code entered in the
execution function. First, the function header is defined. Note that the signature of the function matches
what is expected for a process execution function.
FUNCTION geocode execution (
p process IN APEX PLUGIN.T PROCESS,
p plugin IN APEX PLUGIN.T PLUGIN
)
RETURN APEX PLUGIN.T PROCESS EXEC RESULT
Next, local variables and an inline procedure are declared. Some of the local variables are simply
used to provide better names for the attribute values that are passed into the function. The inline
procedure will clear the values of the longitude and latitude items when appropriate.
IS
l retval APEX PLUGIN.T PROCESS EXEC RESULT;
l yahoo appid VARCHAR2(500) := p plugin.attribute 01;
l address item VARCHAR2(100) := p process.attribute 01;
l lat item VARCHAR2(100) := p process.attribute 02;
l long item VARCHAR2(100) := p process.attribute 03;
l address item val VARCHAR2(32767);
l rest result XMLTYPE;
l parm name list WWV FLOW GLOBAL.VC ARR2;
l parm value list WWV FLOW GLOBAL.VC ARR2;
l error VARCHAR2(32767);
l found count PLS INTEGER;
PROCEDURE clear lat long
IS
BEGIN
apex util.set session state(l lat item, '');
apex util.set session state(l long item, '');
END;
The following lines begin the execution section of the function. If the application is running in
debug mode then a call to APEX PLUGIN UTIL.DEBUG PROCESS is made to log debug information.
BEGIN
IF apex application.g debug
THEN
apex plugin util.debug process(
p plugin => p plugin,
p process => p process
);
END IF;
If the value of the address item is null then the latitude and longitude item values are cleared.
Search WWH ::




Custom Search