예제 #1
0
 @Override
 public Integer add(Menu menu) {
   if (menu.getTitle() == null) throw new IllegalArgumentException("title argument is null");
   if (menu.getPid() == null) throw new IllegalArgumentException("pid argument is null");
   if (menu.getUrl() == null) throw new IllegalArgumentException("url argument is null");
   if (menu.getSorder() == null) throw new IllegalArgumentException("sorder argument is null");
   menu.setDeleteflag(0);
   this.baseDaoSupport.insert("menu", menu);
   return this.baseDaoSupport.getLastId("menu");
 }
예제 #2
0
 @Override
 public void edit(Menu menu) {
   if (menu.getId() == null) throw new IllegalArgumentException("id argument is null");
   if (menu.getTitle() == null) throw new IllegalArgumentException("title argument is null");
   if (menu.getPid() == null) throw new IllegalArgumentException("pid argument is null");
   if (menu.getUrl() == null) throw new IllegalArgumentException("url argument is null");
   if (menu.getSorder() == null) throw new IllegalArgumentException("sorder argument is null");
   menu.setDeleteflag(0);
   this.baseDaoSupport.update("menu", menu, "id=" + menu.getId());
 }
예제 #3
0
 /*     */ private void fillChildMenu(List<Menu> menuList, Element parentEl) /*     */ {
   /* 179 */ for (Menu menu : menuList)
     /* 180 */ if (menu.getMenutype().intValue() != 1) {
       /* 181 */ Element menuEl = new Element("menu");
       /* 182 */ menuEl.setAttribute("text", menu.getTitle());
       /* 183 */ String url = menu.getUrl();
       /* 184 */ if (!StringUtil.isEmpty(url)) {
         /* 185 */ menuEl.setAttribute("url", url);
         /*     */ }
       /*     */
       /* 188 */ String target = menu.getTarget();
       /* 189 */ if (!StringUtil.isEmpty(target)) {
         /* 190 */ menuEl.setAttribute("target", target);
         /*     */ }
       /*     */
       /* 193 */ List children = menu.getChildren();
       /* 194 */ if ((children != null) && (!children.isEmpty())) {
         /* 195 */ fillChildMenu(children, menuEl);
         /*     */ }
       /* 197 */ parentEl.addContent(menuEl);
       /*     */ }
   /*     */ }