From 96aed2c25629a7db375f2bcf4fd58eb614fa0fd4 Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Sat, 29 Mar 2014 22:52:43 -0600 Subject: [PATCH 01/12] WIP --- app/views/archetype.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/archetype.html b/app/views/archetype.html index b565237..344d37f 100644 --- a/app/views/archetype.html +++ b/app/views/archetype.html @@ -25,7 +25,17 @@
- + + + +
From b7a8f5f581276fa2b51f216c605fb8f8c0b6009d Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Fri, 2 May 2014 09:20:59 -0400 Subject: [PATCH 02/12] Add try/catch with logging to prop converters --- .../ArcheTypePropertyEditor.cs | 52 +++++++++++++------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/PropertyEditors/ArcheTypePropertyEditor.cs b/app/Umbraco/Umbraco.Archetype/PropertyEditors/ArcheTypePropertyEditor.cs index e55ed1d..3192130 100644 --- a/app/Umbraco/Umbraco.Archetype/PropertyEditors/ArcheTypePropertyEditor.cs +++ b/app/Umbraco/Umbraco.Archetype/PropertyEditors/ArcheTypePropertyEditor.cs @@ -11,6 +11,7 @@ using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; using Umbraco.Web.PropertyEditors; +using Umbraco.Core.Logging; namespace Archetype.Umbraco.PropertyEditors { @@ -64,11 +65,18 @@ namespace Archetype.Umbraco.PropertyEditors { foreach (var propDef in fieldset.Properties) { - var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid)); - var propType = new PropertyType(dtd) { Alias = propDef.Alias }; - var prop = new Property(propType, propDef.Value); - var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias); - propDef.Value = propEditor.ValueEditor.ConvertDbToString(prop, propType, dataTypeService); + try + { + var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid)); + var propType = new PropertyType(dtd) { Alias = propDef.Alias }; + var prop = new Property(propType, propDef.Value); + var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias); + propDef.Value = propEditor.ValueEditor.ConvertDbToString(prop, propType, dataTypeService); + } + catch (Exception ex) + { + LogHelper.Error(ex.Message, ex); + } } } @@ -86,11 +94,18 @@ namespace Archetype.Umbraco.PropertyEditors { foreach (var propDef in fieldset.Properties) { - var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid)); - var propType = new PropertyType(dtd) { Alias = propDef.Alias }; - var prop = new Property(propType, propDef.Value); - var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias); - propDef.Value = propEditor.ValueEditor.ConvertDbToEditor(prop, propType, dataTypeService); + try + { + var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid)); + var propType = new PropertyType(dtd) { Alias = propDef.Alias }; + var prop = new Property(propType, propDef.Value); + var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias); + propDef.Value = propEditor.ValueEditor.ConvertDbToEditor(prop, propType, dataTypeService); + } + catch (Exception ex) + { + LogHelper.Error(ex.Message, ex); + } } } @@ -107,11 +122,18 @@ namespace Archetype.Umbraco.PropertyEditors { foreach (var propDef in fieldset.Properties) { - var dtd = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid)); - var preValues = ApplicationContext.Current.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dtd.Id); - var propData = new ContentPropertyData(propDef.Value, preValues, new Dictionary()); - var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias); - propDef.Value = propEditor.ValueEditor.ConvertEditorToDb(propData, propDef.Value); + try + { + var dtd = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid)); + var preValues = ApplicationContext.Current.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dtd.Id); + var propData = new ContentPropertyData(propDef.Value, preValues, new Dictionary()); + var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias); + propDef.Value = propEditor.ValueEditor.ConvertEditorToDb(propData, propDef.Value); + } + catch (Exception ex) + { + LogHelper.Error(ex.Message, ex); + } } } From 432a33eef8e0e331fb4ef038c07856de7640a4d4 Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Sat, 3 May 2014 00:32:18 -0600 Subject: [PATCH 03/12] Add `package` task that creates both packages to simplify CI Duplicated task steps to prevent needing to build multiple times but maintaining 'full build' in the individual package tasks --- Gruntfile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8bbb3d9..6bacbeb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -208,6 +208,7 @@ module.exports = function(grunt) { grunt.registerTask('default', ['clean', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:config', 'copy:html']); - grunt.registerTask('nuget', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'clean:tmp']); + grunt.registerTask('nuget', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'clean:tmp']); grunt.registerTask('umbraco', ['clean:tmp', 'default', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']); + grunt.registerTask('package', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']); }; \ No newline at end of file From 91fc5bbd7f2ede96e31d62f3bee439a2afc0b981 Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Sun, 4 May 2014 15:59:01 -0600 Subject: [PATCH 04/12] Fix rows not being added in correct position --- app/views/archetype.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/archetype.html b/app/views/archetype.html index 5e1134a..69800e0 100644 --- a/app/views/archetype.html +++ b/app/views/archetype.html @@ -23,8 +23,8 @@
-
- +