|Oracle® Fusion Middleware Client-Side Developer's Guide for Oracle WebLogic Portal
10g Release 3 (10.3.4)
Part Number E14229-02
This chapter includes these topics:
This section explains how to set up a WebLogic Portal project that includes the Dojo Toolkit.
Locate and download the Dojo Toolkit. The toolkit is available at
Unzip the download file.
In Oracle Enterprise Pack for Eclipse, create a Portal Web Project, a Portal EAR Project, a server, and a domain. See the Oracle Fusion Middleware Tutorials for Oracle WebLogic Portal for details on these tasks.
In the WebContent folder of the Portal Web Project, create a folder called
resources. In that folder, create a subfolder called
Import the Dojo Toolkit folder into the
resources/js folder. To do this, right-click the
resources/js folder and select Import. In the wizard, select General > Filesystem. Import both the
dijit folders from the Dojo download directory. See Figure 4-1.
portlets folder under the WebContent folder of the web project.
In the portlets folder, create a new JSP portlet descriptor file, called
dojotest.portlet. To do this, right-click the folder and select New > Portlet. Use the portlet wizard to create a JSP portlet. The wizard automatically creates both the portlet file and an empty JSP file called, by default,
Configure the portlet to refer to the render dependencies file. To do this, open the portlet in the Portlet Editor view. Set the LAF Dependencies Path in the portlet Properties editor to point to the dependencies file you created.
Add the code in Example 4-1 to the JSP file. The sample code performs these tasks:
Add the portlet to a portal and run it on the server. When you click the button in the portlet, the popup displays the text defined in the callback.
This section explains the purpose and importance of render dependency files and how to create a render dependencies file.
The simplest way to create a render dependencies file is to right-click a folder in your web application and select New > Other > WebLogic Portal > Markup Files > Render Dependencies. The resulting file looks like Example 4-2.
<?xml version="1.0" encoding="UTF-8"?> <window xmlns="http://www.bea.com/servers/portal/framework/laf/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/portal/framework/laf/1.0.0 laf-window-1_0_0.xsd"> </window>
Next, add a <render-dependencies> XML tag to the file. Include in the tag the path to the Dojo toolkit, as shown in Example 4-3. This listing includes certain elements that Dojo requires for this example: the Tundra theme and the djConfig object, which is created when the page loads and configures Dojo.
The <path-element> must be a relative reference from the render dependencies file to the directory that contains the script sources referenced by the <script> tags.