コード例 #1
0
        internal static void SetPipelineReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.Pipeline> omPipelines)
        {
            Log.Info("Sets model references for pipelines");

            foreach (var omPipeline in omPipelines)
            {
                Log.Debug("Sets references for pipeline {0}", omPipeline.FullName);
                var pipeline = artifacts.Pipelines[omPipeline.Id()];
                PipelineModelTransformer.SetReferences(pipeline, artifacts, omPipeline);
            }
        }
コード例 #2
0
        internal static void SetReceivePortReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.ReceivePort> receivePorts)
        {
            Log.Info("Sets model references for receive ports");

            foreach (var omReceivePort in receivePorts)
            {
                Log.Debug("Sets references for receive port {0}", omReceivePort.Name);
                var receivePort = artifacts.ReceivePorts[omReceivePort.Id()];
                ReceivePortModelTransformer.SetReferences(receivePort, artifacts, omReceivePort);
            }
        }
コード例 #3
0
        internal static void SetOrchestrationReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.BtsOrchestration> omOrchestrations)
        {
            Log.Info("Sets model references for orchestrations");

            foreach (var omOrchestration in omOrchestrations)
            {
                Log.Debug("Sets references for orchestration {0}", omOrchestration.FullName);
                var orchestration = artifacts.Orchestrations[omOrchestration.Id()];
                OrchestrationModelTransformer.SetReferences(orchestration, artifacts, omOrchestration);
            }
        }
コード例 #4
0
        internal static void SetAssemblyReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.BtsAssembly> omAssemblies)
        {
            Log.Info("Sets model references for assemblies");

            foreach (var omAssembly in omAssemblies)
            {
                Log.Debug("Sets references for assembly {0}", omAssembly.DisplayName);
                var assembly = artifacts.Assemblies[omAssembly.Id()];
                BizTalkAssemblyModelTransformer.SetReferences(assembly, artifacts, omAssembly);
            }
        }
コード例 #5
0
        internal static void SetSchemaReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.Schema> schemas)
        {
            Log.Info("Sets model references for schemas");

            var transformer = new SchemaModelTransformer();
            foreach (var omSchema in schemas)
            {
                Log.Debug("Sets references for schema {0}", omSchema.FullName);
                var schema = artifacts.Schemas[omSchema.Id()];
                transformer.SetReferences(schema, artifacts, omSchema);
            }
        }
コード例 #6
0
        internal static void SetHostReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.Host> omHosts, 
            IEnumerable<Microsoft.BizTalk.ExplorerOM.BtsOrchestration> omOrchestrations,
            IEnumerable<Microsoft.BizTalk.ExplorerOM.SendPort> omSendPorts,
            IEnumerable<Microsoft.BizTalk.ExplorerOM.ReceivePort> omReceivePorts)
        {
            Log.Info("Sets model references for hosts");

            foreach (var omHost in omHosts)
            {
                Log.Debug("Sets references for host {0}", omHost.Name);
                var host = artifacts.Hosts[omHost.Id()];
                HostModelTransformer.SetReferences(host, artifacts, omOrchestrations, omSendPorts, omReceivePorts);
            }
        }
コード例 #7
0
        public void ExportApplicationData(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.Application> omApplications)
        {
            Log.Info("Sets model references and serializes applications");

            foreach (var omApplication in omApplications)
            {
                //First we get the application
                var application = artifacts.Applications[omApplication.Id()];

                Log.Debug(string.Format("Sets references references for application {0}", application.Name));

                //Then we iterate over references artefact below to add a reference to then in the current application
                foreach (Microsoft.BizTalk.ExplorerOM.Application omReferencingApplication in omApplication.References)
                {
                    if (artifacts.Applications.ContainsKey(omReferencingApplication.Id()))
                        application.ReferencedApplications.Add(artifacts.Applications[omReferencingApplication.Id()]);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.BtsOrchestration omOrchestration in omApplication.Orchestrations)
                {
                    var orchestration = artifacts.Orchestrations[omOrchestration.Id()];

                    if (!application.Orchestrations.ContainsKey(orchestration.Id))
                        application.Orchestrations.Add(orchestration.Id, orchestration);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.Schema omSchema in omApplication.Schemas)
                {
                    var schema = artifacts.Schemas[omSchema.Id()];

                    if (!application.Schemas.ContainsKey(schema.Id))
                        application.Schemas.Add(schema.Id, schema);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.Transform omTransform in omApplication.Transforms)
                {
                    var transform = artifacts.Transforms[omTransform.Id()];

                    if (!application.Maps.ContainsKey(transform.Id))
                        application.Maps.Add(transform.Id, transform);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.ReceivePort omReceivePort in omApplication.ReceivePorts)
                {
                    var receivePort = artifacts.ReceivePorts[omReceivePort.Id()];

                    if (!application.ReceivePorts.ContainsKey(receivePort.Id))
                        application.ReceivePorts.Add(receivePort.Id, receivePort);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.SendPort omSendPort in omApplication.SendPorts)
                {
                    var sendPort = artifacts.SendPorts[omSendPort.Id()];

                    if (!application.SendPorts.ContainsKey(sendPort.Id))
                        application.SendPorts.Add(sendPort.Id, sendPort);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.SendPortGroup omSendPortGroup in omApplication.SendPortGroups)
                {
                    var sendPortGroup = artifacts.SendPortGroups[omSendPortGroup.Id()];

                    if (!application.SendPortGroups.ContainsKey(sendPortGroup.Id))
                        application.SendPortGroups.Add(sendPortGroup.Id, sendPortGroup);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.BtsAssembly omAssembly in omApplication.Assemblies)
                {
                    var assembly = artifacts.Assemblies[omAssembly.Id()];

                    if (!application.Assemblies.ContainsKey(assembly.Id))
                        application.Assemblies.Add(assembly.Id, assembly);
                }

                foreach (Microsoft.BizTalk.ExplorerOM.Pipeline omPipeline in omApplication.Pipelines)
                {
                    var pipeline = artifacts.Pipelines[omPipeline.Id()];

                    if (!application.Pipelines.ContainsKey(pipeline.Id))
                        application.Pipelines.Add(pipeline.Id, pipeline);
                }

                Log.Debug("Serializes Application {0} to disk", application.Id);

                using (var fs = new FileStream(Path.Combine(_applicationDataExportPath, application.Id + ".gz"), FileMode.Create))
                using (var gz = new GZipStream(fs, CompressionMode.Compress))
                {
                    new BinaryFormatter().Serialize(gz, application);
                }
            }
        }
コード例 #8
0
        public void ExportHostData(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.Host> omHosts)
        {
            Log.Info("Sets model references and serializes hosts");

            foreach (var omHost in omHosts)
            {
                var host = artifacts.Hosts[omHost.Id()];

                Log.Debug("Serializes Host {0} to disk", host.Id);

                using (var fs = new FileStream(Path.Combine(_hostDataExportPath, host.Id + ".gz"), FileMode.Create))
                using (var gz = new GZipStream(fs, CompressionMode.Compress))
                {
                    new BinaryFormatter().Serialize(gz, host);
                }
            }
        }
コード例 #9
0
        internal static void SetSendPortGroupReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.SendPortGroup> sendPortsGroup)
        {
            Log.Info("Sets model references for send ports groups");

            foreach (var omSendPortGroup in sendPortsGroup)
            {
                Log.Debug("Sets references for send port group {0}", omSendPortGroup.Name);
                var sendPortGroup = artifacts.SendPortGroups[omSendPortGroup.Id()];
                SendPortGroupModelTransformer.SetReferences(sendPortGroup, artifacts, omSendPortGroup);
            }
        }
コード例 #10
0
        internal static void SetTransformReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.Transform> omTransforms)
        {
            Log.Info("Sets model references for maps");

            foreach (var omTransform in omTransforms)
            {
                Log.Debug("Sets references for map {0}", omTransform.FullName);
                var transform = artifacts.Transforms[omTransform.Id()];
                TransformModelTransformer.SetReferences(transform, artifacts, omTransform);
            }
        }
コード例 #11
0
        internal static void SetSendPortReferences(BizTalkArtifacts artifacts, IEnumerable<Microsoft.BizTalk.ExplorerOM.SendPort> sendPorts)
        {
            Log.Info("Sets model references for send ports");

            foreach (var omSendPort in sendPorts)
            {
                Log.Debug("Sets references for send port {0}", omSendPort.Name);
                var sendPort = artifacts.SendPorts[omSendPort.Id()];
                SendPortModelTransformer.SetReferences(sendPort, artifacts, omSendPort);
            }
        }