public function changeTitleAction() { $this->_helper->layout()->disableLayout(); $request = $this->getRequest(); $roleName = $request->getParam('role'); $collectionNumber = $request->getParam('key'); $collectionName = $request->getParam('title'); try { $model = new Remotecontrol_Model_Collection($roleName, $collectionNumber); $model->rename($collectionName); } catch (Remotecontrol_Model_Exception $e) { $this->getResponse()->setHttpResponseCode(400); $this->view->error = $e->getMessage(); } }
/** * Return a csv representation of all documents that are associated to the * collection identfied by the given role and number. * * @return string CSV output. * @throws Remotecontrol_Model_Exception Thrown if the database does not contain * a collection with the given properties or in case an error occurred while * getting all associated documents from the Solr index. */ public function getCvsFile($role, $number) { $log = Zend_Registry::get('Zend_Log'); if (is_null($role) || is_null($number)) { $msg = 'role or number is empty - could not process request.'; $log->debug($msg); throw new Remotecontrol_Model_Exception($msg); } $collection = new Remotecontrol_Model_Collection($role, $number); $resultList = array(); try { $resultList = $this->getListItems($collection->getId()); $log->debug(count($resultList) . ' documents found.'); } catch (Opus_SolrSearch_Exception $e) { $log->err(__METHOD__ . ' : ' . $e); throw new Remotecontrol_Model_Exception($e->getMessage(), null, $e); } return $this->prepareCsv($resultList); }