public virtual JObject GetTableParams(HttpContext context) { YZRequest request = new YZRequest(context); String datasourceName = request.GetString("DataSource", null); String tableName = request.GetString("tableName"); FlowDataTable tableSchema; using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); tableSchema = DataSourceManager.LoadTableSchema(cn, datasourceName, tableName); } FlowDataTable tableParams = new FlowDataTable("Params"); foreach (FlowDataColumn column in tableSchema.Columns) { if (column.AllowSearch) { tableParams.Columns.Add(column); } } FlowDataSet dataset = new FlowDataSet(); dataset.Tables.Add(tableParams); JObject rv = YZJsonHelper.SerializeSchema(dataset, "", "DataType"); rv["supportOp"] = true; return(rv); }
public virtual JObject GetESBObjectSchema(HttpContext context) { YZRequest request = new YZRequest(context); String objectName = request.GetString("ESB"); FlowDataSet dataset = new FlowDataSet(); //获取参数 string[] strs = objectName.Split(':'); SourceTypeEnum sourceType = (SourceTypeEnum)Enum.Parse(typeof(SourceTypeEnum), strs[0]); SourceInfo sourceInfo = SourceInfoManager.GetSourceInfo(sourceType, strs[1]); FlowDataTable table = new FlowDataTable(); dataset.Tables.Add(table); SourceVisit visit = new SourceVisit(sourceInfo); foreach (var item in visit.GetSchema()) { table.Columns.Add(new FlowDataColumn(item.rename, typeof(string))); } return(YZJsonHelper.SerializeSchema(dataset, "", "DataType")); }