Home arrow SOAP & Web Services arrow Page 7 - Dynamic Data Analysis on the Web-a Design Approach

Value formatting tags - Web Services

Learn about an adaptable approach which separates programming tasks from Web page design tasks. This strong conceptual model encourages good design, enables re-use of data definitions, and is well-suited to the construction of dynamic user interfaces. The authors also illustrate the particular challenges you might encounter when you dynamically change the analysis performed by Web pages. (This intermediate-level article was first published by IBM developerWorks, August 5, 2004, at http://www.ibm.com/developerWorks).

  1. Dynamic Data Analysis on the Web-a Design Approach
  2. Data analysis concepts
  3. Dimensions and measures
  4. Filtering and ordering
  5. Dimension, measure, and slice dimension tags
  6. Presenting data
  7. Value formatting tags
  8. Use of JavaBeans to provide dynamic values
  9. Reporting common errors
  10. Tag containment
  11. Custom tags: lightweight, cheap, replaceable
  12. Benefits of this design approach
  13. In conclusion
By: developerWorks
Rating: starstarstarstarstar / 15
December 29, 2004

print this article



In the example, the page author has chosen specific presentation tags that he or she knows will suit the result values.

The write tag is used to evaluate data values in its body and include them in the page content.

The valueFromColumn tag references a forRows tag using the rowRef attribute, and extracts a value from a particular column in each row. It is configured with a single dimension or measure tag.

The numberFormat tag expects a numeric value within its body and formats this according to the specified style. The documentation for each data source needs to explain to the page author what type of values are found in each of the dimensions and measures. The set of custom tags for data presentation have to include a range of value formatting tags to meet the needs of the page author.

Table 1. Example output of generalised presentation tags

YearProductUnit SalesRevenue
2001Widget A1001,000
2001Widget B801,200
2001Widget C601,100

YearProductUnit SalesRevenue
2002Widget C801,650
2002Widget A60600

YearProductUnit SalesRevenue
2003Widget B60900

In Table 1, an example of the output generated by the tags in Listing 2 is shown. The table lists sales information covering three distinct years and three products for the sales region of interest. Note that the measures have been aggregated for each unique combination of year and product, resulting in six output rows which have been collected into three slices. The rows are in order of year first, and then by unit sales within year in descending order.

Specialised presentation tags

The generalised tags above will meet the many needs of the page author. However, inevitably specialised presentation requirements will need the development of bespoke function.

Listing 3 shows an example of a bespoke tag designed with specific knowledge of the data it is to work with.

Listing 3. A specialised presentation tag

<%@ taglib uri="/WEB-INF/tlds/dc.tld" prefix="dc" %>

<dc:satisfactionChart id="sattrend" width="100%" dataRef="satdata" aggregation="trend"
  monthDimension="Month" yearDimension="Year"
  sampleSizeMeasure="NSI Sample Size" lowSampleSizeMeasure="Low Sample Size"
  nsiMeasure="NSI" satVSatMeasure="SatVSat">
  <dc:title>Net Satisfaction Index (NSI) - Product Diagnostic Survey</dc:title>

In Listing 3, the satisfactionChart tag references a data tag using the dataRef attribute. The dimensions and measures that the satisfactionChart tag requires are named by attributes, which allows it to work with different data sources with different dimension and measure names, provided the data in those dimensions and measures conforms to its requirements. A chart title is provided using the nested title tag. An example of the output from the satisfactionChart tag is shown in Figure 1.

Figure 1. Example output of a specialised presentation tag

Example output of a specialised presentation tag

Enabling dynamic data analysis

Flexibility in presenting information is half of the equation, but to be truly dynamic, the user has to be given the means to modify the information being presented.

The data-related tags illustrated in Listing 1 lend themselves to dynamic control in a structured, yet versatile way. The OLAP-like model provides a structure which ensures that any resulting query is well-formed and valid. Custom JSP tags, such as those illustrated earlier, provide a number of opportunities for dynamic substitution including:

  • Selection of dimensions to be included in the analysis
  • Selection of measures to be included in the analysis
  • Provision of filtering values to be used to constrain the result data
  •  Selection of alternative ordering options for the result data

>>> More SOAP & Web Services Articles          >>> More By developerWorks

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Google Play Launched to Revive Brand
- Google Releases Preview of its Cloud SQL Ser...
- Microsoft and Amazon Team Up for the Cloud
- GoDaddy Joining the Cloud
- Amazon EBS Outage Challenges Cloud Supporters
- Dynamic Data Analysis on the Web-a Design Ap...
- Use collection types with SOAP and JAX-RPC
- Blogging Away To Glory (A bBlog Primer)
- Introduction to Service Oriented Architectur...
- Connecting Smart Devices on the Internet
- An Embeddable Standards Compliant Web Servic...

Developer Shed Affiliates


Dev Shed Tutorial Topics: