Summary


In SQL-NS applications, the distributor handles the formatting and delivery of notifications generated by the matching logic. The distributor employs components called content formatters to do the actual formatting work.

Content formatters receive the raw notification data as input. This data consists of the notification fields and computed fields defined in the notification class. Along with the notification data, the distributor also passes the content formatter information about the locale and device type for which the notification should be formatted. The content formatter can use this information to provide locale- and device-specific formatting. The output of the content formatter is a single string that represents the notification body. The distributor passes this string to the delivery protocol for delivery to the subscriber.

In your applications, you can choose to use the built-in XsltFormatter, or you can build a custom content formatter. If you use the XsltFormatter, you specify application-specific formatting instructions through XSL transforms. You can specify a different transform for each locale and device type that your application supports. If you build a custom content formatter, you can implement the formatting operations in procedural code. It is often easier to implement complex formatting operations by writing procedural code than by writing XSL transforms. In a custom content formatter, you can also access external datasomething that is difficult to do from an XSL transform.

To build a custom content formatter, you develop a class that implements the IContentFormatter interface. You compile this class into an assembly and declare it in your ADF. At runtime, the distributor loads this class and passes it the notification data to format. In this chapter we built a custom content formatter for the music store application's notification class. By doing this, we were able to produce more meaningful, streamlined notifications than we could with the built-in XsltFormatter.




Microsoft SQL Server 2005 Notification Services
Microsoft SQL Server 2005 Notification Services
ISBN: 0672327791
EAN: 2147483647
Year: 2006
Pages: 166
Authors: Shyam Pather

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net