IBM i > TRENDS > OPEN SOURCE

Two New Open-Source Database Tools

A quick look at CGI_WRKDBF and Xataface



 

With just these two files (only one of which is specific to our application), Xataface provides a basic application that lets us display our tables and rows, enter new rows, perform searches, etc. Take a quick look at Figure 1 for an idea of what’s produced.

In the upper-left corner, you can see the tabs that are used to select which table we want to be displayed. The left-hand side of the window is blank right now. In the basic template, it’s reserved for your own menu items so you can integrate the application into your existing Web applications. We haven’t defined anything, so ours is blank. Note that everything you see here is fully customizable by modifying the application templates and using the configuration files. We wanted you to see just how much you get with almost no work! You’ll also notice that on the right-hand side are icons for exporting the data as a comma delimited file, XML file or RSS feed. Other export options are available but these are the standard ones.

To demonstrate how easy it is to customize an Xataface application, we’ll tidy up a few of the column headings and provide a drop-down selection list for the Product Category column.

The first thing to understand is that Xataface is convention driven. If we want to customize the way tables are displayed, we must start by creating a directory called “tables” in the application root (i.e., the directory where our index.php file is located) and within that create a directory for each of our tables. It’s within these table directories that we place our other configuration files. We’ll only deal with two of them here—fields.ini and valuelists.ini.

fields.ini lets us do things like provide more meaningful column headings, provide narrative text to explain the content and determine the column type (check box, selection list, etc.). In our example (a portion of the total file), we’ve provided the label “Product Code” for the ID column of the Product table.

[id]
widget:label="Product Code"
widget:description=“Enter the unique product code here:"

[description]
widget:label="Product Description"

[category]
widget:label="Product Category"
widget:description="Please select the appropriate category"
widget:type=select
vocabulary=category

 

Jon Paris is a technical editor with IBM Systems Magazine and co-owner of Partner400.

Susan Gantner is a technical editor with IBM Systems Magazine and co-owner of Partner400.


comments powered by Disqus

Advertisement

Advertisement

2019 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.

A PHP Partnership

Zend and IBM team up to deliver open-source solutions to IBM i

Making the Net More Inclusive

IBM hopes to help disabled and illiterate users surf the Web

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
IBMi News Sign Up Today! Past News Letters