cancel
Showing results for 
Search instead for 
Did you mean: 

Documentation about onContentRead

lvs
Champ in-the-making
Champ in-the-making
Hi everybody,
I am trying to developp an Access Log manager using the onContentRead from the OnContentReadPolicy. Does anyone know when exactly this method is called? Or better when exactly it is not called?
I saw that for the same user, it is called after a change in the content (I think  that is why the contentHits example works, but I do not want to modify my contant after each read) and after a restarting the server.
Does anyone know if there is a session time too? Or if it is possible to enforce  the getReader method to be called for each read of a content?
Tanks
Laura
5 REPLIES 5

andy
Champ on-the-rise
Champ on-the-rise
Hi

I suggest you use auditing.

This particular policy will fire during indexing. If you set a property on a node during indexing you will get an exception. So on this policy you should only read other information - and write to external places. Otherwise you will end up in a policy knot. 

You probably can not do what you want anyway… What does getting a reader for content mean - nothing about if it has been read, cached on the client, printed, who else has been given the content, if it has been copied …..

So what are you actually trying to do?


Andy

lvs
Champ in-the-making
Champ in-the-making
Hi Andy,

Thank you very much for your reply. I understand the problems you are talking about and I am having a look to auditing.

I would like to write in a file, all the information I can get about who reads a content. If the content is cached on the client it is not a problem because it is not important for me to know if a user read a content twice or three times as long as it is the same content.

My more important problem about auditing is that I would like to have a log on a file in my server and not into Alfrecso Repository. I sthis possible to do with Alfrecsp Configuration? Or maybe I have to developp a batch that creates a log everyday?

Thanks again for your help,
Best regards
Laura

lvs
Champ in-the-making
Champ in-the-making
Hi again,

So I have been trying the audit and it seems to be fine. I still have to do an external log file or something to record each access. Did anybody of you do something like that? How did you manage it?
Does a batch programm running every day and recovering all the audit information to write it to a file seem to be a good idea?
Thank you for any suggestion!
Laura

andy
Champ on-the-rise
Champ on-the-rise
Hi

On content read will record too much. For example, it will record indexing.
As you are writing to a file you could use the policy (which I would like to see removed by the way….) and record at most one call per transaction.

You could modify the auditing code.
Auditing will not log calls to that are used internally (if one service calls another only the call to the outer service is logged by default)

Alternativley you could wrap the FileFolderService and ContentService with additional method interceptors to add your own auditing to file in this case.

You could indeed generate reports from the audit tables and write them to your own log files - with the restrictions above.

Andy

xhawk
Champ in-the-making
Champ in-the-making
Hi

I suggest you use auditing.

This particular policy will fire during indexing. If you set a property on a node during indexing you will get an exception. So on this policy you should only read other information - and write to external places. Otherwise you will end up in a policy knot. 

You probably can not do what you want anyway… What does getting a reader for content mean - nothing about if it has been read, cached on the client, printed, who else has been given the content, if it has been copied …..

So what are you actually trying to do?


Andy

There is that kind of knot in the 3.2.0 Enterprise SDK ContentHits example. I'm not sure where it has been used and has this problem been solved in later versions.