// // Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // $Id: BasicAuditTrail.pdl 287 2005-02-22 00:29:02Z sskracic $ // $DateTime: 2004/08/16 18:10:38 $ model com.arsdigita.auditing; //Note, this doesn't need to extend ACSObject since //we its doesn't require any services such as //permissioning, etc import com.arsdigita.kernel.*; object type BasicAuditTrail { BigDecimal[1..1] id = acs_auditing.object_id INTEGER; Date[1..1] creationDate = acs_auditing.creation_date TIMESTAMP; String[0..1] creationIP = acs_auditing.creation_ip VARCHAR(50); Date[1..1] lastModifiedDate = acs_auditing.last_modified TIMESTAMP; String[0..1] lastModifiedIP = acs_auditing.modifying_ip VARCHAR(50); object key (id); } association { BasicAuditTrail[0..n] createdObjects = join users.user_id to acs_auditing.creation_user; User[0..1] creationUser = join acs_auditing.creation_user to users.user_id; add creationUser {} remove creationUser {} } association { BasicAuditTrail[0..n] modifiedObjects = join users.user_id to acs_auditing.modifying_user; User[0..1] lastModifiedUser = join acs_auditing.modifying_user to users.user_id; add lastModifiedUser {} remove lastModifiedUser {} } //Used to retrieve the BasicAuditTrail for an ACSObject query auditTrailForACSObject { BigDecimal id; do { select object_id from acs_auditing } map { id = acs_auditing.object_id; } }