Updating the Exchange Information Store from SQL Server

When you submit a critique from the CML/LitCrit Web application, a record for your critique is created in the SQL Server Critique table and a LitCrit Outlook form, with the information you entered on the CML/LitCrit Submit Critique Web page, is posted to the LitCrit Exchange public folder.

Later, when you decide to edit your critique from the Web pages of the CML/LitCrit application, the information in the associated posting to the LitCrit public folder also needs to be updated. The CML/LitCrit submit process posts the critique to the LitCrit public folder, and the scripts executed by events on that folder synchronize critique information in Exchange and SQL Server.

The CML administrator can add, change, and delete information in the title and author tables. Critiques posted to the LitCrit public folder that are available to the CML (critiques that have been approved), contain the title of the library item and the author's name from the FmLib database. The CML needs to update LitCrit postings whenever information in the title or author tables with a foreign key relationship in the Critique table is modified.

The following tasks — all executed through the Web pages of the CML/LitCrit application — cause information stored in the FmLib SQL Server database to be changed, which necessitates a corresponding change in the LitCrit public folder of Microsoft Exchange Server.

Add a critique from the CML

Clicking Submit on the Submit Critique Web page runs VBScript on the ASP page that creates a new posting in the LitCrit public folder. When the critique is posted to the LitCrit public folder, critique information is automatically added to the Exchange public information store. The Folder_onMessageCreated event fires on the LitCrit public folder, running script that adds records to the FmLib Critique table to keep critique information in Exchange and SQL Server synchronized.

Edit a critique from the CML

Click Submit on the Submit Critique Web page to run VBScript on the ASP page that updates the posting in the LitCrit public folder. When the critique is reposted to the LitCrit public folder, critique information is automatically updated in the Exchange public information store. The Message_onChanged event fires on the LitCrit public folder, running script that updates the critique record in the FmLib Critique table to keep critique information in Exchange and SQL Server synchronized.

Add a title from the CML

No update action is needed in Exchange when you add records to the FmLib title table.

Change a title from the CML

When a critique record has a foreign key relationship with the title record you change, the item title property of the associated LitCrit posting needs to be updated. The developers plan to add code to the UpdateTitle method of the Admin class, which was written for the original CML application, to update the item title property of LitCrit postings.

Delete a title from the CML

Any critique records that have a foreign key relationship with the title record you delete should also be deleted. The developers plan to add a method to the Admin class that will handle deletes to the FmLib title table and updates to associated critiques in Exchange. The critiques in the LitCrit public folder are not deleted but the bib#, a hidden property on the LitCrit form, is set to blank because the title no longer exists in the FmLib database.

Add, change, or delete an author from the CML

When a critique and an author record share a foreign key relationship with a title, the authors property of the associated LitCrit posting needs to be updated. The developers plan to code a new method in the Admin class that updates the authors property of LitCrit postings.

Add or change a reviewer from the CML

The FmLib borrower table, where reviewer information resides, is populated with information from the Exchange directory. The CML does not directly update the borrower table, but every time an employee submits a critique the data in the borrower table is compared to information in the Exchange directory. Any changes in the Exchange directory are copied to the borrower table in the FmLib database. When the reviewer does not have a borrower record, one is created. The developers plan to reuse the UpdateUserFromExchange method of the User class written for the previous version of the CML.