Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Ying Qi
Audit Trail: Update user infor, it alway stored as the birthday field
10 agosto 2012 13.50
Risposta

Ying Qi

Punteggio: New Member

Messaggi: 11

Data di Iscrizione: 31 gennaio 2011

Messaggi recenti

Hi All,

When I updated the user's address, phone, etc... the Audit hook stored the birthday value was updated (We installed audit-hook-6.0.11.1 and audit-portlet-6.0.11.1 in our customized SP1)

Additional Information {"attributes":[{"newValue":"Thu Jan 01 00:00:00 EST 1970","name":"birthday","oldValue":"1970-01-01 00:00:00.0"}]}

Here are the steps to reproduce:
- Login as system admin --> go the control panel --> users
- Edit any user with either phone, address, etc..
- Then go to the Audit Report to view the update that you just did, it will show the birthday was updated as above sample.

Does anyone seen this behave? Thank you!
David H Nebinger
RE: Audit Trail: Update user infor, it alway stored as the birthday field
10 agosto 2012 14.56
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11046

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

Is there a question here I didn't get?

The audit hook, which has the model listener for the user update, uses a generic process to build the parameterized JSON that you're looking at. It is very simple in that it just calls the toString() method on the objects.

What you're seeing here is the different output of toString() on two different objects, both of which happen to extend java.util.Date, but have different implementations.

Since you get the code w/ the hook, you can go in there and change how it's building the JSON to use a date formatter, for example, if you want to maintain some consistency.
Ying Qi
RE: Audit Trail: Update user infor, it alway stored as the birthday field
13 agosto 2012 6.11
Risposta

Ying Qi

Punteggio: New Member

Messaggi: 11

Data di Iscrizione: 31 gennaio 2011

Messaggi recenti

Thank you for the information, I will try to update the date format to see if it works.

My question was, when I updated the address information, the audit log didn't capture the old address and new address, why it capture the old birthday and new birthday.
David H Nebinger
RE: Audit Trail: Update user infor, it alway stored as the birthday field
13 agosto 2012 10.11
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11046

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

The audit hook is meant to be a template for what you would do to audit any Liferay data.

It shows you how to add model listeners for capturing and forwarding audit record information.

The basic hook has a model listener for address update, but doesn't apparently have one for the create or remove.