Ejemplo n.º 1
0
 /** 显示一级栏目列表 */
 public String execute(HkRequest req, HkResponse resp) throws Exception {
   req.setAttribute("active_1", 1);
   long companyId = req.getLong("companyId");
   List<CmpNav> list =
       this.cmpNavProcessor.getCmpNavListByCompanyIdAndNlevel(companyId, CmpNav.NLEVEL_1, true);
   int i = 1;
   for (CmpNav o : list) {
     if (o.getOrderflg() <= 0) {
       o.setOrderflg(i);
       this.cmpNavService.updateCmpNavOrderflg(o.getOid(), i);
     }
     i++;
   }
   for (CmpNav o : list) {
     if (o.isDirectory()) {
       if (this.cmpNavService.countCmpNavByCompanyIdAndParentIdAndNlevel(
               companyId, o.getOid(), CmpNav.NLEVEL_2)
           > 0) {
         o.setHasChild(true);
       }
     }
   }
   req.setAttribute("list", list);
   return this.getWebPath("admin/cmpnav/list.jsp");
 }
Ejemplo n.º 2
0
 /**
  * 显示二级栏目列表
  *
  * @param req
  * @param resp
  * @return
  * @throws Exception 2010-5-11
  */
 public String list2(HkRequest req, HkResponse resp) throws Exception {
   req.setAttribute("active_1", 1);
   long companyId = req.getLong("companyId");
   long parentId = req.getLongAndSetAttr("parentId");
   CmpNav cmpNav = this.cmpNavService.getCmpNav(parentId);
   req.setAttribute("cmpNav", cmpNav);
   if (cmpNav.isArticleList()) {
     SimplePage page = req.getSimplePage(20);
     List<CmpArticle> list =
         this.cmpArticleService.getCmpArticleListByCompanyIdAndCmpNavOid(
             companyId, parentId, null, page.getBegin(), page.getSize() + 1);
     this.processListForPage(page, list);
     req.setAttribute("list", list);
   } else if (cmpNav.isDirectory()) {
     List<CmpNav> list =
         this.cmpNavProcessor.getCmpNavListByCompanyIdAndParentId(companyId, parentId, true);
     int i = 1;
     for (CmpNav o : list) {
       if (o.getOrderflg() <= 0) {
         o.setOrderflg(i);
         this.cmpNavService.updateCmpNavOrderflg(o.getOid(), i);
       }
       i++;
     }
     req.setAttribute("list", list);
   }
   return this.getWebPath("admin/cmpnav/list2.jsp");
 }