Example #1
0
        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)));
        }
        internal static void SetReferences(SendPortGroup sendPortGroup, BizTalkArtifacts artifacts, Microsoft.BizTalk.ExplorerOM.SendPortGroup omSendPortGroup)
        {
            sendPortGroup.Application = artifacts.Applications[omSendPortGroup.Application.Id()];

            var sendPortIds = omSendPortGroup.SendPorts.Cast <Microsoft.BizTalk.ExplorerOM.SendPort>().Select(s => s.Id());

            sendPortGroup.SendPorts.AddRange(artifacts.SendPorts.Where(t => sendPortIds.Contains(t.Key)).Select(s => s.Value));
        }
        internal static SendPortGroup TransformModel(Microsoft.BizTalk.ExplorerOM.SendPortGroup omSendPortGroup)
        {
            var sendPortGroup = new SendPortGroup();

            sendPortGroup.Name         = omSendPortGroup.Name;
            sendPortGroup.Description  = omSendPortGroup.Description;
            sendPortGroup.FilterGroups = FilterGroupTransformer.CreateFilterGroups(omSendPortGroup.Filter);

            return(sendPortGroup);
        }
Example #4
0
        protected override bool ControlIndividualArtifact(string name, Dictionary <string, object> metadata, BtsCatalogExplorer catalog, Application app)
        {
            SendPortGroup inst = app.SendPortGroups[name];

            PortStatus status = inst.Status;

            ActionType action = (ActionType)metadata[ActionMetadataKey];

            switch (action)
            {
            case ActionType.Enlist:
                if (status == PortStatus.Bound)
                {
                    this.Log.LogMessage(action.ToString() + "ing send port group '" + name + "'...");
                    inst.Status = PortStatus.Stopped;
                    return(true);
                }
                break;

            case ActionType.Unenlist:
                if (status != PortStatus.Bound)
                {
                    this.Log.LogMessage("Unenlisting send port group '" + name + "'...");
                    inst.Status = PortStatus.Bound;
                    return(true);
                }
                break;

            case ActionType.Start:
                if (status != PortStatus.Started)
                {
                    this.Log.LogMessage("Starting send port group '" + name + "'...");
                    inst.Status = PortStatus.Started;
                    return(true);
                }
                break;

            case ActionType.Stop:
                if (status == PortStatus.Started)
                {
                    this.Log.LogMessage(action.ToString() + "ing send port group '" + name + "'...");
                    inst.Status = PortStatus.Stopped;
                    return(true);
                }
                break;
            }

            return(false);
        }
Example #5
0
        static void UnenlistSendPortGroup(SendPortGroup sendPortGroup)
        {
            try
            {
                sendPortGroup.Status = PortStatus.Bound;

                // Also to un-enlist all the send ports under the send port group
                foreach (SendPort sendPort in sendPortGroup.SendPorts)
                {
                    sendPort.Status = PortStatus.Bound;
                }

                sendPortGroup.BtsCatalogExplorer.SaveChanges();
            }
            catch (Exception e)
            {
                sendPortGroup.BtsCatalogExplorer.DiscardChanges();
                throw e;
            }
        }
Example #6
0
        static void CreateSendPortGroup()
        {
            BtsCatalogExplorer root = new BtsCatalogExplorer();

            try
            {
                root.ConnectionString = "Integrated Security=SSPI;database=BizTalkMgmtDb;server=YOURSERVER";

                //create a new send port group
                SendPortGroup mySendPortGroup = root.AddNewSendPortGroup();
                mySendPortGroup.Name = "My Send Port Group";

                //try to commit the changes we made so far. If it fails, roll-back //everything we have done so far
                root.SaveChanges();
            }
            catch (Exception e)
            {
                root.DiscardChanges();
                throw e;
            }
        }
Example #7
0
 public SendPortGroupViewModel(BizTalkApplication currentApplication, IEnumerable <Manifest> manifests, Manifest currentManifest, IEnumerable <BizTalkBaseObject> breadCrumbs, IEnumerable <BizTalkApplication> applications, IEnumerable <Host> hosts, SendPortGroup sendPortGroup)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     SendPortGroup = sendPortGroup;
 }
Example #8
0
 public static string Id(this SendPortGroup omSendPortGroup)
 {
     return(omSendPortGroup.Name);
 }