diff --git a/.gitignore b/.gitignore
index 5e0d59a..89a7373 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,4 +12,48 @@ $RECYCLE.BIN/
dist/
node_modules/
-pkg/
\ No newline at end of file
+pkg/tmp/
+pkg/*.nupkg
+
+[Dd]ebug/
+[Bb]uild/
+[Rr]elease/
+[Bb]in/
+[Oo]bj/
+[Pp]ackages/
+
+*.aps
+*.bak
+*.backup
+*.build.csdef
+*.cache
+*.ilk
+*.lib
+*.log
+*.meta
+*.ncb
+*.obj
+*.orig
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.scc
+*.sdf
+*.sln.docstates
+*.suo
+*.tlb
+*.tlh
+*.tli
+*.tmp
+*.user
+*.vspscc
+*.[Pp]ublish.xml
+*_i.c
+*_p.c
+.builds
+.svn
+.hg
+.hgignore
\ No newline at end of file
diff --git a/Gruntfile.js b/Gruntfile.js
index 0ea5251..febcf19 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,6 +2,9 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
dest: 'dist',
+ version: '0.0.0',
+ package_dir: 'pkg',
+ package_temp_dir: '<%= package_dir %>/tmp/',
watch: {
less: {
@@ -56,22 +59,56 @@ module.exports = function(grunt) {
application: {
src: [
'app/controllers/controller.js',
- 'app/directives/archetypeproperty.js'
+ 'app/controllers/config.controller.js',
+ 'app/directives/archetypeproperty.js',
+ 'app/services/propertyeditor.js'
],
dest: '<%= dest %>/js/archetype.js'
}
},
+ nugetpack: {
+ dist: {
+ src: '<%= package_temp_dir %>/nuget/package.nuspec',
+ dest: '<%= package_dir %>'
+ }
+ },
+
+ template: {
+ 'nuget_manifest': {
+ 'options': {
+ 'data': {
+ version: '<%= version %>',
+ files: [{ path: '..\\..\\..\\<%= dest %>\\**', target: 'content\\App_Plugins\\Archetype'}]
+ }
+ },
+ 'files': {
+ '<%= package_temp_dir %>/nuget/package.nuspec': ['<%= package_dir %>/nuget/package.nuspec']
+ }
+ }
+ },
+
+ clean: {
+ build: ['<%= dest %>'],
+ package_temp: ['<%= package_temp_dir %>']
+ },
+
copy: {
build: {
files: [
{expand: true, cwd: 'app/', src: ['package.manifest'], dest: '<%= dest %>', flatten: true},
- {expand: true, cwd: 'app/views/', src: ['archetype.html'], dest: '<%= dest %>/views', flatten: true}
+ {expand: true, cwd: 'app/config/', src: ['config.views.js'], dest: '<%= dest %>/js', flatten: true},
+ {expand: true, cwd: 'app/views/', src: ['archetype.html', 'archetype.config.html'], dest: '<%= dest %>/views', flatten: true}
]
},
deploy: {
files: [
- {expand: true, cwd: '<%= dest %>/', src: ['**'], dest: '<%= grunt.option("target") %>\\App_Plugins\\Imulus.Archetype', flatten: false},
+ {expand: true, cwd: '<%= dest %>/', src: ['**'], dest: '<%= grunt.option("target") %>\\App_Plugins\\Archetype', flatten: false},
+ ]
+ },
+ nuget_prepare: {
+ files: [
+ {expand: true, cwd: '<%= dest %>/', src: ['**'], dest: '<%= package_temp_dir %>/nuget/content/', flatten: false},
]
},
umbracopackage: {
@@ -105,6 +142,7 @@ module.exports = function(grunt) {
},
clean: ['<%= dest %>']
+ }
});
@@ -115,10 +153,13 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-nuget');
+ grunt.loadNpmTasks('grunt-template');
grunt.loadNpmTasks('grunt-touch');
grunt.loadTasks('tasks');
+ grunt.registerTask('package:nuget', ['default', 'clean:package_temp', 'copy:nuget_prepare', 'template:nuget_manifest', 'nugetpack', 'clean:package_temp']);
grunt.registerTask('touchwebconfigifenabled', function() { if (grunt.option("touch")) grunt.task.run("touch:webconfig") });
grunt.registerTask('deploy', ['default', 'copy:deploy', 'touchwebconfigifenabled']);
grunt.registerTask('package:umbraco', ['copy:umbracopackage', 'umbracoPackage']);
diff --git a/README.md b/README.md
index 91f68fb..a6e5a9e 100644
--- a/README.md
+++ b/README.md
@@ -41,164 +41,11 @@ Your /App_Plugins should contain this structure:
## Prevalue Configs ##
Most of the fields are self evident, the following fields will be discussed further:
-
-###Empty Fieldset Models###
-This option is required and defines the fieldsets and their properties.
-
-If you get a YSOD regarding truncating of data, it's b/c Umbraco has a arbitrarily low limit on the number of characters (2500) allowed as prevalues in the DB.
-See: http://issues.umbraco.org/issue/U4-2120
-
-An example follows below:
-
- ( //note that this needs to start with an open parentheses and notice the closing one at the end of this. This avoids issues with only seeing [object].
- [ //this array holds the array of fieldset objects
- { //fieldset object
- alias: "FS1", //fieldset alias (unique)
- tooltip: "This is for fieldset 1", //used as a helper text
- icon: "/umbraco/Images/aboutNew.png", //a custom icon
- label: "Fieldset 1", //the fieldset label
- headerText: "Please fill out the boxes.", // text to be prepended to the fieldset properties?
- footerText: "Thanks!", //text to be appended to the fieldset properties?
- properties:[ //an array of property objects
- {
- alias: "firstName", //uniquely name the property (unique to the fieldset)
- label: "First Name", //a label to use
- helpText: "(Required)", //a note that will appear under the label
- view: "/umbraco/views/propertyeditors/textbox/textbox.html", //a path to a view
- value: "", //set to none or set to a default; can be json (if the view understands it)
- config: { //pass configs to the view; configs are based on the view used
-
- }
- },
- { //another property
- alias: "lastName",
- label: "Last Name",
- helpText: "(Required)",
- view: "/umbraco/views/propertyeditors/textbox/textbox.html",
- value: "",
- config: {
-
- }
- },
- {
- alias: "age",
- label: "Age",
- helpText: "(Optional)",
- view: "/umbraco/views/propertyeditors/textbox/textbox.html",
- value: "",
- config: {
-
- }
- },
- {
- alias: "blah",
- label: "Blah",
- helpText: "",
- view: "/umbraco/views/propertyeditors/contentpicker/contentpicker.html",
- value: "",
- config: {
-
- }
- }
- ]
- },
- { //another fieldset
- alias: "FS2",
- tooltip: "This is for fieldset 2",
- icon: "/umbraco/Images/about.png",
- label: "Fieldset 2",
- headerText: "Please fill out the boxes.",
- footerText: "Thanks!",
- properties:[
- {
- alias: "foo",
- label: "Foo",
- helpText: "(Required)",
- view: "/umbraco/views/propertyeditors/textbox/textbox.html",
- value: "",
- config: {
-
- }
- },
- {
- alias: "bar",
- label: "Bar",
- helpText: "",
- view: "/umbraco/views/propertyeditors/textbox/textbox.html",
- value: "",
- config: {
-
- }
- }
- ]
- }
- ]
- )//close it
-
-###Default Model###
-Here is the spot to define a starting value. This model uses only the essential data that must be saved. This example shows multiple fieldsets with multiple properties:
-
- ( //again use a parenthesis to avoid [object]
- {
- "fieldsets": [
- {
- "alias": "FS2",
- "properties": [
- {
- "alias": "bar",
- "value": "Field"
- },
- {
- "alias": "foo",
- "value": "Another"
- }
- ]
- },
- {
- "alias": "FS2",
- "properties": [
- {
- "alias": "foo",
- "value": "The Foo Field"
- },
- {
- "alias": "bar",
- "value": "The Bar Field"
- }
- ]
- },
- {
- "alias": "FS1",
- "properties": [
- {
- "alias": "age",
- "value": "Old"
- },
- {
- "alias": "lastName",
- "value": "Giszewski"
- },
- {
- "alias": "firstName",
- "value": "Kevin"
- },
- {
- "alias": "blah",
- "value": ""
- }
- ]
- }
- ]
- }
- )
###Developer Mode###
By turning this on, you will get a textarea visible with the data model (not prevalue model). You can change the contents of the textarea for real-time editing. Additionally when in developer mode, the console will reflect the scope object of each property.
-###Sortable Options###
-Just in case you need to pass something into the jQueryUI sort options, you can override the default behavior by passing in a new JS snippet here.
-
##View Compatibility##
The basis of compatibility is based on the following:
diff --git a/app/Umbraco/.nuget/NuGet.Config b/app/Umbraco/.nuget/NuGet.Config
new file mode 100644
index 0000000..67f8ea0
--- /dev/null
+++ b/app/Umbraco/.nuget/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Umbraco/.nuget/NuGet.exe b/app/Umbraco/.nuget/NuGet.exe
new file mode 100644
index 0000000..8f61340
Binary files /dev/null and b/app/Umbraco/.nuget/NuGet.exe differ
diff --git a/app/Umbraco/.nuget/NuGet.targets b/app/Umbraco/.nuget/NuGet.targets
new file mode 100644
index 0000000..0f124b1
--- /dev/null
+++ b/app/Umbraco/.nuget/NuGet.targets
@@ -0,0 +1,136 @@
+
+
+
+ $(MSBuildProjectDirectory)\..\
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
+ $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
+
+
+
+
+ $(SolutionDir).nuget
+ packages.config
+
+
+
+
+ $(NuGetToolsPath)\NuGet.exe
+ @(PackageSource)
+
+ "$(NuGetExePath)"
+ mono --runtime=v4.0.30319 $(NuGetExePath)
+
+ $(TargetDir.Trim('\\'))
+
+ -RequireConsent
+ -NonInteractive
+
+ "$(SolutionDir) "
+ "$(SolutionDir)"
+
+
+ $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
+ $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
+
+
+
+ RestorePackages;
+ $(BuildDependsOn);
+
+
+
+
+ $(BuildDependsOn);
+ BuildPackage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Umbraco/Umbraco.Archetype.sln b/app/Umbraco/Umbraco.Archetype.sln
new file mode 100644
index 0000000..70ff40d
--- /dev/null
+++ b/app/Umbraco/Umbraco.Archetype.sln
@@ -0,0 +1,27 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Umbraco", "Umbraco.Archetype\Archetype.Umbraco.csproj", "{7D185D41-4228-4978-ACB8-83F9A48AD94F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D84AA4ED-85A6-484F-9E72-BE7AC9835821}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7D185D41-4228-4978-ACB8-83F9A48AD94F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7D185D41-4228-4978-ACB8-83F9A48AD94F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7D185D41-4228-4978-ACB8-83F9A48AD94F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7D185D41-4228-4978-ACB8-83F9A48AD94F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj
new file mode 100644
index 0000000..053a0bd
--- /dev/null
+++ b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj
@@ -0,0 +1,207 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {7D185D41-4228-4978-ACB8-83F9A48AD94F}
+ Library
+ Properties
+ Archetype.Umbraco
+ Archetype
+ v4.5
+ 512
+ ..\
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll
+
+
+ ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\businesslogic.dll
+
+
+ ..\packages\ClientDependency.1.7.0.4\lib\ClientDependency.Core.dll
+
+
+ ..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\cms.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\controls.dll
+
+
+ ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\Examine.dll
+
+
+ ..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll
+
+
+ ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\interfaces.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\log4net.dll
+
+
+ ..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\Microsoft.ApplicationBlocks.Data.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\Microsoft.Web.Helpers.dll
+
+
+ True
+ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
+
+
+ ..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll
+
+
+ ..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll
+
+
+ ..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll
+
+
+ ..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\SQLCE4Umbraco.dll
+
+
+
+
+ True
+ ..\packages\UmbracoCms.Core.7.0.1\lib\System.Data.SqlServerCe.dll
+
+
+ True
+ ..\packages\UmbracoCms.Core.7.0.1\lib\System.Data.SqlServerCe.Entity.dll
+
+
+
+ ..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll
+
+
+
+ True
+ ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll
+
+
+ ..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll
+
+
+ ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll
+
+
+ True
+ ..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll
+
+
+ True
+ ..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll
+
+
+ True
+ ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll
+
+
+ True
+ ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll
+
+
+ True
+ ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll
+
+
+
+
+
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\TidyNet.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\Umbraco.Core.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.DataLayer.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.editorControls.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.MacroEngines.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.providers.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\Umbraco.Web.UI.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.XmlSerializers.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\UmbracoExamine.dll
+
+
+ ..\packages\UmbracoCms.Core.7.0.1\lib\UrlRewritingNet.UrlRewriter.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs b/app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs
new file mode 100644
index 0000000..b875475
--- /dev/null
+++ b/app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Archetype.Umbraco.Extensions
+{
+ public static class Extensions
+ {
+ //lifted from the core as it is marked 'internal'
+ public static bool DetectIsJson(this string input)
+ {
+ input = input.Trim();
+ return input.StartsWith("{") && input.EndsWith("}")
+ || input.StartsWith("[") && input.EndsWith("]");
+ }
+ }
+}
diff --git a/app/Umbraco/Umbraco.Archetype/Models/Archetype.cs b/app/Umbraco/Umbraco.Archetype/Models/Archetype.cs
new file mode 100644
index 0000000..380e41b
--- /dev/null
+++ b/app/Umbraco/Umbraco.Archetype/Models/Archetype.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Archetype.Umbraco.Models
+{
+ public class Archetype
+ {
+ public IEnumerable