public JobDescriptionFactory(Context context, QueryFactory queryFactory) : base(context) { InitializeMembers(); this.queryFactory = queryFactory; }
private void toolbuttonParse_Click(object sender, EventArgs e) { DateTime start = DateTime.Now; try { // *** TODO: load query factory type from registry //queryFactory = new Jhu.SkyQuery.Jobs.Query.XMatchQueryFactory(); queryFactory = new Jhu.Graywulf.Jobs.Query.SqlQueryFactory(); Jhu.Graywulf.ParserLib.Parser parser = queryFactory.CreateParser(); rootNode = (Node)parser.Execute(sql.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } RefreshNodeTree(null, rootNode); parsed.Text = Jhu.Graywulf.SqlParser.SqlCodeGen.SqlServerCodeGenerator.GetCode(rootNode, false); }
private void toolbuttonParse_Click(object sender, EventArgs e) { DateTime start = DateTime.Now; try { // *** TODO: load query factory type from registry //queryFactory = new Jhu.SkyQuery.Jobs.Query.XMatchQueryFactory(); queryFactory = new Jhu.Graywulf.Jobs.Query.SqlQueryFactory(); Jhu.Graywulf.ParserLib.Parser parser = queryFactory.CreateParser(); rootNode = (Node)parser.Execute(sql.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } RefreshNodeTree(null, rootNode); parsed.Text = Jhu.Graywulf.SqlParser.SqlCodeGen.SqlServerCodeGenerator.GetCode(rootNode, false); }
public static JobDescription GetJob(JobInstance job, QueryFactory queryFactory) { // In this function, we don't directly deserialize query parameters because // that could break old job definitions once the job format changes. It's // save to read parameters from the xml representation directly. var res = new JobDescription(); res.Job = job; if (queryJobDefinitions.ContainsKey(job.JobDefinitionReference.Guid)) { res.JobType = JobType.Query; // debug code if (job.Parameters.ContainsKey("Query")) { var xml = new XmlDocument(); xml.LoadXml(job.Parameters["Query"].XmlValue); res.Query = GetXmlInnerText(xml, "Query/QueryString"); res.SchemaName = GetXmlInnerText(xml, "Query/Destination/Table/SchemaName"); res.ObjectName = GetXmlInnerText(xml, "Query/Destination/Table/ObjectName"); } else { // This is probably a wrong job in the database } } else if (exportJobDefinitions.ContainsKey(job.JobDefinitionReference.Guid)) { res.JobType = JobType.ExportTable; if (job.Parameters.ContainsKey("Parameters")) { var xml = new XmlDocument(); xml.LoadXml(job.Parameters["Parameters"].XmlValue); res.SchemaName = GetXmlInnerText(xml, "ExportTable/Source/SchemaName"); res.ObjectName = GetXmlInnerText(xml, "ExportTable/Source/ObjectName"); res.Path = GetXmlInnerText(xml, "ExportTable/Destination/Path"); } } else { res.JobType = JobType.Unknown; } return res; }