Web Services
  Home arrow Web Services arrow Page 6 - Dynamic Data Analysis on the Web-a Des...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
SunQuest
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB SERVICES

Dynamic Data Analysis on the Web-a Design Approach
By: developerWorks
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2004-12-29

    Table of Contents:
  • Dynamic Data Analysis on the Web-a Design Approach
  • Data analysis concepts
  • Dimensions and measures
  • Filtering and ordering
  • Dimension, measure, and slice dimension tags
  • Presenting data
  • Value formatting tags
  • Use of JavaBeans to provide dynamic values
  • Reporting common errors
  • Tag containment
  • Custom tags: lightweight, cheap, replaceable
  • Benefits of this design approach
  • In conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    IBM developerWorks
     
    ADVERTISEMENT

    AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th -1:00PM EST. Register Today!

    Dynamic Data Analysis on the Web-a Design Approach - Presenting data


    (Page 6 of 13 )

    To present and explore the result data, the page author will require some further custom JSP tags. These custom tags will often be general purpose, and leave the page author in control of the layout and display attributes of the result values. In certain cases, specialised custom tags might provide a more sophisticated presentation of the entire result set.

    Listing 2 shows some general purpose custom tags which can be used to iterate through the result values and extract individual values for presentation. In this case, the result values from the data definition shown in Listing 1 are formatted as a series of HTML tables, one for each year of sales results.

    Listing 2. General purpose data presentation tags


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

    <dp:forSlices id="slices" dataRef="sales">
      <TABLE border>
        <TBODY>
          <TR>
            <TH>Year</TH><TH>Product</TH><TH>Unit Sales</TH><TH>Revenue</TH>
          </TR>
          <dp:forRows id="rows" sliceRef="slices">
            <TR>
              <TD>
                <dp:write>
                  <dp:valueFromColumn rowRef="rows">
                    <dd:dimension>Year</dd:dimension>
                  </dp:valueFromColumn>
                </dp:write>
              </TD>
              <TD>
                <dp:write>
                  <dp:valueFromColumn rowRef="rows">
                    <dd:dimension>Product</dd:dimension>
                  </dp:valueFromColumn>
                </dp:write>
              </TD>
              <TD align="right">
                <dp:write>
                  <dp:valueFromColumn rowRef="rows">
                    <dd:measure>Unit Sales</dd:measure>
                  </dp:valueFromColumn>
                </dp:write>
              </TD>
              <TD align="right">
                <dp:write>
                  <dp:numberFormat style="currency" locale="server">
                    <dp:valueFromColumn rowRef="rows">
                      <dd:measure>Revenue</dd:measure>
                    </dp:valueFromColumn>
                  </dp:numberFormat>
                </dp:write>
              </TD>
            </TR>
          </dp:forRows>
        </TBODY>
      </TABLE>
    </dp:forSlices>

    Slice and row iteration tags

    In Listing 2, the taglib directive establishes the scope of the data presentation tags within the JSP with a prefix of dp.

    The forSlices tag references a data tag by using the dataRef attribute to specify the id of the data tag. In this case, it references the data tag defined in Listing 1. The forSlices tag will evaluate its body for every slice in the result data. It, in turn, has an id attribute by which it might be referenced. In the example, an HTML table with borders switched on is defined for each slice. The page author, knowing the dimensions and measures to be presented, has included a row of suitable headers in each table. This is followed by a table row for each row of data within the slice.

    The forRows tag references a forSlices tag using the sliceRef attribute. The forRows tag will evaluate its body for each row in the result data slice from the referenced forSlices tag. It, in turn, has an id attribute by which it might be referenced.

    More Web Services Articles
    More By developerWorks


     

       

    WEB SERVICES ARTICLES

    - 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...

    BlackBerry VTS




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway