public function downloadExportAction() { $this->_requireAccess('editor.jobs', 'index'); $job = $this->_getJob(); $export = new Editor_Models_Export(); $export->setSettings($job->getParams()); $fileDetails = $export->getExportFileDetails(); $filePath = $export->getExportFilesDirPath() . $job->info; $this->getHelper('file')->sendFile($fileDetails['fileName'], $filePath, $fileDetails['mimeType']); }
foreach ($harvester as $page => $records) { echo "page " . ($page + 1) . ":\n"; foreach ($records as $r => $record) { echo " record " . ($r + 1) . ": {$record->identifier}\n"; } } $job->finish()->save(); } catch (OpenSKOS_Oai_Pmh_Harvester_Exception $e) { fwrite(STDERR, $job->id . ': ' . $e->getMessage() . "\n"); $job->error($e->getMessage())->finish()->save(); } break; case OpenSKOS_Db_Table_Row_Job::JOB_TASK_EXPORT: $job->start()->save(); $export = new Editor_Models_Export(); $export->setSettings($job->getParams()); try { $resultFilePath = $export->exportToFile(); $model = new OpenSKOS_Db_Table_Jobs(); // Gets new DB object to prevent connection time out. $job = $model->find($job->id)->current(); // Gets new DB object to prevent connection time out. $job->setInfo($resultFilePath); $job->finish()->save(); } catch (Zend_Exception $e) { $model = new OpenSKOS_Db_Table_Jobs(); // Gets new DB object to prevent connection time out. $job = $model->find($job->id)->current(); // Gets new DB object to prevent connection time out. fwrite(STDERR, $job->id . ': ' . $e->getMessage() . "\n"); $job->error($e->getMessage())->finish()->save();