I would like to clone some audit query code in the
org.nuxeo.ecm.platform.audit package in the audit core test jar. I see:
... DocumentModel searchDoc = session.createDocumentModel("File"); ... searchDoc = session.createDocument(searchDoc); pp.setSearchDocument(searchDoc); ...
Looking at the page provider code it does not appear to be necessary to save the search document to the repository before setting it in the page provider, and my cloned code (so far) seems to work correctly when I don't save the document. So - two questions: 1) am I ok to dispense with saving the search document to the repository? And 2) if not - is there a recommended approach to remove these after use? Thank you