Databases Reference
In-Depth Information
Cupertino—it is as simple as adding the following link after the first so that its rules overwrite any
previous rules.
<link type="text/css" href="/i/libraries/jquery-ui/1.8/themes/cupertino/
jquery-ui.css" rel="stylesheet">
Like the introduction to the jQuery UI Widget Factory, this introduction to the jQuery UI CSS
Framework is just that: an introduction. If you'd like to learn more I recommend you start by learning
from the jQuery and jQuery UI websites. The time spent learning these technologies should easily pay
you back time and time again when you develop plug-ins in APEX.
Plug-in Tutorials
In the first two parts of this chapter I explored the various components of the APEX plug-in architecture
as well as some other tools that can be helpful when developing plug-ins. In this last part I will put
everything I covered to use as I guide you through a series of plug-in development tutorials—one for
each type of plug-in in APEX.
While the tutorials will walk you through the steps required to build a plug-in, they will not
accurately reproduce the plug-in development experience, which is far more iterative. They will,
however, provide you with a decent understanding of how many of the pieces come together to create
useful plug-ins. We will start with some basic techniques and work our way into some rather
sophisticated plug-in development.
To demonstrate some best practices in a generic way, I will pretend the plug-ins are being
developed for a fictitious company named PlugGen. Each tutorial follows a similar pattern of
development. First, a description of the plug-in to be created is provided along with some basic
requirements. Next, the steps required to build the plug-in are laid out in detail.
Each tutorial is independent of the others, but the steps to create them should be completed in
order, from start to finish. If a step to set an attribute's value on a page is not included, then the
attribute's default value should be used.
Developing a Process Plug-in
In its simplest form, geocoding can be defined as the process of finding the longitude and latitude
coordinates of a location from its address. In this tutorial you will create a process plug-in that can be
used for geocoding. The plug-in will serve as a wrapper for Yahoo's geocoding API which will do the
heavy lifting.
Yahoo requires developers to specify a Yahoo Application ID when using their APIs. These
Application IDs can be obtained for free after creating an account at http://developer.yahoo.com .
Because the Application ID will differ for each plug-in user, a custom application level attribute will be
added to the plug-in that allows plug-in users to specify their unique ID.
Three component level attributes will be added as well. One attribute will allow the plug-in user to
specify the name of the item on the page that will contain the address to be geocoded. The other two
items will be used to identify the items into which the latitude and longitude values will be returned
when the geocoding operation has completed successfully.
The logic of the plug-in will be written in such a way that the longitude and latitude items will be
cleared out if the address item is null, if multiple addresses were found based on the address supplied, or
if the “quality” of the coordinates is less than 87 out of 100. To begin creating the plug-in, navigate to
Shared Components Plug-ins and follow these steps, as shown in Figure 11-17.
Search WWH ::




Custom Search