annotate develop/controllers/extractapp.php @ 29:fc7342914cdf

develop_v0
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Thu, 05 Mar 2015 15:08:09 +0100
parents e6e9bdc4f256
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
2
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 class Extractapp extends BaseController {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
4 protected function Index() {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 $viewmodel = new ExtractappModel();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
6 $this->ReturnView($viewmodel->Index(), true);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
7 }
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
8 protected $viewmodel;
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
9
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
10
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
11 public function __construct($action, $urlvalues, $postdata){
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
12 parent::__construct($action, $urlvalues, $postdata);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
13 $this->viewmodel = new ExtractappModel();
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
14 }
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
15
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 protected function TaggingText() {
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
17 //$viewmodel = new ExtractappModel();
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
18 $viewmodel = $this->viewmodel;
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
19
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
20 switch ($this->postdata['func']) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 case 'SaveFullText':
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
22 $viewmodel->SaveFullText($this->postdata);
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
23 $this->ReturnView($viewmodel->StartTagging(), true);
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 6
diff changeset
24 break;
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
25 case 'SaveFullTextToLGService':
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 19
diff changeset
26 $viewmodel->messages .= "SaveFullTextToLGService! "."<br>";
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
27 $viewmodel->GetInfoFromPreviousPage($this->postdata);
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
28 $response = $viewmodel->SaveFullTextToLGService($this->postdata);
13
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
29 $viewmodel->UpdateInfoByResponseFromLGService($response); // update file_id, branch_id, user_id
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
30 $this->ReturnView($viewmodel->StartTagging(), true);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
31 break;
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
32
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
33 case 'SmartRegexLoad':
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
34 $viewmodel->SmartRegexLoad($this->postdata['topic_id']);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
35 break;
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
36 case 'SmartRegexSave':
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
37 $viewmodel->SmartRegexSave($this->postdata);
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
38 break;
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 25
diff changeset
39 case 'Reload':
29
fc7342914cdf develop_v0
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 28
diff changeset
40 // $viewmodel->Reload();
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 25
diff changeset
41 break;
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
42
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
43 case 'ContinueTagging':
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 19
diff changeset
44 $viewmodel->messages .= "(Countinue tagging) "."<br>";
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 6
diff changeset
45 if ($this->postdata['topic']) {
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 6
diff changeset
46 $viewmodel->SetTopic($this->postdata['topic']);
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 6
diff changeset
47 }
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
48 $viewmodel->GetInfoFromPreviousPage($this->postdata);
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
49 $this->ReturnView($viewmodel->StartTagging(), true);
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
50 break;
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
51
28
e6e9bdc4f256 update the saving response from LGService between different file version
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 25
diff changeset
52
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
53 default: // first time visit extraction interface from LGService
21
c805470cefee Remove bootstrap.TaggingText UI layout modification
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 19
diff changeset
54 $viewmodel->messages .= "Welcome to Extraction Interface. "."<br>";
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
55
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
56 if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) {
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
57 // get text from fileId, from LGService
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
58 $viewmodel->GetTextFromFileId($this->postdata);
13
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
59 } else if ($this->postdata['sectionId'] != 0 && $this->postdata['userId'] != 0) {
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
60 // get text from sectionId from LGService
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
61 $viewmodel->GetTextFromSectionId($this->postdata);
13
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
62 } else if ($this->postdata['sectionId'] != 0) {
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
63 $viewmodel->GetTextFromLocal($this->postdata['sectionId']);
cc36a20a68ab automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 12
diff changeset
64
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
65 } else if (is_numeric($this->urlvalues['id'])) {
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
66 // get text from local file system (for development stage only)
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
67 $viewmodel->GetTextFromLocal($this->urlvalues['id']);
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
68 $this->ReturnView_localtest($viewmodel->StartTagging(), true);
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
69 break;
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
70
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
71 } else {
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
72 $viewmodel->messages .= "wrong url!!";
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
73 return;
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
74 }
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
75
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
76 $this->ReturnView($viewmodel->StartTagging(), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
77 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
78 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
79
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
80
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
81
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
82 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
83
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
84 protected function ExportTable() {
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
85 //$viewmodel = new ExtractappModel();
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
86 $viewmodel = $this->viewmodel;
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
87 $this->ReturnView($viewmodel->ExportTable($this->postdata), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
88
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
89 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
90
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
91 protected function EditWordlist() {
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
92 // $viewmodel = new ExtractappModel();
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
93 $viewmodel = $this->viewmodel;
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
94 switch ($this->postdata['func']) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
95 case 'AddNewList':
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
96 $this->ReturnView($viewmodel->AddNewList($this->postdata), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
97 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
98 case 'SaveWordlist':
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
99 $this->ReturnView($viewmodel->SaveWordlist($this->postdata), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
100 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
101 default: // EditWordlist
16
fb948097de39 fix bug: Edittaglist is working on Firefox.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
102
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
103 $this->ReturnView($viewmodel->EditWordlist(), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
104 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
105 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
106 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
107
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
108
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
109 protected function EditTaglist() {
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
110 //$viewmodel = new ExtractappModel();
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
111 $viewmodel = $this->viewmodel;
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
112 switch ($this->postdata['func']) {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
113 case 'NewTagElement':
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
114 $this->ReturnView($viewmodel->NewTagElement($this->postdata), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
115 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
116 case 'SaveTagElement':
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
117 $this->ReturnView($viewmodel->SaveTagElement($this->postdata), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
118 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
119 case 'DeleteTag':
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
120 $this->ReturnView($viewmodel->DeleteTag($this->postdata), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
121 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
122 default: // EditTaglist
17
82f8c6bd2b69 add new tag will based on the current topic_id, insert new element into (1)taglist table and (2)topic_tag_relation table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 16
diff changeset
123 $this->ReturnView($viewmodel->EditTaglist($this->postdata), true);
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
124 break;
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
125 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
126 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
127
10
54a235d43694 add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 6
diff changeset
128
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
129 protected function ConfigTagsInTopic() {
12
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
130 //$viewmodel = new ExtractappModel();
e82ca7375e93 Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
131 $viewmodel = $this->viewmodel;
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
132 switch ($this->postdata['func']) {
19
f60969462226 save tag modification of topic configration into topic_tag_relation table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
133 case 'Update':
f60969462226 save tag modification of topic configration into topic_tag_relation table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
134 $viewmodel->UpdateTagsInTopic($this->postdata);
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
135 break;
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
136 default:
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
137 $this->ReturnView($viewmodel->ConfigTagsInTopic($this->postdata), true);
19
f60969462226 save tag modification of topic configration into topic_tag_relation table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 17
diff changeset
138 break;
11
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
139 }
3d6fba07bfbd implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 10
diff changeset
140 }
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
141
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
142 protected function TestAction() {
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
143 $viewmodel = new ExtractappModel();
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
144 $this->ReturnView($viewmodel->Test(), true);
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
145 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
146
14
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
147
ac77748bb813 - Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 13
diff changeset
148
6
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
149
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
150 }
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
151
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
152
63e08b98032f rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
153 ?>