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.Controller/Azure/DAL.cs

    r9305 r9324  
    162162    }
    163163
     164    public bool Delete(string username, string experimentId) {
     165      TableServiceContext serviceContext = TableClient.GetDataServiceContext();
     166      TableClient.CreateTableIfNotExist(AzureConstants.EXPERIMENT_TABLE);
     167      var entity = (from e in serviceContext.CreateQuery<ExperimentEntity>(AzureConstants.EXPERIMENT_TABLE)
     168                    where e.ExperimentId == experimentId
     169                    select e).FirstOrDefault();
     170
     171      if (entity == null)
     172        return false;
     173
     174      if (entity.ExperimentJsonUrl != null) {
     175        CloudBlobContainer container = BlobClient.GetContainerReference(AzureConstants.EXPERIMENT_BLOB_CONTAINER);
     176        container.CreateIfNotExist();
     177        var blob = container.GetBlobReference(entity.ExperimentJsonUrl);
     178        blob.DeleteIfExists();
     179      }
     180
     181      serviceContext.DeleteObject(entity);
     182      serviceContext.SaveChangesWithRetries();
     183      return true;
     184    }
     185
    164186    public bool DeleteByName(string username, string experiment) {
    165187      TableServiceContext serviceContext = TableClient.GetDataServiceContext();
     
    209231    //}
    210232
    211     public IEnumerable<Model.Experiment> GetExperiments(string user) {
     233    public IEnumerable<Model.Experiment> GetExperiments(string user, bool namesOnly=false) {
    212234      TableServiceContext serviceContext = TableClient.GetDataServiceContext();
    213235      TableClient.CreateTableIfNotExist(AzureConstants.EXPERIMENT_TABLE);
     
    216238                    select e).ToList();
    217239      var experiments = new List<Experiment>();
    218       CloudBlobContainer container = BlobClient.GetContainerReference(AzureConstants.EXPERIMENT_BLOB_CONTAINER);
    219       container.CreateIfNotExist();
    220       foreach (var entity in entites) {
    221         var blob = container.GetBlobReference(entity.ExperimentJsonUrl);
    222         experiments.Add(AlgorithmConverter.ConvertJsonToExperiment(blob.DownloadText()));
    223       }
    224       return experiments;
     240      if (namesOnly) {
     241        return (from e in entites select new Model.Experiment() { Id = e.ExperimentId, Name = e.RowKey.Split('_')[1] });
     242      }
     243      else {
     244        CloudBlobContainer container = BlobClient.GetContainerReference(AzureConstants.EXPERIMENT_BLOB_CONTAINER);
     245        container.CreateIfNotExist();
     246        foreach (var entity in entites) {
     247          var blob = container.GetBlobReference(entity.ExperimentJsonUrl);
     248          experiments.Add(AlgorithmConverter.ConvertJsonToExperiment(blob.DownloadText()));
     249        }
     250        return experiments;
     251      }
    225252    }
    226253
Note: See TracChangeset for help on using the changeset viewer.