JSONEscapeObject jsonResult = new JSONEscapeObject();
jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
Iterator<?> iterator = content.getComments().iterator();
Vector<JSONEscapeObject> comments = new Vector<JSONEscapeObject>();
while (iterator.hasNext()) {
Comment comment = (Comment) iterator.next();
JSONEscapeObject jsonComment = new JSONEscapeObject();
jsonComment.put("commentId", comment.getCommentId());
jsonComment.put("commentTitle", comment.getCommentTitle());
jsonComment.put("comment", comment.getComment());
jsonComment.put("moderation", comment.getModeration());
jsonComment.put("commentApproved", comment.getCommentApproved());
jsonComment.put("custEmail", comment.getCustomer().getCustEmail());
jsonComment.put("custPublicName", comment.getCustomer().getCustPublicName());
jsonComment.put("recCreateDatetime", Format.getFullDatetime(comment.getRecCreateDatetime()));
jsonComment.put("agreeCount", comment.getAgreeCustomers().size());
jsonComment.put("disagreeCount", comment.getDisagreeCustomers().size());
comments.add(jsonComment);
}
jsonResult.put("comments", comments);
String jsonString = jsonResult.toHtmlString();
streamWebService(response, jsonString);