Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/15/10 15:41:38 (15 years ago)
Author:
gkronber
Message:

Worked on administration front-end for deployment service. #860 (Deployment server for plugin installation from web locations)

Location:
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/HeuristicLab.Services.Deployment.DataAccess.csproj

    r2742 r2802  
    5353  </ItemGroup>
    5454  <ItemGroup>
    55     <Compile Include="ProductDescription.cs" />
    5655    <Compile Include="PluginDescription.cs" />
    5756    <Compile Include="PluginStore.cs" />
     
    6463      <DependentUpon>PluginStoreClasses.dbml</DependentUpon>
    6564    </Compile>
     65    <Compile Include="ProductDescription.cs" />
    6666    <Compile Include="Properties\AssemblyInfo.cs" />
    6767    <Compile Include="Properties\Settings.Designer.cs">
  • branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginDescription.cs

    r2771 r2802  
    88  [DataContract(Name = "PluginDescription")]
    99  public class PluginDescription {
    10 
    11     [DataMember(Name = "Id")]
    12     private long id;
    13     internal long Id {
    14       get {
    15         return id;
    16       }
    17       set {
    18         id = value;
    19       }
    20     }
    2110
    2211    [DataMember(Name = "Name")]
     
    3928    }
    4029
    41     //[DataMember(Name = "IsDatabaseInstance")]
    42     //private bool isDatabaseInstance;
    43     //internal bool IsDatabaseInstance {
    44     //  get {
    45     //    return isDatabaseInstance;
    46     //  }
    47     //}
    48 
    49     internal PluginDescription(long id, string name, Version version, IEnumerable<PluginDescription> dependencies) {
    50       this.id = id;
     30    public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies) {
    5131      this.name = name;
    5232      this.version = version;
    5333      this.dependencies = new List<PluginDescription>(dependencies); //.AsReadOnly();
    54       //this.isDatabaseInstance = true;
    55     }
    56 
    57     public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies)
    58       : this(0, name, version, dependencies) {
    59       //this.isDatabaseInstance = false;
    6034    }
    6135
    6236    public PluginDescription(string name, Version version)
    6337      : this(name, version, Enumerable.Empty<PluginDescription>()) {
    64       //this.isDatabaseInstance = false;
    6538    }
    6639  }
  • branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginStore.cs

    r2771 r2802  
    5050            if (pluginEntity.PluginPackage == null) {
    5151              // insert
    52               pluginEntity.PluginPackage = MakePluginPackage(pluginDescription, pluginPackage);
     52              pluginEntity.PluginPackage = MakePluginPackage(pluginEntity, pluginPackage);
    5353            } else {
    5454              // update
     
    104104      }
    105105
    106       product.Id = productEntity.Id;
    107 
    108106      DeleteOldPlugins(ctx, productEntity);
    109107
     
    112110        ProductPlugin prodPlugin = new ProductPlugin();
    113111        prodPlugin.PluginId = existingPlugin.Id;
    114         prodPlugin.ProductId = product.Id;
     112        prodPlugin.ProductId = productEntity.Id;
    115113        ctx.ProductPlugins.InsertOnSubmit(prodPlugin);
    116114      }
     
    146144      if (pluginDescriptions.ContainsKey(pluginEntity)) pluginDescriptions.Remove(pluginEntity);
    147145
    148       pluginDescription.Id = pluginEntity.Id;
    149 
    150146      DeleteOldDependencies(ctx, pluginEntity);
    151147
     
    153149        var dependencyEntity = GetExistingPlugin(ctx, dependency.Name, dependency.Version);
    154150        Dependency d = new Dependency();
    155         d.PluginId = pluginDescription.Id;
     151        d.PluginId = pluginEntity.Id;
    156152        d.DependencyId = dependencyEntity.Id;
    157153        ctx.Dependencies.InsertOnSubmit(d);
     
    173169    #region product <-> productDescription transformation
    174170    private ProductDescription MakeProductDescription(PluginStoreClassesDataContext ctx, Product p, IQueryable<Plugin> plugins) {
    175       var desc = new ProductDescription(p.Id, p.Name, new Version(p.Version), from plugin in plugins
    176                                                                               select MakePluginDescription(ctx, plugin));
     171      var desc = new ProductDescription(p.Name, new Version(p.Version), from plugin in plugins
     172                                                                        select MakePluginDescription(ctx, plugin));
    177173      return desc;
    178174    }
    179175    private Product MakeProductFromDescription(ProductDescription desc) {
    180176      var product = new Product();
    181       product.Id = desc.Id;
    182177      product.Name = desc.Name;
    183178      product.Version = desc.Version.ToString();
     
    192187      if (!pluginDescriptions.ContainsKey(plugin)) {
    193188        // no cached description -> create new
    194         var desc = new PluginDescription(plugin.Id, plugin.Name, new Version(plugin.Version), from dep in GetDependencies(ctx, plugin)
    195                                                                                               select MakePluginDescription(ctx, dep));
     189        var desc = new PluginDescription(plugin.Name, new Version(plugin.Version), from dep in GetDependencies(ctx, plugin)
     190                                                                                   select MakePluginDescription(ctx, dep));
    196191        pluginDescriptions[plugin] = desc;
    197192      }
     
    201196    private Plugin MakePluginFromDescription(PluginDescription pluginDescription) {
    202197      var plugin = new Plugin();
    203       plugin.Id = pluginDescription.Id;
    204198      plugin.Name = pluginDescription.Name;
    205199      plugin.Version = pluginDescription.Version.ToString();
     
    207201    }
    208202
    209     private PluginPackage MakePluginPackage(PluginDescription pluginDescription, byte[] pluginPackage) {
     203    private PluginPackage MakePluginPackage(Plugin plugin, byte[] pluginPackage) {
    210204      var package = new PluginPackage();
    211205      package.Data = pluginPackage;
    212       package.PluginId = pluginDescription.Id;
     206      package.PluginId = plugin.Id;
    213207      package.FileName = string.Empty;
    214208      return package;
  • branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/ProductDescription.cs

    r2742 r2802  
    88  [DataContract(Name = "ProductDescription")]
    99  public class ProductDescription {
    10 
    11     [DataMember(Name = "Id")]
    12     private long id;
    13     internal long Id {
    14       get { return id; }
    15       set { id = value; }
    16     }
    17 
    1810    [DataMember(Name = "Name")]
    1911    private string name;
     
    3426    }
    3527
    36     internal ProductDescription(long id, string name, Version version, IEnumerable<PluginDescription> plugins) {
    37       this.id = id;
     28    public ProductDescription(string name, Version version, IEnumerable<PluginDescription> plugins) {
    3829      this.name = name;
    3930      this.version = version;
    4031      this.plugins = new List<PluginDescription>(plugins).AsReadOnly();
    4132    }
    42 
    43     public ProductDescription(string name, Version version, IEnumerable<PluginDescription> plugins)
    44       : this(0, name, version, plugins) {
    45     }
    46 
     33 
    4734    public ProductDescription(string name, Version version) : this(name, version, Enumerable.Empty<PluginDescription>()) { }
    4835  }
Note: See TracChangeset for help on using the changeset viewer.