Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/20/13 16:56:28 (12 years ago)
Author:
fschoepp
Message:

#1888:

  • DAL: Added a Delete method which deletes by experiment id.
  • HL DataTables will now be transposed and mapped as double[ROWS][COLUMNS] (transposed)
  • JS: Moved all classes into "modules" to prevent namespace pollution (using OAAS_MODEL for model classes, OAAS_VIEW for views and OAAS_CONTROLLER for controllers)
  • JS: Moved DatatypeMapper classes into Backbone views
  • JS: Models now correctly send DELETE requests
  • Added a new job overview page (which also renders run details) using AJAX
  • Using moment.min.js to format DateTime as string
  • Controllers now inherit from BaseController which provides a RedirectToLoginIfNecessary-method
  • Added loading animations to several AJAX bound places (loading experiments / scenarios)
  • Added a section to _Layout.cshtml which allows page-specific JavaScript includes (<script> only for a certain page)
  • Fixed Build/Edit of experiment menu redirecting to the wrong page
  • The Experiment Variation Dialog disables input fields, if the property has not been activated before
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/ExperimentController.cs

    r9305 r9324  
    1414{
    1515    [Authorize(Roles = "Web User")]
    16     public class ExperimentController : Controller
     16    public class ExperimentController : BaseController
    1717    {
    18         private ControllerServiceHelper ControllerService {
    19           get {
    20             var helper = new ControllerServiceHelper(Session["pw"] as string);
    21             if (!helper.Valid) {
    22               Response.Redirect("/Account/Logon?ReturnUrl=%2fExperiment");
    23             }
    24             return helper;
    25           }
    26         }
    27 
    2818        //
    2919        // GET: /Experiment/
     
    3121        public ActionResult Index()
    3222        {
    33           return RedirectToAction("New");
     23          RedirectToLoginIfNecessary("%2fExperiment%2fIndex");
     24          return RedirectToAction("New", "Experiment");
    3425          /*var model = new ExperimentViewModel();
    3526          var scenarios = ControllerService.withControllerService<IEnumerable<string>>((service) => {
     
    4940
    5041        public ActionResult New() {
     42          RedirectToLoginIfNecessary("%2fExperiment%2fNew");
    5143          return View();
    5244        }
    5345
    5446        public ActionResult NewEdit() {
     47          RedirectToLoginIfNecessary("%2fExperiment%2fNewEdit");
    5548          return View();
    5649        }
     50
    5751
    5852        public ActionResult Edit() {
     
    6559            model.Experiments.Add(experiment);
    6660          return View(model);
    67         }
    68 
    69         public ActionResult DeleteExperiment(string experiment) {
    70           ControllerService.withControllerService<bool>((service) => {
    71             User u = new User() { Username = Membership.GetUser().UserName, Password = Session["pw"] as string };
    72             return service.DeleteExperiment(u, experiment);
    73           });
    74           return RedirectToAction("Edit");
    75         }
     61        }
    7662
    7763      #region new experiment methdos
     
    8874        var experiments = ControllerService.withControllerService<IEnumerable<Experiment>>(service => {
    8975          User u = new User() { Username = Membership.GetUser().UserName, Password = Session["pw"] as string };
    90           return service.GetExperiments(u);
     76          return service.GetExperiments(u, namesOnly: true);
    9177        });
    9278        return Content(AlgorithmConverter.ConvertExperimentsToJson(experiments).ToString(), "application/json", System.Text.Encoding.UTF8);
     
    124110      }
    125111
     112      [HttpDelete]
     113      [ActionName("Experiment")]
     114      public JsonResult DeleteExperiment(string nodeId) {
     115        var isExperimentDeleted = ControllerService.withControllerService<bool>(service => {
     116          User u = new User() { Username = Membership.GetUser().UserName, Password = Session["pw"] as string };
     117          return service.DeleteExperiment(u, nodeId);
     118        });
     119        return Json(isExperimentDeleted, JsonRequestBehavior.DenyGet);
     120      }
    126121
    127122      [HttpGet]
Note: See TracChangeset for help on using the changeset viewer.