<commit_before><?php

class Brera_MagentoConnector_Adminhtml_BreraController extends Mage_Adminhtml_Controller_Action
{
    public function exportAllProductsAction()
    {
        /** @var Brera_MagentoConnector_Model_Export_Exporter $exporter */
        $exporter = Mage::getModel('brera_magentoconnector/export_exporter');
        $exporter->exportAllProducts();
        Mage::getSingleton('core/session')->addSuccess('All products exported');
        $this->_redirect('/');
    }

    public function exportQueuedProductUpdatesAction()
    {
        try {
            /** @var Brera_MagentoConnector_Model_Export_Exporter $exporter */
            $exporter = Mage::getModel('brera_magentoconnector/export_exporter');
            $exporter->exportProductsInQueue();
            Mage::getSingleton('core/session')->addSuccess('All products in queue exported');
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')->addNotice($e->getMessage());
        }
        $this->_redirect('/');
    }

    public function exportAllStocksAction()
    {
        try {
            Mage::helper('brera_magentoconnector/export')->addAllProductIdsToStockExport();
            Mage::getModel('brera_magentoconnector/export_stock')->export();
            Mage::getSingleton('core/session')->addSuccess('All stocks exported');
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')->addNotice($e->getMessage());
        }
        $this->_redirect('/');
    }

    public function exportAllCmsBlocksAction()
    {
        try {
            $exporter = Mage::getModel('brera_magentoconnector/export_cms_block');
            $exporter->export();
            Mage::getSingleton('core/session')->addSuccess('All cms blocks exported');
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')->addNotice($e->getMessage());
        }
        $this->_redirect('/');

    }
}<commit_msg>Issue #84: Add exported products to messages<commit_after><?php

class Brera_MagentoConnector_Adminhtml_BreraController extends Mage_Adminhtml_Controller_Action
{
    public function exportAllProductsAction()
    {
        try {
            /** @var Brera_MagentoConnector_Model_Export_Exporter $exporter */
            $exporter = Mage::getModel('brera_magentoconnector/export_exporter');
            $productsExported = $exporter->exportAllProducts();
            Mage::getSingleton('core/session')->addSuccess(sprintf('All (%s) products exported.', $productsExported));
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
        }
        $this->_redirect('/');
    }

    public function exportQueuedProductUpdatesAction()
    {
        try {
            /** @var Brera_MagentoConnector_Model_Export_Exporter $exporter */
            $exporter = Mage::getModel('brera_magentoconnector/export_exporter');
            $productsExported = $exporter->exportProductsInQueue();
            Mage::getSingleton('core/session')->addSuccess(
                sprintf('%s products from queue exported.', $productsExported)
            );
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
        }
        $this->_redirect('/');
    }

    public function exportAllStocksAction()
    {
        try {
            Mage::helper('brera_magentoconnector/export')->addAllProductIdsToStockExport();
            Mage::getModel('brera_magentoconnector/export_stock')->export();
            Mage::getSingleton('core/session')->addSuccess('All stocks exported');
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
        }
        $this->_redirect('/');
    }

    public function exportAllCmsBlocksAction()
    {
        try {
            $exporter = Mage::getModel('brera_magentoconnector/export_cms_block');
            $exporter->export();
            Mage::getSingleton('core/session')->addSuccess('All cms blocks exported');
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
        }
        $this->_redirect('/');

    }
}
{'fraction_non_alphanumeric': 0.13879087273582685, 'fraction_numerical': 0.0004704775346977182, 'mean_word_length': 2.9738317757009347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '2503062', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1193, 'n_words': 153}