コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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();
 }
コード例 #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');
     }
 }
コード例 #5
0
 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());
     }
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 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());
     }
 }
コード例 #8
0
 public static function getContext()
 {
     return MApp::getContext();
 }
コード例 #9
0
ファイル: MHandler.php プロジェクト: elymatos/expressive_fnbr
 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();
     }
 }
コード例 #10
0
ファイル: _MBase.php プロジェクト: elymatos/expressive
 public function getService($service, $module = '')
 {
     $service = MApp::getService(Manager::getApp(), $module == '' ? Manager::getModule() : $module, $service);
     $service->setData();
     return $service;
 }
コード例 #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());
     }
 }
コード例 #12
0
 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());
     }
 }
コード例 #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.");
     }
 }
コード例 #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());
     }
 }
コード例 #15
0
 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());
     }
 }