public function importAction() {
        $memLim = ini_get('memory_limit');
        ini_set('memory_limit', '2G');
        set_time_limit(0); // No time limit

        $params = new Garp_Util_Configuration($this->getRequest()->getParams());
        $params->obligate('datafile')
            ->obligate('model')
            ->setDefault('firstRow', 0)
            ->setDefault('ignoreErrors', false);
        $importer = Garp_Content_Import_Factory::getImporter($params['datafile']);
        $success = false;
        if (isset($params['mapping'])) {
            $mapping = Zend_Json::decode($params['mapping']);

            $className = Garp_Content_Api::modelAliasToClass($params['model']);
            $model = new $className();
            $model->setCmsContext(true);
            $response = array();
            try {
                $success    = !!$importer->save(
                    $model, $mapping, array(
                    'firstRow' => $params['firstRow'],
                    'ignoreErrors' => $params['ignoreErrors'],
                    )
                );
            } catch (Exception $e) {
                $response['message'] = $e->getMessage();
            }

            if ($success) {
                // cleanup input file
                $gf = new Garp_File();
                $gf->remove($params['datafile']);
            }

            $response['success'] = $success;
            $this->view->response = $response;
        } else {
            $std = new stdClass();
            $std->success = true;
            $std->data = $importer->getSampleData();
            $this->view->response = $std;
        }
        ini_set('memory_limit', $memLim);
        $this->_helper->layout->setLayout('json');
        $this->renderScript('content/call.phtml');
    }