Gets embedded package.xml resources able to install from package migration.

This commit is contained in:
Shannon
2021-06-10 13:06:38 -06:00
parent 2114667e65
commit 13583514ae
14 changed files with 129 additions and 111 deletions

View File

@@ -30,11 +30,7 @@ namespace Umbraco.Cms.Core.Packaging
if (info == null) throw new FormatException("The xml document is invalid");
var package = info.Element("package");
if (package == null) throw new FormatException("The xml document is invalid");
var author = info.Element("author");
if (author == null) throw new FormatException("The xml document is invalid");
var requirements = package.Element("requirements");
if (requirements == null) throw new FormatException("The xml document is invalid");
var def = new CompiledPackage
{
// will be null because we don't know where this data is coming from and

View File

@@ -12,6 +12,8 @@ namespace Umbraco.Cms.Core.Packaging
[DataContract(IsReference = true)]
public class InstallationSummary
{
public InstallWarnings Warnings { get; set; } = new InstallWarnings();
public IEnumerable<IDataType> DataTypesInstalled { get; set; } = Enumerable.Empty<IDataType>();
public IEnumerable<ILanguage> LanguagesInstalled { get; set; } = Enumerable.Empty<ILanguage>();
public IEnumerable<IDictionaryItem> DictionaryItemsInstalled { get; set; } = Enumerable.Empty<IDictionaryItem>();
@@ -26,23 +28,64 @@ namespace Umbraco.Cms.Core.Packaging
public override string ToString()
{
var sb = new StringBuilder();
var macroConflicts = Warnings.ConflictingMacros.ToList();
if (macroConflicts.Count > 0)
{
sb.Append("Conflicting macros found, they will be overwritten:");
foreach(IMacro m in macroConflicts)
{
sb.Append(m.Alias);
sb.Append(',');
}
sb.AppendLine(". ");
}
var templateConflicts = Warnings.ConflictingTemplates.ToList();
if (templateConflicts.Count > 0)
{
sb.Append("Conflicting templates found, they will be overwritten:");
foreach (IMacro m in templateConflicts)
{
sb.Append(m.Alias);
sb.Append(',');
}
sb.AppendLine(". ");
}
var stylesheetConflicts = Warnings.ConflictingStylesheets.ToList();
if (stylesheetConflicts.Count > 0)
{
sb.Append("Conflicting stylesheets found, they will be overwritten:");
foreach (IMacro m in stylesheetConflicts)
{
sb.Append(m.Alias);
sb.Append(',');
}
sb.AppendLine(". ");
}
sb.Append("Content items installed: ");
sb.Append(ContentInstalled.Count());
sb.AppendLine(". ");
sb.Append("Media items installed: ");
sb.Append(MediaInstalled.Count());
sb.AppendLine(". ");
sb.Append("Dictionary items installed: ");
sb.Append(DictionaryItemsInstalled.Count());
sb.AppendLine(". ");
sb.Append("Macros installed: ");
sb.Append(MacrosInstalled.Count());
sb.AppendLine(". ");
sb.Append("Stylesheets installed: ");
sb.Append(StylesheetsInstalled.Count());
sb.AppendLine(". ");
sb.Append("Templates installed: ");
sb.Append(TemplatesInstalled.Count());
sb.Append("Templates installed: ");
sb.AppendLine();
sb.Append("Document types installed: ");
sb.Append(DocumentTypesInstalled.Count());
sb.AppendLine(". ");
sb.Append("Media types installed: ");
sb.Append(MediaTypesInstalled.Count());
sb.AppendLine(". ");
sb.Append("Data types items installed: ");
sb.Append(DataTypesInstalled.Count());
return sb.ToString();