comparison develop/controllers/extractapp.php @ 13:cc36a20a68ab

automatically decide which rows (what data) should be shown in the exporting table based on the topic.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 17 Feb 2015 15:25:11 +0100
parents e82ca7375e93
children ac77748bb813
comparison
equal deleted inserted replaced
12:e82ca7375e93 13:cc36a20a68ab
25 case 'SaveFullTextToLGService': 25 case 'SaveFullTextToLGService':
26 echo "[Z] SaveFullTextToLGService! "; 26 echo "[Z] SaveFullTextToLGService! ";
27 $viewmodel->GetInfoFromPreviousPage($this->postdata); 27 $viewmodel->GetInfoFromPreviousPage($this->postdata);
28 $response = $viewmodel->SaveFullTextToLGService($this->postdata); 28 $response = $viewmodel->SaveFullTextToLGService($this->postdata);
29 29
30 $viewmodel->UpdateInfoByResonseFromLGService($response); // update file_id, branch_id, user_id 30 $viewmodel->UpdateInfoByResponseFromLGService($response); // update file_id, branch_id, user_id
31 31
32 $this->ReturnView($viewmodel->StartTagging(), false); 32 $this->ReturnView($viewmodel->StartTagging(), false);
33 break; 33 break;
34 34
35 case 'ContinueTagging': 35 case 'ContinueTagging':
45 echo "[Z] Welcome to Extraction Interface. "; 45 echo "[Z] Welcome to Extraction Interface. ";
46 46
47 if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) { 47 if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) {
48 // get text from fileId, from LGService 48 // get text from fileId, from LGService
49 $viewmodel->GetTextFromFileId($this->postdata); 49 $viewmodel->GetTextFromFileId($this->postdata);
50 } else if ($this->postdata['sectionId'] != 0) { 50 } else if ($this->postdata['sectionId'] != 0 && $this->postdata['userId'] != 0) {
51 // get text from sectionId from LGService 51 // get text from sectionId from LGService
52 $viewmodel->GetTextFromSectionId($this->postdata); 52 $viewmodel->GetTextFromSectionId($this->postdata);
53 } else if ($this->postdata['sectionId'] != 0) {
54 $viewmodel->GetTextFromLocal($this->postdata['sectionId']);
55
53 } else if (is_numeric($this->urlvalues['id'])) { 56 } else if (is_numeric($this->urlvalues['id'])) {
54 // get text from local file system (for development stage only) 57 // get text from local file system (for development stage only)
55 $viewmodel->GetTextFromLocal($this->urlvalues['id']); 58 $viewmodel->GetTextFromLocal($this->urlvalues['id']);
56 59
57 // $this->ReturnView($viewmodel->StartTagging($this->urlvalues), false);
58 } else { 60 } else {
61 var_dump($this->postdata);
62
59 echo "wrong url!!"; 63 echo "wrong url!!";
60 return; 64 return;
61 } 65 }
62 66
63 $this->ReturnView($viewmodel->StartTagging(), false); 67 $this->ReturnView($viewmodel->StartTagging(), false);
69 } 73 }
70 74
71 protected function ExportTable() { 75 protected function ExportTable() {
72 //$viewmodel = new ExtractappModel(); 76 //$viewmodel = new ExtractappModel();
73 $viewmodel = $this->viewmodel; 77 $viewmodel = $this->viewmodel;
74 $this->ReturnView($viewmodel->ExportTable($this->urlvalues, $this->postdata), false); 78 $this->ReturnView($viewmodel->ExportTable($this->postdata), false);
75 79
76 } 80 }
77 81
78 protected function EditWordlist() { 82 protected function EditWordlist() {
79 // $viewmodel = new ExtractappModel(); 83 // $viewmodel = new ExtractappModel();