- Timestamp:
- 02/16/10 18:44:45 (15 years ago)
- Location:
- branches/DeploymentServer Prototype/HeuristicLab.Services
- Files:
-
- 12 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/HeuristicLab.DeploymentService.AdminClient.csproj
r2804 r2816 48 48 </PropertyGroup> 49 49 <ItemGroup> 50 <Reference Include="ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL"> 51 <SpecificVersion>False</SpecificVersion> 52 <HintPath>..\HeuristicLab.PluginInfrastructure\ICSharpCode.SharpZipLib.dll</HintPath> 53 </Reference> 50 54 <Reference Include="System" /> 51 55 <Reference Include="System.Core"> … … 70 74 </ItemGroup> 71 75 <ItemGroup> 76 <Compile Include="ServerPluginView.cs"> 77 <SubType>UserControl</SubType> 78 </Compile> 79 <Compile Include="ServerPluginView.Designer.cs"> 80 <DependentUpon>ServerPluginView.cs</DependentUpon> 81 </Compile> 82 <Compile Include="PluginView.cs"> 83 <SubType>UserControl</SubType> 84 </Compile> 85 <Compile Include="PluginView.Designer.cs"> 86 <DependentUpon>PluginView.cs</DependentUpon> 87 </Compile> 88 <Compile Include="LicenseView.cs"> 89 <SubType>UserControl</SubType> 90 </Compile> 91 <Compile Include="LicenseView.Designer.cs"> 92 <DependentUpon>LicenseView.cs</DependentUpon> 93 </Compile> 94 <Compile Include="LocalPluginView.cs"> 95 <SubType>UserControl</SubType> 96 </Compile> 97 <Compile Include="LocalPluginView.Designer.cs"> 98 <DependentUpon>LocalPluginView.cs</DependentUpon> 99 </Compile> 72 100 <Compile Include="ProductEditor.cs"> 73 101 <SubType>UserControl</SubType> … … 91 119 </Compile> 92 120 <Compile Include="Properties\AssemblyInfo.cs" /> 93 <Compile Include="Service References\AdminService\Reference.cs">94 <AutoGen>True</AutoGen>95 <DesignTime>True</DesignTime>96 <DependentUpon>Reference.svcmap</DependentUpon>97 </Compile>98 <Compile Include="UpdateAction.cs" />99 <Compile Include="UpdateServerPluginsButtonItem.cs" />100 <Compile Include="UpdateServerPluginsMenuItem.cs" />101 121 </ItemGroup> 102 122 <ItemGroup> … … 115 135 </ItemGroup> 116 136 <ItemGroup> 117 <WCFMetadata Include="Service References\" />118 </ItemGroup>119 <ItemGroup>120 137 <None Include="app.config" /> 121 138 <None Include="HeuristicLabDeploymentServiceAdminClientPlugin.cs.frame" /> 122 139 <None Include="Properties\AssemblyInfo.frame" /> 123 <None Include="Service References\AdminService\service.wsdl" />124 <None Include="Service References\AdminService\service.xsd" />125 <None Include="Service References\AdminService\service1.xsd" />126 140 </ItemGroup> 127 141 <ItemGroup> 142 <EmbeddedResource Include="ServerPluginView.resx"> 143 <DependentUpon>ServerPluginView.cs</DependentUpon> 144 </EmbeddedResource> 145 <EmbeddedResource Include="PluginView.resx"> 146 <DependentUpon>PluginView.cs</DependentUpon> 147 </EmbeddedResource> 148 <EmbeddedResource Include="LicenseView.resx"> 149 <DependentUpon>LicenseView.cs</DependentUpon> 150 </EmbeddedResource> 151 <EmbeddedResource Include="LocalPluginView.resx"> 152 <DependentUpon>LocalPluginView.cs</DependentUpon> 153 </EmbeddedResource> 128 154 <EmbeddedResource Include="ProductEditor.resx"> 129 155 <DependentUpon>ProductEditor.cs</DependentUpon> … … 132 158 <DependentUpon>PluginListView.cs</DependentUpon> 133 159 </EmbeddedResource> 134 </ItemGroup>135 <ItemGroup>136 <WCFMetadataStorage Include="Service References\AdminService\" />137 </ItemGroup>138 <ItemGroup>139 <None Include="Service References\AdminService\configuration91.svcinfo" />140 </ItemGroup>141 <ItemGroup>142 <None Include="Service References\AdminService\configuration.svcinfo" />143 </ItemGroup>144 <ItemGroup>145 <None Include="Service References\AdminService\Reference.svcmap">146 <Generator>WCF Proxy Generator</Generator>147 <LastGenOutput>Reference.cs</LastGenOutput>148 </None>149 160 </ItemGroup> 150 161 <ItemGroup> -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/PluginListView.Designer.cs
r2802 r2816 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Local plugins", System.Windows.Forms.HorizontalAlignment.Left);27 System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("All plugins", System.Windows.Forms.HorizontalAlignment.Left);28 System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Disabled plugins", System.Windows.Forms.HorizontalAlignment.Left);29 this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();30 26 this.listView = new System.Windows.Forms.ListView(); 31 27 this.nameHeader = new System.Windows.Forms.ColumnHeader(); 32 this.Version = new System.Windows.Forms.ColumnHeader(); 33 this.detailsTextBox = new System.Windows.Forms.TextBox(); 28 this.localVersion = new System.Windows.Forms.ColumnHeader(); 34 29 this.uploadButton = new System.Windows.Forms.Button(); 30 this.splitContainer = new System.Windows.Forms.SplitContainer(); 31 this.label1 = new System.Windows.Forms.Label(); 32 this.serverUrlTextBox = new System.Windows.Forms.TextBox(); 33 this.connectButton = new System.Windows.Forms.Button(); 34 this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 35 this.serverPluginDetailsGroupBox = new System.Windows.Forms.GroupBox(); 36 this.localPluginDetailsGroupBox = new System.Windows.Forms.GroupBox(); 37 this.localPluginDetailsPanel = new System.Windows.Forms.Panel(); 38 this.serverVersion = new System.Windows.Forms.ColumnHeader(); 39 this.splitContainer.Panel1.SuspendLayout(); 40 this.splitContainer.Panel2.SuspendLayout(); 41 this.splitContainer.SuspendLayout(); 35 42 this.tableLayoutPanel.SuspendLayout(); 43 this.localPluginDetailsGroupBox.SuspendLayout(); 36 44 this.SuspendLayout(); 37 45 // 38 // tableLayoutPanel39 //40 this.tableLayoutPanel.ColumnCount = 1;41 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));42 this.tableLayoutPanel.Controls.Add(this.listView, 0, 0);43 this.tableLayoutPanel.Controls.Add(this.detailsTextBox, 0, 1);44 this.tableLayoutPanel.Controls.Add(this.uploadButton, 0, 2);45 this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;46 this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0);47 this.tableLayoutPanel.Name = "tableLayoutPanel";48 this.tableLayoutPanel.RowCount = 3;49 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 63.42105F));50 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 36.57895F));51 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 123F));52 this.tableLayoutPanel.Size = new System.Drawing.Size(400, 380);53 this.tableLayoutPanel.TabIndex = 0;54 //55 46 // listView 56 47 // 48 this.listView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 49 | System.Windows.Forms.AnchorStyles.Left) 50 | System.Windows.Forms.AnchorStyles.Right))); 57 51 this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 58 52 this.nameHeader, 59 this.Version}); 60 this.listView.Dock = System.Windows.Forms.DockStyle.Fill; 61 listViewGroup1.Header = "Local plugins"; 62 listViewGroup1.Name = "Local plugins"; 63 listViewGroup2.Header = "All plugins"; 64 listViewGroup2.Name = "All plugins"; 65 listViewGroup3.Header = "Disabled plugins"; 66 listViewGroup3.Name = "Disabled plugins"; 67 this.listView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { 68 listViewGroup1, 69 listViewGroup2, 70 listViewGroup3}); 71 this.listView.Location = new System.Drawing.Point(3, 3); 53 this.localVersion, 54 this.serverVersion}); 55 this.listView.Enabled = false; 56 this.listView.Location = new System.Drawing.Point(3, 32); 57 this.listView.MultiSelect = false; 72 58 this.listView.Name = "listView"; 73 this.listView.Size = new System.Drawing.Size(394, 156); 59 this.listView.ShowGroups = false; 60 this.listView.Size = new System.Drawing.Size(392, 459); 74 61 this.listView.TabIndex = 0; 75 62 this.listView.UseCompatibleStateImageBehavior = false; … … 80 67 // 81 68 this.nameHeader.Text = "Name"; 82 this.nameHeader.Width = 300; 83 // 84 // Version 85 // 86 this.Version.Text = "Version"; 87 this.Version.Width = 100; 88 // 89 // detailsTextBox 90 // 91 this.detailsTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 92 this.detailsTextBox.Location = new System.Drawing.Point(3, 165); 93 this.detailsTextBox.Multiline = true; 94 this.detailsTextBox.Name = "detailsTextBox"; 95 this.detailsTextBox.ReadOnly = true; 96 this.detailsTextBox.Size = new System.Drawing.Size(394, 88); 97 this.detailsTextBox.TabIndex = 1; 69 this.nameHeader.Width = 188; 70 // 71 // localVersion 72 // 73 this.localVersion.Text = "Local version"; 74 this.localVersion.Width = 100; 98 75 // 99 76 // uploadButton 100 77 // 101 this.uploadButton.Location = new System.Drawing.Point(3, 259); 78 this.uploadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 79 this.uploadButton.Enabled = false; 80 this.uploadButton.Location = new System.Drawing.Point(6, 459); 102 81 this.uploadButton.Name = "uploadButton"; 103 this.uploadButton.Size = new System.Drawing.Size( 75, 23);82 this.uploadButton.Size = new System.Drawing.Size(110, 23); 104 83 this.uploadButton.TabIndex = 2; 105 this.uploadButton.Text = "Upload ";84 this.uploadButton.Text = "Upload plugin"; 106 85 this.uploadButton.UseVisualStyleBackColor = true; 107 86 this.uploadButton.Click += new System.EventHandler(this.uploadButton_Click); 108 87 // 88 // splitContainer 89 // 90 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; 91 this.splitContainer.Location = new System.Drawing.Point(0, 0); 92 this.splitContainer.Name = "splitContainer"; 93 // 94 // splitContainer.Panel1 95 // 96 this.splitContainer.Panel1.Controls.Add(this.label1); 97 this.splitContainer.Panel1.Controls.Add(this.serverUrlTextBox); 98 this.splitContainer.Panel1.Controls.Add(this.connectButton); 99 this.splitContainer.Panel1.Controls.Add(this.listView); 100 // 101 // splitContainer.Panel2 102 // 103 this.splitContainer.Panel2.Controls.Add(this.tableLayoutPanel); 104 this.splitContainer.Size = new System.Drawing.Size(852, 494); 105 this.splitContainer.SplitterDistance = 398; 106 this.splitContainer.TabIndex = 3; 107 // 108 // label1 109 // 110 this.label1.AutoSize = true; 111 this.label1.Location = new System.Drawing.Point(3, 8); 112 this.label1.Name = "label1"; 113 this.label1.Size = new System.Drawing.Size(98, 13); 114 this.label1.TabIndex = 5; 115 this.label1.Text = "Deployment server:"; 116 // 117 // serverUrlTextBox 118 // 119 this.serverUrlTextBox.Location = new System.Drawing.Point(107, 5); 120 this.serverUrlTextBox.Name = "serverUrlTextBox"; 121 this.serverUrlTextBox.Size = new System.Drawing.Size(107, 20); 122 this.serverUrlTextBox.TabIndex = 4; 123 // 124 // connectButton 125 // 126 this.connectButton.Location = new System.Drawing.Point(220, 3); 127 this.connectButton.Name = "connectButton"; 128 this.connectButton.Size = new System.Drawing.Size(75, 23); 129 this.connectButton.TabIndex = 3; 130 this.connectButton.Text = "Connect"; 131 this.connectButton.UseVisualStyleBackColor = true; 132 this.connectButton.Click += new System.EventHandler(this.connectButton_Click); 133 // 134 // tableLayoutPanel 135 // 136 this.tableLayoutPanel.ColumnCount = 2; 137 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); 138 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); 139 this.tableLayoutPanel.Controls.Add(this.serverPluginDetailsGroupBox, 1, 0); 140 this.tableLayoutPanel.Controls.Add(this.localPluginDetailsGroupBox, 0, 0); 141 this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; 142 this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0); 143 this.tableLayoutPanel.Name = "tableLayoutPanel"; 144 this.tableLayoutPanel.RowCount = 1; 145 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 146 this.tableLayoutPanel.Size = new System.Drawing.Size(450, 494); 147 this.tableLayoutPanel.TabIndex = 3; 148 // 149 // serverPluginDetailsGroupBox 150 // 151 this.serverPluginDetailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 152 this.serverPluginDetailsGroupBox.Location = new System.Drawing.Point(228, 3); 153 this.serverPluginDetailsGroupBox.Name = "serverPluginDetailsGroupBox"; 154 this.serverPluginDetailsGroupBox.Size = new System.Drawing.Size(219, 488); 155 this.serverPluginDetailsGroupBox.TabIndex = 3; 156 this.serverPluginDetailsGroupBox.TabStop = false; 157 this.serverPluginDetailsGroupBox.Text = "Server plugin information"; 158 // 159 // localPluginDetailsGroupBox 160 // 161 this.localPluginDetailsGroupBox.Controls.Add(this.localPluginDetailsPanel); 162 this.localPluginDetailsGroupBox.Controls.Add(this.uploadButton); 163 this.localPluginDetailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 164 this.localPluginDetailsGroupBox.Location = new System.Drawing.Point(3, 3); 165 this.localPluginDetailsGroupBox.Name = "localPluginDetailsGroupBox"; 166 this.localPluginDetailsGroupBox.Size = new System.Drawing.Size(219, 488); 167 this.localPluginDetailsGroupBox.TabIndex = 4; 168 this.localPluginDetailsGroupBox.TabStop = false; 169 this.localPluginDetailsGroupBox.Text = "Local plugin information"; 170 // 171 // localPluginDetailsPanel 172 // 173 this.localPluginDetailsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 174 | System.Windows.Forms.AnchorStyles.Left) 175 | System.Windows.Forms.AnchorStyles.Right))); 176 this.localPluginDetailsPanel.Location = new System.Drawing.Point(6, 19); 177 this.localPluginDetailsPanel.Name = "localPluginDetailsPanel"; 178 this.localPluginDetailsPanel.Size = new System.Drawing.Size(207, 434); 179 this.localPluginDetailsPanel.TabIndex = 3; 180 // 181 // serverVersion 182 // 183 this.serverVersion.Text = "Server version"; 184 this.serverVersion.Width = 100; 185 // 109 186 // PluginListView 110 187 // 111 188 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 112 189 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 113 this.Controls.Add(this. tableLayoutPanel);190 this.Controls.Add(this.splitContainer); 114 191 this.Name = "PluginListView"; 115 this.Size = new System.Drawing.Size(400, 380); 192 this.Size = new System.Drawing.Size(852, 494); 193 this.splitContainer.Panel1.ResumeLayout(false); 194 this.splitContainer.Panel1.PerformLayout(); 195 this.splitContainer.Panel2.ResumeLayout(false); 196 this.splitContainer.ResumeLayout(false); 116 197 this.tableLayoutPanel.ResumeLayout(false); 117 this. tableLayoutPanel.PerformLayout();198 this.localPluginDetailsGroupBox.ResumeLayout(false); 118 199 this.ResumeLayout(false); 119 200 … … 122 203 #endregion 123 204 205 private System.Windows.Forms.ListView listView; 206 private System.Windows.Forms.ColumnHeader nameHeader; 207 private System.Windows.Forms.ColumnHeader localVersion; 208 private System.Windows.Forms.Button uploadButton; 209 private System.Windows.Forms.SplitContainer splitContainer; 210 private System.Windows.Forms.Button connectButton; 211 private System.Windows.Forms.Label label1; 212 private System.Windows.Forms.TextBox serverUrlTextBox; 124 213 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 125 private System.Windows.Forms.ListView listView; 126 private System.Windows.Forms.TextBox detailsTextBox; 127 private System.Windows.Forms.ColumnHeader nameHeader; 128 private System.Windows.Forms.ColumnHeader Version; 129 private System.Windows.Forms.Button uploadButton; 214 private System.Windows.Forms.GroupBox serverPluginDetailsGroupBox; 215 private System.Windows.Forms.GroupBox localPluginDetailsGroupBox; 216 private System.Windows.Forms.Panel localPluginDetailsPanel; 217 private System.Windows.Forms.ColumnHeader serverVersion; 130 218 } 131 219 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/PluginListView.cs
r2804 r2816 9 9 using HeuristicLab.MainForm; 10 10 using HeuristicLab.PluginInfrastructure; 11 using PluginDeploymentService = HeuristicLab.PluginInfrastructure.Advanced.DeploymentService; 12 using HeuristicLab.PluginInfrastructure.Manager; 13 using System.ServiceModel; 14 using ICSharpCode.SharpZipLib.Zip; 15 using System.IO; 11 16 12 17 namespace HeuristicLab.DeploymentService.AdminClient { 13 18 public partial class PluginListView : HeuristicLab.MainForm.WindowsForms.View { 14 private List<ListViewItem> localPlugins; 15 private List<ListViewItem> serverPlugins; 19 private Dictionary<IPluginDescription, PluginDeploymentService.PluginDescription> localAndServerPlugins; 16 20 private BackgroundWorker pluginUploadWorker; 21 private BackgroundWorker updateServerPluginsWorker; 17 22 18 23 public PluginListView() { … … 20 25 Caption = "Plugins"; 21 26 22 localPlugins = new List<ListViewItem>(); 23 serverPlugins = new List<ListViewItem>(); 27 using (var client = new PluginDeploymentService.UpdateClient()) { 28 serverUrlTextBox.Text = client.Endpoint.Address.ToString(); 29 } 30 31 localAndServerPlugins = new Dictionary<IPluginDescription, PluginDeploymentService.PluginDescription>(); 24 32 25 33 pluginUploadWorker = new BackgroundWorker(); … … 27 35 pluginUploadWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(pluginUploadWorker_RunWorkerCompleted); 28 36 29 UpdateLocalPlugins(); 37 updateServerPluginsWorker = new BackgroundWorker(); 38 updateServerPluginsWorker.DoWork += new DoWorkEventHandler(updateServerPluginsWorker_DoWork); 39 updateServerPluginsWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(updateServerPluginsWorker_RunWorkerCompleted); 40 } 41 42 void updateServerPluginsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 43 if (!e.Cancelled && e.Result != null) { 44 UpdateLocalPlugins(); 45 var plugins = (PluginDeploymentService.PluginDescription[])e.Result; 46 foreach (var plugin in plugins) { 47 var matchingLocalPlugin = (from localPlugin in localAndServerPlugins.Keys 48 where localPlugin.Name == plugin.Name 49 where localPlugin.Version == localPlugin.Version 50 select localPlugin).SingleOrDefault(); 51 if (matchingLocalPlugin != null) { 52 localAndServerPlugins[matchingLocalPlugin] = plugin; 53 } 54 } 55 UpdatePluginList(); 56 OnConnected(); 57 } else { 58 OnDisconnected(); 59 } 60 Cursor = Cursors.Default; 61 } 62 63 private void UpdatePluginList() { 64 listView.Items.Clear(); 65 foreach (var pair in localAndServerPlugins) { 66 var item = MakeListViewItem(pair.Key); 67 listView.Items.Add(item); 68 } 69 } 70 71 void updateServerPluginsWorker_DoWork(object sender, DoWorkEventArgs e) { 72 try { 73 using (var client = new PluginDeploymentService.UpdateClient()) { 74 e.Result = client.GetPlugins(); 75 e.Cancel = false; 76 } 77 } 78 catch (EndpointNotFoundException ex) { 79 e.Result = null; 80 e.Cancel = true; 81 } 82 catch (FaultException ex) { 83 e.Result = null; 84 e.Cancel = true; 85 } 30 86 } 31 87 … … 36 92 void pluginUploadWorker_DoWork(object sender, DoWorkEventArgs e) { 37 93 var selectedPlugins = (IEnumerable<IPluginDescription>)e.Argument; 38 AdminService.AdminClient adminClient = new HeuristicLab.DeploymentService.AdminClient.AdminService.AdminClient(); 39 40 foreach (var plugin in IteratePlugins(selectedPlugins)) { 41 adminClient.DeployPlugin(MakePluginDescription(plugin), new byte[0]); 42 } 43 } 44 45 private HeuristicLab.PluginInfrastructure.PluginUpdateService.PluginDescription MakePluginDescription(IPluginDescription plugin) { 94 using (PluginDeploymentService.AdminClient adminClient = new PluginDeploymentService.AdminClient()) { 95 96 foreach (var plugin in IteratePlugins(selectedPlugins)) { 97 adminClient.DeployPlugin(MakePluginDescription(plugin), CreateZipPackage(plugin)); 98 } 99 } 100 } 101 102 private byte[] CreateZipPackage(IPluginDescription plugin) { 103 using (MemoryStream stream = new MemoryStream()) { 104 ZipFile zipFile = new ZipFile(stream); 105 zipFile.BeginUpdate(); 106 foreach (var file in plugin.Files) { 107 zipFile.Add(file.Name); 108 } 109 zipFile.CommitUpdate(); 110 stream.Seek(0, SeekOrigin.Begin); 111 return stream.GetBuffer(); 112 } 113 } 114 115 private PluginDeploymentService.PluginDescription MakePluginDescription(IPluginDescription plugin) { 46 116 var dependencies = from dep in plugin.Dependencies 47 117 select MakePluginDescription(dep); 48 return new HeuristicLab.PluginInfrastructure.PluginUpdateService.PluginDescription(plugin.Name, plugin.Version, dependencies); 118 if (string.IsNullOrEmpty(plugin.ContactName) || string.IsNullOrEmpty(plugin.ContactEmail)) { 119 return new PluginDeploymentService.PluginDescription(plugin.Name, plugin.Version, dependencies); 120 } else return new PluginDeploymentService.PluginDescription(plugin.Name, plugin.Version, dependencies, plugin.ContactName + ", " + plugin.ContactEmail, plugin.LicenseText); 49 121 } 50 122 … … 59 131 60 132 public void UpdateLocalPlugins() { 61 local Plugins.ForEach(x => listView.Items.Remove(x));62 localPlugins.Clear(); 133 localAndServerPlugins.Clear(); 134 63 135 foreach (var plugin in ApplicationManager.Manager.Plugins) { 64 var item = MakeListViewItem(plugin); 65 item.Group = listView.Groups["Local plugins"]; 66 listView.Items.Add(item); 67 localPlugins.Add(item); 68 } 69 } 70 71 public void UpdateServerPlugins() { 72 serverPlugins.ForEach(x => listView.Items.Remove(x)); 73 serverPlugins.Clear(); 74 var client = new HeuristicLab.PluginInfrastructure.PluginUpdateService.UpdateClient(); 75 foreach (var plugin in client.GetPlugins()) { 76 var item = MakeListViewItem(plugin); 77 item.Group = listView.Groups["Server plugins"]; 78 listView.Items.Add(item); 79 localPlugins.Add(item); 80 } 81 } 82 83 private static ListViewItem MakeListViewItem(HeuristicLab.PluginInfrastructure.PluginUpdateService.PluginDescription plugin) { 84 ListViewItem item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString() }); 136 localAndServerPlugins.Add(plugin, null); 137 } 138 } 139 140 141 private ListViewItem MakeListViewItem(IPluginDescription plugin) { 142 ListViewItem item; 143 if (localAndServerPlugins[plugin] != null) { 144 item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString(), localAndServerPlugins[plugin].Version.ToString() }); 145 } else { 146 item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString(), string.Empty }); 147 } 85 148 item.Tag = plugin; 86 149 return item; 87 150 } 88 151 89 private static ListViewItem MakeListViewItem(IPluginDescription plugin) {90 ListViewItem item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString() });91 item.Tag = plugin;92 return item;93 }94 95 152 private void listView_SelectedIndexChanged(object sender, EventArgs e) { 153 localPluginDetailsPanel.Controls.Clear(); 154 serverPluginDetailsGroupBox.Controls.Clear(); 155 96 156 if (listView.SelectedItems.Count > 0) { 97 if (listView.SelectedItems[0].Tag is IPluginDescription) { 98 var plugin = (IPluginDescription)listView.SelectedItems[0].Tag; 99 StringBuilder strBuilder = new StringBuilder(); 100 101 strBuilder.Append("Name: ").AppendLine(plugin.Name); 102 strBuilder.Append("Version: ").AppendLine(plugin.Version.ToString()); 103 strBuilder.AppendLine("Files:"); 104 foreach (var file in plugin.Files) { 105 strBuilder.Append(file.Name + " " + file.Type); 106 } 107 strBuilder.AppendLine("Dependencies:"); 108 foreach (var dep in plugin.Dependencies) { 109 strBuilder.Append(dep.Name + " " + dep.Version); 110 } 111 detailsTextBox.Text = strBuilder.ToString(); 112 } else if (listView.SelectedItems[0].Tag is HeuristicLab.PluginInfrastructure.PluginUpdateService.PluginDescription) { 113 var plugin = (HeuristicLab.PluginInfrastructure.PluginUpdateService.PluginDescription)listView.SelectedItems[0].Tag; 114 StringBuilder strBuilder = new StringBuilder(); 115 116 strBuilder.Append("Name: ").AppendLine(plugin.Name); 117 strBuilder.Append("Version: ").AppendLine(plugin.Version.ToString()); 118 strBuilder.AppendLine("Dependencies:"); 119 foreach (var dep in plugin.Dependencies) { 120 strBuilder.Append(dep.Name + " " + dep.Version); 121 } 122 detailsTextBox.Text = strBuilder.ToString(); 123 } 124 } else { 125 detailsTextBox.Text = string.Empty; 126 } 157 var plugin = (IPluginDescription)listView.SelectedItems[0].Tag; 158 ShowPluginDetails(plugin); 159 } 160 } 161 162 private void ShowPluginDetails(IPluginDescription plugin) { 163 var localView = new LocalPluginView(plugin); 164 var serverView = new ServerPluginView(localAndServerPlugins[plugin]); 165 localView.Dock = DockStyle.Fill; 166 serverView.Dock = DockStyle.Fill; 167 localPluginDetailsPanel.Controls.Add(localView); 168 serverPluginDetailsGroupBox.Controls.Add(serverView); 127 169 } 128 170 … … 136 178 } 137 179 } 180 181 private void connectButton_Click(object sender, EventArgs e) { 182 OnDisconnected(); 183 Cursor = Cursors.AppStarting; 184 updateServerPluginsWorker.RunWorkerAsync(); 185 } 186 187 private void OnConnected() { 188 connectButton.Enabled = false; 189 serverUrlTextBox.Enabled = false; 190 label1.Enabled = false; 191 192 listView.Enabled = true; 193 uploadButton.Enabled = true; 194 } 195 196 private void OnDisconnected() { 197 connectButton.Enabled = true; 198 serverUrlTextBox.Enabled = true; 199 label1.Enabled = true; 200 201 localAndServerPlugins.Clear(); 202 listView.Items.Clear(); 203 localPluginDetailsPanel.Controls.Clear(); 204 serverPluginDetailsGroupBox.Controls.Clear(); 205 listView.Enabled = false; 206 uploadButton.Enabled = false; 207 } 138 208 } 139 209 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ProductEditor.cs
r2804 r2816 8 8 using System.Windows.Forms; 9 9 using HeuristicLab.MainForm; 10 using HeuristicLab.PluginInfrastructure; 11 using UpdateService = HeuristicLab.PluginInfrastructure.PluginUpdateService; 10 using PluginDeploymentService = HeuristicLab.PluginInfrastructure.Advanced.DeploymentService; 12 11 13 12 namespace HeuristicLab.DeploymentService.AdminClient { … … 15 14 private BackgroundWorker refreshProductsWorker; 16 15 private BackgroundWorker uploadChangedProductsWorker; 17 private List< UpdateService.ProductDescription> products;18 private List< UpdateService.PluginDescription> plugins;19 private HashSet< UpdateService.ProductDescription> dirtyProducts;16 private List<PluginDeploymentService.ProductDescription> products; 17 private List<PluginDeploymentService.PluginDescription> plugins; 18 private HashSet<PluginDeploymentService.ProductDescription> dirtyProducts; 20 19 21 20 public ProductEditor() { … … 23 22 Caption = "Products"; 24 23 25 dirtyProducts = new HashSet< UpdateService.ProductDescription>();24 dirtyProducts = new HashSet<PluginDeploymentService.ProductDescription>(); 26 25 refreshProductsWorker = new BackgroundWorker(); 27 26 refreshProductsWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(refreshProductsWorker_RunWorkerCompleted); … … 34 33 35 34 void uploadChangedProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 36 var products = (IEnumerable< UpdateService.ProductDescription>)e.Argument;37 using (var adminClient = new AdminService.AdminClient()) {35 var products = (IEnumerable<PluginDeploymentService.ProductDescription>)e.Argument; 36 using (var adminClient = new PluginDeploymentService.AdminClient()) { 38 37 foreach (var product in products) { 39 38 adminClient.DeployProduct(product); … … 48 47 49 48 void refreshProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 50 var updateClient = new UpdateService.UpdateClient();49 var updateClient = new PluginDeploymentService.UpdateClient(); 51 50 e.Result = new object[] { updateClient.GetProducts(), updateClient.GetPlugins() }; 52 51 } 53 52 54 53 void refreshProductsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 55 this.products = new List< UpdateService.ProductDescription>(56 ( UpdateService.ProductDescription[])((object[])e.Result)[0]);57 this.plugins = new List< UpdateService.PluginDescription>(58 ( UpdateService.PluginDescription[])((object[])e.Result)[1]);54 this.products = new List<PluginDeploymentService.ProductDescription>( 55 (PluginDeploymentService.ProductDescription[])((object[])e.Result)[0]); 56 this.plugins = new List<PluginDeploymentService.PluginDescription>( 57 (PluginDeploymentService.PluginDescription[])((object[])e.Result)[1]); 59 58 60 59 UpdateProductsList(); … … 73 72 private void productsListBox_SelectedIndexChanged(object sender, EventArgs e) { 74 73 if (productsListBox.SelectedItems.Count == 0) return; 75 UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)((ListViewItem)productsListBox.SelectedItem).Tag;74 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)((ListViewItem)productsListBox.SelectedItem).Tag; 76 75 UpdateProductDetails(activeProduct); 77 76 } 78 77 79 private void UpdateProductDetails( UpdateService.ProductDescription activeProduct) {78 private void UpdateProductDetails(PluginDeploymentService.ProductDescription activeProduct) { 80 79 nameTextBox.Text = activeProduct.Name; 81 80 versionTextBox.Text = activeProduct.Version.ToString(); 82 81 83 82 pluginsList.Items.Clear(); 84 foreach ( UpdateService.PluginDescription pluginDesc in plugins) {83 foreach (PluginDeploymentService.PluginDescription pluginDesc in plugins) { 85 84 var matching = from p in activeProduct.Plugins 86 85 where p.Name == pluginDesc.Name … … 106 105 107 106 private void newProductButton_Click(object sender, EventArgs e) { 108 var newProduct = new UpdateService.ProductDescription("New product", new Version("0.0.0.0"));107 var newProduct = new PluginDeploymentService.ProductDescription("New product", new Version("0.0.0.0")); 109 108 ListViewItem item = CreateListViewItem(newProduct); 110 109 productsListBox.Items.Add(item); … … 112 111 } 113 112 114 private ListViewItem CreateListViewItem( UpdateService.ProductDescription productDescription) {113 private ListViewItem CreateListViewItem(PluginDeploymentService.ProductDescription productDescription) { 115 114 ListViewItem item = new ListViewItem(); 116 115 item.Text = productDescription.Name + " " + productDescription.Version; … … 127 126 private void nameTextBox_TextChanged(object sender, EventArgs e) { 128 127 ListViewItem activeItem = (ListViewItem)productsListBox.SelectedItem; 129 UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)activeItem.Tag;128 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag; 130 129 if (string.IsNullOrEmpty(nameTextBox.Name)) { 131 130 errorProvider.SetError(nameTextBox, "Invalid value"); … … 140 139 private void versionTextBox_TextChanged(object sender, EventArgs e) { 141 140 ListViewItem activeItem = (ListViewItem)productsListBox.SelectedItem; 142 UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)activeItem.Tag;141 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag; 143 142 try { 144 143 activeProduct.Version = new Version(versionTextBox.Text); -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/app.config
r2802 r2816 2 2 <configuration> 3 3 <system.serviceModel> 4 <bindings> 5 <wsHttpBinding> 6 <binding name="WSHttpBinding_IAdmin" closeTimeout="00:01:00" 7 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 8 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 9 maxBufferPoolSize="524288" maxReceivedMessageSize="10000000" 10 messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 11 allowCookies="false"> 12 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="10000000" 13 maxBytesPerRead="10000000" maxNameTableCharCount="16384" /> 14 <reliableSession ordered="true" inactivityTimeout="00:10:00" 15 enabled="false" /> 16 <security mode="Message"> 17 <transport clientCredentialType="Windows" proxyCredentialType="None" 18 realm="" /> 19 <message clientCredentialType="Windows" negotiateServiceCredential="true" 20 algorithmSuite="Default" establishSecurityContext="true" /> 21 </security> 22 </binding> 23 </wsHttpBinding> 24 </bindings> 25 <client> 26 <endpoint address="http://localhost:8731/Design_Time_Addresses/HeuristicLab.Services.Deployment/Admin/" 27 binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAdmin" 28 contract="AdminService.IAdmin" name="WSHttpBinding_IAdmin"> 29 <identity> 30 <dns value="localhost" /> 31 </identity> 32 </endpoint> 33 </client> 4 <bindings /> 5 <client /> 34 6 </system.serviceModel> 35 7 </configuration> -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginStoreClasses.dbml
r2766 r2816 19 19 <Column Name="Name" Type="System.String" DbType="NVarChar(300) NOT NULL" CanBeNull="false" /> 20 20 <Column Name="Version" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" /> 21 <Column Name="ContactInformation" Type="System.String" DbType="Text" CanBeNull="true" UpdateCheck="Never" /> 22 <Column Name="License" Type="System.String" DbType="Text" CanBeNull="true" UpdateCheck="Never" /> 21 23 <Association Name="Plugin_PluginPackage" Member="PluginPackage" ThisKey="Id" OtherKey="PluginId" Type="PluginPackage" Cardinality="One" /> 22 24 </Type> … … 25 27 <Type Name="PluginPackage"> 26 28 <Column Name="PluginId" Type="System.Int64" DbType="BigInt NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 27 <Column Name="FileName" Type="System.String" DbType="Text NOT NULL" CanBeNull="false" UpdateCheck="Never" />28 29 <Column Name="Data" Type="System.Data.Linq.Binary" DbType="Image NOT NULL" CanBeNull="false" UpdateCheck="Never" /> 29 30 <Association Name="Plugin_PluginPackage" Member="Plugin" ThisKey="PluginId" OtherKey="Id" Type="Plugin" IsForeignKey="true" /> -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginStoreClasses.dbml.layout
r2766 r2816 3 3 <DataContextMoniker Name="/PluginStoreClassesDataContext" /> 4 4 <nestedChildShapes> 5 <classShape Id=" 8eaeae9c-08a1-4be4-b58a-e3bf24f1961b" absoluteBounds="3.5, 2.625, 2, 1.1939925130208335">5 <classShape Id="5aa5ddda-9296-44d2-a516-238be9f4719d" absoluteBounds="3.5, 2, 2, 1.1939925130208335"> 6 6 <DataClassMoniker Name="/PluginStoreClassesDataContext/Dependency" /> 7 7 <nestedChildShapes> 8 <elementListCompartment Id=" c05168fe-dac9-499f-bf93-2ba4d92d3a81" absoluteBounds="3.515, 3.085, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />8 <elementListCompartment Id="5ca38ac5-5a7e-4c47-a480-0536fec82dcc" absoluteBounds="3.515, 2.46, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 9 9 </nestedChildShapes> 10 10 </classShape> 11 <classShape Id=" 5f1b7d3a-0078-4834-a616-5cf8b1894803" absoluteBounds="3.5, 0.75, 2, 1.1939925130208335">11 <classShape Id="a5892850-02a5-4f0c-8b4d-cdc887c495b6" absoluteBounds="3.5, 4, 2, 1.1939925130208344"> 12 12 <DataClassMoniker Name="/PluginStoreClassesDataContext/ProductPlugin" /> 13 13 <nestedChildShapes> 14 <elementListCompartment Id=" 66444473-2d73-4b22-9e6b-c440e2654f3f" absoluteBounds="3.515, 1.21, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />14 <elementListCompartment Id="07b98569-9ca9-4b3f-8829-d57557588cba" absoluteBounds="3.515, 4.46, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 15 15 </nestedChildShapes> 16 16 </classShape> 17 <classShape Id=" 37f2647d-7364-4f13-a869-2c8ebbc23260" absoluteBounds="0.75, 3.625, 2, 1.3862939453125">17 <classShape Id="7c7e406d-95e8-4f00-ab8e-634b7fbbbea5" absoluteBounds="0.75, 2.75, 2, 1.7708968098958335"> 18 18 <DataClassMoniker Name="/PluginStoreClassesDataContext/Plugin" /> 19 19 <nestedChildShapes> 20 <elementListCompartment Id=" 70f53f38-ca24-4ef6-8b0a-f3be78ad76c7" absoluteBounds="0.765, 4.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />20 <elementListCompartment Id="25134a80-4bf5-4672-bd9e-6449a7935427" absoluteBounds="0.765, 3.21, 1.9700000000000002, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 21 21 </nestedChildShapes> 22 22 </classShape> 23 <classShape Id=" 6d0553e8-405a-4315-bc54-7af25f2a415d" absoluteBounds="3.5, 6.625, 2, 1.3862939453125005">23 <classShape Id="855904b1-2043-4ccc-951d-2f35df8b6190" absoluteBounds="3.5, 6, 2, 1.1939925130208344"> 24 24 <DataClassMoniker Name="/PluginStoreClassesDataContext/PluginPackage" /> 25 25 <nestedChildShapes> 26 <elementListCompartment Id=" 4bc7352f-2d30-4f49-897e-c741d0a60123" absoluteBounds="3.515, 7.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />26 <elementListCompartment Id="25003445-42f3-4db9-8945-6609772da5ec" absoluteBounds="3.515, 6.46, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 27 27 </nestedChildShapes> 28 28 </classShape> 29 <classShape Id="c 36a4ae4-62d6-4891-9389-afdef8241ad1" absoluteBounds="0.75, 1.5, 2, 1.3862939453125003">29 <classShape Id="cc5365b1-2536-41e1-b69d-c3ab09f01086" absoluteBounds="0.75, 5.875, 2, 1.3862939453125005"> 30 30 <DataClassMoniker Name="/PluginStoreClassesDataContext/Product" /> 31 31 <nestedChildShapes> 32 <elementListCompartment Id=" ec5480b9-acee-4912-8ea6-a67dbb78a523" absoluteBounds="0.765, 1.96, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />32 <elementListCompartment Id="875bde79-6306-48eb-bcea-c8653ef81ec2" absoluteBounds="0.765, 6.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 33 33 </nestedChildShapes> 34 34 </classShape> 35 <associationConnector edgePoints="[( 1.75 : 5.0112939453125); (1.75 : 7.31814697265625); (3.5 : 7.31814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">35 <associationConnector edgePoints="[(2.75 : 4.52089680989583); (3.125 : 4.89589680989583); (3.125 : 6.59699625651042); (3.5 : 6.59699625651042)]" fixedFrom="NotFixed" fixedTo="Algorithm"> 36 36 <AssociationMoniker Name="/PluginStoreClassesDataContext/Plugin/Plugin_PluginPackage" /> 37 37 <nodes> 38 <classShapeMoniker Id=" 37f2647d-7364-4f13-a869-2c8ebbc23260" />39 <classShapeMoniker Id=" 6d0553e8-405a-4315-bc54-7af25f2a415d" />38 <classShapeMoniker Id="7c7e406d-95e8-4f00-ab8e-634b7fbbbea5" /> 39 <classShapeMoniker Id="855904b1-2043-4ccc-951d-2f35df8b6190" /> 40 40 </nodes> 41 41 </associationConnector> -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginStoreClasses.designer.cs
r2766 r2816 303 303 private string _Version; 304 304 305 private string _ContactInformation; 306 307 private string _License; 308 305 309 private EntityRef<PluginPackage> _PluginPackage; 306 310 … … 315 319 partial void OnVersionChanging(string value); 316 320 partial void OnVersionChanged(); 321 partial void OnContactInformationChanging(string value); 322 partial void OnContactInformationChanged(); 323 partial void OnLicenseChanging(string value); 324 partial void OnLicenseChanged(); 317 325 #endregion 318 326 … … 379 387 this.SendPropertyChanged("Version"); 380 388 this.OnVersionChanged(); 389 } 390 } 391 } 392 393 [Column(Storage="_ContactInformation", DbType="Text", UpdateCheck=UpdateCheck.Never)] 394 public string ContactInformation 395 { 396 get 397 { 398 return this._ContactInformation; 399 } 400 set 401 { 402 if ((this._ContactInformation != value)) 403 { 404 this.OnContactInformationChanging(value); 405 this.SendPropertyChanging(); 406 this._ContactInformation = value; 407 this.SendPropertyChanged("ContactInformation"); 408 this.OnContactInformationChanged(); 409 } 410 } 411 } 412 413 [Column(Storage="_License", DbType="Text", UpdateCheck=UpdateCheck.Never)] 414 public string License 415 { 416 get 417 { 418 return this._License; 419 } 420 set 421 { 422 if ((this._License != value)) 423 { 424 this.OnLicenseChanging(value); 425 this.SendPropertyChanging(); 426 this._License = value; 427 this.SendPropertyChanged("License"); 428 this.OnLicenseChanged(); 381 429 } 382 430 } … … 441 489 private long _PluginId; 442 490 443 private string _FileName;444 445 491 private System.Data.Linq.Binary _Data; 446 492 … … 453 499 partial void OnPluginIdChanging(long value); 454 500 partial void OnPluginIdChanged(); 455 partial void OnFileNameChanging(string value);456 partial void OnFileNameChanged();457 501 partial void OnDataChanging(System.Data.Linq.Binary value); 458 502 partial void OnDataChanged(); … … 485 529 this.SendPropertyChanged("PluginId"); 486 530 this.OnPluginIdChanged(); 487 }488 }489 }490 491 [Column(Storage="_FileName", DbType="Text NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]492 public string FileName493 {494 get495 {496 return this._FileName;497 }498 set499 {500 if ((this._FileName != value))501 {502 this.OnFileNameChanging(value);503 this.SendPropertyChanging();504 this._FileName = value;505 this.SendPropertyChanged("FileName");506 this.OnFileNameChanged();507 531 } 508 532 } -
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; -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.sln
r2802 r2816 3 3 # Visual Studio 2008 4 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services", "HeuristicLab.Services\HeuristicLab.Services.csproj", "{62D88CDA-264B-4798-B17D-9B5D9C841356}" 5 EndProject6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.PluginInfrastructure", "HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj", "{94186A6A-5176-4402-AE83-886557B53CCA}"7 ProjectSection(ProjectDependencies) = postProject8 {30D8C5F1-CD3A-4EC1-907F-430177A03FBE} = {30D8C5F1-CD3A-4EC1-907F-430177A03FBE}9 EndProjectSection10 5 EndProject 11 6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Deployment", "HeuristicLab.Services.Deployment\HeuristicLab.Services.Deployment.csproj", "{30D8C5F1-CD3A-4EC1-907F-430177A03FBE}" … … 42 37 {62D88CDA-264B-4798-B17D-9B5D9C841356}.Release|x64.ActiveCfg = Release|Any CPU 43 38 {62D88CDA-264B-4798-B17D-9B5D9C841356}.Release|x86.ActiveCfg = Release|Any CPU 44 {94186A6A-5176-4402-AE83-886557B53CCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU45 {94186A6A-5176-4402-AE83-886557B53CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU46 {94186A6A-5176-4402-AE83-886557B53CCA}.Debug|x64.ActiveCfg = Debug|x6447 {94186A6A-5176-4402-AE83-886557B53CCA}.Debug|x64.Build.0 = Debug|x6448 {94186A6A-5176-4402-AE83-886557B53CCA}.Debug|x86.ActiveCfg = Debug|x8649 {94186A6A-5176-4402-AE83-886557B53CCA}.Debug|x86.Build.0 = Debug|x8650 {94186A6A-5176-4402-AE83-886557B53CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU51 {94186A6A-5176-4402-AE83-886557B53CCA}.Release|Any CPU.Build.0 = Release|Any CPU52 {94186A6A-5176-4402-AE83-886557B53CCA}.Release|x64.ActiveCfg = Release|x6453 {94186A6A-5176-4402-AE83-886557B53CCA}.Release|x64.Build.0 = Release|x6454 {94186A6A-5176-4402-AE83-886557B53CCA}.Release|x86.ActiveCfg = Release|x8655 {94186A6A-5176-4402-AE83-886557B53CCA}.Release|x86.Build.0 = Release|x8656 39 {30D8C5F1-CD3A-4EC1-907F-430177A03FBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 40 {30D8C5F1-CD3A-4EC1-907F-430177A03FBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
Note: See TracChangeset
for help on using the changeset viewer.