You can create Liquid Data controls in a variety of WebLogic Workshop projects. This section includes the following procedures to create Liquid Data controls:
The steps are similar for creating Liquid Data controls in other types of WebLogic Workshop projects.
This section describes the general steps for creating a Liquid Data control. For detailed steps for creating a Liquid Data control in a Web Project or in a Web Service project, see To Create a Liquid Data Control in a Web Project or To Create a Liquid Data Control in a Web Service Project.
Before you can create a Liquid Data control in WebLogic Workshop, you must create an application and create a project in the application. You can create a Liquid Data control in most types of Workshop projects, but the most common projects in which you create Liquid Data controls are Web Projects, Web Service Projects, Portal Web Projects, or a Process Web Projects.
Make sure Liquid Data is running. Liquid Data can be running locally (on the same domain as WebLogic Workshop) or remote (on a different domain from workshop). If Liquid Data is not running, start up the domain in which it runs.
Create a folder in the project to hold the Liquid Data control(s). You can also create other controls (database controls, for example) in the same folder, if needed. Workshop controls cannot be created at the top-level of a project directory structure; they must be created in a folder. When you create the folder, enter a name that makes sense for your application.
Figure 1-2 Create a New Folder in WorkshopLiquid Data
The Liquid Data Control is a Java Control Extension. To create a Liquid Data Control, start the Java Control wizard by selecting your folder within a project, right-clicking, and selecting New —> Java Control, as shown in Figure 1-3. You can also create a control using the File —> New—> Java Control menu item.
Figure 1-3 Create a New Liquid Data Control
Then select Liquid Data from the New Java Control Extension dialog, as shown in Figure 1-4. Enter a filename for the control (.jcx) file and click Next.
Figure 1-4 Liquid Data Control in WebLogic Workshop
A screen similar to the one in Figure 1-5 allows you to enter connection information to your Liquid Data server. If the server is local, the Liquid Data control uses the connection information stored in the application properties (to view these settings, access the Tools —> Application Properties menu item in the IDE).
If the Liquid Data server is remote, click the Remote button and fill in the appropriate server URL, user name, and password.
Note: You can specify a different username and password with which you connect to a local machine on the Liquid Data Control Wizard Connection Information dialog, too. To do this, click the Remote button and enter the connection information (with a different username and password) for your local machine. The security credentials specified through the Application Properties or through the Liquid Data Control Wizard are only used for creating the Liquid Data Control (.jcx) file, not for testing queries through the control. For more details, see Security Considerations With Liquid Data Controls.
When the information is correct, click Create to go to the next step.
Figure 1-5 Liquid Data Control Wizard—Connection Information
In the Select Liquid Data Queries screen, select queries from the left pane and click Add to add those queries to the control. If you mouse over a query, the signature of the control method for the query appears in a tooltip popup. A "fetching metadata" message appears if the signature has not yet been retrieved from the Liquid Data server.
Note: Only stored queries with a schema configured appear in the Stored Queries list. For details on configuring stored queries, see Configuring Stored Queries in the Administration Guide.
Select one or more queries, add them to the right pane, and click Finish. When you click Finish, the Liquid Data Control (.jcx) file is generated and XMLBean classes corresponding to the schema for each stored query in the control are generated. The XMLBeans are stored in the Libraries directory of the Workshop Application. In the Libraries directory, there is one JAR file for each Liquid Data control, with the XMLBeans included in the JAR file. The JAR files are named according to the project and directory hierarchy for the control (.jcx) file.
Figure 1-6 Liquid Data Control Wizard—Select Queries
Note: The stored queries should be named according to the Naming Conventions for Stored Queries described in Building Queries and Data Views. If a stored query contains illegal characters (for example, a hyphen), the method generated in the Liquid Data Control (.jcx) file might be an invalid Java name, causing compilation errors. If a method name is invalid, you can change the name to make it valid.
Clicking the New Query button launches the Data View Builder. You can then use the Data View Builder to create, modify, test, and deploy new queries.
The Refresh button updates the stored query list from the Liquid Data server. If you create and deploy a new query with the Data View Builder, click the Refresh button to display the new query in the wizard.
This section describes the basic steps for creating a Liquid Data control in a new Web Project. If you are adding the control to an existing project, you might not need to perform each step (for example, creating a new project). Perform the following steps to create a Liquid Data control in a new WebLogic Workshop Web Project.
Workshop generates the .jcx Java Control Extension file for your Liquid Data control. Each method in the .jcx file returns an XMLBean type corresponding to the stored query schema. The XMLBean classes for each query are automatically generated when you create the Liquid Data control. The XMLBean classes are stored in the Libraries directory of the Workshop Application.
This section describes the basic steps for creating a Liquid Data control in a new Web Service. If you are adding the control to an existing Web Service, you might not need to perform each step (for example, creating a new project). Perform the following steps to create a Liquid Data control in a new WebLogic Workshop Web Service Project.
Workshop generates the .jcx Java Control Extension file for your Liquid Data control. Each method in the .jcx file returns an XMLBean of the type corresponding to the schema from the stored query. The XMLBean for each query is automatically generated when you create the Liquid Data control. The XMLBeans are stored in the Libraries directory of the Workshop Application.
Perform the following steps to add a Liquid Data Control to an existing Web Service .jws file.
Figure 1-7 Add a Liquid Data Control to Web Service
Figure 1-8 Insert Control Wizard
Perform the following steps to generate and test a web service from a Liquid Data Control.
Workshop generates the .jws Java Web Service file for your Liquid Data control.
Workshop builds an asynchronous Web Service from the .jws file.
The Web Service executes the query and the results are returned to the test browser.