v9: Move local xml package files to database instead (#11654)

* Move package to database

* Added migration and implemented new repository

* Updated migrations to use proper xml convert

* Fixed save function and renamed createDate to update date

* Updated dependencyInjection

* Updated UmbracoPlan.cs

* Apply suggestions from code review

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

* Added File check

* Tried using same context as create table

* Fix DTO

* Fix GetById and local package saving

* Fix images when migrating

* Implement deletion of all local files

* Only delete local repo file, not file snapshots

* Remove static package path and use the one we save

* Update package repo to export package and remove check for ids when exporting

* Minor fixes

* Fix so that you can download package after creating

* Update savePackage method to export package afterwards

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
This commit is contained in:
Nikolaj Geisle
2021-12-21 14:02:49 +01:00
committed by GitHub
parent 4abace7e51
commit 76cf5037e5
11 changed files with 953 additions and 12 deletions

View File

@@ -69,7 +69,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
if (ModelState.IsValid == false)
return ValidationProblem(ModelState);
//save it
// Save it
if (!_packagingService.SaveCreatedPackage(model))
{
return ValidationProblem(
@@ -78,9 +78,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
: $"The package with id {model.Id} was not found");
}
_packagingService.ExportCreatedPackage(model);
//the packagePath will be on the model
// The packagePath will be on the model
return model;
}
@@ -112,11 +110,11 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
return ValidationErrorResult.CreateNotificationValidationErrorResult(
$"Package migration failed on package {packageName} with error: {ex.Message}. Check log for full details.");
}
}
}
[HttpGet]
public IActionResult DownloadCreatedPackage(int id)
public IActionResult DownloadCreatedPackage(int id)
{
var package = _packagingService.GetCreatedPackageById(id);
if (package == null)