Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6426


Ignore:
Timestamp:
06/16/11 12:39:32 (13 years ago)
Author:
ascheibe
Message:

#1233 removed useLocalPlugins

Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.Designer.cs

    r6419 r6426  
    5252      this.jobsTabPage = new System.Windows.Forms.TabPage();
    5353      this.jobsTreeView = new HeuristicLab.Clients.Hive.Views.ExperimentManager.HiveJobItemTreeView();
     54      this.stateTabPage = new System.Windows.Forms.TabPage();
     55      this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5456      this.logTabPage = new System.Windows.Forms.TabPage();
    5557      this.logView = new HeuristicLab.Core.Views.LogView();
     
    6264      this.resourceIdsLabel = new System.Windows.Forms.Label();
    6365      this.resourceNamesTextBox = new System.Windows.Forms.TextBox();
    64       this.useLocalPluginsCheckBox = new System.Windows.Forms.CheckBox();
    6566      this.nameLabel = new System.Windows.Forms.Label();
    6667      this.nameTextBox = new System.Windows.Forms.TextBox();
     
    7677      this.calculatingLabel = new System.Windows.Forms.Label();
    7778      this.jobsLabel = new System.Windows.Forms.Label();
    78       this.stateTabPage = new System.Windows.Forms.TabPage();
    79       this.stateLogViewHost = new ViewHost();
    8079      this.tabControl.SuspendLayout();
    8180      this.jobsTabPage.SuspendLayout();
     81      this.stateTabPage.SuspendLayout();
    8282      this.logTabPage.SuspendLayout();
    8383      this.infoGroupBox.SuspendLayout();
    84       this.stateTabPage.SuspendLayout();
    8584      this.SuspendLayout();
    8685      //
     
    126125      this.jobsTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.jobsTreeView_DragOver);
    127126      //
     127      // stateTabPage
     128      //
     129      this.stateTabPage.Controls.Add(this.stateLogViewHost);
     130      this.stateTabPage.Location = new System.Drawing.Point(4, 22);
     131      this.stateTabPage.Name = "stateTabPage";
     132      this.stateTabPage.Size = new System.Drawing.Size(709, 426);
     133      this.stateTabPage.TabIndex = 6;
     134      this.stateTabPage.Text = "State";
     135      this.stateTabPage.UseVisualStyleBackColor = true;
     136      //
     137      // stateLogViewHost
     138      //
     139      this.stateLogViewHost.Caption = "StateLog View";
     140      this.stateLogViewHost.Content = null;
     141      this.stateLogViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
     142      this.stateLogViewHost.Enabled = false;
     143      this.stateLogViewHost.Location = new System.Drawing.Point(0, 0);
     144      this.stateLogViewHost.Name = "stateLogViewHost";
     145      this.stateLogViewHost.ReadOnly = false;
     146      this.stateLogViewHost.Size = new System.Drawing.Size(709, 426);
     147      this.stateLogViewHost.TabIndex = 0;
     148      this.stateLogViewHost.ViewsLabelVisible = true;
     149      this.stateLogViewHost.ViewType = null;
     150      //
    128151      // logTabPage
    129152      //
     
    234257      this.resourceNamesTextBox.TabIndex = 14;
    235258      this.resourceNamesTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated);
    236       //
    237       // useLocalPluginsCheckBox
    238       //
    239       this.useLocalPluginsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    240       this.useLocalPluginsCheckBox.AutoSize = true;
    241       this.useLocalPluginsCheckBox.Location = new System.Drawing.Point(469, 56);
    242       this.useLocalPluginsCheckBox.Name = "useLocalPluginsCheckBox";
    243       this.useLocalPluginsCheckBox.Size = new System.Drawing.Size(105, 17);
    244       this.useLocalPluginsCheckBox.TabIndex = 19;
    245       this.useLocalPluginsCheckBox.Text = "UseLocalPlugins";
    246       this.useLocalPluginsCheckBox.UseVisualStyleBackColor = true;
    247       this.useLocalPluginsCheckBox.CheckedChanged += new System.EventHandler(this.useLocalPluginsCheckBox_CheckedChanged);
    248259      //
    249260      // nameLabel
     
    370381      this.jobsLabel.TabIndex = 0;
    371382      this.jobsLabel.Text = "Jobs:";
    372       //
    373       // stateTabPage
    374       //
    375       this.stateTabPage.Controls.Add(this.stateLogViewHost);
    376       this.stateTabPage.Location = new System.Drawing.Point(4, 22);
    377       this.stateTabPage.Name = "stateTabPage";
    378       this.stateTabPage.Size = new System.Drawing.Size(709, 426);
    379       this.stateTabPage.TabIndex = 6;
    380       this.stateTabPage.Text = "State";
    381       this.stateTabPage.UseVisualStyleBackColor = true;
    382       //
    383       // stateLogViewHost
    384       //
    385       this.stateLogViewHost.Caption = "StateLog View";
    386       this.stateLogViewHost.Content = null;
    387       this.stateLogViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    388       this.stateLogViewHost.Location = new System.Drawing.Point(0, 0);
    389       this.stateLogViewHost.Name = "stateLogViewHost";
    390       this.stateLogViewHost.ReadOnly = false;
    391       this.stateLogViewHost.Size = new System.Drawing.Size(709, 426);
    392       this.stateLogViewHost.TabIndex = 0;
    393383      //
    394384      // RefreshableHiveExperimentView
     
    410400      this.Controls.Add(this.resourceIdsLabel);
    411401      this.Controls.Add(this.stopButton);
    412       this.Controls.Add(this.useLocalPluginsCheckBox);
    413402      this.Controls.Add(this.resetButton);
    414403      this.Name = "RefreshableHiveExperimentView";
     
    416405      this.tabControl.ResumeLayout(false);
    417406      this.jobsTabPage.ResumeLayout(false);
     407      this.stateTabPage.ResumeLayout(false);
    418408      this.logTabPage.ResumeLayout(false);
    419409      this.infoGroupBox.ResumeLayout(false);
    420410      this.infoGroupBox.PerformLayout();
    421       this.stateTabPage.ResumeLayout(false);
    422411      this.ResumeLayout(false);
    423412      this.PerformLayout();
     
    437426    private System.Windows.Forms.TabPage logTabPage;
    438427    private Core.Views.LogView logView;
    439     private System.Windows.Forms.CheckBox useLocalPluginsCheckBox;
    440428    private System.Windows.Forms.TabPage jobsTabPage;
    441429    private HiveJobItemTreeView jobsTreeView;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.cs

    r6419 r6426  
    104104        executionTimeTextBox.Text = string.Empty;
    105105        resourceNamesTextBox.Text = string.Empty;
    106         useLocalPluginsCheckBox.Checked = false;
    107106        isPrivilegedCheckBox.Checked = false;
    108107        logView.Content = null;
     
    113112        executionTimeTextBox.Text = Content.HiveExperiment.ExecutionTime.ToString();
    114113        resourceNamesTextBox.Text = Content.HiveExperiment.ResourceNames;
    115         useLocalPluginsCheckBox.Checked = Content.HiveExperiment.UseLocalPlugins;
    116114        isPrivilegedCheckBox.Checked = Content.HiveExperiment.IsPrivileged;
    117115        refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically;
     
    141139        this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
    142140
    143         this.isPrivilegedCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this
    144         this.useLocalPluginsCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded);
     141        this.isPrivilegedCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this       
    145142        this.refreshAutomaticallyCheckBox.Enabled = Content.IsControllable && alreadyUploaded && jobsLoaded && Content.HiveExperiment.ExecutionState == ExecutionState.Started;
    146143        this.refreshButton.Enabled = Content.IsControllable && alreadyUploaded;
     
    312309        Content.RefreshAutomatically = refreshAutomaticallyCheckBox.Checked;
    313310      }
    314     }
    315 
    316     private void useLocalPluginsCheckBox_CheckedChanged(object sender, EventArgs e) {
    317       if (Content != null) Content.HiveExperiment.UseLocalPlugins = useLocalPluginsCheckBox.Checked;
    318311    }
    319312
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs

    r6419 r6426  
    7171        var plugins = new List<IPluginDescription>();
    7272        PluginUtil.CollectDeclaringPlugins(plugins, types);
    73         job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, new List<Plugin>(), new List<Plugin>(), plugins, false);
     73        job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, new List<Plugin>(), new List<Plugin>(), plugins);
    7474        return s.AddChildJob(parentJobId, job, jobData);
    7575      });
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs

    r6419 r6426  
    219219          this.OnlinePlugins = service.GetPlugins();
    220220          this.AlreadyUploadedPlugins = new List<Plugin>();
    221           Plugin configFilePlugin = UploadConfigurationFile(service);
     221          Plugin configFilePlugin = UploadConfigurationFile(service, onlinePlugins);
    222222          this.alreadyUploadedPlugins.Add(configFilePlugin);
    223223
     
    226226
    227227          foreach (HiveJob hiveJob in refreshableHiveExperiment.HiveExperiment.HiveJobs) {
    228             UploadJobWithChildren(refreshableHiveExperiment.HiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.UseLocalPlugins, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged);
     228            UploadJobWithChildren(refreshableHiveExperiment.HiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged);
    229229          }
    230230
     
    240240    /// Uploads the local configuration file as plugin
    241241    /// </summary>
    242     private static Plugin UploadConfigurationFile(IHiveService service) {
     242    private static Plugin UploadConfigurationFile(IHiveService service, List<Plugin> onlinePlugins) {
    243243      string exeFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HeuristicLab 3.3.exe");
    244244      string configFileName = Path.GetFileName(ConfigurationManager.OpenExeConfiguration(exeFilePath).FilePath);
     
    251251      }
    252252
    253       Plugin configPlugin = new Plugin() { Name = "Configuration", IsLocal = true, Version = new Version(), Hash = hash };
     253      Plugin configPlugin = new Plugin() { Name = "Configuration", Version = new Version(), Hash = hash };
    254254      PluginData configFile = new PluginData() { FileName = configFileName, Data = data };
    255       configPlugin.Id = service.AddPlugin(configPlugin, new List<PluginData> { configFile });
    256       return configPlugin;
     255
     256      IEnumerable<Plugin> onlineConfig = onlinePlugins.Where(p => p.Hash.SequenceEqual(hash));
     257
     258      if (onlineConfig.Count() > 0) {
     259        return onlineConfig.First();
     260      } else {
     261        configPlugin.Id = service.AddPlugin(configPlugin, new List<PluginData> { configFile });
     262        return configPlugin;
     263      }
    257264    }
    258265
     
    264271    /// <param name="parentHiveJob">shall be null if its the root job</param>
    265272    /// <param name="groups"></param>
    266     private void UploadJobWithChildren(IProgress progress, IHiveService service, HiveJob hiveJob, HiveJob parentHiveJob, IEnumerable<Guid> groups, ref int jobCount, int totalJobCount, Guid configPluginId, bool useLocalPlugins, Guid hiveExperimentId, ILog log, bool isPrivileged) {
     273    private void UploadJobWithChildren(IProgress progress, IHiveService service, HiveJob hiveJob, HiveJob parentHiveJob, IEnumerable<Guid> groups, ref int jobCount, int totalJobCount, Guid configPluginId, Guid hiveExperimentId, ILog log, bool isPrivileged) {
    267274      jobCount++;
    268275      progress.Status = string.Format("Serializing job {0} of {1}", jobCount, totalJobCount);
     
    281288
    282289      TryAndRepeat(() => {
    283         hiveJob.Job.PluginsNeededIds = PluginUtil.GetPluginDependencies(service, this.onlinePlugins, this.alreadyUploadedPlugins, plugins, useLocalPlugins);
     290        hiveJob.Job.PluginsNeededIds = PluginUtil.GetPluginDependencies(service, this.onlinePlugins, this.alreadyUploadedPlugins, plugins);
    284291      }, -1, "Failed to upload plugins");
    285292      hiveJob.Job.PluginsNeededIds.Add(configPluginId);
     
    300307
    301308      foreach (HiveJob child in hiveJob.ChildHiveJobs) {
    302         UploadJobWithChildren(progress, service, child, hiveJob, groups, ref jobCount, totalJobCount, configPluginId, useLocalPlugins, hiveExperimentId, log, isPrivileged);
     309        UploadJobWithChildren(progress, service, child, hiveJob, groups, ref jobCount, totalJobCount, configPluginId, hiveExperimentId, log, isPrivileged);
    303310      }
    304311    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs

    r6419 r6426  
    3030namespace HeuristicLab.Clients.Hive {
    3131  public partial class HiveExperiment : IDeepCloneable, IContent, IProgressReporter {
    32     private bool useLocalPlugins;
    33     public bool UseLocalPlugins {
    34       get { return useLocalPlugins; }
    35       set { useLocalPlugins = value; }
    36     }
    3732
    3833    private bool isPrivileged;
     
    115110      this.Id = original.Id;
    116111      this.HiveJobs = cloner.Clone(original.HiveJobs);
    117       this.UseLocalPlugins = original.UseLocalPlugins;
    118112      this.ExecutionTime = original.ExecutionTime;
    119113      this.IsPrivileged = original.IsPrivileged;
     
    213207      OnHiveJobsAdded(e);
    214208    }
    215    
     209
    216210    private void item_StateLogChanged(object sender, EventArgs e) {
    217211      OnStateLogListChanged();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs

    r6407 r6426  
    514514
    515515    [System.Runtime.Serialization.OptionalFieldAttribute()]
    516     private bool IsLocalField;
    517 
    518     [System.Runtime.Serialization.OptionalFieldAttribute()]
    519516    private System.Guid UserIdField;
    520517
     
    544541          this.HashField = value;
    545542          this.RaisePropertyChanged("Hash");
    546         }
    547       }
    548     }
    549 
    550     [System.Runtime.Serialization.DataMemberAttribute()]
    551     public bool IsLocal {
    552       get {
    553         return this.IsLocalField;
    554       }
    555       set {
    556         if ((this.IsLocalField.Equals(value) != true)) {
    557           this.IsLocalField = value;
    558           this.RaisePropertyChanged("IsLocal");
    559543        }
    560544      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Plugin.cs

    r6372 r6426  
    3333      this.UserId = original.UserId;
    3434      this.DateCreated = original.DateCreated;
    35       this.IsLocal = original.IsLocal;
    3635    }
    3736
     
    4140
    4241    public override string ToString() {
    43       return string.Format("{0}-{1}", this.Name, this.Version.ToString()) + (this.IsLocal ? ", Local" : string.Empty);
     42      return string.Format("{0}-{1}", this.Name, this.Version.ToString());
    4443    }
    4544  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Util/PluginUtil.cs

    r6408 r6426  
    3838    /// <param name="alreadyUploadedPlugins">List of plugins which have been uploaded from this HiveExperiment</param>
    3939    /// <param name="neededPlugins">List of plugins which need to be uploaded</param>
    40     /// <param name="useLocalPlugins">If true, the plugins which are already online are ignored. All local plugins are uploaded, but only once.</param>
    4140    /// <returns></returns>
    42     public static List<Guid> GetPluginDependencies(IHiveService service, List<Plugin> onlinePlugins, List<Plugin> alreadyUploadedPlugins, IEnumerable<IPluginDescription> neededPlugins, bool useLocalPlugins) {
     41    public static List<Guid> GetPluginDependencies(IHiveService service, List<Plugin> onlinePlugins, List<Plugin> alreadyUploadedPlugins, IEnumerable<IPluginDescription> neededPlugins) {
    4342      var pluginIds = new List<Guid>();
    4443      Dictionary<IPluginDescription, byte[]> checksumsNeededPlugins = CalcChecksumsForPlugins(neededPlugins);
     
    5554          });
    5655
    57           if (useLocalPlugins || foundPlugin == null) {
    58             Plugin p = CreatePlugin(neededPlugin.Key, useLocalPlugins, neededPlugin.Value);
     56          if (foundPlugin == null) {
     57            Plugin p = CreatePlugin(neededPlugin.Key, neededPlugin.Value);
    5958            List<PluginData> pd = CreatePluginDatas(neededPlugin.Key);
    6059            try {
     
    7675    }
    7776
    78     private static Plugin CreatePlugin(IPluginDescription plugin, bool useLocalPlugins, byte[] hash) {
    79       return new Plugin() { Name = plugin.Name, Version = plugin.Version, IsLocal = useLocalPlugins, Hash = hash };
     77    private static Plugin CreatePlugin(IPluginDescription plugin, byte[] hash) {
     78      return new Plugin() { Name = plugin.Name, Version = plugin.Version, Hash = hash };
    8079    }
    8180
    82     public static Plugin CreatePlugin(IPluginDescription plugin, bool useLocalPlugins) {
    83       return new Plugin() { Name = plugin.Name, Version = plugin.Version, IsLocal = useLocalPlugins };
     81    public static Plugin CreatePlugin(IPluginDescription plugin) {
     82      return new Plugin() { Name = plugin.Name, Version = plugin.Version };
    8483    }
    8584
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Views/3.4/HiveEngineView.Designer.cs

    r6419 r6426  
    3838      this.executionTimeLabel = new System.Windows.Forms.Label();
    3939      this.executionTimeTextBox = new System.Windows.Forms.TextBox();
    40       this.useLocalPluginsCheckBox = new System.Windows.Forms.CheckBox();
    4140      this.isPrivilegedCheckBox = new System.Windows.Forms.CheckBox();
    4241      this.tabControl.SuspendLayout();
     
    180179      this.executionTimeTextBox.Size = new System.Drawing.Size(577, 20);
    181180      this.executionTimeTextBox.TabIndex = 11;
    182       //
    183       // useLocalPluginsCheckBox
    184       //
    185       this.useLocalPluginsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    186       this.useLocalPluginsCheckBox.AutoSize = true;
    187       this.useLocalPluginsCheckBox.Location = new System.Drawing.Point(598, 55);
    188       this.useLocalPluginsCheckBox.Name = "useLocalPluginsCheckBox";
    189       this.useLocalPluginsCheckBox.Size = new System.Drawing.Size(105, 17);
    190       this.useLocalPluginsCheckBox.TabIndex = 12;
    191       this.useLocalPluginsCheckBox.Text = "UseLocalPlugins";
    192       this.useLocalPluginsCheckBox.UseVisualStyleBackColor = true;
    193       this.useLocalPluginsCheckBox.CheckedChanged += new System.EventHandler(this.useLocalPluginsCheckBox_CheckedChanged);
    194181      //
    195182      // isPrivilegedCheckBox
     
    210197      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    211198      this.Controls.Add(this.isPrivilegedCheckBox);
    212       this.Controls.Add(this.useLocalPluginsCheckBox);
    213199      this.Controls.Add(this.executionTimeTextBox);
    214200      this.Controls.Add(this.executionTimeLabel);
     
    243229    private System.Windows.Forms.Label executionTimeLabel;
    244230    private System.Windows.Forms.TextBox executionTimeTextBox;
    245     private System.Windows.Forms.CheckBox useLocalPluginsCheckBox;
    246231    private HeuristicLab.Core.Views.LogView logView;
    247232    private RefreshableHiveExperimentListView hiveExperimentListView;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Views/3.4/HiveEngineView.cs

    r6419 r6426  
    7373        priorityTextBox.Text = string.Empty;
    7474        executionTimeOnHiveTextBox.Text = string.Empty;
    75         useLocalPluginsCheckBox.Checked = false;
    7675        isPrivilegedCheckBox.Checked = false;
    7776        hiveExperimentListView.Content = null;
     
    8180        priorityTextBox.Text = Content.Priority.ToString();
    8281        executionTimeOnHiveTextBox.Text = Content.ExecutionTimeOnHive.ToString();
    83         useLocalPluginsCheckBox.Checked = Content.UseLocalPlugins;
    8482        isPrivilegedCheckBox.Checked = Content.IsPrivileged;
    8583        hiveExperimentListView.Content = Content.HiveExperiments;
     
    9492        resourceIdsTextBox.ReadOnly = this.ReadOnly;
    9593        priorityTextBox.ReadOnly = this.ReadOnly;
    96         useLocalPluginsCheckBox.Enabled = !this.ReadOnly;
    9794        isPrivilegedCheckBox.Enabled = !this.ReadOnly; // TODO: check for user rights
    9895      } else {
    9996        resourceIdsTextBox.ReadOnly = false;
    10097        priorityTextBox.ReadOnly = false;
    101         useLocalPluginsCheckBox.Enabled = false;
    10298        isPrivilegedCheckBox.Enabled = false;
    10399      }
    104100    }
    105    
     101
    106102    #region Event Handlers (child controls)
    107103    private void resourceIdsTextBox_Validated(object sender, EventArgs e) {
     
    111107    private void priorityTextBox_Validated(object sender, EventArgs e) {
    112108      Content.Priority = int.Parse(priorityTextBox.Text);
    113     }
    114 
    115     private void useLocalPluginsCheckBox_CheckedChanged(object sender, EventArgs e) {
    116       Content.UseLocalPlugins = useLocalPluginsCheckBox.Checked;
    117109    }
    118110
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs

    r6419 r6426  
    6868
    6969    [Storable]
    70     private bool useLocalPlugins;
    71     public bool UseLocalPlugins {
    72       get { return useLocalPlugins; }
    73       set { useLocalPlugins = value; }
    74     }
    75 
    76     [Storable]
    7770    private bool isPrivileged;
    7871    public bool IsPrivileged {
     
    114107      this.priority = original.priority;
    115108      this.executionTimeOnHive = original.executionTimeOnHive;
    116       this.useLocalPlugins = original.useLocalPlugins;
    117109      this.IsPrivileged = original.IsPrivileged;
    118110      // this.hiveExperiments = cloner.Clone(original.hiveExperiments); do not clone hiveExperiments - otherwise they would be sent with every job
     
    149141      if (firstRun) {
    150142        TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);
    151         this.OnlinePlugins = ServiceLocator.Instance.CallHiveService(s => s.GetPlugins()).Where(x => x.IsLocal == false).ToList();
     143        this.OnlinePlugins = ServiceLocator.Instance.CallHiveService(s => s.GetPlugins()).Where(x => x.Hash != null).ToList();
    152144        this.AlreadyUploadedPlugins = new List<Plugin>();
    153145        firstRun = false;
     
    338330        hiveExperiment.Name = "HiveEngine Run " + hiveExperiments.Count;
    339331        hiveExperiment.DateCreated = DateTime.Now;
    340         hiveExperiment.UseLocalPlugins = this.UseLocalPlugins;
    341332        hiveExperiment.ResourceNames = this.ResourceNames;
    342333        hiveExperiment.IsPrivileged = this.IsPrivileged;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Plugin.cs

    r6407 r6426  
    3737
    3838    [DataMember]
    39     public bool IsLocal { get; set; }
    40 
    41     [DataMember]
    4239    public byte[] Hash { get; set; }
    4340
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs

    r6407 r6426  
    167167    public static DT.Plugin ToDto(Plugin source) {
    168168      if (source == null) return null;
    169       return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version), UserId = source.UserId, IsLocal = source.IsLocal, DateCreated = source.DateCreated, Hash = source.Hash };
     169      return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version), UserId = source.UserId, DateCreated = source.DateCreated, Hash = source.Hash };
    170170    }
    171171    public static Plugin ToEntity(DT.Plugin source) {
     
    176176    public static void ToEntity(DT.Plugin source, Plugin target) {
    177177      if ((source != null) && (target != null)) {
    178         target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString(); target.UserId = source.UserId; target.IsLocal = source.IsLocal; target.DateCreated = source.DateCreated; target.Hash = source.Hash;
     178        target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString(); target.UserId = source.UserId; target.DateCreated = source.DateCreated; target.Hash = source.Hash;
    179179      }
    180180    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml

    r6407 r6426  
    1414      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    1515      <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    16       <Column Name="IsLocal" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
    1716      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    1817      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout

    r6407 r6426  
    99      </nestedChildShapes>
    1010    </classShape>
    11     <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="8.875, 5.5, 2, 2.1554996744791666">
     11    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="8.875, 5.5, 2, 1.9631982421874996">
    1212      <DataClassMoniker Name="/HiveDataContext/Plugin" />
    1313      <nestedChildShapes>
    14         <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="8.89, 5.9600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     14        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="8.89, 5.9600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    1515      </nestedChildShapes>
    1616    </classShape>
     
    7676      </nodes>
    7777    </associationConnector>
    78     <associationConnector edgePoints="[(7.5 : 4.30930826822917); (7.5 : 4.84780160677083); (8.875 : 4.84780160677083)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     78    <associationConnector edgePoints="[(7.5 : 4.30930826822917); (7.5 : 4.84780160677083); (8.875 : 4.84780160677083)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    7979      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
    8080      <nodes>
     
    116116      </nestedChildShapes>
    117117    </classShape>
    118     <associationConnector edgePoints="[(10.875 : 6.28929768880208); (11.25 : 6.28929768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     118    <associationConnector edgePoints="[(10.875 : 6.28929768880208); (11.25 : 6.28929768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    119119      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
    120120      <nodes>
     
    130130      </nodes>
    131131    </associationConnector>
    132     <associationConnector edgePoints="[(8.875 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     132    <associationConnector edgePoints="[(8.875 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    133133      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
    134134      <nodes>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs

    r6407 r6426  
    438438    private string _Version;
    439439   
    440     private bool _IsLocal;
    441    
    442440    private System.Guid _UserId;
    443441   
     
    460458    partial void OnVersionChanging(string value);
    461459    partial void OnVersionChanged();
    462     partial void OnIsLocalChanging(bool value);
    463     partial void OnIsLocalChanged();
    464460    partial void OnUserIdChanging(System.Guid value);
    465461    partial void OnUserIdChanged();
     
    533529          this.SendPropertyChanged("Version");
    534530          this.OnVersionChanged();
    535         }
    536       }
    537     }
    538    
    539     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsLocal", DbType="Bit")]
    540     public bool IsLocal
    541     {
    542       get
    543       {
    544         return this._IsLocal;
    545       }
    546       set
    547       {
    548         if ((this._IsLocal != value))
    549         {
    550           this.OnIsLocalChanging(value);
    551           this.SendPropertyChanging();
    552           this._IsLocal = value;
    553           this.SendPropertyChanged("IsLocal");
    554           this.OnIsLocalChanged();
    555531        }
    556532      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs

    r6419 r6426  
    9898      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
    9999      //trans.UseTransaction(() => { // cneumuel: try without transaction
    100         jobData.LastUpdate = DateTime.Now;
    101         dao.UpdateJob(job);
    102         dao.UpdateJobData(jobData);
     100      jobData.LastUpdate = DateTime.Now;
     101      dao.UpdateJob(job);
     102      dao.UpdateJobData(jobData);
    103103      //}, false, true);
    104104    }
     
    285285        plugin.UserId = author.UserId;
    286286        plugin.DateCreated = DateTime.Now;
    287         if (!plugin.IsLocal) {
    288           var existing = dao.GetPlugins(x => x.Hash != null && !x.IsLocal).Where(x => x.Hash.SequenceEqual(plugin.Hash));
    289 
    290           if (existing.Count() > 0) {
    291             // a plugin with the same name and version already exists.
    292             throw new FaultException<PluginAlreadyExistsFault>(new PluginAlreadyExistsFault(existing.Single().Id));
    293           }
    294         }
     287
     288        var existing = dao.GetPlugins(x => x.Hash != null).Where(x => x.Hash.SequenceEqual(plugin.Hash));
     289        if (existing.Count() > 0) {
     290          // a plugin already exists.
     291          throw new FaultException<PluginAlreadyExistsFault>(new PluginAlreadyExistsFault(existing.Single().Id));
     292        }
     293
    295294        Guid pluginId = dao.AddPlugin(plugin);
    296295        foreach (PluginData pluginData in pluginDatas) {
     
    309308    public IEnumerable<Plugin> GetPlugins() {
    310309      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
    311       return dao.GetPlugins(x => x.IsLocal == false);
     310      return dao.GetPlugins(x => x.Hash != null);
    312311    }
    313312
Note: See TracChangeset for help on using the changeset viewer.