public function getcatalogsinfolderAction() { //sleep(2); $this->_helper->layout()->disableLayout(); //params: $folderGuid,$start,$limit,orderBy $r = $this->getRequest(); $folderGuid = $r->getParam('folderGuid'); $start = $r->getParam('start') ? $r->getParam('start') : 0; $limit = $r->getParam('limit') ? $r->getParam('limit') : 0; $sort = $r->getParam('sort') ? $r->getParam('sort') : 'regulationType desc, year desc'; //die($sort); $a = array(); //$a['totalCount'] = $tblCatalog->countCatalogsInFolder($folderGuid); $a['folderGuid'] = $folderGuid; $db = Zend_Db_Table::getDefaultAdapter()->query("SELECT catalogGuid as guid from KutuCatalogFolder where folderGuid='{$folderGuid}'"); $rowset = $db->fetchAll(Zend_Db::FETCH_OBJ); $solrAdapter = Kutu_Search::manager(); $numi = count($rowset); $sSolr = "id:("; for ($i = 0; $i < $numi; $i++) { $row = $rowset[$i]; $sSolr .= $row->guid . ' '; } $sSolr .= ')'; if (!$numi) { $sSolr = "id:(hfgjhfdfka)"; } $solrResult = $solrAdapter->findAndSort($sSolr, $start, $limit, array('sort' => $sort)); //$solrResult = $solrAdapter->findAndSort($sSolr,$start,$limit, array('createdDate desc')); $solrNumFound = count($solrResult->response->docs); //$solrResult->response->numFound; $ii = 0; //for($i=$start;$i<($limit+$start);$i++) if ($solrNumFound == 0) { $a['catalogs'][0]['guid'] = 'XXX'; $a['catalogs'][0]['title'] = "No Data"; $a['catalogs'][0]['subTitle'] = ""; $a['catalogs'][0]['createdDate'] = ''; $a['catalogs'][$ii]['modifiedDate'] = ''; } else { if ($solrNumFound > $limit) { $numRowset = $limit; } else { $numRowset = $solrNumFound; } for ($ii = 0; $ii < $numRowset; $ii++) { //die('hi:'.count($solrResult->response->docs)); $row = $solrResult->response->docs[$ii]; if (!empty($row)) { $a['catalogs'][$ii]['guid'] = $row->id; $a['catalogs'][$ii]['title'] = $row->title; $a['catalogs'][$ii]['subTitle'] = $row->subTitle; $a['catalogs'][$ii]['createdDate'] = $row->createdDate; $a['catalogs'][$ii]['modifiedDate'] = $row->modifiedDate; } } } echo Zend_Json::encode($a); }
function indexAction() { $indexingEngine = Kutu_Search::manager(); // $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); // $rowset = $tblCatalog->fetchAll(); // foreach ($rowset as $row) { // $indexingEngine->indexCatalog($row->guid); // echo 'indexing '.$row->guid.'<br>'; // } $indexingEngine->testFind('guid:(pts00637b1b1dc2d6f02a5f5a9ceb866622 pts0090c780b89fda90f0f96d3cc96c8482 pts0180e95cb3f412be868628244310dcb2 pts0390a6c5b63b4551783e023a6100895e pts056e2d43bb866d324d3fdb40ad93c986 pts05ac711523ea7b79bdd6b174792f1197 pts095696236af5011e3ca967db5923d49b pts099ce1de851fd1b0a844fac086d6e2a5 pts0a3029abdeacd236a0bc59e128d03eed pts0b192d76ab15036b8ffbde7eecbded6b pts0c5b2103d17fcafcc22449ee3370b352 pts0c74d1d980939b5811edded52e918066 pts0c774c0b35db68de10da4b77eac87ddf pts0c8b0235506e0efccd6599cca6238c39 pts0c9a9dd958a268a3d732ad0b25d31023 pts0d18c3ccf6650f64322a8623e238abe5 pts0d8359fa034cce01f6d045d3f854fde8 pts0e92dadcc5ffd12d5966f3cb02d45cb2 pts11131ce55524ae8bfed549213cde7358 pts117f0354dbb866f612218c988dfc2849 pts12b0d029296853c67de480cec47d8fe2 pts12dc8917f7021fcd9f6e273b45ced735 pts133895892896c35e8c72a173f5dbb841 pts15086aa9db7df1966210655a35b194b9 pts164f05205a0782c89a538fea40a78cf8 pts17bf489449c4f26e69a866a87f69fdf1 pts181c9e6cb3916319b3644ecec41a4c20 pts185825d8c640f745ebdc50502aeda663 pts18f86619b047f453acc560221d6774a5 pts1b8c6252fe8725ae61e47adad50b600a pts1be7b4ffae1addd0696069755a8d851e pts1c0dc879b14925d243da6e95518ddabb pts1c50307734cd7fea90af1aacf098389f pts1d837ec35bcf2406c67fee669b3de626 pts1dd8a81a8218224c953bd213f284a35e pts1ed78d89028771ee7350a44fc405e19b pts20626886ea20eca639d8473c91766d2c pts20a7a2688f820165e092144485ea0847 pts26d7c53d218d87d92283802e92e52c0d pts27770980f34027ba2bacdedea62e5952 pts28571f39ea63c1b176694195e4bd4b08 pts292455b89024962fb8ba513fbd966c74 pts2969d6c2dfa8298ba878359df9a12fb8 pts2981cf1fe219f2446364dd3cbb1d3683 pts2a730923216ec6826c3649d97f08ceb6 pts2ac907c07495f843a67d2b065fb3170a pts2b212db04c19f8a3a6d9be35e9fed36e pts2b217db0a459e5c5893703ec420dd98e pts2b34d754b53708296777f5d883dd8f8b pts2bb7e884ffaff13eaf4c78d11d6232da pts2be1493849a8c72ece6dd80c562bdeec pts2cc6c42bd5c3706d3969fc7d4643ad26 pts2e4c47f1bf4073648c3dd5dad193e4ae pts2e919f9c1c10a851bd5ce05e0ddea0ad pts2ee3bcf34f4672e5f7007d6607ed1282 pts2f0c74450db07bc72471177be4ea6c42 pts2f67bb0d76101013ffe3d8d1b5134040 pts2fa5e948db744377e604e0bd5b439b7e pts3041efaf1c2f6f66194431c53166b8da pts307aba3a14caef43b3e704b2672cc1e0 pts31c5cd0a2ce3f487252d650bc6e15a27 pts32f3c85f6d923fe9bcba813942e79905 pts3352935dcb333851241837208f813076 pts33d1261ab8ac3a3a29b9b936dadbc26b pts34e1243e248ef2c325802b0b956fd889 pts354110202819abc0c62a111a91c59f3e pts36c505208cdf0d1492945cb64f4cc640 pts376b7d2bf8e8fe0ffbf914165f19dc9d pts385d77b2b4468bb401fd647e6aa6df56 pts39326b1c67b95c6ad0515227619a7ca3 pts39e57bd35bce9ac124b945a7d53591a0 pts39fd12b3261d6f43e7d8e6f4f68431d4 pts3ae4616fa2fe4e6c44d97517a3350ea4 pts3c43a209b65e9ba756705ebe0b132a06 pts3cacaae0117f87922a8b8a681152330a pts3cec7c2f57261f1fd18f88dd7b589894 pts3d093ecf6e60fa59ba58b133f2e608c9 pts3df5292eee58416e300d5656112b9f09 pts3f61c49e87e549b4479c4e9344c68b2d pts435531326fc9c1df7e06c76b6a1b235a pts447c281dfe2d9a9bebde771707d7c6fc pts4494c2c712cf4e8af4e9ff9efcdfc7ac pts44c5b5fbc55cfd010beca6034c89e448 pts4660c70108c1968413f2f5c40f53738a pts47d3d3bc0429b11ed8e85677112bc076 pts47f6f87742e5164f03bb7864809d5251 pts484495e6600554ecfedb397627cdf3e3 pts491ab611aebd9f33c828c3add5a0a218 pts4dd90420ff4e2a47dd0f4dff2561dfa3 pts4eba9b87b9f2c9478b541f4cb21ff0f6 pts5089f8d3761f620d8a6c5eb9e0e751ab pts511ef12abe31de324eafc043abc7ebaa pts514fb8011ad8ddbc2a8481796d573c55 pts5180aee278e66c2db6be4afc00edaf7a pts522464fa67251ab7ee176f6381f687b0 pts5264791b747fafeae1806a2a0bbf007d pts5344617b571d74c8163f6ea32c3664a0 pts53cb29a9a2a5e669d6bd78f138eb89f9 pts5417230f2dd1efddaa07b6481c312f6e pts54a3e849892915ce51e9d9cb839a4949 pts551af50f5e5e1d5f1a3074a6f1456734 pts559d76118716b129da59d72556d420b4 pts5690340db5ccb793f0830ebc7c62557a pts5854eaf6512661ab5b832bd5e90a1656 pts588cfc92e0608c19e95e35f75baf7434 pts58b2046ab6fbf97a757e8cef7a1b49a3 pts58de808fbc38fd68eed8708c1dca253c pts58fedf2384daeb3c5c94d8b7d1958600 pts5956e0ae149fe0dcc6e3f19b3f0ee66e pts59894448ffb6b73203fe800df77bf664 pts59d05a7a1f34810b5f98c54db53ddca2 pts5a2c7da9d1b8f72e54bf25b12a16a600 pts5a5eadec38ace7803b83dbd64934280f pts5aa73c4918941c3a9d624acd864daa1f pts5bce51eca15f9229c855a738da9a8246 pts5d200f5477ba251d624f6d37bb11b962 pts5e700e4a286bce6748f0bb42e8d3ca38 pts5e77c7b6b86c883d87177bc359b1b05c pts5e8a441db12b855ef52c9de4310c3027 pts5eb800032ebe8cf5c86d0d19864cf145 pts5f31f49361685662a29c0599eb42d644 pts60c7f040ec5d375dfcc8567aa9b62cce pts615c52e490b43f53bb1ec6d61ea88442 pts61956b09778819b221d304c47866fea4 pts619b1d0f2f14984f0526eb9022d9d0b9 pts62b91ac95edf495ab7afdc6582e57bb8 pts631099a9abd12910c7a5e241924497a7 pts6433fff1e218052ddf9ba15d567592d1 pts64603c956f9e4330e8463ea980315eb1 pts64fd160ac418a341191fe06a9340d7ff pts65237ce0326cf415bc8730cf990347f1 pts65bb183ab529432b9e3956dbb15daf6f pts65c391a29a7003d870d9ed3290811b55 pts65cad26061c579742e6d8c482c0174e0 pts6777b1bc623bcd2cfbc34841c404541a pts69494c181dfda8080b2741b44195c5c2 pts69819cb2ef0fd3f0859a9f557ad12589 pts69dc98b9971bd6962b6091ddf4d370c7 pts6ab3769ca47f0fe52ee97f4bf5d083f6 pts6acddd11bd25dfec89ef1185be01a2cf pts6af98123aa7792bc5edf96166efc1dcd pts6b42e07d852938f4efa4eaf38ff90411 pts6cc0278ed14cc154c546da0d110a0f74 pts6e635cce6cedec327ebe734ee4923169 pts6f6da8ce17806f00e56aff8df3182eb0 pts7220cd9a5d8d3e3148609a7d642c0dcf pts7237610837bf2aaf4707153445717d34 pts727a13e249db03242e5a1582e509d0ea pts72f00aba0a82f9f03008d94a2cea4831 pts73dfd7830477df6d1d654a14b045984c pts74128d809a73b988d647617234819f22 pts75044a395ec33b7d875175da512341e5 pts75794fb056283d0dfee3bd018bf7d781 pts757e45b375f2787f7b024ed4ac6a96ea pts77f4c6e876ba3ac9e2b527da17d57304 pts7886763bd1696a80a72c21a42becac78 pts78bee21041918701457e4b812328e53a pts79551bb07e7ed67cae4e007ae0872873 pts7c9e738e23b9986b33ad704f68bf0618 pts7eaa2d5f4d15dcdd52707aa2e63bf15d pts7f6077fd023ee1c1fdcb2e908dadf6c9 pts7f6c29b02b4a88bf512e66fe753f5c73 pts80017b4ac09eac6fd55d34451999e907 pts808a68ee507ade0a13ec118e2a04ce09 pts80abf1214d4b9302b969849f81b4df22 pts80b2f150656830abc0e3fff383b59d04 pts812e6312ef5802822325ced8f0db603b pts81e8606e932b64301e3266d124055f1d pts81fb5fbf45a4fb0df55ebd87594796b6 pts820a2d959a884c9ced82aaf996adb811 pts823c43645ac222d1af4907fc135620e1 pts8344506d70f1e95c60c07b47b0077677 pts83490c23e62957ec6a16482cf40ef9bd pts83d8249682fc00ef5d8d6f946731f008 pts83e7d494edf494678b764ceb51b0b115 pts84e558962171df6019f990a459055dbf pts86ada19ca4729c732f2953b9128cf627 pts8a26d649cce13fafe7fb05e5df3f2a88 pts8a75ec2edd9d393bfebffb411f6dc2cd pts8b076cb020b8bf19bc4aab8583bb080b pts8c5289f9ad3c13e2d022d1bdd8742ab7 pts8d071ea58e8a803b377bca090a3dc16d pts8dc9300c001e5fc04ae61f54e3afad4d pts8ef7faaaffd34b55171f4e0e67195084 pts8f27c825a9a7d77aea4ae74013f89be9 pts901708c2585becdddca6d86b1d206941 pts9060eebfdc2287eef2ff9bdd2699a62b pts90c2dec95204507e2f6f54f983b26f66 pts91297d56972999089f3c1d8b4d645795 pts92d807a47b34b0efcb35adc49758505e pts937ae6e311346cb71381ce60ccd2bc5b pts93c1715aed25ae10d39cbdb0432ca11a pts95370ee93ac980e585c30fa557b467ff pts967e3dacd523c53b77e4b408b13169cd pts9694c1dcc9c4a0c76b849d5e6bd92809 pts9767b013b430865f3822dc01b2e14d60 pts9767cbef1b52638b3f4f000830000b94 pts992da10cbb3ef014b86d24ad03fc01cc pts9a19d3178cd3dc8db0288de7062dbb44 pts9b35efdefaa50e8b39c02d9c21037415 pts9c32de4ff6b61cdea0d901daee024286 pts9c8d81f03d44d559a9de6e69ce327e09 pts9d3ffa51fd53be798af9306c9a510138 pts9dc154f0e5292d16828d7903635d6005 pts9eb772d3cf9b6c02c539e74079db2a24 pts9ed7b81a3893a02661d19a71b9ce2e63 pts9fd81cc50dbbe5c82e82865a8b0934c5 ptsa054ee510f717e67d4cdc64b8f07c278 ptsa0f24d7682ef1ced308a38d12f4cfaf3 ptsa1838d483abda120e3c3d080b311ad57 ptsa3e040f6f23c0bd5f72b2ea05df4a306 ptsa3e2a0a6f57abdded892c4e82bbfd9b9 ptsa41ed6711a7ae1f4d739a43fbefd1d5d ptsa4c7e421f84e9054192cfa7836a38cb8 ptsa61e41d476fdff6b9a05c8852e3956f4 ptsa67d16d992cc18cea6e14e32beaccf19 ptsa6f613b7be3a19d3ab856de1b07fa8ce ptsa9962244275e6851d19afdac2f3fcf5e ptsab3d1d2f2c0eb34fc1f2dd415d18553b ptsac99871f519636f408971167bed70073 ptsad7ac95c83665914fb5dac0b7517face ptsad98b7fc8c44152fad4341af484e3c92 ptsae66998d61c715a31d1f438418671c42 ptsb0c3c34ad9f0193e7333d2457f7ea828 ptsb0f6fbb5f58df216ebb4264ba8956ae1 ptsb140d42bcd2e98233bc1af7d3902ef8c ptsb1a158e75bb2ea56bf4cd706f1a67a7a ptsb1b4cc4323afd7a813ace52f1e6c1c54 ptsb39ae0b2d50987935d0a61105281412f ptsb5dd9dcb5da0e86284da960e643f14cc ptsb634ff866b7a54306008a845ef86a41e ptsb7c18acb61abe8e12bd5af4b5c8112e7 ptsb8a94e30a137b322d8a5de5890bc8123 ptsb8fa79b4fb5b9ff35286dfd045d9ffe9 ptsbafbbb4c8f2516f32ca49997f1beff99 ptsbc5ba958ff77b834e637701d33c3e41b ptsbcbe753172bcb1518a2bcd83becf0537 ptsbd238182829962387374ecbcba897276 ptsbdcb51c71a10b0fa04e5351037299d22 ptsbe09fb8827dc07cb57db81a04c823544 ptsbe7d68a2a8b561f6a010a2e645cbe98c ptsbf0755250ef6890d331321971ab8e123 ptsbfe5fe3bf4c79af8f644d4286f4fcc57 ptsc0c89ffda1ed0cdbd39dda9da1aaaa89 ptsc1670b00db2fdf5e122e21bf3b269797 ptsc1a63f2ba4a4498224bff6861e9c79d8 ptsc1adda885ea40935bf9f53b635359d00 ptsc3d621dd27f44cbbb107c255444d1e36 ptsc434c73cf6a7aa7ec794a7c3246d17ad ptsc447ad2af98e5e8a7d001234dffeaf7c ptsc4a2c3244153345dd0012dca17e4eaa0 ptsc54e58956a01a84b2cd8bcd33025120d ptsc61ca1c856b7b69ffb22c4a34cb9b8ff ptsc6722b8019ddc158af30553633f2ac90 ptsc6ab17baad92f7362c81c9ed4a099f49 ptsc6d5f8ff0d6a2f1c913c33a88e7b3beb ptsc82a610f886b6bcb053bed0fd4d284fe ptsc8327c8f476657b5de3d00fd749b3222 ptsc9ce88acbaec0f8c19f0c47be20bb009 ptsc9dc9cc13dcd3303309c5431eeeebca2 ptsc9f8a0417dc463fc60a24dd4941f6202 ptsca6315dd74e6e656f933fd1a01c9cd9a ptscb1f6c694b45e2c14b2d72d9a83fe400 ptscc0d2edfc57ddf2c485f34e3bbb1217b ptscc596ad991b141258511e903ca2c14dd ptscdf534c277307c7317740400f9b9bef2 ptsce8af389ec322125d69ddfb89e8cf401 ptsce9f1a393f464bbd3d628bb3fb954c8b ptsd0255c3e7f135bf7e9a135ce0690a1a2 ptsd0971559164b3e95d20b5f0541eea2d0 ptsd1460a492a10160c3c66151949b537dd ptsd1894ab94d40db3b7bbde0f41f469788 ptsd1f744b248b4a8681dd30780c0a69c32 ptsd28ccc4fe1e1c33ea116ff3496912d59 ptsd3283739d9aaa584bd65b684cccdb87e ptsd42003ba3fc67e33cc229a91697dd0d2 ptsd420f98033bb45b7361404be3a7a5532 ptsd4be954dab2c1d31670b83a46f00a656 ptsd531414da2ec183354e61cbf705b19f4 ptsd69447b93626af2db74dc88884fc85a5 ptsd9b568d9cebd8be4c0f48a81d0f865b7 ptsda38b7256bfbbfaa2f193e244ea71c64 ptsda73121878cff0ee9fead70e65451f35 ptsdc88ba712356e000c19784fe5423a663 ptsdc959cbff65b9d1a4b6c3c418672d909 ptsdcd04cbf8844626d099fb342914a3e98 ptsdd327ce68854285c0a01bedc9e65cb4f ptsdf36ca1dabe1b02e2000fb0042694242 ptsdf93b95c51da2e663e8a5d3139231f81 ptse012a587be99b9e440c692bc8d4a68f6 ptse04bd4f83d615fda00a699317c8b07b5 ptse14378b03050e7d3fba5433eb32b1f67 ptse211c09d80b28af9c0c756312d0823c5 ptse2ff3d8c816eb4b1a1c566243bf82a02 ptse3ff058898da82ca7a40136ca21b7dbd ptse555b92fd9022f32eba1c3d36043f147 ptse5a82cedee1282d13a64b66f412be183 ptse5b2f353efd09b11f7cfe9e1c7b6b6f0 ptse670b9a72d17c4640c88aa96240dd69e ptse676d2401459ff90421ccce386a17b9f ptse6c0c5ae45f432b161543c232053c2ce ptse747768c9e2b05ceb4112b01b3e26800 ptse7b18b7497a266e9548b39a23494b6dc ptse8064c40cf21ce64f1996d50bb5926a7 ptse93230cc9144cf29b4fbaa3b14634853 ptsea9876f03628c358462ce74e262cadb1 ptseab84e6204780db056a8c6b56a1c1137 ptseacd58afeecff4713ca2911e98e435ed ptsebb6e571fc9462d76be3b3fd79a2a50c ptsec1213f4e7138022efcb65d9877c113a ptsec4481e6d61870a7d10575b636163200 ptsec95c8181e07e0c4d493d908a3f24c4e ptsed8ab060f6fe866641223aa9c2edf3b0 ptsedb4eb1b551766db8bde47fac10ddf98 ptsedcfc0d527d3f97b2a5f35beee7e1f19 ptsf04a8bd568276ecc7b48b57ce2d71589 ptsf109cb55992bec317939f61446e14724 ptsf135f84ac4bd3a6c37e3b1d477dfa2c2 ptsf18e5d68bbc910676980a428ac41bbba ptsf329330b4a796b2cbcd4d17e7977a554 ptsf5f78befae1c64bcf86ed8bf9444eefd ptsf61091de6e6d3a30eee40ba63d149e18 ptsf773e4b389e0cfbb27b4ebc58e71765b ptsfb466ed13d626dba7b8333e283fd4843 ptsfb8eceb8b3b0425612059106785f097b ptsfc39d377c8fae75dcbcddfc8a1e5f47c ptsfcabf9e20c84b1e29e355d0caa7b25ee ptsfce2796511dac8fd318cfceadd672661 ptsfd842aa2f6e843f95fedfd3e3a597d88 ptsfdf708c524a1ab04dbae6ca9b56791f5 ptsfe3dcd2ac590437089faa6bfca16e143 ptsfeb29582516b8b37f1efd2805f6d5af7 ptsff885132fd5366fdb7ee71adc277e66b )', 0, 20); }
public function listAction() { $r = $this->getRequest(); $guid = $r->getParam('f'); $g = $r->getParam('g'); $guid = !empty($g) ? $r->getParam('g') : $guid; $tblFolder = new Kutu_Core_Orm_Table_Folder(); $row = $tblFolder->find($guid)->current(); $this->view->listTitle = $row->title; $this->view->pageTitle = $row->title; //View catalogs $limit = $r->getParam('limit') ? $r->getParam('limit') : 12; $this->view->limit = $limit; $itemsPerPage = $limit; $this->view->itemsPerPage = $itemsPerPage; $offset = $r->getParam('offset') ? $r->getParam('offset') : 0; $this->view->offset = $offset; $this->view->currentNode = $guid; $sort = $r->getParam('sort') ? $r->getParam('sort') : "createdDate desc"; //"regulationType desc, year desc"; $this->view->sort = $sort; $db = Zend_Db_Table::getDefaultAdapter()->query("SELECT catalogGuid as guid from KutuCatalogFolder where folderGuid='{$guid}'"); $rowset = $db->fetchAll(Zend_Db::FETCH_OBJ); $solrAdapter = Kutu_Search::manager(); $numi = count($rowset); $sSolr = "id:("; for ($i = 0; $i < $numi; $i++) { $row = $rowset[$i]; $sSolr .= $row->guid . ' '; } $sSolr .= ')'; if (!$numi) { $sSolr = "id:(hfgjhfdfka)"; } $solrResult = $solrAdapter->findAndSort($sSolr, $offset, $limit, array($sort)); //print_r($solrResult);die('gg'); $solrNumFound = count($solrResult->response->docs); $this->view->totalItems = $solrResult->response->numFound; $this->view->hits = $solrResult; if ($r->getParam('heading')) { /*$modDir = $this->getFrontController()->getModuleDirectory(); require_once($modDir.'/components/Pages/DetailsViewer.php'); $w = new Site_Pages_DetailsViewer($solrResult->response->docs[0]->id, 'root'); $this->view->widget1 = $w;*/ $this->view->showHeadline = 1; $this->view->catalogGuid = $solrResult->response->docs[0]->id; $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $row = $tblCatalog->find($solrResult->response->docs[0]->id)->current(); $this->view->row = $row; } }
public function searchAction() { $this->_helper->layout()->setLayout('layout-iht'); $r = $this->getRequest(); $sQuery = $r->getParam('sQuery'); $this->view->sQuery = $sQuery; $sOffset = $r->getParam('sOffset'); $this->view->sOffset = $sOffset; $sLimit = $r->getParam('sLimit'); $this->view->sLimit = $sLimit; $indexingEngine = Kutu_Search::manager(); $hits = $indexingEngine->find($sQuery, $sOffset, $sLimit); $this->view->hits = $hits; //print_r($hits); }
public function searchAction() { $this->view->pageTitle = "Search for Relation"; $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY'); $sessHistory->relatedGuid = $this->_getParam('relatedGuid') ? $this->_getParam('relatedGuid') : $sessHistory->relatedGuid; $this->view->relatedGuid = $sessHistory->relatedGuid; //echo "related: ".$this->view->relatedGuid; $r = $this->getRequest(); $sQuery = $r->getParam('sQuery') ? $r->getParam('sQuery') : ''; $this->view->sQuery = $sQuery; $sOffset = $r->getParam('sOffset'); $this->view->sOffset = $sOffset; $sLimit = $r->getParam('sLimit'); $this->view->sLimit = $sLimit; $indexingEngine = Kutu_Search::manager(); if (empty($sQuery)) { $hits = $indexingEngine->find("fjkslfjdkfjls", $sOffset, $sLimit); } else { $hits = $indexingEngine->find($sQuery . " -profile:kutu_doc", $sOffset, $sLimit); } $this->view->hits = $hits; }
function viewCatalogsAction() { $time_start = microtime(true); $folderGuid = $this->_getParam('node') ? $this->_getParam('node') : 'lt49f812abe4488'; $page = $this->_getParam('page', 1); $db = Zend_Db_Table::getDefaultAdapter()->query("SELECT catalogGuid AS guid FROM KutuCatalogFolder WHERE folderGuid='{$folderGuid}'"); $rowset = $db->fetchAll(Zend_Db::FETCH_OBJ); $indexingEngine = Kutu_Search::manager(); $numi = count($rowset); $sSolr = "id:("; for ($i = 0; $i < $numi; $i++) { $row = $rowset[$i]; $sSolr .= $row->guid . ' '; } $sSolr .= ')'; if (!$numi) { $sSolr = "id:(hfgjhfdfka)"; } $solrResult = $indexingEngine->find($sSolr); $solrNumFound = count($solrResult); $paginator = Zend_Paginator::factory($solrResult); $paginator->setCurrentPageNumber($page); $paginator->setItemCountPerPage(20); $this->view->hits = $paginator; $this->view->folderGuid = $folderGuid; /* if($folderGuid=='root') { $a = array(); $a['totalCount'] = 0; $a['totalCountRows'] = 0; $a['folderGuid'] = $folderGuid; $limit = 20; $a['limit'] = $limit; } else { $a = array(); $a['folderGuid'] = $folderGuid; $db = Zend_Db_Table::getDefaultAdapter()->query ("SELECT guid from KutuCatalog, KutuCatalogFolder where guid=catalogGuid AND folderGuid='$folderGuid'"); $rowset = $db->fetchAll(Zend_Db::FETCH_OBJ); $a['totalCount'] = count($rowset); $a['totalCountRows'] = count($rowset); $limit = 20; $a['limit'] = $limit; } $this->view->aData = $a; $time_end = microtime(true); $time = $time_end - $time_start; // echo'<br>WAKTU EKSEKUSI: '. $time; $this->view->time = round($time,2) . ' detik'; */ }
public function searchAction() { $r = $this->getRequest(); $sQuery = $r->getParam('sQuery') ? $r->getParam('sQuery') : ''; $this->view->sQuery = $sQuery; $sOffset = $r->getParam('sOffset'); $this->view->sOffset = $sOffset; $sLimit = $r->getParam('sLimit'); $this->view->sLimit = $sLimit; $indexingEngine = Kutu_Search::manager(); $hits = $indexingEngine->find($sQuery, $sOffset, $sLimit); $this->view->hits = $hits; $bpm = new Kutu_Core_Bpm_Catalog(); $this->view->bpm = $bpm; }
protected function _postDelete() { //find related docs and delete them $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $rowsetRelatedDocs = $tblRelatedItem->fetchAll("relatedGuid='{$this->guid}' AND relateAs='RELATED_FILE'"); if (count($rowsetRelatedDocs)) { foreach ($rowsetRelatedDocs as $rowRelatedDoc) { $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $rowCatalog = $tblCatalog->find($rowRelatedDoc->itemGuid)->current(); $rowCatalog->delete(); } } if ($this->profileGuid == 'kutu_doc') { //get parentGuid $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $rowsetRelatedItem = $tblRelatedItem->fetchAll("itemGuid='{$this->guid}' AND relateAs='RELATED_FILE'"); if (count($rowsetRelatedItem)) { foreach ($rowsetRelatedItem as $rowRelatedItem) { //must delete the physical files $rowsetCatAtt = $this->findDependentRowsetCatalogAttribute(); $systemname = $rowsetCatAtt->findByAttributeGuid('docSystemName')->value; $parentGuid = $rowRelatedItem->relatedGuid; $sDir1 = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . $systemname; $sDir2 = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . $parentGuid . DIRECTORY_SEPARATOR . $systemname; if (file_exists($sDir1)) { //delete file unlink($sDir1); } else { if (file_exists($sDir2)) { //delete file unlink($sDir2); } } } } } //delete from table CatalogAttribute $tblCatalogAttribute = new Kutu_Core_Orm_Table_CatalogAttribute(); $tblCatalogAttribute->delete("catalogGuid='{$this->guid}'"); //delete catalogGuid from table CatalogFolder $tblCatalogFolder = new Kutu_Core_Orm_Table_CatalogFolder(); $tblCatalogFolder->delete("catalogGuid='{$this->guid}'"); //delete guid from table AssetSetting $tblAssetSetting = new Kutu_Core_Orm_Table_AssetSetting(); $tblAssetSetting->delete("guid='{$this->guid}'"); //delete from table relatedItem $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $tblRelatedItem->delete("itemGuid='{$this->guid}'"); $tblRelatedItem->delete("relatedGuid='{$this->guid}'"); //delete from lucene index //check if guid exist in index, then delete // $indexEngine = new Kutu_Search_Index_Engine(); // $indexEngine->deleteCatalogFromIndex($this->guid); $registry = Zend_Registry::getInstance(); $conf = $registry->get('config'); $indexingEngine = Kutu_Search::manager(); try { $hits = $indexingEngine->deleteCatalogFromIndex($this->guid); } catch (Exception $e) { } /* $tblTmpIndex = new Kutu_Core_Orm_Table_TmpIndex(); $rowTmpIndex = $tblTmpIndex->fetchNew(); $rowTmpIndex->catalogGuid = $this->guid; $rowTmpIndex->status = 'delete'; $rowTmpIndex->save(); */ $tblTmpIndex = new Kutu_Core_Orm_Table_TmpIndex(); $tblTmpIndex->delete("catalogGuid='{$this->guid}'"); //delete physical catalog folder from uploads/files/[catalogGuid] $sDir = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . $this->guid; try { if (is_dir($sDir)) { rmdir($sDir); } } catch (Exception $e) { } $sDir = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'images'; try { if (file_exists($sDir . "/" . $this->guid . ".gif")) { unlink($sDir . "/" . $this->guid . ".gif"); } if (file_exists($sDir . "/tn_" . $this->guid . ".gif")) { unlink($sDir . "/tn_" . $this->guid . ".gif"); } if (file_exists($sDir . "/" . $this->guid . ".jpg")) { unlink($sDir . "/" . $this->guid . ".jpg"); } if (file_exists($sDir . "/tn_" . $this->guid . ".jpg")) { unlink($sDir . "/tn_" . $this->guid . ".jpg"); } if (file_exists($sDir . "/" . $this->guid . ".jpeg")) { unlink($sDir . "/" . $this->guid . ".jpeg"); } if (file_exists($sDir . "/tn_" . $this->guid . ".jpeg")) { unlink($sDir . "/tn_" . $this->guid . ".jpeg"); } if (file_exists($sDir . "/" . $this->guid . ".png")) { unlink($sDir . "/" . $this->guid . ".png"); } if (file_exists($sDir . "/tn_" . $this->guid . ".png")) { unlink($sDir . "/tn_" . $this->guid . ".png"); } } catch (Exception $e) { } //delete from ACL }
private function _createDmsMemoranda($rowsetAttribute, $targetFolderGuid) { $rowSourceCatalog = $rowsetAttribute[0]; $guidPrefix = $this->_guidPrefixDms; // map to KutuCatalog $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $rowCatalog = $tblCatalog->find($guidPrefix . $rowSourceCatalog->DocumentID); if (count($rowCatalog) <= 0) { $rowCatalog = $tblCatalog->fetchNew(); $rowCatalog->guid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalog->shortTitle = $rowSourceCatalog->DocTitle; $rowCatalog->profileGuid = "legal_memoranda"; $rowCatalog->createdBy = $rowSourceCatalog->DocCreator; $rowCatalog->modifiedBy = $rowSourceCatalog->DocModifier; $rowCatalog->createdDate = $rowSourceCatalog->DocCreated; $rowCatalog->modifiedDate = $rowSourceCatalog->DocModified; $rowCatalog->status = 99; $rowCatalog->price = $rowSourceCatalog->Price; $rowCatalog->save(); $tblCatalogAttribute = new Kutu_Core_Orm_Table_CatalogAttribute(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalogAttribute->attributeGuid = 'fixedTitle'; $rowCatalogAttribute->value = $this->_cleanChars($rowSourceCatalog->DocTitle); $rowCatalogAttribute->save(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalogAttribute->attributeGuid = 'fixedSubTitle'; $rowCatalogAttribute->value = $rowSourceCatalog->DocSubject; $rowCatalogAttribute->save(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalogAttribute->attributeGuid = 'fixedKeywords'; $rowCatalogAttribute->value = $rowSourceCatalog->DocKeywords; $rowCatalogAttribute->save(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalogAttribute->attributeGuid = 'fixedDescription'; $rowCatalogAttribute->value = ''; $rowCatalogAttribute->save(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalogAttribute->attributeGuid = 'fixedComments'; $rowCatalogAttribute->value = $rowSourceCatalog->DocComments; $rowCatalogAttribute->save(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalogAttribute->attributeGuid = 'fixedContent'; $rowCatalogAttribute->value = ''; $rowCatalogAttribute->save(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowSourceCatalog->DocumentID; $rowCatalogAttribute->attributeGuid = 'fixedAuthor'; $rowCatalogAttribute->value = ''; $rowCatalogAttribute->save(); foreach ($rowsetAttribute as $rowDocProfile) { $flagSave = false; switch ($rowDocProfile->AttributeID) { case 3: $attribute = "fixedYear"; $attributeValue = $rowDocProfile->Description; $flagSave = true; break; } if ($flagSave) { $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $guidPrefix . $rowDocProfile->DocumentID; $rowCatalogAttribute->attributeGuid = $attribute; $rowCatalogAttribute->value = $attributeValue; $result = $rowCatalogAttribute->save(); } } } else { $rowCatalog = $rowCatalog->current(); } //update KutuCatalogFolder $rowCatalog->copyToFolder($targetFolderGuid); // migrate attached files $this->_createDocs($rowSourceCatalog->DocumentID); // migrate related items $this->_migrateDmsRelatedItems($rowSourceCatalog->DocumentID); //do indexing $indexingEngine = Kutu_Search::manager(); try { $indexingEngine->indexCatalog($this->_guidPrefixDms . $rowSourceCatalog->DocumentID); } catch (Exception $e) { $sE = 'guid: ' . $this->_guidPrefixDms . $rowSourceCatalog->DocumentID . '<br>'; echo $sE . $e->getMessage() . '<br> <br>'; } }
public function quickreindexallAction() { $indexingEngine = Kutu_Search::manager(); $indexingEngine->reIndexCatalog("NORMAL"); die; }
public function alterDate($aRowCatalog) { if (isset($aRowCatalog['guid']) && empty($aRowCatalog['guid'])) { throw new Zend_Exception("Guid can not be empty!"); } $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $row = $tblCatalog->find($aRowCatalog['guid'])->current(); $catalogGuid = $aRowCatalog['guid']; $createdDate = isset($aRowCatalog['createdDate']) ? $aRowCatalog['createdDate'] : $row->createdDate; $modifiedDate = isset($aRowCatalog['modifiedDate']) ? $aRowCatalog['modifiedDate'] : $row->modifiedDate; $tblCatalog->update(array('createdDate' => $createdDate, 'modifiedDate' => $modifiedDate), "guid='{$catalogGuid}'"); //reindex catalog $indexingEngine = Kutu_Search::manager(); $indexingEngine->indexCatalog($catalogGuid); return true; }
public function getsearchAction() { $this->_helper->layout()->disableLayout(); $r = $this->getRequest(); $query = $r->getParam('query') ? $r->getParam('query') : ''; $start = $r->getParam('start') ? $r->getParam('start') : 0; $limit = $r->getParam('limit') ? $r->getParam('limit') : 20; $orderBy = $r->getParam('orderBy') ? $r->getParam('sortBy') : 'regulationOrder'; $sortOrder = $r->getParam('sortOrder') ? $r->getParam('sortOrder') : ' asc'; $a = array(); $a['query'] = $query; $indexingEngine = Kutu_Search::manager(); $hits = $indexingEngine->find($query, $start, $limit); $num = $hits->response->numFound; $solrNumFound = count($hits->response->docs); $ii = 0; if ($solrNumFound == 0) { $a['catalogs'][0]['guid'] = 'XXX'; $a['catalogs'][0]['title'] = "No Data"; $a['catalogs'][0]['subTitle'] = ""; $a['catalogs'][0]['createdDate'] = ''; $a['catalogs'][0]['modifiedDate'] = ''; } else { if ($solrNumFound > $limit) { $numRowset = $limit; } else { $numRowset = $solrNumFound; } for ($ii = 0; $ii < $numRowset; $ii++) { $row = $hits->response->docs[$ii]; if (!empty($row)) { if ($row->profile == 'kutu_doc') { $title = 'File : ' . $row->title; $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $rowset = $tblRelatedItem->fetchRow("itemGuid='{$row->id}'"); if ($rowset) { $guid = $rowset->relatedGuid; } else { $guid = $row->id; } } else { $title = $row->title; $guid = $row->id; } $a['catalogs'][$ii]['title'] = $title; $a['catalogs'][$ii]['guid'] = $guid; if (!isset($row->subTitle)) { $a['catalogs'][$ii]['subTitle'] = ''; } else { $a['catalogs'][$ii]['subTitle'] = $row->subTitle; } if ($row->profile == 'kutu_doc') { $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $rowsetRelatedItem = $tblRelatedItem->fetchRow("itemGuid='{$row->id}' AND relateAs='RELATED_FILE'"); if ($rowsetRelatedItem) { $parentGuid = $rowsetRelatedItem->relatedGuid; } else { $parentGuid = ''; } } else { $tblCatalogFolder = new Kutu_Core_Orm_Table_CatalogFolder(); $rowsetCatalogFolder = $tblCatalogFolder->fetchRow("catalogGuid='{$row->id}'"); if ($rowsetCatalogFolder) { $parentGuid = $rowsetCatalogFolder->folderGuid; } else { $parentGuid = ''; } } $a['catalogs'][$ii]['folderGuid'] = $parentGuid; $a['catalogs'][$ii]['createdDate'] = $row->createdDate; $a['catalogs'][$ii]['modifiedDate'] = $row->modifiedDate; } } } echo Zend_Json::encode($a); }
public function __construct($node) { $time_start = microtime(true); $this->view = new Zend_View(); $this->view->setScriptPath(dirname(__FILE__) . '/views'); $folderGuid = $node ? $node : 'root'; $this->view->addHelperPath(KUTU_ROOT_DIR . '/mix_lib/Kutu/View/Helper', 'Kutu_View_Helper'); Zend_Loader::loadClass('Kutu_Core_Orm_Table_Catalog'); $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); if ($folderGuid == 'root') { $time = time(); $date = date("Y-m-d H:i:s", $time); $rowset = $tblCatalog->fetchAll("createdDate < '{$date}' and profileGuid = 'kutu_peraturan'", 'createdDate DESC', 12, 0); $a = array(); //$a['totalCount'] = count($rowset); $a['totalCount'] = 0; $a['folderGuid'] = $folderGuid; $solrNumFound = 0; } else { $a = array(); //$a['totalCount'] = $tblCatalog->countCatalogsInFolder($folderGuid); $a['folderGuid'] = $folderGuid; $db = Zend_Db_Table::getDefaultAdapter()->query("SELECT guid from KutuCatalog, KutuCatalogFolder where guid=catalogGuid AND folderGuid='{$folderGuid}'"); $rowset = $db->fetchAll(Zend_Db::FETCH_OBJ); $solrAdapter = Kutu_Search::factory('solr', array('host' => 'localhost', 'port' => '8983', 'homedir' => '/solr/core0')); $numi = count($rowset); $sSolr = "id:("; for ($i = 0; $i < $numi; $i++) { $row = $rowset[$i]; $sSolr .= $row->guid . ' '; } $sSolr .= ')'; if (!$numi) { $sSolr = "id:(hfgjhfdfka)"; } $start = 0; $a['totalCount'] = $numi; $limit = 20; $a['limit'] = $limit; $solrResult = $solrAdapter->findAndSort($sSolr, $start, $limit, array('regulationOrder asc')); $solrNumFound = $solrResult->response->numFound; //die('hi'.$solrNumFound); } $ii = 0; //for($i=$start;$i<($limit+$start);$i++) if ($solrNumFound == 0) { $a['catalogs'][0]['guid'] = 'XXX'; $a['catalogs'][0]['title'] = "No Data"; $a['catalogs'][0]['subTitle'] = ""; $a['catalogs'][0]['createdDate'] = ''; $a['catalogs'][$ii]['modifiedDate'] = ''; } else { if ($solrNumFound > $limit) { $numRowset = $limit; } else { $numRowset = $solrNumFound; } for ($ii = 0; $ii < $numRowset; $ii++) { $row = $solrResult->response->docs[$ii]; $a['catalogs'][$ii]['guid'] = $row->id; $a['catalogs'][$ii]['title'] = $row->title; $a['catalogs'][$ii]['subTitle'] = $row->subTitle; $a['catalogs'][$ii]['createdDate'] = $row->createdDate; $a['catalogs'][$ii]['modifiedDate'] = $row->modifiedDate; } } $this->view->aData = $a; //$sNav = $this->renderNavigation($a['totalCount'], $limit); $time_end = microtime(true); $time = $time_end - $time_start; echo '<br>WAKTU EKSEKUSI: ' . $time; }
public static function manager() { $registry = Zend_Registry::getInstance(); $conf = $registry->get('config'); return Kutu_Search::factory(strtolower($conf->indexing->engine), array('host' => $conf->indexing->adapter->param->host, "port" => $conf->indexing->adapter->param->port, "homedir" => $conf->indexing->adapter->param->dir)); }
function viewResultAction() { $time_start = microtime(true); $query = $this->_getParam('query') ? $this->_getParam('query') : ''; $keys = $this->_getParam('keys') ? $this->_getParam('keys') : ''; switch ($keys) { case 'title': $query = 'title:' . $query; break; case 'number': $query = 'number:' . $query; break; case 'judge': $query = 'judge:' . $query; break; case 'subtitle': $query = 'subtitle:' . $query; break; case 'year': $query = 'year:' . $query; break; default: $query = $query; } $a = array(); $a['query'] = $query; $indexingEngine = Kutu_Search::manager(); $hits = $indexingEngine->find($query); $paginator = Zend_Paginator::factory($hits); $paginator->setCurrentPageNumber($page); $paginator->setItemCountPerPage(20); $this->view->hits = $paginator; /* $num = $hits->response->numFound; $limit = 20; $a['totalCount'] = $num; $a['limit'] = $limit; $ii=0; if($a['totalCount']==0) { $a['catalogs'][0]['guid']= 'XXX'; $a['catalogs'][0]['title']= "No Data"; $a['catalogs'][0]['subTitle']= ""; $a['catalogs'][0]['createdDate']= ''; $a['catalogs'][0]['modifiedDate']= ''; } $this->view->aData = $a; $this->view->query = $query; $this->view->hits = $hits; $time_end = microtime(true); $time = $time_end - $time_start; // echo'<br>WAKTU EKSEKUSI: '. $time; $this->view->time = round($time,2); */ }
protected function _postDelete() { //find related docs and delete them $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $rowsetRelatedDocs = $tblRelatedItem->fetchAll("relatedGuid='{$this->guid}' AND relateAs='RELATED_FILE'"); if (count($rowsetRelatedDocs)) { foreach ($rowsetRelatedDocs as $rowRelatedDoc) { $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $rowCatalog = $tblCatalog->find($rowRelatedDoc->itemGuid)->current(); $rowCatalog->delete(); } } if ($this->profileGuid == 'kutu_doc') { //get parentGuid $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $rowsetRelatedItem = $tblRelatedItem->fetchAll("itemGuid='{$this->guid}' AND relateAs='RELATED_FILE'"); if (count($rowsetRelatedItem)) { foreach ($rowsetRelatedItem as $rowRelatedItem) { //must delete the physical files $rowsetCatAtt = $this->findDependentRowsetCatalogAttribute(); $systemname = $rowsetCatAtt->findByAttributeGuid('docSystemName')->value; $parentGuid = $rowRelatedItem->relatedGuid; $sDir1 = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . $systemname; $sDir2 = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . $parentGuid . DIRECTORY_SEPARATOR . $systemname; if (file_exists($sDir1)) { //delete file unlink($sDir1); } else { if (file_exists($sDir2)) { //delete file unlink($sDir2); } } } } } //delete from table CatalogAttribute $tblCatalogAttribute = new Kutu_Core_Orm_Table_CatalogAttribute(); $tblCatalogAttribute->delete("catalogGuid='{$this->guid}'"); //delete catalogGuid from table CatalogFolder $tblCatalogFolder = new Kutu_Core_Orm_Table_CatalogFolder(); $tblCatalogFolder->delete("catalogGuid='{$this->guid}'"); //delete guid from table AssetSetting $tblAssetSetting = new Kutu_Core_Orm_Table_AssetSetting(); $tblAssetSetting->delete("guid='{$this->guid}'"); //delete from table relatedItem $tblRelatedItem = new Kutu_Core_Orm_Table_RelatedItem(); $tblRelatedItem->delete("itemGuid='{$this->guid}'"); $tblRelatedItem->delete("relatedGuid='{$this->guid}'"); //delete physical catalog folder from uploads/files/[catalogGuid] $sDir = KUTU_ROOT_DIR . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . $this->guid; try { if (is_dir($sDir)) { rmdir($sDir); } } catch (Exception $e) { } //delete from index try { $indexingEngine = Kutu_Search::manager(); $indexingEngine->deleteCatalogFromIndex($this->guid); } catch (Exception $e) { } //delete from ACL }
public function searchAction() { //$this->_helper->layout()->setLayout('layout-iht'); $r = $this->getRequest(); $query = $r->getQuery(); if (empty($query)) { // no parameters passed in query string if (!empty($_SESSION['sQuery'])) { $sQuery = $_SESSION['sQuery']; } else { $sQuery = 'xxyyzz'; } } else { $sQuery = $r->getParam('sQuery'); if (empty($sQuery)) { $sQuery = 'xxyyzz'; } $_SESSION['sQuery'] = $sQuery; } $this->view->sQuery = $sQuery; //Get ready ZEND paginator $limit = $r->getParam('limit') ? $r->getParam('limit') : 10; $this->view->limit = $limit; $currentPage = $this->_getParam('page', 1); $sort = $r->getParam('sort') ? $r->getParam('sort') : "createdDate desc"; //"regulationType desc, year desc"; $this->view->sort = $sort; //---- $indexingEngine = Kutu_Search::manager(); $offset = ($currentPage - 1) * $limit; $hits = $indexingEngine->find($sQuery, $offset, $limit); $this->view->hits = $hits; $bpm = new Kutu_Core_Bpm_Catalog(); $this->view->bpm = $bpm; //ZEND PAGINATOR $adapter = new Zend_Paginator_Adapter_Null($hits->response->numFound); $paginator = new Zend_Paginator($adapter); $paginator->setCurrentPageNumber($currentPage); $paginator->setItemCountPerPage($limit); $this->view->paginator = $paginator; }
public function searchFolderAction() { $this->view->pageTitle = "Search Folder"; $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY'); //$sessHistory->relatedGuid = ($this->_getParam('relatedGuid'))? $this->_getParam('relatedGuid') : $sessHistory->relatedGuid; //$this->view->relatedGuid = $sessHistory->relatedGuid; //echo "related: ".$this->view->relatedGuid; $r = $this->getRequest(); $sQuery = $r->getParam('sQuery') ? $r->getParam('sQuery') : ''; $this->view->sQuery = $sQuery; $sOffset = $r->getParam('sOffset'); $this->view->sOffset = $sOffset; $sLimit = $r->getParam('sLimit'); $this->view->sLimit = $sLimit; $indexingEngine = Kutu_Search::manager(); if (empty($sQuery)) { $hits = array(); } else { $sQuery1 = str_replace(' ', '%', $sQuery); $db = Zend_Db_Table::getDefaultAdapter()->query("select * from KutuFolder where title LIKE '%{$sQuery1}%'"); $rowset = $db->fetchAll(Zend_Db::FETCH_OBJ); $hits = $rowset; } $this->view->hits = $hits; $modDir = $this->getFrontController()->getModuleDirectory(); require_once $modDir . '/components/Dms/FolderBreadcrumbs.php'; }