Audit session and bootstrap support

- Sessions are created using an application name (shared prop) and a persisted model ID
 - Added a bootstrap bean for audit that unmarshalls the models
 - Added hook points for repo-loading models, but won't implement yet


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15863 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-08-21 17:50:36 +00:00
parent 99395b7ed2
commit 00dfb8ee66
19 changed files with 877 additions and 280 deletions

View File

@@ -10,17 +10,23 @@
<!-- Type Defs -->
<!-- -->
<typeAlias alias="AuditConfig" type="org.alfresco.repo.domain.audit.AuditConfigEntity"/>
<typeAlias alias="AuditModel" type="org.alfresco.repo.domain.audit.AuditModelEntity"/>
<typeAlias alias="AuditSession" type="org.alfresco.repo.domain.audit.AuditSessionEntity"/>
<!-- -->
<!-- Result Maps -->
<!-- -->
<resultMap id="result.AuditConfig" class="AuditConfig">
<resultMap id="result.AuditModel" class="AuditModel">
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="contentDataId" column="content_data_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="contentCrc" column="content_crc" jdbcType="BIGINT" javaType="long"/>
</resultMap>
<resultMap id="result.AuditSession" class="AuditSession">
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="auditModelId" column="audit_model_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="applicationNameId" column="app_name_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
</resultMap>
<!-- -->
<!-- Parameter Maps -->
@@ -34,21 +40,26 @@
<!-- SQL Snippets -->
<!-- -->
<sql id="insert.AuditConfig.AutoIncrement">
insert into alf_audit_cfg (content_data_id, content_crc)
<sql id="insert.AuditModel.AutoIncrement">
insert into alf_audit_model (content_data_id, content_crc)
values (#contentDataId#, #contentCrc#)
</sql>
<sql id="insert.AuditSession.AutoIncrement">
insert into alf_audit_session (audit_model_id, app_name_id)
values (#auditModelId#, #applicationNameId#)
</sql>
<!-- -->
<!-- Statements -->
<!-- -->
<!-- Get the mimetype entity by mimetype -->
<select id="select.AuditConfigByCrc" parameterClass="AuditConfig" resultMap="result.AuditConfig">
<!-- Get the audit model by the CRC value -->
<select id="select.AuditModelByCrc" parameterClass="AuditModel" resultMap="result.AuditModel">
select
*
from
alf_audit_cfg
alf_audit_model
where
content_crc = #contentCrc#
</select>