diff controllers/extractapp.php @ 57:5cf9720a2e25 extractapp

New: add reloadText to load the latest version
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 30 Mar 2015 17:23:47 +0200
parents f9594c240826
children a11f9103b8db
line wrap: on
line diff
--- a/controllers/extractapp.php	Mon Mar 30 15:54:04 2015 +0200
+++ b/controllers/extractapp.php	Mon Mar 30 17:23:47 2015 +0200
@@ -27,7 +27,6 @@
                 $viewmodel->GetInfoFromPreviousPage($this->postdata);
                 $response = $viewmodel->SaveFullTextToLGService($this->postdata);
                 $viewmodel->UpdateInfoByResponseFromLGService($response);    // update file_id, branch_id, user_id
-                // TODO: GetTextFromFileId?? reload saved file from LGService, necessary!
                 $viewmodel->GetTextFromFileId();     
                 $this->ReturnView($viewmodel->StartTagging(), true); 
                 break;
@@ -38,8 +37,12 @@
             case 'SmartRegexSave':
                 $viewmodel->SmartRegexSave($this->postdata);
                 break;
-            case 'Reload':
-                // $viewmodel->Reload();
+            case 'ReloadText':
+                $viewmodel->messages .= "Reload the latest text "."<br>";
+                $viewmodel->GetInfoFromPreviousPage($this->postdata);
+                $viewmodel->ReloadSetting();    // set file_id = current_fileId, current_fileId = 0
+                $viewmodel->GetTextFromFileId();
+                $this->ReturnView($viewmodel->StartTagging(), true);
                 break;
 
             case 'ContinueTagging':