public function indexCatalog($guid) { $solr =& $this->_solr; $tbl = new App_Model_Db_Table_Url(); $rowset = $tbl->find($guid); if (count($rowset)) { $row = $rowset->current(); $documents = array(); $documents[] = $this->_createSolrDocument($row); try { $solr->addDocuments($documents); $solr->commit(); } catch (Exception $e) { throw new Zend_Exception($e->getMessage()); } } }
public function fetchCountCatalogShortenerAction() { $this->_helper->layout->disableLayout(); $request = $this->getRequest(); $catalogGuid = $request->getParam('guid'); $config = Pandamp_Config::getConfig(); $modelCatalog = App_Model_Show_Catalog::show()->getCatalogByGuid($catalogGuid); $short = ""; if ($modelCatalog['profileGuid'] == 'article') { $uri = "berita/baca/" . $modelCatalog['guid'] . "/" . $modelCatalog['shortTitle']; } else { if ($modelCatalog['profileGuid'] == 'klinik') { $uri = "klinik/detail/" . $modelCatalog['guid'] . "/" . $modelCatalog['shortTitle']; } else { if (in_array($modelCatalog['profileGuid'], array('kutu_putusan', 'kutu_peraturan', 'kutu_rancangan_peraturan', 'kutu_peraturan_kolonial'))) { $node = $this->view->getNode($modelCatalog['guid']); $lnode = $this->view->getLabelNode($node); $uri = "pusatdata/detail/" . $modelCatalog['guid'] . "/" . $lnode . "/" . $node . "/" . $modelCatalog['shortTitle']; } } } $url = $config->web->url->base . DS . $uri; $urlDb = new App_Model_Db_Table_Url(); $shortid = $urlDb->fetchRow("url = '" . $url . "'"); if (isset($shortid->id)) { $hex = dechex($shortid->id); $short = $config->web->url->short . '/' . $hex; } $this->view->assign('guid', $catalogGuid); $this->view->assign('shortUrl', $short); }