Overview

liberiun.portal.contentstats

This package provides handlers (zope event handlers) that logs content management operations (creation, edition, deletion, publication and access) into SQL. It also comes with a viewlet that will render a javascript call at the bottom of the layout to log access. Information tha gets logged into SQL:

action (content management action) log_date (the moment the action took place) user_name (user name of the person who caused the action) content_type (meta_type of the content type) title (the title of the content type) url (the url of the content) path (the path of the content) parent_content_type (meta_type of the parent folder) parent_title (the title of the parent folder) parent_url (the url of the parent folder)

it also logs some http request info such as referer and query string.

Currently the database used is PostgreSQL and its SQL operations are done using Storm ORM. In order to get the package working, one must first run the sql script in db folder and then setup the storm connection in configure.zcml of the the top level package.

CAVEATS: In order to have storm.zope working properly, one must first edit the top level configure.zcml of storm.zope and adjust it so it looks like this:

<configure

xmlns="http://namespaces.zope.org/zope" xmlns:i18n="http://namespaces.zope.org/i18n"; i18n_domain="zope" >

<utility
component=".zstorm.global_zstorm" provides=".interfaces.IZStorm" />
<class class="storm.store.ResultSet">
<allow interface=".interfaces.IResultSet" /> <allow attributes="__getslice__" />

</class>

<class class="storm.store.EmptyResultSet">
<allow interface=".interfaces.IResultSet" /> <allow attributes="__getslice__" />

</class>

<class class="storm.sqlobject.SQLObjectResultSet">
<allow interface=".interfaces.ISQLObjectResultSet" />

</class>

<class class="storm.references.BoundReferenceSet">
<allow attributes="__iter__ find first last one any values order_by
count __contains__" />

</class>

<class class="storm.references.BoundIndirectReferenceSet">
<allow attributes="__iter__ find first last one any values order_by
count __contains__" />

</class>

<adapter factory=".adapters.sqlobject_result_set_to_storm_result_set"
trusted="yes" />

</configure>

Currently, Zope2.12 doesn't support the like_class directive present in storm.zope and it won't load if its configure.zcml is not properly set. Applying the changes above should make it work. Make sure storm.zope and storm.zope-meta are present in your buildout.cfg