Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/13 08:57:22 (12 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.
File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.