changeset 28:e6e9bdc4f256

update the saving response from LGService between different file version
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 03 Mar 2015 18:13:20 +0100
parents 4a29bccb6c59
children fc7342914cdf
files develop/controllers/extractapp.php develop/data/parsing_files/126434.txt develop/models/extractapp.php develop/views/Extractapp/taggingtext.php
diffstat 4 files changed, 306 insertions(+), 276 deletions(-) [+]
line wrap: on
line diff
--- a/develop/controllers/extractapp.php	Tue Mar 03 11:47:41 2015 +0100
+++ b/develop/controllers/extractapp.php	Tue Mar 03 18:13:20 2015 +0100
@@ -26,9 +26,7 @@
                 $viewmodel->messages .= "SaveFullTextToLGService! "."<br>";
                 $viewmodel->GetInfoFromPreviousPage($this->postdata);
                 $response = $viewmodel->SaveFullTextToLGService($this->postdata);
-                
                 $viewmodel->UpdateInfoByResponseFromLGService($response);    // update file_id, branch_id, user_id
-                
                 $this->ReturnView($viewmodel->StartTagging(), true); 
                 break;
 
@@ -38,6 +36,10 @@
             case 'SmartRegexSave':
                 $viewmodel->SmartRegexSave($this->postdata);
                 break;
+            case 'Reload':
+                $viewmodel->messages .= "Reload <br>";
+                
+                break;
 
             case 'ContinueTagging':
                 $viewmodel->messages .= "(Countinue tagging) "."<br>";
@@ -48,6 +50,7 @@
                 $this->ReturnView($viewmodel->StartTagging(), true); 
                 break;
 
+
             default:    // first time visit extraction interface from LGService
                 $viewmodel->messages .= "Welcome to Extraction Interface. "."<br>";
 
--- a/develop/data/parsing_files/126434.txt	Tue Mar 03 11:47:41 2015 +0100
+++ b/develop/data/parsing_files/126434.txt	Tue Mar 03 18:13:20 2015 +0100
@@ -1,4 +1,4 @@
-【737】常州府志卷之十    物産   禮曰天時有生也地利有宜也天不生地不養君子   不以為禮則物宜所亟辨哉常郡屬古揚州而禹貢   所載貢物吾郡無一焉蓋吾郡之所生者日用飮食   之外無他奇似無足紀然書稱不貴異物賤用物民   乃足豈吾郡之謂乎兹於他郡所同有者紀於前吾   郡所獨有者紀於後即同為他郡所有而吾郡尤佳   者亦特表而出之作物産志 
+【737】〈常州府志〉卷之十    物産   禮曰天時有生也地利有宜也天不生地不養君子   不以為禮則物宜所亟辨哉常郡屬古揚州而禹貢   所載貢物吾郡無一焉蓋吾郡之所生者日用飮食   之外無他奇似無足紀然書稱不貴異物賤用物民   乃足豈吾郡之謂乎兹於他郡所同有者紀於前吾   郡所獨有者紀於後即同為他郡所有而吾郡尤佳   者亦特表而出之作物産志 
 <shu>〈榖之屬〉</shu>〈榖之屬〉
 <shu>〈榖之屬〉</shu>如
 <shu>〈榖之屬〉</shu><product_name>白稻</product_name>
@@ -8,7 +8,7 @@
 <shu>〈榖之屬〉</shu><product_name>晚稻</product_name>
 <shu>〈榖之屬〉</shu><product_name>糯稻</product_name>與他郡無異 
 <shu>〈榖之屬〉</shu>【738】  惟
-<shu style="line-height: 33.5999984741211px;">〈榖之屬〉</shu><product_name style="line-height: 33.5999984741211px;">香珠稻</product_name>
+<shu>〈榖之屬〉</shu><product_name>香珠稻</product_name>
 <shu>〈榖之屬〉</shu><product_name>紅蓮稻</product_name>則産於<product_place>武進</product_place>者佳而秈米則歲以   二十石為 上供焉如
 <shu>〈榖之屬〉</shu><product_name>大麥</product_name>
 <shu>〈榖之屬〉</shu><product_name>小麥</product_name>
@@ -24,198 +24,134 @@
 <shu>〈榖之屬〉</shu><product_name>僧衣豆</product_name>
 <shu>〈榖之屬〉</shu><product_name>豇豆</product_name>
 <shu>〈榖之屬〉</shu><product_name>豌豆</product_name>
-<shu>〈榖之屬〉</shu><product_name>稨豆</product_name>
-<shu>〈榖之屬〉</shu><product_name>芝麻</product_name>
-<shu>〈榖之屬〉</shu><product_name>飯豆</product_name>俱與他郡無異惟
-<shu>〈榖之屬〉</shu><product_name>白果豆</product_name>則産於<product_place><product_place><product_place><product_place>武進</product_place></product_place></product_place></product_place>者
-<shu>〈榖之屬〉</shu><product_name>佳蠶豆</product_name>   則産於<product_place><product_place>無錫</product_place></product_place>者佳 
-<shu>〈蔬之屬〉</shu>〈蔬之屬〉
-<shu>〈蔬之屬〉</shu>如
-<shu>〈蔬之屬〉</shu><product_name>芹菜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>蔓菁</product_name>
-<shu>〈蔬之屬〉</shu><product_name>韭薺</product_name>
-<shu>〈蔬之屬〉</shu><product_name>塌科</product_name>
-<shu>〈蔬之屬〉</shu><product_name>烏菘菜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>薹馬蘭</product_name>
-<shu>〈蔬之屬〉</shu><product_name>茼蒿</product_name>
-<shu>〈蔬之屬〉</shu><product_name>菠菜</product_name>芫荽葱小蒜扁瓠茭白芥莧萵苣馬齒
-<shu>〈蔬之屬〉</shu><product_name>莧黄瓜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>茄子</product_name>
-<shu>〈蔬之屬〉</shu><product_name>絲瓜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>南瓜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>牛角瓜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>香瓜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>冬瓜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>番瓜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>火菜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>白菜</product_name>
-<shu>〈蔬之屬〉</shu><product_name>葫蘆</product_name>   
-<shu></shu><shu>〈蔬之屬〉</shu><product_name>刀豆</product_name>
-<shu>〈蔬之屬〉</shu><product_name>莢茨</product_name>
-<shu>〈蔬之屬〉</shu><product_name>菇</product_name>
-<shu>〈蔬之屬〉</shu><product_name>荸薺</product_name>
-<shu>〈蔬之屬〉</shu><product_name>香芋</product_name><product_name></product_name>俱與他郡無異惟
-<shu>〈蔬之屬〉</shu><product_name>燕笋</product_name>産於 【739】  <product_place>江陰</product_place>者隹
-<shu>〈蔬之屬〉</shu><product_name>毛笋</product_name>產於<product_place>宜興</product_place>者隹
-<shu>〈蔬之屬〉</shu><product_name>萊菔</product_name> 即<othername>蘿蔔</othername> 産於<product_place><product_place><product_place>武進</product_place></product_place></product_place>   之觀基者隹
-<shu>〈蔬之屬〉</shu><product_name>芋頭</product_name>產於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之馬山者隹蕈産於無   錫之惠山
-<shu>〈蔬之屬〉</shu>者隹<product_name>竹茹</product_name>産於<product_place>宜興</product_place>之南山者
-<shu>〈蔬之屬〉</shu>隹<product_name>西瓜</product_name>産   於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之奔牛<product_place>無錫</product_place>之五牧<product_place>江陰</product_place>之青暘者隹
-<shu>〈蔬之屬〉</shu><product_name>大蒜</product_name>   産於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之横林者隹 
-<shu>〈果之屬〉</shu>
-<shu>〈果之屬〉</shu>如
-<shu></shu><shu></shu><shu>〈果之屬〉</shu><product_name>棗栗</product_name>
-<shu>〈果之屬〉</shu><product_name>梅</product_name>
-<shu>〈果之屬〉</shu><product_name>杏</product_name>
-<shu>〈果之屬〉</shu><product_name>李</product_name>
-<shu>〈果之屬〉</shu><product_name>枇杷</product_name>
-<shu>〈果之屬〉</shu><product_name>梨</product_name>
-<shu>〈果之屬〉</shu><product_name>杮</product_name>
-<shu>〈果之屬〉</shu><product_name>梧桐</product_name>
-<shu>〈果之屬〉</shu><product_name>石榴花</product_name>紅嘉慶   子
-<shu>〈果之屬〉</shu><product_name>核桃</product_name>
-<shu>〈果之屬〉</shu><product_name>葡萄</product_name>
-<shu>〈果之屬〉</shu><product_name>銀杏</product_name>
-<shu>〈果之屬〉</shu><product_name>蓮蓬</product_name>
-<shu>〈果之屬〉</shu><product_name>芡</product_name><product_name></product_name>實俱與他郡無異惟
-<shu>〈果之屬〉</shu><product_name>桃</product_name><product_name></product_name>則   産於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之孟河靖江之諸沙者隹
-<shu>〈果之屬〉</shu><product_name>櫻桃</product_name>產於<product_place>江陰</product_place>   之青暘者隹
-<shu>〈果之屬〉</shu><product_name>楊梅</product_name>産於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之馬山者隹
-<shu>〈果之屬〉</shu><product_name>菱</product_name>産於<product_place>武進</product_place>之蘆墅者隹 
-【740】
-<shu>〈藥之屬〉</shu>〈藥之屬〉如
-<shu>〈藥之屬〉</shu><product_name>百合</product_name>
-<shu></shu><shu>〈藥之屬〉</shu>〈藥之屬〉<product_name>山藥</product_name>
-<shu>〈藥之屬〉</shu><product_name>麥門冬</product_name>
-<shu>〈藥之屬〉</shu><product_name>桔梗</product_name>
-<shu>〈藥之屬〉</shu><product_name>枸杞</product_name>
-<shu>〈藥之屬〉</shu><product_name>菖蒲</product_name>
-<shu>〈藥之屬〉</shu><product_name>金銀花</product_name>
-<shu>〈藥之屬〉</shu><product_name>櫻子</product_name>
-<shu>〈藥之屬〉</shu><product_name>山查</product_name>
-<shu>〈藥之屬〉</shu><product_name>决明</product_name>
-<shu>〈藥之屬〉</shu><product_name>蒲公英</product_name><product_name></product_name>皂角沙參稀薟蒼耳子大薊   小薊牽牛薄荷蛇牀子茴
-<shu></shu><shu>〈藥之屬〉</shu><product_name>香瞿</product_name>
-<shu>〈藥之屬〉</shu><product_name>麥藿</product_name>
-<shu>〈藥之屬〉</shu><product_name>香夏</product_name><product_name></product_name>
-<shu>〈藥之屬〉</shu><product_name>枯草</product_name>瓜簍   仁益母草山茨菰土茯苓五加皮水蓼浮萍羊蹄根   天花粉甘菊艾俱與他郡無異惟
-<shu>〈藥之屬〉</shu><product_name>紫蘇</product_name>產於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之   毘陵驛者隹
-<shu>〈藥之屬〉</shu><product_name>何首烏</product_name>産於<product_place>宜興</product_place>之銅官者佳而<product_place><product_place><product_place>武進</product_place></product_place></product_place>   之馬山又有一種亦名何首烏或曰<othername>何首胡</othername>身如蘿   蔔而略細味甚甘美山人種之售於他邑多所獲利 
-<shu>〈木之屬〉</shu>〈木之屬〉
-<shu>〈木之屬〉</shu>如
-<shu>〈木之屬〉</shu><product_name>松</product_name>
-<shu>〈木之屬〉</shu><product_name>栢</product_name>
-<shu>〈木之屬〉</shu><product_name>檜</product_name>榆槐椐石楠
-<shu>〈木之屬〉</shu><product_name>冬青</product_name>
-<shu>〈木之屬〉</shu><product_name>棕櫚</product_name>黄楊檉梓桐   杉椿桑柘樗樟楓楊柳楮樸槿楝烏柏烏穠糓檀櫟 
-<shu>〈木之屬〉</shu>【741】  俱與他郡無異惟
-<shu>〈木之屬〉</shu><product_name>茶</product_name>則産於<product_place><product_place>宜興</product_place></product_place>者佳其品類不一   而總名之日岕茶大約以高山者為上平原者為下   每當初夏商賈駢集官給茶引方敢出境 
-<shu>〈竹之屬〉</shu>〈竹之屬〉
-<shu>〈竹之屬〉</shu>如
-<shu>〈竹之屬〉</shu><product_name>慈孝</product_name>
-<shu>〈竹之屬〉</shu><product_name>紫竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>淡竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>金竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>剛竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>天竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>苦竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>木竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>鳯尾竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>烏筋竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>水竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>護基竹</product_name>俱與他郡無異
-<shu>〈竹之屬〉</shu>惟
-<shu>〈竹之屬〉</shu><product_name></product_name><product_place>〈江陰〉</product_place><product_name>燕竹</product_name>
-<shu>〈竹之屬〉</shu><product_place>〈江陰〉</product_place><product_name>班竹</product_name>産於
-<shu>〈竹之屬〉</shu><product_place>〈江陰〉</product_place>〈江陰〉<product_place><product_place></product_place></product_place>者佳
-<shu>〈竹之屬〉</shu><product_name>毛竹</product_name>産於<product_place><product_place>宜興</product_place></product_place>者佳
-<shu></shu><shu>〈竹之屬〉</shu>〈竹之屬〉其
-<shu>〈竹之屬〉</shu><product_name>班竹</product_name>
-<shu>〈竹之屬〉</shu><product_name>毛竹</product_name><product_name></product_name>   俱可為器物 
-<shu>〈花之屬〉</shu>〈花之屬〉
-<shu>〈花之屬〉</shu>其已見果屬者不更載如
-<product_name></product_name><shu>〈花之屬〉</shu><product_name>芍藥</product_name>
-<shu>〈花之屬〉</shu><product_name>山鵑</product_name>萱夜合金   雀
-<shu>〈花之屬〉</shu><product_name>薔薇</product_name>木香月季鐵線蓮
-<shu>〈花之屬〉</shu><product_name>罌粟</product_name>虞美人佛見笑荼䕷   
-諸葛菜金絲桃蝴蝶蜀葵錦葵剪春羅剪秋紗翠梅 
-【742】  烏羢凌霄沃丹沃黄沃素玉簮長春玫瑰滴滴金千   日紫秋葵鳯仙雞冠荷包牡丹埭棠海棠俱與他郡   無異惟
-<shu>〈花之屬〉</shu><product_name>牡丹</product_name>則産於<product_place>江陰</product_place>之虎涇口者隹多以芍藥   相接故花色甚不一
-<shu>〈花之屬〉</shu><product_name>石巖</product_name>亦産於<product_place>江陰</product_place>之虎涇口沙山者佳
-<shu>〈花之屬〉</shu><product_name>菊花</product_name>亦産於<product_place><product_place>江陰</product_place></product_place>者佳
-<shu>〈花之屬〉</shu><product_name>蘭蕙</product_name>産於<product_place>宜興</product_place>諸山者佳
-<shu>〈花之屬〉</shu><product_name>杜鵑</product_name>亦産於<product_place><product_place>宜興</product_place></product_place>者佳而惟南嶽一株為最古   
-<shu>〈花之屬〉</shu><product_name>棉花</product_name>雖各邑俱産而江靖尤多遠近交相貿易 
+<shu>〈榖之屬〉</shu><product_name>稨豆</product_name>芝麻飯   豆俱與他郡無異惟
+<shu>〈榖之屬〉</shu><product_name>白果豆</product_name>則産於<product_place>武進</product_place>者
+<shu>〈榖之屬〉</shu><product_name>佳蠶豆</product_name>   則産於<product_place>無錫</product_place>者佳 
+〈蔬之屬〉
+如
+<product_name>芹菜</product_name>蔓菁韭薺塌科
+<product_name>烏菘菜</product_name>薹馬蘭茼蒿菠   菜芫荽葱小蒜扁瓠茭白芥莧萵苣馬齒
+<product_name>莧黄瓜</product_name>茄   
+<product_name>子絲瓜</product_name>
+<product_name>南瓜</product_name>
+<product_name>牛角瓜</product_name>
+<product_name>香瓜</product_name>
+<product_name>冬瓜</product_name>
+<product_name>番瓜</product_name>
+<product_name>火菜</product_name>
+<product_name>白菜</product_name>葫蘆   
+<product_name>刀豆</product_name>莢茨菇荸薺香芋俱與他郡無異惟燕笋産於 
+【739】  江陰者隹毛笋產於宜興者隹萊菔 
+<product_name>即蘿</product_name> 
+<product_name>蔔</product_name> 産於武進   之觀基者隹芋頭產於武進之馬山者隹蕈産於無   錫之惠山
+<product_name>者隹竹</product_name>茹産於宜興之南山者
+<product_name>隹西瓜</product_name>産   於武進之奔牛無錫之五牧江陰之青暘者隹大蒜   産於武進之横林者隹 
+〈果之屬〉
+如棗栗梅杏李枇杷梨杮梧桐石榴花紅嘉慶   子核桃葡萄銀杏蓮蓬芡實俱與他郡無異惟桃則   産於武進之孟河靖江之諸沙者隹櫻桃產於江陰   之青暘者隹楊梅産於武進之馬山者隹菱産於武   進之蘆墅者隹 
+【740】藥之屬如百合
+<product_name>山藥麥</product_name>門冬桔梗枸杞菖蒲金銀花金櫻子山查决明蒲公英皂角沙參稀薟蒼耳子大薊   小薊牽牛薄荷蛇牀子茴
+<product_name>香瞿麥</product_name>藿香夏
+<product_name>枯草瓜</product_name>簍   仁益母草山茨菰土茯苓五加皮水蓼浮萍羊蹄根   天花粉甘菊艾俱與他郡無異惟紫蘇產於武進之   毘陵驛者隹何首烏産於宜興之銅官者佳而武進   之馬山又有一種亦名何首烏或曰何首胡身如蘿   蔔而略細味甚甘美山人種之售於他邑多所獲利 
+〈木之屬〉
+如松栢檜榆槐椐石楠冬青棕櫚黄楊檉梓桐   杉椿桑柘樗樟楓楊柳楮樸槿楝烏柏烏穠糓檀櫟 
+【741】  俱與他郡無異惟茶則産於<product_place>宜興</product_place>者佳其品類不一   而總名之日岕茶大約以高山者為上平原者為下   每當初夏商賈駢集官給茶引方敢出境 
+〈竹之屬〉
+如慈
+<product_name>孝紫竹</product_name>
+<product_name>淡竹</product_name>
+<product_name>金竹</product_name>
+<product_name>剛竹</product_name>
+<product_name>天竹</product_name>
+<product_name>苦竹</product_name>
+<product_name>木竹</product_name>鳯   
+<product_name>尾竹</product_name>
+<product_name>烏筋竹</product_name>
+<product_name>水竹</product_name>
+<product_name>護基竹</product_name>俱與他郡無異
+<product_name>惟燕竹</product_name>班   竹産於<product_place>江陰</product_place>者
+<product_name>佳毛竹</product_name>産於<product_place>宜興</product_place>者佳
+<product_name>其班竹</product_name>
+<product_name>毛竹</product_name>   俱可為器物 
+〈花之屬〉
+其已見果屬者不更載如芍藥山鵑萱夜合金   雀薔薇木香月季鐵線蓮罌粟虞美人佛見笑荼䕷   
+<product_name>諸葛菜</product_name>金絲桃蝴蝶蜀葵錦葵剪春羅剪秋紗翠梅 
+【742】  烏羢凌霄沃丹沃黄沃素玉簮長春玫瑰滴滴金千   日紫秋葵鳯仙雞冠荷包牡丹埭棠海棠俱與他郡   無異惟牡丹則産於江陰之虎涇口者隹多以芍藥   相接故花色甚不一石巖亦産於江陰之虎涇口沙   山者佳菊花亦産於<product_place>江陰</product_place>者佳蘭蕙産於宜興諸山   者佳杜鵑亦産於<product_place>宜興</product_place>者佳而惟南嶽一株為最古   棉花雖各邑俱産而江靖尤多遠近交相貿易 
 〈草之屬〉
-如千年蒀龍虎草游龍虎耳鳯尾吉祥翠雲繡   墩書帶芭蕉酸漿魚腥紅蓼辣蓼淡竹葉青苔薜荔   莎蓬蒿灰蓼俱與他郡無異惟
-<product_name>黄麻席草</product_name>則産於【743】<product_place>無錫</product_place>者佳黄麻漬水取皮織以為布蓆草織以為蓆藍   則産於<product_place>江靖</product_place>者多而且佳以之為靛利用甚溥 
-<shu>〈禽之屬〉</shu>〈禽之屬〉
-<shu>〈禽之屬〉</shu>如
-<shu>〈禽之屬〉</shu><product_name>雞</product_name>
-<shu>〈禽之屬〉</shu><product_name>鵝</product_name>
-<shu>〈禽之屬〉</shu><product_name>鴨</product_name>
-<shu>〈禽之屬〉</shu><product_name>鴿</product_name>
-<shu>〈禽之屬〉</shu><product_name>雉竹</product_name>
-<shu>〈禽之屬〉</shu><product_name>雞鵲</product_name>
-<shu>〈禽之屬〉</shu><product_name>烏鴉</product_name>鶯燕戴勝雀鳩鵓   鴣鸜鵒鵜鶘練雀百舌畫眉脊令啄木鷹鷺鷥鷗鴛   鴦黄頭偷倉鸕鷀俱與他郡無異惟
-<shu>〈禽之屬〉</shu><product_name>鶩</product_name> 俗名 <othername>野鴨</othername> 
-<shu>〈禽之屬〉</shu><product_name>鳬</product_name> 俗名 <othername>水葫蘆</othername>産於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之太湖滆湖者佳
-<shu>〈禽之屬〉</shu><product_name>黄</product_name><product_name>雀</product_name>産於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之横   林<product_place>無錫</product_place>之五牧者佳以上數禽取其肥而可食 
+如千年蒀龍虎草游龍虎耳鳯尾吉祥翠雲繡   墩書帶芭蕉
+<product_name>酸漿魚</product_name>腥紅蓼辣
+<product_name>蓼淡竹</product_name>葉青苔薜荔   莎蓬蒿灰蓼俱與他郡無異惟黄麻席草則産於無 
+【743】  錫者佳黄麻漬水取皮織以為布蓆草織以為蓆藍   則産於<product_place>江靖</product_place>者多而且佳以之為靛利用甚溥 
+〈禽之屬〉
+如雞鵝鴨
+<product_name>鴿雉竹</product_name>雞鵲烏鴉鶯燕戴勝雀鳩鵓   鴣鸜鵒鵜鶘練雀百舌畫眉脊令啄木鷹鷺鷥鷗鴛   鴦黄頭偷倉鸕鷀俱與他郡無異惟鶩 
+<product_name>俗名</product_name> 
+<product_name>野鴨</product_name> 
+<product_name>鳬</product_name> 
+<product_name>俗名</product_name> 
+<product_name>水葫</product_name>  
+<product_name>蘆</product_name>  産於武進之太湖滆湖者佳黄雀産於武進之横   林無錫之五牧者佳以上數禽取其肥而可食 
 〈獸之屬〉
-如
-<product_name>牛</product_name>
-<product_name>羊</product_name>
-<product_name>虎豹</product_name>
-<product_name>豕兔</product_name>
-<product_name>犬貓</product_name>
-<product_name>竹䶉</product_name>
-<product_name>獺獾</product_name>俱與他郡無   異惟鹿獐鹿柿狐山牛野猪産於<product_place>宜興</product_place>諸山者佳而   可食 
-【744】
-〈鱗之屬〉如鯉青魚鰱鯽鯶鯿鱸鮆鮎土鮒蝦虎黄䫙白   絲黑魚鰻鱔俱與他郡無異惟子魚河魨刀鱭鱠殘   塌沙蛼 俗名 <othername>昌蛾</othername> 鑊㔶鱘鮰蝗諸種産於<product_place>武邑</product_place>之孟河   虞塘及江靖兩邑者佳白魚至時雨後産於<product_place>無錫</product_place>溪   河及<product_place>太湖</product_place>者佳
-<product_name></product_name><product_place></product_place><product_place>〈無錫〉</product_place><product_place>〈太湖〉</product_place><product_name>銀魚</product_name>
-<product_place>〈無錫〉</product_place><product_place>〈太湖〉</product_place><product_name>澤魚</product_name>産於
-<product_place>〈無錫〉</product_place>〈太湖〉〈太湖〉<product_place></product_place>及
-<product_place>〈無錫〉</product_place>〈無錫〉<product_place></product_place>之鵝肫   蕩者佳 
+如牛羊虎豹豕兔
+<product_name>犬貓竹</product_name>䶉獺獾俱與他郡無   異惟鹿獐鹿柿狐山牛野猪産於宜興諸山者佳而   
+<product_name>可食</product_name> 
+【744】鱗之屬如
+<product_name>鯉青魚</product_name>鰱鯽鯶鯿鱸鮆鮎土鮒蝦虎黄䫙白   
+<product_name>絲黑魚</product_name>鰻鱔俱與他郡無異
+<product_name>惟子魚</product_name>河魨刀鱭鱠殘   塌沙蛼 
+<product_name>俗名</product_name> 
+<product_name>昌蛾</product_name> 鑊㔶鱘鮰蝗諸種産於武邑之孟河   虞塘及江靖兩邑者
+<product_name>佳白魚</product_name>至時雨後産於無錫溪   河及太湖者
+<product_name>佳銀魚</product_name>
+<product_name>澤魚</product_name>産於太湖及無錫之鵝肫   
+<product_name>蕩者佳</product_name> 
 〈介之屬〉
-如鼋龜蝦蟛蜞鼈蚌蜆螺田螺俱與他郡無異   惟
-<product_name>蟹</product_name>則産於<product_place><product_place><product_place>武進</product_place></product_place></product_place>之芙蓉湖
-名玉瓜者佳<product_place>江陰</product_place>之江   蟹尤巨 
-<shu>〈蟲之屬〉</shu>〈蟲之屬〉
-<shu>〈蟲之屬〉</shu>如蠶蜂蛙蝦蟇蝌蚪蜥蜴蜘蛛䗪 俗名 <othername>地鱉</othername> <othername>螟蛉</othername> 
-<shu>〈蟲之屬〉</shu>【745】  菜花蟲螢蟬螻蟈螳螂蠅虎蠅螬蠐蚱蜢飛蛾蝸牛   壁虎黄蜂鐵嘴蜂蛇蜈蚣虱蚤蚊俱與他郡無異惟   
-<shu>〈蟲之屬〉</shu><product_name>石曠</product_name><product_name></product_name>一名<othername>石麟</othername>産於<product_place>宜興</product_place>山中食者以為佳 
-<shu>〈布帛之屬〉</shu>〈布帛之屬〉
-<shu>〈布帛之屬〉</shu>如
-<shu>〈布帛之屬〉</shu><product_name>綾絹</product_name>
-<shu>〈布帛之屬〉</shu><product_name>布苧</product_name>之類與他郡無異惟
-<shu>〈布帛之屬〉</shu><product_name>布</product_name>則<product_place>武邑</product_place>   之名東門闊者闊而甚細異於他織<product_place>無錫</product_place>之名蕩口   縑者細擘黄草合絲縷績之織成縑布靖江之麻布   麤細各種細者縝密可愛即麤者亦疏爽經久不敝 
-<shu>〈工作之屬〉</shu>〈工作之屬〉
-<shu>〈工作之屬〉</shu>如
-<shu>〈工作之屬〉</shu><product_name>銀</product_name>
-<shu>〈工作之屬〉</shu><product_name>錫</product_name>
-<shu>〈工作之屬〉</shu><product_name>銅</product_name>
-<shu>〈工作之屬〉</shu><product_name>鐵</product_name>
-<shu>〈工作之屬〉</shu><product_name>木</product_name>
-<shu>〈工作之屬〉</shu><product_name>瓦</product_name>
-<shu>〈工作之屬〉</shu><product_name>石</product_name>
-<shu>〈工作之屬〉</shu><product_name>漆</product_name>
-<shu>〈工作之屬〉</shu><product_name>染</product_name>諸作俱與他郡無   異惟
-<shu>〈工作之屬〉</shu><product_name>酒</product_name><product_name>作</product_name>則<product_place>無錫</product_place>最擅名所云惠山三白 謂米白麴 白泉水白   臘月釀成以味清冽者為上奔走天下每歲數十萬 
-【746】  斛不止窑作則<product_place>宜興</product_place>之缸甕罌缽壺諸器稱蜀山   窑者佳又有灰户伐石而焚炭户斵薪而火一郡資   之<product_place>無錫</product_place>則磚瓦窑磚瓦盛行於數百里內外又若石   作則<product_place>宜興</product_place>之石板可以蓋地<product_place>無錫</product_place>之陽山石可以為   磨為臼<product_place>江陰</product_place>之石堰石可以砌牆築岸皆工人终歲   勤劬以為業也 
-<shu>〈器用之屬〉</shu>〈器用之屬〉
-<shu>〈器用之屬〉</shu>如
-<shu>〈器用之屬〉</shu><product_name>筆箋</product_name>
-<shu>〈器用之屬〉</shu><product_name>扇箸</product_name>
-<shu>〈器用之屬〉</shu><product_name>梳枕</product_name>
-<shu>〈器用之屬〉</shu>以及
-<shu>〈器用之屬〉</shu><product_name>竹木</product_name>器皿之類俱與   他郡無異惟燈則<product_place>武邑</product_place>有料絲燈初鈕姓獨擅其長   今則工是伎者甚衆厥製方圓不一又或為圍屏或   為對額夜燃膏燭瑩瑩洞徹山水人物花卉翎毛畢 
-<shu>〈器用之屬〉</shu>【747】  具爭奇競巧歲歲不同惟
-<shu>〈器用之屬〉</shu><product_name>壺</product_name>則<product_place>宜興</product_place>有茶壺澄泥為   之始於供春而時大彬陳仲美陳用卿徐友泉輩踵   事增華并製為花罇菊合香盤十錦杯等物精美絕   倫四方皆爭購之他如
-<shu>〈器用之屬〉</shu><product_name></product_name><product_place>〈江陰〉</product_place><product_name>蒲扇</product_name>
-<shu>〈器用之屬〉</shu><product_place>〈江陰〉</product_place><product_name>蒲蓆</product_name>則
-<shu>〈器用之屬〉</shu><product_place>〈江陰〉</product_place>〈江陰〉<product_place></product_place>者佳
-<shu>〈器用之屬〉</shu><product_name>苧帨</product_name>   則<product_place><product_place><product_place>武進</product_place></product_place></product_place>之驛前<product_place>無錫</product_place>之蕩口與靖江三者各佳
-<shu>〈器用之屬〉</shu><product_name>蒲鞋</product_name>   則<product_place>宜興</product_place>之陳橋者佳     
-【748】常州府志卷之十一    封系   考古封建所以親親尙賢也三代建國盛於西北而   東南則自泰伯季札始封至漢初猶循遺制從兹以   後有借一邑以為名實未嘗秉國之鈞食土之毛也   欲譜其流必溯其源自商周以迄後世其族之䌓簡   年之多寡莫不彰彰可考若夫齊以四代興梁以五   傳熾二代同姓各紀其始祖而餘略之蓋詳於史矣   作封系志    商 
+如鼋龜蝦蟛蜞鼈蚌蜆螺田螺俱與他郡無異   惟蟹則産於武進之芙蓉湖
+<product_name>名玉瓜</product_name>者佳江陰之江   
+<product_name>蟹尤巨</product_name> 
+〈蟲之屬〉
+如蠶蜂蛙蝦蟇蝌蚪蜥蜴蜘蛛䗪 
+<product_name>俗名</product_name> 
+<product_name>地鱉</product_name> 
+<product_name>螟蛉</product_name> 
+【745】  菜花蟲螢蟬螻蟈螳螂蠅虎蠅螬蠐蚱蜢飛蛾蝸牛   壁虎黄蜂鐵嘴蜂蛇蜈蚣虱蚤蚊俱與他郡無異惟   石曠一名石麟産於宜興山中食者以為佳 
+〈布帛之屬〉
+如綾絹布苧之類與他郡無異惟布則武邑   之名東門闊者闊而甚細異於他織無錫之名蕩口   縑者細擘黄草合絲縷績之織成縑布靖江之麻布   麤細各種細者縝密可愛即麤者亦疏爽經久不敝 
+〈工作之屬〉
+如銀錫銅鐵木瓦石漆染諸作俱與他郡無   異惟酒作則無錫最擅名所云惠山三白 謂米白麴 白泉水白   臘月釀成以味清冽者為上奔走天下每歲數十萬 
+【746】  斛不止窑作則宜興之缸甕罌缽壺諸器稱蜀山   窑者佳又有灰户伐石而焚炭户斵薪而火一郡資   之無錫則磚瓦窑磚瓦盛行於數百里內外又若石   作則宜興之石板可以蓋地無錫之陽山石可以為   磨為臼江陰之石堰石可以砌牆築岸皆工人终歲   勤劬以為業也 
+〈器用之屬〉
+如筆箋扇箸梳枕
+<product_name>以及竹</product_name>木器皿之類俱與   他郡無異惟燈則武邑有料絲燈初鈕姓獨擅其長   今則工是伎者甚衆厥製方圓不一又或為圍屏或   為對額夜燃膏燭瑩瑩洞徹山水人物花卉翎毛畢 
+【747】  具爭奇競巧歲歲不同惟壺則宜興有茶壺澄泥為   之始於供春而時大彬陳仲美陳用卿徐友泉輩踵   事增華并製為花罇菊合香盤十錦杯等物精美絕   倫四方皆爭購之他如蒲扇蒲蓆則江陰者佳苧帨   則武進之驛前無錫之蕩口與靖江三者各佳蒲鞋   則宜興之陳橋者佳     
+【748】常州府志卷之十一    
+<product_name>封系</product_name>   考古封建所以親親尙賢也三代建國盛於西北而   東南則自泰伯季札始封至漢初猶循遺制從兹以   後有借一邑以為名實未嘗秉國之鈞食土之毛也   欲譜其流必溯其源自商周以迄後世其族之䌓簡   年之多寡莫不彰彰可考若夫齊以四代興梁以五   傳熾二代同姓各紀其始祖而餘略之蓋詳於史矣   作封系志    
+<product_name>商</product_name> 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- a/develop/models/extractapp.php	Tue Mar 03 11:47:41 2015 +0100
+++ b/develop/models/extractapp.php	Tue Mar 03 18:13:20 2015 +0100
@@ -8,7 +8,7 @@
 		return array("Index Value 1", "Value 2", "Value 3");
 	}
     
-    protected $section_id = 0, $data_path, $file_id = 0, $branch_id = 0, $user_id = 0, $lg_text = "", $topic = 0;
+    protected $section_id = 0, $data_path, $file_id = 0, $current_fileId=0, $branch_id = 0, $user_id = 0, $lg_text = "", $topic = 0;
     public $messages = "";
 
     private function Initialize($_urlvalues) {
@@ -17,24 +17,28 @@
     }
 
     public function GetTextFromFileId($_postdata) {
-        $file_id = $_postdata['fileId'];
+        
+        if ($this->current_fileId != 0) {
+            $this->file_id = $this->current_fileId;
+        } else {
+            $this->file_id = $_postdata['fileId'];
+        }
+
         $branch_id = $_postdata['branchId'];
         $section_id = $_postdata['sectionId'];
 
         $this->branch_id = $branch_id;
-        $this->file_id = $file_id;
         $this->user_id = $_postdata['userId'];
         $this->section_id = $section_id;
 
 
-        // TODO: get info from LGService
         $this->section_name = $_postdata['sectionName'];
         $this->book_id = $_postdata['bookId'];
         $this->book_name = $_postdata['bookName'];
 
         
         // get from URL with file_id
-        $lg_text_url = $this->get_text_from_fileId_url.$file_id;
+        $lg_text_url = $this->get_text_from_fileId_url.$this->file_id;
         $lg_text = file_get_contents($lg_text_url);
 
         $stringInput = $lg_text;
@@ -112,13 +116,11 @@
         if ($_postdata['bookId']) {
             $this->book_id = $_postdata['bookId'];
         }
+        if ($_postdata['currentFileId']) {
+            $this->current_fileId = $_postdata['currentFileId'];
+        }
 
-        $this->messages .= "Info: ";
-        $this->messages .= "file_id=".$this->file_id.", section_id=".$this->section_id;
-        $this->messages .= ", user_id=".$this->user_id.", branch_id=".$this->branch_id.", topic_id=".$this->topic;
-        $this->messages .= ", book_id=".$this->book_id.", book_name=".$this->book_name.", section_name=".$this->section_name."<br>";
-
-
+       
 
     }
     public function InitData($_postdata) {
@@ -192,10 +194,19 @@
         $data['topic_tag'] = $this->GetTopicTag($this->GetTopic());
         $data['topic_name'] = $this->GetTopicName($this->GetTopic());
 
+
         $data['info'] = array('file_id'=>$this->file_id, 'user_id'=>$this->user_id,
                 'branch_id'=>$this->branch_id, 'section_id'=>$this->section_id, 'book_id'=>$this->book_id, 
                 'book_name'=>$this->book_name, 'section_name'=>$this->section_name,
                 'current_fileId'=>$this->current_fileId);
+                //'current_fileId'=>$this->file_id);
+                //'current_fileId'=>'123');
+
+        $this->messages .= "Info: ";
+        $this->messages .= "file_id=".$this->file_id.", section_id=".$this->section_id;
+        $this->messages .= ", user_id=".$this->user_id.", branch_id=".$this->branch_id.", topic_id=".$this->topic;
+        $this->messages .= ", book_id=".$this->book_id.", book_name=".$this->book_name.", section_name=".$this->section_name;
+        $this->messages .= ", current_fileId=".$this->current_fileId."<br>";
 
         $data['messages'] = $this->messages;
 
@@ -228,26 +239,44 @@
     }
 
     public function UpdateInfoByResponseFromLGService($response) {
+        
+        
+        $status = $response["status"];
+        if ($response["status"] == "error") {
+            $response_currentFile = $response["currentFile"];
+    
+            $this->current_fileId = (string)$response_currentFile['id'];
+            $this->messages .= "saving does not success! ".(string)$response["message"];
 
+            
+        } else {
+            
+            $response_file = $response["file"];
+            $response_branch = $response["branch"];
+
+            $this->messages .= "saving success.";
+            $this->file_id = (string)$response_file["id"]; 
+            $this->branch_id = (string)$response_branch["id"];
+
+        }
+
+
+        /*
         $response_file = $response["file"];
         $response_branch = $response["branch"];
 
-        $this->file_id = (string)$response_file["id"]; 
-        $this->branch_id = (string)$response_branch["id"];
-
-
-
         $status = (string)$response["status"];
         if ($status == "ok") {
             $this->messages .= "saving success.";
+            $this->file_id = (string)$response_file["id"]; 
+            $this->branch_id = (string)$response_branch["id"];
 
         } else if ($status == "error") {
             // saving not success
             $this->messages .= "saving does not success! ".(string)$response["message"];
-            $this->current_fileId = (string)$response['currentFileId'];
-            // ask to "force save" or "reload"
-
+            $this->current_fileId = $response["currentFileId"];
         }
+        */
         
 
     }
@@ -282,7 +311,7 @@
 
 
         if ($_postdata['branchId'] != 0) {
-            // exiting branch case
+            // -- exiting branch case
             $postfields = array(
                 "text" => $require, 
                 "branchId" => $_postdata['branchId'],
@@ -292,7 +321,7 @@
             $save_url = $this->save_to_LGService_url;     
 
         } else {
-            // new branch case
+            // -- new branch case
             echo "saveNew!";
             if ($_postdata['userId']) {
                 $user_id = $_postdata['userId'];
@@ -323,10 +352,11 @@
 
         // execute the request
 
-        $output = curl_exec($ch);
+        //$output = curl_exec($ch);
+
 
         // output the profile information - includes the header
-        //echo($output) . PHP_EOL;
+        echo($output) . PHP_EOL;
 
         // close curl resource to free up system resources
         curl_close($ch);
--- a/develop/views/Extractapp/taggingtext.php	Tue Mar 03 11:47:41 2015 +0100
+++ b/develop/views/Extractapp/taggingtext.php	Tue Mar 03 18:13:20 2015 +0100
@@ -73,6 +73,60 @@
 // ====
 
 
+handleFileVersionConflict();
+// Popup to proceeding the saving situations
+function handleFileVersionConflict() {
+    var info = JSON.parse('<?php echo json_encode($info) ?>');
+    console.log(info['current_fileId']);
+    
+    if (info['current_fileId'] != 0){
+        // -- there might be conflicts between different version
+        var retVal = confirm('There were something happened/someone editing in the between of time.\nDo you want to force saving? (There might be conflicts between two versions.)');
+        if( retVal == true ){
+            // TODO: force saving with currentFileId
+            alert("You do the force saving!");
+            //saveTextToLGService();
+
+        }else{
+            var loadLastest = confirm("Do you want to reload for the lastest version? (Your current editing will lost.)");
+            if (loadLastest == true) {
+                // TODO: reload page with the currentFileId
+                alert("You will reload the latest version.");   
+                
+                var form = document.createElement("form");
+                form.setAttribute("method", "post");
+                form.setAttribute("action", "./TaggingText");  // hand to controller
+                form.setAttribute("target", "_blank");  
+
+                var topic_id = JSON.parse('<?php echo json_encode($default_topic_id) ?>');
+
+                var hiddenField = document.createElement("input");      
+                hiddenField.setAttribute("name", "topic");
+                hiddenField.setAttribute("value", topic_id);
+                form.appendChild(hiddenField);
+
+                var hiddenField = document.createElement("input");      
+                hiddenField.setAttribute("name", "func");
+                hiddenField.setAttribute("value", "Reload");  // reload
+                form.appendChild(hiddenField);
+
+
+
+                _postForContineTagging(form);
+                
+                // use the current_fileId to reload the latest version of text
+                console.log('reloaded');
+                
+
+            } else {
+                alert("Just a reminder, there is a new version for this branch.");
+            }
+        }
+    }
+    return;
+    
+}
+
 <?php 
 foreach ( $taglistArray as $taglistValue ) {
 	echo '$(document).on("click", "'.$taglistValue[2].'", function (e) {'."\n";
@@ -118,29 +172,9 @@
 
 
 
-    var info = JSON.parse('<?php echo json_encode($info) ?>');
-    // Popup to proceeding the saving situations
+    
+
     /*
-    if (info['current_fileId']) {
-        var retVal = confirm('There were something happened/someone editing in the between of time. 
-            Please choose what you want to proceed the saving. 
-            Click "OK" to force saving the current file.');
-        if( retVal == true ){
-            // TODO: force saving
-            alert("You do the force saving!");
-            return true;
-        }else{
-            // TODO: reload with the new file id (current_FileId)
-
-
-            alert("You will reload for the latest version!");            
-            return false;
-        }
-
-    };
-    
-    */
-
 
     // Popup choosing topic if first time to this section. without branchId
     if (info['file_id'] == 0) {  // or info['branchId'] == 0, means new file
@@ -151,7 +185,8 @@
         var popup = document.getElementById('popup-window');
 
         // alert('choose topic!');
-    };
+    }
+    */
 
 });
 $(document).on("click", "name", function (e) {
@@ -359,7 +394,7 @@
     form.appendChild(hiddenField);
 
     _postForContineTagging(form);
-
+   
 
     /*
     var section_id = JSON.parse('<?php echo json_encode($section_id) ?>');
@@ -422,8 +457,6 @@
     form.appendChild(hiddenField);
 
     _postForContineTagging(form);
-
-
 /*
     var section_id = JSON.parse('<?php echo json_encode($section_id) ?>');
     console.log("section_id: "+section_id+", topic_id: "+topic_id);
@@ -567,6 +600,7 @@
         }    
     };
     
+    
 
     var form = document.createElement("form");
     form.setAttribute("method", "post");
@@ -592,6 +626,7 @@
     _postForContineTagging(form);
 
     /*
+
     if (info) {
         var hiddenField = document.createElement("input");      
         hiddenField.setAttribute("name", "fileId");
@@ -685,8 +720,9 @@
         form.appendChild(hiddenField);
     
 	    _postForContineTagging(form);
+           
+    };
 
-    };
 
     //Create and append the options
 	for (var i = 0; i < t.length; i++) {
@@ -723,39 +759,58 @@
 
     if (info) {
         // TODO: different field info array based on fileId(branchId) existing or not
-        var hiddenField = document.createElement("input");      
-        hiddenField.setAttribute("name", "fileId");
-        hiddenField.setAttribute("value", info['file_id']);
-        form.appendChild(hiddenField);
-        var hiddenField = document.createElement("input");      
-        hiddenField.setAttribute("name", "branchId");
-        hiddenField.setAttribute("value", info['branch_id']);
-        form.appendChild(hiddenField);
-        var hiddenField = document.createElement("input");      
-        hiddenField.setAttribute("name", "userId");
-        hiddenField.setAttribute("value", info['user_id']);
-        form.appendChild(hiddenField);
-        var hiddenField = document.createElement("input");      
-        hiddenField.setAttribute("name", "sectionId");
-        hiddenField.setAttribute("value", info['section_id']);
-        form.appendChild(hiddenField);
+        if (info['file_id']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "fileId");
+            hiddenField.setAttribute("value", info['file_id']);
+            form.appendChild(hiddenField);
+        };
+        if (info['branch_id']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "branchId");
+            hiddenField.setAttribute("value", info['branch_id']);
+            form.appendChild(hiddenField);
+        };
+        if (info['user_id']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "userId");
+            hiddenField.setAttribute("value", info['user_id']);
+            form.appendChild(hiddenField);
+        };
+        if (info['section_id']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "sectionId");
+            hiddenField.setAttribute("value", info['section_id']);
+            form.appendChild(hiddenField);
+        };
+        if (info['book_id']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "bookId");
+            hiddenField.setAttribute("value", info['book_id']);
+            form.appendChild(hiddenField);
+        };
+        if (info['section_name']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "sectionName");
+            hiddenField.setAttribute("value", info['section_name']);
+            form.appendChild(hiddenField);
+        };
+        if (info['book_name']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "bookName");
+            hiddenField.setAttribute("value", info['book_name']);
+            form.appendChild(hiddenField);
+        };
+        /*
+        if (info['current_fileId']) {
+            var hiddenField = document.createElement("input");      
+            hiddenField.setAttribute("name", "currentFileId");
+            hiddenField.setAttribute("value", info['current_fileId']);
+            form.appendChild(hiddenField);
+        };
+        */
 
-        var hiddenField = document.createElement("input");      
-        hiddenField.setAttribute("name", "bookId");
-        hiddenField.setAttribute("value", info['book_id']);
-        form.appendChild(hiddenField);
-        
-        var hiddenField = document.createElement("input");      
-        hiddenField.setAttribute("name", "sectionName");
-        hiddenField.setAttribute("value", info['section_name']);
-        form.appendChild(hiddenField);
-
-        var hiddenField = document.createElement("input");      
-        hiddenField.setAttribute("name", "bookName");
-        hiddenField.setAttribute("value", info['book_name']);
-        form.appendChild(hiddenField);
     }
-
     if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
         document.body.appendChild(form);
         form.submit();
@@ -778,7 +833,13 @@
     form.appendChild(hiddenField);
 
     _postForContineTagging(form);
-
+    
+    if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
+        document.body.appendChild(form);
+        form.submit();
+    } else {
+        form.submit(); // works under IE and Chrome, but not FF  
+    }
 }