コード例 #1
0
ファイル: ViewModelBase.cs プロジェクト: riha/btswebdoc
 protected ViewModelBase(IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts)
 {
     Manifests = manifests;
     //CurrentArtefact = currentArtefact;
     CurrentManifest = currentManifest;
     BreadCrumbs = breadCrumbs;
     Applications = applications;
     Hosts = hosts;
 }
コード例 #2
0
        /// <summary>
        /// Used to link to the correct path taking the current manifest in 
        /// </summary>
        public static string Path(this BizTalkBaseObject artefact, Manifest manifest)
        {
            if (artefact == null)
                throw new ArgumentNullException("artefact");

            var versionPrefix = string.Empty;
            var reuqestPath = HttpContext.Current.Request.ApplicationPath;

            if (manifest != null && !manifest.IsDefaultLatest)
                versionPrefix = manifest.Version + "/";

            if (reuqestPath != "/")
                reuqestPath = reuqestPath + "/";

            if (artefact is BizTalkApplication)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Id);

            if (artefact is BizTalkAssembly)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/Assembly/", artefact.Id, "/", artefact.Name);

            if (artefact is Orchestration)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/Orchestration/", artefact.Id);

            if (artefact is Pipeline)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/Pipeline/", artefact.Id);

            if (artefact is ReceivePort)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/ReceivePort/", artefact.Id);

            //Here we need to actually go to the receive port that contains the location as location doesn't have their own page
            if (artefact is ReceiveLocation)
            {
                var rp = ((ReceiveLocation) artefact).ReceivePort;
                return string.Concat(reuqestPath, versionPrefix, "Application/", rp.Application.Id, "/ReceivePort/", rp.Id);
            }

            if (artefact is Schema)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/Schema/", artefact.Id, "/", artefact.Name);

            if (artefact is SendPort)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/SendPort/", artefact.Id);

            if (artefact is SendPortGroup)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/SendPortGroup/", artefact.Id);

            if (artefact is Transform)
                return string.Concat(reuqestPath, versionPrefix, "Application/", artefact.Application.Id, "/Map/", artefact.Id);

            if (artefact is Host)
                return string.Concat(reuqestPath, versionPrefix, "Host/", artefact.Id);

            throw new ApplicationException("Unknown BizTalk type");
        }
コード例 #3
0
ファイル: InstallationReader.cs プロジェクト: riha/btswebdoc
 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);
             }
         }
     }
 }
コード例 #4
0
ファイル: SchemaExtensions.cs プロジェクト: riha/btswebdoc
        public static string SourcePath(this Schema schema, Manifest manifest)
        {
            var versionPrefix = string.Empty;
            var reuqestPath = HttpContext.Current.Request.ApplicationPath;
            const string action = "/Schema/";

            if (reuqestPath != "/")
                reuqestPath = reuqestPath + "/";

            if (manifest != null && !manifest.IsDefaultLatest)
                versionPrefix = manifest.Version + "/";

            return string.Concat(reuqestPath, versionPrefix, "Assets", action, schema.Name, ".xml");
        }
コード例 #5
0
ファイル: InstallationReader.cs プロジェクト: riha/btswebdoc
        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;
        }
コード例 #6
0
ファイル: SchemaViewModel.cs プロジェクト: riha/btswebdoc
 public SchemaViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, Schema schema)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Schema = schema;
 }
コード例 #7
0
ファイル: HostViewModel.cs プロジェクト: riha/btswebdoc
 public HostViewModel(Host currentHost, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, Host host)
     : base(currentHost, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Host = host;
 }
コード例 #8
0
ファイル: TransformViewModel.cs プロジェクト: riha/btswebdoc
 public TransformViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, Transform transform)
     : base(currentApplication, manifests, currentManifest, breadCrumbs,  applications, hosts)
 {
     Transform = transform;
 }
コード例 #9
0
ファイル: InstallationReader.cs プロジェクト: riha/btswebdoc
 public static BizTalkInstallation GetBizTalkInstallation(Manifest manifest)
 {
     return ReadBizTalkInstallation(manifest);
 }
コード例 #10
0
 public OrchestrationViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, Orchestration orchestration)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Orchestration = orchestration;
 }
コード例 #11
0
ファイル: HomeViewModel.cs プロジェクト: riha/btswebdoc
 public HomeViewModel(IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts)
     : base(manifests, currentManifest, breadCrumbs, applications, hosts)
 {
 }
コード例 #12
0
ファイル: SendPortViewModel.cs プロジェクト: riha/btswebdoc
 public SendPortViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, SendPort sendPort)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     SendPort = sendPort;
 }
コード例 #13
0
 protected ApplicationViewModelBase(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts)
     : base(manifests, currentManifest,breadCrumbs, applications,hosts)
 {
     CurrentApplication = currentApplication;
 }