Adding CML/LitCrit Stored Procedures

The stored procedures used by the critique-enhanced CML and LitCrit Outlook applications are called from COM components that reside in the business-services tier of the CML application, from VBScript in the ASP pages of the library Web application, and from other stored procedures. The stored procedures written for the previous version of the library application remain in use.

Most procedures continue to work with no modifications but some did require changes, specifically:

Modifying the Fm_admin_checkin Procedure

With the addition of critique features to the CML application the fm_admin_checkin stored procedure needs to be changed.

The fm_admin_checkin stored procedure, developed for the previous version of the CML, is used to check in library items. The procedure updates information (status, location, and borrower) in the item table record. Now the check-in procedure needs to mail a message (with a LitCrit Outlook form as an attachment) that invites the borrower to submit a critique of the checked-in title.

There are two ways to accomplish this: The existing procedure can be changed to include statements that send the message or the procedure can be modified to call another procedure that handles the mailing of the message. The latter is the better solution, as it keeps the function of each stored procedure clear and separate. In summary, these are the necessary changes:

Note  An alternative is to add a second update trigger to the item table. The trigger sends an e-mail message to the borrower when the status of the item is updated from "out" to "in."

Creating Critique Stored Procedures

The critique enhancements to the CML Web application and the LitCrit Outlook application require a number of stored procedures to select or modify information in the tables of the FmLib SQL Server database. Server-Side Critique COM Component describes how the database updates are implemented. The critique applications use stored procedures to: