# HG changeset patch # User Calvin Yeh # Date 1493901932 -7200 # Node ID 881461e4f37d3ed68c162e19439f82631ffd22d3 # Parent 7f10544e27dde8337302af8cd5e062103c6e8a3c more specific warning message for section without contents diff -r 7f10544e27dd -r 881461e4f37d src/main/java/de/mpiwg/gazetteer/rest/GetSectionText.java --- a/src/main/java/de/mpiwg/gazetteer/rest/GetSectionText.java Thu May 04 10:56:23 2017 +0200 +++ b/src/main/java/de/mpiwg/gazetteer/rest/GetSectionText.java Thu May 04 14:45:32 2017 +0200 @@ -13,25 +13,25 @@ public class GetSectionText extends AbstractServletMethod { public static String name = "getSectionText"; - + public static void execute(HttpServletRequest request, HttpServletResponse response) throws Exception{ - + Long sectionId = getQueryLongParam(request, "sectionId"); - + if(sectionId != null){ String text = DBService.getSectionWithContent(sectionId).getText(); if(StringUtils.isNotEmpty(text)){ - + PrintWriter out = response.getWriter(); out.print(text); out.flush(); response.setContentType("text/plain; charset=UTF-8"); - + }else{ response.setContentType("application/json"); JSONObject json = new JSONObject(); json.put("status", "error"); - json.put("message", "Section no found (" + sectionId + ")"); + json.put("message", "The content of this section is not available yet (" + sectionId + ")"); PrintWriter out = response.getWriter(); out.print(json.toString()); out.flush(); @@ -46,5 +46,5 @@ out.flush(); } } - + }