Web Services
  Home arrow Web Services arrow Page 6 - Dynamic Data Analysis on the Web-a Design Approach
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 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: starstarstarstarstar / 14
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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

     
     
    ADVERTISEMENT


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


    Email Marketing Software
    iContact Email Marketing Software Simplifies Online Communication.
    Online Survey Software
    Vovici online survey software, sample surveys & survey templates.
    Internet Marketing Company
    Provider of internet marketing services to boost your site rankings.
    SEO Services
    Top seo services provider; great organic rankings & qualified traffic
    SEO Firm
    SEO firm with excellent organic results for clients in all verticals



    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT