CustomThreadCategoryList.java 文件源码

java
阅读 16 收藏 0 点赞 0 评论 0

项目:Discussion-Board-Liferay 作者:
/**
 *Method that get list of posts by particular user
 */
public static List<MBThread> getMyPosts(HttpServletRequest request) throws PortalException{
    _log.debug("Entry : getMyPosts");
    List<MBThread> myThreadList=new ArrayList<>();
    ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
    List<Long> categoryIds=new ArrayList<Long>();
    PortletPreferences preference=(PortletPreferences)request.getAttribute(CustomConstants.PREFERENCE_REQUEST_ATTRIBUTE);
    long preferenceCatId=GetterUtil.getLong(preference.getValue(CustomConstants.PREFERENCE_CATEGORYID, String.valueOf(QueryUtil.ALL_POS)));
    List<MBThread> mbThreadList=MBThreadServiceUtil.getGroupThreads(themeDisplay.getScopeGroupId(), themeDisplay.getUserId(),  WorkflowConstants.STATUS_ANY, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
    if(preferenceCatId != QueryUtil.ALL_POS){
        categoryIds=getPreferenceCatChildList(preferenceCatId, request);
         for(MBThread  mbThread:mbThreadList){
             for(Long categoryId:categoryIds){
                 if(mbThread.getCategoryId() == categoryId){
                     myThreadList.add(mbThread);
                 }
             }
         }
    }
    else{
        myThreadList=mbThreadList;
    }
        _log.debug("List Size:=>"+myThreadList.size());
        return myThreadList;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号