Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content folder support #21

Merged
merged 4 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,27 @@
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Kentico.Xperience.Core" Version="28.4.1" />
<PackageVersion Include="Kentico.Xperience.ImageProcessing" Version="28.4.1" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageVersion Include="Kentico.Xperience.Core" Version="29.0.2" />
<PackageVersion Include="Kentico.Xperience.Admin" Version="29.0.2" />
<PackageVersion Include="Kentico.Xperience.ImageProcessing" Version="29.0.2" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.6.0.74858" />
<PackageVersion Include="Markdig" Version="0.31.0" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.7.0-2.final" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.7.0-2.final" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.24.0.89429">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Markdig" Version="0.37.0" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.9.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.9.2" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageVersion Include="NJsonSchema" Version="10.9.0" />
<PackageVersion Include="RazorLight" Version="2.3.1" />
<PackageVersion Include="FluentAssertions" Version="6.11.0" />
<PackageVersion Include="Kentico.Xperience.Libraries.Tests" Version="13.0.118" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Kentico.Xperience.Admin" Version="28.4.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
<PackageVersion Include="RazorLight" Version="2.3.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="xunit" Version="2.4.2" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions docs/Enums/FormComponents.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
|`Int32[]`|`Kentico.Administration.ObjectIdSelector`|`ObjectIdSelectorComponent`|`ObjectSelectorProperties`||
|`ObjectRelatedItem[]`||`ObjectSelectorComponent`|`ObjectSelectorProperties`||
|`TagReference[]`|`Kentico.Administration.TagSelector`|`TagSelectorComponent`|`TagSelectorProperties`||
|`int`|`Kentico.Administration.ContentFolderSelector`|`ContentFolderSelectorComponent`|`ContentFolderSelectorProperties`||
|`int`|`Kentico.Administration.NumberWithLabel`|`NumberWithLabelComponent`|`FormComponentProperties`||
|`System.DateTime?`|`Kentico.Administration.DateInput`|`DateInputComponent`|`FormComponentProperties`||
|`System.DateTime?`|`Kentico.Administration.DateTimeInput`|`DateTimeInputComponent`|`FormComponentProperties`||
Expand Down
29 changes: 29 additions & 0 deletions docs/Model/ContentFolderModel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- generated file with tool "Kentico.Xperience.UMT.DocUtils" - edited through template "UmtModel.cshtml" -->
## ContentFolderModel
Model represents XbyK ContentFolderInfo, enables user to create content item folders with umt

Model [discriminator](../UmtModel.md#discriminator): `ContentFolder`

|PropertyName|Summary|.NET Type|Notes|
|---|---|---|---|
|ContentFolderGUID\*||System.Guid?|[UniqueId](../UmtModel.md#UniqueId)|
|ContentFolderParentFolderGUID|parent folder guid. If null is specified, folder is created directly under root|System.Guid?|Reference to [ContentFolderInfo](../References.md#ContentFolderInfo) on property ContentFolderParentFolderID|
|ContentFolderName\*||string?||
|ContentFolderDisplayName\*||string?||
|ContentFolderTreePath\*||string?||
|[customPropertyName]|custom property defined by created [DataClass](./DataClassModel.md)|.NET type defined by data class field||

<p>*) value is required</p>


### Content folder basic sample

```json
{
"$type": "ContentFolder",
"ContentFolderGUID": "7665a8fc-53a2-4aff-86e8-99b009104ff2",
"ContentFolderName": "articles",
"ContentFolderDisplayName": "Articles",
"ContentFolderTreePath": "/articles"
}
```
1 change: 1 addition & 0 deletions docs/Model/ContentItemModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Model [discriminator](../UmtModel.md#discriminator): `ContentItem`
|PropertyName|Summary|.NET Type|Notes|
|---|---|---|---|
|ContentItemGUID\*||System.Guid?|[UniqueId](../UmtModel.md#UniqueId)|
|ContentItemContentFolderGUID|reference to content folder|System.Guid?|Reference to [ContentFolderInfo](../References.md#ContentFolderInfo) on property ContentItemContentFolderID|
|ContentItemName\*||string?||
|ContentItemIsReusable\*||bool?||
|ContentItemIsSecured||bool?||
Expand Down
1 change: 1 addition & 0 deletions docs/Model/ContentItemSimplifiedModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Model [discriminator](../UmtModel.md#discriminator): `ContentItemSimplified`
|PropertyName|Summary|.NET Type|Notes|
|---|---|---|---|
|ContentItemGUID\*||System.Guid?|[UniqueId](../UmtModel.md#UniqueId)|
|ContentItemContentFolderGUID|Reference to content folder|System.Guid?||
|IsSecured||bool?||
|ContentTypeName\*|Content item type name.|string?||
|Name\*|Code name of the content item.|string?||
Expand Down
60 changes: 60 additions & 0 deletions docs/Model/UMT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@
"format": "guid",
"minLength": 1
},
"ContentItemContentFolderGUID": {
"type": [
"null",
"string"
],
"description": "reference to content folder",
"format": "guid"
},
"ContentItemName": {
"type": "string",
"minLength": 1
Expand Down Expand Up @@ -389,6 +397,58 @@
}
]
},
"ContentFolderModel": {
"allOf": [
{
"$ref": "#/definitions/UmtModel"
},
{
"type": "object",
"description": "Model represents XbyK ContentFolderInfo, enables user to create content item folders with umt",
"additionalProperties": {
"oneOf": [
{},
{
"type": "null"
}
]
},
"required": [
"ContentFolderGUID",
"ContentFolderName",
"ContentFolderDisplayName",
"ContentFolderTreePath"
],
"properties": {
"ContentFolderGUID": {
"type": "string",
"format": "guid",
"minLength": 1
},
"ContentFolderParentFolderGUID": {
"type": [
"null",
"string"
],
"description": "parent folder guid. If null is specified, folder is created directly under root",
"format": "guid"
},
"ContentFolderName": {
"type": "string",
"minLength": 1
},
"ContentFolderDisplayName": {
"type": "string",
"minLength": 1
},
"ContentFolderTreePath": {
"type": "string",
"minLength": 1
}
}
}
]
},
"DataClassModel": {
"allOf": [
{
Expand Down
22 changes: 22 additions & 0 deletions docs/Samples/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
{
"$type": "ContentItem",
"ContentItemGUID": "c354427d-3d02-4876-8ed4-4de817fae929",
"ContentItemContentFolderGUID": null,
"ContentItemName": "NewsLetterExampleName",
"ContentItemIsReusable": true,
"ContentItemIsSecured": true,
Expand Down Expand Up @@ -373,6 +374,7 @@
{
"$type": "ContentItem",
"ContentItemGUID": "b64b3e3e-f5a9-4d02-8cdb-6d81805c0fee",
"ContentItemContentFolderGUID": null,
"ContentItemName": "SampleReusableFaq",
"ContentItemIsReusable": true,
"ContentItemIsSecured": true,
Expand Down Expand Up @@ -444,6 +446,7 @@
{
"$type": "ContentItem",
"ContentItemGUID": "df81215e-1414-4d87-befd-ae123f4e5653",
"ContentItemContentFolderGUID": null,
"ContentItemName": "CreationOfUmtModel",
"ContentItemIsReusable": false,
"ContentItemIsSecured": false,
Expand Down Expand Up @@ -551,6 +554,7 @@
{
"$type": "ContentItem",
"ContentItemGUID": "e09121ad-dd97-472f-b8f6-85fe5428ed6a",
"ContentItemContentFolderGUID": null,
"ContentItemName": "Content-item-with-relations",
"ContentItemIsReusable": false,
"ContentItemIsSecured": true,
Expand Down Expand Up @@ -669,9 +673,26 @@
"WebPageUrlPathIsLatest": true,
"WebPageUrlPathIsDraft": false
},
{
"$type": "ContentFolder",
"ContentFolderGUID": "7665a8fc-53a2-4aff-86e8-99b009104ff2",
"ContentFolderParentFolderGUID": null,
"ContentFolderName": "articles",
"ContentFolderDisplayName": "Articles",
"ContentFolderTreePath": "/articles"
},
{
"$type": "ContentFolder",
"ContentFolderGUID": "ae29c1d1-217a-45da-8b30-585d1881387e",
"ContentFolderParentFolderGUID": "7665a8fc-53a2-4aff-86e8-99b009104ff2",
"ContentFolderName": "obsolete",
"ContentFolderDisplayName": "Obsolete",
"ContentFolderTreePath": "/articles/obsolete"
},
{
"$type": "ContentItemSimplified",
"ContentItemGUID": "37c3f5dd-6f2a-4eff-b46e-a36eddebf572",
"ContentItemContentFolderGUID": null,
"IsSecured": false,
"ContentTypeName": "UMT.Article",
"Name": "SimplifiedModelSample",
Expand Down Expand Up @@ -724,6 +745,7 @@
{
"$type": "ContentItemSimplified",
"ContentItemGUID": "f9cb9484-ce90-460f-a5c8-ad953e2b9286",
"ContentItemContentFolderGUID": "ae29c1d1-217a-45da-8b30-585d1881387e",
"IsSecured": false,
"ContentTypeName": "UMT.Faq",
"Name": "SimplifiedModelSampleReusable",
Expand Down
Loading
Loading