Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/28/12 10:02:01 (12 years ago)
Author:
fschoepp
Message:

#1888:

  • Added a administrator web interface for job management
  • Fixed Hive Client (PluginValidator) to find the assemblies within the right directories
  • Reorganized controller classes (Folders HL, Interfaces, Azure)
  • You may now successfully schedule and run jobs with the web ui.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/PlaceholderControllerService.cs

    r8817 r8958  
    6262
    6363    public Model.OptimizationScenario GetOptimizationScenarioByName(string name) {
    64       if (scenarios[0].Name == name)
    65         return scenarios[0];
    66       return null;
     64      var scen = (from e in scenarios
     65                  where e.Name == name
     66                  select e).FirstOrDefault();     
     67      return scen;
    6768    }
    6869
     
    8990      return hiveManager.GetJobResults(user, id);
    9091    }
     92
     93
     94    public bool AddHiveScenario(User user, string scenarioXml, string scenarioMapper) {
     95      var scenario = parser.ParseScenarioFromXml(scenarioXml);
     96      if (scenario == null) {
     97        return false;
     98      }     
     99      var added = hiveManager.AddScenario(user, scenario.Name, scenarioXml, scenarioMapper);
     100      if (added)
     101        scenarios.Add(scenario);
     102      return added;
     103    }
     104
     105    public bool DeleteHiveScenario(User user, string scenarioName) {
     106      var scen = GetOptimizationScenarioByName(scenarioName);
     107      if (scen != null) {
     108        scenarios.Remove(scen);
     109        return hiveManager.DeleteScenario(user, scenarioName);
     110      }
     111      return false;
     112    }
     113
     114    public IEnumerable<string> GetOptimizationScenarioNames() {
     115      return (from e in scenarios
     116              select e.Name).AsEnumerable();     
     117    }
    91118  }
    92119}
Note: See TracChangeset for help on using the changeset viewer.