Пример #1
0
 /**
  * 使用Html绘制查询面板时需要使用的元数据和关联数据 @Methods Name forHtmlQuery @Create In 2009-1-2 By sa
  *
  * @param request
  * @return String
  */
 @SuppressWarnings("unchecked")
 private String forHtmlQuery(HttpServletRequest request) {
   String json = "";
   String className = request.getParameter("clazz");
   Class clazz = getClass(className);
   List<UserTableQueryColumn> userQueryColumns = metaDataManager.getUserColumnForQuery(clazz);
   Map queryMap = metaDataManager.getEntityDataForAdd(clazz);
   json = ExtHtmlBuilder.genQueryHtml(queryMap, userQueryColumns);
   return json;
 }
Пример #2
0
  /**
   * 获取单Form面板元数据 @Methods Name forSaveSingleFormForLook @Create 2009-4-20 By daijf
   *
   * @param request
   * @return @ReturnType String
   */
  private String forSaveSingleFormForLook(HttpServletRequest request) {
    String json = "";
    String id = request.getParameter("id");
    String panelName = request.getParameter("panelname");
    PagePanel panel = pagePanelService.findPagePanel(panelName);
    SystemMainTable smt = panel.getSystemMainTable();
    String tableName = smt.getTableName();
    String className = smt.getClassName();
    Class clazz = null;
    try {
      clazz = Class.forName(className);
    } catch (ClassNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    List<PagePanelColumn> pagePanelColumns = pageManager.getUserPagePanelColumn(panelName);

    Map<String, Object> dataMap = null;
    if (StringUtils.isNotBlank(id)) {
      if (panel.getXtype().getName().equals("form")) {
        Object obj = service.find(clazz, id, true);
        dataMap = metaDataManager.getEntityDataForLook(obj, tableName);
        json = CoderForLook.encode(pagePanelColumns, dataMap, true);

      } else {
        json = null;
      }

    } else {
      dataMap = pageManager.getPagePanelDataForAdd(panelName);
      json = CoderForLook.encode(pagePanelColumns, dataMap, false);
    }

    return json;
  }
Пример #3
0
 /**
  * 使用EXTJS组件绘制查询面板时需要使用的元数据和关联数据 @Methods Name forQuery @Create In Aug 30, 2008 By yang
  *
  * @param request
  * @return @ReturnType String
  */
 @SuppressWarnings("unchecked")
 private String forQuery(HttpServletRequest request) {
   String json = "";
   //		String id = request.getParameter("id");
   String panelName = request.getParameter("panelname");
   PagePanel panel = pagePanelService.findPagePanel(panelName);
   SystemMainTable smt = panel.getSystemMainTable();
   String className = smt.getClassName();
   Class clazz = this.getClass(className);
   List<UserTableQueryColumn> userQueryColumns = metaDataManager.getUserColumnForQuery(clazz);
   Map queryMap = this.pageManager.getPagePanelDataForQuery(panelName);
   json = CoderForFind.encode(queryMap, userQueryColumns);
   return json;
 }