Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/13 08:57:22 (11 years ago)
Author:
fschoepp
Message:

#1888:

  • Added IVisualExtensionDao to the backend representing js extension that create new viewable elements of an algorithm.
  • Started to upgrade the frontend to render those new javascript UI extensions.
Location:
branches/OaaS/HeuristicLab.Services.Optimization.Controller
Files:
10 edited

Legend:

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

    r9324 r9362  
    1717    public static readonly string EXPERIMENT_TABLE = "Experiment";
    1818    public static readonly string EXPERIMENT_BLOB_CONTAINER = "experiment";
     19    public static readonly string VISUAL_BLOB_CONTAINER = "visualextensions";
    1920    public static readonly string CLOUD_SETTINGS_KEY = "Cloudia.WindowsAzure.Storage";
    2021
     
    289290      return AlgorithmConverter.ConvertJsonToExperiment(blob.DownloadText());
    290291    }
    291 
     292  }
     293
     294  public class VisualExtensionDao : IVisualExtensionDao {
     295    public CloudBlobClient BlobClient { get; set; }
     296
     297    public bool Add(string algorithmId, string script) {
     298      CloudBlobContainer container = BlobClient.GetContainerReference(AzureConstants.VISUAL_BLOB_CONTAINER);
     299      container.CreateIfNotExist();
     300      var blob = container.GetBlobReference(algorithmId);
     301      blob.UploadText(script);
     302      return true;
     303    }
     304
     305    public bool DeleteById(string algorithmId) {
     306      CloudBlobContainer container = BlobClient.GetContainerReference(AzureConstants.VISUAL_BLOB_CONTAINER);
     307      container.CreateIfNotExist();
     308      var blob = container.GetBlobReference(algorithmId);
     309      return blob.DeleteIfExists();
     310    }
     311
     312    public string FindById(string algorithmId) {
     313      CloudBlobContainer container = BlobClient.GetContainerReference(AzureConstants.VISUAL_BLOB_CONTAINER);
     314      container.CreateIfNotExist();
     315      var blob = container.GetBlobReference(algorithmId);
     316      return blob.DownloadText();
     317    }
    292318  }
    293319
     
    296322    private IBlobDao blobDao;
    297323    private IExperimentDao expDao;
     324    private IVisualExtensionDao visualDao;
    298325
    299326    private CloudStorageAccount storageAccount;
     
    340367      }
    341368    }
     369
     370
     371    public IVisualExtensionDao VisualExtensionDao {
     372      get {
     373        if (visualDao == null) {
     374          visualDao = new VisualExtensionDao() { BlobClient = StorageAccount.CreateCloudBlobClient() };
     375        }
     376        return visualDao;
     377      }
     378    }
    342379  }
    343380}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/HL/HiveScenarioManager.cs

    r9350 r9362  
    294294            Model.Run taskRun = new Model.Run();
    295295            taskRun.Id = taskRun.Name = run.Name;
     296            taskRun.AlgorithmName = run.Algorithm.Name;
    296297            IList<Parameter> resultValues = new List<Model.Parameter>();
    297298            foreach (var key in run.Results.Keys) {
     
    611612      return dal.ExperimentDao.GetExperimentById(user, nodeId);
    612613    }
     614
     615
     616    public string GetVisualExtension(string algorithmId) {
     617      return dal.VisualExtensionDao.FindById(algorithmId);
     618    }
    613619  }
    614620}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/DAL.cs

    r9350 r9362  
    3636  }
    3737
     38
     39  public interface IVisualExtensionDao {
     40    bool Add(string algorithmId, string script);
     41    bool DeleteById(string algorithmId);
     42    string FindById(string algorithmId);
     43  }
     44
    3845  public interface IDataAccessLayer {
    3946    IScenarioDao ScenarioDao { get; }
    4047    IBlobDao BlobDao { get; }
    4148    IExperimentDao ExperimentDao { get; }
     49    IVisualExtensionDao VisualExtensionDao { get; }
    4250  }
     51
    4352
    4453  public static class DataAccessLayerProvider {   
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/IControllerService.cs

    r9324 r9362  
    6666    [OperationContract]
    6767    Experiment GetExperimentById(User u, string nodeId);
     68
     69    [OperationContract]
     70    string GetVisualExtension(string algorithmId);
     71
     72    [OperationContract]
     73    bool AddVisualExtension(string algorithmId, string script);
     74
     75    [OperationContract]
     76    bool DeleteVisualExtension(string algorithmId);
    6877  }
    6978}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/IScenarioManager.cs

    r9324 r9362  
    2828   
    2929    bool DispatchExperiment(User user, Experiment exp, JobExecutionDetails details);
     30
     31    string GetVisualExtension(string algorithmId);
    3032  }
    3133}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/Model/ControllerModel.cs

    r9350 r9362  
    483483    [DataMember]
    484484    public IList<Parameter> InputParameters { get; set; }
     485
     486    public string AlgorithmName { get; set; }
    485487  }
    486488
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Mockup/MockupDAL.cs

    r9350 r9362  
    253253      }     
    254254    }
     255
     256
     257    public IVisualExtensionDao VisualExtensionDao {
     258      get { throw new NotImplementedException(); }
     259    }
    255260  }
    256261}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Mockup/MockupScenarioManager.cs

    r9324 r9362  
    286286      throw new NotImplementedException();
    287287    }
     288
     289
     290    public string GetVisualExtension(string algorithmId) {
     291      throw new NotImplementedException();
     292    }
    288293  }
    289294}
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/Parsers/AlgorithmConverter.cs

    r9350 r9362  
    190190      jrun["results"] = ConvertParametersToJson(run.Results);
    191191      jrun["params"] = ConvertParametersToJson(run.InputParameters);
     192      jrun["algorithmName"] = run.AlgorithmName;
    192193      return jrun;
    193194    }
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/PlaceholderControllerService.cs

    r9324 r9362  
    192192      return hiveManager.GetExperimentById(u, nodeId);
    193193    }
     194
     195
     196    public string GetVisualExtension(string algorithmId) {
     197      return hiveManager.GetVisualExtension(algorithmId);
     198    }
     199
     200
     201    public bool AddVisualExtension(string algorithmId, string script) {
     202      return hiveManager.AddVisualExtension(algorithmId, script);
     203    }
     204
     205    public bool DeleteVisualExtension(string algorithmId) {
     206      return hiveManager.DeleteVisualExtension(algorithmId);
     207    }
    194208  }
    195209}
Note: See TracChangeset for help on using the changeset viewer.