Mercurial > hg > LGServices
comparison src/main/java/de/mpiwg/gazetteer/utils/FileManager.java @ 62:824b808a7481
improvements and bug fixed
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 18 Jul 2016 17:35:32 +0200 |
parents | b8ad346e39a0 |
children |
comparison
equal
deleted
inserted
replaced
61:2486846e61d5 | 62:824b808a7481 |
---|---|
58 logger.info("Trying to save file " + absolutePath + fileName + "."); | 58 logger.info("Trying to save file " + absolutePath + fileName + "."); |
59 | 59 |
60 PrintWriter out = new PrintWriter(absolutePath + fileName); | 60 PrintWriter out = new PrintWriter(absolutePath + fileName); |
61 | 61 |
62 String text = new String(); // make it from list | 62 String text = new String(); // make it from list |
63 text += "Address,LEVEL1,LEVEL2,Name,DYNASTY,PERIOD,ADMIN_TYPE,TimeSpan:begin,TimeSpan:end,Longitude,Latitude,PAGE,SECTION,CONTENT,BOOK_ID,Description\n"; | 63 text += "Address,LEVEL1,LEVEL2,Name,DYNASTY,PERIOD,ADMIN_TYPE,TimeSpan:begin,TimeSpan:end,Longitude,Latitude,PAGE,SECTION,CONTENT,BOOK_ID,Author,Edition,Volume,Description\n"; |
64 | 64 |
65 for (DBContents c : list) { | 65 for (DBContents c : list) { |
66 | 66 |
67 if (c.getSection() != null && !c.isRemoved()){ // only those are not removed to csv which means to LGMap | 67 if (c.getSection() != null && !c.isRemoved()){ // only those are not removed to csv which means to LGMap |
68 | 68 |
83 c.getCoordinatesBook().getY() + "," + | 83 c.getCoordinatesBook().getY() + "," + |
84 c.getPage() + "," + | 84 c.getPage() + "," + |
85 c.getSection().getName() + "," + | 85 c.getSection().getName() + "," + |
86 c.getContent() + "," + | 86 c.getContent() + "," + |
87 c.getBookId() + "," + | 87 c.getBookId() + "," + |
88 | |
89 | |
90 // add author, edition, volume | |
91 book.getAuthor() + "," + | |
92 book.getEdition() + "," + | |
93 book.getVolume() + "," + | |
94 | |
95 | |
88 description + "\n"; | 96 description + "\n"; |
89 } | 97 } |
90 } | 98 } |
91 | 99 |
92 text = text.substring(0, text.length()-2); // cut the last 2 chars, which are "\n" here | 100 text = text.substring(0, text.length()-2); // cut the last 2 chars, which are "\n" here |
151 + "<td class='tableTitle'>period</td>" | 159 + "<td class='tableTitle'>period</td>" |
152 + "<td class='tableTitle'>admin type</td>" | 160 + "<td class='tableTitle'>admin type</td>" |
153 + "<td class='tableTitle'>section name</td>" | 161 + "<td class='tableTitle'>section name</td>" |
154 + "<td class='tableTitle'>page</td>" | 162 + "<td class='tableTitle'>page</td>" |
155 + "<td class='tableTitle'>content</td>" | 163 + "<td class='tableTitle'>content</td>" |
156 + "<td class='tableTitle'>content id</td>" | 164 + "<td class='tableTitle hiddenField'>content id</td>" |
157 + "<td class='tableTitle'>isRemoved</td>" | 165 + "<td class='tableTitle hiddenField'>isRemoved</td>" |
158 | 166 |
159 // TODO add Author, edition, volume, place name, coordinates (x,y) | 167 // add author, edition, volume, place name, coordinates (x,y) |
160 + "<td class='tableTitle'>Author</td>" | 168 + "<td class='tableTitle'>author</td>" |
161 + "<td class='tableTitle'>edition</td>" | 169 + "<td class='tableTitle'>edition</td>" |
162 + "<td class='tableTitle'>volume</td>" | 170 + "<td class='tableTitle'>volume</td>" |
163 + "<td class='tableTitle'>place name</td>" | 171 + "<td class='tableTitle'>place name</td>" |
164 + "<td class='tableTitle'>cooridnates(x,y)</td>" | 172 + "<td class='tableTitle'>cooridnates(x,y)</td>" |
165 | 173 |
169 | 177 |
170 //if ( c.getSection() != null && !c.isRemoved()){ | 178 //if ( c.getSection() != null && !c.isRemoved()){ |
171 if ( c.getSection() != null){ | 179 if ( c.getSection() != null){ |
172 | 180 |
173 DBBook book = c.getSection().getBook(); | 181 DBBook book = c.getSection().getBook(); |
174 | 182 |
175 text += "<tr>" + | 183 if (c.isRemoved()) { |
184 text += "<tr class='hiddenField'>"; | |
185 } else { | |
186 text += "<tr>"; | |
187 | |
188 } | |
189 text += | |
176 "<td>" + c.getInx() + "</td>" + | 190 "<td>" + c.getInx() + "</td>" + |
177 "<td>" + c.getBookId() + "</td>" + | 191 "<td>" + c.getBookId() + "</td>" + |
178 "<td>" + book.getName() + "</td>" + | 192 "<td>" + book.getName() + "</td>" + |
179 "<td>" + book.getLevel1() + "</td>" + | 193 "<td>" + book.getLevel1() + "</td>" + |
180 "<td>" + book.getLevel2() + "</td>" + | 194 "<td>" + book.getLevel2() + "</td>" + |
182 "<td>" + book.getPeriod() + "</td>" + | 196 "<td>" + book.getPeriod() + "</td>" + |
183 "<td>" + book.getAdmin_type() + "</td>" + | 197 "<td>" + book.getAdmin_type() + "</td>" + |
184 "<td>" + c.getSection().getName() + "</td>" + | 198 "<td>" + c.getSection().getName() + "</td>" + |
185 "<td>" + c.getPage() + "</td>" + | 199 "<td>" + c.getPage() + "</td>" + |
186 "<td class='content'>" + c.getContent() + "</td>" + | 200 "<td class='content'>" + c.getContent() + "</td>" + |
187 "<td>" + c.getId() + "</td>" + | 201 "<td class='hiddenField'>" + c.getId() + "</td>" + |
188 "<td>" + c.isRemoved() + "</td>" + | 202 "<td class='hiddenField'>" + c.isRemoved() + "</td>" + |
189 | 203 |
190 // TODO | |
191 "<td>" + book.getAuthor() + "</td>" + | 204 "<td>" + book.getAuthor() + "</td>" + |
192 "<td>" + book.getEdition() + "</td>" + | 205 "<td>" + book.getEdition() + "</td>" + |
193 "<td>" + book.getVolume() + "</td>" + | 206 "<td>" + book.getVolume() + "</td>" + |
194 "<td>" + c.getCoordinatesBook().getPlace_name() + "</td>" + | 207 "<td>" + c.getCoordinatesBook().getPlace_name() + "</td>" + |
195 "<td> (" + c.getCoordinatesBook().getX() + "," + c.getCoordinatesBook().getY() + ")</td>" + | 208 "<td> (" + c.getCoordinatesBook().getX() + "," + c.getCoordinatesBook().getY() + ")</td>" + |