Databases Reference
In-Depth Information
Figure 11-14. The Comments region of the Create/Edit page
PL/SQL APIs
Many tasks involved with developing plug-ins are common. Examples include
Using external files, such as JavaScript, image, and CSS files
Querying data and processing the results
Performing Ajax calls
A number of PL/SQL APIs have been developed to help make these tasks easier to complete than
they would otherwise be. Learning about these APIs is important, even if only at the most basic level, as
it could save you from reinventing the wheel when you really only want to build a plug-in. This section
provides an introduction to the PL/SQL APIs most commonly used for plug-in development in APEX.
APEX_PLUGIN
The APEX PLUGIN package contains a number of core types and functions which are used specifically for
plug-ins. The record types are used in the source code and callback functions of a plug-in. Here's an
example from an item render function that demonstrates their use (see the item plug-in in the tutorials
section for a complete example):
FUNCTION password render (
p item IN APEX PLUGIN.T PAGE ITEM,
p plugin IN APEX PLUGIN.T PLUGIN,
p value IN VARCHAR2,
p is readonly IN BOOLEAN,
p is printer friendly IN BOOLEAN
)
RETURN APEX PLUGIN.T PAGE ITEM RENDER RESULT
The T PLUGIN record type, used above as the data type for the formal parameter p plugin , is
included as a parameter in every callback function. It provides developers with access to the application
level attributes of a plug-in such as the name, file prefix, and any custom attributes added at that level.
Each type of plug-in also has a number of dedicated record types defined in the APEX PLUGIN
package which are used in the callback functions: one used as a formal parameter and a number of
others used as result types. The record type used as a formal parameter, T PAGE ITEM in this example,
provides developers with access to the component level attributes such as the name, standard attributes,
and any custom attributes added at that level.
Search WWH ::




Custom Search