示例#1
0
 @Override
 public FXmlNodes buildItemNodes(TListArgs args) {
   FXmlNodes nodes = new FXmlNodes();
   String name = args.name();
   if (name.startsWith("{") && name.endsWith("}")) {
     name = name.substring(1, name.length() - 1);
     // 去数据库去CodeList
     if (null == args.sqlContext()) {
       ISqlConnection cnn = null;
       try {
         cnn = _databaseConsole.alloc();
         innerBuildCodeList(nodes, name, cnn);
       } finally {
         if (null != cnn) {
           _databaseConsole.free(cnn);
         }
       }
     } else {
       innerBuildCodeList(nodes, name, args.sqlContext());
     }
   } else {
     // 通过列表取数据
     innerBuildList(nodes, name);
   }
   return nodes;
 }
示例#2
0
 @Override
 public FXmlNode buildListConfig(TListArgs args) {
   String name = args.name();
   // 从缓冲管理器中查找列表对象
   ICache cache = _cacheConsole.find(IListConsole.class, name);
   if (null != cache) {
     return (FXmlNode) cache.instance();
   }
   // 创建节点
   FXmlNode config = new FXmlNode("List");
   config.set("name", name);
   if (name.startsWith("{") && name.endsWith("}")) {
     String code = name.substring(1, name.length() - 1);
     // 去数据库去CodeList
     if (null == args.sqlContext()) {
       ISqlConnection cnn = null;
       try {
         cnn = _databaseConsole.alloc();
         innerBuildCodeList(config.nodes(), code, cnn);
       } finally {
         if (null != cnn) {
           _databaseConsole.free(cnn);
         }
       }
     } else {
       innerBuildCodeList(config.nodes(), code, args.sqlContext());
     }
   } else {
     // 通过列表取数据
     innerBuildList(config.nodes(), name);
   }
   // 向缓冲管理器中注册列表对象
   cache = new FCache(config);
   cache.setTimeout(_cacheTimeout);
   _cacheConsole.register(IListConsole.class, name, cache);
   return config;
 }