Search in sources :

Example 1 with DocumentTriggers

use of org.exist.collections.triggers.DocumentTriggers in project exist by eXist-db.

the class Modification method prepareTrigger.

/**
 * Fires the prepare function for the UPDATE_DOCUMENT_EVENT trigger for the Document doc
 *
 * @param transaction The database transaction
 * @param doc The document to trigger for
 *
 * @throws TriggerException if a trigger raises an error
 */
private void prepareTrigger(Txn transaction, DocumentImpl doc) throws TriggerException {
    final Collection col = doc.getCollection();
    final DocumentTrigger trigger = new DocumentTriggers(broker, transaction, col);
    trigger.beforeUpdateDocument(broker, transaction, doc);
    triggers.put(doc.getDocId(), trigger);
}
Also used : Collection(org.exist.collections.Collection) DocumentTrigger(org.exist.collections.triggers.DocumentTrigger) DocumentTriggers(org.exist.collections.triggers.DocumentTriggers)

Example 2 with DocumentTriggers

use of org.exist.collections.triggers.DocumentTriggers in project exist by eXist-db.

the class Modification method prepareTrigger.

/**
 * Fires the prepare function for the UPDATE_DOCUMENT_EVENT trigger for the Document doc
 *
 * @param transaction	The transaction
 * @param doc	The document to trigger for
 *
 * @throws TriggerException
 */
private void prepareTrigger(Txn transaction, DocumentImpl doc) throws TriggerException {
    final Collection col = doc.getCollection();
    final DBBroker broker = context.getBroker();
    final DocumentTrigger trigger = new DocumentTriggers(broker, transaction, col);
    // prepare the trigger
    trigger.beforeUpdateDocument(context.getBroker(), transaction, doc);
    triggers.put(doc.getDocId(), trigger);
}
Also used : DBBroker(org.exist.storage.DBBroker) Collection(org.exist.collections.Collection) DocumentTrigger(org.exist.collections.triggers.DocumentTrigger) DocumentTriggers(org.exist.collections.triggers.DocumentTriggers)

Aggregations

Collection (org.exist.collections.Collection)2 DocumentTrigger (org.exist.collections.triggers.DocumentTrigger)2 DocumentTriggers (org.exist.collections.triggers.DocumentTriggers)2 DBBroker (org.exist.storage.DBBroker)1