|Use the data in DB2® XML columns to create an Atom feed.
Use the data in DB2® XML columns to create an Atom feed.
Before you begin
The DB2 native XML data store feature, also called pureXML®, stores each well-formed XML document in a separate row in the DB2 table. The XML documents are stored in their native hierarchical form. Each XML document in the DB2 XML column becomes one entry in the Atom feed.
About this task
To create a pureXML feed:
- On the Home:Catalog page, click Create and select New Feed.
- Select DB2 XML Columns (pureXML) and click Next.
- Connection Profile: Select a database that is already known to MashupHub, or select New to create a new database specification.
Important: If you edit the connection profile, all feeds that use the profile are affected. Before you edit a profile, ensure that the database schema is the same and that no dependent feeds will be broken.
In the Connection Type field, select Driver Manager (Non-managed Connection) or JNDI (Managed Connection):
If you grant Edit permission for a database feed to another user, that user can change the profile, which will change the properties for all the feeds that use that profile.
- If you select a known profile, the remaining fields are automatically filled in.
- For a new connection profile, in the Connection Profile Name field, type the new profile name.
The fields that are displayed depend on the database and the connection type that you select.
- Driver Manager (Non-managed Connection): Connects to the database using the JDBC DriverManager interface. Connection management is not handled by the WebSphere® Application Server, but through the API instead.
JNDI (Managed Connection): Requires the specification of the JNDI name. With managed connections, a connection factory must have been defined by using the WebSphere Application Server Administrative console. This JNDI name needs to have been specified in the connection factory. The JNDI name is case-sensitive.
- In the Database Name field, type the database name that contains the tables from which to generate the feed.
- In the Host field, type the hostname or IP address of the database server.
- In the Port field, type the port number.
- In the Username field, type the user ID that you use to connect to the database.
- In the Password field, type the password that is associated with the user ID that you use to connect to the database.
Restriction: Only direct JNDI names are supported. With direct JNDI names, such as jdbc/myDataSource, the application server assigns default values to the resource reference data. Indirect JNDI names require the use of an assembly tool to define the resource references. They are not supported.
Click Next. The Specify the options for the PureXML feed window is comprised of a set of tabs.
On the DB2 Data tab, select the table and column that you want to create a feed from. MashupHub automatically fills in the DB2 Table and DB2 Column fields on the DB2 Data tab.
On the Content tab, specify the elements in the XML data:
On the Criteria tab, specify the criteria that you want to use to filter the XML content:
- Entry Title: Select the element from the XML data that best represents the overall XML content.
- Entry Summary: Select the element from the XML data that best summaries the XML content.
- Entry Author: Select the element from the XML data that contains the author or source of the XML content.
The fields that are displayed depend on your selections.
- Row Conditional: Specify the element from the XML data you want to filter on. The XPath for the element is displayed.
- In the Value field, specify the value for the element that you specified in the Row Conditional field.
Note: The Value field is displayed when you select Contain, Equal, or Compare Numerically To operations.
Use the Inclusion, Operation, and Comparisons fields to specify the type of filter that you want to perform.
Inclusion specifies whether to include the results where the Row Conditional matches the comparison. The Is Not selection returns all results except those that match the comparison.
On the Length tab, specify the maximum number of entries that the feed should include. This value defines how many XML documents are displayed when you view the feed. The default maximum is 10 entries.
Enter the feed details. See Specifying the object details and registering the object.
Note: The Comparisons choices are displayed when you select the Compare Numerically To operation.
For example, you want to filter based on a specific price, such as 9.99 and the price element is nested under the product and description elements, you would select the following criteria.
|Criteria selections||Sample |
|Operation||Compare Numerically To|
After you save the feed, click View Feed in Browser
. The results appear in a new tab or window in the browser.
The elements in the output of a DB2 XML column (pureXML) feed will have the atm:
prefix except elements in this namespace http://www.ibm.com/xmlns/atom/content/datarow/1.0
will have the atr:
The number of items in the Atom feed is limited by the value that you specified in the Number of Results
You might need to view the page source from the browser to see all the information in the feed. For example, in Firefox select View
-> Page Source
Sample format for DB2 pureXML feeds: imc3
You can create an Atom feed from a pureXML source by using the set of XML documents that are stored in the DB2 XML columns. Each XML document in the DB2 XML column becomes one entry in the Atom feed.
Parent topic: Creating and registering new feeds: imc3