/**
* Get Thread list
*
* Depending on the passed site groupd id, fetch all pages in the site and return JSON object list.
*
* @param resourceRequest
* @param resourceResponse
* @return
* @throws PortalException
*/
protected String getThreadList(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
throws PortalException {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
long siteGroupId = ParamUtil.getLong(resourceRequest, "siteGroupId", themeDisplay.getSiteGroupId());
if(_log.isDebugEnabled()) {
_log.debug("SiteGroup Id <" + String.valueOf(siteGroupId) + ">");
}
List<MBThread> threads = _mbThreadLocalService.getThreads(
siteGroupId,
MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID,
WorkflowConstants.STATUS_APPROVED,
QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
for(MBThread thread : threads ) {
JSONObject curUserJSONObject = JSONFactoryUtil.createJSONObject();
MBMessage message = _mbMessageLocalService.getMessage(thread.getRootMessageId());
if(_log.isDebugEnabled()) {
_log.debug("Root message <" + message.getSubject() + ">");
_log.debug(thread.toString());
_log.debug("----------");
}
curUserJSONObject.put("rootMessageSubject" , message.getSubject());
curUserJSONObject.put("threadId" , thread.getThreadId());
curUserJSONObject.put("rootMessageId" , thread.getRootMessageId());
jsonArray.put(curUserJSONObject);
}
return jsonArray.toJSONString();
}
MBMVCResourceCommand.java 文件源码
java
阅读 16
收藏 0
点赞 0
评论 0
项目:liferay-dummy-factory
作者:
评论列表
文章目录