mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Renaming PackageSourceRecord to PackageSource
--HG-- branch : nuget
This commit is contained in:
@@ -6,7 +6,7 @@ using Orchard.Localization;
|
|||||||
using Orchard.Packaging.Services;
|
using Orchard.Packaging.Services;
|
||||||
|
|
||||||
namespace Orchard.Packaging {
|
namespace Orchard.Packaging {
|
||||||
[OrchardFeature("Gallery")]
|
[OrchardFeature("PackagingServices")]
|
||||||
public class DefaultPackagingUpdater : IFeatureEventHandler {
|
public class DefaultPackagingUpdater : IFeatureEventHandler {
|
||||||
private readonly IPackagingSourceManager _packagingSourceManager;
|
private readonly IPackagingSourceManager _packagingSourceManager;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Orchard.Data.Migration;
|
using Orchard.Data.Migration;
|
||||||
|
using Orchard.Environment.Extensions;
|
||||||
|
|
||||||
namespace Orchard.Packaging {
|
namespace Orchard.Packaging {
|
||||||
|
[OrchardFeature("PackagingServices")]
|
||||||
public class Migrations: DataMigrationImpl {
|
public class Migrations: DataMigrationImpl {
|
||||||
public int Create() {
|
public int Create() {
|
||||||
SchemaBuilder.CreateTable("PackagingSourceRecord",
|
SchemaBuilder.CreateTable("PackagingSourceRecord",
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Orchard.Packaging.Models {
|
||||||
|
public class PackagingSource {
|
||||||
|
public virtual int Id { get; set; }
|
||||||
|
public virtual string FeedTitle { get; set; }
|
||||||
|
public virtual string FeedUrl { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Orchard.Packaging.Models {
|
|
||||||
public class PackagingSourceRecord {
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual string FeedTitle { get; set; }
|
|
||||||
public virtual string FeedUrl { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<Compile Include="Controllers\GalleryController.cs" />
|
<Compile Include="Controllers\GalleryController.cs" />
|
||||||
<Compile Include="DefaultPackagingUpdater.cs" />
|
<Compile Include="DefaultPackagingUpdater.cs" />
|
||||||
<Compile Include="Migrations.cs" />
|
<Compile Include="Migrations.cs" />
|
||||||
<Compile Include="Models\PackagingSourceRecord.cs" />
|
<Compile Include="Models\PackagingSource.cs" />
|
||||||
<Compile Include="ResourceManifest.cs" />
|
<Compile Include="ResourceManifest.cs" />
|
||||||
<Compile Include="Services\AtomExtensions.cs" />
|
<Compile Include="Services\AtomExtensions.cs" />
|
||||||
<Compile Include="Services\IPackageBuilder.cs" />
|
<Compile Include="Services\IPackageBuilder.cs" />
|
||||||
@@ -90,7 +90,6 @@
|
|||||||
<Compile Include="Services\PackageExpander.cs" />
|
<Compile Include="Services\PackageExpander.cs" />
|
||||||
<Compile Include="Services\PackageManager.cs" />
|
<Compile Include="Services\PackageManager.cs" />
|
||||||
<Compile Include="Services\PackagingEntry.cs" />
|
<Compile Include="Services\PackagingEntry.cs" />
|
||||||
<Compile Include="Services\PackagingSource.cs" />
|
|
||||||
<Compile Include="Services\PackagingSourceManager.cs" />
|
<Compile Include="Services\PackagingSourceManager.cs" />
|
||||||
<Compile Include="ViewModels\PackagingAddSourceViewModel.cs" />
|
<Compile Include="ViewModels\PackagingAddSourceViewModel.cs" />
|
||||||
<Compile Include="ViewModels\PackagingHarvestViewModel.cs" />
|
<Compile Include="ViewModels\PackagingHarvestViewModel.cs" />
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Orchard.Environment.Extensions;
|
using Orchard.Environment.Extensions;
|
||||||
using Orchard.UI.Resources;
|
using Orchard.UI.Resources;
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ using Orchard.Packaging.Models;
|
|||||||
|
|
||||||
namespace Orchard.Packaging.Services {
|
namespace Orchard.Packaging.Services {
|
||||||
public interface IPackagingSourceManager : IDependency {
|
public interface IPackagingSourceManager : IDependency {
|
||||||
IEnumerable<PackagingSourceRecord> GetSources();
|
IEnumerable<PackagingSource> GetSources();
|
||||||
void AddSource(string feedTitle, string feedUrl);
|
void AddSource(string feedTitle, string feedUrl);
|
||||||
void RemoveSource(int id);
|
void RemoveSource(int id);
|
||||||
|
|
||||||
IEnumerable<PackagingEntry> GetModuleList(PackagingSourceRecord packagingSource = null);
|
IEnumerable<PackagingEntry> GetModuleList(PackagingSource packagingSource = null);
|
||||||
IEnumerable<PackagingEntry> GetThemeList(PackagingSourceRecord packagingSource = null);
|
IEnumerable<PackagingEntry> GetThemeList(PackagingSource packagingSource = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ using Orchard.Packaging.Models;
|
|||||||
|
|
||||||
namespace Orchard.Packaging.Services {
|
namespace Orchard.Packaging.Services {
|
||||||
public class PackagingEntry {
|
public class PackagingEntry {
|
||||||
public PackagingSourceRecord Source { get; set; }
|
public PackagingSource Source { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string PackageId { get; set; }
|
public string PackageId { get; set; }
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace Orchard.Packaging.Services {
|
|
||||||
public class _PackagingSource {
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
public string FeedTitle { get; set; }
|
|
||||||
public string FeedUrl { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,9 +13,9 @@ namespace Orchard.Packaging.Services {
|
|||||||
private const string ModulesFilter = "Orchard.Module.";
|
private const string ModulesFilter = "Orchard.Module.";
|
||||||
private const string ThemesFilter = "Orchard.Theme.";
|
private const string ThemesFilter = "Orchard.Theme.";
|
||||||
|
|
||||||
private readonly IRepository<PackagingSourceRecord> _packagingSourceRecordRepository;
|
private readonly IRepository<PackagingSource> _packagingSourceRecordRepository;
|
||||||
|
|
||||||
public PackagingSourceManager(IRepository<PackagingSourceRecord> packagingSourceRecordRepository) {
|
public PackagingSourceManager(IRepository<PackagingSource> packagingSourceRecordRepository) {
|
||||||
_packagingSourceRecordRepository = packagingSourceRecordRepository;
|
_packagingSourceRecordRepository = packagingSourceRecordRepository;
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
}
|
}
|
||||||
@@ -24,12 +24,12 @@ namespace Orchard.Packaging.Services {
|
|||||||
|
|
||||||
#region IPackagingSourceManager Members
|
#region IPackagingSourceManager Members
|
||||||
|
|
||||||
public IEnumerable<PackagingSourceRecord> GetSources() {
|
public IEnumerable<PackagingSource> GetSources() {
|
||||||
return _packagingSourceRecordRepository.Table.ToList();
|
return _packagingSourceRecordRepository.Table.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddSource(string feedTitle, string feedUrl) {
|
public void AddSource(string feedTitle, string feedUrl) {
|
||||||
_packagingSourceRecordRepository.Create(new PackagingSourceRecord {FeedTitle = feedTitle, FeedUrl = feedUrl});
|
_packagingSourceRecordRepository.Create(new PackagingSource {FeedTitle = feedTitle, FeedUrl = feedUrl});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveSource(int id) {
|
public void RemoveSource(int id) {
|
||||||
@@ -39,14 +39,14 @@ namespace Orchard.Packaging.Services {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<PackagingEntry> GetModuleList(PackagingSourceRecord packagingSource = null) {
|
public IEnumerable<PackagingEntry> GetModuleList(PackagingSource packagingSource = null) {
|
||||||
return GetExtensionList(ModulesFilter, packagingSource);
|
return GetExtensionList(ModulesFilter, packagingSource);
|
||||||
}
|
}
|
||||||
public IEnumerable<PackagingEntry> GetThemeList(PackagingSourceRecord packagingSource = null) {
|
public IEnumerable<PackagingEntry> GetThemeList(PackagingSource packagingSource = null) {
|
||||||
return GetExtensionList(ThemesFilter, packagingSource);
|
return GetExtensionList(ThemesFilter, packagingSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<PackagingEntry> GetExtensionList(string filter = null, PackagingSourceRecord packagingSource = null) {
|
private IEnumerable<PackagingEntry> GetExtensionList(string filter = null, PackagingSource packagingSource = null) {
|
||||||
return ( packagingSource == null ? GetSources() : new[] { packagingSource } )
|
return ( packagingSource == null ? GetSources() : new[] { packagingSource } )
|
||||||
.SelectMany(
|
.SelectMany(
|
||||||
source =>
|
source =>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Orchard.Packaging.Services;
|
|||||||
namespace Orchard.Packaging.ViewModels {
|
namespace Orchard.Packaging.ViewModels {
|
||||||
public class PackagingExtensionsViewModel {
|
public class PackagingExtensionsViewModel {
|
||||||
public IEnumerable<PackagingEntry> Extensions { get; set; }
|
public IEnumerable<PackagingEntry> Extensions { get; set; }
|
||||||
public IEnumerable<PackagingSourceRecord> Sources { get; set; }
|
public IEnumerable<PackagingSource> Sources { get; set; }
|
||||||
public PackagingSourceRecord SelectedSource { get; set; }
|
public PackagingSource SelectedSource { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ using Orchard.Packaging.Models;
|
|||||||
|
|
||||||
namespace Orchard.Packaging.ViewModels {
|
namespace Orchard.Packaging.ViewModels {
|
||||||
public class PackagingHarvestViewModel {
|
public class PackagingHarvestViewModel {
|
||||||
public IEnumerable<PackagingSourceRecord> Sources { get; set; }
|
public IEnumerable<PackagingSource> Sources { get; set; }
|
||||||
public IEnumerable<ExtensionDescriptor> Extensions { get; set; }
|
public IEnumerable<ExtensionDescriptor> Extensions { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ using Orchard.Packaging.Models;
|
|||||||
|
|
||||||
namespace Orchard.Packaging.ViewModels {
|
namespace Orchard.Packaging.ViewModels {
|
||||||
public class PackagingSourcesViewModel {
|
public class PackagingSourcesViewModel {
|
||||||
public IEnumerable<PackagingSourceRecord> Sources { get; set; }
|
public IEnumerable<PackagingSource> Sources { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user