public void Add(NameIdPair obj)
 {
     if (obj != null)
     {
         this.List.Add(obj);
     }
 }
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.ReceiveLocation location)
        {
            this.Address = location.Address;

            this.Name              = location.Name;
            this.receivePipeline   = new NameIdPair(location.ReceivePipeline.FullName, "");
            this.transportProtocol = location.TransportType.Name;
            this.data              = location.TransportTypeData;
            this.CustomDescription = location.Description;

            if (location.SendPipeline != null)
            {
                this.sendPipeline = new NameIdPair(location.SendPipeline.FullName, "");
            }
            else
            {
                this.sendPipeline = new NameIdPair("<Not configured>", "");
            }

            this.serviceWindow                  = new ServiceWindow();
            this.serviceWindow.Enabled          = location.ServiceWindowEnabled;
            this.serviceWindow.StartDateEnabled = location.StartDateEnabled;
            this.serviceWindow.EndDateEnabled   = location.EndDateEnabled;
            this.serviceWindow.EndTime          = location.ToTime;
            this.serviceWindow.StartTime        = location.FromTime;
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        /// <param name="orchestration"></param>
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.BtsOrchestration orchestration)
        {
            if (orchestration != null)
            {
                this.QualifiedName     = orchestration.AssemblyQualifiedName;
                this.Name              = orchestration.FullName;
                this.ApplicationName   = orchestration.Application.Name;
                this.CustomDescription = orchestration.Description;
                this.AssemblyName      = orchestration.AssemblyQualifiedName;

                if (orchestration.Host != null)
                {
                    this.host = new NameIdPair(orchestration.Host.Name, "");
                }

                foreach (BizTalkCore.OrchestrationPort port in orchestration.Ports)
                {
                    OrchestrationPort op = new OrchestrationPort(port.Name);
                    op.Load(port);
                    this.ports.Add(op);
                }

                this.GetInfo(orchestration);
            }
        }
        public void Load(BizTalkCore.OrchestrationPort port)
        {
            this.Name        = port.Name;
            this.BindingType = (BindingType)Enum.Parse(typeof(BindingType), ((int)port.Binding).ToString());

            this.sendPortGroupName = port.SendPortGroup != null ? new NameIdPair(port.SendPortGroup.Name, "") : null;
            this.sendPortName      = port.SendPort != null ? new NameIdPair(port.SendPort.Name, "") : null;
            this.receivePortName   = port.ReceivePort != null ? new NameIdPair(port.ReceivePort.Name, "") : null;
        }
Пример #5
0
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.Role role)
        {
            if (role != null)
            {
                this.QualifiedName   = String.Empty;
                this.serviceLinkType = role.ServiceLinkType;
                this.parentAssembly  = new NameIdPair(role.BtsAssembly.Name, "");

                foreach (BizTalkCore.EnlistedParty party in role.EnlistedParties)
                {
                    this.enlistedParties.Add(new NameIdPair(party.Party.Name, ""));
                }
            }

            return;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        internal override void FixReferences(BizTalkCore.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            Schema s = this.Application.ParentInstallation.Schemas[this.sourceSchema.Name] as Schema;

            if (s != null)
            {
                this.sourceSchema = s.NameIdPair;
            }

            s = this.Application.ParentInstallation.Schemas[this.targetSchema.Name] as Schema;

            if (s != null)
            {
                this.targetSchema = s.NameIdPair;
            }

            TraceManager.SmartTrace.TraceOut();
        }
Пример #7
0
        internal override void FixReferences(BizTalkCore.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            foreach (NameIdPair enlistedParty in this.enlistedParties)
            {
                Party party = this.Application.ParentInstallation.Parties[enlistedParty.Name] as Party;
                enlistedParty.Id = party.Id;
                party.LinkedRoles.Add(this.NameIdPair);
            }

            BizTalkAssembly asm = this.Application.ParentInstallation.Assemblies[parentAssembly.Name] as BizTalkAssembly;

            if (asm != null)
            {
                this.parentAssembly = asm.NameIdPair;
            }

            TraceManager.SmartTrace.TraceOut();
        }
Пример #8
0
        public OrchestrationRoleLink(XmlNode linkNode, XmlNamespaceManager mgr)
        {
            // Basic Info
            this.Name     = linkNode.SelectSingleNode("om:Property[@Name='Name']", mgr).Attributes.GetNamedItem("Value").Value;
            this.typeName = linkNode.SelectSingleNode("om:Property[@Name='Type']", mgr).Attributes.GetNamedItem("Value").Value;

            XmlNode initRoleNode = linkNode.SelectSingleNode("om:Property[@Name='RoleName']", mgr);

            if (initRoleNode != null)
            {
                this.initiatingRole = new NameIdPair(initRoleNode.Attributes.GetNamedItem("Value").Value, "");
            }

            // Service Link Type Info
            string shortTypeName    = this.typeName.Substring(this.typeName.LastIndexOf(".") + 1);
            string serviceTypeXpath = ".//om:Element[@Type='ServiceLinkType' and om:Property[@Value='" + shortTypeName + "']]";

            XmlNode svcLinkTypeNode = linkNode.OwnerDocument.SelectSingleNode(serviceTypeXpath, mgr);

            if (svcLinkTypeNode != null)
            {
                XmlNode providerRoleNode = svcLinkTypeNode.SelectSingleNode("om:Element[@Type='RoleDeclaration' and position()=1]", mgr);
                XmlNode consumerRoleNode = svcLinkTypeNode.SelectSingleNode("om:Element[@Type='RoleDeclaration' and position()=2]", mgr);

                if (providerRoleNode != null)
                {
                    string name = providerRoleNode.SelectSingleNode("om:Property[@Name='Name']", mgr).Attributes.GetNamedItem("Value").Value;
                    this.providerRole = new NameIdPair(name, "");
                }

                if (consumerRoleNode != null)
                {
                    string name = consumerRoleNode.SelectSingleNode("om:Property[@Name='Name']", mgr).Attributes.GetNamedItem("Value").Value;
                    this.consumerRole = new NameIdPair(name, "");
                }
            }

            return;
        }
Пример #9
0
        /// <summary>
        ///
        /// </summary>
        internal override void FixReferences(BizTalkCore.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            // Host
            if (this.Host != null)
            {
                Host h = this.Application.ParentInstallation.Hosts[this.Host.Name] as Host;

                if (h != null)
                {
                    this.host = h.NameIdPair;
                    h.HostedOrchestrations.Add(this.NameIdPair);
                }
            }

            // Ports
            foreach (OrchestrationPort port in this.ports)
            {
                if (port.ReceivePortName != null)
                {
                    ReceivePort rp = this.Application.ParentInstallation.ReceivePorts[port.ReceivePortName.Name] as ReceivePort;

                    if (rp != null)
                    {
                        port.ReceivePortName = rp.NameIdPair;
                        rp.BoundOrchestrations.Add(this.NameIdPair);
                    }
                }

                if (port.SendPortName != null)
                {
                    SendPort sp = this.Application.ParentInstallation.SendPorts[port.SendPortName.Name] as SendPort;

                    if (sp != null)
                    {
                        port.SendPortName = sp.NameIdPair;
                        sp.BoundOrchestrations.Add(this.NameIdPair);
                    }
                }

                if (port.SendPortGroupName != null)
                {
                    SendPortGroup spg = this.Application.ParentInstallation.SendPortGroups[port.SendPortGroupName.Name] as SendPortGroup;

                    if (spg != null)
                    {
                        port.SendPortGroupName = spg.NameIdPair;
                        spg.BoundOrchestrations.Add(this.NameIdPair);
                    }
                }
            }

            // Maps
            foreach (NameIdPair transform in this.transforms)
            {
                Transform t = this.Application.ParentInstallation.Maps[transform.Name] as Transform;

                if (t != null)
                {
                    transform.Id = t.NameIdPair.Id;
                    t.Orchestrations.Add(this.NameIdPair);
                }
            }

            // Role links
            foreach (OrchestrationRoleLink roleLink in this.roleLinks)
            {
                if (roleLink.ConsumerRole != null)
                {
                    Role role = this.Application.ParentInstallation.Roles[roleLink.ConsumerRole.Name] as Role;

                    if (role != null)
                    {
                        roleLink.ConsumerRole.Id = role.Id;
                    }
                }

                if (roleLink.ProviderRole != null)
                {
                    Role role = this.Application.ParentInstallation.Roles[roleLink.ProviderRole.Name] as Role;

                    if (role != null)
                    {
                        roleLink.ProviderRole.Id = role.Id;
                    }
                }

                if (roleLink.InitiatingRole != null)
                {
                    Role role = this.Application.ParentInstallation.Roles[roleLink.InitiatingRole.Name] as Role;

                    if (role != null)
                    {
                        roleLink.InitiatingRole.Id = role.Id;
                    }
                }
            }

            // Shape Map
            if (this.artifactData != string.Empty && this.viewData != string.Empty)
            {
                try
                {
                    Bitmap bmp = this.GetImage();
                    bmp.Dispose();

                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(this.ArtifactData);

                    XmlNamespaceManager xnm = new XmlNamespaceManager(doc.NameTable);
                    xnm.AddNamespace("om", "http://schemas.microsoft.com/BizTalk/2003/DesignerData");

                    foreach (OrchShape os in this.ShapeMap)
                    {
                        switch (os.ShapeType)
                        {
                        case ShapeType.ReceiveShape:
                        case ShapeType.SendShape:
                            XmlNode shapeNode = doc.SelectSingleNode("//om:Element[@OID='" + os.Id + "']", xnm);

                            if (shapeNode != null)
                            {
                                os.PortName      = shapeNode.SelectSingleNode("om:Property[@Name='PortName']/@Value", xnm).Value;
                                os.OperationName = shapeNode.SelectSingleNode("om:Property[@Name='OperationName']/@Value", xnm).Value;
                                os.MessageName   = shapeNode.SelectSingleNode("om:Property[@Name='MessageName']/@Value", xnm).Value;
                            }
                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    TraceManager.SmartTrace.TraceError(ex);
                }
            }

            TraceManager.SmartTrace.TraceOut();
            return;
        }
Пример #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        internal override void FixReferences(Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            BizTalkCore.ReceivePort port = explorer.ReceivePorts[this.Name];

            if (port != null)
            {
                // Outbound Transforms
                if (port.OutboundTransforms != null)
                {
                    foreach (BizTalkCore.Transform transform in port.OutboundTransforms)
                    {
                        Transform t = this.Application.Maps[transform.FullName] as Transform;

                        if (t != null)
                        {
                            t.ReceivePorts.Add(this.NameIdPair);
                            this.outboundMaps.Add(t.NameIdPair);
                        }
                    }
                }

                // Inbound Transforms
                if (port.InboundTransforms != null)
                {
                    foreach (BizTalkCore.Transform transform in port.InboundTransforms)
                    {
                        Transform t = this.Application.Maps[transform.FullName] as Transform;

                        if (t != null)
                        {
                            t.ReceivePorts.Add(this.NameIdPair);
                            this.inboundMaps.Add(t.NameIdPair);
                        }
                    }
                }

                // Locations
                try
                {
                    foreach (ReceiveLocation location in this.receiveLocations)
                    {
                        NameIdPair nameIdPair = new NameIdPair(location.Name, this.Id);

                        Pipeline pl = this.Application.ParentInstallation.Pipelines[location.ReceivePipeline.Name] as Pipeline;

                        if (pl != null)
                        {
                            //Colin Dijkgraaf 20141010
                            //location.ReceivePipeline = pl.NameIdPair;
                            //pl.ReceiveLocations.Add(nameIdPair);
                            if (pl.Name == location.ReceivePipeline.Name)  // Actually check that a match was found.
                            {
                                location.ReceivePipeline = pl.NameIdPair;
                                pl.ReceiveLocations.Add(nameIdPair);
                            }
                        }

                        if (this.twoWay)
                        {
                            pl = this.Application.ParentInstallation.Pipelines[location.SendPipeline.Name] as Pipeline;

                            if (pl != null)
                            {
                                //Colin Dijkgraaf 20141010
                                //location.SendPipeline = pl.NameIdPair;
                                if (pl.Name == location.SendPipeline.Name)  // Actually check that a match was found.
                                {
                                    location.SendPipeline = pl.NameIdPair;
                                }
                            }
                        }

                        Protocol p = this.Application.ParentInstallation.ProtocolTypes[location.TransportProtocol] as Protocol;

                        if (p != null)
                        {
                            p.ReceiveLocations.Add(nameIdPair);

                            //foreach (NameIdPair handler in p.ReceiveHandlers)CD 20140402
                            //{
                            //Host h = this.Application.ParentInstallation.Hosts[handler.Name] as Host;
                            Host h = this.Application.ParentInstallation.Hosts[port.PrimaryReceiveLocation.ReceiveHandler.Name] as Host;

                            if (h != null)
                            {
                                h.HostedReceiveLocations.Add(nameIdPair);
                                location.ReceiveHandler = h.NameIdPair;
                            }
                            //}
                        }
                    }
                }
                catch (Exception ex)
                {
                    TraceManager.SmartTrace.TraceError(ex);
                }

                TraceManager.SmartTrace.TraceOut();
                return;
            }
        }
Пример #11
0
        /// <summary>
        ///
        /// </summary>
        internal override void FixReferences(BizTalkCore.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            // Host
            if (this.Host != null)
            {
                Host h = this.Application.ParentInstallation.Hosts[this.Host.Name] as Host;

                if (h != null)
                {
                    this.host = h.NameIdPair;
                    h.HostedOrchestrations.Add(this.NameIdPair);
                }
            }

            // Ports
            foreach (OrchestrationPort port in this.ports)
            {
                if (port.ReceivePortName != null)
                {
                    ReceivePort rp = this.Application.ParentInstallation.ReceivePorts[port.ReceivePortName.Name] as ReceivePort;

                    if (rp != null)
                    {
                        port.ReceivePortName = rp.NameIdPair;
                        rp.BoundOrchestrations.Add(this.NameIdPair);
                    }
                }

                if (port.SendPortName != null)
                {
                    SendPort sp = this.Application.ParentInstallation.SendPorts[port.SendPortName.Name] as SendPort;

                    if (sp != null)
                    {
                        port.SendPortName = sp.NameIdPair;
                        sp.BoundOrchestrations.Add(this.NameIdPair);
                    }
                }

                if (port.SendPortGroupName != null)
                {
                    SendPortGroup spg = this.Application.ParentInstallation.SendPortGroups[port.SendPortGroupName.Name] as SendPortGroup;

                    if (spg != null)
                    {
                        port.SendPortGroupName = spg.NameIdPair;
                        spg.BoundOrchestrations.Add(this.NameIdPair);
                    }
                }
            }

            // Maps
            foreach (NameIdPair transform in this.transforms)
            {
                Transform t = this.Application.ParentInstallation.Maps[transform.Name] as Transform;

                if (t != null)
                {
                    transform.Id = t.NameIdPair.Id;
                    t.Orchestrations.Add(this.NameIdPair);
                }
            }

            // Role links
            foreach (OrchestrationRoleLink roleLink in this.roleLinks)
            {
                if (roleLink.ConsumerRole != null)
                {
                    Role role = this.Application.ParentInstallation.Roles[roleLink.ConsumerRole.Name] as Role;

                    if (role != null)
                    {
                        roleLink.ConsumerRole.Id = role.Id;
                    }
                }

                if (roleLink.ProviderRole != null)
                {
                    Role role = this.Application.ParentInstallation.Roles[roleLink.ProviderRole.Name] as Role;

                    if (role != null)
                    {
                        roleLink.ProviderRole.Id = role.Id;
                    }
                }

                if (roleLink.InitiatingRole != null)
                {
                    Role role = this.Application.ParentInstallation.Roles[roleLink.InitiatingRole.Name] as Role;

                    if (role != null)
                    {
                        roleLink.InitiatingRole.Id = role.Id;
                    }
                }
            }

            // Shape Map
            if (this.artifactData != string.Empty && this.viewData != string.Empty)
            {
                try
                {
                    Bitmap bmp = this.GetImage();
                    bmp.Dispose();

                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(this.ArtifactData);

                    XmlNamespaceManager xnm = new XmlNamespaceManager(doc.NameTable);
                    xnm.AddNamespace("om", "http://schemas.microsoft.com/BizTalk/2003/DesignerData");

                    foreach (OrchShape os in this.ShapeMap)
                    {
                        switch (os.ShapeType)
                        {
                        case ShapeType.ReceiveShape:
                        case ShapeType.SendShape:
                            XmlNode shapeNode = doc.SelectSingleNode("//om:Element[@OID='" + os.Id + "']", xnm);

                            if (shapeNode != null)
                            {
                                os.PortName      = shapeNode.SelectSingleNode("om:Property[@Name='PortName']/@Value", xnm).Value;
                                os.OperationName = shapeNode.SelectSingleNode("om:Property[@Name='OperationName']/@Value", xnm).Value;
                                os.MessageName   = shapeNode.SelectSingleNode("om:Property[@Name='MessageName']/@Value", xnm).Value;
                            }
                            break;

                        case ShapeType.TransformShape:     // NJB TransformShape  -- CD Tidied this code.
                            XmlNode shapeNode2 = doc.SelectSingleNode("//om:Element[@OID='" + os.Id + "']", xnm);
                            XmlNode name       = shapeNode2.SelectSingleNode("om:Property[@Name='ClassName']/@Value", xnm);

                            if (name != null)
                            {
                                os.TransformName = name.Value;
                            }

                            XmlNodeList messagesIn = shapeNode2.SelectNodes("om:Element[@ParentLink='Transform_InputMessagePartRef']", xnm);

                            if (messagesIn != null)
                            {
                                foreach (XmlNode selectNode in messagesIn)
                                {
                                    foreach (XmlNode detail in selectNode.ChildNodes)
                                    {
                                        if (detail.Attributes != null)
                                        {
                                            if (detail.Attributes["Name"].Value == "MessageRef")
                                            {
                                                os.InputMessage += detail.Attributes["Value"].Value + ',';
                                            }
                                        }
                                    }
                                }
                            }

                            if (!string.IsNullOrEmpty(os.InputMessage))
                            {
                                os.InputMessage = os.InputMessage.Remove(os.InputMessage.LastIndexOf(","));
                            }

                            XmlNodeList messagesOut = shapeNode2.SelectNodes("om:Element[@ParentLink='Transform_OutputMessagePartRef']", xnm);

                            if (messagesOut != null)
                            {
                                foreach (XmlNode selectNode in messagesOut)
                                {
                                    foreach (XmlNode detail in selectNode.ChildNodes)
                                    {
                                        if (detail.Attributes != null)
                                        {
                                            if (detail.Attributes["Name"].Value == "MessageRef")
                                            {
                                                os.OutputMessage += detail.Attributes["Value"].Value + ',';
                                            }
                                        }
                                    }
                                }
                            }

                            if (!string.IsNullOrEmpty(os.OutputMessage))
                            {
                                os.OutputMessage = os.OutputMessage.Remove(os.OutputMessage.LastIndexOf(","));
                            }

                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    TraceManager.SmartTrace.TraceError(ex);
                }
            }

            TraceManager.SmartTrace.TraceOut();
            return;
        }
Пример #12
0
        //public NameIdPair SendHandler
        //{
        //    get { return this.sendHandler; }
        //    set { this.sendHandler = value; }
        //}

        #endregion

        #region Load

        /// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        /// <param name="port"></param>
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.SendPort port)
        {
            if (port != null)
            {
                this.QualifiedName = String.Empty;
                // Basic properties
                this.trackingType = (TrackingType)Enum.Parse(typeof(TrackingType), ((int)port.Tracking).ToString());
                this.priority     = port.Priority;
                this.twoWay       = port.IsTwoWay;
                this.dynamic      = port.IsDynamic;
                //this.sendPipeline = port.SendPipeline.FullName;

                // Fix so to have link for Send Pipeline  CD 20140404
                Pipeline pl = this.Application.ParentInstallation.Pipelines[port.SendPipeline.FullName] as Pipeline;
                if (pl != null)
                {
                    if (pl.Name == port.SendPipeline.FullName)  // Actually check that a match was found.
                    {
                        this.sendPipeline = pl.NameIdPair;
                    }
                    else
                    {
                        this.sendPipeline = new NameIdPair(port.SendPipeline.FullName, "");
                    }
                }

                this.ApplicationName      = port.Application.Name;
                this.RouteFailedMessage   = port.RouteFailedMessage;
                this.StopSendingOnFailure = port.StopSendingOnFailure;
                this.CustomDescription    = port.Description;

                // Encryption Certificates
                if (port.EncryptionCert != null)
                {
                    this.encryptionCert = new EncryptionCert(port.EncryptionCert);
                }

                // Receive pipeline if two way
                if (this.twoWay)
                {
                    //this.receivePipeline = port.ReceivePipeline.FullName; CD 20140405
                    Pipeline rpl = this.Application.ParentInstallation.Pipelines[port.ReceivePipeline.FullName] as Pipeline;
                    if (rpl != null)
                    {
                        if (rpl.Name == port.ReceivePipeline.FullName)  // Actually check that a match was found.
                        {
                            this.ReceivePipeline = rpl.NameIdPair;
                        }
                        else
                        {
                            this.ReceivePipeline = new NameIdPair(port.ReceivePipeline.FullName, "");
                        }
                    }
                }

                // Primary transport
                if (port.PrimaryTransport != null)
                {
                    this.primaryTransport = new TransportInfo(port.PrimaryTransport, true);
                }

                // Secondary transport
                if (port.SecondaryTransport != null && port.SecondaryTransport.Address.Length > 0)
                {
                    this.secondaryTransport = new TransportInfo(port.SecondaryTransport, false);
                }

                // Filters
                if (port.Filter != string.Empty)
                {
                    this.FilterGroups = BizTalkInstallation.CreateFilterGroups(port.Filter);
                }
            }
        }