Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13689 for branches


Ignore:
Timestamp:
03/11/16 12:56:12 (8 years ago)
Author:
jlodewyc
Message:

#2582 Implemented uploading

Location:
branches/WebJobManager
Files:
27 added
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager

    • Property svn:ignore set to
      project.lock.json
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/HomeController.cs

    r13656 r13689  
    2727                var model = loginViewModelService.GetLoginViewModel();
    2828                HiveServiceLocatorWebManagerService hiveServiceLocator = (HiveServiceLocatorWebManagerService)HiveServiceLocatorWebManagerService.Instance;
    29                 Settings.Default.UserName = loginName;
    30                 Settings.Default.Password = Common.CryptoService.EncryptString(password);
    31                 Settings.Default.Save();
     29                HeuristicLab.Clients.Common.Properties.Settings.Default.UserName = loginName;
     30                HeuristicLab.Clients.Common.Properties.Settings.Default.Password = Common.CryptoService.EncryptString(password);
     31                HeuristicLab.Clients.Common.Properties.Settings.Default.Save();
    3232                hiveServiceLocator.Username = loginName;
    3333                hiveServiceLocator.Password = password;
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs

    r13656 r13689  
    1414using HeuristicLab.Core;
    1515using HeuristicLab.Optimization;
     16using System.Threading;
    1617
    1718namespace HeuristicLab.Clients.Hive.WebJobManager.Controllers
     
    3233            _environment = env;
    3334        }
     35        #region Jobs
    3436        public IActionResult Index()
    3537        {
    3638            try
    3739            {
     40
    3841                vm.userJobs = client.GetJobs();
    3942            }
     
    5659                vm.userJobs = client.GetJobs();
    5760                vm.selectedJob = client.GetJob(id);
    58                 vm.jobTasks = client.GetLightweightJobTasks(id);
     61
     62                vm.lightJobTasks = client.GetLightweightJobTasks(id);
     63                foreach (var light in vm.lightJobTasks)
     64                {
     65                    vm.filledJobTasks.Add(client.GetTask(light.Id));
     66                }
    5967                ViewBag.Title = vm.selectedJob.Name + " - Jobs";
    6068                return View("Index", vm);
     
    6674            }
    6775        }
    68         public IActionResult Delete(Guid id)
     76        public IActionResult Delete(Guid id)// delete a job
    6977        {
    7078            if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
     
    8391            }
    8492        }
    85 
    86         public IActionResult Upload()
     93        #endregion
     94
     95        #region Uploads
     96        public IActionResult Uploads()
     97        {
     98            if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
     99            {
     100                UploadedJobViewModel upper = new UploadedJobViewModel();
     101                fillUploadsPaths(upper, -1);
     102
     103                ViewBag.Title = "Uploaded files";
     104                return View("Uploads", upper);
     105            }
     106            else
     107            {
     108                HiveServiceLocatorWebManagerService.SetLoginErrorMessage();
     109                return RedirectToAction("Index", "Home");
     110            }
     111        }
     112        public IActionResult UploadDir(int index)
     113        {
     114            if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
     115            {
     116                UploadedJobViewModel upper = new UploadedJobViewModel();
     117                fillUploadsPaths(upper, index);
     118
     119                ViewBag.Title = "Uploaded files";
     120                return View("Uploads", upper);
     121            }
     122            else
     123            {
     124                HiveServiceLocatorWebManagerService.SetLoginErrorMessage();
     125                return RedirectToAction("Index", "Home");
     126            }
     127        }
     128        private void fillUploadsPaths(UploadedJobViewModel vm, int index)
     129        {
     130            var tempdex = index; //Fix when maps gets deleted
     131            var start = Path.Combine(_environment.WebRootPath, "uploads", client.ClientCredentials.UserName.UserName);
     132            var dirs = Directory.GetDirectories(start);
     133            foreach (string dir in dirs)
     134            {
     135                if (Directory.GetFiles(dir).Length == 0 && Directory.GetDirectories(dir).Length == 0)
     136                {
     137                    Directory.Delete(dir, false);
     138                    tempdex = -1;
     139                }
     140                else {
     141                    vm.FullDatePaths.Add(dir);
     142                    var temp = dir.Split('\\');
     143                    vm.DisplayDatePaths.Add(temp[temp.Length - 1]);
     144                }
     145            }
     146            if (tempdex != -1)
     147            {
     148                vm.SelectedIndex = tempdex;
     149                dirs = Directory.GetFiles(vm.FullDatePaths[tempdex]);
     150                foreach (string dir in dirs)
     151                {
     152                    vm.FullFilesPaths.Add(dir);
     153                    var temp = dir.Split('\\');
     154                    vm.DisplayFilesPaths.Add(temp[temp.Length - 1]);
     155                }
     156            }
     157        }
     158        public IActionResult DeleteFile(int index, int filedex)
     159        {
     160            if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
     161            {
     162                UploadedJobViewModel upper = new UploadedJobViewModel();
     163                fillUploadsPaths(upper, index);
     164                System.IO.File.Delete(upper.FullFilesPaths[filedex]);
     165                var message = upper.DisplayFilesPaths[filedex] + " has been deleted";
     166
     167                upper = new UploadedJobViewModel();
     168                fillUploadsPaths(upper, index);
     169                upper.message = message;
     170                ViewBag.Title = "Uploaded files";
     171
     172                return View("Uploads", upper);
     173            }
     174            else
     175            {
     176                HiveServiceLocatorWebManagerService.SetLoginErrorMessage();
     177                return RedirectToAction("Index", "Home");
     178            }
     179        }
     180
     181        public IActionResult OpenFile(int index, int filedex)
     182        {
     183            if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
     184            {
     185                UploadedJobViewModel upper = new UploadedJobViewModel();
     186                fillUploadsPaths(upper, index);
     187
     188                FileOpeningService serve = FileOpeningService.Instance;
     189                serve.NewModel();
     190                serve.env = _environment;
     191
     192                var ioptimizer = ContentManager.Load(upper.FullFilesPaths[filedex]);
     193
     194                serve.vm.SelectedTask = new OptimizerHiveTask((IOptimizer)ioptimizer);
     195                if (serve.vm.SelectedTask.ItemTask.Item is IAlgorithm)
     196                {
     197                    serve.vm.SelectedAlgorithm = (IAlgorithm)serve.vm.SelectedTask.ItemTask.Item;
     198                }
     199                else if (serve.vm.SelectedTask.ItemTask.Item is BatchRun)
     200                {
     201                    serve.vm.SelectedBatchRun = (BatchRun)serve.vm.SelectedTask.ItemTask.Item;
     202                }
     203                else if (serve.vm.SelectedTask.ItemTask.Item is Experiment)
     204                {
     205                    serve.vm.SelectedExperiment = (Experiment)serve.vm.SelectedTask.ItemTask.Item;
     206                }
     207
     208                ViewBag.Title = serve.vm.SelectedTask.ItemTask.Name + " - Open file";
     209
     210                return View("OpenFile", serve.vm);
     211            }
     212            else
     213            {
     214                HiveServiceLocatorWebManagerService.SetLoginErrorMessage();
     215                return RedirectToAction("Index", "Home");
     216            }
     217        }
     218
     219        public IActionResult AddToHive()
     220        {
     221            if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
     222            {
     223                    var job = FileOpeningService.Instance.AddCurrentModelToHive();
     224                    while (job.Progress.ProgressValue != 1)
     225                    { }
     226
     227                    Thread.Sleep(1000);
     228                    job.Progress.Status = "Upload finished";
     229                    Thread.Sleep(2000);
     230                    return RedirectToAction("Index", "Job");
     231            }
     232            else
     233            {
     234                HiveServiceLocatorWebManagerService.SetLoginErrorMessage();
     235                return RedirectToAction("Index", "Home");
     236            }
     237        }
     238        //TODO Work in progress
     239        /* public async Task<IActionResult> DownloadFile(int index, int filedex)
     240         {
     241             if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
     242             {
     243                 UploadedJobViewModel upper = new UploadedJobViewModel();
     244                 fillUploadsPaths(upper, index);
     245
     246                HttpContext.Response.ContentType = "APPLICATION/OCTET-STREAM";
     247                 String Header = "Attachment; Filename=" + upper.DisplayFilesPaths[filedex];
     248                 HttpContext.Response.Headers.Add("Content-Disposition", Header);
     249                 System.IO.FileInfo Dfile = new System.IO.FileInfo(upper.FullFilesPaths[filedex]);
     250                 await HttpContext.Response.WriteAsync(Dfile.FullName);
     251                 //HttpContext.Response.End();
     252
     253                 var message = upper.DisplayFilesPaths[filedex] + " has been downloaded";
     254
     255                 upper.message = message;
     256                 ViewBag.Title = "Downloaded file";
     257
     258                 return View("Uploads", upper);
     259             }
     260             else
     261             {
     262                 HiveServiceLocatorWebManagerService.SetLoginErrorMessage();
     263                 return RedirectToAction("Index", "Home");
     264             }
     265         }*/
     266
     267        #endregion
     268
     269        #region Uploader
     270        public IActionResult Uploader()
    87271        {
    88272            if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())
    89273            {
    90274                ViewBag.Title = "Upload Jobs";
    91                 return View("Upload");
     275                ViewBag.Name = client.ClientCredentials.UserName.UserName;
     276                return View("Uploader");
    92277            }
    93278            else
     
    98283        }
    99284        [HttpPost]
    100         public async Task<IActionResult> Upload(ICollection<IFormFile> files)
     285        public async Task<IActionResult> Uploader(ICollection<IFormFile> files, string directory)
    101286        {
    102287
    103288            UploadedJobViewModel upper = new UploadedJobViewModel();
    104             var uploads = Path.Combine(_environment.WebRootPath, "uploads");
     289            var uploads = Path.Combine(_environment.WebRootPath, "uploads", client.ClientCredentials.UserName.UserName,
     290                directory);
     291            Directory.CreateDirectory(uploads);
    105292            foreach (var file in files)
    106293            {
     
    109296                    var fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"');
    110297                    await file.SaveAsAsync(Path.Combine(uploads, fileName));
    111                     var ioptimizer = ContentManager.Load(Path.Combine(uploads, fileName));
    112                     OptimizerHiveTask task = new OptimizerHiveTask((IOptimizer)ioptimizer);
    113                     upper.Tasks.Add(task);
     298                    // var ioptimizer = ContentManager.Load(Path.Combine(uploads, fileName));
     299                    //OptimizerHiveTask task = new OptimizerHiveTask((IOptimizer)ioptimizer);
     300                    //upper.Tasks.Add(task);
    114301                }
    115302            }
    116303            ViewBag.Title = "Upload complete";
    117             return View();
    118 
    119         }
     304            return RedirectToAction("Uploads", "Job");
     305
     306        }
     307        #endregion
    120308    }
    121309}
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Startup.cs

    r13656 r13689  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Threading.Tasks;
    5 using Microsoft.AspNet.Builder;
     1using Microsoft.AspNet.Builder;
    62using Microsoft.AspNet.Hosting;
    7 using Microsoft.AspNet.Http;
    83using Microsoft.Extensions.DependencyInjection;
    94using HeuristicLab.Clients.Hive.WebJobManager.Services;
     
    116using HeuristicLab.Common;
    127using HeuristicLab.Core;
     8using HeuristicLab.PluginInfrastructure;
     9
    1310
    1411namespace HeuristicLab.Clients.Hive.WebJobManager
     
    1613    public class Startup
    1714    {
    18         private IHostingEnvironment hostingEnvironment;
     15        public IHostingEnvironment hostingEnvironment {
     16            get; set; }
    1917        public Startup(IHostingEnvironment hostingEnvironment)
    2018        {
     
    2321                .AddEnvironmentVariables();
    2422            var config = builder.Build();
     23
     24            ApplicationManager.InitializeForWeb();
     25
     26
    2527            ContentManager.Initialize(new PersistenceContentManager());
    2628            //Console.WriteLine(""+ config.Get("configuration"));
     
    3436            services.AddMvc();
    3537            services.AddSingleton<ILoginViewModelService, LoginViewModelService>();
     38            services.AddSingleton<IHiveServiceLocator, HiveServiceLocatorWebManagerService>();
     39            services.AddSignalR();
    3640        }
    3741
     
    3943        public void Configure(IApplicationBuilder app)
    4044        {
     45           
    4146            if (hostingEnvironment.IsDevelopment())
    4247                app.UseDeveloperExceptionPage();
    4348
    4449            app.UseIISPlatformHandler();
     50           
     51            app.UseStaticFiles();
     52            app.UseSignalR();
     53            app.UseStatusCodePages();
     54            app.UseMvcWithDefaultRoute();
     55        }
    4556
    46             app.UseMvcWithDefaultRoute();
    47             app.UseStaticFiles();
    48             app.UseStatusCodePages();
    49         }
     57
    5058
    5159        // Entry point for the application.
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/JobViewModel.cs

    r13656 r13689  
    1010        public List<Job> userJobs { get; set; }
    1111
    12         public List<LightweightTask> jobTasks { get; set; }
     12        public List<LightweightTask> lightJobTasks { get; set; }
     13        public List<Task> filledJobTasks { get; set; }
    1314        public Job selectedJob { get; set; }
    1415        public string message { get; set; }
     
    1718            userJobs = null;
    1819            selectedJob = null;
     20            filledJobTasks = new List<Task>();
    1921            message = "";
    2022        }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/UploadedJobViewModel.cs

    r13656 r13689  
    1 using System;
     1using HeuristicLab.Optimization;
     2using System;
    23using System.Collections.Generic;
    34using System.Linq;
     
    89    public class UploadedJobViewModel
    910    {
    10         public List<OptimizerHiveTask> Tasks { get; set; }
     11        public UploadedJobViewModel()
     12        {
     13            FullDatePaths = new List<string>();
     14            DisplayDatePaths = new List<string>();
     15            FullFilesPaths = new List<string>();
     16            DisplayFilesPaths = new List<string>();
     17            SelectedIndex = -1;
     18        }
     19
     20        public List<string> FullDatePaths { get; set; }
     21        public List<string> DisplayDatePaths { get; set; }
     22        public List<string> FullFilesPaths { get; set; }
     23        public List<string> DisplayFilesPaths { get; set; }
     24        public int SelectedIndex { get; set; }
     25        public string message { get; set; }
     26
     27       
    1128    }
    1229}
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml

    r13656 r13689  
    1212    </div>
    1313    <div class="row" style="margin:10px">
    14         <a class="btn btn-success btn-lg btn-block"
     14        <a class="btn btn-info btn-lg btn-block"
    1515           asp-controller="Job"
    16            asp-action="Upload">
    17             Add job
     16           asp-action="Uploads">
     17            Uploads
    1818        </a>
    1919    </div>
     
    4646                <div class="col-sm-8" style="padding:5px; padding-left:10px;">
    4747                    <div class="row">
    48                         <h2 style="padding-left:20px"> @Model.selectedJob.Name
    49                             <a asp-action="Delete" asp-route-id="@Model.selectedJob.Id" asp-controller="Job" style="margin-bottom:10px;" id="del" class='btn btn-danger'>
     48                        <h2 style="padding-left:20px">
     49                            @Model.selectedJob.Name
     50                            <a onclick="popUpDelete()"
     51                               style="margin-bottom:10px;"
     52                               
     53                               class='btn btn-danger'>
    5054                                <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
    5155                            </a>
    52 </h2>
     56                            <a style="display:none"
     57                               asp-action="Delete"
     58                               asp-route-id="@Model.selectedJob.Id"
     59                               asp-controller="Job" id="del"  ></a>
     60
     61                            <script type="text/javascript">
     62                                function popUpDelete() {
     63                                    if (confirm("Are you sure you want to delete this job?") == true) {
     64                                        document.getElementById("del").click();
     65                                    }
     66
     67                                }
     68                            </script>
     69           
     70                        </h2>
    5371                        <div class="col-sm-6" style="padding-left:30px">
    5472                            <p>Description: @Model.selectedJob.Description</p>
     
    5977                        </div>
    6078                        <div class="col-sm-6" style="padding-left:30px">
    61                             <p>Jobs: @Model.selectedJob.JobCount</p>
    6279                            <p>Calculating: @Model.selectedJob.CalculatingCount</p>
    6380                            <p>Finished: @Model.selectedJob.FinishedCount</p>
     
    6683                    </div>
    6784                    <div class="row">
    68                         <h3 style="padding-left:20px">@Model.jobTasks.Count Task@(Model.jobTasks != null && Model.jobTasks.Count != 1 ? "s" : "" )</h3>
    69                         @foreach (var task in Model.jobTasks)
     85                        <h3 style="padding-left:20px">@Model.lightJobTasks.Count Task@(Model.lightJobTasks != null && Model.lightJobTasks.Count != 1 ? "s" : "" )</h3>
     86                        @foreach (var task in Model.lightJobTasks)
    7087                        {
    71                             <p style="padding-left:30px" >
    72                                 Last update @task.LastTaskDataUpdate - @task.State - @task.ExecutionTime executed - created @task.DateCreated
    73                             </p>
     88                            <table class="table "
     89                                   style="margin-left:20px;">
     90                                <thead>
     91                                    <tr>
     92                                        <th>@task</th>
     93                                    </tr>
     94                                </thead>
     95                                <tbody>
     96                                    <tr>
     97                                        <td>Last update @task.LastTaskDataUpdate</td>
     98                                        <td>State: @task.State</td>
     99                                       
     100                                    </tr>
     101                                    <tr>
     102                                        <td>@task.ExecutionTime executed</td>
     103                                        <td>Created: @task.DateCreated</td>
     104                                    </tr>
     105                                </tbody>
     106                            </table>
     107
    74108                        }
    75109                    </div>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Shared/_Layout.cshtml

    r13656 r13689  
    2020            </div>
    2121        </nav>
    22         <environment names="Development">
    23             <script asp-src-include="~/js/*.js"></script>
    24         </environment>
    25         <environment names="Staging, Production">
    26             <script src="~/js/min/site.min.js"></script>
    27         </environment>
     22
     23        <script src="~/js/jquery-2.1.1.js"></script>
     24        <script src="~/js/bootstrap.js"></script>
     25     
     26        <script src="~/js/jquery.signalr-2.1.2.js"></script>
     27        <script src='~/signalr/js'></script>
     28        <script src="~/js/morris.js"></script>
     29        <script src="~/js/npm.js"></script>
     30        <script src="~/js/raphael.js"></script>
    2831        @RenderBody()
    2932    </div>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/project.json

    r13656 r13689  
    1010
    1111  "dependencies": {
     12    "Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final",
    1213    "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
    1314    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    1415    "Microsoft.AspNet.Loader.IIS": "1.0.0-beta7",
    1516    "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
     17    "Microsoft.AspNet.Owin": "1.0.0-rc1-final",
    1618    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
    1719    "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
    1820    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    19     "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final"
     21    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
     22    "Microsoft.AspNet.SignalR.Server": "3.0.0-rc1-final",
     23    "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
     24    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final"
    2025  },
    2126
     
    2833    "dnx451": {
    2934      "dependencies": {
     35        "ALGLIB-3.7.0": "1.0.0-*",
     36        "AutoDiff-1.0": "1.0.0-*",
    3037        "HeuristicLab.Algorithms.ALPS-3.3": "1.0.0-*",
    3138        "HeuristicLab.Algorithms.Benchmarks-3.3": "1.0.0-*",
     
    6572        "HeuristicLab.Encodings.LinearLinkageEncoding-3.3": "1.0.0-*",
    6673        "HeuristicLab.Encodings.PermutationEncoding-3.3": "1.0.0-*",
     74        "HeuristicLab.Encodings.PermutationEncoding.Views-3.3": "1.0.0-*",
    6775        "HeuristicLab.Encodings.RealVectorEncoding-3.3": "1.0.0-*",
    6876        "HeuristicLab.Encodings.ScheduleEncoding-3.3": "1.0.0-*",
     
    122130        "HeuristicLab.SequentialEngine-3.3": "1.0.0-*",
    123131        "HeuristicLab.Tracing-3.3": "1.0.0-*",
    124         "ALGLIB-3.7.0": "1.0.0-*",
    125         "AutoDiff-1.0": "1.0.0-*"
     132        "HeuristicLab 3.3": "1.0.0-*"
    126133      },
    127134      "frameworkAssemblies": {
     135        "System.configuration": "4.0.0.0",
    128136        "System.Drawing": "4.0.0.0",
    129137        "System.IdentityModel": "4.0.0.0",
     138        "System.Net.Http": "4.0.0.0",
     139        "System.Runtime.Serialization": "4.0.0.0",
    130140        "System.ServiceModel": "4.0.0.0",
    131141        "System.Web": "4.0.0.0"
  • branches/WebJobManager/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj

    r11623 r13689  
    192192    <None Include="ServiceClients\GenerateServiceClients.cmd" />
    193193    <None Include="Settings.settings">
    194       <Generator>SettingsSingleFileGenerator</Generator>
     194      <Generator>PublicSettingsSingleFileGenerator</Generator>
    195195      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    196196    </None>
  • branches/WebJobManager/HeuristicLab.Clients.Hive/3.3/Settings.Designer.cs

    r11623 r13689  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.34014
     4//     Runtime Version:4.0.30319.42000
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    1313   
    1414    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    15     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
    16     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
     15    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
     16    public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
    1717       
    1818        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
  • branches/WebJobManager/HeuristicLab.PluginInfrastructure/3.3/ApplicationManager.cs

    r12012 r13689  
    2020#endregion
    2121
     22using HeuristicLab.PluginInfrastructure.Manager;
    2223using System;
    2324
     
    3132    private static IApplicationManager appManager;
    3233
    33     /// <summary>
    34     /// Gets the application manager singleton.
    35     /// </summary>
    36     public static IApplicationManager Manager {
     34
     35        public static void InitializeForWeb()
     36        {
     37            DefaultApplicationManager applicationManager = new DefaultApplicationManager();
     38            appManager = applicationManager;
     39            PluginManager manager = new PluginManager(@"C:\HeuristicSVN\artifacts\bin\HeuristicLab.Clients.Hive.WebJobManager");
     40            manager.DiscoverAndCheckPlugins();
     41            applicationManager.PrepareApplicationDomain(manager.Applications, manager.Plugins);
     42        }
     43
     44        /// <summary>
     45        /// Gets the application manager singleton.
     46        /// </summary>
     47        public static IApplicationManager Manager {
    3748      get {
    3849        if (appManager == null)
     
    4758    /// <param name="manager"></param>
    4859    internal static void RegisterApplicationManager(IApplicationManager manager) {
    49       if (appManager != null && !(appManager is LightweightApplicationManager)) throw new InvalidOperationException("The application manager has already been set.");
    50       else {
     60      if (appManager != null ){
    5161        appManager = manager;
    5262      }
Note: See TracChangeset for help on using the changeset viewer.