Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/11/13 14:40:04 (12 years ago)
Author:
fschoepp
Message:

#1888:

  • Added an Update / GetExperiment... methods to the controller for updating and querying experiments.
  • The AlgorithmConverter class now properly converts from/to JSON format.
  • Integrated backbone js as MVC provider for JavaScript + jquery.
  • Added experiment.model.js + experiment.view.js + experiment.controller.js containing the MVC impl. for the Experiment pages.
  • Added new methods to the ExperimentController usable by the backbone js model implementation.
  • Added the experiment dialog from HL 3.3.7 (variate experiment parameters). It's capable of variating the algorithm parameters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.Services.Optimization.Web/Binders/AlgorithmJsonAttribute.cs

    r9227 r9305  
    1313namespace Mvc3TestApplication.Binders
    1414{
    15   public class AlgorithmJsonAttribute : CustomModelBinderAttribute
    16   {
    17     public override IModelBinder GetBinder()
    18     {
    19       return new AlgorithmJsonBinder();
    20     }
    21   }
    22 
    23   public class AlgorithmJsonBinder : IModelBinder
    24   {
    25     public AlgorithmJsonBinder()
    26     {
    27     }
    28 
    29     public object BindModel(ControllerContext controllerCtx, ModelBindingContext bindingCtx)
    30     {
    31       var contentType = controllerCtx.HttpContext.Request.ContentType;
    32       if (!contentType.StartsWith("application/json", StringComparison.OrdinalIgnoreCase))
    33         return null;
    34 
    35       string body;
    36       using (var stream = controllerCtx.HttpContext.Request.InputStream)
    37       {
    38         stream.Seek(0, System.IO.SeekOrigin.Begin);
    39         using (var reader = new StreamReader(stream))
    40           body = reader.ReadToEnd();
    41       }
    42       if (string.IsNullOrEmpty(body)) return null;
    43       return AlgorithmConverter.Convert(body);
    44     }
    45 
    46    
    47   }
    48 
    4915  public class ExperimentJsonAttribute : CustomModelBinderAttribute {
    5016    public override IModelBinder GetBinder() {
     
    6935      }
    7036      if (string.IsNullOrEmpty(body)) return null;
    71       return AlgorithmConverter.ConvertExperiment(body);
     37      return AlgorithmConverter.ConvertJsonToExperiment(body);
    7238    }
    7339
Note: See TracChangeset for help on using the changeset viewer.