params=$params; $this->handler = new onto_handler($ontology_filepath, $onto_store, $onto_store_config, $data_store_type, $data_store_config, $tab_namespaces, $default_display_label); $this->handler->get_ontology(); if(!isset($params->sub) || !$params->sub){ $params->sub=$this->handler->get_first_ontology_class_name(); } $controler_class_name=self::resolve_controler_class_name($this->handler->get_onto_name()); $this->controler=new $controler_class_name($this->handler,$this->params); } public function proceed(){ return $this->controler->proceed(); } /** * * Renvoi le nom de la class controler à utiliser pour l'ontologie * * @return string */ public static function resolve_controler_class_name($ontology_name){ return self::search_controler_class_name($ontology_name); } /** * * Recherche et renvoi le nom de classe controler le plus approprié pour l'ontologie * * @param string $ontology_name * @return string */ public static function search_controler_class_name($ontology_name){ $suffixe = "_controler"; $prefix="onto_"; if(class_exists($prefix.$ontology_name.$suffixe)){ //La classe controler a le même nom que l'ontologie //ex : onto_skos<=>onto_skos_controler return $prefix.$ontology_name.$suffixe; }else{ return $prefix.'common'.$suffixe; } return false; } }