예제 #1
0
 private String forPanelButton(HttpServletRequest request) {
   String keyName = request.getParameter("panelName");
   PagePanel panel = pagePanelService.findPagePanel(keyName);
   String json = "[";
   List<PagePanelBtn> ppbs = pagePanelBtnService.findPanelBtnByPanel(panel);
   if (ppbs.isEmpty()) {
     json += "";
   } else {
     for (PagePanelBtn ppb : ppbs) {
       if (ppb.getIsDisplay() != null && ppb.getIsDisplay() == 1) {
         json += "{";
         json += "\"btnName\":\"" + ppb.getBtnName() + "\",";
         json += "\"container\":\"" + ppb.getPagePanel().getName() + "\",";
         json +=
             "\"containerTable\":\""
                 + ppb.getPagePanel().getSystemMainTable().getTableName()
                 + "\",";
         json += "\"method\":\"" + ppb.getMethod() + "\",";
         json += "\"link\":\"" + ppb.getLink() + "\",";
         json +=
             "\"nextPageModel\":\""
                 + (ppb.getNextPageModel() == null ? "" : ppb.getNextPageModel().getName())
                 + "\",";
         json += "\"imageUrl\":\"" + ppb.getImageUrl() + "\"";
         json += "},";
       }
     }
     if (json.length() > 1) json = json.substring(0, json.length() - 1);
   }
   json += "]";
   return json;
 }