You create data sources to add data from any of the following types of sources to a Nexaweb application:
Remote URI/REST Request
XML
XAL UI File
JSP
Project servlet
SOA data from a web service or database
Use the Create Data Source wizard to add a data source to your Nexaweb application project.
To create a data source, follow these steps:
1. Launch the Create Data Source wizard in any of the following ways:
|
From Nexaweb Data perspective: |
From Nexaweb perspective: |
|
|
The Data Source Selection dialog appears.
2. Complete the Data Source Selection wizard as follows:
|
Figure 114: Data Source Selection Dialog |
Select type of source data: Click to select the appropriate type of datasource to add: Data Source ID: Specify a unique ID for this data source. |
Click Next.
The Data Selection dialog appears.
3. Complete the Data Selection dialog as follows:
|
Figure 115: Data Selection Dialog |
Select data location: To specify the source data file, click on one of the data source type options: Client Side Keep Source Empty: Leaves source undefined so data is not initially loaded. You must specify source later using either setSource or loadSourceFromServer APIs (see AbstractDataSource). Server Side Remote URI/REST Request: Connects data source to a remote URL. For example, an RSS feed. XML file: Specifies a server-side XML file to use as the data source. Select File: Optionally, if you specified documentDataSource as the type for this data source: click Choose File to create a new XML file to use any server-side file type as the data source. JavaServerPage (JSP): Specifies a JSP file on the server to use as the data source. Project Servlet: Specifies a servlet, a Java EE server-side handler for web requests, as the data source. Data Service Connection Service Request: Specifies SOA data from a web service or database to use as a datasource. This creates a Nexaweb dataservice serviceRequest. |
3. After selecting Data location either:
|
To select an existing file: |
To create a new file: |
|
Click Next. A File Selection dialog appears: |
Click Add New and then click Next. |
2. See the following sections for adding the various types of data sources.
After adding the data source a Data Source Attributes dialog appears.
3. Complete the Data Source Attributes dialog as follows:
|
|
DocumentName: Registers the source document retrieved from the source in the DocumentRegistry. Click in the value field beside and specify the document name. OnDataChanged: Specify a call to an event handler (MCO, Macro and so forth) for when this event notification fires. Click in the value field and then click OnDataRequestCompleted: Specify a call to an event handler (MCO, Macro and so forth) for when this event notification fires. Click in the value field and then click OnDataRequestFailed Specify a call to an event handler (MCO, Macro and so forth) for when this event notification fires. Click in the value field and then click RefreshOnAttributeChange: Specifies whether to refresh the datasource when attribute change events fire on any element in the source file. Click in the value field and then click the arrow in this field to select true or false. RefreshOnStructureChange: Specifies whether to refresh the datasource when structure change events fire on any element in the source file. Click in the value field and then click the arrow in this field to select true or false. |
4. Click Next.
Nexaweb Studio displays the syntax of this datasource.
Optionally, click Back to edit the datasource.
5. Click Finish.
The data source you added appears:
-In Data view, under the Data Source node.
- In the Outline view under the UI file to which you added it.