Changeset 2802 for branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess
- Timestamp:
- 02/15/10 15:41:38 (15 years ago)
- 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 53 53 </ItemGroup> 54 54 <ItemGroup> 55 <Compile Include="ProductDescription.cs" />56 55 <Compile Include="PluginDescription.cs" /> 57 56 <Compile Include="PluginStore.cs" /> … … 64 63 <DependentUpon>PluginStoreClasses.dbml</DependentUpon> 65 64 </Compile> 65 <Compile Include="ProductDescription.cs" /> 66 66 <Compile Include="Properties\AssemblyInfo.cs" /> 67 67 <Compile Include="Properties\Settings.Designer.cs"> -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginDescription.cs
r2771 r2802 8 8 [DataContract(Name = "PluginDescription")] 9 9 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 }21 10 22 11 [DataMember(Name = "Name")] … … 39 28 } 40 29 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) { 51 31 this.name = name; 52 32 this.version = version; 53 33 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;60 34 } 61 35 62 36 public PluginDescription(string name, Version version) 63 37 : this(name, version, Enumerable.Empty<PluginDescription>()) { 64 //this.isDatabaseInstance = false;65 38 } 66 39 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginStore.cs
r2771 r2802 50 50 if (pluginEntity.PluginPackage == null) { 51 51 // insert 52 pluginEntity.PluginPackage = MakePluginPackage(plugin Description, pluginPackage);52 pluginEntity.PluginPackage = MakePluginPackage(pluginEntity, pluginPackage); 53 53 } else { 54 54 // update … … 104 104 } 105 105 106 product.Id = productEntity.Id;107 108 106 DeleteOldPlugins(ctx, productEntity); 109 107 … … 112 110 ProductPlugin prodPlugin = new ProductPlugin(); 113 111 prodPlugin.PluginId = existingPlugin.Id; 114 prodPlugin.ProductId = product .Id;112 prodPlugin.ProductId = productEntity.Id; 115 113 ctx.ProductPlugins.InsertOnSubmit(prodPlugin); 116 114 } … … 146 144 if (pluginDescriptions.ContainsKey(pluginEntity)) pluginDescriptions.Remove(pluginEntity); 147 145 148 pluginDescription.Id = pluginEntity.Id;149 150 146 DeleteOldDependencies(ctx, pluginEntity); 151 147 … … 153 149 var dependencyEntity = GetExistingPlugin(ctx, dependency.Name, dependency.Version); 154 150 Dependency d = new Dependency(); 155 d.PluginId = plugin Description.Id;151 d.PluginId = pluginEntity.Id; 156 152 d.DependencyId = dependencyEntity.Id; 157 153 ctx.Dependencies.InsertOnSubmit(d); … … 173 169 #region product <-> productDescription transformation 174 170 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 plugins176 171 var desc = new ProductDescription(p.Name, new Version(p.Version), from plugin in plugins 172 select MakePluginDescription(ctx, plugin)); 177 173 return desc; 178 174 } 179 175 private Product MakeProductFromDescription(ProductDescription desc) { 180 176 var product = new Product(); 181 product.Id = desc.Id;182 177 product.Name = desc.Name; 183 178 product.Version = desc.Version.ToString(); … … 192 187 if (!pluginDescriptions.ContainsKey(plugin)) { 193 188 // 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 189 var desc = new PluginDescription(plugin.Name, new Version(plugin.Version), from dep in GetDependencies(ctx, plugin) 190 select MakePluginDescription(ctx, dep)); 196 191 pluginDescriptions[plugin] = desc; 197 192 } … … 201 196 private Plugin MakePluginFromDescription(PluginDescription pluginDescription) { 202 197 var plugin = new Plugin(); 203 plugin.Id = pluginDescription.Id;204 198 plugin.Name = pluginDescription.Name; 205 199 plugin.Version = pluginDescription.Version.ToString(); … … 207 201 } 208 202 209 private PluginPackage MakePluginPackage(Plugin Description pluginDescription, byte[] pluginPackage) {203 private PluginPackage MakePluginPackage(Plugin plugin, byte[] pluginPackage) { 210 204 var package = new PluginPackage(); 211 205 package.Data = pluginPackage; 212 package.PluginId = plugin Description.Id;206 package.PluginId = plugin.Id; 213 207 package.FileName = string.Empty; 214 208 return package; -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/ProductDescription.cs
r2742 r2802 8 8 [DataContract(Name = "ProductDescription")] 9 9 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 18 10 [DataMember(Name = "Name")] 19 11 private string name; … … 34 26 } 35 27 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) { 38 29 this.name = name; 39 30 this.version = version; 40 31 this.plugins = new List<PluginDescription>(plugins).AsReadOnly(); 41 32 } 42 43 public ProductDescription(string name, Version version, IEnumerable<PluginDescription> plugins) 44 : this(0, name, version, plugins) { 45 } 46 33 47 34 public ProductDescription(string name, Version version) : this(name, version, Enumerable.Empty<PluginDescription>()) { } 48 35 }
Note: See TracChangeset
for help on using the changeset viewer.