<commit_before>package ca.firstvoices.listeners;

public class FVExportListener {
}<commit_msg>Basic Export listener to activate export workers.<commit_after>package ca.firstvoices.listeners;

import ca.firstvoices.workers.FVCyclicExportWorker;
import ca.firstvoices.workers.FVExportWorker;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuxeo.ecm.core.event.Event;
import org.nuxeo.ecm.core.work.api.WorkManager;
import org.nuxeo.runtime.api.Framework;

public class FVExportListener
{
    private static final Log log = LogFactory.getLog(FVExportListener.class);

    public static final String PRODUCE_FORMATTED_DOCUMENT = "produceFormattedDocument";
    public static final String AUTO_PRODUCE_FORMATTED_DOCUMENT = "autoProduceFormattedDocument";

    protected WorkManager workManager = Framework.getService(WorkManager.class);

    @Override
    public void handleEvent(Event event)
    {
        switch( event.getName() )
        {
            case PRODUCE_FORMATTED_DOCUMENT:
                FVExportWorker doExportFormattedDoc = new FVExportWorker(); // TODO: pass arguments attached to event
                workManager.schedule(doExportFormattedDoc, true);
                break;

            case AUTO_PRODUCE_FORMATTED_DOCUMENT:
                FVCyclicExportWorker doAutoExportFormattedDoc = new FVCyclicExportWorker(); // TODO: pass arguments attached to event
                workManager.schedule(doAutoExportFormattedDoc, true);
                break;
        }
    }
}
{'fraction_non_alphanumeric': 0.0736156351791531, 'fraction_numerical': 0.0, 'mean_word_length': 3.6126126126126126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2654194', 'n_tokens_mistral': 447, 'n_tokens_neox': 424, 'n_words': 89}