/** * Akce vracející data description a konfiguraci pro EasyMiner UI * @param int $id_dm * @param int $miner * @throws ForbiddenRequestException */ public function actionGetData($id_dm, $miner) { if (empty($miner)) { $miner = $id_dm; } //------------------------------------------------------------------------------------------------------------------ $miner = $this->findMinerWithCheckAccess($miner); $minerType = $miner->type; $FLPathElement = 'FLPath_' . Strings::upper($minerType); //------------------------------------------------------------------------------------------------------------------ #region připravení informací pro UI - s odděleným připravením DataDictionary $dataDescriptionPMML = null; $dataParser = new DataParser($dataDescriptionPMML, $this->config->{$FLPathElement}, $this->config->FGCPath, null, null, $this->translator->getLang()); $dataParser->loadData(); $responseContent = $dataParser->parseData(); $user = $this->getCurrentUser(); $responseContent['DD'] = ['dataDictionary' => $this->datasourcesFacade->exportDataDictionaryArr($miner->datasource, $user, $rowsCount), 'transformationDictionary' => $this->metasourcesFacade->exportTransformationDictionaryArr($miner->metasource, $user), 'recordCount' => $rowsCount]; #endregion připravení informací pro UI - s odděleným připravením DataDictionary uksort($responseContent['DD']['transformationDictionary'], function ($a, $b) { return strnatcasecmp($a, $b); }); uksort($responseContent['DD']['dataDictionary'], function ($a, $b) { return strnatcasecmp($a, $b); //return strnatcasecmp(mb_strtolower($a,'utf-8'),mb_strtolower($b,'utf-8')); }); $responseContent['status'] = 'ok'; $responseContent['miner_type'] = $miner->type; $responseContent['miner_name'] = $miner->name; if ($miner->ruleSet) { $ruleSet = $miner->ruleSet; } else { $ruleSet = $this->ruleSetsFacade->saveNewRuleSetForUser($miner->name, $this->getCurrentUser()); $miner->ruleSet = $ruleSet; $this->minersFacade->saveMiner($miner); } $responseContent['miner_ruleset'] = ['id' => $ruleSet->ruleSetId, 'name' => $ruleSet->name]; $responseContent['miner_config'] = $miner->getExternalConfig(); $this->sendJsonResponse($responseContent); }