Mercurial > hg > extraction-interface
comparison models/extractapp.php @ 75:75233b09c580 extractapp
saving latest taglist from db according to topic (even when changing topic)
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Thu, 09 Apr 2015 15:29:46 +0200 |
| parents | 60b5a94163c3 |
| children | c49192885290 |
comparison
equal
deleted
inserted
replaced
| 74:60b5a94163c3 | 75:75233b09c580 |
|---|---|
| 300 $this->file_id = $this->current_fileId; | 300 $this->file_id = $this->current_fileId; |
| 301 $this->current_fileId = 0; | 301 $this->current_fileId = 0; |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 // This is only called by SaveFullTextToLGService() | |
| 305 private function AppendMetaData($text_content) { | 306 private function AppendMetaData($text_content) { |
| 306 $text = '<?xml version="1.0" encoding="UTF-8"?>'; | 307 $text = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 307 $text .= "\n<text>\n"; | 308 $text .= "\n<text>\n"; |
| 308 // topic | 309 // --- topic --- |
| 309 $text .= "<topic>".$this->topic."</topic>\n"; | 310 $text .= "<topic>".$this->topic."</topic>\n"; |
| 310 // book meta data | 311 // --- book meta data --- |
| 311 $book = $this->book_meta; | 312 $book = $this->book_meta; |
| 312 foreach ($book as $b) { | 313 foreach ($book as $b) { |
| 313 $text .= "<book>\n"; | 314 $text .= "<book>\n"; |
| 314 $text .= "<id>".$b[0]."</id>\n"; | 315 $text .= "<id>".$b[0]."</id>\n"; |
| 315 $text .= "<name>".$b[1]."</name>\n"; | 316 $text .= "<name>".$b[1]."</name>\n"; |
| 326 $text .= "<in_jibengujiku>".$b[12]."</in_jibengujiku>\n"; | 327 $text .= "<in_jibengujiku>".$b[12]."</in_jibengujiku>\n"; |
| 327 $text .= "<admin_type>".$b[13]."</admin_type>\n"; | 328 $text .= "<admin_type>".$b[13]."</admin_type>\n"; |
| 328 $text .= "</book>\n"; | 329 $text .= "</book>\n"; |
| 329 | 330 |
| 330 } | 331 } |
| 331 // taglist | 332 |
| 332 $taglist = $this->taglist_infile; | 333 // ---- taglist --- |
| 334 // $taglist = $this->taglist_infile; | |
| 335 // obtain the latest taglist from db | |
| 336 $taglist = $this->GetTaglistByTopicID($this->GetTopic()); | |
| 337 | |
| 333 foreach ($taglist as $tagitem) { | 338 foreach ($taglist as $tagitem) { |
| 334 $text .= "<tagitem>\n"; | 339 $text .= "<tagitem>\n"; |
| 335 $text .= "<id>".$tagitem[0]."</id>\n"; | 340 $text .= "<id>".$tagitem[0]."</id>\n"; |
| 336 $text .= "<name>".$tagitem[1]."</name>\n"; | 341 $text .= "<name>".$tagitem[1]."</name>\n"; |
| 337 $text .= "<tag>".$tagitem[2]."</tag>\n"; | 342 $text .= "<tag>".$tagitem[2]."</tag>\n"; |
| 338 $text .= "<color>".$tagitem[3]."</color>\n"; | 343 $text .= "<color>".$tagitem[3]."</color>\n"; |
| 339 $text .= "</tagitem>\n"; | 344 $text .= "</tagitem>\n"; |
| 340 } | 345 } |
| 341 | 346 // ---- |
| 342 // text_content | 347 // --- text_content --- |
| 343 $text .= $text_content; | 348 $text .= $text_content; |
| 344 $text .= "</text>"; | 349 $text .= "</text>"; |
| 350 // ---- | |
| 345 | 351 |
| 346 return $text; | 352 return $text; |
| 347 } | 353 } |
| 348 public function SaveFullTextToLGService($_postdata) { | 354 public function SaveFullTextToLGService($_postdata) { |
| 349 // save tagged text (full text) by Jorge's API to lg service | 355 // save tagged text (full text) by Jorge's API to lg service |
