Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/16/10 18:44:45 (14 years ago)
Author:
gkronber
Message:

Worked on plugin deployment GUI.
Added contact info and license text to DB schema.
#860

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  
    77namespace HeuristicLab.Services.Deployment {
    88  [DataContract(Name = "PluginDescription")]
    9   public class PluginDescription  {
     9  public class PluginDescription {
    1010
    1111    [DataMember(Name = "Name")]
     
    2121    }
    2222
     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    }
    2334
    2435    [DataMember(Name = "Dependencies")]
     
    2839    }
    2940
    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();
    3144      this.name = name;
    3245      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;
    3449    }
    3550
     
    3752      : this(name, version, Enumerable.Empty<PluginDescription>()) {
    3853    }
     54
     55    public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies)
     56      : this(name, version, dependencies, string.Empty, string.Empty) {
     57    }
    3958  }
    4059}
  • branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment/PluginStore.cs

    r2804 r2816  
    142142
    143143    private void UpdatePlugin(PluginStoreClassesDataContext ctx, Plugin pluginEntity, PluginDescription pluginDescription) {
     144      // update plugin data
     145      pluginEntity.License = pluginDescription.LicenseText;
     146      pluginEntity.ContactInformation = pluginDescription.ContactInformation;
     147     
    144148      // delete cached entry
    145149      if (pluginDescriptions.ContainsKey(pluginEntity)) pluginDescriptions.Remove(pluginEntity);
     
    188192      if (!pluginDescriptions.ContainsKey(plugin)) {
    189193        // 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          );
    192201        pluginDescriptions[plugin] = desc;
    193202      }
     
    199208      plugin.Name = pluginDescription.Name;
    200209      plugin.Version = pluginDescription.Version.ToString();
     210      plugin.ContactInformation = pluginDescription.ContactInformation;
     211      plugin.License = pluginDescription.LicenseText;
    201212      return plugin;
    202213    }
     
    206217      package.Data = pluginPackage;
    207218      package.PluginId = plugin.Id;
    208       package.FileName = string.Empty;
    209219      return package;
    210220    }
  • branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment/ProductDescription.cs

    r2804 r2816  
    2727
    2828    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();
    2931      this.name = name;
    3032      this.version = version;
Note: See TracChangeset for help on using the changeset viewer.