Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/12/15 14:59:54 (10 years ago)
Author:
dglaser
Message:

#2394: Improved PluginManager and updated hive status monitor.

Location:
trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/BundleConfig.cs

    r12428 r12435  
    1 using System.Collections.Generic;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Collections.Generic;
    223using System.IO;
    3 using System.Linq;
    4 using System.Web;
    524using System.Web.Optimization;
    625
    726namespace HeuristicLab.Services.WebApp.Configs {
    827  public class BundleConfig {
     28
    929    public static void RegisterBundles(BundleCollection bundles) {
    1030      bundles.IgnoreList.Clear();
     
    6181        "~/WebApp/app.css"
    6282      ));
    63       AddOrUpdateWebAppBundle();
     83
     84      bundles.Add(new ScriptBundle("~/Bundles/WebApp/Main").Include(
     85        "~/WebApp/main.js"
     86      ));
     87
     88      bundles.Add(new ScriptBundle("~/Bundles/WebApp/Shared")
     89        .IncludeDirectory("~/WebApp/shared/services", "*.js", true)
     90        .IncludeDirectory("~/WebApp/shared/directives", "*.js", true)
     91        .IncludeDirectory("~/WebApp/shared/menu", "*.js", true)
     92      );
    6493    }
    6594
    66     public static void AddOrUpdateWebAppBundle() {
    67       var jsBundle = BundleTable.Bundles.GetBundleFor("~/Bundles/WebApp/js");
    68       if (jsBundle != null) {
    69         BundleTable.Bundles.Remove(jsBundle);
     95    public static IEnumerable<string> GetWebAppScripts() {
     96      var jsFiles = new List<string> {
     97        "WebApp/helper.js",
     98        "WebApp/app.js"
     99      };
     100      PluginManager pluginManager = PluginManager.Instance;
     101      foreach (var plugin in pluginManager.GetPlugins()) {
     102        if (File.Exists(string.Format(@"{0}\{1}\{1}.js", PluginManager.PluginsDirectory, plugin.Name))) {
     103          jsFiles.Add(string.Format("WebApp/plugins/{0}/{0}.js", plugin.Name));
     104        }
    70105      }
    71       var jsFiles = new List<string> {
    72         "~/WebApp/helper.js",
    73         "~/WebApp/app.js"
    74       };
    75       var directories = Directory.GetDirectories(string.Format(@"{0}WebApp\plugins", HttpRuntime.AppDomainAppPath));
    76       jsFiles.AddRange(directories.Select(Path.GetFileName).Select(directory => string.Format("~/WebApp/plugins/{0}/{0}.js", directory)));
    77       jsFiles.Add("~/WebApp/main.js");
    78       jsBundle = new ScriptBundle("~/Bundles/WebApp/js");
    79       jsBundle.Include(jsFiles.ToArray());
    80       jsBundle.IncludeDirectory("~/WebApp/shared/", "*.js", true);
    81       BundleTable.Bundles.Add(jsBundle);
     106      jsFiles.Add("WebApp/main.js");
     107      return jsFiles;
    82108    }
    83109  }
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/FilterConfig.cs

    r12428 r12435  
    1 using System.Web.Mvc;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Web.Mvc;
    223
    324namespace HeuristicLab.Services.WebApp.Configs {
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/RouteConfig.cs

    r12428 r12435  
    1 using System.Web.Mvc;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Web.Mvc;
    223using System.Web.Routing;
    324
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/WebApiConfig.cs

    r12428 r12435  
    1 
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
    222using System.Net.Http.Formatting;
    323using System.Web.Http;
Note: See TracChangeset for help on using the changeset viewer.