Monday, May 5, 2008

Working With the Data View Web Part


Working With the Data View Web Part


What is the Data View?
Data View Web Part is the primary component used for data presentation when building data-driven Web sites using FrontPage 2003 and Windows SharePoint Services. When you create a data-driven Web site, you select data sources from a Data Source Catalog and use Data View Web Parts to present data. Data View Web Parts render data by using Extensible Stylesheet Language Transformation (XSLT).


Data-driven Web Sites


FrontPage 2003 has many features for building live, data-driven webs. Central to any data-driven Web page is the ability to collect and present live customer data on the fly on a page – that is, you are effectively building a page based on data (hence the term data-driven). These features fall into two categories:
· Sites based on ASP or ASP.NET: using the Database Results Wizard and the Database Interface Wizard. You can create Web pages that display interactive views of desktop-based or server-based data by using ASP code or ASP.NET controls.
· Sites based on Windows SharePoint Services: using the Data Source Catalog and Data View Task panes. You can access a wide range of data sources, including desktop-based and server-based databases, XML files, Web services, and SharePoint Services-based lists.
In this document, we focus on the second set of features.


Data Binding


When working with a Windows SharePoint Services-based site, FrontPage 2003 allows live views of customer data from a variety of different sources:
· SharePoint Services-based Lists and Libraries
· OLEDB data sources, including Microsoft SQL Server
· XML Web Services
· XML FilesThe key technology enabling this versatile data access is the data retrieval service, which is a new data binding mechanism in Windows SharePoint Services. A data retrieval service enables data consumers and data sources to communicate with each other through Simple Object Access Protocol (SOAP) and XML. In essence, it is an XML Web service that returns XML data from different data sources or manipulates data against those data sources. A data retrieval service is installed and runs on a server running Microsoft Windows SharePoint Services. Windows SharePoint Services includes a default set of data retrieval services for working with data in SharePoint Services-based lists, OLEDB, and XML data sources.


Data Views: XSLT-based Presentation of XML


The Data View Web Part is a special Web Part which acts as a client to the data retrieval service as it can retrieve and manipulate data from any data source supported by data retrieval services. As we mentioned before, the data retrieval service is a Web service, thus, it returns data in the form of XML. The Data View uses Extensible Stylesheet Language Transformations (XSLT) on this XML to format the data.


A key feature of the Data View is that it provides WYSIWYG authoring of XSLT to produce formatted views of data. The visual editor produces XSLT; the XSL transformation code is inserted directly into the HTML of your page. Once inserted on your page, you can use any WYSIWYG formatting tools from within the Data View in FrontPage 2003, such as adding table columns with certain font formatting, and FrontPage 2003 will generate the new XSLT on the fly. You can also change or add to the XSLT in the CODE view of the FP 2003 editor
Because of the data retrieval services architecture, live data is available at authoring time; furthermore, data is available as XML regardless of how it is stored at the data source. Recall that the data retrieval service is an XML Web service.
Data Views can be connected to build rich pages that combine data from multiple sources, and/or provide rich views on top of hierarchical data (such as master-detail).

References
FrontPage 2003: Overview of Web Parts Framework
FrontPage 2003:
Customizing Web Parts
FrontPage 2003:
Working with Web Part Libraries
FrontPage 2003:
Connecting Web Parts
FrontPage 2003: Working with Web Part Pages
FrontPage 2003:
An Architectural Introduction to Web Parts and ASP.NET
Other Microsoft Resources
Microsoft FrontPage 2003 Customization Kit Web: http://www.sharepointcustomization.com
Microsoft FrontPage Web site:
http://www.microsoft.com/frontpage/default.htm
Microsoft FrontPage Add-in Center:
http://www.microsoft.com/frontpage/downloads/addin/default.asp
Microsoft SharePoint Products and Technologies:http://www.microsoft.com/sharepoint/default.asp
SharePoint Products and Technologies Web Component Directory:
http://www.microsoft.com/sharepoint/downloads/components/default.asp

No comments: