Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/09 20:32:29 (15 years ago)
Author:
gkronber
Message:

Worked on update location service. #799

Location:
branches/PluginInfrastructure Refactoring
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/PluginInfrastructure Refactoring

    • Property svn:ignore
      •  

        old new  
        11HeuristicLab.suo
         2PluginMetaDataTest
  • branches/PluginInfrastructure Refactoring/HeuristicLab.Update.Service

    • Property svn:ignore set to
      bin
      obj
  • branches/PluginInfrastructure Refactoring/HeuristicLab.Update.Service/HeuristicLab.Update.Service.csproj

    r2517 r2528  
    4141    </Reference>
    4242    <Reference Include="System.Data" />
     43    <Reference Include="System.Data.Linq">
     44      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     45    </Reference>
    4346    <Reference Include="System.Drawing" />
    4447    <Reference Include="System.EnterpriseServices" />
     
    6568  </ItemGroup>
    6669  <ItemGroup>
     70    <Compile Include="PluginStore.designer.cs">
     71      <AutoGen>True</AutoGen>
     72      <DesignTime>True</DesignTime>
     73      <DependentUpon>PluginStore.dbml</DependentUpon>
     74    </Compile>
    6775    <Compile Include="UpdateLocation.svc.cs">
    6876      <DependentUpon>UpdateLocation.svc</DependentUpon>
     
    7684      <Name>HeuristicLab.PluginInfrastructure</Name>
    7785    </ProjectReference>
     86  </ItemGroup>
     87  <ItemGroup>
     88    <None Include="PluginStore.dbml">
     89      <Generator>MSLinqToSQLGenerator</Generator>
     90      <LastGenOutput>PluginStore.designer.cs</LastGenOutput>
     91      <SubType>Designer</SubType>
     92    </None>
     93  </ItemGroup>
     94  <ItemGroup>
     95    <Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" />
     96  </ItemGroup>
     97  <ItemGroup>
     98    <None Include="PluginStore.dbml.layout">
     99      <DependentUpon>PluginStore.dbml</DependentUpon>
     100    </None>
    78101  </ItemGroup>
    79102  <ItemGroup>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.Update.Service/HeuristicLab.Update.Service.csproj.user

    r2517 r2528  
    22  <ProjectExtensions>
    33    <VisualStudio>
    4       <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}" xmlns="">
     4      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
    55        <WebProjectProperties>
    66          <StartPageUrl>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.Update.Service/IUpdateLocation.cs

    r2517 r2528  
    1212
    1313    [OperationContract]
    14     IEnumerable<PluginInformation> GetAvailablePlugins();
     14    IEnumerable<PluginInformation> GetAvailablePluginsByName(string name);
    1515
    1616    [OperationContract]
    17     Stream GetPackedPlugin(PluginInformation info);
     17    IEnumerable<byte[]> GetPluginFiles(PluginInformation info);
    1818  }
    1919
     
    4040    }
    4141
    42     public PluginInformation(string name, Version version, DateTime buildDate) : base() {
     42    public PluginInformation(string name, Version version, DateTime buildDate)
     43      : base() {
    4344      this.name = name;
    4445      this.version = version;
  • branches/PluginInfrastructure Refactoring/HeuristicLab.Update.Service/UpdateLocation.svc.cs

    r2517 r2528  
    1414    #region IUpdateLocation Members
    1515
    16     public IEnumerable<PluginInformation> GetAvailablePlugins() {
    17       yield break;
     16    public IEnumerable<PluginInformation> GetAvailablePluginsByName(string name) {
     17      using (PluginStoreDataContext ctx = new PluginStoreDataContext()) {
     18        return from plugin in ctx.Plugins
     19               where MatchingName(name, plugin.Name)
     20               select new PluginInformation(plugin.Name, new Version(plugin.Version), plugin.BuildDate);
     21      }
    1822    }
     23    public IEnumerable<byte[]> GetPluginFiles(PluginInformation info) {
     24      using (PluginStoreDataContext ctx = new PluginStoreDataContext()) {
     25        return from plugin in ctx.Plugins
     26               from file in ctx.PluginFiles
     27               where
     28                 plugin.Name == info.Name &&
     29                 plugin.BuildDate == info.BuildDate &&
     30                 plugin.Version == info.Version.ToString() &&
     31                 file.PluginId == plugin.Id
     32               select file.Data.ToArray();
     33      }
     34    }
     35    #endregion
    1936
    20     public System.IO.Stream GetPackedPlugin(PluginInformation info) {
    21       MemoryStream memStream = new MemoryStream();
    22       ZipOutputStream stream = new ZipOutputStream(memStream);
    23       ZipEntryFactory fac = new ZipEntryFactory();
    24       foreach (string fileName in GetMatchingPluginDescription(info.Name, pluginManager.Plugins).Files) {
    25         stream.PutNextEntry( (Path.Combine(pluginDir, fileName)));
    26       }
    2737
    28       return memStream;
     38    private static bool MatchingName(string name, string pluginName) {
     39      return name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase);
    2940    }
    30 
    31     private static PluginDescription GetMatchingPluginDescription(string name, IEnumerable<PluginDescription> plugins) {
    32       return (from x in plugins
    33               where x.Name == name
    34               select x).Single();
    35     }
    36 
    37     #endregion
    3841  }
    3942}
  • branches/PluginInfrastructure Refactoring/HeuristicLab.Update.Service/Web.config

    r2517 r2528  
    1 <?xml version="1.0"?>
     1<?xml version="1.0"?>
    22<!--
    33    Note: As an alternative to hand editing this file you can use the
     
    2727
    2828    <appSettings/>
    29     <connectionStrings/>
     29    <connectionStrings>
     30        <add name="HeuristicLab_PluginStoreConnectionString" connectionString="Data Source=HEUREKA01\SQLEXPRESS;Initial Catalog=HeuristicLab.PluginStore;Integrated Security=True"
     31            providerName="System.Data.SqlClient" />
     32    </connectionStrings>
    3033
    3134    <system.web>
Note: See TracChangeset for help on using the changeset viewer.