Mercurial > hg > extraction-interface
comparison models/extractapp.php @ 53:f9594c240826 extractapp
get/update text after saving, for xml file consistency
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 26 Mar 2015 17:25:46 +0100 |
parents | 94064f625650 |
children | f9e7119339b2 |
comparison
equal
deleted
inserted
replaced
52:94064f625650 | 53:f9594c240826 |
---|---|
15 private function Initialize($_urlvalues) { | 15 private function Initialize($_urlvalues) { |
16 $this->SetSectionId($_urlvalues); | 16 $this->SetSectionId($_urlvalues); |
17 | 17 |
18 } | 18 } |
19 | 19 |
20 public function GetTextFromFileId($_postdata) { | 20 public function GetTextFromFileId() { // remove $_postdata as input |
21 /* | |
21 $this->file_id = $_postdata['fileId']; | 22 $this->file_id = $_postdata['fileId']; |
22 $branch_id = $_postdata['branchId']; | 23 $branch_id = $_postdata['branchId']; |
23 $section_id = $_postdata['sectionId']; | 24 $section_id = $_postdata['sectionId']; |
24 | 25 |
25 $this->branch_id = $branch_id; | 26 $this->branch_id = $branch_id; |
27 $this->section_id = $section_id; | 28 $this->section_id = $section_id; |
28 | 29 |
29 $this->section_name = $_postdata['sectionName']; | 30 $this->section_name = $_postdata['sectionName']; |
30 $this->book_id = $_postdata['bookId']; | 31 $this->book_id = $_postdata['bookId']; |
31 $this->book_name = $_postdata['bookName']; | 32 $this->book_name = $_postdata['bookName']; |
33 */ | |
32 | 34 |
33 // get from URL with file_id | 35 // get from URL with file_id |
34 $lg_text_url = $this->get_text_from_fileId_url.$this->file_id; | 36 $lg_text_url = $this->get_text_from_fileId_url.$this->file_id; |
35 //$lg_text = file_get_contents($lg_text_url); | 37 //$lg_text = file_get_contents($lg_text_url); |
36 // --- get/set text and parsing meta data from text file | 38 // --- get/set text and parsing meta data from text file |
48 | 50 |
49 $this->lg_text = $lg_text; | 51 $this->lg_text = $lg_text; |
50 | 52 |
51 } | 53 } |
52 | 54 |
53 public function GetTextFromSectionId($_postdata) { | 55 public function GetTextFromSectionId() { // remove $_postdata as input |
56 /* | |
54 $section_id = $_postdata['sectionId']; | 57 $section_id = $_postdata['sectionId']; |
55 $this->section_id = $section_id; | 58 $this->section_id = $section_id; |
56 $this->user_id = $_postdata['userId']; | 59 $this->user_id = $_postdata['userId']; |
57 | 60 |
58 $this->section_name = $_postdata['sectionName']; | 61 $this->section_name = $_postdata['sectionName']; |
59 $this->book_id = $_postdata['bookId']; | 62 $this->book_id = $_postdata['bookId']; |
60 $this->book_name = $_postdata['bookName']; | 63 $this->book_name = $_postdata['bookName']; |
64 */ | |
61 | 65 |
62 // get from URL with file_id | 66 // get from URL with file_id |
63 $lg_text_url = $this->get_text_from_sectionId_url.$section_id; | 67 // $lg_text_url = $this->get_text_from_sectionId_url.$section_id; |
68 $lg_text_url = $this->get_text_from_sectionId_url.$this->section_id; | |
64 $lg_text = file_get_contents($lg_text_url); | 69 $lg_text = file_get_contents($lg_text_url); |
65 | 70 |
66 // TODO: get book_meta from $_postdata and set $this->book_meta: book_id,book_name,author,year,pagenumber | 71 // TODO: get book_meta from $_postdata and set $this->book_meta: book_id,book_name,author,year,pagenumber |
67 $book_meta = array(); | 72 $book_meta = array(); |
68 array_push($book_meta, array($this->book_id,$this->book_name,"NULL","NULL","NULL")); // missing author,year,pagenumber | 73 array_push($book_meta, array($this->book_id,$this->book_name,"no_data","no_data","no_data")); // missing author,year,pagenumber |
69 | 74 |
70 $this->book_meta = $book_meta; | 75 $this->book_meta = $book_meta; |
71 | 76 |
72 | 77 |
73 | 78 |