public function modelTree()
 {
     $structure = MApp::getService('fnbr20', '', 'structurelayergroup');
     if ($this->data->id == '') {
         $children = $structure->listAll($this->data, $this->idLanguage);
         $data = (object) ['id' => 'root', 'state' => 'open', 'text' => 'Layer Groups', 'children' => $children];
         $json = json_encode([$data]);
     }
     $this->renderJson($json);
 }
 public function frameTree()
 {
     $grapher = MApp::getService('fnbr20', '', 'grapher');
     if ($this->data->id == '') {
         $children = $grapher->listFrames($this->data, $this->idLanguage);
         $data = (object) ['id' => 'root', 'state' => 'open', 'text' => 'Frames', 'children' => $children];
         $json = json_encode([$data]);
     }
     $this->renderJson($json);
 }
 public function showFrame()
 {
     $idFrame = $this->data->id;
     $report = MApp::getService('fnbr20', '', 'reportframe');
     $frame = new Frame($idFrame);
     $this->data->frame->entry = $frame->getEntryObject();
     $this->data->fe = $report->getFEData($idFrame);
     $this->data->frame->entry->description = $report->decorate($this->data->frame->entry->description, $this->data->fe['styles']);
     $this->data->relations = $report->getRelations($frame);
     $this->render();
 }
Esempio n. 4
0
 public function saveCERelation()
 {
     $isMaster = Manager::checkAccess('MASTER', A_EXECUTE);
     $editor = MApp::getService('fnbr20', '', 'visualeditor');
     if ($isMaster) {
         $editor->updateCERelation($this->data->graphceJson);
         $editor->deleteCERelation($this->data->linksceRemoved);
         $this->renderPrompt('info', 'Ok');
     } else {
         $this->renderPrompt('error', 'Error');
     }
 }
 public function exportFrames()
 {
     try {
         $service = MApp::getService('fnbr20', '', 'data');
         $json = $service->exportFramesToJSON($this->data->gridExportFrames->data->checked);
         $fileName = $this->data->fileName . '.json';
         $mfile = MFile::file($json, false, $fileName);
         $this->renderFile($mfile);
     } catch (EMException $e) {
         $this->renderPrompt('error', $e->getMessage());
     }
 }
 public function corpusTree()
 {
     $structure = MApp::getService('fnbr20', '', 'structurecorpus');
     if ($this->data->id == '') {
         $children = $structure->listCorpus($this->data, $this->idLanguage);
         $data = (object) ['id' => 'root', 'state' => 'open', 'text' => 'Corpus', 'children' => $children];
         $json = json_encode([$data]);
     } elseif ($this->data->id[0] == 'c') {
         $json = json_encode($structure->listDocuments(substr($this->data->id, 1), $this->idLanguage));
     }
     $this->renderJson($json);
 }
 public function importFrames()
 {
     try {
         $service = MApp::getService('fnbr20', '', 'data');
         $files = \Maestro\Utils\Mutil::parseFiles('uploadFile');
         $json = file_get_contents($files[0]->getTmpName());
         $service->importFramesFromJSON($json);
         $this->renderPrompt('information', 'OK');
     } catch (EMException $e) {
         $this->renderPrompt('error', $e->getMessage());
     }
 }
Esempio n. 8
0
 public static function getContext()
 {
     return MApp::getContext();
 }
Esempio n. 9
0
 public function execute()
 {
     // registra, carrega e processa os filtros
     $filters = Manager::getConf('maestro.filters');
     if (is_array($filters)) {
         foreach ($filters as $filter) {
             $filterInstance = MApp::getFilter($this, $filter);
             $filterInstance->preProcess();
         }
     }
     // se a execução não foi cancelada pelos filtros
     if ($this->canCallHandler()) {
         $this->invoke();
     }
     // executa o pos-processamento dos filtros indicados em conf.php
     foreach (Manager::$filters as $filter) {
         $filter[1]->postProcess();
     }
 }
Esempio n. 10
0
 public function getService($service, $module = '')
 {
     $service = MApp::getService(Manager::getApp(), $module == '' ? Manager::getModule() : $module, $service);
     $service->setData();
     return $service;
 }
Esempio n. 11
0
 public function deleteFrame()
 {
     try {
         $structure = MApp::getService('fnbr20', '', 'structureframe');
         $structure->deleteFrame($this->data->id);
         $this->renderResponse('information', 'OK', "!structure.reloadFrame();");
     } catch (\Exception $e) {
         $this->renderResponse('error', $e->getMessage());
     }
 }
 public function delEntitySemanticType()
 {
     try {
         $structure = MApp::getService('fnbr20', '', 'structuresemantictype');
         $structure->delEntitySemanticType($this->data->idEntity, $this->data->toRemove);
         $this->renderPrompt('information', "Ok", "\$('#{$this->data->idGrid}').datagrid('reload');");
     } catch (\Exception $e) {
         $this->renderPrompt('error', $e->getMessage());
     }
 }
Esempio n. 13
0
 public function deleteCxn()
 {
     try {
         $structure = MApp::getService('fnbr20', '', 'structurecxn');
         $structure->deleteCxn($this->data->id);
         $this->renderPrompt('information', 'Cxn deleted.');
     } catch (\Exception $e) {
         $this->renderPrompt('error', "Não é possível remover esta construção.");
     }
 }
Esempio n. 14
0
 public function changeStatusAS()
 {
     try {
         $annotation = MApp::getService('fnbr20', '', 'annotation');
         $as = json_decode($this->data->asToChange);
         $annotation->changeStatusAS($as, $this->data->asNewStatus);
         $this->renderPrompt('information', 'ok', "!annotation.showSubCorpus(annotation.idSubCorpus)");
     } catch (\Exception $e) {
         $this->renderPrompt('error', $e->getMessage());
     }
 }
 public function formDeleteTemplate()
 {
     try {
         $structure = MApp::getService('fnbr20', '', 'structuretemplate');
         $structure->deleteTemplate($this->data->id);
         $this->renderPrompt('information', 'Template deleted.', "\$('#templatesTree').tree('reload');");
     } catch (\Exception $e) {
         mdump($e->getMessage());
         $this->renderPrompt('error', $e->getMessage());
     }
 }