Add Orchard Module Gallery Feed by default in Gallery module

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-07-28 14:01:29 -07:00
parent 334223f532
commit 63ce9ea1e5
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
using System;
using Orchard.Environment;
using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
using Orchard.Packaging.Services;
namespace Orchard.Packaging {
[OrchardFeature("Gallery")]
public class DefaultPackagingUpdater : IFeatureEventHandler {
private readonly IPackagingSourceManager _packagingSourceManager;
public DefaultPackagingUpdater(IPackagingSourceManager packagingSourceManager) {
_packagingSourceManager = packagingSourceManager;
}
public void Install(Feature feature) {
// add http://orchardproject.net/feeds/modules as the default Modules Feed
_packagingSourceManager.AddSource(new PackagingSource { Id = Guid.NewGuid(), FeedTitle = "Orchard Module Gallery", FeedUrl = "http://orchardproject.net/feeds/modules" });
}
public void Enable(Feature feature) {
}
public void Disable(Feature feature) {
}
public void Uninstall(Feature feature) {
}
}
}

View File

@@ -74,6 +74,7 @@
<Compile Include="Commands\PackagingCommands.cs" />
<Compile Include="Controllers\DownloadStreamResult.cs" />
<Compile Include="Controllers\GalleryController.cs" />
<Compile Include="DefaultPackagingUpdater.cs" />
<Compile Include="Services\AtomExtensions.cs" />
<Compile Include="Services\IPackageBuilder.cs" />
<Compile Include="Services\IPackageExpander.cs" />

View File

@@ -98,6 +98,10 @@
<Project>{14C049FD-B35B-415A-A824-87F26B26E7FD}</Project>
<Name>Orchard.Comments</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Packaging\Orchard.Packaging.csproj">
<Project>{DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}</Project>
<Name>Orchard.Packaging</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Module.txt" />