public ActionResult ReceivePort(string applicationName, string artifactid, string version) { Manifest manifest = ManifestReader.GetCurrentManifest(version, Request.PhysicalApplicationPath); BizTalkInstallation installation = InstallationReader.GetBizTalkInstallation(manifest); BizTalkApplication application = installation.Applications[applicationName]; ReceivePort receivePort = application.ReceivePorts[artifactid]; var breadCrumbs = new List <BizTalkBaseObject> { application, receivePort }; return(View(new ReceivePortViewModel( application, ManifestReader.GetAllManifests(Request.PhysicalApplicationPath), manifest, breadCrumbs, installation.Applications.Values, installation.Hosts.Values, receivePort))); }
public ActionResult Assembly(string applicationName, string artifactid, string version) { Manifest manifest = ManifestReader.GetCurrentManifest(version, Request.PhysicalApplicationPath); BizTalkInstallation installation = InstallationReader.GetBizTalkInstallation(manifest); BizTalkApplication application = installation.Applications[applicationName]; BizTalkAssembly assembly = application.Assemblies[artifactid]; var breadCrumbs = new List <BizTalkBaseObject> { application, assembly }; return(View(new AssemblyViewModel( application, ManifestReader.GetAllManifests(Request.PhysicalApplicationPath), manifest, breadCrumbs, installation.Applications.Values, installation.Hosts.Values, assembly))); }
public ActionResult SendPortGroup(string applicationName, string artifactid, string version) { Manifest manifest = ManifestReader.GetCurrentManifest(version, Request.PhysicalApplicationPath); BizTalkInstallation installation = InstallationReader.GetBizTalkInstallation(manifest); BizTalkApplication application = installation.Applications[applicationName]; SendPortGroup sendPortGroup = application.SendPortGroups[artifactid]; var breadCrumbs = new List <BizTalkBaseObject> { application, sendPortGroup }; return(View(new SendPortGroupViewModel( application, ManifestReader.GetAllManifests(Request.PhysicalApplicationPath), manifest, breadCrumbs, installation.Applications.Values, installation.Hosts.Values, sendPortGroup))); }
public ActionResult Map(string applicationName, string artifactid, string version) { Manifest manifest = ManifestReader.GetCurrentManifest(version, Request.PhysicalApplicationPath); BizTalkInstallation installation = InstallationReader.GetBizTalkInstallation(manifest); BizTalkApplication application = installation.Applications[applicationName]; Transform transform = application.Maps[artifactid]; var breadCrumbs = new List <BizTalkBaseObject> { application, transform }; return(View(new TransformViewModel( application, ManifestReader.GetAllManifests(Request.PhysicalApplicationPath), manifest, breadCrumbs, installation.Applications.Values, installation.Hosts.Values, transform))); }
private static void ReadSerializedArtefacts(BizTalkInstallation installation, Manifest manifest, string artefactPath, Action <BizTalkInstallation, string, GZipStream> artefactsToAdd) { foreach (var file in Directory.EnumerateFiles(Path.Combine(manifest.Path, artefactPath))) { using (var fs = new FileStream(Path.Combine(manifest.Path, file), FileMode.Open, FileAccess.Read, FileShare.None)) { using (var gz = new GZipStream(fs, CompressionMode.Decompress)) { artefactsToAdd(installation, file, gz); } } } }
public ActionResult Index(string version) { Manifest manifest = ManifestReader.GetCurrentManifest(version, Request.PhysicalApplicationPath); BizTalkInstallation installation = InstallationReader.GetBizTalkInstallation(manifest); var breadCrumbs = new List <BizTalkBaseObject>(); return(View(new HomeViewModel( ManifestReader.GetAllManifests(Request.PhysicalApplicationPath), manifest, breadCrumbs, installation.Applications.Values, installation.Hosts.Values))); }
private static BizTalkInstallation ReadBizTalkInstallation(Manifest manifest) { //We'll add the current version that has been read to cache so we can get at it quicker var installation = HttpRuntime.Cache.Get(manifest.Version) as BizTalkInstallation; //If we have it in cache we'll use that if (installation != null) { return(installation); } installation = new BizTalkInstallation(); ReadSerializedArtefacts(installation, manifest, Constants.ApplicationDataPath, AddApplication); ReadSerializedArtefacts(installation, manifest, Constants.HostDataPath, AddHost); HttpRuntime.Cache.Clear(); HttpRuntime.Cache.Insert(manifest.Version, installation); return(installation); }
/// <summary> /// /// </summary> /// <param name="coll"></param> /// <returns></returns> private BizTalkBaseObjectCollection RetrieveDeployedOrchestrations(AssemblyOrchestrationPairCollection coll, ReportingConfiguration reportingConfiguration) { // darrenj BizTalkInstallation bi = new BizTalkInstallation(); // Ilya - 08/2007: get the Mgmt DB server / name from the Reporting Configuration bi.MgmtDatabaseName = reportingConfiguration.MgmtDatabaseName; bi.Server = reportingConfiguration.MgmtServerName; BizTalkBaseObjectCollection orchestrations = new BizTalkBaseObjectCollection(); string ConnectionStringFormat = "Server={0};Database={1};Integrated Security=SSPI"; BtsCatalogExplorer explorer = new BtsCatalogExplorer(); explorer.ConnectionString = string.Format(ConnectionStringFormat, reportingConfiguration.MgmtServerName, reportingConfiguration.MgmtDatabaseName); foreach (BtsAssembly btsAssembly in explorer.Assemblies) { string asmName = btsAssembly.DisplayName; if (!btsAssembly.IsSystem && coll.ContainsAssembly(asmName)) { foreach (BtsOrchestration btsOrchestration in btsAssembly.Orchestrations) { if (coll.ContainsOrchestration(asmName, btsOrchestration.FullName)) { Orchestration orchestration = bi.GetOrchestration(btsAssembly.DisplayName, btsOrchestration.FullName); orchestration.ParentAssemblyFormattedName = btsAssembly.DisplayName; orchestrations.Add(orchestration); } } } } return(orchestrations); }
private static void AddApplication(BizTalkInstallation installation, string file, GZipStream gz) { installation.Applications.Add(Path.GetFileNameWithoutExtension(file), (BizTalkApplication) new BinaryFormatter().Deserialize(gz)); }
/// <summary> /// /// </summary> private void GenerateDocumentation() { Cursor.Current = Cursors.WaitCursor; try { linkLabel6.Visible = false; progressBar1.Visible = true; if (!Utility.ValidateReportName(documenter.ReportName)) { throw new ApplicationException("Report title contains some invalid characters."); } BizTalkInstallation bi = new BizTalkInstallation(); bi.Server = this.server; bi.MgmtDatabaseName = this.mgmtDatabaseName; //documenter.Application = bi.GetApplicationDetail(this.appName); documenter.PercentageDocumentationComplete += new UpdatePercentageComplete(DocumenterPercentageDocumentationComplete); //if (radioAssembly.Checked == true) //{ // if (clbApplications.CheckedItems.Count == 0) // { // MessageBox.Show("No applications have been selected for documentation", "Error Generating Documentation", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); // return; // } // foreach (object item in clbApplications.CheckedItems) // { // string appName = item.ToString(); // BizTalkInstallation bi = new BizTalkInstallation(); // bi.Server = this.txtServerName.Text; // bi.MgmtDatabaseName = this.textBox1.Text; // documenter.Application = bi.GetApplicationDetail(appName); // break; // } // documenter.PublishType = PublishType.SpecificApplication; //} //else if (radioSchema.Checked == true) //{ // documenter.PublishType = PublishType.SchemaOnly; //} //if (executionMode == ExecutionMode.Interactive) //{ // documenter.Publisher = DeterminePublisher(this.comboBox1.SelectedItem.ToString()); //} //documenter.PublishType = PublishType.SpecificApplication; documenter.PublishType = PublishType.EntireConfiguration; documenter.ResourceFolder = this.txtResourceFolderName.Text; documenter.Publisher = DeterminePublisher(this.comboBox2.SelectedItem.ToString()); documenter.GenerateDocumentation(); } catch (Exception ex) { #if (DEBUG) MessageBox.Show(ex.ToString()); #endif MessageBox.Show(ex.Message, "Error Generating Documentation", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { progressBar1.Visible = false; linkLabel6.Visible = true; Cursor.Current = Cursors.Default; } return; }
/// <summary> /// /// </summary> public void GenerateDocumentation() { try { if (this.Publisher == null) { throw new ApplicationException("Error initialising documentation publisher"); } this.Publisher.PercentageDocumentationComplete += new UpdatePercentageComplete(Publisher_PercentageDocumentationComplete); //============================================ // Prepare the environment for the doc run //============================================ if (!Publisher.Prepare()) { return; } Publisher_PercentageDocumentationComplete(10); BizTalkInstallation bi = new BizTalkInstallation(); if (string.Compare("localhost", this.Server, true) == 0 || string.Compare("(local)", this.Server, true) == 0 || string.Compare(".", this.Server, true) == 0) { this.Server = Environment.GetEnvironmentVariable("COMPUTERNAME"); } bi.Server = this.Server; bi.MgmtDatabaseName = this.Database; bi.RulesServer = this.RulesServer; bi.RulesDatabase = this.RulesDatabase; if (this.PublishType == PublishType.SpecificApplication) { bi.LoadConfig(this.Applications, this.IncludeReferences); } else { bi.LoadConfig(); } string[] ssoLocations = { SsoStage, SsoTest, SsoProd }; this.Publisher.Publish(bi, this.PublishType, this.ResourceFolder, this.OutputDir, this.ReportName, this.DocumentRules, ssoLocations, this.SsoApplications, this.BizTalkXmlConfig , RulesPolicyFilters, RulesVocabularyFilters, HostFilters, AdapterFilters); // PCA 2015-01-06 //this.Publisher.Publish(bi, this.PublishType, this.ResourceFolder, this.OutputDir, this.ReportName, this.DocumentRules); MTB 20130308 bi = null; if (this.ShowOutput) { this.Publisher.ShowOutput(); } } catch (Exception ex) { TraceManager.SmartTrace.TraceError(ex); Console.WriteLine(ex.ToString()); throw; } finally { //============================================ // And cleanup - Done! //============================================ if (this.Publisher != null) { this.Publisher.Cleanup(); } } return; }
/// <summary> /// Display orchestration view pane... /// </summary> /// <param name="orchestrationName"></param> /// <param name="assemblyName"></param> private void DisplayOrchestration(string orchestrationName, string assemblyName) { try { BizTalkInstallation bizTalkInstallation = new BizTalkInstallation(); bizTalkInstallation.Server = BCCOperator.BizTalkSQLServer(); bizTalkInstallation.MgmtDatabaseName = BCCOperator.BizTalkMgmtDb(); Orchestration oInstance = bizTalkInstallation.GetOrchestration(assemblyName, orchestrationName); if (oInstance != null) { string filePath = BuildFilePath(oInstance.Name); if (File.Exists(filePath)) { File.Delete(filePath); } if (oInstance.SaveAsImage(filePath)) { // Left side panel this.leftSideView.Controls.Add(ShowOrchestration(oInstance.Name, orchestrationName)); } if (oInstance.ShapeMap.Count > 0) { XslCompiledTransform orchCodeTransform = new XslCompiledTransform(); XmlTextReader xr = new XmlTextReader(new StreamReader(StylesheetPath("Header"))); orchCodeTransform.Load(xr, XsltSettings.Default, new XmlUrlResolver()); xr.Close(); XsltArgumentList orchCodeXsltArgs = new XsltArgumentList(); string header = WriteTransformedXmlDataToString2( oInstance.GetXml(), orchCodeTransform, orchCodeXsltArgs); Label lblOrchData = new Label(); lblOrchData.Text = header; lblOrchData.BorderStyle = BorderStyle.Solid; lblOrchData.BorderWidth = Unit.Pixel(2); lblOrchData.ToolTip = "Orchestration header section"; // Right side panel this.rightSideView.Controls.Add(lblOrchData); // Right side panel this.rightSideView.Controls.Add(new LiteralControl("<br/><br/>")); // Orchestration data orchCodeTransform = new XslCompiledTransform(); xr = new XmlTextReader(new StreamReader(StylesheetPath("Body") ) ); orchCodeTransform.Load(xr, XsltSettings.Default, new XmlUrlResolver()); xr.Close(); orchCodeXsltArgs = new XsltArgumentList(); orchCodeXsltArgs.AddParam("OrchName", string.Empty, oInstance.Name); string body = WriteTransformedXmlDataToString( oInstance.ArtifactData, orchCodeTransform, orchCodeXsltArgs); Label lblOrchData2 = new Label(); lblOrchData2.Text = body; lblOrchData2.BorderStyle = BorderStyle.Solid; lblOrchData2.BorderWidth = Unit.Pixel(2); lblOrchData2.ToolTip = "Orchestration body section"; // Right side panel this.rightSideView.Controls.Add(lblOrchData2); } else { // Right side panel this.rightSideView.Controls.Add(new LiteralControl("No orchestration shapes were found.")); } } } catch (Exception exception) { this.leftSideView.Controls.Add(new LiteralControl("Exception:" + exception.Message + ". Try refreshing the page or recycling the application pool.")); } }