DiscussionsList discussion = null;
if (request.getParameter(Params.DICUSSION_REPLY.getParamName()) == null
|| request.getParameter(Params.DICUSSION_REPLY.getParamName())
.isEmpty())
throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
if (request.getParameter(Params.DISCUSSION_PARENT_ID.getParamName()) == null
|| request.getParameter(
Params.DISCUSSION_PARENT_ID.getParamName()).isEmpty())
throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
replayMsg = request
.getParameter(Params.DICUSSION_REPLY.getParamName());
replayTo = request.getParameter(Params.DISCUSSION_PARENT_ID
.getParamName());
Replys newReplay = new Replys(request, replayMsg, replayTo);
PersistenceManager pm = PMF.get().getPersistenceManager();
discussion = (DiscussionsList) helper.getSingleItemByKeyForAction(pm,
request, DiscussionsList.class);
if (discussion == null)
throw new RequestException(ReqErrorTypes.ITEM_NOT_FOUND);
List<Replys> replays = discussion.getReply();
replayOrder = calcOrder(discussion, replayTo);