Changeset 2816 for branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment
- Timestamp:
- 02/16/10 18:44:45 (15 years ago)
- Location:
- branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment/PluginDescription.cs
r2804 r2816 7 7 namespace HeuristicLab.Services.Deployment { 8 8 [DataContract(Name = "PluginDescription")] 9 public class PluginDescription 9 public class PluginDescription { 10 10 11 11 [DataMember(Name = "Name")] … … 21 21 } 22 22 23 [DataMember(Name = "ContactInformation")] 24 private string contactInformation; 25 public string ContactInformation { 26 get { return contactInformation; } 27 } 28 29 [DataMember(Name = "LicenseText")] 30 private string licenseText; 31 public string LicenseText { 32 get { return licenseText; } 33 } 23 34 24 35 [DataMember(Name = "Dependencies")] … … 28 39 } 29 40 30 public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies) { 41 public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies, string contactInformation, string license) { 42 if (string.IsNullOrEmpty(name)) throw new ArgumentException("name is empty"); 43 if (version == null || dependencies == null || contactInformation == null || license == null) throw new ArgumentNullException(); 31 44 this.name = name; 32 45 this.version = version; 33 this.dependencies = new List<PluginDescription>(dependencies); //.AsReadOnly(); 46 this.dependencies = new List<PluginDescription>(dependencies); 47 this.licenseText = license; 48 this.contactInformation = contactInformation; 34 49 } 35 50 … … 37 52 : this(name, version, Enumerable.Empty<PluginDescription>()) { 38 53 } 54 55 public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies) 56 : this(name, version, dependencies, string.Empty, string.Empty) { 57 } 39 58 } 40 59 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment/PluginStore.cs
r2804 r2816 142 142 143 143 private void UpdatePlugin(PluginStoreClassesDataContext ctx, Plugin pluginEntity, PluginDescription pluginDescription) { 144 // update plugin data 145 pluginEntity.License = pluginDescription.LicenseText; 146 pluginEntity.ContactInformation = pluginDescription.ContactInformation; 147 144 148 // delete cached entry 145 149 if (pluginDescriptions.ContainsKey(pluginEntity)) pluginDescriptions.Remove(pluginEntity); … … 188 192 if (!pluginDescriptions.ContainsKey(plugin)) { 189 193 // no cached description -> create new 190 var desc = new PluginDescription(plugin.Name, new Version(plugin.Version), from dep in GetDependencies(ctx, plugin) 191 select MakePluginDescription(ctx, dep)); 194 var desc = new PluginDescription(plugin.Name, 195 new Version(plugin.Version), 196 from dep in GetDependencies(ctx, plugin) 197 select MakePluginDescription(ctx, dep), 198 plugin.ContactInformation ?? string.Empty, 199 plugin.License ?? string.Empty 200 ); 192 201 pluginDescriptions[plugin] = desc; 193 202 } … … 199 208 plugin.Name = pluginDescription.Name; 200 209 plugin.Version = pluginDescription.Version.ToString(); 210 plugin.ContactInformation = pluginDescription.ContactInformation; 211 plugin.License = pluginDescription.LicenseText; 201 212 return plugin; 202 213 } … … 206 217 package.Data = pluginPackage; 207 218 package.PluginId = plugin.Id; 208 package.FileName = string.Empty;209 219 return package; 210 220 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment/ProductDescription.cs
r2804 r2816 27 27 28 28 public ProductDescription(string name, Version version, IEnumerable<PluginDescription> plugins) { 29 if (string.IsNullOrEmpty(name)) throw new ArgumentException("name is empty"); 30 if (version == null || plugins == null) throw new ArgumentNullException(); 29 31 this.name = name; 30 32 this.version = version;
Note: See TracChangeset
for help on using the changeset viewer.