Mercurial > hg > LGServices
changeset 81:881461e4f37d
more specific warning message for section without contents
author | Calvin Yeh <cyeh@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 04 May 2017 14:45:32 +0200 |
parents | 7f10544e27dd |
children | 9649f29eb4b0 |
files | src/main/java/de/mpiwg/gazetteer/rest/GetSectionText.java |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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(); } } - + }