Display List of Critiques for a Title

Users need access to approved critiques submitted both from the critique-enhanced CML and from the LitCrit Outlook companion application. The Choose Critique Web page allows them to locate the critique they want to read, display the chosen critique, or add a critique of the selected title. The implementation of CML/LitCrit closely follows the application design laid out in the Critique-Enhanced CML Application topic, and Test-Driving CML/LitCrit Functionality lists the steps to access this new Web page.

The Choose Critique Web page (critiques.asp) appears when the user clicks View Critiques on the Search Details page and DDetails.asp runs the ViewCritiques subroutine. The bib# from the RDS_LongDisplay.Recordset is copied to the bibno variable and passed to critiques.asp. Displaying the Choose Critique Web Page shows how the bibno is passed as a parameter to the queries in FmLibMap.ini.

Sub ViewCritiques()
   bibno = RDS_LongDisplay.Recordset("bib#").Value
   window.location.href = "critiques.asp?bibno=" & bibno
End Sub

Displaying the Choose Critique Web Page

Information about the title, critiques, and authors of the title is retrieved from the FmLib SQL Server™ database using the RDS handler named "MDDFMAP.handler,FmLibMap.ini". The following code fragment shows how the Handler property is assigned.

RDS.Handler = "MSDFMAP.Handler,FmLibMap.ini"

SQL statements in the FmLibMap.ini file execute and retrieve information from the FmLib SQL Server database. Setting Up RDS to Use a Handler, Using RDS Handlers, About RDS Customization Handlers, and Implementing a Handler in CML/LitCrit describe the details of writing and implementing a handler. Three queries run:

The TitleDetailShort query accepts bibno as a parameter and returns the bib#, title, and coll columns from the title table. See the entire query in FmlibMap.ini.

Set RDS = RDS_ShortDisplay
RDS.ExecuteOptions = adcExecSync
RDS.FetchOptions = adcFetchUpFront
RDS.Handler = "MSDFMAP.Handler,FmLibMap.ini"
RDS.Server = "http://<%= Request.ServerVariables("SERVER_NAME") %>"
RDS.Connect = "Data Source=FmLib"
RDS.SQL = "TitleDetailShort(<%= nBibNo %>)"
RDS.Refresh

The AuthorDetails query accepts bibno as a parameter and returns the fname and lname columns from the author table. See the entire query in FmlibMap.ini.

Set RDS = RDS_AuthorDetail
RDS.ExecuteOptions = adcExecSync
RDS.FetchOptions = adcFetchUpFront
RDS.Handler = "MSDFMAP.Handler,FmLibMap.ini"
RDS.Server = "http://<%= Request.ServerVariables("SERVER_NAME") %>"
RDS.Connect = "Data Source=FmLib"
RDS.SQL = "AuthorDetail(<%= nBibNo %>)"
RDS.Refresh

The ReviewList query accepts bibno as a parameter and returns the objectId, rating, and dateOfCritique columns from the Critique table and the fname, lname, and title columns from the borrower table. See the entire query in FmlibMap.ini.

Set RDS = RDS_ReviewList
RDS.ExecuteOptions = adcExecSync
RDS.FetchOptions = adcFetchUpFront
RDS.Handler = "MSDFMAP.Handler,FmLibMap.ini"
RDS.Server = "http://<%= Request.ServerVariables("SERVER_NAME") %>"
RDS.Connect = "Data Source=FmLib"
RDS.SQL = "ReviewList(<%= nBibNo %>)"
RDS.Refresh

After the Choose Critique Web page appears, the user can double-click a critique entry to view an existing critique or click Add Critique to add a critique for the title.

Double-Clicking a Critique

When the user double-clicks a critique entry the DoCritique subroutine is called and the frmRoot.asp file is opened and passed the url and the objectID, which was retrieved in the ReviewList query described above. About the FrmRoot.asp File describes this file in details.

Sub DoCritique(objectID)
   url = "http://<%=Application("ExchangeServer")%>/Exchange/"
   url = url & "Forms/IPM/Post/EnhancedLitCrit/frmRoot.asp?"
   url = url & "command=open&obj=" & objectID
   window.open url,objectID,"menubar=no,toolbar=no,status=no,location=no,resizable=yes",False
End Sub

Clicking Add Critique

When the user clicks Add Critique the NewCritique subroutine runs. The values from Application variables and the RDS recordset retrieved from the FmLib database by the TitleDetailShort and AuthorDetails queries — described in Displaying the Choose Critique Web Page and FmLibMap.ini — are copied to variables.

The values of the variables are assigned to properties on the form. The statement "command=new&ID=<%=Application("PublicFolderObjectID")%>" tells frmRoot.asp that this is a new critique, and the Submit Critique Web page appears. The Application("PublicFolderObjectID") variable contains the PublicFolderObjectID from the Settings table; Updating Global.asa tells you how all the columns from the Settings table are loaded into variables used by the critique-enhanced CML application.

Sub NewCritique()
   bibno = RDS_ShortDisplay.Recordset("bib#").Value
   itemtitle = RDS_ShortDisplay.Recordset("title").Value
   authname = AuthorsToString(RDS_AuthorDetail.Recordset)
   mediatype = RDS_ShortDisplay.Recordset("coll").Value
   approvalreq = <%= Application("ApprovalRequired") %>
   approveremail = "<%= Application("ApproverEmail") %>"
   
   url = "http://<%=Application("ExchangeServer")%>/Exchange/"
   url = url & "Forms/IPM/Post/EnhancedLitCrit/frmRoot.asp?"
   url = url & "command=new&ID=<%=Application("PublicFolderObjectID")%>"
   url = url & "&BN=" & bibno & "&IT=" & itemtitle & "&AN=" & authname & "&MT=" & mediatype
   url = url & "&AR=" & approvalreq & "&AE=" & approveremail
   window.open url,"NewCritique","menubar=yes,toolbar=no,status=no,location=no",False
End Sub

Clicking Author's Name

When the reviewer clicks the author's name that appears as a link on the Choose Critique Web page, a list of titles by that author is displayed on the Search Details Web page. LoadPage.asp provides access to the author information already cached in the IFrame defined in Library.asp. Critiques.asp decodes the URL and sets the session ("lastPage") to author.asp%3FAuthorNo=" & authorno. The "%3F" is the encoded value of a question mark (?). Since only one "?" is allowed in a URL query string the second one is encoded.

document.location.href = "loadpage.asp?author.asp%3FAuthorNo=" & authorno

The UrlDecode function decodes the URL and puts the "?" back into the session ("lastPage").

Session("LastPage") = UrlDecode(Request.QueryString)

The session ("lastPage") is the source for the IFrame that gets loaded in Library.asp.

<iframe ID="ifControl" STYLE="display:none;top:0;left:250;height:40 px;width:540 px;POSITION:absolute" FRAMEBORDER=0 NORESIZE SCROLLING=none SRC="<%= Session("LastPage") %>"></iframe>

Next redirect the page to Library.asp.

Response.Redirect "library.asp"