CustomThreadCategoryList.java 文件源码

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

项目:Discussion-Board-Liferay 作者:
/**
 * Method that get list of subscribed threads by users
 */
public static List<MBThread> getSubscribedThreadsList(HttpServletRequest request) throws PortalException{
    _log.debug("Entry: getSubscribedThreadsList");
    List<MBThread> subscribedThreadList=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_APPROVED , true, 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){
                     subscribedThreadList.add(mbThread);
                 }
             }
         }
    }
    else{
        subscribedThreadList=mbThreadList;
    }
        _log.debug("List Size:=>"+subscribedThreadList.size());
        return subscribedThreadList;

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号