[daisy] Document Hit Counter
Scott Warren
scottwarren at ocom.com.au
Thu Aug 10 01:40:10 CDT 2006
I have a similar requirement which records who, what and when a document was
read. I wrote an extension and used a skin to silently call my extension.
Ie create an extension. In your document-to-html.xsl
Add lines like
<form method="post" >
<xsl:attribute name="action"><xsl:value-of
select="$basePath"/>/ext/forms/audit</xsl:attribute>
<input type="hidden" name="langid"><xsl:attribute
name="value"><xsl:value-of select="/page/context/site/@languageId"
/></xsl:attribute></input>
<input type="hidden" name="branchid"><xsl:attribute
name="value"><xsl:value-of select="/page/context/site/@branchId"
/></xsl:attribute></input>
<input type="hidden" name="userid"><xsl:attribute
name="value"><xsl:value-of select="/page/context/user/id"
/></xsl:attribute></input>
<input type="hidden" name="versionid"><xsl:attribute
name="value"><xsl:value-of select="$document/@dataVersionId"
/></xsl:attribute></input>
<input type="hidden" name="docid"><xsl:attribute
name="value"><xsl:value-of select="$document/@id" /></xsl:attribute></input>
<input type="hidden" name="ref"><xsl:attribute
name="value"><xsl:value-of
select="/page/context/request/@uri"/></xsl:attribute></input>
<input type="submit" value="Read and Understood" />
</form>
In my case I used a form with a button but you could use an image for
example
<image
src="/daisy/site/ext/hitcounter?langid=1&branched=2&userid=12&versionid=3&do
cid=100" height="0" width="0" />
The extention will take the parameters and insert a record into the
database.
Hope this helps.
Regards
Scott Warren
Ocom Software
... Exceeding Quality.....
web | ocom.com.au
> -----Original Message-----
> From: daisy-bounces at lists.cocoondev.org [mailto:daisy-
> bounces at lists.cocoondev.org] On Behalf Of Eric Rich
> Sent: Wednesday, 9 August 2006 11:14 PM
> To: daisy at lists.cocoondev.org
> Subject: [daisy] Document Hit Counter
>
> Hi,
>
> Are there any plans to add the ability to track how many times a
> document has been accessed?
>
> I'd like to display a list of "most popular" documents. As such, sorting
> a query by hit count would be really ideal.
>
> I can hack the code to get this functionality, but I was wondering if
> this is a common request?
>
> Thanks!
>
> -Eric
>
> _______________________________________________
> daisy community mailing list
> Professional Daisy support:
> http://outerthought.org/site/services/daisy/daisysupport.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
More information about the daisy
mailing list