comparison src/main/java/de/mpiwg/gazetteer/rest/GetSectionMetadata.java @ 19:9c4937b290c6

new: coordinates books
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 02 Jun 2015 16:44:02 +0200
parents 3e62083dbcbf
children 88a485937f9a
comparison
equal deleted inserted replaced
18:881e7591f3e4 19:9c4937b290c6
6 import javax.servlet.http.HttpServletResponse; 6 import javax.servlet.http.HttpServletResponse;
7 7
8 import org.json.JSONObject; 8 import org.json.JSONObject;
9 9
10 import de.mpiwg.gazetteer.db.DBBook; 10 import de.mpiwg.gazetteer.db.DBBook;
11 import de.mpiwg.gazetteer.db.DBCoordinatesBook;
11 import de.mpiwg.gazetteer.db.DBSection; 12 import de.mpiwg.gazetteer.db.DBSection;
12 import de.mpiwg.gazetteer.utils.DBService; 13 import de.mpiwg.gazetteer.utils.DBService;
13 14
14 public class GetSectionMetadata extends AbstractServletMethod { 15 public class GetSectionMetadata extends AbstractServletMethod {
15 16
43 bookJson.put("author", book.getAuthor()); 44 bookJson.put("author", book.getAuthor());
44 bookJson.put("edition", book.getEdition()); 45 bookJson.put("edition", book.getEdition());
45 bookJson.put("line", book.getLine()); 46 bookJson.put("line", book.getLine());
46 bookJson.put("period", book.getPeriod()); 47 bookJson.put("period", book.getPeriod());
47 bookJson.put("volume", book.getVolume()); 48 bookJson.put("volume", book.getVolume());
48
49 bookJson.put("level1", book.getLevel1()); 49 bookJson.put("level1", book.getLevel1());
50 bookJson.put("level2", book.getLevel2()); 50 bookJson.put("level2", book.getLevel2());
51 bookJson.put("admin_type", book.getAdmin_type()); 51 bookJson.put("admin_type", book.getAdmin_type());
52 bookJson.put("in_jibengujiku", book.getIn_jibengujiku()); 52 bookJson.put("in_jibengujiku", book.getIn_jibengujiku());
53
54
55 bookJson.put("dynasty", book.getDynasty()); 53 bookJson.put("dynasty", book.getDynasty());
56 bookJson.put("start_year", book.getStart_year()); 54 bookJson.put("start_year", book.getStart_year());
57 bookJson.put("end_year", book.getEnd_year()); 55 bookJson.put("end_year", book.getEnd_year());
58 56
57 sectionJson.put("book", bookJson);
59 58
60 sectionJson.put("book", bookJson); 59
60 DBCoordinatesBook coor_book = DBService.getInstance().getCoordinatesBook(section.getBookId());
61
62 JSONObject coordinates_books = new JSONObject();
63 coordinates_books.put("place_name", coor_book.getPlace_name());
64 coordinates_books.put("x", coor_book.getX());
65 coordinates_books.put("y", coor_book.getY());
66
67 sectionJson.put("coordinates_books", coordinates_books);
68
61 69
62 70
63 json.put("section", sectionJson); 71 json.put("section", sectionJson);
64 72
65 73