예제 #1
0
        public virtual JObject GetXClassSchema(HttpContext context)
        {
            YZRequest     request     = new YZRequest(context);
            String        xclass      = request.GetString("xclass", null);
            FlowDataSet   dataset     = new FlowDataSet();
            FlowDataTable table       = new FlowDataTable();
            FlowDataTable tableFilter = new FlowDataTable();

            dataset.Tables.Add(table);

            if (!String.IsNullOrEmpty(xclass))
            {
                string url     = YZUtility.GetUrlFromXClass(xclass);
                string phyPath = context.Server.MapPath(url);
                using (StreamReader rd = new StreamReader(phyPath))
                {
                    string jsText      = rd.ReadToEnd();
                    string dataColumns = this.GetProperty(jsText, "datasourceColumns", '[', ']');
                    if (!String.IsNullOrEmpty(dataColumns))
                    {
                        JArray jDataColumns = JArray.Parse(dataColumns);
                        foreach (JToken token in jDataColumns)
                        {
                            if (token.Type == JTokenType.String)
                            {
                                FlowDataColumn column = new FlowDataColumn((string)token, typeof(string));
                                table.Columns.Add(column);
                            }
                        }
                    }
                }
            }

            return(YZJsonHelper.SerializeSchema(dataset, "", "DataType"));
        }
예제 #2
0
파일: DataSource.cs 프로젝트: radtek/EMIP
        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);
        }
예제 #3
0
파일: DataSource.cs 프로젝트: radtek/EMIP
        public virtual JObject GetESBObjectParams(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);
            List <ColumnInfo> paramList = visit.GetParameter();

            if (paramList != null && paramList.Count > 0)
            {
                foreach (var item in visit.GetParameter())
                {
                    table.Columns.Add(new FlowDataColumn(item.rename));
                }
            }
            JObject rv = YZJsonHelper.SerializeSchema(dataset, "", "DataType");

            rv["supportOp"] = false;
            return(rv);
        }
예제 #4
0
파일: DataSource.cs 프로젝트: radtek/EMIP
        public virtual JObject GetTableSchemas(HttpContext context)
        {
            YZRequest request              = new YZRequest(context);
            string    serverName           = request.GetString("ServerName", null);
            TableIdentityCollection tables = request.GetPostData <JArray>().ToObject <TableIdentityCollection>();
            FlowDataSet             dataSet;

            using (BPMConnection cn = new BPMConnection())
            {
                this.OpenConnection(cn, serverName);
                dataSet = DataSourceManager.LoadDataSetSchema(cn, tables);
                return(YZJsonHelper.SerializeSchema(dataSet));
            }
        }
예제 #5
0
파일: DataSource.cs 프로젝트: radtek/EMIP
        public virtual JObject GetTableSchema(HttpContext context)
        {
            YZRequest   request        = new YZRequest(context);
            String      datasourceName = request.GetString("DataSource", null);
            String      tableName      = request.GetString("tableName");
            FlowDataSet dataset        = new FlowDataSet();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                dataset.Tables.Add(DataSourceManager.LoadTableSchema(cn, datasourceName, tableName));
            }

            return(YZJsonHelper.SerializeSchema(dataset, "", "DataType"));
        }
예제 #6
0
파일: DataSource.cs 프로젝트: radtek/EMIP
        public virtual JObject GetQuerySchema(HttpContext context)
        {
            YZRequest request                    = new YZRequest(context);
            String    datasourceName             = request.GetString("DataSource", null);
            String    query                      = request.GetString("Query");
            QueryParameterCollection queryParams = JArray.Parse(request.GetString("QueryParams")).ToObject <QueryParameterCollection>();
            FlowDataSet dataset                  = new FlowDataSet();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                dataset.Tables.Add(DataSourceManager.LoadSchemaByQuery(cn, datasourceName, query, queryParams.CreateNullDBParameters()));
            }

            return(YZJsonHelper.SerializeSchema(dataset, "", "DataType"));
        }
예제 #7
0
        public virtual JObject XSD2DataSetSchema(HttpContext context, HttpPostedFile file, string fileName, long fileSize, string fileExt)
        {
            DataSet dataSet = new DataSet();

            if (String.Compare(fileExt, ".xml", true) == 0)
            {
                dataSet.ReadXml(file.InputStream, XmlReadMode.Auto);
            }
            else
            {
                dataSet.ReadXmlSchema(file.InputStream);
            }

            FlowDataSet flowDataSet = new FlowDataSet();

            flowDataSet.LoadDefine(dataSet);

            return(YZJsonHelper.SerializeSchema(flowDataSet));
        }
예제 #8
0
파일: DataSource.cs 프로젝트: radtek/EMIP
        public virtual JObject GetProcedureParams(HttpContext context)
        {
            YZRequest     request        = new YZRequest(context);
            String        datasourceName = request.GetString("DataSource", null);
            String        procedureName  = request.GetString("ProcedureName");
            FlowDataSet   dataset        = new FlowDataSet();
            FlowDataTable tableParams;

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                DataSourceManager.LoadProdecureSchema(cn, datasourceName, procedureName, out tableParams);
                dataset.Tables.Add(tableParams);
            }

            JObject rv = YZJsonHelper.SerializeSchema(dataset, "", "DataType");

            rv["supportOp"] = false;
            return(rv);
        }
예제 #9
0
파일: DataSource.cs 프로젝트: radtek/EMIP
        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"));
        }