/** * Redesign the content of the body you will index * * @param string $content The filename you want to index * * @return string */ function getIndexableBody($content) { $body = " "; if (substr($this->file_type, 0, 6) == 'image/') { $body = $this->file_name; } else { switch ($this->file_type) { case 'text/osoft': $body = $this->getBinaryContent(); $osoft_histo = new COsoftHistorique(false); $body = $osoft_histo->toHTML($body); $body = strip_tags($body); break; case 'application/osoft': $body = $this->getBinaryContent(); $osoft_dossier = new COsoftDossier(false); $body = $osoft_dossier->toHTML($body); $body = strip_tags($body); break; default: $wrapper = new CSearchFileWrapper($content, $this->_id); $body = $wrapper->run(); } } return $body; }
} catch (Exception $e) { $infos_index = array(); CAppUI::displayAjaxMsg("Le serveur de recherche n'est pas connecté", UI_MSG_WARNING); } try { // récupération des données pour les journaux utilisateurs $client_log = new CSearchLog(); $client_log->createClient(); $infos_log = $client_log->loadCartoInfos(); } catch (Exception $e) { $infos_log = array(); CAppUI::displayAjaxMsg("Le serveur de recherche de journaux n'est pas connecté", UI_MSG_WARNING); } try { // récupération des données pour les journaux utilisateurs $wrapper = new CSearchFileWrapper(null, null); $infos_tika = $wrapper->loadTikaInfos(); } catch (Exception $e) { mbLog($e); $infos_tika = ""; CAppUI::displayAjaxMsg("Le serveur d'extraction de fichiers n'est pas connecté", UI_MSG_WARNING); } $ds = CSQLDataSource::get("std"); $query = "SELECT MIN(`date`) AS oldest_datetime FROM `search_indexing`"; $result = $ds->exec($query); $oldest_datetime = $ds->fetchObject($result)->oldest_datetime; // Création du template $smarty = new CSmartyDP(); $smarty->assign("infos_index", $infos_index); $smarty->assign("infos_log", $infos_log); $smarty->assign("infos_tika", $infos_tika);