mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Rename a few classes, and update package install API
Installing a package via the PackageManager now returns a package info containing a subset of metadata properties. --HG-- branch : dev rename : src/Orchard/Packaging/IPackageSourceManager.cs => src/Orchard/Packaging/IPackagingSourceManager.cs rename : src/Orchard/Packaging/PackageEntry.cs => src/Orchard/Packaging/PackagingEntry.cs rename : src/Orchard/Packaging/PackageSource.cs => src/Orchard/Packaging/PackagingSource.cs rename : src/Orchard/Packaging/PackageSourceManager.cs => src/Orchard/Packaging/PackagingSourceManager.cs
This commit is contained in:
@@ -13,17 +13,17 @@ namespace Futures.Modules.Packaging.Controllers {
|
||||
[Themed, Admin]
|
||||
public class PackagingController : Controller {
|
||||
private readonly IPackageManager _packageManager;
|
||||
private readonly IPackageSourceManager _packageSourceManager;
|
||||
private readonly IPackagingSourceManager _packagingSourceManager;
|
||||
private readonly IExtensionManager _extensionManager;
|
||||
private readonly INotifier _notifier;
|
||||
|
||||
public PackagingController(
|
||||
IPackageManager packageManager,
|
||||
IPackageSourceManager packageSourceManager,
|
||||
IPackagingSourceManager packagingSourceManager,
|
||||
IExtensionManager extensionManager,
|
||||
INotifier notifier) {
|
||||
_packageManager = packageManager;
|
||||
_packageSourceManager = packageSourceManager;
|
||||
_packagingSourceManager = packagingSourceManager;
|
||||
_extensionManager = extensionManager;
|
||||
_notifier = notifier;
|
||||
T = NullLocalizer.Instance;
|
||||
@@ -37,12 +37,12 @@ namespace Futures.Modules.Packaging.Controllers {
|
||||
|
||||
public ActionResult Sources() {
|
||||
return View("Sources", new PackagingSourcesViewModel {
|
||||
Sources = _packageSourceManager.GetSources(),
|
||||
Sources = _packagingSourceManager.GetSources(),
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult AddSource(string url) {
|
||||
_packageSourceManager.AddSource(new PackageSource { Id = Guid.NewGuid(), FeedUrl = url });
|
||||
_packagingSourceManager.AddSource(new PackagingSource { Id = Guid.NewGuid(), FeedUrl = url });
|
||||
Update();
|
||||
return RedirectToAction("Sources");
|
||||
}
|
||||
@@ -50,12 +50,12 @@ namespace Futures.Modules.Packaging.Controllers {
|
||||
|
||||
public ActionResult Modules() {
|
||||
return View("Modules", new PackagingModulesViewModel {
|
||||
Modules = _packageSourceManager.GetModuleList()
|
||||
Modules = _packagingSourceManager.GetModuleList()
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult Update() {
|
||||
_packageSourceManager.UpdateLists();
|
||||
_packagingSourceManager.UpdateLists();
|
||||
_notifier.Information(T("List of available modules and themes is updated."));
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
@@ -64,14 +64,14 @@ namespace Futures.Modules.Packaging.Controllers {
|
||||
return View("Harvest", new PackagingHarvestViewModel {
|
||||
ExtensionName = extensionName,
|
||||
FeedUrl = feedUrl,
|
||||
Sources = _packageSourceManager.GetSources(),
|
||||
Sources = _packagingSourceManager.GetSources(),
|
||||
Extensions = _extensionManager.AvailableExtensions()
|
||||
});
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Harvest(PackagingHarvestViewModel model) {
|
||||
model.Sources = _packageSourceManager.GetSources();
|
||||
model.Sources = _packagingSourceManager.GetSources();
|
||||
model.Extensions = _extensionManager.AvailableExtensions();
|
||||
|
||||
var packageData = _packageManager.Harvest(model.ExtensionName);
|
||||
@@ -98,7 +98,7 @@ namespace Futures.Modules.Packaging.Controllers {
|
||||
|
||||
public ActionResult Install(string syndicationId) {
|
||||
var packageData = _packageManager.Download(syndicationId);
|
||||
_packageManager.Install(packageData);
|
||||
_packageManager.Install(packageData.PackageStream);
|
||||
_notifier.Information(T("Installed module"));
|
||||
return RedirectToAction("Modules");
|
||||
}
|
||||
|
@@ -86,7 +86,6 @@
|
||||
<Folder Include="Content\" />
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="Scripts\" />
|
||||
<Folder Include="Services\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
||||
|
@@ -5,7 +5,7 @@ using Orchard.Packaging;
|
||||
|
||||
namespace Futures.Modules.Packaging.ViewModels {
|
||||
public class PackagingHarvestViewModel {
|
||||
public IEnumerable<PackageSource> Sources { get; set; }
|
||||
public IEnumerable<PackagingSource> Sources { get; set; }
|
||||
public IEnumerable<ExtensionDescriptor> Extensions { get; set; }
|
||||
|
||||
[Required]
|
||||
|
@@ -3,6 +3,6 @@ using Orchard.Packaging;
|
||||
|
||||
namespace Futures.Modules.Packaging.ViewModels {
|
||||
public class PackagingModulesViewModel {
|
||||
public IEnumerable<PackageEntry> Modules { get; set; }
|
||||
public IEnumerable<PackagingEntry> Modules { get; set; }
|
||||
}
|
||||
}
|
@@ -3,6 +3,6 @@ using Orchard.Packaging;
|
||||
|
||||
namespace Futures.Modules.Packaging.ViewModels {
|
||||
public class PackagingSourcesViewModel {
|
||||
public IEnumerable<PackageSource> Sources { get; set; }
|
||||
public IEnumerable<PackagingSource> Sources { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user