Data processing for Atom feeds from CICS

To produce an Atom feed or collection document containing Atom entries, CICS obtains data for the Atom entries either directly from a file or temporary storage queue, or from a service routine that extracts data from another resource.

Figure 1 shows how CICS uses an Atom configuration file to identify and extract relevant data from a record in a file:

Figure 1. Extracting Atom entry data directly from a file
A file record contains a field "Title" with the data "My first entry", and a field "Content" with the data "Content for the first entry". In CICS Atom processing, an Atom configuration file includes the element <cics:fieldnames title="Title" content="Content"/>, which identify the Title and Content fields in the file record. CICS Atom processing extracts the data from these fields and places it in <atom:title> and <atom:content> elements respectively, to form an Atom entry.
  • The record in the file contains fields called "Title" and "Content" that hold data for the Atom entry.
  • The Atom configuration file includes a <cics:resource> element that identifies the file, a <cics:bind> element that refers to the XML binding for the file, and a <cics:fieldnames> element. The title attribute of the <cics:fieldnames> element identifies the "Title" field in the file record as the field that holds the data for the title of the Atom entry. The content attribute identifies the "Content" field in the file record as the field that holds the data for the content of the Atom entry.
  • CICS uses the information in the Atom configuration file and the XML binding to locate and extract the data from the "Title" and "Content" fields in the file record, and uses that data to populate the <atom:title> and <atom:content> elements of an Atom entry in an Atom feed document.
  • When CICS has carried out this processing for a series of records from the file to produce the required number of Atom entries, CICS sends the Atom feed document containing the Atom entries to the web client.

Figure 2 shows how CICS obtains data from a record in a database through a user-written service routine program:

Figure 2. Using a service routine to supply Atom entry data
A database record contains a field "Title" with the data "My first entry", and a field "Content" with the data "Content for the first entry". A service routine extracts this data from the database record, and writes it into containers called DFHATOMTITLE and DFHATOMCONTENT, which it returns to CICS Atom processing. The service routine also interacts with a container called DFHATOMPARMS supplied by CICS Atom processing, which might contain information from the <cics:fieldnames> element in an Atom configuration file. In CICS Atom processing, an Atom configuration file includes the element <atom:title> Default title for an Atom entry</atom:title>, and the element <atom:author>, which contains an <atom:name> element giving the author name Joe Bloggs. The <atom:name> element in the Atom configuration file supplies an author name for an Atom entry in an Atom feed document, and the data from the DFHATOMTITLE and DFHATOMCONTENT containers supplies the content for the Atom entry.
  • The record in the database contains fields called "Title" and "Content" that hold data for the Atom entry.
  • A service routine extracts the data from the "Title" and "Content" fields in the database. If a service routine is working with a resource that has an XML binding, it can obtain the names of the relevant fields from information in a <cics:fieldnames> element in an Atom configuration file, which CICS passes to the service routine as parameters in a container called DFHATOMPARMS. DFHATOMPARMS also contains other information about the web client's request.
  • The service routine creates containers called DFHATOMTITLE and DFHATOMCONTENT, and writes the data from the "Title" and "Content" fields into the containers. It then returns the containers to CICS Atom processing.
  • The Atom configuration file includes an <atom:title> element that gives a default title for Atom entries, and an <atom:author> element that contains an <atom:name> element giving the author name Joe Bloggs.
  • CICS composes an Atom entry using the title and content that were supplied by the service routine in the DFHATOMTITLE and DFHATOMCONTENT containers. The service routine did not supply an author name, so CICS uses the author name from the Atom configuration file. CICS does not need the default title from the Atom configuration file, because the service routine has supplied that data.
  • When CICS has called the service routine a number of times to supply data from different database records to produce the required number of Atom entries, CICS sends the Atom feed document containing the Atom entries to the web client.