Danh mục

Microsoft SQL Server 2005 Developer’s Guide- P8

Số trang: 20      Loại file: pdf      Dung lượng: 360.70 KB      Lượt xem: 9      Lượt tải: 0    
Thư viện của tui

Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Microsoft SQL Server 2005 Developer’s Guide- P8:This book is the successor to the SQL Server 2000 Developer’s Guide, whichwas extremely successful thanks to all of the supportive SQL Server developerswho bought that edition of the book. Our first thanks go to all of the peoplewho encouraged us to write another book about Microsoft’s incredible new relationaldatabase server: SQL Server 2005.
Nội dung trích xuất từ tài liệu:
Microsoft SQL Server 2005 Developer’s Guide- P8 Chapter 5: Developing with Notification Services 1392005’s efficient relational database engine to join the rows from the events table withthe rows in the subscriptions table in order to match events to subscriptions.Developing Notification Services ApplicationsIn the first part of this chapter you got an overview of the new SQL Server 2005Notification Services. In this next section, you learn about the actual steps requiredto develop SQL Server 2005 Notification Services applications. First, you’ll seea quick overview of the development process, and next we’ll dive in and build asample Notification Services application. The process for developing Notification Services applications begins withdefining the rules that govern how the application works. Next, you must compilethe application. Then you need to construct an interface that allows the user to addsubscriptions to the application. Finally, you’ll need to add any custom componentsthat may be needed by the application. Let’s look at each of these steps in more detail.Defining the ApplicationThe Notification Services developer uses a combination of XML and T-SQL todefine the application’s schema and rules. When you define the schema and therules for a Notification Services application, you are essentially describing theevents that the application will monitor as well as the application’s subscriptions, itsnotifications, and the logic that will be used to match the events to the subscriptions.The Notification Services application’s rules are primarily defined in two files—anapplication definition file and an instance configuration file. Although you can alsodefine them using the Notification Management Objects (NMO) API interface, theapplication definition file and the instance configuration file are typically createdusing a standard text editor or an XML-aware editor such as Visual Studio 2005 orXMLSpy. More detailed information about the specific contents of the applicationdefinition file and the instance configuration file is presented later in this chapter.Compiling the ApplicationAfter the schema and the rules have been created, the next step in buildinga Notification Services application is to compile all of the code and register a servicethat will run the Notification Services applications. To compile the application, youcan use the Notification Services node in the SQL Server Management Studio or thenscontrol command-line utility. These tools create the Notification Services instanceand database, if required.140 M i c r o s o f t S Q L S e r v e r 2 0 0 5 D e v e l o p e r ’s G u i d e Building the Notification Subscription Management Application The first two steps build the core engine of the Notification Services application. However, users still need a way of adding their own subscription information to the application. To enable users to enter their subscription information, the Notification Services application needs a subscription management interface, which is typically a Web or Windows application built using ASP.NET, VB.NET, or C# technologies. This application updates entries to the Notification Services subscription database. Adding Custom Components Finally, the last step in building your Notification Services application is to optionally add any custom components that might be needed by the application. Custom components would include any required custom event providers, content formats, or notification delivery protocols that are not included in the base SQL Server 2005 Notification Services product. Notification Services Application Sample The sample Notification Services application that is presented in the next part of this section represents a simple shipping notification application. In this example, events consist of shipment information, which identifies a store ID that will receive the shipment as well as the date, the product ID, the product name, and the number of units that are being shipped. Subscribers will select a store ID where they want to be notified about the incoming shipments. To make all of this work, an event will be created that is fired if the value of the store ID for a shipment matches a store ID that has been registered by a subscriber. The user must enter a subscription for that event, and a rule must be added to allow the Notification Services engine to match the events to the subscriptions. When an event matches the event rule, the distribution provider will create a file-based notification. Now that you’ve got an overview of the sample Notification Services application, let’s see how it’s built. Creating the ICF File Notification Services applications consist of two primary files: an application definition file (ADF) and an instance configuration file (ICF)—both XML files that must be built in accordance with their XSD schemas. The XSD schemas serve to make sure that both documents possess the required elements and attributes. The ICF and Chapter 5: Developing with Notification Services 141ADF files are essentially the source code for a Notification Services application.The ADF file is the core file for the Notification Services; the different sectionsof the ADF describe the event, subscription, rules, and notification structure thatwill be employed by the Notification Services application. The ICF file defines thename of the Notification Services application as well as its instance name and theapplication’s directory path. The instance name is essentially the name of a Windowsservice that runs the Notification Services application. Fortunately you’re not ...

Tài liệu được xem nhiều: