Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -486,4 +486,5 @@ $RECYCLE.BIN/
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
**/wwwroot/umbraco/

**/SeoToolkit.Umbraco.Site/App_Plugins/
**/SeoToolkit.Umbraco.Site/App_Plugins/
src/SeoToolkit.Umbraco.Site/uSync/
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using SeoToolkit.Umbraco.MetaFields.Core.Models.SeoSettings.Database;

namespace SeoToolkit.Umbraco.MetaFields.Core.Repositories.SeoValueRepository
{
Expand All @@ -10,5 +12,6 @@ public interface IMetaFieldsValueRepository
bool Exists(int nodeId, string fieldAlias, string culture);

Dictionary<string, object> GetAllValues(int nodeId, string culture);
IEnumerable<IGrouping<int, MetaFieldsValueEntity>> GetAll();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,13 @@ public Dictionary<string, object> GetAllValues(int nodeId, string culture)
.ToDictionary(it => it.Alias, it => JsonConvert.DeserializeObject(it.UserValue));
}
}

public IEnumerable<IGrouping<int, MetaFieldsValueEntity>> GetAll()
{
using var scope = _scopeProvider.CreateScope();
var values = scope.Database
.Fetch<MetaFieldsValueEntity>(scope.SqlContext.Sql()).GroupBy(it => it.NodeId);
return values;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Extensions;
using SeoToolkit.Umbraco.MetaFields.Core.Interfaces.Services;
using SeoToolkit.Umbraco.MetaFields.Core.Models.SeoSettings.Database;
using SeoToolkit.Umbraco.MetaFields.Core.Repositories.SeoValueRepository;

namespace SeoToolkit.Umbraco.MetaFields.Core.Services.SeoValueService
Expand Down Expand Up @@ -44,6 +46,11 @@ public void AddValues(int nodeId, Dictionary<string, object> values, string cult
ClearCache(nodeId);
}

public IEnumerable<IGrouping<int, MetaFieldsValueEntity>> GetAll()
{
return _repository.GetAll();
}

public void Delete(int nodeId, string fieldAlias, string culture = null)
{
_repository.Delete(nodeId, fieldAlias, culture.IfNullOrWhiteSpace(GetCulture()));
Expand Down
2 changes: 2 additions & 0 deletions src/SeoToolkit.Umbraco.Site/SeoToolkit.Umbraco.Site.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="clean" Version="2.0.0-beta002" />
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.6" />
<PackageReference Include="uSync" Version="11.0.2" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
</ItemGroup>

Expand Down Expand Up @@ -46,6 +47,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SeoToolkit.Umbraco\SeoToolkit.Umbraco.csproj" />
<ProjectReference Include="..\SeoToolkit.uSync\SeoToolkit.uSync.csproj" />
</ItemGroup>

<PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/SeoToolkit.Umbraco.Site/appsettings-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3883,6 +3883,9 @@
},
{
"$ref": "appsettings-schema.Umbraco.Cms.json#"
},
{
"$ref": "appsettings-schema.usync.json#"
}
]
}
278 changes: 278 additions & 0 deletions src/SeoToolkit.Umbraco.Site/appsettings-schema.usync.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "uSyncAppSettings",
"type": "object",
"properties": {
"uSync": {
"$ref": "#/definitions/USyncuSyncDefinition"
}
},
"definitions": {
"USyncuSyncDefinition": {
"type": "object",
"description": "Configuration of uSync settings",
"properties": {
"Settings": {
"description": "uSync settings",
"oneOf": [
{
"$ref": "#/definitions/USyncBackOfficeConfigurationuSyncSettings"
}
]
},
"ForceFips": {
"type": "boolean",
"description": "Force uSync to use FIPS compliant hashing algorthims when comparing files"
},
"Sets": {
"description": "Settings of Handler sets",
"oneOf": [
{
"$ref": "#/definitions/USyncuSyncSetsDefinition"
}
]
},
"AutoTemplates": {
"description": "Settings for the AutoTemplates package, (dynamic adding of templates based on files on disk)",
"oneOf": [
{
"$ref": "#/definitions/USyncAutoTemplatesDefinition"
}
]
}
}
},
"USyncBackOfficeConfigurationuSyncSettings": {
"type": "object",
"description": "uSync Settings",
"properties": {
"RootFolder": {
"type": "string",
"description": "Location where all uSync files are saved by default",
"default": "uSync/v9/"
},
"DefaultSet": {
"type": "string",
"description": "The default handler set to use on all notification triggered events",
"default": "Default"
},
"ImportAtStartup": {
"type": "string",
"description": "Import when Umbraco boots (can be group name or 'All' so everything is done, blank or 'none' == off)",
"default": "None"
},
"ExportAtStartup": {
"type": "string",
"description": "Export when Umbraco boots",
"default": "None"
},
"ExportOnSave": {
"type": "string",
"description": "Export when an item is saved in Umbraco",
"default": "All"
},
"UiEnabledGroups": {
"type": "string",
"description": "The handler groups that are enabled in the UI.",
"default": "All"
},
"ReportDebug": {
"type": "boolean",
"description": "Debug reports (creates an export into a temp folder for comparison)",
"default": false
},
"AddOnPing": {
"type": "boolean",
"description": "Ping the AddOnUrl to get the json used to show the addons dashboard",
"default": true
},
"RebuildCacheOnCompletion": {
"type": "boolean",
"description": "Pre Umbraco 8.4 - rebuild the cache was needed after content was imported",
"default": false
},
"FailOnMissingParent": {
"type": "boolean",
"description": "Fail if the items parent is not in umbraco or part of the batch being imported",
"default": false
},
"CacheFolderKeys": {
"type": "boolean",
"description": "Should folder keys be cached (for speed)",
"default": true
},
"ShowVersionCheckWarning": {
"type": "boolean",
"description": "Show a version check warning to the user if the folder version is less than the version expected by uSync.",
"default": true
},
"CustomMappings": {
"type": "object",
"description": "Custom mapping keys, allows users to add a simple config mapping to make one property type to behave like an existing one",
"additionalProperties": {
"type": "string"
}
},
"SignalRRoot": {
"type": "string",
"description": "location of SignalR hub script",
"default": ""
},
"EnableHistory": {
"type": "boolean",
"description": "Should the history view be on of off ? ",
"default": true
},
"DefaultExtension": {
"type": "string",
"description": "Default file extension for the uSync files. ",
"default": "config"
},
"ImportOnFirstBoot": {
"type": "boolean",
"description": "Import the uSync folder on the first boot. ",
"default": false
},
"FirstBootGroup": {
"type": "string",
"description": "Handler group(s) to run on first boot, default is All (so full import)",
"default": "All"
},
"DisableDashboard": {
"type": "boolean",
"description": "Disable the default dashboard (so people can't accedently press the buttons).",
"default": "false"
},
"SummaryDashboard": {
"type": "boolean",
"description": "summerize results (for when there are loads and loads of items)\n ",
"default": "false"
},
"SummaryLimit": {
"type": "integer",
"description": "limit of items to display before flicking to summary view. (this is per handler)\n ",
"format": "int32",
"default": 1000
}
}
},
"USyncuSyncSetsDefinition": {
"type": "object",
"properties": {
"Default": {
"$ref": "#/definitions/USyncBackOfficeConfigurationuSyncHandlerSetSettings"
}
}
},
"USyncBackOfficeConfigurationuSyncHandlerSetSettings": {
"type": "object",
"description": "Settings for a handler set (group of handlers)",
"properties": {
"Enabled": {
"type": "boolean",
"description": "Is this handler set enabled",
"default": true
},
"HandlerGroups": {
"type": "array",
"description": "List of groups handlers can belong to.",
"items": {
"type": "string"
}
},
"DisabledHandlers": {
"type": "array",
"description": "List of disabled handlers",
"items": {
"type": "string"
}
},
"HandlerDefaults": {
"description": "Default settings for all handlers",
"oneOf": [
{
"$ref": "#/definitions/USyncBackOfficeConfigurationHandlerSettings"
}
]
},
"Handlers": {
"type": "object",
"description": "Settings for named handlers ",
"additionalProperties": {
"$ref": "#/definitions/USyncBackOfficeConfigurationHandlerSettings"
}
},
"IsSelectable": {
"type": "boolean",
"description": "for handlers to appear in the drop down on the dashboard they have to be selectable\n "
}
}
},
"USyncBackOfficeConfigurationHandlerSettings": {
"type": "object",
"description": "Settings to control who a handler works",
"properties": {
"Enabled": {
"type": "boolean",
"description": "Is handler enabled or disabled",
"default": true
},
"Actions": {
"type": "array",
"description": "List of actions the handler is configured for. ",
"items": {
"type": "string"
}
},
"UseFlatStructure": {
"type": "boolean",
"description": "Should use a flat folder structure when exporting items",
"default": true
},
"GuidNames": {
"type": "boolean",
"description": "Items should be saved with their guid/key value as the filename",
"default": false
},
"FailOnMissingParent": {
"type": "boolean",
"description": "Imports should fail if the parent item is missing (if false, item be importated go a close as possible to location)",
"default": false
},
"Group": {
"type": "string",
"description": "Override the group the handler belongs too.",
"default": ""
},
"Settings": {
"type": "object",
"description": "Additional settings for the handler",
"additionalProperties": {
"type": "string"
}
}
}
},
"USyncAutoTemplatesDefinition": {
"type": "object",
"properties": {
"Enabled": {
"type": "boolean",
"description": "Enable AutoTemplates feature",
"default": false
},
"Delete": {
"type": "boolean",
"description": "Delete templates from Umbraco if the file is missing from disk",
"default": false
},
"Delay": {
"type": "integer",
"description": "Amount of time (milliseconds) to wait after file change event before applying changes",
"format": "int32",
"default": 1000
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/SeoToolkit.Umbraco.Site/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
},
"ConnectionStrings": {
"umbracoDbDSN": "Server=localhost;Database=uSeoToolkitV11;Integrated Security=true"
"umbracoDbDSN": "Server=(localdb)\\MSSQLLocalDB;Database=uSeoToolkit;Integrated Security=true"
},
"Umbraco": {
"CMS": {
Expand Down
Loading