0 Replies Latest reply on Feb 13, 2009 6:24 AM by rambo

    Policy Manager in CF using CFContent?

      I am using the following to display word docs, but what would be the best approach to check that the document has been opened and read by the user.

      <cfset user = listLast(cgi.REMOTE_USER,"\") >

      <cfheader name="content-disposition"

      <cfcontent type="application/msword"
      file="#ExpandPath(".")#\testdoc.doc" deletefile="no">

      Once read the user has to click a checkbox or link? that they have read the document. (Similar to an e-learning course website)

      In the document listing page, next to this document it will display 'Read' with this information stored in the database for that user. If the user has opened the doc and not clicked the checkbox it will display 'Doc Opened' next to that document on the webpage, and if they have not opened it, it will display 'Not Read'. Any ideas on the right approach for this?

      Or am I making this more complicated than it should be?

      I have set up a DB table with the following fields ID, Name, LoginID, Document, Status, Date

      For example when opening the doc via cfcontent how would I create a query to set the document name in the database, so it knows that users have either 'opened', 'read' or 'not read' the document and what would be the best way of setting the status of the document i.e. Opened, Read or Not Read? in the database to display next to the document listing

      <cfquery name="LOOKUP" datasource="DS">
      SELECT Max(docid) NewdocID
      FROM docstatus

      <cfif lookup.newdocid is "">
      <cfset docid = 1>
      <cfset docid = lookup.newdocid + 1>

      <cfquery datasource="DS" name="insert ">
      INSERT INTO docstatus (docid, name, loginid, documents, status, date)
      VALUES (
      <cfqueryparam cfsqltype="cf_sql_number" value="#docid#">,
      <cfqueryparam cfsqltype="cf_sql_date" value="#user#">,
      <cfqueryparam cfsqltype="cf_sql_varchar" value="#loginid#">,