calcPage(adminBean, form, list, pageNo);
Vector<CommentDisplayForm> vector = new Vector<CommentDisplayForm>();
int startRecord = (form.getPageNo() - 1) * adminBean.getListingPageSize();
int endRecord = startRecord + adminBean.getListingPageSize();
for (int i = startRecord; i < list.size() && i < endRecord; i++) {
Comment comment = (Comment) list.get(i);
CommentDisplayForm display = new CommentDisplayForm();
display.setCommentId(Format.getLong(comment.getCommentId()));
display.setCommentTitle(comment.getCommentTitle());
display.setComment(comment.getComment());
display.setCustEmail(comment.getCustomer().getCustEmail());
display.setCustPublicName(comment.getCustomer().getCustPublicName());
display.setAgreeCount(Format.getInt(comment.getAgreeCustomers().size()));
display.setDisagreeCount(Format.getInt(comment.getDisagreeCustomers().size()));
display.setRecUpdatedDatetime(Format.getFullDatetime(comment.getRecUpdateDatetime()));
if (comment.getContent() != null) {
display.setCommentSource("C");
Content content = comment.getContent();
display.setCommentSourceTitle(content.getContentLanguage().getContentTitle());
display.setCommentSourceId(Format.getLong(content.getContentId()));
}
else {
display.setCommentSource("I");
Item item = comment.getItem();
display.setCommentSourceTitle(item.getItemLanguage().getItemShortDesc());
display.setCommentSourceId(Format.getLong(comment.getItem().getItemId()));
}
if (comment.getModeration() != null && comment.getModeration() == Constants.VALUE_YES) {
display.setCommentModeration("Yes");
}
if (comment.getCommentApproved() != null && comment.getCommentApproved() == Constants.VALUE_YES) {
display.setCommentApproved("Approved");
}
if (comment.getCommentApproved() != null && comment.getCommentApproved() == Constants.VALUE_NO) {
display.setCommentApproved("Rejected");
}
vector.add(display);
}
CommentDisplayForm commentDisplayForms[] = new CommentDisplayForm[vector.size()];