AB3649 - Moved manifest stuff

This commit is contained in:
Bjarke Berg
2019-11-12 10:59:04 +01:00
parent b64b0758e1
commit 94f5894b74
8 changed files with 79 additions and 86 deletions

View File

@@ -1,28 +1,28 @@
using System;
using System.ComponentModel;
using Newtonsoft.Json;
using Umbraco.Core.Composing;
using System.Runtime.Serialization;
using Umbraco.Core.Dashboards;
using Umbraco.Core.IO;
namespace Umbraco.Core.Manifest
{
[DataContract]
public class ManifestDashboard : IDashboard
{
[JsonProperty("alias", Required = Required.Always)]
[DataMember(Name = "alias", IsRequired = true)]
public string Alias { get; set; }
[JsonProperty("weight", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
//TODO this needs to be tested manually!
//[JsonProperty("weight", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(100)] // must be equal to DashboardCollectionBuilder.DefaultWeight
public int Weight { get; set; }
[JsonProperty("view", Required = Required.Always)]
[DataMember(Name = "view", IsRequired = true)]
public string View { get; set; }
[JsonProperty("sections")]
[DataMember(Name = "sections")]
public string[] Sections { get; set; } = Array.Empty<string>();
[JsonProperty("access")]
[DataMember(Name = "access")]
public IAccessRule[] AccessRules { get; set; } = Array.Empty<IAccessRule>();
}
}

View File

@@ -1,70 +1,71 @@
using System;
using Newtonsoft.Json;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Core.Manifest
{
/// <summary>
/// Represents the content of a package manifest.
/// </summary>
public class PackageManifest
{
/// <summary>
/// Gets the source path of the manifest.
/// </summary>
/// <remarks>
/// <para>Gets the full absolute file path of the manifest,
/// using system directory separators.</para>
/// </remarks>
[JsonIgnore]
public string Source { get; set; }
/// <summary>
/// Gets or sets the scripts listed in the manifest.
/// </summary>
[JsonProperty("javascript")]
public string[] Scripts { get; set; } = Array.Empty<string>();
/// <summary>
/// Gets or sets the stylesheets listed in the manifest.
/// </summary>
[JsonProperty("css")]
public string[] Stylesheets { get; set; } = Array.Empty<string>();
/// <summary>
/// Gets or sets the property editors listed in the manifest.
/// </summary>
[JsonProperty("propertyEditors")]
public IDataEditor[] PropertyEditors { get; set; } = Array.Empty<IDataEditor>();
/// <summary>
/// Gets or sets the parameter editors listed in the manifest.
/// </summary>
[JsonProperty("parameterEditors")]
public IDataEditor[] ParameterEditors { get; set; } = Array.Empty<IDataEditor>();
/// <summary>
/// Gets or sets the grid editors listed in the manifest.
/// </summary>
[JsonProperty("gridEditors")]
public GridEditor[] GridEditors { get; set; } = Array.Empty<GridEditor>();
/// <summary>
/// Gets or sets the content apps listed in the manifest.
/// </summary>
[JsonProperty("contentApps")]
public ManifestContentAppDefinition[] ContentApps { get; set; } = Array.Empty<ManifestContentAppDefinition>();
/// <summary>
/// Gets or sets the dashboards listed in the manifest.
/// </summary>
[JsonProperty("dashboards")]
public ManifestDashboard[] Dashboards { get; set; } = Array.Empty<ManifestDashboard>();
/// <summary>
/// Gets or sets the sections listed in the manifest.
/// </summary>
[JsonProperty("sections")]
public ManifestSection[] Sections { get; set; } = Array.Empty<ManifestSection>();
}
}
using System;
using System.Runtime.Serialization;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Core.Manifest
{
/// <summary>
/// Represents the content of a package manifest.
/// </summary>
[DataContract]
public class PackageManifest
{
/// <summary>
/// Gets the source path of the manifest.
/// </summary>
/// <remarks>
/// <para>Gets the full absolute file path of the manifest,
/// using system directory separators.</para>
/// </remarks>
[IgnoreDataMember]
public string Source { get; set; }
/// <summary>
/// Gets or sets the scripts listed in the manifest.
/// </summary>
[DataMember(Name = "javascript")]
public string[] Scripts { get; set; } = Array.Empty<string>();
/// <summary>
/// Gets or sets the stylesheets listed in the manifest.
/// </summary>
[DataMember(Name = "css")]
public string[] Stylesheets { get; set; } = Array.Empty<string>();
/// <summary>
/// Gets or sets the property editors listed in the manifest.
/// </summary>
[DataMember(Name = "propertyEditors")]
public IDataEditor[] PropertyEditors { get; set; } = Array.Empty<IDataEditor>();
/// <summary>
/// Gets or sets the parameter editors listed in the manifest.
/// </summary>
[DataMember(Name = "parameterEditors")]
public IDataEditor[] ParameterEditors { get; set; } = Array.Empty<IDataEditor>();
/// <summary>
/// Gets or sets the grid editors listed in the manifest.
/// </summary>
[DataMember(Name = "gridEditors")]
public GridEditor[] GridEditors { get; set; } = Array.Empty<GridEditor>();
/// <summary>
/// Gets or sets the content apps listed in the manifest.
/// </summary>
[DataMember(Name = "contentApps")]
public ManifestContentAppDefinition[] ContentApps { get; set; } = Array.Empty<ManifestContentAppDefinition>();
/// <summary>
/// Gets or sets the dashboards listed in the manifest.
/// </summary>
[DataMember(Name = "dashboards")]
public ManifestDashboard[] Dashboards { get; set; } = Array.Empty<ManifestDashboard>();
/// <summary>
/// Gets or sets the sections listed in the manifest.
/// </summary>
[DataMember(Name = "sections")]
public ManifestSection[] Sections { get; set; } = Array.Empty<ManifestSection>();
}
}

View File

@@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations;
using System.Xml.Linq;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.Services;
namespace Umbraco.Core.PropertyEditors
{

View File

@@ -184,9 +184,6 @@
<Compile Include="IO\IOHelper.cs" />
<Compile Include="IO\MediaPathSchemes\UniqueMediaPathScheme.cs" />
<Compile Include="Logging\Viewer\LogTimePeriod.cs" />
<Compile Include="Manifest\IManifestFilter.cs" />
<Compile Include="Manifest\ManifestFilterCollection.cs" />
<Compile Include="Manifest\ManifestFilterCollectionBuilder.cs" />
<Compile Include="Manifest\ManifestParser.cs" />
<Compile Include="Migrations\IMigrationBuilder.cs" />
<Compile Include="Migrations\Upgrade\Common\DeleteKeysAndIndexes.cs" />
@@ -225,7 +222,6 @@
<Compile Include="Models\IContentTypeBase.cs" />
<Compile Include="Models\IContentTypeComposition.cs" />
<Compile Include="Models\IDataType.cs" />
<Compile Include="Models\IDataValueEditor.cs" />
<Compile Include="Models\Identity\IdentityMapDefinition.cs" />
<Compile Include="Models\Identity\UserLoginInfoWrapper.cs" />
<Compile Include="Models\IMediaType.cs" />
@@ -276,7 +272,6 @@
<Compile Include="PropertyEditors\DataEditorAttribute.cs" />
<Compile Include="PropertyEditors\DateTimeConfiguration.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\RenameLabelAndRichTextPropertyEditorAliases.cs" />
<Compile Include="PropertyEditors\IDataEditor.cs" />
<Compile Include="PropertyEditors\PropertyValueConverterCollection.cs" />
<Compile Include="PropertyEditors\PropertyValueConverterCollectionBuilder.cs" />
<Compile Include="PropertyEditors\VoidEditor.cs" />
@@ -379,7 +374,6 @@
<Compile Include="Logging\Viewer\SavedLogSearch.cs" />
<Compile Include="Manifest\DashboardAccessRuleConverter.cs" />
<Compile Include="Manifest\ManifestContentAppFactory.cs" />
<Compile Include="Manifest\ManifestDashboard.cs" />
<Compile Include="Migrations\MergeBuilder.cs" />
<Compile Include="Migrations\MigrationBase_Extra.cs" />
<Compile Include="Migrations\PostMigrations\IPublishedSnapshotRebuilder.cs" />
@@ -540,7 +534,6 @@
<Compile Include="MainDom.cs" />
<Compile Include="Manifest\ValueValidatorConverter.cs" />
<Compile Include="Manifest\ManifestWatcher.cs" />
<Compile Include="Manifest\PackageManifest.cs" />
<Compile Include="Manifest\DataEditorConverter.cs" />
<Compile Include="Migrations\MigrationBuilder.cs" />
<Compile Include="Migrations\MigrationPlan.cs" />