diff controllers/extractapp.php @ 78:960ba96efce1 extractapp

Update: click to popup remove-tag-window; select to popup tag-window
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 20 Apr 2015 15:44:54 +0200
parents 97c1e5102a22
children f1f849d31272
line wrap: on
line diff
--- a/controllers/extractapp.php	Thu Apr 16 14:53:22 2015 +0200
+++ b/controllers/extractapp.php	Mon Apr 20 15:44:54 2015 +0200
@@ -1,17 +1,15 @@
 <?php
 /** 
-    * Extractapp is extended from the BaseController.
-    * This is where we handle the processes for every action.
-    * 
-    * For example, there are five actions in Extractapp, tagging text, exporting a table,
-    * editing the wordlist, and configurating tags in one topic.
-**/
+ * Extractapp is extended from the BaseController.
+ * This is where we handle the processes for every action.
+ * 
+ * For example, there are five actions in Extractapp, tagging text, exporting a table,
+ * editing the wordlist, and configurating tags in one topic.
+*/
 
 class Extractapp extends BaseController {
-	protected function Index() {
-		$viewmodel = new ExtractappModel();
-        $this->ReturnView($viewmodel->Index(), true);
-	}
+	
+
     protected $viewmodel;
 
        
@@ -22,19 +20,19 @@
 
     protected function TaggingText() {
         /**
-            * TaggingText action in Extractapp handles the taging related actions, for example, 
-            * tagging itself, saving tag results, loading and saving regular expression for tagging.
-            * They are handled by 'func' variable in postdata, which could come from LGService or from extraction-interface application itself.
-            *
-            * From LGService, the postdata contains essential information about the file/section of local gazetteers data.
-            * This happens when user entering to extraction-interface the first time, or after s/he saved her/is tagging results to LGService.
-            * (default one, SaveFullTextToLGService, SmartRegexLoad, SmartRegexSave case)
-            * 
-            * From extraction-interface itself, it contains the information from previous page.
-            * This happens when user choosing another topic in the extraction-interface, 
-            * the page need to retrieve related information from database for the topic.
-            * (ContinueTagging case)
-        */
+         * TaggingText action in Extractapp handles the taging related actions, for example, 
+         * tagging itself, saving tag results, loading and saving regular expression for tagging.
+         * They are handled by 'func' variable in postdata, which could come from LGService or from extraction-interface application itself.
+         *
+         * From LGService, the postdata contains essential information about the file/section of local gazetteers data.
+         * This happens when user entering to extraction-interface the first time, or after s/he saved her/is tagging results to LGService.
+         * (default one, SaveFullTextToLGService, SmartRegexLoad, SmartRegexSave case)
+         * 
+         * From extraction-interface itself, it contains the information from previous page.
+         * This happens when user choosing another topic in the extraction-interface, 
+         * the page need to retrieve related information from database for the topic.
+         * (ContinueTagging case)
+         */
 
         $viewmodel = $this->viewmodel;
         
@@ -50,16 +48,16 @@
                 $viewmodel->messages['info'] .= "SaveFullTextToLGService! ";
                 $viewmodel->GetInfoFromPreviousPage($this->postdata);
                 $response = $viewmodel->SaveFullTextToLGService($this->postdata);
-                $viewmodel->UpdateInfoByResponseFromLGService($response);    // update file_id, branch_id, user_id
+                $viewmodel->UpdateInfoResponsedFromLGService($response);    // update file_id, branch_id, user_id
                 $viewmodel->GetTextFromFileId();     
                 $this->ReturnView($viewmodel->StartTagging(), true); 
                 break;
 
             case 'SmartRegexLoad':
-                $viewmodel->SmartRegexLoad($this->postdata['topic_id']);
+                $viewmodel->LoadSmartRegex($this->postdata['topic_id']);
                 break;
             case 'SmartRegexSave':
-                $viewmodel->SmartRegexSave($this->postdata);
+                $viewmodel->SaveSmartRegex($this->postdata);
                 break;
             case 'ReloadText':
                 $viewmodel->messages['info'] .= "Reload the latest text ";
@@ -87,7 +85,7 @@
                     if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) {
                         // --- Existing branch case ---
                         $viewmodel->GetInfoFromPreviousPage($this->postdata);
-                        $viewmodel->SetBookMetaDataBySectionId();
+                        $viewmodel->SetBookMetadataBySectionId();
                         // get text by fileId, from LGService
                         $viewmodel->GetTextFromFileId();
                     }
@@ -95,18 +93,18 @@
                 } else if ($this->postdata['sectionId'] != 0 && $this->postdata['userId'] != 0) {
                     // --- New branch case ---
                     $viewmodel->GetInfoFromPreviousPage($this->postdata);
-                    $viewmodel->SetBookMetaDataBySectionId();
+                    $viewmodel->SetBookMetadataBySectionId();
                     // get text by sectionId from LGService
                     $viewmodel->GetTextFromSectionId();  
 
                 } else if ($this->postdata['sectionId'] != 0) { 
                     $viewmodel->GetTextFromLocal($this->postdata['sectionId']);
-                    $viewmodel->SetBookMetaDataBySectionId();
+                    $viewmodel->SetBookMetadataBySectionId();
 
                 } else if (is_numeric($this->urlvalues['id'])) {
                     // get text from local file system (for development stage only)
                     $viewmodel->GetTextFromLocal($this->urlvalues['id']);
-                    $viewmodel->SetBookMetaDataBySectionId();
+                    $viewmodel->SetBookMetadataBySectionId();
                     $this->ReturnView_localtest($viewmodel->StartTagging(), true); 
                     break;                    
 
@@ -126,8 +124,8 @@
 
     protected function ExportTable() {
         /**
-            * ExportTable action returns "./views/Extractapp/ExportTable.php" view.
-        */
+         * ExportTable action returns "./views/Extractapp/ExportTable.php" view.
+         */
         $viewmodel = $this->viewmodel;
 
         if (isset($this->postdata['func'])) {
@@ -150,9 +148,9 @@
 
     protected function EditWordlist() {
         /**
-            * EditWordlist action returns "./views/Extractapp/EditWordlist.php" view, 
-            * It adds or saves wordlist based on the 'func' variable in postdata.
-        */
+         * EditWordlist action returns "./views/Extractapp/EditWordlist.php" view, 
+         * It adds or saves wordlist based on the 'func' variable in postdata.
+         */
 
         $viewmodel = $this->viewmodel;
         if (isset($this->postdata['func'])) {
@@ -174,9 +172,9 @@
 
     protected function EditTaglist() {
         /**
-            * EditTaglist action returns "./views/Extractapp/EditTaglist.php" view.
-            * It adds, saves or delete tag in the current topic.
-        */
+         * EditTaglist action returns "./views/Extractapp/EditTaglist.php" view.
+         * It adds, saves or delete tag in the current topic.
+         */
 
         $viewmodel = $this->viewmodel;
         if (isset($this->postdata['func'])) {
@@ -201,9 +199,9 @@
  
     protected function ConfigTagsInTopic() {
         /**
-            * ConfigTagsInTopic action returns "./views/Extractapp/ConfigTagsInTopic.php" view.
-            * It shows or updates the tags-in-topic relation.
-        */
+         * ConfigTagsInTopic action returns "./views/Extractapp/ConfigTagsInTopic.php" view.
+         * It shows or updates the tags-in-topic relation.
+         */
 
         $viewmodel = $this->viewmodel;
         if (isset($this->postdata['func'])) {