Previous Page Arrow Next Page Arrow

6.7 Feed Rendering

SData feeds can be displayed by a variety of consumers, such as RSS/Atom readers, web browsers, AJAX clients and mobile applications. This section describes the way consumers can display information they extract from SData feeds.

Atom

SData feeds are valid Atom feeds. They can be directly displayed by RSS/Atom readers and by web browsers that understand the Atom syndication format. For example, Internet Explorer (IE), Firefox, Safari and Chrome.

The user experience with standard Atom readers is usually limited because these readers only deal with Atom elements. They don’t understand other SData protocol, such as XML payload and schemas. But at least the user sees a well formatted list with the <title> and <content> of the feed entries.

Simple list extensions

SData producers MAY include Microsoft’s SLE (Simple List Extensions) markup in their feeds. This markup is recognized by Microsoft’s Internet Explorer, not by other browsers. It allows IE to display an enhanced user interface with links to sort and filter the feed contents. See Simple List Extensions section for details.

Paging

SData consumers can use the paging links (first, last, previous, next) to set up page by page navigation. They can also use the opensearch elements included in the feed (totalResults, startIndex, itemsPerPage) to set up a navigation bar with direct access by page number. See Paging section for details on paging links and opensearch elements.

Advanced consumers (AJAX components) can go further and implement a scrolling mechanism on top of the SData paging protocol. The opensearch elements (totalResults, startIndex, itemsPerPage) can be used to regulate a scrollbar. Then the UI component can use the startIndex and count query parameters to load the entries dynamically as the user scrolls through the data. Moreover, the SData caching mechanism can be used to avoid reloading pages when the user scrolls back and forth. Even though SData breaks the data into pages, a smart component can hide the paging mechanism and provide a user friendly scrolling experience.

The XML payload included in the Atom entries contains the resource data. An SData client can display this information by applying an XSLT stylesheet or ad hoc rendering logic.

SData consumers can also use the sdata:url and sdata:lookup URLs contained in the payload to set up drill down and lookup links. In our sales order feed example, the first entry contains the following sdata:url links:

<contact sdata:key="216" 
         sdata:url="http://www.example.com/sdata/myApp/myContract/-/contacts('216')" 
         sdata:lookup="http://www.example.com/sdata/myApp/myContract/-/contacts"/>
<orderLines sdata:url="http://www.example.com/sdata/myApp/myContract/-/salesOrderLines?where=salesOrderID%20eq%2043660"/>

The consumer can use the sdata:url URLs to set up drill-down links to the collection of order lines or the contact resource.

The sdata:lookup attribute can be used to populate a list box of contacts when the sales order entry is displayed in a form.

Metadata

Generic SData consumers can use schema information to decide how to display SData feeds.

The sme:label attributes provide localized, user friendly names for the resource kinds and their properties. They can be used as menu entries, table names, column names, etc. See Resource Kind Definitions section  and Property Definition section for details.

The sme:canPost, sme:canPut and sme:canDelete attributes on resource kind definitions are used to control whether the consumer should display links to create, modify and/or delete resources. See Resource Kind Definitions section for details.

The sme:canFilter, sme:canSort and sme:canGroup attributes on property definitions are used to decide if the consumer should enable filtering, sorting or grouping for a property. See Property Definition section for details.

The sme:precedence attribute on property definitions is used to prioritize which properties are displayed when the screen is too small to display all properties. See Property Definition section for details.

The sme:isMandatory attribute is used to ensure mandatory fields are not blank in resource creation forms. See Property Definition section for details.


Previous Page Arrow Next Page Arrow