Mercurial > hg > extraction-interface
comparison controllers/extractapp.php @ 67:3ada9334ebfc extractapp
New: check taglist is deprecated or not
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Tue, 07 Apr 2015 14:45:31 +0200 |
| parents | 3395385476d1 |
| children | edb8a2e8ce84 |
comparison
equal
deleted
inserted
replaced
| 66:e71a437ae49f | 67:3ada9334ebfc |
|---|---|
| 12 parent::__construct($action, $urlvalues, $postdata); | 12 parent::__construct($action, $urlvalues, $postdata); |
| 13 $this->viewmodel = new ExtractappModel(); | 13 $this->viewmodel = new ExtractappModel(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 protected function TaggingText() { | 16 protected function TaggingText() { |
| 17 //$viewmodel = new ExtractappModel(); | |
| 18 $viewmodel = $this->viewmodel; | 17 $viewmodel = $this->viewmodel; |
| 19 | 18 |
| 20 switch ($this->postdata['func']) { | 19 switch ($this->postdata['func']) { |
| 21 case 'SaveFullText': | 20 case 'SaveFullText': |
| 22 $viewmodel->SaveFullText($this->postdata); | 21 $viewmodel->SaveFullText($this->postdata); |
| 58 default: // first time visit extraction interface from LGService | 57 default: // first time visit extraction interface from LGService |
| 59 $viewmodel->messages['info'] .= "Welcome to Extraction Interface. "; | 58 $viewmodel->messages['info'] .= "Welcome to Extraction Interface. "; |
| 60 | 59 |
| 61 if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) { | 60 if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) { |
| 62 // --- Existing branch case --- | 61 // --- Existing branch case --- |
| 63 // get text from fileId, from LGService | |
| 64 $viewmodel->GetInfoFromPreviousPage($this->postdata); | 62 $viewmodel->GetInfoFromPreviousPage($this->postdata); |
| 63 // get text by fileId, from LGService | |
| 65 $viewmodel->GetTextFromFileId(); | 64 $viewmodel->GetTextFromFileId(); |
| 66 | 65 |
| 67 } else if ($this->postdata['sectionId'] != 0 && $this->postdata['userId'] != 0) { | 66 } else if ($this->postdata['sectionId'] != 0 && $this->postdata['userId'] != 0) { |
| 68 // --- New branch case --- | 67 // --- New branch case --- |
| 69 // get text from sectionId from LGService | |
| 70 $viewmodel->GetInfoFromPreviousPage($this->postdata); | 68 $viewmodel->GetInfoFromPreviousPage($this->postdata); |
| 71 $viewmodel->GetBookMetaData($this->postdata); | 69 $viewmodel->GetBookMetaDataBySectionId(); |
| 70 // get text by sectionId from LGService | |
| 72 $viewmodel->GetTextFromSectionId(); | 71 $viewmodel->GetTextFromSectionId(); |
| 73 | 72 |
| 74 } else if ($this->postdata['sectionId'] != 0) { | 73 } else if ($this->postdata['sectionId'] != 0) { |
| 75 $viewmodel->GetTextFromLocal($this->postdata['sectionId']); | 74 $viewmodel->GetTextFromLocal($this->postdata['sectionId']); |
| 76 | 75 |
| 92 | 91 |
| 93 | 92 |
| 94 } | 93 } |
| 95 | 94 |
| 96 protected function ExportTable() { | 95 protected function ExportTable() { |
| 97 //$viewmodel = new ExtractappModel(); | |
| 98 $viewmodel = $this->viewmodel; | 96 $viewmodel = $this->viewmodel; |
| 99 $this->ReturnView($viewmodel->ExportTable($this->postdata), true); | 97 $this->ReturnView($viewmodel->ExportTable($this->postdata), true); |
| 100 | 98 |
| 101 } | 99 } |
| 102 | 100 |
| 103 protected function EditWordlist() { | 101 protected function EditWordlist() { |
| 104 // $viewmodel = new ExtractappModel(); | |
| 105 $viewmodel = $this->viewmodel; | 102 $viewmodel = $this->viewmodel; |
| 106 switch ($this->postdata['func']) { | 103 switch ($this->postdata['func']) { |
| 107 case 'AddNewList': | 104 case 'AddNewList': |
| 108 $this->ReturnView($viewmodel->AddNewList($this->postdata), true); | 105 $this->ReturnView($viewmodel->AddNewList($this->postdata), true); |
| 109 break; | 106 break; |
| 117 } | 114 } |
| 118 } | 115 } |
| 119 | 116 |
| 120 | 117 |
| 121 protected function EditTaglist() { | 118 protected function EditTaglist() { |
| 122 //$viewmodel = new ExtractappModel(); | |
| 123 $viewmodel = $this->viewmodel; | 119 $viewmodel = $this->viewmodel; |
| 124 switch ($this->postdata['func']) { | 120 switch ($this->postdata['func']) { |
| 125 case 'NewTagElement': | 121 case 'NewTagElement': |
| 126 $this->ReturnView($viewmodel->NewTagElement($this->postdata), true); | 122 $this->ReturnView($viewmodel->NewTagElement($this->postdata), true); |
| 127 break; | 123 break; |
| 137 } | 133 } |
| 138 } | 134 } |
| 139 | 135 |
| 140 | 136 |
| 141 protected function ConfigTagsInTopic() { | 137 protected function ConfigTagsInTopic() { |
| 142 //$viewmodel = new ExtractappModel(); | |
| 143 $viewmodel = $this->viewmodel; | 138 $viewmodel = $this->viewmodel; |
| 144 switch ($this->postdata['func']) { | 139 switch ($this->postdata['func']) { |
| 145 case 'Update': | 140 case 'Update': |
| 146 $viewmodel->UpdateTagsInTopic($this->postdata); | 141 $viewmodel->UpdateTagsInTopic($this->postdata); |
| 147 break; | 142 break; |
| 150 break; | 145 break; |
| 151 } | 146 } |
| 152 } | 147 } |
| 153 | 148 |
| 154 protected function TestAction() { | 149 protected function TestAction() { |
| 155 $viewmodel = new ExtractappModel(); | |
| 156 $this->ReturnView($viewmodel->Test(), true); | 150 $this->ReturnView($viewmodel->Test(), true); |
| 157 } | 151 } |
| 158 | 152 |
| 159 | 153 |
| 160 | 154 |
