Gets the IPackageBuilder working and tested, now the controller can create and update packages, validation is also working, need to do some more tests for adding other entities , removes more of the old packaging code.

This commit is contained in:
Shannon
2019-01-10 17:18:47 +11:00
parent 5f972384b1
commit b8d2309b9c
44 changed files with 333 additions and 2931 deletions

View File

@@ -60,8 +60,11 @@ namespace Umbraco.Core.Composing.Composers
composition.RegisterUnique<IEntityXmlSerializer, EntityXmlSerializer>();
composition.RegisterUnique<PackageActionRunner>();
composition.RegisterUnique<IPackageCreation, PackageCreation>();
composition.RegisterUnique<IPackageBuilder>(factory =>
new PackageBuilder( //we are using a factory because there are optional ctor args
factory.GetInstance<IContentService>(), factory.GetInstance<IContentTypeService>(), factory.GetInstance<IDataTypeService>(),
factory.GetInstance<IFileService>(), factory.GetInstance<IMacroService>(), factory.GetInstance<ILocalizationService>(),
factory.GetInstance<IEntityXmlSerializer>(), factory.GetInstance<ILogger>()));
//TODO: These are replaced in the web project - we need to declare them so that
// something is wired up, just not sure this is very nice but will work for now.

View File

@@ -43,9 +43,9 @@ namespace Umbraco.Core.IO
[Obsolete("Only used by legacy load balancing which is obsolete and should be removed")]
public static string WebServices => IOHelper.ReturnPath("umbracoWebservicesPath", Umbraco.EnsureEndsWith("/") + "webservices");
public static string Packages => Data + IOHelper.DirSepChar + "packages";
public static string Packages => Data + "/packages";
public static string Preview => Data + IOHelper.DirSepChar + "preview";
public static string Preview => Data + "/preview";
private static string _root;

View File

@@ -11,15 +11,8 @@ namespace Umbraco.Core.Models.Packaging
[DataMember(Name = "id")]
public int Id { get; set; }
//TODO: I don't see why this is necessary
[DataMember(Name = "repositoryGuid")]
public string RepositoryGuid { get; set; }
[DataMember(Name = "packageGuid")]
public string PackageGuid { get; set; }
[DataMember(Name = "hasUpdate")]
public bool HasUpdate { get; set; }
public Guid PackageId { get; set; }
[DataMember(Name = "name")]
[Required]
@@ -30,21 +23,24 @@ namespace Umbraco.Core.Models.Packaging
[Url]
public string Url { get; set; } = string.Empty;
/// <summary>
/// This is a generated GUID which is used to determine a temporary folder name for processing the package
/// </summary>
[DataMember(Name = "folder")]
public string Folder { get; set; } = string.Empty;
public Guid FolderId { get; set; }
[DataMember(Name = "packagePath")]
public string PackagePath { get; set; } = string.Empty;
[DataMember(Name = "version")]
[Required]
public string Version { get; set; } = string.Empty;
public string Version { get; set; } = "1.0.0";
/// <summary>
/// The minimum umbraco version that this package requires
/// </summary>
[DataMember(Name = "umbracoVersion")]
public Version UmbracoVersion { get; set; }
public Version UmbracoVersion { get; set; } = Configuration.UmbracoVersion.Current;
[DataMember(Name = "author")]
[Required]
@@ -65,31 +61,31 @@ namespace Umbraco.Core.Models.Packaging
public string Readme { get; set; } = string.Empty;
[DataMember(Name = "contentLoadChildNodes")]
public bool ContentLoadChildNodes { get; set; } = false;
public bool ContentLoadChildNodes { get; set; }
[DataMember(Name = "contentNodeId")]
public string ContentNodeId { get; set; } = string.Empty;
[DataMember(Name = "macros")]
public List<string> Macros { get; set; } = new List<string>();
public IList<string> Macros { get; set; } = new List<string>();
[DataMember(Name = "languages")]
public List<string> Languages { get; set; } = new List<string>();
public IList<string> Languages { get; set; } = new List<string>();
[DataMember(Name = "dictionaryItems")]
public List<string> DictionaryItems { get; set; } = new List<string>();
public IList<string> DictionaryItems { get; set; } = new List<string>();
[DataMember(Name = "templates")]
public List<string> Templates { get; set; } = new List<string>();
public IList<string> Templates { get; set; } = new List<string>();
[DataMember(Name = "documentTypes")]
public List<string> DocumentTypes { get; set; } = new List<string>();
public IList<string> DocumentTypes { get; set; } = new List<string>();
[DataMember(Name = "stylesheets")]
public List<string> Stylesheets { get; set; } = new List<string>();
public IList<string> Stylesheets { get; set; } = new List<string>();
[DataMember(Name = "files")]
public List<string> Files { get; set; } = new List<string>();
public IList<string> Files { get; set; } = new List<string>();
//TODO: Change this to angular view
[DataMember(Name = "loadControl")]
@@ -99,7 +95,7 @@ namespace Umbraco.Core.Models.Packaging
public string Actions { get; set; }
[DataMember(Name = "dataTypes")]
public List<string> DataTypes { get; set; } = new List<string>();
public IList<string> DataTypes { get; set; } = new List<string>();
[DataMember(Name = "iconUrl")]
public string IconUrl { get; set; } = string.Empty;

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.Packaging;
namespace Umbraco.Core.Packaging
{
/// <summary>
/// Creates packages
/// </summary>
public interface IPackageBuilder
{
IEnumerable<PackageDefinition> GetAll();
PackageDefinition GetById(int id);
void Delete(int id);
/// <summary>
/// Persists a package definition to storage
/// </summary>
/// <returns>
/// true if creating/updating the package was successful, otherwise false
/// </returns>
bool SavePackage(PackageDefinition definition);
/// <summary>
/// Creates the package file and returns it's physical path
/// </summary>
/// <param name="definition"></param>
string ExportPackage(PackageDefinition definition);
}
}

View File

@@ -1,22 +0,0 @@
using Umbraco.Core.Models.Packaging;
namespace Umbraco.Core.Packaging
{
/// <summary>
/// Creates packages
/// </summary>
public interface IPackageCreation
{
/// <summary>
/// Persists a package definition to storage
/// </summary>
/// <returns></returns>
void SavePackageDefinition(PackageDefinition definition);
/// <summary>
/// Creates the package file and returns it's physical path
/// </summary>
/// <param name="definition"></param>
string ExportPackageDefinition(PackageDefinition definition);
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.IO.Compression;
using System.Linq;
@@ -14,7 +15,7 @@ using File = System.IO.File;
namespace Umbraco.Core.Packaging
{
internal class PackageCreation : IPackageCreation
internal class PackageBuilder : IPackageBuilder
{
private readonly IContentService _contentService;
private readonly IContentTypeService _contentTypeService;
@@ -24,11 +25,15 @@ namespace Umbraco.Core.Packaging
private readonly ILocalizationService _languageService;
private readonly IEntityXmlSerializer _serializer;
private readonly ILogger _logger;
private readonly string _mediaFolderPath;
private readonly string _packagesFolderPath;
private readonly string _tempFolderPath;
public PackageCreation(IContentService contentService, IContentTypeService contentTypeService,
public PackageBuilder(IContentService contentService, IContentTypeService contentTypeService,
IDataTypeService dataTypeService, IFileService fileService, IMacroService macroService,
ILocalizationService languageService,
IEntityXmlSerializer serializer, ILogger logger)
IEntityXmlSerializer serializer, ILogger logger,
string tempFolderPath = null, string packagesFolderPath = null, string mediaFolderPath = null)
{
_contentService = contentService;
_contentTypeService = contentTypeService;
@@ -38,49 +43,87 @@ namespace Umbraco.Core.Packaging
_languageService = languageService;
_serializer = serializer;
_logger = logger;
_tempFolderPath = tempFolderPath ?? SystemDirectories.Data + "/TEMP/PackageFiles";
_packagesFolderPath = packagesFolderPath ?? SystemDirectories.Packages;
_mediaFolderPath = mediaFolderPath ?? SystemDirectories.Media + "/created-packages";
}
public static string CreatedPackagesFile => SystemDirectories.Packages + IOHelper.DirSepChar + "createdPackages.config";
private string CreatedPackagesFile => _packagesFolderPath.EnsureEndsWith('/') + "createdPackages.config";
public void SavePackageDefinition(PackageDefinition definition)
public IEnumerable<PackageDefinition> GetAll()
{
var packagesXml = EnsureStorage(out _);
foreach (var packageXml in packagesXml.Root.Elements("package"))
yield return XmlToPackageDefinition(packageXml);
}
public PackageDefinition GetById(int id)
{
var packagesXml = EnsureStorage(out _);
var packageXml = packagesXml.Root.Elements("package").FirstOrDefault(x => x.AttributeValue<int>("id") == id);
return packageXml == null ? null : XmlToPackageDefinition(packageXml);
}
public void Delete(int id)
{
var packagesXml = EnsureStorage(out var packagesFile);
var packageXml = packagesXml.Root.Elements("package").FirstOrDefault(x => x.AttributeValue<int>("id") == id);
if (packageXml == null) return;
packageXml.Remove();
packagesXml.Save(packagesFile);
}
public bool SavePackage(PackageDefinition definition)
{
if (definition == null) throw new ArgumentNullException(nameof(definition));
var packagesXml = EnsureStorage(out var packagesFile);
//ensure it's valid
ValidatePackage(definition);
if (definition.Id == default)
{
//need to gen an id and persist
// Find max id
var maxId = packagesXml.Root.Elements("package").Max(x => x.AttributeValue<int>("id"));
var maxId = packagesXml.Root.Elements("package").Max(x => x.AttributeValue<int?>("id")) ?? 0;
var newId = maxId + 1;
definition.Id = newId;
definition.PackageGuid = Guid.NewGuid().ToString();
definition.Folder = Guid.NewGuid().ToString();
definition.PackageId = Guid.NewGuid();
definition.FolderId = Guid.NewGuid();
var packageXml = PackageDefinitionToXml(definition);
packagesXml.Add(packageXml);
packagesXml.Root.Add(packageXml);
}
else
{
//existing
var packageXml = packagesXml.Root.Elements("package").FirstOrDefault(x => x.AttributeValue<int>("id") == definition.Id);
if (packageXml == null)
throw new InvalidOperationException($"The package with id {definition.Id} was not found");
return false;
var updatedXml = PackageDefinitionToXml(definition);
packageXml.ReplaceWith(updatedXml);
}
packagesXml.Save(packagesFile);
return true;
}
public string ExportPackageDefinition(PackageDefinition definition)
public string ExportPackage(PackageDefinition definition)
{
if (definition.Id == default) throw new ArgumentException("The package definition does not have an ID, it must be saved before being exported");
if (definition.PackageGuid.IsNullOrWhiteSpace()) throw new ArgumentException("the package definition does not have a GUID, it must be saved before being exported");
if (definition.PackageId == default) throw new ArgumentException("the package definition does not have a GUID, it must be saved before being exported");
if (definition.FolderId == default) throw new ArgumentException("the package definition does not have a folder GUID, it must be saved before being exported");
//ensure it's valid
ValidatePackage(definition);
//Create a folder for building this package
var temporaryPath = IOHelper.MapPath(SystemDirectories.Data + "/TEMP/PackageFiles/" + definition.Folder);
var temporaryPath = IOHelper.MapPath(_tempFolderPath.EnsureEndsWith('/') + definition.FolderId);
if (Directory.Exists(temporaryPath) == false)
Directory.CreateDirectory(temporaryPath);
@@ -90,7 +133,7 @@ namespace Umbraco.Core.Packaging
var packageManifest = CreatePackageManifest(out var manifestRoot, out var filesXml);
//Info section
packageManifest.Add(GetPackageInfoXml(definition));
manifestRoot.Add(GetPackageInfoXml(definition));
PackageDocumentsAndTags(definition, manifestRoot);
PackageDocumentTypes(definition, manifestRoot);
@@ -124,7 +167,7 @@ namespace Umbraco.Core.Packaging
}
catch (Exception e)
{
_logger.Warn<PackageCreation>(e, "Could not add package actions to the package manifest, the xml did not parse");
_logger.Warn<PackageBuilder>(e, "Could not add package actions to the package manifest, the xml did not parse");
}
}
@@ -136,13 +179,17 @@ namespace Umbraco.Core.Packaging
packageManifest.Save(manifestFileName);
// check if there's a packages directory below media
var packagesDirectory = SystemDirectories.Media + "/created-packages";
if (Directory.Exists(IOHelper.MapPath(packagesDirectory)) == false)
Directory.CreateDirectory(IOHelper.MapPath(packagesDirectory));
var packPath = packagesDirectory + "/" + (definition.Name + "_" + definition.Version).Replace(' ', '_') + ".zip";
if (Directory.Exists(IOHelper.MapPath(_mediaFolderPath)) == false)
Directory.CreateDirectory(IOHelper.MapPath(_mediaFolderPath));
var packPath = _mediaFolderPath.EnsureEndsWith('/') + (definition.Name + "_" + definition.Version).Replace(' ', '_') + ".zip";
ZipPackage(temporaryPath, IOHelper.MapPath(packPath));
//we need to update the package path and save it
definition.PackagePath = packPath;
SavePackage(definition);
return packPath;
}
finally
@@ -152,6 +199,16 @@ namespace Umbraco.Core.Packaging
}
}
private void ValidatePackage(PackageDefinition definition)
{
//ensure it's valid
var context = new ValidationContext(definition, serviceProvider: null, items: null);
var results = new List<ValidationResult>();
var isValid = Validator.TryValidateObject(definition, context, results);
if (!isValid)
throw new InvalidOperationException("Validation failed, there is invalid data on the model: " + string.Join(", ", results.Select(x => x.ErrorMessage)));
}
private void PackageDataTypes(PackageDefinition definition, XContainer manifestRoot)
{
var dataTypes = new XElement("DataTypes");
@@ -342,6 +399,8 @@ namespace Umbraco.Core.Packaging
/// <param name="savePath">The save path.</param>
private static void ZipPackage(string path, string savePath)
{
if (File.Exists(savePath))
File.Delete(savePath);
ZipFile.CreateFromDirectory(path, savePath);
}
@@ -476,7 +535,7 @@ namespace Umbraco.Core.Packaging
requirements.Add(new XElement("patch", definition.UmbracoVersion == null ? UmbracoVersion.SemanticVersion.Patch.ToInvariantString() : definition.UmbracoVersion.Build.ToInvariantString()));
if (definition.UmbracoVersion != null)
requirements.Add(new XAttribute("type", "strict"));
requirements.Add(new XAttribute("type", RequirementsType.Strict.ToString()));
package.Add(requirements);
info.Add(package);
@@ -496,13 +555,13 @@ namespace Umbraco.Core.Packaging
{
files = new XElement("files");
root = new XElement("umbPackage", files);
var packageManifest = new XDocument();
var packageManifest = new XDocument(root);
return packageManifest;
}
private static XDocument EnsureStorage(out string packagesFile)
private XDocument EnsureStorage(out string packagesFile)
{
var packagesFolder = IOHelper.MapPath(SystemDirectories.Packages);
var packagesFolder = IOHelper.MapPath(_packagesFolderPath);
//ensure it exists
Directory.CreateDirectory(packagesFolder);
@@ -517,45 +576,80 @@ namespace Umbraco.Core.Packaging
return packagesXml;
}
private static PackageDefinition XmlToPackageDefinition(XElement xml)
{
if (xml == null) return null;
var retVal = new PackageDefinition
{
Id = xml.AttributeValue<int>("id"),
Name = xml.AttributeValue<string>("name") ?? string.Empty,
FolderId = xml.AttributeValue<Guid>("folder"),
PackagePath = xml.AttributeValue<string>("packagePath") ?? string.Empty,
Version = xml.AttributeValue<string>("version") ?? string.Empty,
Url = xml.AttributeValue<string>("url") ?? string.Empty,
PackageId = xml.AttributeValue<Guid>("packageGuid"),
IconUrl = xml.AttributeValue<string>("iconUrl") ?? string.Empty,
UmbracoVersion = xml.AttributeValue<Version>("umbVersion"),
License = xml.Element("license")?.Value ?? string.Empty,
LicenseUrl = xml.Element("license")?.AttributeValue<string>("url") ?? string.Empty,
Author = xml.Element("author")?.Value ?? string.Empty,
AuthorUrl = xml.Element("author")?.AttributeValue<string>("url") ?? string.Empty,
Readme = xml.Element("readme")?.Value ?? string.Empty,
Actions = xml.Element("actions")?.ToString() ?? string.Empty,
ContentNodeId = xml.Element("content")?.AttributeValue<string>("nodeId") ?? string.Empty,
ContentLoadChildNodes = xml.Element("content")?.AttributeValue<bool>("loadChildNodes") ?? false,
Macros = xml.Element("macros")?.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
Templates = xml.Element("templates")?.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
Stylesheets = xml.Element("stylesheets")?.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
DocumentTypes = xml.Element("documentTypes")?.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
Languages = xml.Element("languages")?.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
DictionaryItems = xml.Element("dictionaryitems")?.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
DataTypes = xml.Element("datatypes")?.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List<string>(),
Files = xml.Element("files")?.Elements("file").Select(x => x.Value).ToList() ?? new List<string>(),
LoadControl = xml.Element("loadcontrol")?.Value ?? string.Empty
};
return retVal;
}
private static XElement PackageDefinitionToXml(PackageDefinition def)
{
var packageXml = new XElement("package",
new XAttribute("id", def.Id),
new XAttribute("version", def.Version),
new XAttribute("url", def.Url),
new XAttribute("name", def.Name),
new XAttribute("folder", def.Folder), //fixme: What is this?
new XAttribute("packagepath", def.PackagePath),
new XAttribute("repositoryGuid", def.RepositoryGuid),
new XAttribute("iconUrl", def.IconUrl),
new XAttribute("version", def.Version ?? string.Empty),
new XAttribute("url", def.Url ?? string.Empty),
new XAttribute("name", def.Name ?? string.Empty),
new XAttribute("folder", def.FolderId),
new XAttribute("packagePath", def.PackagePath ?? string.Empty),
new XAttribute("iconUrl", def.IconUrl ?? string.Empty),
new XAttribute("umbVersion", def.UmbracoVersion),
new XAttribute("packageGuid", def.PackageGuid),
new XAttribute("hasUpdate", def.HasUpdate), //fixme: What is this?
new XAttribute("packageGuid", def.PackageId),
new XElement("license",
new XCData(def.License),
new XAttribute("url", def.LicenseUrl)),
new XCData(def.License ?? string.Empty),
new XAttribute("url", def.LicenseUrl ?? string.Empty)),
new XElement("author",
new XCData(def.Author),
new XAttribute("url", def.AuthorUrl)),
new XCData(def.Author ?? string.Empty),
new XAttribute("url", def.AuthorUrl ?? string.Empty)),
new XElement("readme", def.Readme),
new XElement("actions", def.Actions),
new XElement("datatypes", string.Join(",", def.DataTypes)),
new XElement("readme", def.Readme ?? string.Empty),
new XElement("actions", def.Actions ?? string.Empty),
new XElement("datatypes", string.Join(",", def.DataTypes ?? Array.Empty<string>())),
new XElement("content",
new XAttribute("nodeId", def.ContentNodeId),
new XAttribute("loadChildNodes", def.ContentLoadChildNodes)),
new XElement("templates", string.Join(",", def.Templates)),
new XElement("stylesheets", string.Join(",", def.Stylesheets)),
new XElement("documentTypes", string.Join(",", def.DocumentTypes)),
new XElement("macros", string.Join(",", def.Macros)),
new XElement("files", string.Join(",", def.Files)),
new XElement("languages", string.Join(",", def.Languages)),
new XElement("dictionaryitems", string.Join(",", def.DictionaryItems)),
new XElement("loadcontrol", "")); //fixme: no more loadcontrol, needs to be an angular view
new XElement("templates", string.Join(",", def.Templates ?? Array.Empty<string>())),
new XElement("stylesheets", string.Join(",", def.Stylesheets ?? Array.Empty<string>())),
new XElement("documentTypes", string.Join(",", def.DocumentTypes ?? Array.Empty<string>())),
new XElement("macros", string.Join(",", def.Macros ?? Array.Empty<string>())),
new XElement("files", (def.Files ?? Array.Empty<string>()).Where(x => !x.IsNullOrWhiteSpace()).Select(x => new XElement("file", x))),
new XElement("languages", string.Join(",", def.Languages ?? Array.Empty<string>())),
new XElement("dictionaryitems", string.Join(",", def.DictionaryItems ?? Array.Empty<string>())),
new XElement("loadcontrol", def.LoadControl ?? string.Empty)); //fixme: no more loadcontrol, needs to be an angular view
return packageXml;
}

View File

@@ -1,4 +1,4 @@
namespace Umbraco.Web._Legacy.Packager
namespace Umbraco.Core.Packaging
{
public enum RequirementsType
{

View File

@@ -9,14 +9,27 @@ namespace Umbraco.Core.Services
{
public interface IPackagingService : IService
{
#region Package Creation
#region Package Building
IEnumerable<PackageDefinition> GetAll();
PackageDefinition GetById(int id);
void Delete(int id);
/// <summary>
/// Persists a package definition to storage
/// </summary>
/// <returns></returns>
void SavePackageDefinition(PackageDefinition definition);
bool SavePackage(PackageDefinition definition);
/// <summary>
/// Creates the package file and returns it's physical path
/// </summary>
/// <param name="definition"></param>
string ExportPackage(PackageDefinition definition);
#endregion
#region Importing
/// <summary>
/// Imports and saves package xml as <see cref="IContent"/>
/// </summary>
@@ -89,6 +102,7 @@ namespace Umbraco.Core.Services
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
/// <returns>An enumrable list of generated Templates</returns>
IEnumerable<ITemplate> ImportTemplates(XElement element, int userId = 0, bool raiseEvents = true);
#endregion
/// <summary>
/// This will fetch an Umbraco package file from the package repository and return the relative file path to the downloaded package file

View File

@@ -46,7 +46,7 @@ namespace Umbraco.Core.Services.Implement
private readonly IAuditRepository _auditRepository;
private readonly IContentTypeRepository _contentTypeRepository;
private readonly PropertyEditorCollection _propertyEditors;
private readonly IPackageCreation _packageCreation;
private readonly IPackageBuilder _packageBuilder;
private static HttpClient _httpClient;
public PackagingService(
@@ -62,7 +62,7 @@ namespace Umbraco.Core.Services.Implement
IAuditRepository auditRepository,
IContentTypeRepository contentTypeRepository,
PropertyEditorCollection propertyEditors,
IPackageCreation packageCreation)
IPackageBuilder packageBuilder)
{
_logger = logger;
_contentService = contentService;
@@ -76,7 +76,7 @@ namespace Umbraco.Core.Services.Implement
_auditRepository = auditRepository;
_contentTypeRepository = contentTypeRepository;
_propertyEditors = propertyEditors;
_packageCreation = packageCreation;
_packageBuilder = packageBuilder;
_importedContentTypes = new Dictionary<string, IContentType>();
}
@@ -1402,7 +1402,15 @@ namespace Umbraco.Core.Services.Implement
#region Package Building
public void SavePackageDefinition(PackageDefinition definition) => _packageCreation.SavePackageDefinition(definition);
public void Delete(int id) => _packageBuilder.Delete(id);
public IEnumerable<PackageDefinition> GetAll() => _packageBuilder.GetAll();
public PackageDefinition GetById(int id) => _packageBuilder.GetById(id);
public bool SavePackage(PackageDefinition definition) => _packageBuilder.SavePackage(definition);
public string ExportPackage(PackageDefinition definition) => _packageBuilder.ExportPackage(definition);
#endregion

View File

@@ -444,9 +444,10 @@
<Compile Include="Models\PublishedContent\ThreadCultureVariationContextAccessor.cs" />
<Compile Include="Models\PublishedContent\VariationContextAccessorExtensions.cs" />
<Compile Include="Models\Packaging\UninstallationSummaryExtentions.cs" />
<Compile Include="Packaging\IPackageCreation.cs" />
<Compile Include="Packaging\IPackageBuilder.cs" />
<Compile Include="Packaging\PackageActionRunner.cs" />
<Compile Include="Packaging\PackageCreation.cs" />
<Compile Include="Packaging\PackageBuilder.cs" />
<Compile Include="Packaging\RequirementsType.cs" />
<Compile Include="Persistence\Dtos\AuditEntryDto.cs" />
<Compile Include="Persistence\Dtos\ConsentDto.cs" />
<Compile Include="Persistence\Dtos\ContentScheduleDto.cs" />

View File

@@ -90,7 +90,7 @@ namespace Umbraco.Tests.Composing
Assert.AreEqual(0, typesFound.Count()); // 0 classes in _assemblies are marked with [Tree]
typesFound = TypeFinder.FindClassesWithAttribute<TreeAttribute>(new[] { typeof (UmbracoContext).Assembly });
Assert.AreEqual(21, typesFound.Count()); // + classes in Umbraco.Web are marked with [Tree]
Assert.AreEqual(22, typesFound.Count()); // + classes in Umbraco.Web are marked with [Tree]
}
private static IProfilingLogger GetTestProfilingLogger()

View File

@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using NUnit.Framework;
using Umbraco.Core.IO;
using Umbraco.Core.Models.Packaging;

View File

@@ -170,7 +170,7 @@ namespace Umbraco.Tests.TestHelpers
var macroService = GetLazyService<IMacroService>(factory, c => new MacroService(scopeProvider, logger, eventMessagesFactory, GetRepo<IMacroRepository>(c), GetRepo<IAuditRepository>(c)));
var packagingService = GetLazyService<IPackagingService>(factory, c => new PackagingService(
logger, contentService.Value, contentTypeService.Value, macroService.Value, dataTypeService.Value, fileService.Value, localizationService.Value, entityService.Value, scopeProvider, GetRepo<IAuditRepository>(c), GetRepo<IContentTypeRepository>(c), new PropertyEditorCollection(new DataEditorCollection(Enumerable.Empty<DataEditor>())),
new PackageCreation(contentService.Value, contentTypeService.Value, dataTypeService.Value, fileService.Value, macroService.Value, localizationService.Value,
new PackageBuilder(contentService.Value, contentTypeService.Value, dataTypeService.Value, fileService.Value, macroService.Value, localizationService.Value,
new EntityXmlSerializer(contentService.Value, mediaService.Value, dataTypeService.Value, userService.Value, localizationService.Value, contentTypeService.Value, urlSegmentProviders), logger)));
var relationService = GetLazyService<IRelationService>(factory, c => new RelationService(scopeProvider, logger, eventMessagesFactory, entityService.Value, GetRepo<IRelationRepository>(c), GetRepo<IRelationTypeRepository>(c)));
var treeService = GetLazyService<IApplicationTreeService>(factory, c => new ApplicationTreeService(logger, cache, typeLoader));

View File

@@ -62,6 +62,8 @@
<Reference Include="System.Data.Entity.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Runtime.Caching" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Text.Encoding" />
@@ -140,6 +142,7 @@
<Compile Include="Services\ContentServiceTagsTests.cs" />
<Compile Include="Services\ContentTypeServiceVariantsTests.cs" />
<Compile Include="Services\EntityXmlSerializerTests.cs" />
<Compile Include="Packaging\PackageBuilderTests.cs" />
<Compile Include="Testing\Objects\TestDataSource.cs" />
<Compile Include="Published\PublishedSnapshotTestObjects.cs" />
<Compile Include="Published\ModelTypeTests.cs" />

View File

@@ -179,20 +179,29 @@ function packageResource($q, $http, umbDataFormatter, umbRequestHelper) {
'Failed to get package');
},
getEmpty: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"packageApiBaseUrl",
"getEmpty")),
'Failed to get scaffold');
},
/**
* @ngdoc method
* @name umbraco.resources.packageInstallResource#createPackage
* @name umbraco.resources.packageInstallResource#savePackage
* @methodOf umbraco.resources.packageInstallResource
*
* @description
* Creates a new package
* Creates or updates a package
*/
createPackage: function (umbPackage) {
savePackage: function (umbPackage) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"packageApiBaseUrl",
"PostCreatePackage"), umbPackage),
"PostSavePackage"), umbPackage),
'Failed to create package');
},

View File

@@ -119,6 +119,8 @@ function formHelper(angularHelper, serverValidationManager, notificationsService
serverValidationManager.notifyAndClearAllSubscriptions();
}
else {
//TODO: All YSOD handling should be done with an interceptor
overlayService.ysod(err);
}
}

View File

@@ -177,6 +177,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
//show a ysod dialog
if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) {
const error = { errorMsg: 'An error occured', data: response.data };
//TODO: All YSOD handling should be done with an interceptor
overlayService.ysod(error);
}
else {
@@ -288,6 +289,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
else if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) {
//show a ysod dialog
const error = { errorMsg: 'An error occured', data: response.data };
//TODO: All YSOD handling should be done with an interceptor
overlayService.ysod(error);
}
else {

View File

@@ -65,6 +65,7 @@ function ContentDeleteController($scope, $timeout, contentResource, treeService,
//check if response is ysod
if (err.status && err.status >= 500) {
//TODO: All YSOD handling should be done with an interceptor
overlayService.ysod(err);
}
});

View File

@@ -59,6 +59,7 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer
//check if response is ysod
if (err.status && err.status >= 500) {
//TODO: All YSOD handling should be done with an interceptor
overlayService.ysod(err);
}

View File

@@ -1,7 +1,7 @@
(function () {
"use strict";
function EditController($scope, $location, $routeParams, entityResource, packageResource, contentTypeResource, templateResource, stylesheetResource, languageResource, dictionaryResource, dataTypeResource, editorService, formHelper) {
function EditController($scope, $location, $routeParams, entityResource, stylesheetResource, languageResource, packageResource, dictionaryResource, editorService, formHelper) {
const vm = this;
@@ -12,10 +12,9 @@
vm.contentOpen = true;
vm.filesOpen = true;
vm.actionsOpen = true;
vm.loading = true;
vm.back = back;
vm.createPackage = createPackage;
vm.save = save;
vm.createOrUpdatePackage = createOrUpdatePackage;
vm.removeContentItem = removeContentItem;
vm.openContentPicker = openContentPicker;
vm.openFilePicker = openFilePicker;
@@ -23,24 +22,23 @@
vm.openControlPicker = openControlPicker;
vm.removeControl = removeControl;
function onInit() {
const packageId = $routeParams.id;
const create = $routeParams.create;
const packageId = $routeParams.id;
const create = $routeParams.create;
function onInit() {
if(create) {
//pre populate package with some values
vm.package = {
"version": "0.0.1",
"license": "MIT License",
"licenseUrl": "http://opensource.org/licenses/MIT",
"umbracoVersion": Umbraco.Sys.ServerVariables.application.version
};
packageResource.getEmpty().then(scaffold => {
vm.package = scaffold;
vm.loading = false;
});
vm.buttonLabel = "Create";
} else {
// load package
packageResource.getCreatedById(packageId).then(createdPackage => {
vm.package = createdPackage;
vm.loading = false;
// get render model for content node
if(vm.package.contentNodeId) {
entityResource.getById(vm.package.contentNodeId, "Document")
@@ -49,11 +47,12 @@
});
}
}, angular.noop);
});
vm.buttonLabel = "Save";
}
// get all doc types
contentTypeResource.getAll().then(documentTypes => {
entityResource.getAll("DocumentType").then(documentTypes => {
// a package stores the id as a string so we
// need to convert all ids to string for comparison
documentTypes.forEach(documentType => {
@@ -63,7 +62,7 @@
});
// get all templates
templateResource.getAll().then(templates => {
entityResource.getAll("Template").then(templates => {
// a package stores the id as a string so we
// need to convert all ids to string for comparison
templates.forEach(template => {
@@ -101,7 +100,7 @@
});
// get all data types items
dataTypeResource.getAll().then(dataTypes => {
entityResource.getAll("DataType").then(dataTypes => {
// a package stores the id as a string so we
// need to convert all ids to string for comparison
dataTypes.forEach(dataType => {
@@ -116,26 +115,31 @@
$location.path("packages/packages/overview").search('create', null);;
}
function createPackage(editPackageForm) {
function createOrUpdatePackage(editPackageForm) {
if (formHelper.submitForm({ formCtrl: editPackageForm, scope: $scope })) {
vm.createPackageButtonState = "busy";
vm.buttonState = "busy";
packageResource.savePackage(vm.package).then((updatedPackage) => {
packageResource.createPackage(vm.package).then((updatedPackage) => {
vm.package = updatedPackage;
vm.createPackageButtonState = "success";
vm.buttonState = "success";
if (create) {
//if we are creating, then redirect to the correct url and reload
$location.path("packages/packages/overview/" + vm.package.id).search("subview", "created");
//don't add a browser history for this
$location.replace();
}
}, function(err){
formHelper.handleError(err);
vm.createPackageButtonState = "error";
vm.buttonState = "error";
});
}
}
function save() {
console.log("save package");
}
function removeContentItem() {
vm.package.contentNodeId = null;
}

View File

@@ -300,14 +300,15 @@
<umb-editor-footer>
<umb-editor-footer-content-right>
<umb-button
type="button"
action="vm.createPackage(editPackageForm)"
state="vm.createPackageButtonState"
button-style="success"
label="Create"
disabled="vm.loading">
<umb-button type="button"
action="vm.createOrUpdatePackage(editPackageForm)"
state="vm.buttonState"
button-style="success"
label="{{vm.buttonLabel}}"
disabled="vm.loading">
</umb-button>
</umb-editor-footer-content-right>
</umb-editor-footer>

View File

@@ -157,13 +157,6 @@
<Compile Include="Umbraco\Developer\Macros\EditMacro.aspx.designer.cs">
<DependentUpon>editMacro.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Developer\Packages\DirectoryBrowser.aspx.cs">
<DependentUpon>directoryBrowser.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Developer\Packages\DirectoryBrowser.aspx.designer.cs">
<DependentUpon>directoryBrowser.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Masterpages\Default.Master.cs">
<DependentUpon>default.Master</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -209,7 +202,6 @@
<Content Include="Umbraco\Config\Lang\tr.xml" />
<Content Include="Umbraco\Config\Lang\zh_tw.xml" />
<Content Include="Umbraco\create.aspx" />
<Content Include="Umbraco\Developer\Packages\installer.aspx" />
<Content Include="Config\Splashes\booting.aspx" />
<Content Include="Config\Splashes\noNodes.aspx" />
<Content Include="Umbraco\Install\Views\Web.config" />
@@ -307,8 +299,6 @@
<Content Include="Umbraco\Config\Lang\nl.xml" />
<Content Include="Umbraco\Config\Lang\nb.xml" />
<Content Include="Umbraco\Config\Lang\sv.xml" />
<Content Include="Umbraco\Developer\Packages\directoryBrowser.aspx" />
<Content Include="Umbraco\Developer\Packages\editPackage.aspx" />
<Content Include="Umbraco\Config\Create\UI.xml" />
<Content Include="Umbraco\Config\Lang\en.xml">
<SubType>Designer</SubType>

View File

@@ -15,32 +15,4 @@
<delete assembly="Umbraco.Web" type="macroTasks" />
</tasks>
</nodeType>
<nodeType alias="initpackager">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
<nodeType alias="packager">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
<nodeType alias="createdPackages">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
<nodeType alias="createdPackageInstance">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<delete assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
</createUI>

View File

@@ -15,32 +15,4 @@
<delete assembly="Umbraco.Web" type="macroTasks" />
</tasks>
</nodeType>
<nodeType alias="initpackager">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
<nodeType alias="packager">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
<nodeType alias="createdPackages">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
<nodeType alias="createdPackageInstance">
<header>Package</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<delete assembly="Umbraco.Web" type="CreatedPackageTasks" />
</tasks>
</nodeType>
</createUI>

View File

@@ -1,140 +0,0 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Web.UI.Pages;
namespace Umbraco.Web.UI.Umbraco.Developer.Packages
{
public partial class DirectoryBrowser : UmbracoEnsuredPage
{
public DirectoryBrowser()
{
CurrentApp = Constants.Applications.Packages;
}
string _lsScriptName;
string _lsWebPath;
protected string Target = "";
private readonly Regex _xssElementIdClean = new Regex(@"^([a-zA-Z0-9-_:\.]+)");
private readonly StringBuilder _sb = new StringBuilder();
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(5));
Response.Cache.SetCacheability(HttpCacheability.Public);
//we need to clean this string:
//http://issues.umbraco.org/issue/U4-2027
var target = Request.QueryString.Get("target");
if (target.IsNullOrWhiteSpace())
throw new InvalidOperationException("The target query string must be set to a valid html element id");
var matched = _xssElementIdClean.Matches(target);
if (matched.Count == 0)
throw new InvalidOperationException("The target query string must be set to a valid html element id");
Target = matched[0].Value;
try
{
//Variables used in script
var sebChar = IOHelper.DirSepChar.ToString();
//Work on path and ensure no back tracking
string sSubDir = Request.QueryString.Get("path");
if (string.IsNullOrEmpty(sSubDir)) { sSubDir = "/"; }
sSubDir = sSubDir.Replace(IOHelper.DirSepChar.ToString(), "");
sSubDir = sSubDir.Replace("//", "/");
sSubDir = sSubDir.Replace("..", "./");
sSubDir = sSubDir.Replace('/', IOHelper.DirSepChar);
//Clean path for processing and collect path varitations
if (sSubDir.Substring(0, 1) != sebChar) { sSubDir = sebChar + sSubDir; }
if (sSubDir.Substring(sSubDir.Length - 1, 1) != "\\") { sSubDir = sSubDir + sebChar; }
//Get name of the browser script file
_lsScriptName = Request.ServerVariables.Get("SCRIPT_NAME");
var j = _lsScriptName.LastIndexOf("/");
if (j > 0) { _lsScriptName = _lsScriptName.Substring(j + 1, _lsScriptName.Length - (j + 1)).ToLower(); }
//Create navigation string and other path strings
GetNavLink("", "root");
if (sSubDir != sebChar)
{
j = 0; int i = 0;
do
{
i = sSubDir.IndexOf(sebChar, j + 1);
_lsWebPath += sSubDir.Substring(j + 1, i - (j + 1)) + "/";
GetNavLink(_lsWebPath, sSubDir.Substring(j + 1, i - (j + 1)));
j = i;
} while (i != sSubDir.Length - 1);
}
//Output header
_sb.Append("<table cellpadding=3 cellspacing=1><tbody>");
//Output directorys
var oDirInfo = new DirectoryInfo(IOHelper.MapPath("~/" + sSubDir));
var oDirs = oDirInfo.GetDirectories();
foreach (var oDir in oDirs)
{
try
{
_sb.Append("<tr><td class=\"tdDir\"><a href=\"" + _lsScriptName + "?path=" + _lsWebPath + oDir.Name + "&target=" + Target + "\">" + oDir.Name + "</a> <small><a href=\"javascript:postPath('/" + _lsWebPath + oDir.Name + "')\"> (Include entire folder)</small></td></tr>");
}
catch (Exception)
{
_sb.Append("<tr><td class=\"tdDir\">" + oDir.Name + " (Access Denied)</td></tr>");
}
}
//Ouput files
var oFiles = oDirInfo.GetFiles();
foreach (var oFile in oFiles.Where(oFile => oFile.Name.ToLower() != _lsScriptName))
{
decimal iLen = oFile.Length;
string sLen;
if (iLen >= 1048960) { iLen = iLen / 1048960; sLen = "mb"; } else { iLen = iLen / 1024; sLen = "kb"; }
sLen = Decimal.Round(iLen, 2).ToString() + sLen;
_sb.Append("<tr><td class=\"tdFile\"><a href=\"javascript:postPath('/" + _lsWebPath + oFile.Name + "')\">" + oFile.Name + "</a></td></tr>");
}
//Output footer
_sb.Append("</tbody></table></center>");
}
catch (Exception ex)
{
RptErr(ex.Message);
}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
Output.Controls.Add(new LiteralControl(_sb.ToString()));
}
private void RptErr(string psMessage)
{
_sb.Append("<DIV align=\"left\" width=\"100%\"><B>Script Reported Error: </B>&nbsp;" + psMessage + "</DIV><BR>");
}
private string GetNavLink(string psHref, string psText)
{
return ("/<a class=\"tdheadA\" href=\"" + _lsScriptName + "?path=" + psHref + "\">" + psText + "</a>");
}
}
}

View File

@@ -1,42 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Umbraco.Web.UI.Umbraco.Developer.Packages {
public partial class DirectoryBrowser {
/// <summary>
/// CssInclude1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
/// <summary>
/// pane control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane pane;
/// <summary>
/// Output control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.PlaceHolder Output;
}
}

View File

@@ -1,26 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="True" MasterPageFile="../../masterpages/umbracoDialog.Master" CodeBehind="DirectoryBrowser.aspx.cs" Inherits="Umbraco.Web.UI.Umbraco.Developer.Packages.DirectoryBrowser" %>
<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<%@ Register TagPrefix="cdf" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<cdf:CssInclude ID="CssInclude1" runat="server" FilePath="Editors/DirectoryBrowser.css" PathNameAlias="UmbracoClient"></cdf:CssInclude>
<script type="text/javascript">
function postPath(path) {
var elementId = '<%=Target%>';
top.right.document.getElementById(elementId).value = path;
UmbClientMgr.closeModalWindow();
}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<div class="umb-dialog-body">
<cc1:Pane runat="server" Width="100px" ID="pane">
<asp:PlaceHolder runat="server" ID="Output"></asp:PlaceHolder>
</cc1:Pane>
</div>
</asp:Content>

View File

@@ -1,232 +0,0 @@
<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master"
Title="Package and export content" CodeBehind="editPackage.aspx.cs" Inherits="umbraco.presentation.developer.packages._Default" %>
<%@ Register TagPrefix="cc2" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
var updateMethod = "";
var contentOrMediaId = "";
var windowChooser;
var treePickerId = -1;
var prefix;
function addfileJs() {
if (document.getElementById("<%= packageFilePathNew.ClientID %>").value == '') {
alert("Please pick a file by clicking the folder Icon, before clicking the 'add' button");
}
}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc2:TabView ID="TabView1" runat="server" Width="552px" Height="392px"></cc2:TabView>
<cc2:Pane ID="Pane1" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_name" Text="Package Name">
<asp:TextBox ID="packageName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator0" runat="server" EnableClientScript="false"
ControlToValidate="packageName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_url" Text="Package Url">
<asp:TextBox ID="packageUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" EnableClientScript="false"
ControlToValidate="packageUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_version" Text="Package Version">
<asp:TextBox ID="packageVersion" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" EnableClientScript="false"
ControlToValidate="packageVersion">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_icon" Text="Package Icon URL">
<asp:TextBox ID="iconUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_file" Text="Package file (.zip):">
<asp:Literal ID="packageUmbFile" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane5" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_umbracoVersion" Text="Umbraco Target Version">
<asp:TextBox ID="umbracoVersion" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" EnableClientScript="false"
ControlToValidate="umbracoVersion">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="VersionValidator" runat="server" EnableClientScript="false"
ControlToValidate="umbracoVersion" ValidationExpression="^\d+\.\d+\.\d+$">Invalid version number (eg. 7.5.0)</asp:RegularExpressionValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_1" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_author" Text="Author Name" >
<asp:TextBox ID="packageAuthorName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" EnableClientScript="false"
ControlToValidate="packageAuthorName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_author_url" Text="Author url">
<asp:TextBox ID="packageAuthorUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" EnableClientScript="false"
ControlToValidate="packageAuthorUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_2" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_licens" Text="License Name:">
<asp:TextBox ID="packageLicenseName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" EnableClientScript="false"
ControlToValidate="packageLicenseName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_license_url" Text="License url:">
<asp:TextBox ID="packageLicenseUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" EnableClientScript="false"
ControlToValidate="packageLicenseUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_3" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_readme" Text="Readme">
<asp:TextBox ID="packageReadme" TextMode="MultiLine" Rows="10" Width="460px" CssClass="guiInputText"
runat="server"></asp:TextBox>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_content" Text="Content">
<asp:PlaceHolder ID="content" runat="server"></asp:PlaceHolder>
<br />
<asp:CheckBox ID="packageContentSubdirs" runat="server" />
<asp:Label ID="packageContentSubdirsLabel" Text="Include all child nodes" AssociatedControlID="packageContentSubdirs" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_1" runat="server">
<cc2:PropertyPanel runat="server" Text="Document Types">
<asp:CheckBoxList ID="documentTypes" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_2" runat="server">
<cc2:PropertyPanel runat="server" Text="Templates">
<asp:CheckBoxList ID="templates" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_3" runat="server">
<cc2:PropertyPanel runat="server" Text="Stylesheets">
<asp:CheckBoxList ID="stylesheets" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_4" runat="server">
<cc2:PropertyPanel runat="server" Text="Macros">
<asp:CheckBoxList ID="macros" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_5" runat="server">
<cc2:PropertyPanel runat="server" Text="Languages">
<asp:CheckBoxList ID="languages" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_6" runat="server">
<cc2:PropertyPanel runat="server" Text="Dictionary Items">
<asp:CheckBoxList ID="dictionary" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_7" runat="server">
<cc2:PropertyPanel runat="server" Text="Data types">
<asp:CheckBoxList ID="cbl_datatypes" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane3" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td>
<strong style="color: Red;">Remember:</strong> .ascx files for your macros
will be added automaticly, but you will still need to add <strong>assemblies</strong>,
<strong>images</strong> and <strong>script files</strong> manually to the list below.
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane3_1" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td class="propertyHeader">
Absolute path to file (ie: /bin/umbraco.bin)
</td>
<td class="propertyHeader" />
</tr>
<asp:Repeater ID="packageFilesRepeater" runat="server">
<ItemTemplate>
<tr>
<td class="propertyContent">
<asp:TextBox runat="server" ID="packageFilePath" Enabled="false" Width="330px" CssClass="guiInputText"
Text='<%#DataBinder.Eval(Container, "DataItem")%>' />
</td>
<td class="propertyContent">
<asp:Button OnClick="deleteFileFromPackage" ID="delete" Text="Delete" runat="server"
CssClass="btn btn-danger" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
<tr>
<td class="propertyContent">
<asp:TextBox runat="server" ID="packageFilePathNew" Width="330px" CssClass="guiInputText"
Text='' />
<a href="#" onclick="UmbClientMgr.openModalWindow('developer/packages/directoryBrowser.aspx?target=<%= packageFilePathNew.ClientID %>','Choose a file or a folder', true, 400, 500); return false;"
style="border: none;">
<i class="icon icon-folder"></i>
</a>
</td>
<td class="propertyContent">
<asp:Button ID="createNewFilePath" OnClientClick="addfileJs()" Text="Add" OnClick="addFileToPackage"
runat="server" CssClass="btn" />
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane3_2" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td class="propertyHeader" valign="top">
Load control after installation (ex: /usercontrols/installer.ascx)
</td>
</tr>
<tr>
<td class="propertyContent">
<asp:TextBox ID="packageControlPath" Width="330px" CssClass="guiInputText" runat="server" />
<a href="#" onclick="UmbClientMgr.openModalWindow('developer/packages/directoryBrowser.aspx?target=<%= packageControlPath.ClientID %>','Choose a file or a folder', true, 500, 400); return false;"
style="border: none;">
<i class="icon icon-folder"></i>
</a>
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane4" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td>
<p>
Here you can add custom installer / uninstaller events to perform certain tasks
during installation and uninstallation.
<br />
All actions are formed as a xml node, containing data for the action to be performed.
<a href="https://our.umbraco.org/documentation/Reference/Packaging/
" target="_blank">Package actions documentation</a>
</p>
<asp:CustomValidator ID="actionsVal" runat="server" OnServerValidate="validateActions"
ControlToValidate="tb_actions" ErrorMessage="Actions XML is malformed, either remove the text in the actions field or make sure it is correctly formed XML" />
</td>
</tr>
<tr>
<td class="propertyHeader">
Actions:
</td>
</tr>
<tr>
<td class="propertyContent">
<asp:TextBox ID="tb_actions" TextMode="MultiLine" Rows="14" Width="100%" CssClass="guiInputText"
runat="server"></asp:TextBox>
</td>
</tr>
</table>
</cc2:Pane>
<script type="text/javascript">
jQuery(document).ready(function () {
UmbClientMgr.appActions().bindSaveShortCut();
});
</script>
</asp:Content>

View File

@@ -1,10 +0,0 @@
<%@ Page Language="c#" MasterPageFile="../../masterpages/umbracoPage.Master"
AutoEventWireup="True" Inherits="umbraco.presentation.developer.packages.Installer" Trace="false" ValidateRequest="false" %>
<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc1:UmbracoPanel ID="Panel1" Text="Install package" runat="server" Width="496px" Height="584px">
<cc1:Pane ID="pane_installing" runat="server" Visible="false" Text=""></cc1:Pane>
<cc1:Pane ID="pane_optional" runat="server" Visible="false" />
</cc1:UmbracoPanel>
</asp:Content>

View File

@@ -1,232 +0,0 @@
<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master"
Title="Package and export content" CodeBehind="editPackage.aspx.cs" Inherits="umbraco.presentation.developer.packages._Default" %>
<%@ Register TagPrefix="cc2" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
var updateMethod = "";
var contentOrMediaId = "";
var windowChooser;
var treePickerId = -1;
var prefix;
function addfileJs() {
if (document.getElementById("<%= packageFilePathNew.ClientID %>").value == '') {
alert("Please pick a file by clicking the folder Icon, before clicking the 'add' button");
}
}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc2:TabView ID="TabView1" runat="server" Width="552px" Height="392px"></cc2:TabView>
<cc2:Pane ID="Pane1" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_name" Text="Package Name">
<asp:TextBox ID="packageName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator0" runat="server" EnableClientScript="false"
ControlToValidate="packageName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_url" Text="Package Url">
<asp:TextBox ID="packageUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" EnableClientScript="false"
ControlToValidate="packageUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_version" Text="Package Version">
<asp:TextBox ID="packageVersion" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" EnableClientScript="false"
ControlToValidate="packageVersion">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_icon" Text="Package Icon URL">
<asp:TextBox ID="iconUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_file" Text="Package file (.zip):">
<asp:Literal ID="packageUmbFile" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane5" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_umbracoVersion" Text="Umbraco Target Version">
<asp:TextBox ID="umbracoVersion" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" EnableClientScript="false"
ControlToValidate="umbracoVersion">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="VersionValidator" runat="server" EnableClientScript="false"
ControlToValidate="umbracoVersion" ValidationExpression="^\d+\.\d+\.\d+$">Invalid version number (eg. 7.5.0)</asp:RegularExpressionValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_1" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_author" Text="Author Name" >
<asp:TextBox ID="packageAuthorName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" EnableClientScript="false"
ControlToValidate="packageAuthorName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_author_url" Text="Author url">
<asp:TextBox ID="packageAuthorUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" EnableClientScript="false"
ControlToValidate="packageAuthorUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_2" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_licens" Text="License Name:">
<asp:TextBox ID="packageLicenseName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" EnableClientScript="false"
ControlToValidate="packageLicenseName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_license_url" Text="License url:">
<asp:TextBox ID="packageLicenseUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" EnableClientScript="false"
ControlToValidate="packageLicenseUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_3" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_readme" Text="Readme">
<asp:TextBox ID="packageReadme" TextMode="MultiLine" Rows="10" Width="460px" CssClass="guiInputText"
runat="server"></asp:TextBox>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_content" Text="Content">
<asp:PlaceHolder ID="content" runat="server"></asp:PlaceHolder>
<br />
<asp:CheckBox ID="packageContentSubdirs" runat="server" />
<asp:Label ID="packageContentSubdirsLabel" Text="Include all child nodes" AssociatedControlID="packageContentSubdirs" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_1" runat="server">
<cc2:PropertyPanel runat="server" Text="Document Types">
<asp:CheckBoxList ID="documentTypes" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_2" runat="server">
<cc2:PropertyPanel runat="server" Text="Templates">
<asp:CheckBoxList ID="templates" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_3" runat="server">
<cc2:PropertyPanel runat="server" Text="Stylesheets">
<asp:CheckBoxList ID="stylesheets" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_4" runat="server">
<cc2:PropertyPanel runat="server" Text="Macros">
<asp:CheckBoxList ID="macros" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_5" runat="server">
<cc2:PropertyPanel runat="server" Text="Languages">
<asp:CheckBoxList ID="languages" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_6" runat="server">
<cc2:PropertyPanel runat="server" Text="Dictionary Items">
<asp:CheckBoxList ID="dictionary" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_7" runat="server">
<cc2:PropertyPanel runat="server" Text="Data types">
<asp:CheckBoxList ID="cbl_datatypes" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane3" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td>
<strong style="color: Red;">Remember:</strong> .ascx files for your macros
will be added automaticly, but you will still need to add <strong>assemblies</strong>,
<strong>images</strong> and <strong>script files</strong> manually to the list below.
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane3_1" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td class="propertyHeader">
Absolute path to file (ie: /bin/umbraco.bin)
</td>
<td class="propertyHeader" />
</tr>
<asp:Repeater ID="packageFilesRepeater" runat="server">
<ItemTemplate>
<tr>
<td class="propertyContent">
<asp:TextBox runat="server" ID="packageFilePath" Enabled="false" Width="330px" CssClass="guiInputText"
Text='<%#DataBinder.Eval(Container, "DataItem")%>' />
</td>
<td class="propertyContent">
<asp:Button OnClick="deleteFileFromPackage" ID="delete" Text="Delete" runat="server"
CssClass="btn btn-danger" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
<tr>
<td class="propertyContent">
<asp:TextBox runat="server" ID="packageFilePathNew" Width="330px" CssClass="guiInputText"
Text='' />
<a href="#" onclick="UmbClientMgr.openModalWindow('developer/packages/directoryBrowser.aspx?target=<%= packageFilePathNew.ClientID %>','Choose a file or a folder', true, 400, 500); return false;"
style="border: none;">
<i class="icon icon-folder"></i>
</a>
</td>
<td class="propertyContent">
<asp:Button ID="createNewFilePath" OnClientClick="addfileJs()" Text="Add" OnClick="addFileToPackage"
runat="server" CssClass="btn" />
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane3_2" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td class="propertyHeader" valign="top">
Load control after installation (ex: /usercontrols/installer.ascx)
</td>
</tr>
<tr>
<td class="propertyContent">
<asp:TextBox ID="packageControlPath" Width="330px" CssClass="guiInputText" runat="server" />
<a href="#" onclick="UmbClientMgr.openModalWindow('developer/packages/directoryBrowser.aspx?target=<%= packageControlPath.ClientID %>','Choose a file or a folder', true, 500, 400); return false;"
style="border: none;">
<i class="icon icon-folder"></i>
</a>
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane4" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td>
<p>
Here you can add custom installer / uninstaller events to perform certain tasks
during installation and uninstallation.
<br />
All actions are formed as a xml node, containing data for the action to be performed.
<a href="https://our.umbraco.org/documentation/Reference/Packaging/
" target="_blank">Package actions documentation</a>
</p>
<asp:CustomValidator ID="actionsVal" runat="server" OnServerValidate="validateActions"
ControlToValidate="tb_actions" ErrorMessage="Actions XML is malformed, either remove the text in the actions field or make sure it is correctly formed XML" />
</td>
</tr>
<tr>
<td class="propertyHeader">
Actions:
</td>
</tr>
<tr>
<td class="propertyContent">
<asp:TextBox ID="tb_actions" TextMode="MultiLine" Rows="14" Width="100%" CssClass="guiInputText"
runat="server"></asp:TextBox>
</td>
</tr>
</table>
</cc2:Pane>
<script type="text/javascript">
jQuery(document).ready(function () {
UmbClientMgr.appActions().bindSaveShortCut();
});
</script>
</asp:Content>

View File

@@ -23,57 +23,42 @@ namespace Umbraco.Web.Editors
[UmbracoApplicationAuthorize(Core.Constants.Applications.Packages)]
public class PackageController : UmbracoAuthorizedJsonController
{
public List<PackageDefinition> GetCreatedPackages()
public IEnumerable<PackageDefinition> GetCreatedPackages()
{
return CreatedPackage.GetAllCreatedPackages().Select(x => x.Data).ToList();
return Services.PackagingService.GetAll();
}
public PackageDefinition GetCreatedPackageById(int id)
{
var package = CreatedPackage.GetById(id);
var package = Services.PackagingService.GetById(id);
if (package == null)
throw new HttpResponseException(HttpStatusCode.NotFound);
return package.Data;
return package;
}
public PackageDefinition PostUpdatePackage(PackageDefinition model)
public PackageDefinition GetEmpty()
{
var package = CreatedPackage.GetById(model.Id);
if (package == null)
throw new HttpResponseException(HttpStatusCode.NotFound);
if (ModelState.IsValid == false)
{
//Throw/bubble up errors
throw new HttpResponseException(Request.CreateValidationErrorResponse(ModelState));
}
package.Data = model;
//We should have packagepath populated now
return package.Data;
return new PackageDefinition();
}
public PackageDefinition PostCreatePackage(PackageDefinition model)
/// <summary>
/// Creates or updates a package
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public PackageDefinition PostSavePackage(PackageDefinition model)
{
//creating requires an empty model/package id
if (model.Id != 0 || model.PackageGuid != null)
throw new HttpResponseException(HttpStatusCode.NotFound);
if (ModelState.IsValid == false)
{
//Throw/bubble up errors
throw new HttpResponseException(Request.CreateValidationErrorResponse(ModelState));
}
//save it
Services.PackagingService.SavePackageDefinition(model);
if (!Services.PackagingService.SavePackage(model))
throw new HttpResponseException(Request.CreateNotificationValidationErrorResponse("The package with id {definition.Id} was not found"));
//then publish to get the file
//package.Publish();
//TODO: We need a link to the downloadable zip file, in packagepath ?
Services.PackagingService.ExportPackage(model);
//the packagePath will be on the model
return model;
}
@@ -86,11 +71,7 @@ namespace Umbraco.Web.Editors
[HttpDelete]
public IHttpActionResult DeleteCreatedPackage(int packageId)
{
var package = CreatedPackage.GetById(packageId);
if (package == null)
return NotFound();
package.Delete();
Services.PackagingService.Delete(packageId);
return Ok();
}

View File

@@ -510,7 +510,7 @@ namespace Umbraco.Web.Editors
}
model.TemporaryDirectoryPath = Path.Combine(SystemDirectories.Data, tempPath);
model.Id = ins.CreateManifest(IOHelper.MapPath(model.TemporaryDirectoryPath), model.PackageGuid.ToString(), model.RepositoryGuid.ToString());
model.Id = ins.CreateManifest(IOHelper.MapPath(model.TemporaryDirectoryPath), model.PackageGuid, model.RepositoryGuid.ToString());
return model;
}
@@ -584,6 +584,7 @@ namespace Umbraco.Web.Editors
var redirectUrl = "";
if (ins.Control.IsNullOrWhiteSpace() == false)
{
//fixme: this needs to be replaced with an angular view the installer.aspx no longer exists.
redirectUrl = string.Format("/developer/framed/{0}",
Uri.EscapeDataString(
string.Format("/umbraco/developer/Packages/installer.aspx?installing=custominstaller&dir={0}&pId={1}&customControl={2}&customUrl={3}", tempDir, model.Id, ins.Control, ins.Url)));

View File

@@ -60,7 +60,7 @@ namespace Umbraco.Web.Install.Controllers
var tempFile = installer.Import(packageFile);
installer.LoadConfig(tempFile);
var pId = installer.CreateManifest(tempFile, model.KitGuid.ToString(), RepoGuid);
var pId = installer.CreateManifest(tempFile, model.KitGuid, RepoGuid);
return Json(new
{
success = true,

View File

@@ -68,7 +68,7 @@ namespace Umbraco.Web.Install.InstallSteps
var tempFile = installer.Import(packageFile);
installer.LoadConfig(tempFile);
var pId = installer.CreateManifest(tempFile, kitGuid.ToString(), RepoGuid);
var pId = installer.CreateManifest(tempFile, kitGuid, RepoGuid);
InstallPackageFiles(pId, tempFile);

View File

@@ -1142,10 +1142,7 @@
<Compile Include="_Legacy\PackageActions\removeStringFromTemplate.cs" />
<Compile Include="_Legacy\Packager\data.cs" />
<Compile Include="_Legacy\Packager\Installer.cs" />
<Compile Include="_Legacy\Packager\PackageInstance\CreatedPackage.cs" />
<Compile Include="_Legacy\Packager\PackageInstance\InstalledPackage.cs" />
<Compile Include="_Legacy\Packager\PackageInstance\PackagerUtility.cs" />
<Compile Include="_Legacy\Packager\RequirementsType.cs" />
<Compile Include="_Legacy\Packager\Settings.cs" />
<Compile Include="_Legacy\UI\ITask.cs" />
<Compile Include="_Legacy\UI\ITaskReturnUrl.cs" />
@@ -1236,13 +1233,6 @@
<Compile Include="umbraco.presentation\umbraco\dashboard\FeedProxy.aspx.designer.cs">
<DependentUpon>FeedProxy.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx.cs">
<DependentUpon>editPackage.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx.designer.cs">
<DependentUpon>editPackage.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\templateControls\DisableEventValidation.cs" />
<Compile Include="umbraco.presentation\umbraco\templateControls\Item.cs" />
<Compile Include="umbraco.presentation\umbraco\templateControls\ItemRenderer.cs" />
@@ -1288,9 +1278,6 @@
<!--<Content Include="umbraco.presentation\umbraco\users\PermissionEditor.aspx" />-->
<Content Include="PublishedCache\NuCache\notes.txt" />
<Content Include="umbraco.presentation\umbraco\dashboard\FeedProxy.aspx" />
<Content Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="Web References\org.umbraco.update\checkforupgrade.disco" />

View File

@@ -209,7 +209,7 @@ namespace Umbraco.Web._Legacy.Packager
return Import(inputFile, true);
}
public int CreateManifest(string tempDir, string guid, string repoGuid)
public int CreateManifest(string tempDir, Guid guid, string repoGuid)
{
//This is the new improved install rutine, which chops up the process into 3 steps, creating the manifest, moving files, and finally handling umb objects
var packName = XmlHelper.GetNodeValue(Config.DocumentElement.SelectSingleNode("/umbPackage/info/package/name"));
@@ -243,8 +243,7 @@ namespace Umbraco.Web._Legacy.Packager
insPack.Data.Url = packUrl;
insPack.Data.IconUrl = iconUrl;
insPack.Data.PackageGuid = guid; //the package unique key.
insPack.Data.RepositoryGuid = repoGuid; //the repository unique key, if the package is a file install, the repository will not get logged.
insPack.Data.PackageId = guid; //the package unique key.
insPack.Save();
return insPack.Data.Id;
@@ -324,7 +323,7 @@ namespace Umbraco.Web._Legacy.Packager
{
Current.Services.AuditService.Add(AuditType.PackagerInstall,
_currentUserId,
-1, "Package", string.Format("Package '{0}' installed. Package guid: {1}", insPack.Data.Name, insPack.Data.PackageGuid));
-1, "Package", string.Format("Package '{0}' installed. Package guid: {1}", insPack.Data.Name, insPack.Data.PackageId));
}
insPack.Save();
@@ -373,7 +372,8 @@ namespace Umbraco.Web._Legacy.Packager
if (languageItemsElement != null)
{
var insertedLanguages = packagingService.ImportLanguages(languageItemsElement);
insPack.Data.Languages.AddRange(insertedLanguages.Select(l => l.Id.ToString(CultureInfo.InvariantCulture)));
foreach(var x in insertedLanguages.Select(l => l.Id.ToString(CultureInfo.InvariantCulture)))
insPack.Data.Languages.Add(x);
}
#endregion
@@ -383,7 +383,8 @@ namespace Umbraco.Web._Legacy.Packager
if (dictionaryItemsElement != null)
{
var insertedDictionaryItems = packagingService.ImportDictionaryItems(dictionaryItemsElement);
insPack.Data.DictionaryItems.AddRange(insertedDictionaryItems.Select(d => d.Id.ToString(CultureInfo.InvariantCulture)));
foreach (var x in insertedDictionaryItems.Select(d => d.Id.ToString(CultureInfo.InvariantCulture)))
insPack.Data.DictionaryItems.Add(x);
}
#endregion
@@ -392,7 +393,9 @@ namespace Umbraco.Web._Legacy.Packager
if (macroItemsElement != null)
{
var insertedMacros = packagingService.ImportMacros(macroItemsElement);
insPack.Data.Macros.AddRange(insertedMacros.Select(m => m.Id.ToString(CultureInfo.InvariantCulture)));
foreach (var x in insertedMacros.Select(m => m.Id.ToString(CultureInfo.InvariantCulture)))
insPack.Data.Macros.Add(x);
}
#endregion

View File

@@ -1,387 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using File = System.IO.File;
namespace Umbraco.Web._Legacy.Packager.PackageInstance
{
//TODO: Fix this class , service + model + internal?
public class CreatedPackage
{
public static CreatedPackage GetById(int id)
{
var pack = new CreatedPackage();
pack.Data = data.Package(id, IOHelper.MapPath(Settings.CreatedPackagesSettings));
return pack;
}
public static CreatedPackage MakeNew(string name, Core.Models.Packaging.PackageDefinition packageData = null)
{
var pack = new CreatedPackage
{
Data = packageData ?? data.MakeNew(name, IOHelper.MapPath(Settings.CreatedPackagesSettings))
};
return pack;
}
public void Save()
{
data.Save(this.Data, IOHelper.MapPath(Settings.CreatedPackagesSettings));
}
public void Delete()
{
data.Delete(this.Data.Id, IOHelper.MapPath(Settings.CreatedPackagesSettings));
}
public Core.Models.Packaging.PackageDefinition Data { get; set; }
public static List<CreatedPackage> GetAllCreatedPackages()
{
var val = new List<CreatedPackage>();
foreach (var pack in data.GetAllPackages(IOHelper.MapPath(Settings.CreatedPackagesSettings)))
{
var crPack = new CreatedPackage();
crPack.Data = pack;
val.Add(crPack);
}
return val;
}
private static XmlDocument _packageManifest;
private static void CreatePackageManifest()
{
_packageManifest = new XmlDocument();
var xmldecl = _packageManifest.CreateXmlDeclaration("1.0", "UTF-8", "no");
_packageManifest.AppendChild(xmldecl);
//root node
XmlNode umbPackage = _packageManifest.CreateElement("umbPackage");
_packageManifest.AppendChild(umbPackage);
//Files node
umbPackage.AppendChild(_packageManifest.CreateElement("files"));
}
private static void AppendElement(XmlNode node)
{
var root = _packageManifest.SelectSingleNode("/umbPackage");
root.AppendChild(node);
}
public void Publish(IEntityXmlSerializer serializer)
{
var package = this;
var pack = package.Data;
var outInt = 0;
//Path checking...
var localPath = IOHelper.MapPath(SystemDirectories.Media + "/" + pack.Folder);
if (Directory.Exists(localPath) == false)
Directory.CreateDirectory(localPath);
//Init package file...
CreatePackageManifest();
//Info section..
AppendElement(PackagerUtility.PackageInfo(pack, _packageManifest));
//Documents and tags...
var contentNodeId = 0;
if (string.IsNullOrEmpty(pack.ContentNodeId) == false && int.TryParse(pack.ContentNodeId, out contentNodeId))
{
if (contentNodeId > 0)
{
//Create the Documents/DocumentSet node
XmlNode documents = _packageManifest.CreateElement("Documents");
XmlNode documentSet = _packageManifest.CreateElement("DocumentSet");
XmlAttribute importMode = _packageManifest.CreateAttribute("importMode", "");
importMode.Value = "root";
documentSet.Attributes.Append(importMode);
documents.AppendChild(documentSet);
//load content from umbraco.
//var umbDocument = new Document(contentNodeId);
//var x = umbDocument.ToXml(_packageManifest, pack.ContentLoadChildNodes);
var udoc = Current.Services.ContentService.GetById(contentNodeId);
var xe = pack.ContentLoadChildNodes ? udoc.ToDeepXml(serializer) : udoc.ToXml(serializer);
var x = xe.GetXmlNode(_packageManifest);
documentSet.AppendChild(x);
AppendElement(documents);
////Create the TagProperties node - this is used to store a definition for all
//// document properties that are tags, this ensures that we can re-import tags properly
//XmlNode tagProps = _packageManifest.CreateElement("TagProperties");
////before we try to populate this, we'll do a quick lookup to see if any of the documents
//// being exported contain published tags.
//var allExportedIds = documents.SelectNodes("//@id").Cast<XmlNode>()
// .Select(x => x.Value.TryConvertTo<int>())
// .Where(x => x.Success)
// .Select(x => x.Result)
// .ToArray();
//var allContentTags = new List<ITag>();
//foreach (var exportedId in allExportedIds)
//{
// allContentTags.AddRange(
// Current.Services.TagService.GetTagsForEntity(exportedId));
//}
////This is pretty round-about but it works. Essentially we need to get the properties that are tagged
//// but to do that we need to lookup by a tag (string)
//var allTaggedEntities = new List<TaggedEntity>();
//foreach (var group in allContentTags.Select(x => x.Group).Distinct())
//{
// allTaggedEntities.AddRange(
// Current.Services.TagService.GetTaggedContentByTagGroup(group));
//}
////Now, we have all property Ids/Aliases and their referenced document Ids and tags
//var allExportedTaggedEntities = allTaggedEntities.Where(x => allExportedIds.Contains(x.EntityId))
// .DistinctBy(x => x.EntityId)
// .OrderBy(x => x.EntityId);
//foreach (var taggedEntity in allExportedTaggedEntities)
//{
// foreach (var taggedProperty in taggedEntity.TaggedProperties.Where(x => x.Tags.Any()))
// {
// XmlNode tagProp = _packageManifest.CreateElement("TagProperty");
// var docId = _packageManifest.CreateAttribute("docId", "");
// docId.Value = taggedEntity.EntityId.ToString(CultureInfo.InvariantCulture);
// tagProp.Attributes.Append(docId);
// var propertyAlias = _packageManifest.CreateAttribute("propertyAlias", "");
// propertyAlias.Value = taggedProperty.PropertyTypeAlias;
// tagProp.Attributes.Append(propertyAlias);
// var group = _packageManifest.CreateAttribute("group", "");
// group.Value = taggedProperty.Tags.First().Group;
// tagProp.Attributes.Append(group);
// tagProp.AppendChild(_packageManifest.CreateCDataSection(
// JsonConvert.SerializeObject(taggedProperty.Tags.Select(x => x.Text).ToArray())));
// tagProps.AppendChild(tagProp);
// }
//}
//AppendElement(tagProps);
}
}
//Document types..
var dtl = new List<IContentType>();
var docTypes = _packageManifest.CreateElement("DocumentTypes");
foreach (var dtId in pack.DocumentTypes)
{
if (int.TryParse(dtId, out outInt))
{
var docT = Current.Services.ContentTypeService.Get(outInt);
//DocumentType docT = new DocumentType(outInt);
AddDocumentType(docT, ref dtl);
}
}
foreach (var d in dtl)
{
var xml = serializer.Serialize(d);
var xNode = xml.GetXmlNode();
var n = (XmlElement) _packageManifest.ImportNode(xNode, true);
docTypes.AppendChild(n);
}
AppendElement(docTypes);
//Templates
var templates = _packageManifest.CreateElement("Templates");
foreach (var templateId in pack.Templates)
{
if (int.TryParse(templateId, out outInt))
{
var t = Current.Services.FileService.GetTemplate(outInt);
var serialized = serializer.Serialize(t);
var n = serialized.GetXmlNode(_packageManifest);
templates.AppendChild(n);
}
}
AppendElement(templates);
//Stylesheets
var stylesheets = _packageManifest.CreateElement("Stylesheets");
foreach (var stylesheetName in pack.Stylesheets)
{
if (stylesheetName.IsNullOrWhiteSpace()) continue;
var stylesheetXmlNode = PackagerUtility.Stylesheet(stylesheetName, true, _packageManifest);
if (stylesheetXmlNode != null)
stylesheets.AppendChild(stylesheetXmlNode);
}
AppendElement(stylesheets);
////Macros
//var macros = _packageManifest.CreateElement("Macros");
//foreach (var macroId in pack.Macros)
//{
// if (int.TryParse(macroId, out outInt))
// {
// macros.AppendChild(PackagerUtility.Macro(int.Parse(macroId), true, localPath, _packageManifest));
// }
//}
//AppendElement(macros);
//Dictionary Items
var dictionaryItems = _packageManifest.CreateElement("DictionaryItems");
foreach (var dictionaryId in pack.DictionaryItems)
{
if (int.TryParse(dictionaryId, out outInt))
{
var di = Current.Services.LocalizationService.GetDictionaryItemById(outInt);
var xmlNode = serializer.Serialize(di, false).GetXmlNode(_packageManifest);
dictionaryItems.AppendChild(xmlNode);
}
}
AppendElement(dictionaryItems);
//Languages
var languages = _packageManifest.CreateElement("Languages");
foreach (var langId in pack.Languages)
{
if (int.TryParse(langId, out outInt))
{
var lang = Current.Services.LocalizationService.GetLanguageById(outInt);
var xml = serializer.Serialize(lang);
var n = xml.GetXmlNode(_packageManifest);
languages.AppendChild(n);
}
}
AppendElement(languages);
//TODO: Fix this! ... actually once we use the new packager we don't need to
////Datatypes
//var dataTypes = _packageManifest.CreateElement("DataTypes");
//foreach (var dtId in pack.DataTypes)
//{
// if (int.TryParse(dtId, out outInt))
// {
// datatype.DataTypeDefinition dtd = new datatype.DataTypeDefinition(outInt);
// dataTypes.AppendChild(dtd.ToXml(_packageManifest));
// }
//}
//AppendElement(dataTypes);
//Files
foreach (var fileName in pack.Files)
{
PackagerUtility.AppendFileToManifest(fileName, localPath, _packageManifest);
}
//Load control on install...
if (string.IsNullOrEmpty(pack.LoadControl) == false)
{
XmlNode control = _packageManifest.CreateElement("control");
control.InnerText = pack.LoadControl;
PackagerUtility.AppendFileToManifest(pack.LoadControl, localPath, _packageManifest);
AppendElement(control);
}
//Actions
if (string.IsNullOrEmpty(pack.Actions) == false)
{
try
{
var xdActions = new XmlDocument();
xdActions.LoadXml("<Actions>" + pack.Actions + "</Actions>");
var actions = xdActions.DocumentElement.SelectSingleNode(".");
if (actions != null)
{
actions = _packageManifest.ImportNode(actions, true).Clone();
AppendElement(actions);
}
}
catch
{
//TODO: Log!?
}
}
var manifestFileName = localPath + "/package.xml";
if (File.Exists(manifestFileName))
File.Delete(manifestFileName);
_packageManifest.Save(manifestFileName);
_packageManifest = null;
//string packPath = Settings.PackagerRoot.Replace(System.IO.Path.DirectorySeparatorChar.ToString(), "/") + "/" + pack.Name.Replace(' ', '_') + "_" + pack.Version.Replace(' ', '_') + "." + Settings.PackageFileExtension;
// check if there's a packages directory below media
var packagesDirectory = SystemDirectories.Media + "/created-packages";
if (Directory.Exists(IOHelper.MapPath(packagesDirectory)) == false)
{
Directory.CreateDirectory(IOHelper.MapPath(packagesDirectory));
}
var packPath = packagesDirectory + "/" + (pack.Name + "_" + pack.Version).Replace(' ', '_') + "." + Settings.PackageFileExtension;
PackagerUtility.ZipPackage(localPath, IOHelper.MapPath(packPath));
pack.PackagePath = packPath;
if (pack.PackageGuid.Trim() == "")
pack.PackageGuid = Guid.NewGuid().ToString();
package.Save();
//Clean up..
File.Delete(localPath + "/package.xml");
Directory.Delete(localPath, true);
}
private void AddDocumentType(IContentType dt, ref List<IContentType> dtl)
{
if (dt.ParentId > 0)
{
var parent = Current.Services.ContentTypeService.Get(dt.ParentId);
if (parent != null) // could be a container
{
AddDocumentType(parent, ref dtl);
}
}
if (dtl.Contains(dt) == false)
{
dtl.Add(dt);
}
}
}
}

View File

@@ -72,7 +72,7 @@ namespace Umbraco.Web._Legacy.Packager.PackageInstance
public void Delete(int userId)
{
Current.Services.AuditService.Add(AuditType.PackagerUninstall, userId, -1, "Package", string.Format("Package '{0}' uninstalled. Package guid: {1}", Data.Name, Data.PackageGuid));
Current.Services.AuditService.Add(AuditType.PackagerUninstall, userId, -1, "Package", string.Format("Package '{0}' uninstalled. Package guid: {1}", Data.Name, Data.PackageId));
Delete();
}

View File

@@ -1,279 +0,0 @@
using System;
using System.Collections;
using System.IO;
using System.Xml;
using ICSharpCode.SharpZipLib.Zip;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
namespace Umbraco.Web._Legacy.Packager.PackageInstance
{
/// <summary>
/// A utillity class for working with packager data.
/// It provides basic methods for adding new items to a package manifest, moving files and other misc.
/// </summary>
public class PackagerUtility
{
/// <summary>
/// Creates a package manifest containing name, license, version and other meta data.
/// </summary>
/// <param name="pack">The packinstance.</param>
/// <param name="doc">The xml document.</param>
/// <returns></returns>
public static XmlNode PackageInfo(Core.Models.Packaging.PackageDefinition pack, XmlDocument doc)
{
XmlNode info = doc.CreateElement("info");
//Package info
XmlNode package = doc.CreateElement("package");
package.AppendChild(CreateNode("name", pack.Name, doc));
package.AppendChild(CreateNode("version", pack.Version, doc));
package.AppendChild(CreateNode("iconUrl", pack.IconUrl, doc));
XmlNode license = CreateNode("license", pack.License, doc);
license.Attributes.Append(CreateAttribute("url", pack.LicenseUrl, doc));
package.AppendChild(license);
package.AppendChild(CreateNode("url", pack.Url, doc));
XmlNode requirements = doc.CreateElement("requirements");
//NOTE: The defaults are 3.0.0 - I'm just leaving that here since that's the way it's been //SD
requirements.AppendChild(CreateNode("major", pack.UmbracoVersion == null ? "3" : pack.UmbracoVersion.Major.ToInvariantString(), doc));
requirements.AppendChild(CreateNode("minor", pack.UmbracoVersion == null ? "0" : pack.UmbracoVersion.Minor.ToInvariantString(), doc));
requirements.AppendChild(CreateNode("patch", pack.UmbracoVersion == null ? "0" : pack.UmbracoVersion.Build.ToInvariantString(), doc));
if (pack.UmbracoVersion != null)
requirements.Attributes.Append(CreateAttribute("type", "strict", doc));
package.AppendChild(requirements);
info.AppendChild(package);
//Author
XmlNode author = CreateNode("author", "", doc);
author.AppendChild(CreateNode("name", pack.Author, doc));
author.AppendChild(CreateNode("website", pack.AuthorUrl, doc));
info.AppendChild(author);
info.AppendChild(CreateNode("readme", "<![CDATA[" + pack.Readme + "]]>", doc));
return info;
}
/// <summary>
/// Converts a umbraco stylesheet to a package xml node
/// </summary>
/// <param name="name">The name of the stylesheet.</param>
/// <param name="includeProperties">if set to <c>true</c> [incluce properties].</param>
/// <param name="doc">The doc.</param>
/// <returns></returns>
public static XmlNode Stylesheet(string name, bool includeProperties, XmlDocument doc)
{
if (doc == null) throw new ArgumentNullException("doc");
if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Value cannot be null or whitespace.", "name");
var fileService = Current.Services.FileService;
var sts = fileService.GetStylesheetByName(name);
var stylesheet = doc.CreateElement("Stylesheet");
stylesheet.AppendChild(CreateNode("Name", sts.Alias, doc));
stylesheet.AppendChild(CreateNode("FileName", sts.Name, doc));
stylesheet.AppendChild(CreateNode("Content", "<![CDATA[" + sts.Content + "]]>", doc));
if (includeProperties)
{
var properties = doc.CreateElement("Properties");
foreach (var ssP in sts.Properties)
{
var property = doc.CreateElement("Property");
property.AppendChild(CreateNode("Name", ssP.Name, doc));
property.AppendChild(CreateNode("Alias", ssP.Alias, doc));
property.AppendChild(CreateNode("Value", ssP.Value, doc));
}
stylesheet.AppendChild(properties);
}
return stylesheet;
}
/// <summary>
/// Appends a file to package manifest and copies the file to the correct folder.
/// </summary>
/// <param name="path">The path.</param>
/// <param name="packageDirectory">The package directory.</param>
/// <param name="doc">The doc.</param>
public static void AppendFileToManifest(string path, string packageDirectory, XmlDocument doc)
{
if (!path.StartsWith("~/") && !path.StartsWith("/"))
path = "~/" + path;
string serverPath = IOHelper.MapPath(path);
if (System.IO.File.Exists(serverPath))
AppendFileXml(path, packageDirectory, doc);
else if (System.IO.Directory.Exists(serverPath))
ProcessDirectory(path, packageDirectory, doc);
}
//Process files in directory and add them to package
private static void ProcessDirectory(string path, string packageDirectory, XmlDocument doc)
{
string serverPath = IOHelper.MapPath(path);
if (System.IO.Directory.Exists(serverPath))
{
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(serverPath);
foreach (System.IO.FileInfo file in di.GetFiles())
AppendFileXml(path + "/" + file.Name, packageDirectory, doc);
foreach (System.IO.DirectoryInfo dir in di.GetDirectories())
ProcessDirectory(path + "/" + dir.Name, packageDirectory, doc);
}
}
private static void AppendFileXml(string path, string packageDirectory, XmlDocument doc)
{
string serverPath = IOHelper.MapPath(path);
string orgPath = path.Substring(0, (path.LastIndexOf('/')));
string orgName = path.Substring((path.LastIndexOf('/') + 1));
string newFileName = orgName;
if (System.IO.File.Exists(packageDirectory + "/" + orgName))
{
string fileGuid = System.Guid.NewGuid().ToString();
newFileName = fileGuid + "_" + newFileName;
}
//Copy file to directory for zipping...
System.IO.File.Copy(serverPath, packageDirectory + "/" + newFileName, true);
//Append file info to files xml node
XmlNode files = doc.SelectSingleNode("/umbPackage/files");
XmlNode file = doc.CreateElement("file");
file.AppendChild(CreateNode("guid", newFileName, doc));
file.AppendChild(CreateNode("orgPath", orgPath == "" ? "/" : orgPath, doc));
file.AppendChild(CreateNode("orgName", orgName, doc));
files.AppendChild(file);
}
/// <summary>
/// Determines whether the file is in the package manifest
/// </summary>
/// <param name="guid">The GUID.</param>
/// <param name="doc">The doc.</param>
/// <returns>
/// <c>true</c> if [is file in manifest]; otherwise, <c>false</c>.
/// </returns>
public static bool IsFileInManifest(string guid, XmlDocument doc)
{
return false;
}
private static XmlNode CreateNode(string name, string value, XmlDocument doc)
{
var node = doc.CreateElement(name);
node.InnerXml = value;
return node;
}
private static XmlAttribute CreateAttribute(string name, string value, XmlDocument doc)
{
var attribute = doc.CreateAttribute(name);
attribute.Value = value;
return attribute;
}
/// <summary>
/// Zips the package.
/// </summary>
/// <param name="Path">The path.</param>
/// <param name="savePath">The save path.</param>
public static void ZipPackage(string Path, string savePath)
{
string OutPath = savePath;
ArrayList ar = GenerateFileList(Path);
// generate file list
// find number of chars to remove from orginal file path
int TrimLength = (Directory.GetParent(Path)).ToString().Length;
TrimLength += 1;
//remove '\'
FileStream ostream;
byte[] obuffer;
ZipOutputStream oZipStream = new ZipOutputStream(System.IO.File.Create(OutPath));
// create zip stream
oZipStream.SetLevel(9);
// 9 = maximum compression level
ZipEntry oZipEntry;
foreach (string Fil in ar) // for each file, generate a zipentry
{
oZipEntry = new ZipEntry(Fil.Remove(0, TrimLength));
oZipStream.PutNextEntry(oZipEntry);
if (!Fil.EndsWith(@"/")) // if a file ends with '/' its a directory
{
ostream = File.OpenRead(Fil);
obuffer = new byte[ostream.Length];
// byte buffer
ostream.Read(obuffer, 0, obuffer.Length);
oZipStream.Write(obuffer, 0, obuffer.Length);
ostream.Close();
}
}
oZipStream.Finish();
oZipStream.Close();
oZipStream.Dispose();
oZipStream = null;
oZipEntry = null;
ostream = null;
ar.Clear();
ar = null;
}
private static ArrayList GenerateFileList(string Dir)
{
ArrayList mid = new ArrayList();
bool Empty = true;
// add each file in directory
foreach (string file in Directory.GetFiles(Dir))
{
mid.Add(file);
Empty = false;
}
// if directory is completely empty, add it
if (Empty && Directory.GetDirectories(Dir).Length == 0)
mid.Add(Dir + @"/");
// do this recursively
foreach (string dirs in Directory.GetDirectories(Dir))
{
foreach (object obj in GenerateFileList(dirs))
mid.Add(obj);
}
return mid; // return file list
}
}
}

View File

@@ -8,10 +8,6 @@ namespace Umbraco.Web._Legacy.Packager
{
public static string InstalledPackagesSettings => SystemDirectories.Packages + IOHelper.DirSepChar + "installedPackages.config";
public static string CreatedPackagesSettings => SystemDirectories.Packages + IOHelper.DirSepChar + "createdPackages.config";
public static string PackageFileExtension => "zip";
}
}

View File

@@ -95,7 +95,7 @@ namespace Umbraco.Web._Legacy.Packager
instance.Attributes.Append(XmlHelper.AddAttribute(Source, "url", ""));
instance.Attributes.Append(XmlHelper.AddAttribute(Source, "name", name));
instance.Attributes.Append(XmlHelper.AddAttribute(Source, "folder", Guid.NewGuid().ToString()));
instance.Attributes.Append(XmlHelper.AddAttribute(Source, "packagepath", ""));
instance.Attributes.Append(XmlHelper.AddAttribute(Source, "packagePath", ""));
instance.Attributes.Append(XmlHelper.AddAttribute(Source, "repositoryGuid", ""));
instance.Attributes.Append(XmlHelper.AddAttribute(Source, "iconUrl", ""));
//set to current version
@@ -187,13 +187,11 @@ namespace Umbraco.Web._Legacy.Packager
{
retVal.Id = int.Parse(SafeAttribute("id", n));
retVal.Name = SafeAttribute("name", n);
retVal.Folder = SafeAttribute("folder", n);
retVal.PackagePath = SafeAttribute("packagepath", n);
retVal.FolderId = Guid.Parse(SafeAttribute("folder", n));
retVal.PackagePath = SafeAttribute("packagePath", n);
retVal.Version = SafeAttribute("version", n);
retVal.Url = SafeAttribute("url", n);
retVal.RepositoryGuid = SafeAttribute("repositoryGuid", n);
retVal.PackageGuid = SafeAttribute("packageGuid", n);
retVal.HasUpdate = bool.Parse(SafeAttribute("hasUpdate", n));
retVal.PackageId = Guid.Parse(SafeAttribute("packageGuid", n));
retVal.IconUrl = SafeAttribute("iconUrl", n);
var umbVersion = SafeAttribute("umbVersion", n);
@@ -262,10 +260,8 @@ namespace Umbraco.Web._Legacy.Packager
XmlHelper.SetAttribute(Source, xmlDef, "name", package.Name);
XmlHelper.SetAttribute(Source, xmlDef, "version", package.Version);
XmlHelper.SetAttribute(Source, xmlDef, "url", package.Url);
XmlHelper.SetAttribute(Source, xmlDef, "packagepath", package.PackagePath);
XmlHelper.SetAttribute(Source, xmlDef, "repositoryGuid", package.RepositoryGuid);
XmlHelper.SetAttribute(Source, xmlDef, "packageGuid", package.PackageGuid);
XmlHelper.SetAttribute(Source, xmlDef, "hasUpdate", package.HasUpdate.ToString());
XmlHelper.SetAttribute(Source, xmlDef, "packagePath", package.PackagePath);
XmlHelper.SetAttribute(Source, xmlDef, "packageGuid", package.PackageId.ToString());
XmlHelper.SetAttribute(Source, xmlDef, "iconUrl", package.IconUrl);
if (package.UmbracoVersion != null)
XmlHelper.SetAttribute(Source, xmlDef, "umbVersion", package.UmbracoVersion.ToString(3));
@@ -359,7 +355,7 @@ namespace Umbraco.Web._Legacy.Packager
}
private static string JoinList(List<string> list, char seperator)
private static string JoinList(IList<string> list, char seperator)
{
string retVal = "";
foreach (string str in list)

View File

@@ -1,232 +0,0 @@
<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master"
Title="Package and export content" CodeBehind="editPackage.aspx.cs" Inherits="umbraco.presentation.developer.packages._Default" %>
<%@ Register TagPrefix="cc2" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
var updateMethod = "";
var contentOrMediaId = "";
var windowChooser;
var treePickerId = -1;
var prefix;
function addfileJs() {
if (document.getElementById("<%= packageFilePathNew.ClientID %>").value == '') {
alert("Please pick a file by clicking the folder Icon, before clicking the 'add' button");
}
}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc2:TabView ID="TabView1" runat="server" Width="552px" Height="392px"></cc2:TabView>
<cc2:Pane ID="Pane1" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_name" Text="Package Name">
<asp:TextBox ID="packageName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator0" runat="server" EnableClientScript="false"
ControlToValidate="packageName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_url" Text="Package Url">
<asp:TextBox ID="packageUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" EnableClientScript="false"
ControlToValidate="packageUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_version" Text="Package Version">
<asp:TextBox ID="packageVersion" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" EnableClientScript="false"
ControlToValidate="packageVersion">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_icon" Text="Package Icon URL">
<asp:TextBox ID="iconUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_file" Text="Package file (.zip):">
<asp:Literal ID="packageUmbFile" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane5" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_umbracoVersion" Text="Umbraco Target Version">
<asp:TextBox ID="umbracoVersion" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" EnableClientScript="false"
ControlToValidate="umbracoVersion">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="VersionValidator" runat="server" EnableClientScript="false"
ControlToValidate="umbracoVersion" ValidationExpression="^\d+\.\d+\.\d+$">Invalid version number (eg. 7.5.0)</asp:RegularExpressionValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_1" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_author" Text="Author Name" >
<asp:TextBox ID="packageAuthorName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" EnableClientScript="false"
ControlToValidate="packageAuthorName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_author_url" Text="Author url">
<asp:TextBox ID="packageAuthorUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" EnableClientScript="false"
ControlToValidate="packageAuthorUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_2" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_licens" Text="License Name:">
<asp:TextBox ID="packageLicenseName" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" EnableClientScript="false"
ControlToValidate="packageLicenseName">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
<cc2:PropertyPanel runat="server" ID="pp_license_url" Text="License url:">
<asp:TextBox ID="packageLicenseUrl" runat="server" Width="230px" CssClass="guiInputText"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" EnableClientScript="false"
ControlToValidate="packageLicenseUrl">*</asp:RequiredFieldValidator>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane1_3" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_readme" Text="Readme">
<asp:TextBox ID="packageReadme" TextMode="MultiLine" Rows="10" Width="460px" CssClass="guiInputText"
runat="server"></asp:TextBox>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2" runat="server">
<cc2:PropertyPanel runat="server" ID="pp_content" Text="Content">
<asp:PlaceHolder ID="content" runat="server"></asp:PlaceHolder>
<br />
<asp:CheckBox ID="packageContentSubdirs" runat="server" />
<asp:Label ID="packageContentSubdirsLabel" Text="Include all child nodes" AssociatedControlID="packageContentSubdirs" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_1" runat="server">
<cc2:PropertyPanel runat="server" Text="Document Types">
<asp:CheckBoxList ID="documentTypes" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_2" runat="server">
<cc2:PropertyPanel runat="server" Text="Templates">
<asp:CheckBoxList ID="templates" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_3" runat="server">
<cc2:PropertyPanel runat="server" Text="Stylesheets">
<asp:CheckBoxList ID="stylesheets" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_4" runat="server">
<cc2:PropertyPanel runat="server" Text="Macros">
<asp:CheckBoxList ID="macros" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_5" runat="server">
<cc2:PropertyPanel runat="server" Text="Languages">
<asp:CheckBoxList ID="languages" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_6" runat="server">
<cc2:PropertyPanel runat="server" Text="Dictionary Items">
<asp:CheckBoxList ID="dictionary" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane2_7" runat="server">
<cc2:PropertyPanel runat="server" Text="Data types">
<asp:CheckBoxList ID="cbl_datatypes" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="Pane3" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td>
<strong style="color: Red;">Remember:</strong> .xslt and .ascx files for your macros
will be added automaticly, but you will still need to add <strong>assemblies</strong>,
<strong>images</strong> and <strong>script files</strong> manually to the list below.
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane3_1" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td class="propertyHeader">
Absolute path to file (ie: /bin/umbraco.bin)
</td>
<td class="propertyHeader" />
</tr>
<asp:Repeater ID="packageFilesRepeater" runat="server">
<ItemTemplate>
<tr>
<td class="propertyContent">
<asp:TextBox runat="server" ID="packageFilePath" Enabled="false" Width="330px" CssClass="guiInputText"
Text='<%#DataBinder.Eval(Container, "DataItem")%>' />
</td>
<td class="propertyContent">
<asp:Button OnClick="deleteFileFromPackage" ID="delete" Text="Delete" runat="server"
CssClass="btn btn-danger" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
<tr>
<td class="propertyContent">
<asp:TextBox runat="server" ID="packageFilePathNew" Width="330px" CssClass="guiInputText"
Text='' />
<a href="#" onclick="UmbClientMgr.openModalWindow('developer/packages/directoryBrowser.aspx?target=<%= packageFilePathNew.ClientID %>','Choose a file or a folder', true, 400, 500); return false;"
style="border: none;">
<i class="icon icon-folder"></i>
</a>
</td>
<td class="propertyContent">
<asp:Button ID="createNewFilePath" OnClientClick="addfileJs()" Text="Add" OnClick="addFileToPackage"
runat="server" CssClass="btn" />
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane3_2" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td class="propertyHeader" valign="top">
Load control after installation (ex: /usercontrols/installer.ascx)
</td>
</tr>
<tr>
<td class="propertyContent">
<asp:TextBox ID="packageControlPath" Width="330px" CssClass="guiInputText" runat="server" />
<a href="#" onclick="UmbClientMgr.openModalWindow('developer/packages/directoryBrowser.aspx?target=<%= packageControlPath.ClientID %>','Choose a file or a folder', true, 500, 400); return false;"
style="border: none;">
<i class="icon icon-folder"></i>
</a>
</td>
</tr>
</table>
</cc2:Pane>
<cc2:Pane ID="Pane4" runat="server">
<table border="0" style="width: 100%;">
<tr>
<td>
<p>
Here you can add custom installer / uninstaller events to perform certain tasks
during installation and uninstallation.
<br />
All actions are formed as a xml node, containing data for the action to be performed.
<a href="https://our.umbraco.com/documentation/Reference/Packaging/
" target="_blank">Package actions documentation</a>
</p>
<asp:CustomValidator ID="actionsVal" runat="server" OnServerValidate="validateActions"
ControlToValidate="tb_actions" ErrorMessage="Actions XML is malformed, either remove the text in the actions field or make sure it is correctly formed XML" />
</td>
</tr>
<tr>
<td class="propertyHeader">
Actions:
</td>
</tr>
<tr>
<td class="propertyContent">
<asp:TextBox ID="tb_actions" TextMode="MultiLine" Rows="14" Width="100%" CssClass="guiInputText"
runat="server"></asp:TextBox>
</td>
</tr>
</table>
</cc2:Pane>
<script type="text/javascript">
jQuery(document).ready(function () {
UmbClientMgr.appActions().bindSaveShortCut();
});
</script>
</asp:Content>

View File

@@ -1,453 +0,0 @@
using Umbraco.Core.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using umbraco.controls;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Models.Packaging;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.UI;
using Umbraco.Web.UI.Pages;
using Umbraco.Web._Legacy.Packager.PackageInstance;
namespace umbraco.presentation.developer.packages
{
public partial class _Default : UmbracoEnsuredPage
{
public _Default()
{
CurrentApp = Constants.Applications.Packages.ToString();
}
public Umbraco.Web._Legacy.Controls.TabPage packageInfo;
public Umbraco.Web._Legacy.Controls.TabPage packageContents;
public Umbraco.Web._Legacy.Controls.TabPage packageFiles;
public Umbraco.Web._Legacy.Controls.TabPage packageOutput;
public Umbraco.Web._Legacy.Controls.TabPage packageAbout;
public Umbraco.Web._Legacy.Controls.TabPage packageActions;
protected ContentPicker cp;
private PackageDefinition pack;
private CreatedPackage createdPackage;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["id"] != null)
{
createdPackage = CreatedPackage.GetById(int.Parse(Request.QueryString["id"]));
pack = createdPackage.Data;
/* CONTENT */
cp = new ContentPicker();
content.Controls.Add(cp);
if (string.IsNullOrEmpty(pack.PackagePath) == false)
{
packageUmbFile.Text = " &nbsp; <a href='" + Page.ResolveClientUrl(pack.PackagePath) + "'>Download</a>";
}
else
{
packageUmbFile.Text = "<em>This package is not published</em>";
}
if (Page.IsPostBack == false)
{
ClientTools
.SyncTree("-1,created," + createdPackage.Data.Id, false);
packageAuthorName.Text = pack.Author;
packageAuthorUrl.Text = pack.AuthorUrl;
packageLicenseName.Text = pack.License;
packageLicenseUrl.Text = pack.LicenseUrl;
packageName.Text = pack.Name;
packageReadme.Text = pack.Readme;
packageVersion.Text = pack.Version;
packageUrl.Text = pack.Url;
iconUrl.Text = pack.IconUrl;
umbracoVersion.Text = pack.UmbracoVersion != null ? pack.UmbracoVersion.ToString(3) : string.Empty;
/*ACTIONS XML*/
tb_actions.Text = pack.Actions;
cp.Value = pack.ContentNodeId.ToString();
//startNode.Value = pack.ContentNodeId.ToString();
packageContentSubdirs.Checked = pack.ContentLoadChildNodes;
/*TEMPLATES */
var nTemplates = Services.FileService.GetTemplates();
//Template[] umbTemplates = Template.GetAllAsList().ToArray();
foreach (var tmp in nTemplates)
{
ListItem li = new ListItem(tmp.Name, tmp.Id.ToString());
if (pack.Templates.Contains(tmp.Id.ToString()))
li.Selected = true;
templates.Items.Add(li);
}
/* DOC TYPES */
// fixme - media types? member types?
var nContentTypes = Services.ContentTypeService.GetAll();
//DocumentType[] docs = DocumentType.GetAllAsList().ToArray();
foreach (var dc in nContentTypes)
{
ListItem li = new ListItem(dc.Name, dc.Id.ToString());
if (pack.DocumentTypes.Contains(dc.Id.ToString()))
li.Selected = true;
documentTypes.Items.Add(li);
}
/*Stylesheets */
var sheets = Services.FileService.GetStylesheets();
foreach (var st in sheets)
{
if (string.IsNullOrEmpty(st.Name) == false)
{
var li = new ListItem(st.Alias, st.Name);
if (pack.Stylesheets.Contains(st.Name))
li.Selected = true;
stylesheets.Items.Add(li);
}
}
/* MACROS */
var nMacros = Services.MacroService.GetAll();
//Macro[] umbMacros = Macro.GetAll();
foreach (var m in nMacros)
{
ListItem li = new ListItem(m.Name, m.Id.ToString());
if (pack.Macros.Contains(m.Id.ToString()))
li.Selected = true;
macros.Items.Add(li);
}
/*Langauges */
var nLanguages = Services.LocalizationService.GetAllLanguages();
//Language[] umbLanguages = Language.getAll;
foreach (var l in nLanguages)
{
ListItem li = new ListItem(l.CultureName, l.Id.ToString());
if (pack.Languages.Contains(l.Id.ToString()))
li.Selected = true;
languages.Items.Add(li);
}
/*Dictionary Items*/
var umbDictionary = Services.LocalizationService.GetRootDictionaryItems();
foreach (var d in umbDictionary)
{
string liName = d.ItemKey;
var children = Services.LocalizationService.GetDictionaryItemChildren(d.Key);
if (children.Any())
liName += " <small>(Including all child items)</small>";
var li = new ListItem(liName, d.Id.ToString());
if (pack.DictionaryItems.Contains(d.Id.ToString()))
li.Selected = true;
dictionary.Items.Add(li);
}
//TODO: Fix this with the new services and apis! and then remove since this should all be in angular
///*Data types */
//cms.businesslogic.datatype.DataTypeDefinition[] umbDataType = cms.businesslogic.datatype.DataTypeDefinition.GetAll();
// sort array by name
//Array.Sort(umbDataType, delegate(cms.businesslogic.datatype.DataTypeDefinition umbDataType1, cms.businesslogic.datatype.DataTypeDefinition umbDataType2)
//{
// return umbDataType1.Text.CompareTo(umbDataType2.Text);
//});
//foreach (cms.businesslogic.datatype.DataTypeDefinition umbDtd in umbDataType)
//{
// ListItem li = new ListItem(umbDtd.Text, umbDtd.Id.ToString());
// if (pack.DataTypes.Contains(umbDtd.Id.ToString()))
// li.Selected = true;
// cbl_datatypes.Items.Add(li);
//}
/* FILES */
packageFilesRepeater.DataSource = pack.Files;
packageFilesRepeater.DataBind();
packageControlPath.Text = pack.LoadControl;
}
else
{
ClientTools
.SyncTree("-1,created," + createdPackage.Data.Id, true);
}
}
}
protected void validateActions(object sender, ServerValidateEventArgs e)
{
string actions = tb_actions.Text;
if (!string.IsNullOrEmpty(actions))
{
actions = "<Actions>" + actions + "</Actions>";
try
{
//we try to load an xml document with the potential malformed xml to ensure that this is actual action xml...
XmlDocument xd = new XmlDocument();
xd.LoadXml(actions);
e.IsValid = true;
}
catch
{
e.IsValid = false;
}
}
else
e.IsValid = true;
}
//protected void saveOrPublish(object sender, CommandEventArgs e)
//{
// if (!Page.IsValid)
// {
// this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, "Saved failed.", "Some fields have not been filled-out correctly");
// }
// else
// {
// if (e.CommandName == "save")
// SavePackage(true);
// if (e.CommandName == "publish")
// {
// SavePackage(false);
// int packageID = int.Parse(Request.QueryString["id"]);
// //string packFileName = cms.businesslogic.packager. Publish.publishPackage(packageID);
// createdPackage.Publish();
// if (!string.IsNullOrEmpty(pack.PackagePath))
// {
// packageUmbFile.Text = " &nbsp; <a href='" + IOHelper.ResolveUrl(pack.PackagePath) + "'>Download</a>";
// this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Success, "Package saved and published", "");
// }
// else
// {
// this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, "Save failed", "check your umbraco log.");
// }
// }
// }
//}
private void SavePackage(bool showNotification)
{
pack.Author = packageAuthorName.Text;
pack.AuthorUrl = packageAuthorUrl.Text;
pack.License = packageLicenseName.Text;
pack.LicenseUrl = packageLicenseUrl.Text;
pack.Readme = packageReadme.Text;
pack.Actions = tb_actions.Text;
pack.Name = packageName.Text;
pack.Url = packageUrl.Text;
pack.Version = packageVersion.Text;
pack.IconUrl = iconUrl.Text;
pack.UmbracoVersion = Version.Parse(umbracoVersion.Text);
pack.ContentLoadChildNodes = packageContentSubdirs.Checked;
if (string.IsNullOrEmpty(cp.Value) == false)
pack.ContentNodeId = cp.Value;
else
pack.ContentNodeId = "";
string tmpStylesheets = "";
foreach (ListItem li in stylesheets.Items)
{
if (li.Selected)
tmpStylesheets += li.Value + ",";
}
pack.Stylesheets = new List<string>(tmpStylesheets.Trim(',').Split(','));
string tmpDoctypes = "";
foreach (ListItem li in documentTypes.Items)
{
if (li.Selected)
tmpDoctypes += li.Value + ",";
}
pack.DocumentTypes = new List<string>(tmpDoctypes.Trim(',').Split(','));
string tmpMacros = "";
foreach (ListItem li in macros.Items)
{
if (li.Selected)
tmpMacros += li.Value + ",";
}
pack.Macros = new List<string>(tmpMacros.Trim(',').Split(','));
string tmpLanguages = "";
foreach (ListItem li in languages.Items)
{
if (li.Selected)
tmpLanguages += li.Value + ",";
}
pack.Languages = new List<string>(tmpLanguages.Trim(',').Split(','));
string tmpDictionaries = "";
foreach (ListItem li in dictionary.Items)
{
if (li.Selected)
tmpDictionaries += li.Value + ",";
}
pack.DictionaryItems = new List<string>(tmpDictionaries.Trim(',').Split(','));
string tmpTemplates = "";
foreach (ListItem li in templates.Items)
{
if (li.Selected)
tmpTemplates += li.Value + ",";
}
pack.Templates = new List<string>(tmpTemplates.Trim(',').Split(','));
string tmpDataTypes = "";
foreach (ListItem li in cbl_datatypes.Items)
{
if (li.Selected)
tmpDataTypes += li.Value + ",";
}
pack.DataTypes = new List<string>(tmpDataTypes.Trim(',').Split(','));
pack.LoadControl = packageControlPath.Text;
createdPackage.Save();
if (showNotification)
this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, "Package Saved", "");
}
protected void addFileToPackage(object sender, EventArgs e)
{
string newPath = packageFilePathNew.Text;
if (newPath.Trim() != "")
{
CreatedPackage createdPackage = CreatedPackage.GetById(int.Parse(Request.QueryString["id"]));
PackageDefinition pack = createdPackage.Data;
pack.Files.Add(newPath);
createdPackage.Save();
packageFilePathNew.Text = "";
packageFilesRepeater.DataSource = pack.Files;
packageFilesRepeater.DataBind();
}
}
protected void deleteFileFromPackage(object sender, EventArgs e)
{
TextBox filePathControl = (TextBox)((Control)sender).Parent.FindControl("packageFilePath");
filePathControl.Text = "";
string tmpFilePathString = "";
foreach (RepeaterItem rItem in packageFilesRepeater.Items)
{
string tmpFFFF = ((TextBox)rItem.FindControl("packageFilePath")).Text;
if (tmpFFFF.Trim() != "")
tmpFilePathString += tmpFFFF + "<22>";
}
CreatedPackage createdPackage = CreatedPackage.GetById(int.Parse(Request.QueryString["id"]));
PackageDefinition pack = createdPackage.Data;
pack.Files = new List<string>(tmpFilePathString.Trim('<27>').Split('<27>'));
pack.Files.TrimExcess();
createdPackage.Save();
packageFilesRepeater.DataSource = pack.Files;
packageFilesRepeater.DataBind();
}
protected override void OnInit(EventArgs e)
{
// Tab setup
packageInfo = TabView1.NewTabPage("Package Properties");
packageInfo.Controls.Add(Pane1);
packageInfo.Controls.Add(Pane5);
packageInfo.Controls.Add(Pane1_1);
packageInfo.Controls.Add(Pane1_2);
packageInfo.Controls.Add(Pane1_3);
packageContents = TabView1.NewTabPage("Package Contents");
packageContents.Controls.Add(Pane2);
packageContents.Controls.Add(Pane2_1);
packageContents.Controls.Add(Pane2_2);
packageContents.Controls.Add(Pane2_3);
packageContents.Controls.Add(Pane2_4);
packageContents.Controls.Add(Pane2_5);
packageContents.Controls.Add(Pane2_6);
packageContents.Controls.Add(Pane2_7);
packageFiles = TabView1.NewTabPage("Package Files");
packageFiles.Controls.Add(Pane3);
packageFiles.Controls.Add(Pane3_1);
packageFiles.Controls.Add(Pane3_2);
packageActions = TabView1.NewTabPage("Package Actions");
packageActions.Controls.Add(Pane4);
//var pubs = TabView1.Menu.NewButton();
//pubs.Text = Services.TextService.Localize("publish");
//pubs.CommandName = "publish";
//pubs.Command += new CommandEventHandler(saveOrPublish);
//pubs.ID = "saveAndPublish";
//var saves = TabView1.Menu.NewButton();
//saves.Text = Services.TextService.Localize("save");
//saves.CommandName = "save";
//saves.Command += new CommandEventHandler(saveOrPublish);
//saves.ButtonType = Umbraco.Web._Legacy.Controls.MenuButtonType.Primary;
//saves.ID = "save";
base.OnInit(e);
}
}
}

View File

@@ -1,609 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace umbraco.presentation.developer.packages {
public partial class _Default {
/// <summary>
/// TabView1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.TabView TabView1;
/// <summary>
/// Pane1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane1;
/// <summary>
/// pp_name control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_name;
/// <summary>
/// packageName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageName;
/// <summary>
/// RequiredFieldValidator0 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator0;
/// <summary>
/// pp_url control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_url;
/// <summary>
/// packageUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageUrl;
/// <summary>
/// RequiredFieldValidator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary>
/// pp_version control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_version;
/// <summary>
/// packageVersion control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageVersion;
/// <summary>
/// RequiredFieldValidator2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
/// <summary>
/// pp_icon control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_icon;
/// <summary>
/// iconUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox iconUrl;
/// <summary>
/// pp_file control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_file;
/// <summary>
/// packageUmbFile control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal packageUmbFile;
/// <summary>
/// Pane5 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane5;
/// <summary>
/// pp_umbracoVersion control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_umbracoVersion;
/// <summary>
/// umbracoVersion control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox umbracoVersion;
/// <summary>
/// RequiredFieldValidator7 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator7;
/// <summary>
/// VersionValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator VersionValidator;
/// <summary>
/// Pane1_1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_1;
/// <summary>
/// pp_author control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_author;
/// <summary>
/// packageAuthorName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageAuthorName;
/// <summary>
/// RequiredFieldValidator3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3;
/// <summary>
/// pp_author_url control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_author_url;
/// <summary>
/// packageAuthorUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageAuthorUrl;
/// <summary>
/// RequiredFieldValidator4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;
/// <summary>
/// Pane1_2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_2;
/// <summary>
/// pp_licens control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_licens;
/// <summary>
/// packageLicenseName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageLicenseName;
/// <summary>
/// RequiredFieldValidator5 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator5;
/// <summary>
/// pp_license_url control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_license_url;
/// <summary>
/// packageLicenseUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageLicenseUrl;
/// <summary>
/// RequiredFieldValidator6 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator6;
/// <summary>
/// Pane1_3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_3;
/// <summary>
/// pp_readme control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_readme;
/// <summary>
/// packageReadme control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageReadme;
/// <summary>
/// Pane2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2;
/// <summary>
/// pp_content control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_content;
/// <summary>
/// content control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.PlaceHolder content;
/// <summary>
/// packageContentSubdirs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox packageContentSubdirs;
/// <summary>
/// packageContentSubdirsLabel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label packageContentSubdirsLabel;
/// <summary>
/// Pane2_1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_1;
/// <summary>
/// documentTypes control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList documentTypes;
/// <summary>
/// Pane2_2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_2;
/// <summary>
/// templates control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList templates;
/// <summary>
/// Pane2_3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_3;
/// <summary>
/// stylesheets control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList stylesheets;
/// <summary>
/// Pane2_4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_4;
/// <summary>
/// macros control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList macros;
/// <summary>
/// Pane2_5 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_5;
/// <summary>
/// languages control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList languages;
/// <summary>
/// Pane2_6 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_6;
/// <summary>
/// dictionary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList dictionary;
/// <summary>
/// Pane2_7 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_7;
/// <summary>
/// cbl_datatypes control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBoxList cbl_datatypes;
/// <summary>
/// Pane3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane3;
/// <summary>
/// Pane3_1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane3_1;
/// <summary>
/// packageFilesRepeater control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Repeater packageFilesRepeater;
/// <summary>
/// packageFilePathNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageFilePathNew;
/// <summary>
/// createNewFilePath control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button createNewFilePath;
/// <summary>
/// Pane3_2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane3_2;
/// <summary>
/// packageControlPath control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox packageControlPath;
/// <summary>
/// Pane4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane Pane4;
/// <summary>
/// actionsVal control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CustomValidator actionsVal;
/// <summary>
/// tb_actions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox tb_actions;
}
}