extends audit service to support adapters in EL expressions
-----------------------------------------------------------

                 Key: NXP-4657
                 URL: http://jira.nuxeo.org/browse/NXP-4657
             Project: Nuxeo Enterprise Platform
          Issue Type: Improvement
            Reporter: Eugen Ionica


*issue : with current audit service can NOT log values resulted from customized 
method calls

Audit Service use EL expression to add extra information to be logged.
For now there are 3 objects available in the context to be used in EL
expressions:

message - Document message describing the event
source - Document from which the event is from
principal - Identity of the event owner

<extension point="extendedInfo" 
target="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService">
    <extendedInfo expression="${source.myschema.myproperty}" key="extraInfo" />
</extension>


But sometimes we need to implement some logic to produce the value that we want 
to record
in our case
[...]
if (doc.isProxy()) {
  CoreSession session = CoreInstance.getInstance().getSession(sessionId);
  DocumentModel tmp = session.getSourceDocument(doc.getRef());
  originalDocUUID = session.getSourceDocument(tmp.getRef()).getId();
}
else {
  originalDocUUID = doc.getId();
}
[...]


* posbile solution
added a new extension point to 
org.nuxeo.ecm.platform.audit.service.NXAuditEventsService called "docAdapter"

using this point will register an adapter for DocuementModel
<extension point="doc" 
target="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService">
    <adapter class="org.nuxeo.myadapter" name="myadapter" />
</extension>

class - is the qualified name of the class that will wrap the document model 
specified by "source"
name - is the name that will be used in EL

then win "extendedInfo" will add
<extension point="extendedInfo" 
target="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService">
    <extendedInfo expression="${myadapter.originalDocUUID}" 
key="original_doc_uuid" />
</extension> 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.nuxeo.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to