From b9179f4140a4fd42ee6d59da556fbcb273340d74 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Wed, 6 Sep 2017 12:20:52 -0400 Subject: [PATCH 01/12] WIP on version checking --- Gruntfile.js | 7 ++- .../Api/ArchetypeDataTypeController.cs | 29 +++++++++- .../Archetype.Umbraco.csproj | 2 + app/Umbraco/Umbraco.Archetype/Constants.cs | 2 + .../Extensions/ArchetypeHelper.cs | 24 ++++++++ .../Models/ArchetypeGlobalSettings.cs | 56 +++++++++++++++++++ .../Properties/VersionInfo.cs | 4 +- app/controllers/config.controller.js | 10 +++- app/controllers/config.dialog.controller.js | 1 + app/controllers/config.global.controller.js | 28 ++++++++++ app/services/archetypeGlobalConfigService.js | 19 +++++++ .../archetype.config.developer.dialog.html | 4 +- config/meta.json | 2 +- 13 files changed, 178 insertions(+), 10 deletions(-) create mode 100644 app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs create mode 100644 app/controllers/config.global.controller.js create mode 100644 app/services/archetypeGlobalConfigService.js diff --git a/Gruntfile.js b/Gruntfile.js index cf1ca49..14db49a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -85,6 +85,7 @@ module.exports = function(grunt) { 'app/controllers/controller_versioned.js', 'app/controllers/config.controller.js', 'app/controllers/config.dialog.controller.js', + 'app/controllers/config.global.controller.js', 'app/directives/archetypeproperty.js', 'app/directives/archetypesubmitwatcher.js', 'app/directives/archetypecustomview.js', @@ -95,7 +96,8 @@ module.exports = function(grunt) { 'app/resources/archetypePropertyEditorResource.js', 'app/services/archetypeService.js', 'app/services/archetypeLabelService.js', - 'app/services/archetypeCacheService.js' + 'app/services/archetypeCacheService.js', + 'app/services/archetypeGlobalConfigService.js' ], dest: '<%= basePath %>/js/archetype.js' } @@ -269,7 +271,8 @@ module.exports = function(grunt) { 'app/controllers/*.js', '!app/controllers/controller.js', '!app/controllers/config.controller.js', - '!app/controllers/config.dialog.controller.js' + '!app/controllers/config.dialog.controller.js', + '!app/controllers/config.global.controller.js' ], less: [ 'app/less/*.less', diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index af0c4ce..f49696f 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -11,15 +11,17 @@ using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.Editors; using Archetype.Extensions; +using Archetype.Models; namespace Archetype.Api -{ - /// +{/// /// Controller that handles datatype related interactions. /// [PluginController("ArchetypeApi")] public class ArchetypeDataTypeController : UmbracoAuthorizedJsonController - { + { + private readonly ArchetypeHelper _archetypeHelper = new ArchetypeHelper(); + public IEnumerable GetAllPropertyEditors() { return @@ -85,6 +87,27 @@ namespace Archetype.Api return new {dllVersion = _version()}; } + [HttpGet] + public object GlobalSettings() + { + return new + { + isCheckingForUpdates = _archetypeHelper.GetGlobalSettings().IsCheckingForUpdates + }; + } + + [HttpPost] + public void SetCheckForUpdates([FromBody] bool isChecking) + { + _archetypeHelper.SetCheckForUpdates(isChecking); + } + + [HttpPost] + public void CheckForUpdates() + { + _archetypeHelper.CheckForUpdates(); + } + /// /// Gets the DLL version from the file. /// diff --git a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj index 5a64ccc..1242eae 100644 --- a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj +++ b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj @@ -129,6 +129,7 @@ False + False @@ -238,6 +239,7 @@ + diff --git a/app/Umbraco/Umbraco.Archetype/Constants.cs b/app/Umbraco/Umbraco.Archetype/Constants.cs index d2a9db8..59d500d 100644 --- a/app/Umbraco/Umbraco.Archetype/Constants.cs +++ b/app/Umbraco/Umbraco.Archetype/Constants.cs @@ -12,5 +12,7 @@ public const string CacheKey_DataTypeByGuid = ""; public const string CacheKey_PreValueFromDataTypeId = "Archetype_GetArchetypePreValueFromDataTypeId_"; + + public const string CheckForUpdatesAlias = "Archetype:CheckForUpdates"; } } diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs index 73383eb..98d42af 100644 --- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs +++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Web.Configuration; using Archetype.Models; using Newtonsoft.Json; using Umbraco.Core; @@ -7,6 +8,9 @@ using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Models.PublishedContent; +/// +/// The Extensions namespace. +/// namespace Archetype.Extensions { /// @@ -16,6 +20,7 @@ namespace Archetype.Extensions { protected JsonSerializerSettings _jsonSettings; protected ApplicationContext _app; + private ArchetypeGlobalSettings _globalSettings = new ArchetypeGlobalSettings(); private static readonly ArchetypeHelper _instance = new ArchetypeHelper(); @@ -112,12 +117,31 @@ namespace Archetype.Extensions internal bool IsPropertyValueConverterOverridden(int dataTypeId) { var prevalues = GetArchetypePreValueFromDataTypeId(dataTypeId); + if (prevalues == null) return false; return prevalues.OverrideDefaultPropertyValueConverter; } + internal ArchetypeGlobalSettings GetGlobalSettings() + { + return _globalSettings; + } + + internal void SetCheckForUpdates(bool isChecking) + { + _globalSettings.IsCheckingForUpdates = isChecking; + _globalSettings.Save(); + } + + internal void CheckForUpdates() + { + //http request + //send umb version + //send archetype version + } + /// /// Gets the archetype pre value from data type identifier. /// diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs new file mode 100644 index 0000000..a3c8d49 --- /dev/null +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs @@ -0,0 +1,56 @@ +using System.Web.Configuration; + +namespace Archetype.Models +{ + public class ArchetypeGlobalSettings + { + private bool? _isCheckingForUpdates; + + public bool IsCheckingForUpdates + { + get + { + if (_isCheckingForUpdates == null) + { + var setting = WebConfigurationManager.AppSettings[Constants.CheckForUpdatesAlias]; + + if (setting == null) + { + _isCheckingForUpdates = true; + } + + var settingValue = true; + + if (bool.TryParse(setting, out settingValue)) + { + _isCheckingForUpdates = settingValue; + } + else + { + _isCheckingForUpdates = true; + } + } + + return _isCheckingForUpdates.Value; + } + + set + { + _isCheckingForUpdates = value; + } + } + + public void Save() + { + var config = WebConfigurationManager.OpenWebConfiguration("~"); + + if (config.AppSettings.Settings[Constants.CheckForUpdatesAlias] != null) + { + config.AppSettings.Settings.Remove(Constants.CheckForUpdatesAlias); + } + + config.AppSettings.Settings.Add(Constants.CheckForUpdatesAlias, IsCheckingForUpdates.ToString()); + config.Save(); + } + } +} diff --git a/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs b/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs index 97f5ded..6b51d14 100644 --- a/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs +++ b/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("1.15.1")] -[assembly: AssemblyFileVersion("1.15.1")] +[assembly: AssemblyVersion("1.16.0")] +[assembly: AssemblyFileVersion("1.16.0")] diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index a718175..c7cbc56 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -1,4 +1,4 @@ -angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource) { +angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource, archetypeGlobalConfigService, notificationService) { //$scope.model.value = ""; //console.log($scope.model.value); @@ -16,6 +16,14 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio archetypePropertyEditorResource.getDllVersion().then(function(data){ $scope.dllVersion = data.dllVersion; }); + + archetypeGlobalConfigService.checkForUpdates().then(function() { + console.log("checked..."); + notificationService.showNotification({ + type: 'info', + message: 'A new version of Archetype is available!' + }); + }); //ini the render model initConfigRenderModel(); diff --git a/app/controllers/config.dialog.controller.js b/app/controllers/config.dialog.controller.js index 511f37d..5f5fc06 100644 --- a/app/controllers/config.dialog.controller.js +++ b/app/controllers/config.dialog.controller.js @@ -1,4 +1,5 @@ angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) { + //handles a fieldset group add $scope.addFieldsetGroup = function () { $scope.dialogData.model.fieldsetGroups.push({ name: "" }); diff --git a/app/controllers/config.global.controller.js b/app/controllers/config.global.controller.js new file mode 100644 index 0000000..27cab86 --- /dev/null +++ b/app/controllers/config.global.controller.js @@ -0,0 +1,28 @@ +angular.module('umbraco').controller('ArchetypeConfigGlobalOptionsController', function ($scope, archetypeGlobalConfigService) { + $scope.globalSettings = {}; + + $scope.confirmCheckNewVersionChange = function() { + if(confirm("By changing this value, it will cause a restart of the app domain, are you sure?")) + { + archetypeGlobalConfigService.setCheckForUpdates($scope.globalSettings.checkForNewVersion); + } + else + { + $scope.globalSettings.checkForNewVersion = !$scope.globalSettings.checkForNewVersion; + } + } + + function getGlobalSettings() + { + archetypeGlobalConfigService.globalSettings().then(function(data) { + $scope.globalSettings.checkForNewVersion = data.isCheckingForUpdates; + }); + } + + init(); + + function init() + { + getGlobalSettings(); + } +}); \ No newline at end of file diff --git a/app/services/archetypeGlobalConfigService.js b/app/services/archetypeGlobalConfigService.js new file mode 100644 index 0000000..a732ed0 --- /dev/null +++ b/app/services/archetypeGlobalConfigService.js @@ -0,0 +1,19 @@ +angular.module('umbraco.services').factory('archetypeGlobalConfigService', function ($q, $http, umbRequestHelper) { + return { + globalSettings: function () { + return umbRequestHelper.resourcePromise( + $http.get("backoffice/ArchetypeApi/ArchetypeDataType/globalSettings"), 'Failed to get whether or not we are checking for updates!' + ); + }, + setCheckForUpdates: function (isChecking) { + return umbRequestHelper.resourcePromise( + $http.post("backoffice/ArchetypeApi/ArchetypeDataType/SetCheckForUpdates", isChecking), 'Failed to update check status!' + ); + }, + checkForUpdates: function () { + return umbRequestHelper.resourcePromise( + $http.post("backoffice/ArchetypeApi/ArchetypeDataType/checkForUpdates", { }), 'Failed to check for updates!' + ); + } + } +}); \ No newline at end of file diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index 96e4f44..43a8ac7 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -11,7 +11,9 @@
- +
+ +
diff --git a/config/meta.json b/config/meta.json index 6c5dc6f..e4c118a 100644 --- a/config/meta.json +++ b/config/meta.json @@ -1,6 +1,6 @@ { "name": "Archetype", - "version": "1.15.1", + "version": "1.16.0", "url": "http://github.com/imulus/archetype/", "author": "Imulus - Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Et. Al.", "authorUrl": "http://imulus.com/", From 1cb21391378476f59b376a1a9993e34729c5bb14 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Wed, 6 Sep 2017 18:32:48 -0400 Subject: [PATCH 02/12] More WIP --- .../Api/ArchetypeDataTypeController.cs | 61 ++++--- .../Archetype.Umbraco.csproj | 2 + app/Umbraco/Umbraco.Archetype/Constants.cs | 3 + .../Umbraco.Archetype/Events/StartUp.cs | 38 +++++ .../Extensions/ArchetypeHelper.cs | 151 +++++++++++++++--- .../Models/ArchetypeUpdateNotification.cs | 10 ++ .../Properties/AssemblyInfo.cs | 2 +- app/controllers/config.controller.js | 16 +- .../archetype.config.developer.dialog.html | 2 +- app/views/archetype.config.html | 3 +- 10 files changed, 231 insertions(+), 57 deletions(-) create mode 100644 app/Umbraco/Umbraco.Archetype/Events/StartUp.cs create mode 100644 app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index f49696f..5b8ad09 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; using System; -using System.Diagnostics; using System.Linq; using System.Net; -using System.Reflection; using System.Web.Http; using AutoMapper; using Umbraco.Core.Models; @@ -11,29 +9,28 @@ using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.Editors; using Archetype.Extensions; -using Archetype.Models; namespace Archetype.Api -{/// +{ + /// /// Controller that handles datatype related interactions. /// + /// [PluginController("ArchetypeApi")] public class ArchetypeDataTypeController : UmbracoAuthorizedJsonController - { - private readonly ArchetypeHelper _archetypeHelper = new ArchetypeHelper(); - + { public IEnumerable GetAllPropertyEditors() { return global::Umbraco.Core.PropertyEditors.PropertyEditorResolver.Current.PropertyEditors - .Select(x => new {defaultPreValues = x.DefaultPreValuesForArchetype(), alias = x.Alias, view = x.ValueEditor.View}); + .Select(x => new { defaultPreValues = x.DefaultPreValuesForArchetype(), alias = x.Alias, view = x.ValueEditor.View }); } /// /// Gets all datatypes. /// /// - public object GetAll() + public object GetAll() { var dataTypes = Services.DataTypeService.GetAllDataTypeDefinitions(); return dataTypes.Select(t => new { guid = t.Key, name = t.Name }); @@ -84,40 +81,56 @@ namespace Archetype.Api /// public object GetDllVersion() { - return new {dllVersion = _version()}; + return new { dllVersion = ArchetypeHelper.Instance.DllVersion() }; } + /// + /// Globals the settings. + /// + /// System.Object. [HttpGet] public object GlobalSettings() { return new { - isCheckingForUpdates = _archetypeHelper.GetGlobalSettings().IsCheckingForUpdates + isCheckingForUpdates = ArchetypeHelper.Instance.GetGlobalSettings().IsCheckingForUpdates }; } + /// + /// Sets the check for updates. + /// + /// if set to true [is checking]. [HttpPost] public void SetCheckForUpdates([FromBody] bool isChecking) { - _archetypeHelper.SetCheckForUpdates(isChecking); - } - - [HttpPost] - public void CheckForUpdates() - { - _archetypeHelper.CheckForUpdates(); + ArchetypeHelper.Instance.SetCheckForUpdates(isChecking); } /// - /// Gets the DLL version from the file. + /// Checks for updates. /// - /// - private string _version() + /// System.Object. + [HttpPost] + public object CheckForUpdates() { - var asm = Assembly.GetExecutingAssembly(); - var fvi = FileVersionInfo.GetVersionInfo(asm.Location); + if (!ArchetypeHelper.Instance.GetGlobalSettings().IsCheckingForUpdates) + { + return new + { + isUpdateAvailable = false + }; + } - return fvi.FileVersion; + var updateNotificationModel = ArchetypeHelper.Instance.CheckForUpdates(); + + return new + { + isUpdateAvailable = updateNotificationModel.IsUpdateAvailable, + headline = updateNotificationModel.Headline, + type = updateNotificationModel.Type, + message = updateNotificationModel.Message + }; } } } diff --git a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj index 1242eae..8a66dbf 100644 --- a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj +++ b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj @@ -232,6 +232,7 @@ + @@ -250,6 +251,7 @@ + diff --git a/app/Umbraco/Umbraco.Archetype/Constants.cs b/app/Umbraco/Umbraco.Archetype/Constants.cs index 59d500d..d01b68d 100644 --- a/app/Umbraco/Umbraco.Archetype/Constants.cs +++ b/app/Umbraco/Umbraco.Archetype/Constants.cs @@ -14,5 +14,8 @@ public const string CacheKey_PreValueFromDataTypeId = "Archetype_GetArchetypePreValueFromDataTypeId_"; public const string CheckForUpdatesAlias = "Archetype:CheckForUpdates"; + public const string IdAlias = "Archetype:Id"; + public const string UmbracoVersionAlias = "umbracoConfigurationStatus"; + public const string NotificationUrl = "https://api.gizmo42.com/v1/archetype/CheckForUpdates"; } } diff --git a/app/Umbraco/Umbraco.Archetype/Events/StartUp.cs b/app/Umbraco/Umbraco.Archetype/Events/StartUp.cs new file mode 100644 index 0000000..4731c9d --- /dev/null +++ b/app/Umbraco/Umbraco.Archetype/Events/StartUp.cs @@ -0,0 +1,38 @@ +using System; +using System.Web.Configuration; +using Umbraco.Core; + +namespace Archetype.Events +{ + public class StartUp : ApplicationEventHandler + { + protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) + { + base.ApplicationStarting(umbracoApplication, applicationContext); + + var config = WebConfigurationManager.OpenWebConfiguration("~"); + + //do we have an Archetype Id? + if (config.AppSettings.Settings[Constants.IdAlias] == null) + { + //guess we need one + config.AppSettings.Settings.Add(Constants.IdAlias, Guid.NewGuid().ToString()); + config.Save(); + } + else + { + //we have the setting, but is it a GUID? + Guid id; + + if (!Guid.TryParse(config.AppSettings.Settings[Constants.IdAlias].Value, out id)) + { + config.AppSettings.Settings.Remove(Constants.IdAlias); + config.AppSettings.Settings.Add(Constants.IdAlias, Guid.NewGuid().ToString()); + config.Save(); + } + + //guess we're g2g + } + } + } +} diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs index 98d42af..489c3f4 100644 --- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs +++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs @@ -1,12 +1,17 @@ using System; +using System.Configuration; using System.Linq; -using System.Web.Configuration; +using System.Net.Http; +using System.Text; using Archetype.Models; using Newtonsoft.Json; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Models.PublishedContent; +using System.Reflection; +using System.Diagnostics; +using System.Net; /// /// The Extensions namespace. @@ -18,32 +23,69 @@ namespace Archetype.Extensions /// public class ArchetypeHelper { + /// + /// The json settings + /// protected JsonSerializerSettings _jsonSettings; + /// + /// The application + /// protected ApplicationContext _app; - private ArchetypeGlobalSettings _globalSettings = new ArchetypeGlobalSettings(); - - private static readonly ArchetypeHelper _instance = new ArchetypeHelper(); - - internal static ArchetypeHelper Instance { get { return _instance; } } /// - /// Initializes a new instance of the class. + /// The global settings /// - internal ArchetypeHelper() + private readonly ArchetypeGlobalSettings _globalSettings; + + /// + /// The pad lock + /// + private static readonly object _padLock = new object(); + + /// + /// The instance + /// + private static ArchetypeHelper _instance = new ArchetypeHelper(); + + /// + /// Gets the instance. + /// + /// The instance. + internal static ArchetypeHelper Instance { + get + { + if (_instance == null) + { + lock (_padLock) + { + if (_instance == null) + { + _instance = new ArchetypeHelper(); + } + } + } + + return _instance; + } + } + + /// + /// Initializes a new instance of the class. + /// + private ArchetypeHelper() { var dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver(); - dcr.DefaultMembersSearchFlags |= System.Reflection.BindingFlags.NonPublic; + dcr.DefaultMembersSearchFlags |= BindingFlags.NonPublic; _jsonSettings = new JsonSerializerSettings { ContractResolver = dcr }; _app = ApplicationContext.Current; + _globalSettings = new ArchetypeGlobalSettings(); } /// /// Gets the json serializer settings. /// - /// - /// The json serializer settings. - /// + /// The json serializer settings. internal JsonSerializerSettings JsonSerializerSettings { get { return _jsonSettings; } } /// @@ -51,7 +93,7 @@ namespace Archetype.Extensions /// /// The source JSON. /// The data type pre values. - /// + /// ArchetypeModel. internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, PreValueCollection dataTypePreValues) { try @@ -83,7 +125,7 @@ namespace Archetype.Extensions /// The source JSON. /// The data type identifier. /// Type of the host content. - /// + /// ArchetypeModel. internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, int dataTypeId, PublishedContentType hostContentType = null) { try @@ -113,7 +155,7 @@ namespace Archetype.Extensions /// Determines whether datatypeId has had it's PVC overridden. /// /// The data type identifier. - /// + /// true if [is property value converter overridden] [the specified data type identifier]; otherwise, false. internal bool IsPropertyValueConverterOverridden(int dataTypeId) { var prevalues = GetArchetypePreValueFromDataTypeId(dataTypeId); @@ -124,29 +166,79 @@ namespace Archetype.Extensions return prevalues.OverrideDefaultPropertyValueConverter; } + /// + /// Gets the global settings. + /// + /// ArchetypeGlobalSettings. internal ArchetypeGlobalSettings GetGlobalSettings() { return _globalSettings; } + /// + /// Sets the check for updates. + /// + /// if set to true [is checking]. internal void SetCheckForUpdates(bool isChecking) { _globalSettings.IsCheckingForUpdates = isChecking; _globalSettings.Save(); } - internal void CheckForUpdates() + /// + /// Checks for updates. + /// + /// ArchetypeUpdateNotification. + internal ArchetypeUpdateNotification CheckForUpdates() { - //http request - //send umb version - //send archetype version + try + { + using (var client = new HttpClient()) + { + var id = ConfigurationManager.AppSettings[Constants.IdAlias]; + + if (id == null) + { + id = Guid.NewGuid().ToString(); + } + + var content = new StringContent(new + { + umbracoVersion = ConfigurationManager.AppSettings[Constants.UmbracoVersionAlias], + archetypeVersion = DllVersion(), + id = id + }.ToString(), Encoding.UTF8, "application/json"); + + var response = client.PostAsync(new Uri(Constants.NotificationUrl), content).Result; + + if (response.StatusCode == HttpStatusCode.OK) + { + var responseString = response.Content.ReadAsStringAsync().Result; + + return JsonConvert.DeserializeObject(responseString); + } + + return new ArchetypeUpdateNotification + { + IsUpdateAvailable = false + }; + } + } + catch (Exception ex) + { + //if anything goes wrong let's make sure we don't break their site + return new ArchetypeUpdateNotification + { + IsUpdateAvailable = false + }; + } } /// /// Gets the archetype pre value from data type identifier. /// /// The data type identifier. - /// + /// ArchetypePreValue. private ArchetypePreValue GetArchetypePreValueFromDataTypeId(int dataTypeId) { return _app.ApplicationCache.RuntimeCache.GetCacheItem( @@ -171,7 +263,7 @@ namespace Archetype.Extensions /// Gets the archetype pre value from pre values collection. /// /// The data type pre values. - /// + /// ArchetypePreValue. private ArchetypePreValue GetArchetypePreValueFromPreValuesCollection(PreValueCollection dataTypePreValues) { var preValueAsString = dataTypePreValues.PreValuesAsDictionary.First().Value.Value; @@ -183,7 +275,7 @@ namespace Archetype.Extensions /// Gets the data type by unique identifier. /// /// The unique identifier. - /// + /// IDataTypeDefinition. internal IDataTypeDefinition GetDataTypeByGuid(Guid guid) { return (IDataTypeDefinition)ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem( @@ -196,6 +288,7 @@ namespace Archetype.Extensions /// /// The Archetype to add the additional metadata to /// The configuration of the Archetype + /// Type of the host content. private void RetrieveAdditionalProperties(ref ArchetypeModel archetype, ArchetypePreValue preValue, PublishedContentType hostContentType = null) { foreach (var fieldset in preValue.Fieldsets) @@ -221,7 +314,6 @@ namespace Archetype.Extensions /// /// Retrieves additional metadata that isn't available on the stored model of an ArchetypePreValue /// - /// The Archetype to add the additional metadata to /// The configuration of the Archetype private void RetrieveAdditionalProperties(ref ArchetypePreValue preValue) { @@ -233,5 +325,18 @@ namespace Archetype.Extensions } } } + + + /// + /// Gets the DLL version from the file. + /// + /// System.String. + internal string DllVersion() + { + var asm = Assembly.GetExecutingAssembly(); + var fvi = FileVersionInfo.GetVersionInfo(asm.Location); + + return fvi.FileVersion; + } } } \ No newline at end of file diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs new file mode 100644 index 0000000..efb5c6d --- /dev/null +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs @@ -0,0 +1,10 @@ +namespace Archetype.Models +{ + public class ArchetypeUpdateNotification + { + public bool IsUpdateAvailable { get; set; } + public string Headline { get; set; } + public string Type { get; set; } + public string Message { get; set; } + } +} diff --git a/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs b/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs index 47eb6ba..53871e3 100644 --- a/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs +++ b/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Archetype")] [assembly: AssemblyDescription("Archetype's supporting code library for Umbraco")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Imulus")] +[assembly: AssemblyCompany("Kevin Giszewski LLC")] [assembly: AssemblyProduct("Archetype")] [assembly: AssemblyCopyright("MIT Licensed")] [assembly: AssemblyTrademark("")] diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index c7cbc56..1890cb0 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -1,4 +1,4 @@ -angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource, archetypeGlobalConfigService, notificationService) { +angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource, archetypeGlobalConfigService, notificationsService) { //$scope.model.value = ""; //console.log($scope.model.value); @@ -17,12 +17,14 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio $scope.dllVersion = data.dllVersion; }); - archetypeGlobalConfigService.checkForUpdates().then(function() { - console.log("checked..."); - notificationService.showNotification({ - type: 'info', - message: 'A new version of Archetype is available!' - }); + archetypeGlobalConfigService.checkForUpdates().then(function(data) { + if(data.isUpdateAvailable) { + notificationsService.add({ + headline: data.headline, + type: data.type, + message: data.message + }); + } }); //ini the render model diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index 43a8ac7..83280a3 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -15,7 +15,7 @@
- +
diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index e44f1c7..69f9962 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -2,7 +2,8 @@

Archetype{{dllVersion}}

At a minimum your Archetype needs at least one fieldset with at least one property. You can configure it to allow for multiple types of fieldsets within a single Archetype and you can even add another Archetype as a property. Please use the link below for the full manual:

-

Archetype Manual

+

Archetype Manual | Terms of Service

+
  • From 6a7ac205bc88d4a71e7f77e7a161c0a8ccddc9ca Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Wed, 6 Sep 2017 19:53:25 -0400 Subject: [PATCH 03/12] Update the url to call and use JSON Convert --- app/Umbraco/Umbraco.Archetype/Constants.cs | 2 +- app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Constants.cs b/app/Umbraco/Umbraco.Archetype/Constants.cs index d01b68d..a091e19 100644 --- a/app/Umbraco/Umbraco.Archetype/Constants.cs +++ b/app/Umbraco/Umbraco.Archetype/Constants.cs @@ -16,6 +16,6 @@ public const string CheckForUpdatesAlias = "Archetype:CheckForUpdates"; public const string IdAlias = "Archetype:Id"; public const string UmbracoVersionAlias = "umbracoConfigurationStatus"; - public const string NotificationUrl = "https://api.gizmo42.com/v1/archetype/CheckForUpdates"; + public const string NotificationUrl = "https://api.gizmo42.com/v1/archetype/check-for-updates"; } } diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs index 489c3f4..737f1bf 100644 --- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs +++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs @@ -202,12 +202,13 @@ namespace Archetype.Extensions id = Guid.NewGuid().ToString(); } - var content = new StringContent(new + var content = new StringContent(JsonConvert.SerializeObject(new { umbracoVersion = ConfigurationManager.AppSettings[Constants.UmbracoVersionAlias], archetypeVersion = DllVersion(), id = id - }.ToString(), Encoding.UTF8, "application/json"); + }), Encoding.UTF8, "application/json"); + var response = client.PostAsync(new Uri(Constants.NotificationUrl), content).Result; From 0d55f0ed86c1e686a5a0b906988d7c39799154bc Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Wed, 6 Sep 2017 21:00:32 -0400 Subject: [PATCH 04/12] Add a URL to the notification --- .../Umbraco.Archetype/Api/ArchetypeDataTypeController.cs | 3 ++- .../Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs | 1 + app/controllers/config.controller.js | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index 5b8ad09..2676c8b 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -129,7 +129,8 @@ namespace Archetype.Api isUpdateAvailable = updateNotificationModel.IsUpdateAvailable, headline = updateNotificationModel.Headline, type = updateNotificationModel.Type, - message = updateNotificationModel.Message + message = updateNotificationModel.Message, + url = updateNotificationModel.Url }; } } diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs index efb5c6d..e99b1ff 100644 --- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs @@ -6,5 +6,6 @@ public string Headline { get; set; } public string Type { get; set; } public string Message { get; set; } + public string Url { get; set; } } } diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index 1890cb0..d015699 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -22,7 +22,8 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio notificationsService.add({ headline: data.headline, type: data.type, - message: data.message + message: data.message, + url: data.url }); } }); From 77ec2d7a9cc660e521907a21c7c670986059da17 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Wed, 6 Sep 2017 21:22:00 -0400 Subject: [PATCH 05/12] Update meta.json --- app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs | 3 +-- config/meta.json | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs index 737f1bf..4c78111 100644 --- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs +++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs @@ -208,8 +208,7 @@ namespace Archetype.Extensions archetypeVersion = DllVersion(), id = id }), Encoding.UTF8, "application/json"); - - + var response = client.PostAsync(new Uri(Constants.NotificationUrl), content).Result; if (response.StatusCode == HttpStatusCode.OK) diff --git a/config/meta.json b/config/meta.json index e4c118a..b13e405 100644 --- a/config/meta.json +++ b/config/meta.json @@ -1,9 +1,9 @@ { "name": "Archetype", "version": "1.16.0", - "url": "http://github.com/imulus/archetype/", - "author": "Imulus - Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Et. Al.", - "authorUrl": "http://imulus.com/", + "url": "http://github.com/kgiszewski/archetype/", + "author": "Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Nicholas Westby - Et. Al.", + "authorUrl": "http://github.com/kgiszewski/archetype/", "license": "MIT", "licenseUrl": "http://opensource.org/licenses/MIT" } \ No newline at end of file From a127dac03a5476208706e38b84b2f5e4a796fac4 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Thu, 7 Sep 2017 08:55:26 -0400 Subject: [PATCH 06/12] Move off the web.config in favor of an Archetype config --- .../Api/ArchetypeDataTypeController.cs | 11 +- .../Archetype.Umbraco.csproj | 2 +- app/Umbraco/Umbraco.Archetype/Constants.cs | 2 - .../Umbraco.Archetype/Events/StartUp.cs | 38 ------ .../Extensions/ArchetypeHelper.cs | 36 +----- .../Models/ArchetypeConfigFileModel.cs | 10 ++ .../Models/ArchetypeGlobalSettings.cs | 110 +++++++++++++----- app/controllers/config.global.controller.js | 9 +- .../archetype.config.developer.dialog.html | 2 +- 9 files changed, 101 insertions(+), 119 deletions(-) delete mode 100644 app/Umbraco/Umbraco.Archetype/Events/StartUp.cs create mode 100644 app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index 2676c8b..015f3b5 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -9,6 +9,7 @@ using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.Editors; using Archetype.Extensions; +using Archetype.Models; namespace Archetype.Api { @@ -67,11 +68,14 @@ namespace Archetype.Api public object GetByGuid(Guid guid, string contentTypeAlias, string propertyTypeAlias, string archetypeAlias, int nodeId) { var dataType = Services.DataTypeService.GetDataTypeDefinitionById(guid); + if (dataType == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } + var dataTypeDisplay = Mapper.Map(dataType); + return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias, nodeId = nodeId }; } @@ -93,7 +97,7 @@ namespace Archetype.Api { return new { - isCheckingForUpdates = ArchetypeHelper.Instance.GetGlobalSettings().IsCheckingForUpdates + isCheckingForUpdates = ArchetypeGlobalSettings.Instance.CheckForUpdates }; } @@ -104,7 +108,8 @@ namespace Archetype.Api [HttpPost] public void SetCheckForUpdates([FromBody] bool isChecking) { - ArchetypeHelper.Instance.SetCheckForUpdates(isChecking); + ArchetypeGlobalSettings.Instance.CheckForUpdates = isChecking; + ArchetypeGlobalSettings.Instance.Save(); } /// @@ -114,7 +119,7 @@ namespace Archetype.Api [HttpPost] public object CheckForUpdates() { - if (!ArchetypeHelper.Instance.GetGlobalSettings().IsCheckingForUpdates) + if (!ArchetypeGlobalSettings.Instance.CheckForUpdates) { return new { diff --git a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj index 8a66dbf..015af80 100644 --- a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj +++ b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj @@ -232,7 +232,6 @@ - @@ -240,6 +239,7 @@ + diff --git a/app/Umbraco/Umbraco.Archetype/Constants.cs b/app/Umbraco/Umbraco.Archetype/Constants.cs index a091e19..7f3b77a 100644 --- a/app/Umbraco/Umbraco.Archetype/Constants.cs +++ b/app/Umbraco/Umbraco.Archetype/Constants.cs @@ -13,8 +13,6 @@ public const string CacheKey_PreValueFromDataTypeId = "Archetype_GetArchetypePreValueFromDataTypeId_"; - public const string CheckForUpdatesAlias = "Archetype:CheckForUpdates"; - public const string IdAlias = "Archetype:Id"; public const string UmbracoVersionAlias = "umbracoConfigurationStatus"; public const string NotificationUrl = "https://api.gizmo42.com/v1/archetype/check-for-updates"; } diff --git a/app/Umbraco/Umbraco.Archetype/Events/StartUp.cs b/app/Umbraco/Umbraco.Archetype/Events/StartUp.cs deleted file mode 100644 index 4731c9d..0000000 --- a/app/Umbraco/Umbraco.Archetype/Events/StartUp.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Web.Configuration; -using Umbraco.Core; - -namespace Archetype.Events -{ - public class StartUp : ApplicationEventHandler - { - protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { - base.ApplicationStarting(umbracoApplication, applicationContext); - - var config = WebConfigurationManager.OpenWebConfiguration("~"); - - //do we have an Archetype Id? - if (config.AppSettings.Settings[Constants.IdAlias] == null) - { - //guess we need one - config.AppSettings.Settings.Add(Constants.IdAlias, Guid.NewGuid().ToString()); - config.Save(); - } - else - { - //we have the setting, but is it a GUID? - Guid id; - - if (!Guid.TryParse(config.AppSettings.Settings[Constants.IdAlias].Value, out id)) - { - config.AppSettings.Settings.Remove(Constants.IdAlias); - config.AppSettings.Settings.Add(Constants.IdAlias, Guid.NewGuid().ToString()); - config.Save(); - } - - //guess we're g2g - } - } - } -} diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs index 4c78111..7bfb3ac 100644 --- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs +++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs @@ -31,17 +31,10 @@ namespace Archetype.Extensions /// The application /// protected ApplicationContext _app; - - /// - /// The global settings - /// - private readonly ArchetypeGlobalSettings _globalSettings; - /// /// The pad lock /// private static readonly object _padLock = new object(); - /// /// The instance /// @@ -79,7 +72,6 @@ namespace Archetype.Extensions _jsonSettings = new JsonSerializerSettings { ContractResolver = dcr }; _app = ApplicationContext.Current; - _globalSettings = new ArchetypeGlobalSettings(); } /// @@ -166,25 +158,6 @@ namespace Archetype.Extensions return prevalues.OverrideDefaultPropertyValueConverter; } - /// - /// Gets the global settings. - /// - /// ArchetypeGlobalSettings. - internal ArchetypeGlobalSettings GetGlobalSettings() - { - return _globalSettings; - } - - /// - /// Sets the check for updates. - /// - /// if set to true [is checking]. - internal void SetCheckForUpdates(bool isChecking) - { - _globalSettings.IsCheckingForUpdates = isChecking; - _globalSettings.Save(); - } - /// /// Checks for updates. /// @@ -195,18 +168,11 @@ namespace Archetype.Extensions { using (var client = new HttpClient()) { - var id = ConfigurationManager.AppSettings[Constants.IdAlias]; - - if (id == null) - { - id = Guid.NewGuid().ToString(); - } - var content = new StringContent(JsonConvert.SerializeObject(new { umbracoVersion = ConfigurationManager.AppSettings[Constants.UmbracoVersionAlias], archetypeVersion = DllVersion(), - id = id + id = ArchetypeGlobalSettings.Instance.Id }), Encoding.UTF8, "application/json"); var response = client.PostAsync(new Uri(Constants.NotificationUrl), content).Result; diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs new file mode 100644 index 0000000..c5218e3 --- /dev/null +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace Archetype.Models +{ + public class ArchetypeConfigFileModel + { + public Guid Id { get; set; } + public bool OptInNewVersionNotification { get; set; } + } +} diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs index a3c8d49..0120a12 100644 --- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs @@ -1,56 +1,104 @@ -using System.Web.Configuration; +using System; +using System.IO; +using Newtonsoft.Json; +using Umbraco.Core.IO; +using Umbraco.Core.Logging; namespace Archetype.Models { public class ArchetypeGlobalSettings { - private bool? _isCheckingForUpdates; + public bool CheckForUpdates { get; set; } + public Guid Id { get; set; } - public bool IsCheckingForUpdates + private static ArchetypeGlobalSettings _instance; + + private static string _pathToConfig = @"~/Config/Archetype.config.js"; + + private static readonly string _mappedPathToConfig = IOHelper.MapPath(_pathToConfig); + + private static object _padLock = new object(); + + private ArchetypeGlobalSettings() + { + + } + + public static ArchetypeGlobalSettings Instance { get { - if (_isCheckingForUpdates == null) + if (_instance == null) { - var setting = WebConfigurationManager.AppSettings[Constants.CheckForUpdatesAlias]; - - if (setting == null) + lock (_padLock) { - _isCheckingForUpdates = true; - } + if (_instance == null) + { + _instance = new ArchetypeGlobalSettings(); - var settingValue = true; - - if (bool.TryParse(setting, out settingValue)) - { - _isCheckingForUpdates = settingValue; - } - else - { - _isCheckingForUpdates = true; + _loadSettingsFromConfigFile(); + } } } - return _isCheckingForUpdates.Value; - } - - set - { - _isCheckingForUpdates = value; + return _instance; } } public void Save() { - var config = WebConfigurationManager.OpenWebConfiguration("~"); - - if (config.AppSettings.Settings[Constants.CheckForUpdatesAlias] != null) + //write to JSON + var configFileModel = new ArchetypeConfigFileModel { - config.AppSettings.Settings.Remove(Constants.CheckForUpdatesAlias); - } + Id = _instance.Id, + OptInNewVersionNotification = _instance.CheckForUpdates + }; - config.AppSettings.Settings.Add(Constants.CheckForUpdatesAlias, IsCheckingForUpdates.ToString()); - config.Save(); + var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented); + + File.WriteAllText(_mappedPathToConfig, serializedJson); + } + + private static void _loadSettingsFromConfigFile() + { + try + { + if (File.Exists(_mappedPathToConfig)) + { + //load + var deserializedConfigFile = JsonConvert.DeserializeObject(File.ReadAllText(_mappedPathToConfig)); + + if (deserializedConfigFile != null) + { + _instance.Id = deserializedConfigFile.Id; + _instance.CheckForUpdates = deserializedConfigFile.OptInNewVersionNotification; + } + else + { + _createNewConfigFile("Config file model was null!"); + } + } + else + { + _createNewConfigFile("Config file was missing!"); + } + } + catch (Exception ex) + { + LogHelper.Error(ex.Message, ex); + + _createNewConfigFile("Exception!"); + } + } + + private static void _createNewConfigFile(string reason) + { + //write a new file with defaults + LogHelper.Info(string.Format("Generating a new config file reason: {0}", reason)); + + _instance.Id = Guid.NewGuid(); + _instance.CheckForUpdates = true; + _instance.Save(); } } } diff --git a/app/controllers/config.global.controller.js b/app/controllers/config.global.controller.js index 27cab86..948ad93 100644 --- a/app/controllers/config.global.controller.js +++ b/app/controllers/config.global.controller.js @@ -2,14 +2,7 @@ angular.module('umbraco').controller('ArchetypeConfigGlobalOptionsController', f $scope.globalSettings = {}; $scope.confirmCheckNewVersionChange = function() { - if(confirm("By changing this value, it will cause a restart of the app domain, are you sure?")) - { - archetypeGlobalConfigService.setCheckForUpdates($scope.globalSettings.checkForNewVersion); - } - else - { - $scope.globalSettings.checkForNewVersion = !$scope.globalSettings.checkForNewVersion; - } + archetypeGlobalConfigService.setCheckForUpdates($scope.globalSettings.checkForNewVersion); } function getGlobalSettings() diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index 83280a3..19a3851 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -12,7 +12,7 @@
    - +
    From 757ba890f57d61e75e65884dde8d31a983451035 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Thu, 7 Sep 2017 09:03:39 -0400 Subject: [PATCH 07/12] Update links and blurb in the config --- app/less/archetype.less | 4 ++++ app/views/archetype.config.html | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/less/archetype.less b/app/less/archetype.less index 0c87813..da2c9ef 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -429,6 +429,10 @@ .manual-link { color: blue; } + + .donate-link { + font-weight: 700; + } ul { list-style: none; diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 69f9962..9f7c699 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,8 +1,13 @@ {{VERSION_HTML}}

    Archetype{{dllVersion}}

    -

    At a minimum your Archetype needs at least one fieldset with at least one property. You can configure it to allow for multiple types of fieldsets within a single Archetype and you can even add another Archetype as a property. Please use the link below for the full manual:

    -

    Archetype Manual | Terms of Service

    +

    At a minimum your Archetype needs at least one fieldset with at least one property. Please use the link below for the full manual. We would really love a donation if you find Archetype useful. If your company wants to sponsor this project, please get in touch!

    +

    + Archetype Manual | + Terms of Service | + Quick Start Video | + +

    • From a54170b915dc5fa1017f2a2c656e0d13b107e195 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Thu, 7 Sep 2017 09:08:47 -0400 Subject: [PATCH 08/12] Naming is hard. --- .../Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs | 2 +- .../Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs index c5218e3..ad95261 100644 --- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs @@ -5,6 +5,6 @@ namespace Archetype.Models public class ArchetypeConfigFileModel { public Guid Id { get; set; } - public bool OptInNewVersionNotification { get; set; } + public bool CheckForUpdates { get; set; } } } diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs index 0120a12..7a67bb3 100644 --- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs @@ -51,7 +51,7 @@ namespace Archetype.Models var configFileModel = new ArchetypeConfigFileModel { Id = _instance.Id, - OptInNewVersionNotification = _instance.CheckForUpdates + CheckForUpdates = _instance.CheckForUpdates }; var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented); @@ -71,7 +71,7 @@ namespace Archetype.Models if (deserializedConfigFile != null) { _instance.Id = deserializedConfigFile.Id; - _instance.CheckForUpdates = deserializedConfigFile.OptInNewVersionNotification; + _instance.CheckForUpdates = deserializedConfigFile.CheckForUpdates; } else { From 078f4a506eeede682494842d08d3c8019ca102be Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Thu, 7 Sep 2017 11:01:29 -0400 Subject: [PATCH 09/12] Add obfuscation --- .../Extensions/ArchetypeHelper.cs | 4 ++- .../Models/ArchetypeGlobalSettings.cs | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs index 7bfb3ac..837a67b 100644 --- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs +++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs @@ -174,7 +174,9 @@ namespace Archetype.Extensions archetypeVersion = DllVersion(), id = ArchetypeGlobalSettings.Instance.Id }), Encoding.UTF8, "application/json"); - + + client.DefaultRequestHeaders.Add("x-api-key-id", ArchetypeGlobalSettings.Instance.ApiKey.ToString()); + var response = client.PostAsync(new Uri(Constants.NotificationUrl), content).Result; if (response.StatusCode == HttpStatusCode.OK) diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs index 7a67bb3..b45594d 100644 --- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.IO; +using System.Text; using Newtonsoft.Json; using Umbraco.Core.IO; using Umbraco.Core.Logging; @@ -11,6 +13,8 @@ namespace Archetype.Models public bool CheckForUpdates { get; set; } public Guid Id { get; set; } + public Guid ApiKey = _getApiKey(); + private static ArchetypeGlobalSettings _instance; private static string _pathToConfig = @"~/Config/Archetype.config.js"; @@ -100,5 +104,29 @@ namespace Archetype.Models _instance.CheckForUpdates = true; _instance.Save(); } + + private static Guid _getApiKey() + { + //this is just obfuscation and an attempt to keep out most but not the determined hacker + var array = new [] + { + "RTA4MUZDRjA=", + "NzkzQS1BRDIw", + "OTI3QjFDNjkwQTYy", + "MjI0OQ==" + }; + + return new Guid(string.Format("{0}-{1}-{3}-{2}", + _decodeBase64(array[0]), + _decodeBase64(array[1]), + _decodeBase64(array[2]), + _decodeBase64(array[3]) + )); + } + + private static string _decodeBase64(string input) + { + return Encoding.UTF8.GetString(Convert.FromBase64String(input)); + } } } From 6a9c56df5848d55582173a653f3e71abb96d5d40 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Thu, 7 Sep 2017 13:13:37 -0400 Subject: [PATCH 10/12] Add locking to the file saving. Update casing on English lang files. --- .../Models/ArchetypeGlobalSettings.cs | 18 ++++++++++-------- app/langs/en-gb.js | 4 ++-- app/langs/en-us.js | 4 ++-- app/langs/en.js | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs index b45594d..58de79c 100644 --- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; @@ -51,16 +50,19 @@ namespace Archetype.Models public void Save() { - //write to JSON - var configFileModel = new ArchetypeConfigFileModel + lock (_padLock) { - Id = _instance.Id, - CheckForUpdates = _instance.CheckForUpdates - }; + //write to JSON + var configFileModel = new ArchetypeConfigFileModel + { + Id = _instance.Id, + CheckForUpdates = _instance.CheckForUpdates + }; - var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented); + var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented); - File.WriteAllText(_mappedPathToConfig, serializedJson); + File.WriteAllText(_mappedPathToConfig, serializedJson); + } } private static void _loadSettingsFromConfigFile() diff --git a/app/langs/en-gb.js b/app/langs/en-gb.js index 85889b5..d141e13 100644 --- a/app/langs/en-gb.js +++ b/app/langs/en-gb.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", diff --git a/app/langs/en-us.js b/app/langs/en-us.js index bdde762..65401c4 100644 --- a/app/langs/en-us.js +++ b/app/langs/en-us.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", diff --git a/app/langs/en.js b/app/langs/en.js index bdde762..65401c4 100644 --- a/app/langs/en.js +++ b/app/langs/en.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", From 7d8a6e28fa8c3e15c8ebe4e2945cde5efaa9b048 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Thu, 7 Sep 2017 14:15:28 -0400 Subject: [PATCH 11/12] Test Sponsors --- app/less/archetype.less | 20 ++++++++++++++++++++ app/views/archetype.config.html | 13 ++++++++++--- assets/tonic_logo_50.png | Bin 0 -> 4850 bytes 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 assets/tonic_logo_50.png diff --git a/app/less/archetype.less b/app/less/archetype.less index da2c9ef..190b47f 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -357,6 +357,7 @@ } } } + .settings { padding: 14px; background-color: #f8f8f8; @@ -391,6 +392,7 @@ .archetypeEditorControls { float: right; } + .archetypeEditorControls, .archetypeFieldsetGroups { i { cursor: pointer; @@ -433,6 +435,22 @@ .donate-link { font-weight: 700; } + + .sponsors { + padding-bottom: 10px; + margin-bottom: 5px; + margin-left: 5px; + display: inline-table; + float: right; + + a { + float: none; + } + + h4 { + border-bottom: 1px solid #ccc; + } + } ul { list-style: none; @@ -453,6 +471,8 @@ .archetypeFieldsets { margin-left: 0; + border-top: 5px solid; + padding-top: 5px; } .archetypeFieldsetWrapper { diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 9f7c699..4eef37c 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,12 +1,19 @@ {{VERSION_HTML}}
      -

      Archetype{{dllVersion}}

      -

      At a minimum your Archetype needs at least one fieldset with at least one property. Please use the link below for the full manual. We would really love a donation if you find Archetype useful. If your company wants to sponsor this project, please get in touch!

      +

      Archetype{{dllVersion}} +
      +

      Our Sponsors

      + +
      +

      +

      At a minimum your Archetype needs at least one fieldset with at least one property. Please use the link below for the full manual. We would really love a donation if you find Archetype useful. Be sure to visit our sponsors!

      Archetype Manual | Terms of Service | Quick Start Video | - + Twitter | + GitHub | +

        diff --git a/assets/tonic_logo_50.png b/assets/tonic_logo_50.png new file mode 100644 index 0000000000000000000000000000000000000000..29eb5e40125903873f8c640689a7e606a3477105 GIT binary patch literal 4850 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 Y0Q&By-(9xotN;K207*qoM6N<$g0{5}xBvhE literal 0 HcmV?d00001 From 9a2e14d8f6fa7283183f4d3b61cc138b038b865c Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Fri, 8 Sep 2017 09:09:38 -0400 Subject: [PATCH 12/12] Add sponsors --- app/views/archetype.config.html | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 4eef37c..440e8f3 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,18 +1,14 @@ {{VERSION_HTML}}
        -

        Archetype{{dllVersion}} -
        -

        Our Sponsors

        - -
        -

        -

        At a minimum your Archetype needs at least one fieldset with at least one property. Please use the link below for the full manual. We would really love a donation if you find Archetype useful. Be sure to visit our sponsors!

        +

        Archetype{{dllVersion}}

        +

        At a minimum your Archetype needs at least one fieldset with at least one property. Please use the link below for the full manual. We would really love a donation if you find Archetype useful. Your company can also sponsor a sprint!

        Archetype Manual | Terms of Service | Quick Start Video | Twitter | GitHub | + Become a sponsor |