Compare commits
603 Commits
v0.4-alpha
...
v1.11
| Author | SHA1 | Date | |
|---|---|---|---|
| fd28df1bad | |||
| 165a98c89e | |||
| ca1214a09a | |||
| 17062c6913 | |||
| 16e73446fd | |||
| e56356534e | |||
| 21b933a0dc | |||
| e3a2b66022 | |||
| 645198444b | |||
| 0e9bef9048 | |||
| bd4398ff28 | |||
| a4f371a4ca | |||
| e465861da6 | |||
| 3fdfa2b2c6 | |||
| 9787af9ed6 | |||
| b8fc0fb71c | |||
| de7ed9328d | |||
| ee8b16eb9b | |||
| 5465c1c899 | |||
| 3402f216b9 | |||
| 490de7b3ff | |||
| 275b5d2207 | |||
| bc19e6dda1 | |||
| 3904b6527e | |||
| d5fd59b954 | |||
| e01c50f08a | |||
| 1e9c7d0a6c | |||
| 3cf153fc80 | |||
| 8e11a33031 | |||
| 5c95f59219 | |||
| 01b59f28f1 | |||
| f40e023420 | |||
| 6d9c32e30d | |||
| 2f48e9da9a | |||
| 2aa71e48a3 | |||
| e6732d2a37 | |||
| a7dca93781 | |||
| 0ec0e213a2 | |||
| 6919c5a8b4 | |||
| 6505323297 | |||
| ec8df1d465 | |||
| 451f2773a4 | |||
| f366305583 | |||
| 43a72ed5e5 | |||
| 709198f943 | |||
| 77f72ed72e | |||
| a03fe3af32 | |||
| 697a797c7e | |||
| cfe014ee45 | |||
| d62fa05ab5 | |||
| 662cf4c3bf | |||
| d0b8314134 | |||
| 8eb4786976 | |||
| 20155b5ca6 | |||
| 16c310f3c6 | |||
| 99d570dc97 | |||
| 2ae3e3ade9 | |||
| d4718e358c | |||
| bb91eb7036 | |||
| 484f2c22a3 | |||
| a2121cd8a7 | |||
| 2fb922fd6c | |||
| c2986d39a9 | |||
| 8ee5488261 | |||
| c60c9e1c5d | |||
| 8610f69c88 | |||
| 34b4209de7 | |||
| b6145c9275 | |||
| f51ca65659 | |||
| d026af9fd2 | |||
| 11fff5da1a | |||
| 788a5dd720 | |||
| 24e232b2cc | |||
| 5bdcb23933 | |||
| 34b3ed3b47 | |||
| 50a486a9ac | |||
| 4f4128a744 | |||
| 4851797a83 | |||
| 54a435dce7 | |||
| 03a170d716 | |||
| 37976abc84 | |||
| f7e96438be | |||
| f1c3caae2d | |||
| 8f8078e12f | |||
| dbc9b872d8 | |||
| eef1b94586 | |||
| 9bbf366fe2 | |||
| 368a9f6c07 | |||
| d3b3f80f3d | |||
| 11f7881dd7 | |||
| 9894357469 | |||
| 146a3770a1 | |||
| caf9d1ac15 | |||
| 614595ceb3 | |||
| d1b21a1ca7 | |||
| 54bc507049 | |||
| 037585458c | |||
| f52649eb9e | |||
| 423fedb954 | |||
| b39312ccd2 | |||
| b9c4be0bb6 | |||
| 29285607a9 | |||
| 909b87cea0 | |||
| 3d25f75fb9 | |||
| 6fa713f88e | |||
| d9982fe3a2 | |||
| 588bdfe429 | |||
| 0174f6d78b | |||
| 84144b6206 | |||
| 27910e8d22 | |||
| 9bf413207f | |||
| e5cd3d0cb0 | |||
| 032ee958c1 | |||
| ef5bd7ccc8 | |||
| 7839e4a992 | |||
| 408c178348 | |||
| 852b7a92a7 | |||
| 5a4118a1cc | |||
| 4b603bf97f | |||
| c8884c8d92 | |||
| dd843ce2c6 | |||
| 8036ab72d0 | |||
| b25d8bdc4b | |||
| 023d99cc88 | |||
| 1cc0586c75 | |||
| a16b61f03f | |||
| 7ea01cad86 | |||
| aea65a531d | |||
| 482cb5a149 | |||
| 81ac5fbddb | |||
| 801baf355b | |||
| a3b531caa4 | |||
| 1d680c612e | |||
| cdea3c1aec | |||
| 37fa9c40d6 | |||
| 774ba46e13 | |||
| 280a97c8d1 | |||
| 7dd3848bdf | |||
| add44e533a | |||
| 870b848e3b | |||
| b262d8a86f | |||
| 5dba1a0895 | |||
| 8f4857aba1 | |||
| cd95404a08 | |||
| 7e7a4aff58 | |||
| c9d8952b7f | |||
| 890b5674a6 | |||
| 7f5dbd31c9 | |||
| a2255aa037 | |||
| 415a84f5c0 | |||
| 3a0eba401a | |||
| 991d56dac1 | |||
| f704088bcb | |||
| a599215620 | |||
| a6e76cb398 | |||
| 4fd134ac74 | |||
| 22b87c0a37 | |||
| d707b55362 | |||
| 37a195109c | |||
| 205919ccae | |||
| 04e57b7d6b | |||
| 9e8cc0c556 | |||
| 8fe90c3b86 | |||
| 99581b0aeb | |||
| d8939c59a0 | |||
| e49fe6ee17 | |||
| ca52f0a216 | |||
| 08d4e4b51d | |||
| e9c51ee96e | |||
| b5f281cae0 | |||
| 3bbb27f85e | |||
| 247eea3477 | |||
| 8635fa7301 | |||
| e49a8d947d | |||
| 3e2e43d342 | |||
| 78ba99a52e | |||
| 42efa1a3d4 | |||
| d2f4fce808 | |||
| d76a5f58d4 | |||
| f6457416cc | |||
| c841813a74 | |||
| bcc7be94e7 | |||
| e200c22244 | |||
| 244db7f19d | |||
| 31f3d00b76 | |||
| 07125bae84 | |||
| f2a8286f00 | |||
| 5725c0770e | |||
| 210fbb8230 | |||
| c8e398c726 | |||
| bfa882fa01 | |||
| 876aea4007 | |||
| 07750c7537 | |||
| 17a1577d09 | |||
| 987f383139 | |||
| dc14f11f83 | |||
| 500f4c4dee | |||
| a16451df1f | |||
| 9ac7877174 | |||
| 4d3bcb68b3 | |||
| 30074fe198 | |||
| 7f0bd45a9d | |||
| 6045eed5c5 | |||
| 57ffa69ff5 | |||
| 6b61dc978a | |||
| c20aa64af2 | |||
| 25826958a3 | |||
| b5bfbb5c25 | |||
| 9afaa024c0 | |||
| c58dcd80ff | |||
| b7c16ee6ef | |||
| 786c547e0b | |||
| fbf686f559 | |||
| 42b4076700 | |||
| 5feb415093 | |||
| 79c85cf86b | |||
| a0f65370c9 | |||
| 029d17c428 | |||
| e262d7b0c9 | |||
| 44ea6c56f5 | |||
| d7477eaf6d | |||
| c33649201f | |||
| 3940955360 | |||
| 03f66a35f7 | |||
| b4b60dd89c | |||
| 4105912394 | |||
| 7b3d31f897 | |||
| 50861badf1 | |||
| fa682c3717 | |||
| d18d1ff0b1 | |||
| 247491187a | |||
| 80194786a1 | |||
| 72ee7b3d09 | |||
| 284b1d93dc | |||
| 7c5a3c34e2 | |||
| fa970750d1 | |||
| aeeb3c7b40 | |||
| bdd3c2088c | |||
| 80b41e4a5f | |||
| d60e7ba2f4 | |||
| 4524320db2 | |||
| 90ca77c9a9 | |||
| 8332a841eb | |||
| d6a13b2335 | |||
| 987e5cf470 | |||
| f2e5b83795 | |||
| 066e807847 | |||
| d8378ed6bb | |||
| 19ee2b890c | |||
| c953f12412 | |||
| 601f2c0d81 | |||
| 283dd8af76 | |||
| c83942dc5c | |||
| a0ff42a84f | |||
| ed97d586b4 | |||
| 1bd09799b4 | |||
| 0b77ddeef1 | |||
| 2b2d0b4b0d | |||
| dc992293e1 | |||
| 0bc1451a5c | |||
| f052ed70a9 | |||
| 0dedd7fb2d | |||
| cb6455c34a | |||
| f99ef697db | |||
| aac015dc0b | |||
| f7ef096ba6 | |||
| a17e5b5372 | |||
| 16a73e0c82 | |||
| a56864b731 | |||
| 2f195dd588 | |||
| 35309b863c | |||
| da9085c244 | |||
| 1d8703e211 | |||
| 0ebf07d0f4 | |||
| fdcd6cc3bf | |||
| 59179d0c81 | |||
| 16f8d9fb2a | |||
| cfffa89138 | |||
| 2b4cc2c429 | |||
| 9c82018903 | |||
| 386a1a58fc | |||
| 9aaa490eb0 | |||
| ec446b6800 | |||
| 67f21ee4d8 | |||
| 0573d99218 | |||
| a520d86ec4 | |||
| 3c9b7692f1 | |||
| 51223d4ac7 | |||
| 1d5f91964f | |||
| 0accac26ee | |||
| 1cbb7b3173 | |||
| 0048330863 | |||
| d07c16160a | |||
| 6527e66ff3 | |||
| 47e71067a1 | |||
| 969cc45e9b | |||
| 9ff5bfc907 | |||
| 7cdcb940bd | |||
| 75e0ac5d6d | |||
| 310771303c | |||
| 71be453ada | |||
| ba6921fdb9 | |||
| efae05b3ae | |||
| aafeebfc62 | |||
| 84acd43ccf | |||
| 8624617ad4 | |||
| e46e5c279f | |||
| a9dc79e4ff | |||
| 485c6cb6a1 | |||
| 8e7eda9276 | |||
| 96d70bc1a9 | |||
| 264208dcc7 | |||
| 077ab44dc8 | |||
| 7499395807 | |||
| d983b75be3 | |||
| 381875bc14 | |||
| 3944da57b1 | |||
| 0cbbd1c93e | |||
| 9fe756bacb | |||
| 1bfab0f8a3 | |||
| b6d2b7e1dd | |||
| 1179147041 | |||
| 0cfcaa3364 | |||
| cd03b5a4f9 | |||
| 07a62d7edf | |||
| 14777a98dc | |||
| a306424162 | |||
| d124622089 | |||
| d9a25d1bb3 | |||
| cda17ac754 | |||
| d5329935aa | |||
| 537abea717 | |||
| c8d9b04a57 | |||
| 1913f8bf14 | |||
| 6f2eaa9859 | |||
| a6c166d926 | |||
| 31074ec9db | |||
| c1bc555443 | |||
| 32d0d199a3 | |||
| 715776771a | |||
| 4785c85b84 | |||
| 712ca3cd76 | |||
| 512ecbdb05 | |||
| 9a97e9102e | |||
| e9b2f4aeee | |||
| bdb7f247c3 | |||
| 08c09a8820 | |||
| ac84c35f67 | |||
| bff8bcc562 | |||
| 8fc209abc1 | |||
| a6a961d52a | |||
| b289892727 | |||
| 43a7202194 | |||
| 4051734313 | |||
| d4166f33e8 | |||
| 9a21ab0ef4 | |||
| 46613bbc01 | |||
| 4998acb59a | |||
| bc58078eec | |||
| d1d95aebe7 | |||
| ae242feed6 | |||
| f1df0f2ad9 | |||
| 1c9bce8b66 | |||
| 8d3e3aeb0a | |||
| a58c0154c9 | |||
| 9829ab796a | |||
| 75080b0e2d | |||
| 932f098837 | |||
| 6e50301da5 | |||
| 448bbe26f0 | |||
| 7c3c0e041d | |||
| 3b2559c37d | |||
| 2cc4fd711a | |||
| d5038a52d1 | |||
| d4cf60d5f3 | |||
| 09a3172c80 | |||
| 2bf2e5f91a | |||
| d09831b547 | |||
| db82bd8013 | |||
| 4014583ade | |||
| 9a0e40b489 | |||
| 5c60c109d5 | |||
| 475fe7c81f | |||
| 7615657a18 | |||
| bdb3655418 | |||
| 0d766c1ad9 | |||
| e2c7e9b0ef | |||
| 62964dcfae | |||
| a48033874a | |||
| ecb933d13a | |||
| 45ccf6e06d | |||
| b0118f4bdb | |||
| 7fd1b69e81 | |||
| b67e150fe1 | |||
| 9b1b3d1793 | |||
| f1f8b7db22 | |||
| 475bca3c05 | |||
| 77c501f2dd | |||
| 5db9bb972b | |||
| f931e4a31f | |||
| bc246b947f | |||
| ec642fa69f | |||
| 1ba1fa2d83 | |||
| 7c02539751 | |||
| bc6fff6f73 | |||
| 5b43053406 | |||
| 1cbc192a9d | |||
| 4fff98640e | |||
| 085ff2cecf | |||
| d72a000d68 | |||
| 911a74e43e | |||
| 2fc8845851 | |||
| 934df00281 | |||
| df8d3a8888 | |||
| d5c6b4a324 | |||
| bd617162f1 | |||
| e341732f83 | |||
| 6c5a5c8393 | |||
| 5e23d845d5 | |||
| 11befe727c | |||
| 06fdfc8226 | |||
| d4d50cae52 | |||
| 688ad534f2 | |||
| ed9ba7d41f | |||
| 1ae967e002 | |||
| 72303c1c83 | |||
| bc6580995a | |||
| ff39bce262 | |||
| 481259f0b7 | |||
| 059d951a21 | |||
| 6dc5841f31 | |||
| 91fc5bbd7f | |||
| 3742147cf7 | |||
| 432a33eef8 | |||
| b7a8f5f581 | |||
| 52ff09f089 | |||
| 34e65ba57e | |||
| 87da7e1243 | |||
| ed86255cf0 | |||
| 518f68951d | |||
| baa909d0c7 | |||
| 6ea44c271d | |||
| 7d4c27646f | |||
| 848d25a156 | |||
| b4fc3e1cd3 | |||
| 0547c4c07e | |||
| 86f2f180bf | |||
| 62a9ff05b9 | |||
| ce05dbb845 | |||
| 8ce8454620 | |||
| d13a5b1b86 | |||
| a6b1abaecc | |||
| 258b0859ab | |||
| cee7d73b01 | |||
| 1e12b82742 | |||
| 3b5cff8d9a | |||
| f214785cfa | |||
| 61d0b67118 | |||
| 7a71afda0e | |||
| 4ad88a04e5 | |||
| 6f281080e8 | |||
| 7b5d9b4dd5 | |||
| 766ae0a8df | |||
| 43e1855b2c | |||
| 00d2b693dd | |||
| bf76b80330 | |||
| 5d12f5f76c | |||
| 8deca35f24 | |||
| e628fa7af0 | |||
| e2341e8bb5 | |||
| 55bb2e49e5 | |||
| cbec133186 | |||
| ff4b5da163 | |||
| ea017fa6cd | |||
| 7a29683008 | |||
| f52bbc2d0a | |||
| fa174ba15a | |||
| a3a275808e | |||
| 23735fdf59 | |||
| 8c005b2ec9 | |||
| bfb1cc6abc | |||
| ea0d641f25 | |||
| 67311836c8 | |||
| 22d596e827 | |||
| b42306e741 | |||
| 1ca8878592 | |||
| 5aeef0383c | |||
| 337cd6d863 | |||
| 3160f8ce8f | |||
| 5eed6da175 | |||
| da4383181c | |||
| 25e8db9443 | |||
| c6a47c0036 | |||
| 9795e26f1a | |||
| e144e475b7 | |||
| 9c7cb43bb9 | |||
| ac20b370fb | |||
| 6cc91e4359 | |||
| c883afc81f | |||
| 3a89c73b6d | |||
| 1eb0aa68d2 | |||
| 533f7d9f8f | |||
| 3ffd03e34c | |||
| 91dcdae780 | |||
| 15a242ab9b | |||
| 05b98beee6 | |||
| f138ee178b | |||
| 6e52df4f88 | |||
| 59aa67b89f | |||
| 7ddc74d75b | |||
| b53e3529b4 | |||
| e2e38646d1 | |||
| d7432d1f95 | |||
| b9a0852c4f | |||
| 9d1850de97 | |||
| 4a319b9ed4 | |||
| 96aed2c256 | |||
| ddd01b4745 | |||
| 3521543f17 | |||
| 6ce31efc27 | |||
| 342789e692 | |||
| e87e84eb5b | |||
| 96b1839c04 | |||
| 73e8712ad8 | |||
| 0830290bf1 | |||
| e374a9f01b | |||
| 980752340e | |||
| 5092a24dca | |||
| 9203718a95 | |||
| 63b47c8f9d | |||
| f3fd6f3676 | |||
| 504a3b5c04 | |||
| 363e614349 | |||
| 35ea62dff1 | |||
| 4879230303 | |||
| 0a65c1a843 | |||
| 30d0d11af0 | |||
| bb6a2d2f96 | |||
| c5eced8a44 | |||
| 512edaeaf9 | |||
| dd453fc66a | |||
| cc92cd23f4 | |||
| ac36b19399 | |||
| 2a444260a4 | |||
| 8e71e5b66e | |||
| d0ffd314e9 | |||
| 9abab522e6 | |||
| 99861275a8 | |||
| fa54294d74 | |||
| 92b2615e46 | |||
| 898790bfa6 | |||
| d37ee132bc | |||
| 561ef8ccd0 | |||
| 45d7db0239 | |||
| e444b728b6 | |||
| 5865b47482 | |||
| 6248837b60 | |||
| 37f2de0a8f | |||
| be15dba68a | |||
| e2620892f5 | |||
| 7879ae695e | |||
| 50ced7459a | |||
| 89af319265 | |||
| 7505de1cf1 | |||
| a09c69edc1 | |||
| 03101a128e | |||
| 67c118066b | |||
| f49159d2d0 | |||
| 840feec967 | |||
| ffc4eaa964 | |||
| eaf766c2a7 | |||
| 419180c443 | |||
| e97c976c7f | |||
| 2d05e64e5a | |||
| 6f4d7f9e9b | |||
| 5a24e9b016 | |||
| 4d4e9d7de0 | |||
| 1dde1ed5f0 | |||
| 88051ef61d | |||
| 10d3dd76ed | |||
| b52f153141 | |||
| 062f28f9ca | |||
| cd2bd8c562 | |||
| ed6068230e | |||
| 24bfef64dd | |||
| 1d5e4eda7e | |||
| 346b8c73d4 | |||
| 43ea29cdf2 | |||
| de03a12e9c | |||
| f05a67d9d2 | |||
| 3ac7ef34ec | |||
| 518f95ce01 | |||
| 7831e476e3 | |||
| bfb883c098 | |||
| bbe3506747 | |||
| 42743b1394 | |||
| 9a712acd6a | |||
| 4c8bbd5d8f | |||
| 9296388abe | |||
| 3c5e2013a0 | |||
| aacbc06992 | |||
| 220a034d2a | |||
| 6317b83720 |
+5
-1
@@ -13,16 +13,20 @@ $RECYCLE.BIN/
|
||||
app/less/*.css
|
||||
dist/
|
||||
node_modules/
|
||||
pkg/tmp/
|
||||
tmp/
|
||||
pkg/*.nupkg
|
||||
pkg/*.zip
|
||||
|
||||
*_versioned*
|
||||
|
||||
|
||||
[Dd]ebug/
|
||||
[Bb]uild/
|
||||
[Rr]elease/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Pp]ackages/
|
||||
VersionInfo.cs
|
||||
|
||||
*.aps
|
||||
*.bak
|
||||
|
||||
+226
-144
@@ -1,54 +1,78 @@
|
||||
module.exports = function(grunt) {
|
||||
require('load-grunt-tasks')(grunt);
|
||||
var path = require('path');
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
pkgMeta: grunt.file.readJSON('pkg/meta.json'),
|
||||
dest: 'dist',
|
||||
package_dir: 'pkg',
|
||||
package_temp_dir: '<%= package_dir %>/tmp/',
|
||||
pkgMeta: grunt.file.readJSON('config/meta.json'),
|
||||
dest: grunt.option('target') || 'dist',
|
||||
basePath: path.join('<%= dest %>', 'App_Plugins', '<%= pkgMeta.name %>'),
|
||||
|
||||
|
||||
watch: {
|
||||
less: {
|
||||
files: ['app/less/*.less', 'lib/**/*.less'],
|
||||
tasks: ['less:build'],
|
||||
'string-replace': {
|
||||
version: {
|
||||
files: {
|
||||
"app/controllers/controller_versioned.js": "app/controllers/controller.js",
|
||||
"app/less/archetype_versioned.less": "app/less/archetype.less",
|
||||
"app/views/archetype.config.developer.dialog_versioned.html": "app/views/archetype.config.developer.dialog.html",
|
||||
"app/views/archetype.config.stylescript.dialog_versioned.html": "app/views/archetype.config.stylescript.dialog.html",
|
||||
"app/views/archetype.config.fieldset.dialog_versioned.html": "app/views/archetype.config.fieldset.dialog.html",
|
||||
"app/views/archetype.config_versioned.html": "app/views/archetype.config.html",
|
||||
"app/views/archetype_versioned.html": "app/views/archetype.html",
|
||||
"app/views/archetype.default_versioned.html": "app/views/archetype.default.html",
|
||||
|
||||
},
|
||||
options: {
|
||||
spawn: false
|
||||
}
|
||||
},
|
||||
|
||||
js: {
|
||||
files: ['app/**/*.js', 'lib/**/*.js'],
|
||||
tasks: ['concat', 'jshint'],
|
||||
options: {
|
||||
spawn: false
|
||||
}
|
||||
},
|
||||
|
||||
dev: {
|
||||
files: ['app/**'],
|
||||
tasks: ['deploy'],
|
||||
options: {
|
||||
spawn: false
|
||||
replacements: [{
|
||||
pattern: /{{VERSION}}/g,
|
||||
replacement: '/* Version <%= pkgMeta.version %> */'
|
||||
},
|
||||
{
|
||||
pattern: /{{VERSION_HTML}}/g,
|
||||
replacement: '<!-- Version <%= pkgMeta.version %> -->'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
|
||||
watch: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
spawn: false,
|
||||
atBegin: true
|
||||
},
|
||||
src: {
|
||||
src: ['app/**/*.js', 'lib/**/*.js']
|
||||
|
||||
less: {
|
||||
files: ['app/**/*.less'],
|
||||
tasks: ['string-replace', 'less:dist']
|
||||
},
|
||||
|
||||
js: {
|
||||
files: ['app/**/*.js'],
|
||||
tasks: ['string-replace', 'concat:dist']
|
||||
},
|
||||
|
||||
html: {
|
||||
files: ['app/**/*.html'],
|
||||
tasks: ['string-replace', 'copy:html']
|
||||
},
|
||||
|
||||
dll: {
|
||||
files: ['app/Umbraco/**/*.dll'],
|
||||
tasks: ['copy:dll']
|
||||
},
|
||||
|
||||
assets: {
|
||||
files: ['assets/*.*'],
|
||||
tasks: ['copy:assets']
|
||||
}
|
||||
},
|
||||
|
||||
less: {
|
||||
build: {
|
||||
dist: {
|
||||
options: {
|
||||
paths: ["app/less", "lib/less", "vendor"],
|
||||
},
|
||||
files: {
|
||||
'<%= dest %>/css/archetype.css': 'app/less/archetype.less',
|
||||
'<%= basePath %>/css/archetype.css': 'app/less/archetype_versioned.less',
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -57,86 +81,115 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
stripBanners: false
|
||||
},
|
||||
application: {
|
||||
dist: {
|
||||
src: [
|
||||
'app/controllers/controller.js',
|
||||
'app/controllers/controller_versioned.js',
|
||||
'app/controllers/config.controller.js',
|
||||
'app/controllers/config.dialog.controller.js',
|
||||
'app/directives/archetypeproperty.js',
|
||||
'app/directives/localize.js',
|
||||
'app/services/localization.js',
|
||||
'app/resources/propertyeditor.js'
|
||||
'app/directives/archetypesubmitwatcher.js',
|
||||
'app/directives/archetypecustomview.js',
|
||||
'app/directives/archetypeLocalize.js',
|
||||
'app/directives/archetypeclickoutside.js',
|
||||
'app/services/archetypeLocalizationService.js',
|
||||
'app/helpers/sampleLabelHelpers.js',
|
||||
'app/resources/archetypePropertyEditorResource.js',
|
||||
'app/services/archetypeService.js',
|
||||
'app/services/archetypeLabelService.js',
|
||||
'app/services/archetypeCacheService.js'
|
||||
],
|
||||
dest: '<%= dest %>/js/archetype.js'
|
||||
dest: '<%= basePath %>/js/archetype.js'
|
||||
}
|
||||
},
|
||||
|
||||
copy: {
|
||||
html: {
|
||||
cwd: 'app/views/',
|
||||
src: [
|
||||
'archetype_versioned.html',
|
||||
'archetype.default_versioned.html',
|
||||
'archetype.config_versioned.html',
|
||||
'archetype.config.fieldset.dialog_versioned.html',
|
||||
'archetype.config.stylescript.dialog_versioned.html',
|
||||
'archetype.config.developer.dialog_versioned.html'
|
||||
],
|
||||
dest: '<%= basePath %>/views/',
|
||||
expand: true,
|
||||
rename: function(dest, src) {
|
||||
return dest + src.replace('_versioned','');
|
||||
}
|
||||
},
|
||||
assets: {
|
||||
cwd: 'assets/',
|
||||
src: ['*.*'],
|
||||
dest: '<%= basePath %>/assets',
|
||||
expand: true
|
||||
},
|
||||
dll: {
|
||||
cwd: 'app/Umbraco/Umbraco.Archetype/bin/Debug/',
|
||||
src: 'Archetype.dll',
|
||||
dest: '<%= dest %>/bin/',
|
||||
expand: true
|
||||
},
|
||||
config: {
|
||||
files: [
|
||||
{
|
||||
cwd: 'app/langs/',
|
||||
src: ['**'],
|
||||
dest: '<%= basePath %>/langs',
|
||||
expand: true
|
||||
}
|
||||
]
|
||||
},
|
||||
nuget: {
|
||||
files: [
|
||||
{
|
||||
cwd: '<%= dest %>',
|
||||
src: ['**/*', '!bin', '!bin/*'],
|
||||
dest: 'tmp/nuget/content',
|
||||
expand: true
|
||||
},
|
||||
{
|
||||
cwd: '<%= dest %>/bin',
|
||||
src: ['*.dll'],
|
||||
dest: 'tmp/nuget/lib/net40',
|
||||
expand: true
|
||||
}
|
||||
]
|
||||
},
|
||||
umbraco: {
|
||||
cwd: '<%= dest %>',
|
||||
src: '**/*',
|
||||
dest: 'tmp/umbraco',
|
||||
expand: true
|
||||
}
|
||||
},
|
||||
|
||||
nugetpack: {
|
||||
dist: {
|
||||
src: '<%= package_temp_dir %>/nuget/package.nuspec',
|
||||
dest: '<%= package_dir %>'
|
||||
}
|
||||
dist: {
|
||||
src: 'tmp/nuget/package.nuspec',
|
||||
dest: 'pkg'
|
||||
}
|
||||
},
|
||||
|
||||
template: {
|
||||
'nuget_manifest': {
|
||||
'options': {
|
||||
'data': {
|
||||
name: '<%= pkgMeta.name %>',
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
|
||||
files: [{ path: '..\\..\\..\\<%= dest %>\\**', target: 'content\\App_Plugins\\Archetype'}]
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'<%= package_temp_dir %>/nuget/package.nuspec': ['<%= package_dir %>/nuget/package.nuspec']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clean: {
|
||||
build: ['<%= dest %>']
|
||||
},
|
||||
|
||||
copy: {
|
||||
build: {
|
||||
files: [
|
||||
{expand: true, cwd: 'app/', src: ['package.manifest'], dest: '<%= dest %>', flatten: true},
|
||||
{expand: true, cwd: 'app/views/', src: ['archetype.html', 'archetype.config.html'], dest: '<%= dest %>/views', flatten: true},
|
||||
{expand: true, cwd: 'app/config/', src: ['propertyEditors.views.js'], dest: '<%= dest %>/js', flatten: true},
|
||||
{expand: true, cwd: 'app/langs/', src: ['**'], dest: '<%= dest %>/langs', flatten: true},
|
||||
{expand: true, cwd: 'app/Umbraco/Umbraco.Archetype/bin/Debug/', src: ['Archetype.dll'], dest: '<%= dest %>/bin', flatten: true}
|
||||
]
|
||||
},
|
||||
deploy: {
|
||||
files: [
|
||||
{expand: true, cwd: '<%= dest %>/', src: ['**/*', '!bin/*'], dest: '<%= grunt.option("target") %>\\App_Plugins\\Archetype', flatten: false},
|
||||
{expand: true, cwd: '<%= dest %>/', src: ['bin/*'], dest: '<%= grunt.option("target") %>\\bin', flatten: false},
|
||||
]
|
||||
},
|
||||
nuget_prepare: {
|
||||
files: [
|
||||
{expand: true, cwd: '<%= dest %>/', src: ['**/*', '!bin/*'], dest: '<%= package_temp_dir %>/nuget/content/', flatten: false},
|
||||
{expand: true, cwd: '<%= dest %>/', src: ['bin/*'], dest: '<%= package_temp_dir %>/nuget/lib/net40/', flatten: false}
|
||||
]
|
||||
},
|
||||
umbracopackage: {
|
||||
files: [
|
||||
{expand: true, cwd: '<%= dest %>/', src: ['**/*', "!bin/*"], dest: 'pkg/tmp/umbraco/App_Plugins/Archetype', flatten: false},
|
||||
{expand: true, cwd: '<%= dest %>/', src: ['bin/*'], dest: 'pkg/tmp/umbraco', flatten: false}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
touch: {
|
||||
options: {},
|
||||
webconfig: {
|
||||
src: ['<%= grunt.option("target") %>\\Web.config']
|
||||
}
|
||||
'nuspec': {
|
||||
'options': {
|
||||
'data': {
|
||||
name: '<%= pkgMeta.name %>',
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
files: [{ path: 'tmp/nuget/**', target: 'content/App_Plugins/Archetype'}]
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'tmp/nuget/package.nuspec': ['config/package.nuspec']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
umbracoPackage: {
|
||||
@@ -148,58 +201,87 @@ module.exports = function(grunt) {
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
manifest: 'pkg/umbraco/package.xml',
|
||||
readme: 'pkg/umbraco/readme.txt',
|
||||
sourceDir: 'pkg/tmp/umbraco',
|
||||
manifest: 'config/package.xml',
|
||||
readme: 'config/readme.txt',
|
||||
sourceDir: 'tmp/umbraco',
|
||||
outputDir: 'pkg',
|
||||
}
|
||||
},
|
||||
|
||||
clean: {
|
||||
build: ['<%= dest %>'],
|
||||
package_temp: ['pkg/tmp'],
|
||||
package_artifacts: ['pkg/*.zip', 'pkg/*.nupkg'],
|
||||
build: '<%= grunt.config("basePath").substring(0, 4) == "dist" ? "dist/**/*" : "null" %>',
|
||||
tmp: ['tmp'],
|
||||
html: [
|
||||
'app/views/*.html',
|
||||
'!app/views/archetype.html',
|
||||
'!app/views/archetype.default.html',
|
||||
'!app/views/archetype.config.html',
|
||||
'!app/views/archetype.config.fieldset.dialog.html',
|
||||
'!app/views/archetype.config.stylescript.dialog.html',
|
||||
'!app/views/archetype.config.developer.dialog.html'
|
||||
],
|
||||
js: [
|
||||
'app/controllers/*.js',
|
||||
'!app/controllers/controller.js',
|
||||
'!app/controllers/config.controller.js',
|
||||
'!app/controllers/config.dialog.controller.js'
|
||||
],
|
||||
less: [
|
||||
'app/less/*.less',
|
||||
'!app/less/archetype.less'
|
||||
]
|
||||
},
|
||||
|
||||
assemblyinfo: {
|
||||
options: {
|
||||
files: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj', 'app/Umbraco/Umbraco.Archetype/Archetype.Courier.csproj'],
|
||||
filename: 'VersionInfo.cs',
|
||||
info: {
|
||||
version: '<%= (pkgMeta.version.indexOf("-") > 0 ? pkgMeta.version.substring(0, pkgMeta.version.indexOf("-")) : pkgMeta.version) %>',
|
||||
fileVersion: '<%= pkgMeta.version %>'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
touch: {
|
||||
webconfig: {
|
||||
src: ['<%= grunt.option("target") %>\\Web.config']
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
src: {
|
||||
src: ['app/**/*.js', 'lib/**/*.js']
|
||||
}
|
||||
},
|
||||
|
||||
msbuild: {
|
||||
dev: {
|
||||
src: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj'],
|
||||
options: {
|
||||
projectConfiguration: 'Debug',
|
||||
targets: ['Clean', 'Rebuild'],
|
||||
stdout: true,
|
||||
maxCpuCount: 4,
|
||||
buildParameters: {
|
||||
WarningLevel: 2
|
||||
},
|
||||
verbosity: 'quiet'
|
||||
}
|
||||
options: {
|
||||
stdout: true,
|
||||
verbosity: 'quiet',
|
||||
maxCpuCount: 4,
|
||||
version: 4.0,
|
||||
buildParameters: {
|
||||
WarningLevel: 2,
|
||||
NoWarn: 1607
|
||||
}
|
||||
},
|
||||
dist: {
|
||||
src: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj','app/Umbraco/Archetype.Courier/Archetype.Courier.csproj'],
|
||||
options: {
|
||||
projectConfiguration: 'Debug',
|
||||
targets: ['Clean', 'Rebuild'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
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.loadNpmTasks('grunt-msbuild');
|
||||
grunt.loadTasks('tasks');
|
||||
|
||||
|
||||
grunt.registerTask('package', ['clean:package_artifacts', 'default', 'package:nuget', 'package:umbraco']);
|
||||
grunt.registerTask('package:nuget', ['copy:nuget_prepare', 'template:nuget_manifest', 'nugetpack', 'clean:package_temp']);
|
||||
grunt.registerTask('package:umbraco', ['copy:umbracopackage', 'umbracoPackage', '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('css:build', ['less']);
|
||||
grunt.registerTask('js:build', ['concat']);
|
||||
grunt.registerTask('default', ['clean', 'css:build', 'js:build', 'copy:build', 'msbuild:dev']);
|
||||
};
|
||||
grunt.registerTask('default', ['clean', 'string-replace', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:assets', 'copy:config', 'clean:html', 'clean:js', 'clean:less']);
|
||||
|
||||
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']);
|
||||
};
|
||||
@@ -1,12 +1,17 @@
|
||||
Archetype
|
||||
=========
|
||||

|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
Install the selected <a href='https://github.com/imulus/Archetype/releases'>release</a> through the Umbraco package installer or via <a href='http://www.nuget.org/packages/Archetype/'>NuGet</a>.
|
||||
|
||||
|
||||
## Official Docs ##
|
||||
http://imulus.github.io/Archetype
|
||||
https://github.com/kgiszewski/ArchetypeManual
|
||||
|
||||
Follow us on Twitter https://twitter.com/ArchetypeKit
|
||||
|
||||
## Contribute ##
|
||||
|
||||
@@ -21,10 +26,14 @@ Want to contribute to Archetype? You'll want to use Grunt (our task runner) to
|
||||
### Build ###
|
||||
grunt
|
||||
|
||||
Builds the project to `/dist/`. These files can be dropped into an Umbraco 7 site, or you can build directly to a site using:
|
||||
|
||||
grunt --target="D:\inetpub\mysite"
|
||||
|
||||
You can also watch for changes using:
|
||||
|
||||
grunt watch
|
||||
grunt watch --target="D:\inetpub\mysite"
|
||||
|
||||
### Deploy ###
|
||||
grunt deploy --target=C:\\path\\to\\umbraco\\site
|
||||
grunt watch:dev --target=C:\\path\to\\umbraco\\site
|
||||
|
||||
Add `--touch` to either command to automatically touch the web.config on a deploy
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{FE8BE437-8B11-4E49-9B02-F45994E6D723}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Archetype.Courier</RootNamespace>
|
||||
<AssemblyName>Archetype.Courier</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="businesslogic">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="cms">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="interfaces">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Core">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Courier.Core">
|
||||
<HintPath>lib\Umbraco.Courier.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Courier.DataResolvers">
|
||||
<HintPath>lib\Umbraco.Courier.DataResolvers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Courier.Providers">
|
||||
<HintPath>lib\Umbraco.Courier.Providers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.providers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Umbraco.Archetype\Properties\VersionInfo.cs">
|
||||
<Link>Properties\VersionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="DataResolvers\ArchetypeDataResolver.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Umbraco.Archetype\Archetype.Umbraco.csproj">
|
||||
<Project>{7d185d41-4228-4978-acb8-83f9a48ad94f}</Project>
|
||||
<Name>Archetype.Umbraco</Name>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,214 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Extensions;
|
||||
using Archetype.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Courier.Core;
|
||||
using Umbraco.Courier.Core.Logging;
|
||||
using Umbraco.Courier.Core.ProviderModel;
|
||||
using Umbraco.Courier.DataResolvers;
|
||||
using Umbraco.Courier.ItemProviders;
|
||||
|
||||
namespace Archetype.Courier.DataResolvers
|
||||
{
|
||||
public class ArchetypeDataResolver : PropertyDataResolverProvider
|
||||
{
|
||||
private enum Direction
|
||||
{
|
||||
Extracting,
|
||||
Packaging
|
||||
}
|
||||
|
||||
public override string EditorAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return Constants.PropertyEditorAlias;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExtractingDataType(DataType item)
|
||||
{
|
||||
// No longer need to extract the DataType (int) Ids as Archetype now references the Guid [LK]
|
||||
}
|
||||
|
||||
public override void ExtractingProperty(Item item, ContentProperty propertyData)
|
||||
{
|
||||
ReplacePropertyDataIds(item, propertyData, Direction.Extracting);
|
||||
}
|
||||
|
||||
public override void PackagingDataType(DataType item)
|
||||
{
|
||||
AddDataTypeDependencies(item);
|
||||
}
|
||||
|
||||
public override void PackagingProperty(Item item, ContentProperty propertyData)
|
||||
{
|
||||
ReplacePropertyDataIds(item, propertyData, Direction.Packaging);
|
||||
}
|
||||
|
||||
private void AddDataTypeDependencies(DataType item)
|
||||
{
|
||||
if (item.Prevalues != null && item.Prevalues.Count > 0)
|
||||
{
|
||||
var prevalue = item.Prevalues[0];
|
||||
if (prevalue.Alias.InvariantEquals(Constants.PreValueAlias) && !string.IsNullOrWhiteSpace(prevalue.Value))
|
||||
{
|
||||
var config = JsonConvert.DeserializeObject<ArchetypePreValue>(prevalue.Value);
|
||||
|
||||
if (config != null && config.Fieldsets != null)
|
||||
{
|
||||
foreach (var property in config.Fieldsets.SelectMany(x => x.Properties))
|
||||
{
|
||||
item.Dependencies.Add(property.DataTypeGuid.ToString(), ItemProviderIds.dataTypeItemProviderGuid);
|
||||
}
|
||||
|
||||
item.Prevalues[0].Value = JsonConvert.SerializeObject(config, Formatting.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ReplacePropertyDataIds(Item item, ContentProperty propertyData, Direction direction)
|
||||
{
|
||||
if (propertyData != null && propertyData.Value != null)
|
||||
{
|
||||
var dataType = ExecutionContext.DatabasePersistence.RetrieveItem<DataType>(new ItemIdentifier(propertyData.DataType.ToString(),
|
||||
ItemProviderIds.dataTypeItemProviderGuid));
|
||||
|
||||
//Fetch the Prevalues for the current Property's DataType (if its an 'Archetype config')
|
||||
var prevalue = dataType.Prevalues.FirstOrDefault(x => x.Alias.ToLowerInvariant().Equals("archetypeconfig"));
|
||||
var archetypePreValue = prevalue == null
|
||||
? null
|
||||
: JsonConvert.DeserializeObject<ArchetypePreValue>(prevalue.Value,
|
||||
ArchetypeHelper.Instance.JsonSerializerSettings);
|
||||
RetrieveAdditionalProperties(ref archetypePreValue);
|
||||
|
||||
//Deserialize the value of the current Property to an ArchetypeModel and set additional properties before converting values
|
||||
var sourceJson = propertyData.Value.ToString();
|
||||
var archetype = JsonConvert.DeserializeObject<ArchetypeModel>(sourceJson, ArchetypeHelper.Instance.JsonSerializerSettings);
|
||||
RetrieveAdditionalProperties(ref archetype, archetypePreValue);
|
||||
|
||||
if (archetype != null)
|
||||
{
|
||||
// get the `PropertyItemProvider` from the collection.
|
||||
var propertyItemProvider = ItemProviderCollection.Instance.GetProvider(ItemProviderIds.propertyDataItemProviderGuid, ExecutionContext);
|
||||
|
||||
foreach (var property in archetype.Fieldsets.SelectMany(x => x.Properties))
|
||||
{
|
||||
if (property == null || string.IsNullOrWhiteSpace(property.PropertyEditorAlias))
|
||||
continue;
|
||||
|
||||
// create a 'fake' item for Courier to process
|
||||
var fakeItem = new ContentPropertyData
|
||||
{
|
||||
ItemId = item.ItemId,
|
||||
Name = string.Format("{0} [{1}: Nested {2} ({3})]", new[] { item.Name, EditorAlias, property.PropertyEditorAlias, property.Alias }),
|
||||
Data = new List<ContentProperty>
|
||||
{
|
||||
new ContentProperty
|
||||
{
|
||||
Alias = property.Alias,
|
||||
DataType = ExecutionContext.DatabasePersistence.GetUniqueId(property.DataTypeId, UmbracoNodeObjectTypeIds.DataType),
|
||||
PropertyEditorAlias = property.PropertyEditorAlias,
|
||||
Value = property.Value
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (direction == Direction.Packaging)
|
||||
{
|
||||
try
|
||||
{
|
||||
// run the 'fake' item through Courier's data resolvers
|
||||
ResolutionManager.Instance.PackagingItem(fakeItem, propertyItemProvider);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
CourierLogHelper.Error<ArchetypeDataResolver>(string.Concat("Error packaging data value: ", fakeItem.Name), ex);
|
||||
}
|
||||
|
||||
// pass up the dependencies and resources
|
||||
item.Dependencies.AddRange(fakeItem.Dependencies);
|
||||
item.Resources.AddRange(fakeItem.Resources);
|
||||
}
|
||||
else if (direction == Direction.Extracting)
|
||||
{
|
||||
try
|
||||
{
|
||||
// run the 'fake' item through Courier's data resolvers
|
||||
ResolutionManager.Instance.ExtractingItem(fakeItem, propertyItemProvider);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
CourierLogHelper.Error<ArchetypeDataResolver>(string.Concat("Error extracting data value: ", fakeItem.Name), ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (fakeItem.Data != null && fakeItem.Data.Any())
|
||||
{
|
||||
var firstDataType = fakeItem.Data.FirstOrDefault();
|
||||
if (firstDataType != null)
|
||||
{
|
||||
// set the resolved property data value
|
||||
property.Value = firstDataType.Value;
|
||||
|
||||
// (if packaging) add a dependency for the property's data-type
|
||||
if (direction == Direction.Packaging)
|
||||
item.Dependencies.Add(firstDataType.DataType.ToString(), ItemProviderIds.dataTypeItemProviderGuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// serialize the Archetype back to a string
|
||||
propertyData.Value = archetype.SerializeForPersistence();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RetrieveAdditionalProperties(ref ArchetypePreValue preValue)
|
||||
{
|
||||
if (preValue == null)
|
||||
return;
|
||||
|
||||
foreach (var fieldset in preValue.Fieldsets)
|
||||
{
|
||||
foreach (var property in fieldset.Properties)
|
||||
{
|
||||
var dataType = ExecutionContext.DatabasePersistence.RetrieveItem<DataType>(
|
||||
new ItemIdentifier(property.DataTypeGuid.ToString(),
|
||||
ItemProviderIds.dataTypeItemProviderGuid));
|
||||
|
||||
if (dataType == null)
|
||||
continue;
|
||||
|
||||
property.PropertyEditorAlias = dataType.PropertyEditorAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RetrieveAdditionalProperties(ref ArchetypeModel archetype, ArchetypePreValue preValue)
|
||||
{
|
||||
foreach (var fieldset in preValue.Fieldsets)
|
||||
{
|
||||
var fieldsetAlias = fieldset.Alias;
|
||||
foreach (var fieldsetInst in archetype.Fieldsets.Where(x => x.Alias == fieldsetAlias))
|
||||
{
|
||||
foreach (var property in fieldset.Properties)
|
||||
{
|
||||
var propertyAlias = property.Alias;
|
||||
foreach (var propertyInst in fieldsetInst.Properties.Where(x => x.Alias == propertyAlias))
|
||||
{
|
||||
propertyInst.DataTypeGuid = property.DataTypeGuid.ToString();
|
||||
propertyInst.DataTypeId = ExecutionContext.DatabasePersistence.GetNodeId(
|
||||
property.DataTypeGuid, UmbracoNodeObjectTypeIds.DataType);
|
||||
propertyInst.PropertyEditorAlias = property.PropertyEditorAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("Archetype.Courier")]
|
||||
[assembly: AssemblyDescription("A set of tools to support Archetype with Umbraco Courier")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Umbrella Inc Ltd")]
|
||||
[assembly: AssemblyProduct("Archetype.Courier")]
|
||||
[assembly: AssemblyCopyright("Copyright \xa9 Lee Kelleher, Umbrella Inc Ltd 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("6F05C431-ABBF-4D77-9D3D-5AF6C8E318AF")]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
|
||||
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
|
||||
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
|
||||
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
|
||||
<package id="ImageProcessor" version="1.8.7.0" targetFramework="net45" />
|
||||
<package id="ImageProcessor.Web" version="3.2.1.0" targetFramework="net45" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
|
||||
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -31,21 +31,230 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AutoMapper">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="AutoMapper.Net4">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="businesslogic, Version=1.0.5242.22740, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core">
|
||||
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core.Mvc">
|
||||
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="cms, Version=1.0.5242.22741, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="controls, Version=1.0.5242.22742, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="CookComputing.XmlRpcV2">
|
||||
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Examine, Version=0.1.55.2941, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="HtmlAgilityPack">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib">
|
||||
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor.Web, Version=3.2.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="interfaces, Version=1.0.5242.22737, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lucene.Net">
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MiniProfiler">
|
||||
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq">
|
||||
<HintPath>..\packages\Moq.4.2.1312.1622\lib\net40\Moq.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLCE4Umbraco, Version=1.0.5242.22741, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Umbraco.Core">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\Umbraco.Core.dll</HintPath>
|
||||
<Reference Include="TidyNet, Version=1.0.0.0, Culture=neutral">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco, Version=1.0.5242.22743, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Core, Version=1.0.5242.22738, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.DataLayer, Version=1.0.5242.22740, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.editorControls, Version=1.0.5242.22746, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.MacroEngines, Version=1.0.5242.22747, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.providers, Version=1.0.5242.22742, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Web.UI, Version=1.0.5242.22748, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.XmlSerializers, Version=1.0.5242.22743, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine, Version=0.6.0.22741, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.60829.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -54,6 +263,7 @@
|
||||
<Compile Include="PropertyValueConverter\PropertyValueConverterTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="Data\sample-1.json" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
@@ -61,10 +271,20 @@
|
||||
<ProjectReference Include="..\Umbraco.Archetype\Archetype.Umbraco.csproj">
|
||||
<Project>{7D185D41-4228-4978-ACB8-83F9A48AD94F}</Project>
|
||||
<Name>Archetype.Umbraco</Name>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Archetype.Umbraco.PropertyConverters;
|
||||
using Archetype.PropertyConverters;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Archetype.Tests.Models
|
||||
@@ -26,7 +26,7 @@ namespace Archetype.Tests.Models
|
||||
public void Can_Get_Fieldset_Property_By_Alias()
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = (Archetype.Umbraco.Models.Archetype)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
|
||||
var fieldset = result.Fieldsets.First();
|
||||
var propertyValue = fieldset.GetValue("boxHeadline");
|
||||
@@ -34,24 +34,36 @@ namespace Archetype.Tests.Models
|
||||
Assert.That(propertyValue == "Box 1 Title");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Get_Fieldset_Property_Default_Value_By_Alias()
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
|
||||
var fieldset = result.Fieldsets.First();
|
||||
var propertyValue = fieldset.GetValue<string>("noSuchProperty", "noSuchProperty default value");
|
||||
|
||||
Assert.That(propertyValue == "noSuchProperty default value");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Convert_Property_Value_Types()
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = (Archetype.Umbraco.Models.Archetype)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
|
||||
var fieldset = result.Fieldsets.First();
|
||||
|
||||
Assert.That(fieldset.GetValue<int>("link") == 3175);
|
||||
Assert.That(fieldset.GetValue<bool>("show") == true);
|
||||
Assert.That(fieldset.GetValue<string>("blurb") == "A blurb here");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Returns_String_When_No_Type_Specified()
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = (Archetype.Umbraco.Models.Archetype)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
|
||||
var fieldset = result.Fieldsets.First();
|
||||
|
||||
@@ -59,6 +71,5 @@ namespace Archetype.Tests.Models
|
||||
Assert.That(property is string);
|
||||
Assert.That(property == "3175");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Archetype.Umbraco.PropertyConverters;
|
||||
using Archetype.PropertyConverters;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
@@ -24,39 +24,37 @@ namespace Archetype.Tests.PropertyValueConverter
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Returns_Null_When_Data_Is_Null()
|
||||
[TestCase(null)]
|
||||
[TestCase("")]
|
||||
public void Returns_Empty_Archetype_When_Data_Is_Null_Or_Empty(object data)
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = converter.ConvertDataToSource(null, null, false);
|
||||
|
||||
Assert.IsNull(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Returns_Empty_String_When_Data_Is_Empty_String()
|
||||
{
|
||||
var data = "";
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = converter.ConvertDataToSource(null, data, false);
|
||||
|
||||
Assert.AreEqual("", result);
|
||||
Assert.AreEqual(result.GetType(), typeof (Archetype.Models.ArchetypeModel));
|
||||
|
||||
var fieldsets = (Archetype.Models.ArchetypeModel) result;
|
||||
Assert.IsTrue(fieldsets.Count() == 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Returns_Original_String_When_Data_Is_Invalid_Json()
|
||||
public void Returns_Empty_Archetype_When_Data_Is_Invalid_Json()
|
||||
{
|
||||
var data = "{ invalid";
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = converter.ConvertDataToSource(null, data, false);
|
||||
|
||||
Assert.AreEqual(data, result);
|
||||
Assert.AreEqual(result.GetType(), typeof (Archetype.Models.ArchetypeModel));
|
||||
|
||||
var fieldsets = (Archetype.Models.ArchetypeModel) result;
|
||||
Assert.IsTrue(fieldsets.Count() == 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Serialize_From_Json_Model()
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var result = (Archetype.Umbraco.Models.Archetype)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
|
||||
Assert.That(result != null);
|
||||
Assert.That(result.Fieldsets.Count() == 2);
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="umbracoConfiguration">
|
||||
<section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<umbracoConfiguration>
|
||||
<settings configSource="config\umbracoSettings.config" />
|
||||
</umbracoConfiguration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,5 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
|
||||
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
|
||||
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
|
||||
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
|
||||
<package id="ImageProcessor" version="1.9.0.0" targetFramework="net45" />
|
||||
<package id="ImageProcessor.Web" version="3.2.3.0" targetFramework="net45" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Moq" version="4.2.1312.1622" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="NUnit" version="2.6.3" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
|
||||
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace DatabaseSizer
|
||||
{
|
||||
public class Application : ApplicationEventHandler
|
||||
{
|
||||
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
|
||||
{
|
||||
base.ApplicationStarted(umbracoApplication, applicationContext);
|
||||
|
||||
ExpandPrevalueValueColumnSize();
|
||||
}
|
||||
|
||||
protected void ExpandPrevalueValueColumnSize()
|
||||
{
|
||||
try
|
||||
{
|
||||
var dbContext = ApplicationContext.Current.DatabaseContext;
|
||||
var colCount =
|
||||
dbContext.Database.ExecuteScalar<int>(
|
||||
"SELECT COUNT(1) FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'nvarchar' AND COLUMN_NAME = 'value' AND CHARACTER_MAXIMUM_LENGTH = 2500 AND TABLE_NAME = 'cmsDataTypePreValues'");
|
||||
|
||||
// Check column
|
||||
if (colCount != 0)
|
||||
{
|
||||
using (var trans = dbContext.Database.GetTransaction())
|
||||
{
|
||||
// Change column
|
||||
dbContext.Database.Execute("ALTER TABLE [cmsDataTypePreValues] ALTER COLUMN [value] ntext NULL;");
|
||||
|
||||
trans.Complete();
|
||||
}
|
||||
|
||||
LogHelper.Debug(typeof(Application), "Successfully expanded Prevalue table Value column");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Debug(typeof(Application), "Prevalue table Value column is already expanded");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(typeof(Application), "Error expanding Prevalue table Value column", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0114C963-C514-49C1-B7AB-DCB1825F498C}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DatabaseSizer</RootNamespace>
|
||||
<AssemblyName>DatabaseSizer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AutoMapper">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="AutoMapper.Net4">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="businesslogic">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core">
|
||||
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core.Mvc">
|
||||
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="cms">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="controls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="CookComputing.XmlRpcV2">
|
||||
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Examine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="HtmlAgilityPack">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib">
|
||||
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor">
|
||||
<HintPath>..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor.Web">
|
||||
<HintPath>..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="interfaces">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lucene.Net">
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Helpers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MiniProfiler">
|
||||
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLCE4Umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="TidyNet">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Core">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.DataLayer">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.editorControls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.MacroEngines">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.providers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Web.UI">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.XmlSerializers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Application.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DatabaseSizer.cs")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DatabaseSizer.cs")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("28dc35d2-3dfb-40b4-9093-bc47c91127ea")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
|
||||
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
|
||||
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
|
||||
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
|
||||
<package id="ImageProcessor" version="1.9.0.0" targetFramework="net45" />
|
||||
<package id="ImageProcessor.Web" version="3.2.3.0" targetFramework="net45" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
|
||||
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -12,6 +12,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D84AA4
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Tests", "Archetype.Tests\Archetype.Tests.csproj", "{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DatabaseSizer", "DatabaseSizer\DatabaseSizer.csproj", "{0114C963-C514-49C1-B7AB-DCB1825F498C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Courier", "Archetype.Courier\Archetype.Courier.csproj", "{FE8BE437-8B11-4E49-9B02-F45994E6D723}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -26,6 +30,14 @@ Global
|
||||
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
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;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.Editors;
|
||||
using Archetype.Extensions;
|
||||
|
||||
namespace Archetype.Api
|
||||
{
|
||||
[PluginController("ArchetypeApi")]
|
||||
public class ArchetypeDataTypeController : UmbracoAuthorizedJsonController
|
||||
{
|
||||
|
||||
public IEnumerable<object> GetAllPropertyEditors()
|
||||
{
|
||||
return
|
||||
global::Umbraco.Core.PropertyEditors.PropertyEditorResolver.Current.PropertyEditors
|
||||
.Select(x => new {defaultPreValues = x.DefaultPreValuesForArchetype(), alias = x.Alias, view = x.ValueEditor.View});
|
||||
}
|
||||
|
||||
public object GetAll()
|
||||
{
|
||||
var dataTypes = Services.DataTypeService.GetAllDataTypeDefinitions();
|
||||
return dataTypes.Select(t => new { guid = t.Key, name = t.Name });
|
||||
}
|
||||
|
||||
public object GetByGuid(Guid guid)
|
||||
{
|
||||
var dataType = Services.DataTypeService.GetDataTypeDefinitionById(guid);
|
||||
if (dataType == null)
|
||||
{
|
||||
throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
}
|
||||
|
||||
var dataTypeDisplay = Mapper.Map<IDataTypeDefinition, DataTypeDisplay>(dataType);
|
||||
return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues };
|
||||
}
|
||||
|
||||
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<IDataTypeDefinition, DataTypeDisplay>(dataType);
|
||||
return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias, nodeId = nodeId };
|
||||
}
|
||||
|
||||
public object GetDllVersion()
|
||||
{
|
||||
return new {dllVersion = _version()};
|
||||
}
|
||||
|
||||
private string _version()
|
||||
{
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
var fvi = FileVersionInfo.GetVersionInfo(asm.Location);
|
||||
|
||||
return fvi.FileVersion;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
<ProjectGuid>{7D185D41-4228-4978-ACB8-83F9A48AD94F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Archetype.Umbraco</RootNamespace>
|
||||
<RootNamespace>Archetype</RootNamespace>
|
||||
<AssemblyName>Archetype</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -34,114 +34,147 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="AutoMapper">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="AutoMapper.Net4">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="businesslogic">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\businesslogic.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core">
|
||||
<HintPath>..\packages\ClientDependency.1.7.0.4\lib\ClientDependency.Core.dll</HintPath>
|
||||
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core.Mvc">
|
||||
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="cms">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\cms.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="controls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\controls.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="CookComputing.XmlRpcV2">
|
||||
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Examine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\Examine.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="HtmlAgilityPack">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib">
|
||||
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor">
|
||||
<HintPath>..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor.Web">
|
||||
<HintPath>..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="interfaces">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\interfaces.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\log4net.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lucene.Net">
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Helpers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MiniProfiler">
|
||||
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLCE4Umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -150,51 +183,73 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="TidyNet">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\TidyNet.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Core">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\Umbraco.Core.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.DataLayer">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.DataLayer.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.editorControls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.editorControls.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.MacroEngines">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.providers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.providers.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Web.UI">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.XmlSerializers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\UmbracoExamine.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.0.1\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Extensions\Extensions.cs" />
|
||||
<Compile Include="Models\Archetype.cs" />
|
||||
<Compile Include="Api\ArchetypeDataTypeController.cs" />
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Events\ExpireCache.cs" />
|
||||
<Compile Include="Extensions\ArchetypeHelper.cs" />
|
||||
<Compile Include="Extensions\HtmlHelperExtensions.cs" />
|
||||
<Compile Include="Extensions\ArchetypePropertyModelExtensions.cs" />
|
||||
<Compile Include="Extensions\PropertyEditorExtensions.cs" />
|
||||
<Compile Include="Extensions\StringExtensions.cs" />
|
||||
<Compile Include="Models\ArchetypeModel.cs" />
|
||||
<Compile Include="Models\ArchetypePreValue.cs" />
|
||||
<Compile Include="Models\ArchetypePreValueFieldset.cs" />
|
||||
<Compile Include="Models\ArchetypePreValueFieldsetGroup.cs" />
|
||||
<Compile Include="Models\ArchetypePreValueProperty.cs" />
|
||||
<Compile Include="Models\Fieldset.cs" />
|
||||
<Compile Include="Models\Property.cs" />
|
||||
<Compile Include="Models\ArchetypeFieldsetModel.cs" />
|
||||
<Compile Include="Models\ArchetypePropertyModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\VersionInfo.cs" />
|
||||
<Compile Include="PropertyConverters\ArchetypeValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ArchetypePropertyEditor.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Archetype
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string PropertyEditorAlias = "Imulus.Archetype";
|
||||
|
||||
public const string PreValueAlias = "archetypeConfig";
|
||||
|
||||
public const string CacheKey_DataTypeByGuid = "";
|
||||
|
||||
public const string CacheKey_PreValueFromDataTypeId = "Archetype_GetArchetypePreValueFromDataTypeId_";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace Archetype.Events
|
||||
{
|
||||
public class ExpireCache : ApplicationEventHandler
|
||||
{
|
||||
|
||||
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
|
||||
{
|
||||
base.ApplicationStarting(umbracoApplication, applicationContext);
|
||||
|
||||
DataTypeService.Saved += ExpirePreValueCache;
|
||||
}
|
||||
|
||||
void ExpirePreValueCache(IDataTypeService sender, global::Umbraco.Core.Events.SaveEventArgs<IDataTypeDefinition> e)
|
||||
{
|
||||
foreach (var dataType in e.SavedEntities)
|
||||
{
|
||||
ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(Constants.CacheKey_PreValueFromDataTypeId + dataType.Id);
|
||||
ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(Constants.CacheKey_DataTypeByGuid + dataType.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Archetype.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
public class ArchetypeHelper
|
||||
{
|
||||
protected JsonSerializerSettings _jsonSettings;
|
||||
protected ApplicationContext _app;
|
||||
|
||||
private static readonly ArchetypeHelper _instance = new ArchetypeHelper();
|
||||
|
||||
internal static ArchetypeHelper Instance { get { return _instance; } }
|
||||
|
||||
internal ArchetypeHelper()
|
||||
{
|
||||
var dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver();
|
||||
dcr.DefaultMembersSearchFlags |= System.Reflection.BindingFlags.NonPublic;
|
||||
|
||||
_jsonSettings = new JsonSerializerSettings { ContractResolver = dcr };
|
||||
_app = ApplicationContext.Current;
|
||||
}
|
||||
|
||||
internal JsonSerializerSettings JsonSerializerSettings { get { return _jsonSettings; } }
|
||||
|
||||
internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, PreValueCollection dataTypePreValues)
|
||||
{
|
||||
try
|
||||
{
|
||||
var archetype = JsonConvert.DeserializeObject<ArchetypeModel>(sourceJson, _jsonSettings);
|
||||
|
||||
try
|
||||
{
|
||||
// Get list of configured properties and their types and map them to the deserialized archetype model
|
||||
var preValue = GetArchetypePreValueFromPreValuesCollection(dataTypePreValues);
|
||||
RetrieveAdditionalProperties(ref archetype, preValue);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<ArchetypeHelper>("DeserializeJsonToArchetype", ex);
|
||||
}
|
||||
|
||||
return archetype;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ArchetypeModel();
|
||||
}
|
||||
}
|
||||
|
||||
internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, int dataTypeId, PublishedContentType hostContentType = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var archetype = JsonConvert.DeserializeObject<ArchetypeModel>(sourceJson, _jsonSettings);
|
||||
|
||||
try
|
||||
{
|
||||
// Get list of configured properties and their types and map them to the deserialized archetype model
|
||||
var preValue = GetArchetypePreValueFromDataTypeId(dataTypeId);
|
||||
RetrieveAdditionalProperties(ref archetype, preValue, hostContentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<ArchetypeHelper>(string.Format("DeserializeJsonToArchetype Error DatatypeId=>{0} SourceJson=>{1}", dataTypeId, sourceJson), ex);
|
||||
}
|
||||
|
||||
return archetype;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ArchetypeModel();
|
||||
}
|
||||
}
|
||||
|
||||
internal bool IsPropertyValueConverterOverridden(int dataTypeId)
|
||||
{
|
||||
var prevalues = GetArchetypePreValueFromDataTypeId(dataTypeId);
|
||||
if (prevalues == null)
|
||||
return false;
|
||||
|
||||
return prevalues.OverrideDefaultPropertyValueConverter;
|
||||
}
|
||||
|
||||
private ArchetypePreValue GetArchetypePreValueFromDataTypeId(int dataTypeId)
|
||||
{
|
||||
return _app.ApplicationCache.RuntimeCache.GetCacheItem(
|
||||
Constants.CacheKey_PreValueFromDataTypeId + dataTypeId,
|
||||
() =>
|
||||
{
|
||||
var preValues = _app.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeId);
|
||||
|
||||
var configJson = preValues.IsDictionaryBased
|
||||
? preValues.PreValuesAsDictionary[Constants.PreValueAlias].Value
|
||||
: preValues.PreValuesAsArray.First().Value;
|
||||
|
||||
var config = JsonConvert.DeserializeObject<ArchetypePreValue>(configJson, _jsonSettings);
|
||||
RetrieveAdditionalProperties(ref config);
|
||||
|
||||
return config;
|
||||
|
||||
}) as ArchetypePreValue;
|
||||
}
|
||||
|
||||
private ArchetypePreValue GetArchetypePreValueFromPreValuesCollection(PreValueCollection dataTypePreValues)
|
||||
{
|
||||
var preValueAsString = dataTypePreValues.PreValuesAsDictionary.First().Value.Value;
|
||||
var preValue = JsonConvert.DeserializeObject<ArchetypePreValue>(preValueAsString, _jsonSettings);
|
||||
return preValue;
|
||||
}
|
||||
|
||||
internal IDataTypeDefinition GetDataTypeByGuid(Guid guid)
|
||||
{
|
||||
return (IDataTypeDefinition)ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem(
|
||||
Constants.CacheKey_DataTypeByGuid + guid,
|
||||
() => _app.Services.DataTypeService.GetDataTypeDefinitionById(guid));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves additional metadata that isn't available on the stored model of an Archetype
|
||||
/// </summary>
|
||||
/// <param name="archetype">The Archetype to add the additional metadata to</param>
|
||||
/// <param name="preValue">The configuration of the Archetype</param>
|
||||
private void RetrieveAdditionalProperties(ref ArchetypeModel archetype, ArchetypePreValue preValue, PublishedContentType hostContentType = null)
|
||||
{
|
||||
foreach (var fieldset in preValue.Fieldsets)
|
||||
{
|
||||
var fieldsetAlias = fieldset.Alias;
|
||||
foreach (var fieldsetInst in archetype.Fieldsets.Where(x => x.Alias == fieldsetAlias))
|
||||
{
|
||||
foreach (var property in fieldset.Properties)
|
||||
{
|
||||
var propertyAlias = property.Alias;
|
||||
foreach (var propertyInst in fieldsetInst.Properties.Where(x => x.Alias == propertyAlias))
|
||||
{
|
||||
propertyInst.DataTypeGuid = property.DataTypeGuid.ToString();
|
||||
propertyInst.DataTypeId = GetDataTypeByGuid(property.DataTypeGuid).Id;
|
||||
propertyInst.PropertyEditorAlias = property.PropertyEditorAlias;
|
||||
propertyInst.HostContentType = hostContentType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves additional metadata that isn't available on the stored model of an ArchetypePreValue
|
||||
/// </summary>
|
||||
/// <param name="archetype">The Archetype to add the additional metadata to</param>
|
||||
/// <param name="preValue">The configuration of the Archetype</param>
|
||||
private void RetrieveAdditionalProperties(ref ArchetypePreValue preValue)
|
||||
{
|
||||
foreach (var fieldset in preValue.Fieldsets)
|
||||
{
|
||||
foreach (var property in fieldset.Properties)
|
||||
{
|
||||
property.PropertyEditorAlias = GetDataTypeByGuid(property.DataTypeGuid).PropertyEditorAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
public static class ArchetypePropertyModelExtensions
|
||||
{
|
||||
public static bool IsArchetype(this ArchetypePropertyModel prop)
|
||||
{
|
||||
return prop.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditorAlias);
|
||||
}
|
||||
|
||||
internal static PublishedPropertyType CreateDummyPropertyType(this ArchetypePropertyModel prop)
|
||||
{
|
||||
return new PublishedPropertyType(prop.HostContentType, new PropertyType(new DataTypeDefinition(-1, prop.PropertyEditorAlias) { Id = prop.DataTypeId }));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Html;
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
public static class HtmlHelperExtensions
|
||||
{
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel)
|
||||
{
|
||||
return RenderPartials(htmlHelper, archetypeModel, null, null);
|
||||
}
|
||||
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath)
|
||||
{
|
||||
return RenderPartials(htmlHelper, archetypeModel, partialPath, null);
|
||||
}
|
||||
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return RenderPartials(htmlHelper, archetypeModel, null, viewDataDictionary);
|
||||
}
|
||||
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return htmlHelper.RenderPartials(archetypeModel, partialPath, viewDataDictionary);
|
||||
}
|
||||
|
||||
private static IHtmlString RenderPartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
var context = HttpContext.Current;
|
||||
|
||||
if (archetypeModel == null || context == null)
|
||||
{
|
||||
return new HtmlString("");
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var pathToPartials = "~/Views/Partials/Archetype/";
|
||||
if (!string.IsNullOrEmpty(partialPath))
|
||||
{
|
||||
pathToPartials = partialPath;
|
||||
}
|
||||
|
||||
foreach (var fieldsetModel in archetypeModel)
|
||||
{
|
||||
var partial = pathToPartials + fieldsetModel.Alias + ".cshtml";
|
||||
|
||||
if (System.IO.File.Exists(context.Server.MapPath(partial)))
|
||||
{
|
||||
sb.AppendLine(htmlHelper.Partial(partial, fieldsetModel, viewDataDictionary).ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Info<ArchetypeModel>(string.Format("The partial for {0} could not be found. Please create a partial with that name or rename your alias.", context.Server.MapPath(partial)));
|
||||
}
|
||||
}
|
||||
|
||||
return new HtmlString(sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
public static class PropertyEditorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Formats the default prevalues for a property editor for use within an Archetype clientside context
|
||||
/// </summary>
|
||||
/// <param name="propertyEditor">The property editor</param>
|
||||
/// <returns>The formatted default prevalues</returns>
|
||||
public static IDictionary<string, object> DefaultPreValuesForArchetype(this PropertyEditor propertyEditor)
|
||||
{
|
||||
if (propertyEditor.DefaultPreValues == null || propertyEditor.DefaultPreValues.Any() == false)
|
||||
{
|
||||
return propertyEditor.DefaultPreValues;
|
||||
}
|
||||
var view = propertyEditor.ValueEditor.View.ToLowerInvariant();
|
||||
|
||||
// This is the extension point for default prevalues formatting, in case we need to handle any other
|
||||
// property editors later on. It should be replaced with a switch statement by then, or maybe some fancy
|
||||
// auto discovery of formatters :)
|
||||
if (view == "imagecropper")
|
||||
{
|
||||
propertyEditor.FormatImageCropperDefaultPreValuesForArchetype();
|
||||
}
|
||||
return propertyEditor.DefaultPreValues;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Format the default prevalues of the image cropper property editor
|
||||
/// </summary>
|
||||
/// <param name="propertyEditor"></param>
|
||||
/// <remarks>
|
||||
/// In order for the image cropper to work clientside, we need to make sure it's default prevalue "focalpoint" is returned
|
||||
/// as a JSON object and not as the string it's defined as on the image cropper property editor.
|
||||
/// </remarks>
|
||||
private static void FormatImageCropperDefaultPreValuesForArchetype(this PropertyEditor propertyEditor)
|
||||
{
|
||||
const string focalPointKey = "focalPoint";
|
||||
|
||||
if (propertyEditor.DefaultPreValues.ContainsKey(focalPointKey) == false || propertyEditor.DefaultPreValues[focalPointKey] == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var focalPoint = propertyEditor.DefaultPreValues[focalPointKey].ToString();
|
||||
if (string.IsNullOrEmpty(focalPoint))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// translate the JSON string to a JSON object
|
||||
propertyEditor.DefaultPreValues[focalPointKey] = JsonConvert.DeserializeObject(focalPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-11
@@ -1,9 +1,6 @@
|
||||
using Umbraco.Core;
|
||||
using Archetype.Umbraco.Models;
|
||||
|
||||
namespace Archetype.Umbraco.Extensions
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
public static class Extensions
|
||||
public static class StringExtensions
|
||||
{
|
||||
//lifted from the core as it is marked 'internal'
|
||||
public static bool DetectIsJson(this string input)
|
||||
@@ -12,10 +9,5 @@ namespace Archetype.Umbraco.Extensions
|
||||
return input.StartsWith("{") && input.EndsWith("}")
|
||||
|| input.StartsWith("[") && input.EndsWith("]");
|
||||
}
|
||||
|
||||
public static bool IsArchetype(this Property prop)
|
||||
{
|
||||
return prop.PropertyEditorAlias.InvariantEquals("Imulus.Archetype");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
{
|
||||
public class Archetype
|
||||
{
|
||||
public IEnumerable<Fieldset> Fieldsets { get; set; }
|
||||
|
||||
public Archetype()
|
||||
{
|
||||
Fieldsets = new List<Fieldset>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using System;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypeFieldsetModel
|
||||
{
|
||||
[JsonProperty("alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[JsonProperty("disabled")]
|
||||
public bool Disabled { get; set; }
|
||||
|
||||
[JsonProperty("properties")]
|
||||
public IEnumerable<ArchetypePropertyModel> Properties;
|
||||
|
||||
[JsonProperty("id")]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public ArchetypeFieldsetModel()
|
||||
{
|
||||
Properties = new List<ArchetypePropertyModel>();
|
||||
}
|
||||
|
||||
#region Helper Methods
|
||||
|
||||
public string GetValue(string propertyAlias)
|
||||
{
|
||||
return GetValue<string>(propertyAlias);
|
||||
}
|
||||
|
||||
public T GetValue<T>(string propertyAlias)
|
||||
{
|
||||
var property = GetProperty(propertyAlias);
|
||||
|
||||
if (IsEmptyProperty(property))
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
|
||||
return property.GetValue<T>();
|
||||
}
|
||||
|
||||
// issue 142: support default T value supplied by caller
|
||||
// this code would look nicer if the two GetValue<T>() methods had one common implementation.
|
||||
// however, this would require GetValue<T>(string propertyAlias) to call the common implementation
|
||||
// with a default(T) value, which could in theory result in a performance hit, if T for some reason
|
||||
// is costly to instantiate.
|
||||
public T GetValue<T>(string propertyAlias, T defaultValue)
|
||||
{
|
||||
var property = GetProperty(propertyAlias);
|
||||
|
||||
if (IsEmptyProperty(property))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return property.GetValue<T>();
|
||||
}
|
||||
|
||||
private bool IsEmptyProperty(ArchetypePropertyModel property)
|
||||
{
|
||||
return (property == null || property.Value == null || string.IsNullOrEmpty(property.Value.ToString()));
|
||||
}
|
||||
|
||||
public bool HasProperty(string propertyAlias)
|
||||
{
|
||||
return GetProperty(propertyAlias) != null;
|
||||
}
|
||||
|
||||
public bool HasValue(string propertyAlias)
|
||||
{
|
||||
var property = GetProperty(propertyAlias);
|
||||
if (property == null || property.Value == null)
|
||||
return false;
|
||||
|
||||
return !string.IsNullOrEmpty(property.Value.ToString());
|
||||
}
|
||||
|
||||
private ArchetypePropertyModel GetProperty(string propertyAlias)
|
||||
{
|
||||
return Properties.FirstOrDefault(p => p.Alias.InvariantEquals(propertyAlias));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
[JsonObject]
|
||||
public class ArchetypeModel : IEnumerable<ArchetypeFieldsetModel>
|
||||
{
|
||||
[JsonProperty("fieldsets")]
|
||||
public IEnumerable<ArchetypeFieldsetModel> Fieldsets { get; set; }
|
||||
|
||||
public ArchetypeModel()
|
||||
{
|
||||
Fieldsets = new List<ArchetypeFieldsetModel>();
|
||||
}
|
||||
|
||||
public IEnumerator<ArchetypeFieldsetModel> GetEnumerator()
|
||||
{
|
||||
return this.Fieldsets.Where(f => f.Disabled == false).GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
public string SerializeForPersistence()
|
||||
{
|
||||
var json = JObject.Parse(JsonConvert.SerializeObject(this, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }));
|
||||
|
||||
var propertiesToRemove = new String[] { "propertyEditorAlias", "dataTypeId", "dataTypeGuid", "hostContentType", "editorState" };
|
||||
|
||||
json.Descendants().OfType<JProperty>()
|
||||
.Where(p => propertiesToRemove.Contains(p.Name))
|
||||
.ToList()
|
||||
.ForEach(x => x.Remove());
|
||||
|
||||
return json.ToString(Formatting.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
namespace Archetype.Models
|
||||
{
|
||||
internal class ArchetypePreValue
|
||||
{
|
||||
internal IEnumerable<ArchetypePreValueFieldset> Fieldsets { get; set; }
|
||||
}
|
||||
public class ArchetypePreValue
|
||||
{
|
||||
[JsonProperty("showAdvancedOptions")]
|
||||
public bool ShowAdvancedOptions { get; set; }
|
||||
|
||||
[JsonProperty("startWithAddButton")]
|
||||
public bool StartWithAddButton { get; set; }
|
||||
|
||||
[JsonProperty("hideFieldsetToolbar")]
|
||||
[Obsolete("This value is no longer used but is kept to prevent breaking changes.")]
|
||||
public bool HideFieldsetToolbar { get; set; }
|
||||
|
||||
[JsonProperty("enableMultipleFieldsets")]
|
||||
public bool EnableMultipleFieldsets { get; set; }
|
||||
|
||||
[JsonProperty("enableCollapsing")]
|
||||
public bool EnableCollapsing { get; set; }
|
||||
|
||||
[JsonProperty("enableCloning")]
|
||||
public bool EnableCloning { get; set; }
|
||||
|
||||
[JsonProperty("enableDisabling")]
|
||||
public bool EnableDisabling { get; set; }
|
||||
|
||||
[JsonProperty("hideFieldsetControls")]
|
||||
public bool HideFieldsetControls { get; set; }
|
||||
|
||||
[JsonProperty("hidePropertyLabel")]
|
||||
public bool HidePropertyLabel { get; set; }
|
||||
|
||||
[JsonProperty("maxFieldsets", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public int MaxFieldsets { get; set; }
|
||||
|
||||
[JsonProperty("fieldsets")]
|
||||
public IEnumerable<ArchetypePreValueFieldset> Fieldsets { get; set; }
|
||||
|
||||
[JsonProperty("fieldsetGroups")]
|
||||
public IEnumerable<ArchetypePreValueFieldsetGroup> FieldsetGroups { get; set; }
|
||||
|
||||
[JsonProperty("hidePropertyLabels")]
|
||||
public bool HidePropertyLabels { get; set; }
|
||||
|
||||
[JsonProperty("customCssClass")]
|
||||
public string CustomCssClass { get; set; }
|
||||
|
||||
[JsonProperty("customCssPath")]
|
||||
public string CustomCssPath { get; set; }
|
||||
|
||||
[JsonProperty("customJsPath")]
|
||||
public string CustomJsPath { get; set; }
|
||||
|
||||
[JsonProperty("customViewPath")]
|
||||
public string CustomViewPath { get; set; }
|
||||
|
||||
[JsonProperty("enableDeepDatatypeRequests")]
|
||||
public bool EnableDeepDatatypeRequests { get; set; }
|
||||
|
||||
[JsonProperty("developerMode")]
|
||||
public bool DeveloperMode { get; set; }
|
||||
|
||||
[JsonProperty("overrideDefaultPropertyValueConverter")]
|
||||
public bool OverrideDefaultPropertyValueConverter { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
namespace Archetype.Models
|
||||
{
|
||||
internal class ArchetypePreValueFieldset
|
||||
{
|
||||
internal string Alias { get; set; }
|
||||
internal IEnumerable<ArchetypePreValueProperty> Properties { get; set; }
|
||||
}
|
||||
}
|
||||
public class ArchetypePreValueFieldset
|
||||
{
|
||||
[JsonProperty("alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[JsonProperty("remove")]
|
||||
public bool Remove { get; set; }
|
||||
|
||||
[JsonProperty("collapse")]
|
||||
public bool Collapse { get; set; }
|
||||
|
||||
[JsonProperty("labelTemplate")]
|
||||
public string LabelTemplate { get; set; }
|
||||
|
||||
[JsonProperty("icon")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
[JsonProperty("label")]
|
||||
public string Label { get; set; }
|
||||
|
||||
[JsonProperty("properties")]
|
||||
public IEnumerable<ArchetypePreValueProperty> Properties { get; set; }
|
||||
|
||||
[JsonProperty("group")]
|
||||
public ArchetypePreValueFieldsetGroup Group { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypePreValueFieldsetGroup
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,38 @@
|
||||
namespace Archetype.Umbraco.Models
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
internal class ArchetypePreValueProperty
|
||||
{
|
||||
internal string Alias { get; set; }
|
||||
internal int DataTypeId { get; set; }
|
||||
internal string PropertyEditorAlias { get; set; }
|
||||
}
|
||||
public class ArchetypePreValueProperty
|
||||
{
|
||||
[JsonProperty("alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[JsonProperty("remove")]
|
||||
public bool Remove { get; set; }
|
||||
|
||||
[JsonProperty("collapse")]
|
||||
public bool Collapse { get; set; }
|
||||
|
||||
[JsonProperty("label")]
|
||||
public string Label { get; set; }
|
||||
|
||||
[JsonProperty("helpText")]
|
||||
public string HelpText { get; set; }
|
||||
|
||||
[JsonProperty("dataTypeGuid")]
|
||||
public Guid DataTypeGuid { get; set; }
|
||||
|
||||
[JsonProperty("propertyEditorAlias")]
|
||||
public string PropertyEditorAlias { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
[JsonProperty("required")]
|
||||
public bool Required { get; set; }
|
||||
|
||||
[JsonProperty("regEx")]
|
||||
public string RegEx { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypePropertyModel
|
||||
{
|
||||
[JsonProperty("alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
public object Value { get; set; }
|
||||
|
||||
[JsonProperty("propertyEditorAlias")]
|
||||
public string PropertyEditorAlias { get; internal set; }
|
||||
|
||||
[JsonProperty("dataTypeId")]
|
||||
public int DataTypeId { get; internal set; }
|
||||
|
||||
[JsonProperty("dataTypeGuid")]
|
||||
internal string DataTypeGuid { get; set; }
|
||||
|
||||
// container for temporary editor state from the Umbraco backend
|
||||
[JsonProperty("editorState")]
|
||||
internal UmbracoEditorState EditorState { get; set; }
|
||||
|
||||
[JsonProperty("hostContentType")]
|
||||
internal PublishedContentType HostContentType { get; set; }
|
||||
|
||||
public T GetValue<T>()
|
||||
{
|
||||
// Try Umbraco's PropertyValueConverters
|
||||
var converters = UmbracoContext.Current != null ? PropertyValueConvertersResolver.Current.Converters : Enumerable.Empty<IPropertyValueConverter>();
|
||||
if (!string.IsNullOrWhiteSpace(this.PropertyEditorAlias) && converters.Any())
|
||||
{
|
||||
var convertedAttempt = TryConvertWithPropertyValueConverters<T>(Value, converters);
|
||||
if (convertedAttempt.Success)
|
||||
return convertedAttempt.Result;
|
||||
}
|
||||
|
||||
// If the value is of type T, just return it
|
||||
if (Value is T)
|
||||
return (T)Value;
|
||||
|
||||
// No PropertyValueConverters matched, so try a regular type conversion
|
||||
var convertAttempt2 = Value.TryConvertTo<T>();
|
||||
if (convertAttempt2.Success)
|
||||
return convertAttempt2.Result;
|
||||
|
||||
return default(T);
|
||||
}
|
||||
|
||||
private Attempt<T> TryConvertWithPropertyValueConverters<T>(object value, IEnumerable<IPropertyValueConverter> converters)
|
||||
{
|
||||
var properyType = this.CreateDummyPropertyType();
|
||||
|
||||
// In umbraco, there are default value converters that try to convert the
|
||||
// value if all else fails. The problem is, they are also in the list of
|
||||
// converters, and the means for filtering these out is internal, so
|
||||
// we currently have to try ALL converters to see if they can convert
|
||||
// rather than just finding the most appropreate. If the ability to filter
|
||||
// out default value converters becomes public, the following logic could
|
||||
// and probably should be changed.
|
||||
foreach (var converter in converters.Where(x => x.IsConverter(properyType)))
|
||||
{
|
||||
// Convert the type using a found value converter
|
||||
var value2 = converter.ConvertDataToSource(properyType, value, false);
|
||||
|
||||
// If the value is of type T, just return it
|
||||
if (value2 is T)
|
||||
return Attempt<T>.Succeed((T)value2);
|
||||
|
||||
// If ConvertDataToSource failed try ConvertSourceToObject.
|
||||
var value3 = converter.ConvertSourceToObject(properyType, value2, false);
|
||||
|
||||
// If the value is of type T, just return it
|
||||
if (value3 is T)
|
||||
return Attempt<T>.Succeed((T)value3);
|
||||
|
||||
// Value is not final value type, so try a regular type conversion aswell
|
||||
var convertAttempt = value2.TryConvertTo<T>();
|
||||
if (convertAttempt.Success)
|
||||
return Attempt<T>.Succeed(convertAttempt.Result);
|
||||
}
|
||||
|
||||
return Attempt<T>.Fail();
|
||||
}
|
||||
|
||||
internal class UmbracoEditorState
|
||||
{
|
||||
// container for the names of any files selected for a property in the Umbraco backend
|
||||
[JsonProperty("fileNames")]
|
||||
public IEnumerable<string> FileNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
{
|
||||
public class Fieldset
|
||||
{
|
||||
public string Alias { get; set; }
|
||||
|
||||
public IEnumerable<Property> Properties;
|
||||
|
||||
public Fieldset()
|
||||
{
|
||||
Properties = new List<Property>();
|
||||
}
|
||||
|
||||
#region Helper Methods
|
||||
|
||||
public string GetValue(string propertyAlias)
|
||||
{
|
||||
return GetValue<string>(propertyAlias);
|
||||
}
|
||||
|
||||
public T GetValue<T>(string propertyAlias)
|
||||
{
|
||||
var property = GetProperty(propertyAlias);
|
||||
|
||||
if (property == null || string.IsNullOrEmpty(property.Value.ToString()))
|
||||
return default(T);
|
||||
|
||||
return property.GetValue<T>();
|
||||
}
|
||||
|
||||
private Property GetProperty(string propertyAlias)
|
||||
{
|
||||
return Properties.FirstOrDefault(p => p.Alias.InvariantEquals(propertyAlias));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
{
|
||||
public class Property
|
||||
{
|
||||
public string Alias { get; internal set; }
|
||||
public object Value { get; internal set; }
|
||||
public string PropertyEditorAlias { get; internal set; }
|
||||
|
||||
internal int DataTypeId { get; set; }
|
||||
|
||||
public T GetValue<T>()
|
||||
{
|
||||
// If the value is of type T, just return it
|
||||
if (Value is T)
|
||||
return (T)Value;
|
||||
|
||||
// Umbraco has the concept of a IPropertyEditorValueConverter which it
|
||||
// also queries for property resolvers. However I'm not sure what these
|
||||
// are for, nor can I find any implementations in core, so am currently
|
||||
// just ignoring these when looking up converters.
|
||||
// NB: IPropertyEditorValueConverter not to be confused with
|
||||
// IPropertyValueConverter which are the ones most people are creating
|
||||
var properyType = CreateDummyPropertyType(DataTypeId, PropertyEditorAlias);
|
||||
var converters = PropertyValueConvertersResolver.Current.Converters.ToArray();
|
||||
|
||||
// In umbraco, there are default value converters that try to convert the
|
||||
// value if all else fails. The problem is, they are also in the list of
|
||||
// converters, and the means for filtering these out is internal, so
|
||||
// we currently have to try ALL converters to see if they can convert
|
||||
// rather than just finding the most appropreate. If the ability to filter
|
||||
// out default value converters becomes public, the following logic could
|
||||
// and probably should be changed.
|
||||
foreach (var converter in converters.Where(x => x.IsConverter(properyType)))
|
||||
{
|
||||
// Convert the type using a found value converter
|
||||
var value2 = converter.ConvertDataToSource(properyType, Value, false);
|
||||
|
||||
// If the value is of type T, just return it
|
||||
if (value2 is T)
|
||||
return (T)value2;
|
||||
|
||||
// Value is not final value type, so try a regular type conversion aswell
|
||||
var convertAttempt = value2.TryConvertTo<T>();
|
||||
if (convertAttempt.Success)
|
||||
return convertAttempt.Result;
|
||||
}
|
||||
|
||||
// Value is not final value type, so try a regular type conversion
|
||||
var convertAttempt2 = Value.TryConvertTo<T>();
|
||||
if (convertAttempt2.Success)
|
||||
return convertAttempt2.Result;
|
||||
|
||||
return default(T);
|
||||
}
|
||||
|
||||
private PublishedPropertyType CreateDummyPropertyType(int dataTypeId, string propertyEditorAlias)
|
||||
{
|
||||
return new PublishedPropertyType(null,
|
||||
new PropertyType(new DataTypeDefinition(-1, propertyEditorAlias)
|
||||
{
|
||||
Id = dataTypeId
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,36 +2,17 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Archetype")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyDescription("Archetype's supporting code library for Umbraco")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCompany("Imulus")]
|
||||
[assembly: AssemblyProduct("Archetype")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyCopyright("MIT Licensed")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("E37E94F9-C7BA-4B54-B7E1-64419B3DBA0B")]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e37e94f9-c7ba-4b54-b7e1-64419b3dba0b")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.1.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.1.0.0")]
|
||||
[assembly: AssemblyInformationalVersion("0.1.0-alpha")]
|
||||
[assembly: InternalsVisibleTo("Archetype.Courier")]
|
||||
[assembly: InternalsVisibleTo("Archetype.Tests")]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.11")]
|
||||
[assembly: AssemblyFileVersion("1.11")]
|
||||
@@ -1,110 +1,52 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Archetype.Umbraco.Models;
|
||||
using Archetype.Umbraco.Extensions;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Archetype.Umbraco.PropertyConverters
|
||||
{
|
||||
/* based on the Tim Geyssens sample at: https://github.com/TimGeyssens/MatrixPropEditor/blob/master/SamplePropertyValueConverter/SamplePropertyValueConverter/MatrixValueConverter.cs */
|
||||
[PropertyValueType(typeof(Archetype.Umbraco.Models.Archetype))]
|
||||
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
|
||||
public class ArchetypeValueConverter : PropertyValueConverterBase
|
||||
{
|
||||
protected JsonSerializerSettings _jsonSettings;
|
||||
|
||||
public ArchetypeValueConverter()
|
||||
{
|
||||
var dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver();
|
||||
dcr.DefaultMembersSearchFlags |= System.Reflection.BindingFlags.NonPublic;
|
||||
|
||||
_jsonSettings = new JsonSerializerSettings { ContractResolver = dcr };
|
||||
}
|
||||
|
||||
public ServiceContext Services
|
||||
{
|
||||
get { return ApplicationContext.Current.Services; }
|
||||
}
|
||||
|
||||
public override bool IsConverter(PublishedPropertyType propertyType)
|
||||
{
|
||||
return propertyType.PropertyEditorAlias.Equals("Imulus.Archetype");
|
||||
}
|
||||
|
||||
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
|
||||
{
|
||||
if (source == null) return null;
|
||||
|
||||
var sourceString = source.ToString();
|
||||
|
||||
if (sourceString.DetectIsJson())
|
||||
{
|
||||
try
|
||||
{
|
||||
// Deserialize value to archetype model
|
||||
var archetype = JsonConvert.DeserializeObject<Models.Archetype>(sourceString, _jsonSettings);
|
||||
|
||||
// Get list of configured properties and their types
|
||||
// and map them to the deserialized archetype model
|
||||
var preValue = GetArchetypePreValueFromDataTypeId(propertyType.DataTypeId);
|
||||
foreach (var fieldset in preValue.Fieldsets)
|
||||
{
|
||||
var fieldsetAlias = fieldset.Alias;
|
||||
foreach (var fieldsetInst in archetype.Fieldsets.Where(x => x.Alias == fieldsetAlias))
|
||||
{
|
||||
foreach (var property in fieldset.Properties)
|
||||
{
|
||||
var propertyAlias = property.Alias;
|
||||
foreach (var propertyInst in fieldsetInst.Properties.Where(x => x.Alias == propertyAlias))
|
||||
{
|
||||
propertyInst.DataTypeId = property.DataTypeId;
|
||||
propertyInst.PropertyEditorAlias = property.PropertyEditorAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return archetype;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return sourceString;
|
||||
}
|
||||
|
||||
internal ArchetypePreValue GetArchetypePreValueFromDataTypeId(int dataTypeId)
|
||||
{
|
||||
var preValues = Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeId);
|
||||
|
||||
var configJson = preValues.IsDictionaryBased
|
||||
? preValues.PreValuesAsDictionary["archetypeConfig"].Value
|
||||
: preValues.PreValuesAsArray.First().Value;
|
||||
|
||||
var config = JsonConvert.DeserializeObject<Models.ArchetypePreValue>(configJson, _jsonSettings);
|
||||
|
||||
foreach (var fieldset in config.Fieldsets)
|
||||
{
|
||||
foreach (var property in fieldset.Properties)
|
||||
{
|
||||
// Lookup the properties property editor alias
|
||||
// (See if we've already looked it up first though to save a database hit)
|
||||
var propertyWithSameDataType = config.Fieldsets.SelectMany(x => x.Properties)
|
||||
.FirstOrDefault(x => x.DataTypeId == property.DataTypeId && !string.IsNullOrWhiteSpace(x.PropertyEditorAlias));
|
||||
|
||||
property.PropertyEditorAlias = propertyWithSameDataType != null
|
||||
? propertyWithSameDataType.PropertyEditorAlias
|
||||
: Services.DataTypeService.GetDataTypeDefinitionById(property.DataTypeId).PropertyEditorAlias;
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using Archetype.Extensions;
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Archetype.PropertyConverters
|
||||
{
|
||||
[PropertyValueType(typeof(Models.ArchetypeModel))]
|
||||
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
|
||||
public class ArchetypeValueConverter : PropertyValueConverterBase
|
||||
{
|
||||
public ServiceContext Services
|
||||
{
|
||||
get { return ApplicationContext.Current.Services; }
|
||||
}
|
||||
|
||||
public override bool IsConverter(PublishedPropertyType propertyType)
|
||||
{
|
||||
var isArcheTypePropertyEditor = !String.IsNullOrEmpty(propertyType.PropertyEditorAlias)
|
||||
&& propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditorAlias);
|
||||
if (!isArcheTypePropertyEditor)
|
||||
return false;
|
||||
|
||||
return !ArchetypeHelper.Instance.IsPropertyValueConverterOverridden(propertyType.DataTypeId);
|
||||
}
|
||||
|
||||
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
|
||||
{
|
||||
var defaultValue = new ArchetypeModel();
|
||||
|
||||
if (source == null)
|
||||
return defaultValue;
|
||||
|
||||
var sourceString = source.ToString();
|
||||
|
||||
if (!sourceString.DetectIsJson())
|
||||
return defaultValue;
|
||||
|
||||
using (var timer = DisposableTimer.DebugDuration<ArchetypeValueConverter>(string.Format("ConvertDataToSource ({0})", propertyType != null ? propertyType.PropertyTypeAlias : "null")))
|
||||
{
|
||||
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(sourceString,
|
||||
(propertyType != null ? propertyType.DataTypeId : -1),
|
||||
(propertyType != null ? propertyType.ContentType : null));
|
||||
|
||||
return archetype;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Extensions;
|
||||
using ClientDependency.Core;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Editors;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.PropertyEditors;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Archetype.PropertyEditors
|
||||
{
|
||||
[PropertyEditorAsset(ClientDependencyType.Javascript, "../App_Plugins/Archetype/js/archetype.js")]
|
||||
[PropertyEditor(Constants.PropertyEditorAlias, "Archetype", "../App_Plugins/Archetype/views/archetype.html", ValueType = "JSON")]
|
||||
public class ArchetypePropertyEditor : PropertyEditor
|
||||
{
|
||||
#region Pre Value Editor
|
||||
|
||||
protected override PreValueEditor CreatePreValueEditor()
|
||||
{
|
||||
return new ArchetypePreValueEditor();
|
||||
}
|
||||
|
||||
internal class ArchetypePreValueEditor : PreValueEditor
|
||||
{
|
||||
[PreValueField("archetypeConfig", "Config", "../App_Plugins/Archetype/views/archetype.config.html",
|
||||
Description = "(Required) Describe your Archetype.")]
|
||||
public string Config { get; set; }
|
||||
|
||||
[PreValueField("hideLabel", "Hide Label", "boolean",
|
||||
Description = "Hide the Umbraco property title and description, making the Archetype span the entire page width")]
|
||||
public bool HideLabel { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Value Editor
|
||||
|
||||
protected override PropertyValueEditor CreateValueEditor()
|
||||
{
|
||||
return new ArchetypePropertyValueEditor(base.CreateValueEditor());
|
||||
}
|
||||
|
||||
internal class ArchetypePropertyValueEditor : PropertyValueEditorWrapper
|
||||
{
|
||||
protected JsonSerializerSettings _jsonSettings;
|
||||
|
||||
public ArchetypePropertyValueEditor(PropertyValueEditor wrapped)
|
||||
: base(wrapped)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ConvertDbToString(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
|
||||
{
|
||||
if(property.Value == null || property.Value.ToString() == "")
|
||||
return string.Empty;
|
||||
|
||||
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(property.Value.ToString(), propertyType.DataTypeDefinitionId);
|
||||
|
||||
foreach (var fieldset in archetype.Fieldsets)
|
||||
{
|
||||
foreach (var propDef in fieldset.Properties.Where(p => p.DataTypeGuid != null))
|
||||
{
|
||||
try
|
||||
{
|
||||
if(propDef == null || propDef.DataTypeGuid == null) continue;
|
||||
var dtd = ArchetypeHelper.Instance.GetDataTypeByGuid(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<ArchetypePropertyValueEditor>(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return archetype.SerializeForPersistence();
|
||||
}
|
||||
|
||||
public override object ConvertDbToEditor(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
|
||||
{
|
||||
if(property.Value == null || property.Value.ToString() == "")
|
||||
return string.Empty;
|
||||
|
||||
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(property.Value.ToString(), propertyType.DataTypeDefinitionId);
|
||||
|
||||
foreach (var fieldset in archetype.Fieldsets)
|
||||
{
|
||||
foreach (var propDef in fieldset.Properties.Where(p => p.DataTypeGuid != null))
|
||||
{
|
||||
try
|
||||
{
|
||||
var dtd = ArchetypeHelper.Instance.GetDataTypeByGuid(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<ArchetypePropertyValueEditor>(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return archetype;
|
||||
}
|
||||
|
||||
public override object ConvertEditorToDb(ContentPropertyData editorValue, object currentValue)
|
||||
{
|
||||
if(editorValue.Value == null || editorValue.Value.ToString() == "")
|
||||
return string.Empty;
|
||||
|
||||
// attempt to deserialize the current property value as an Archetype
|
||||
var currentArchetype = currentValue != null ? ArchetypeHelper.Instance.DeserializeJsonToArchetype(currentValue.ToString(), editorValue.PreValues) : null;
|
||||
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(editorValue.Value.ToString(), editorValue.PreValues);
|
||||
|
||||
// get all files uploaded via the file manager (if any)
|
||||
var uploadedFiles = editorValue.AdditionalData.ContainsKey("files") ? editorValue.AdditionalData["files"] as IEnumerable<ContentItemFile> : null;
|
||||
foreach (var fieldset in archetype.Fieldsets)
|
||||
{
|
||||
// assign an id to the fieldset if it has none (e.g. newly created fieldset)
|
||||
fieldset.Id = fieldset.Id == Guid.Empty ? Guid.NewGuid() : fieldset.Id;
|
||||
// find the corresponding fieldset in the current Archetype value (if any)
|
||||
var currentFieldset = currentArchetype != null ? currentArchetype.Fieldsets.FirstOrDefault(f => f.Id == fieldset.Id) : null;
|
||||
foreach (var propDef in fieldset.Properties)
|
||||
{
|
||||
try
|
||||
{
|
||||
// find the corresponding property in the current Archetype value (if any)
|
||||
var currentProperty = currentFieldset != null ? currentFieldset.Properties.FirstOrDefault(p => p.Alias == propDef.Alias) : null;
|
||||
var dtd = ArchetypeHelper.Instance.GetDataTypeByGuid(Guid.Parse(propDef.DataTypeGuid));
|
||||
var preValues = ApplicationContext.Current.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dtd.Id);
|
||||
|
||||
var additionalData = new Dictionary<string, object>();
|
||||
|
||||
// figure out if we need to pass a files collection in the additional data to the property value editor
|
||||
if(uploadedFiles != null)
|
||||
{
|
||||
if(dtd.PropertyEditorAlias == Constants.PropertyEditorAlias)
|
||||
{
|
||||
// it's a nested Archetype - just pass all uploaded files to the value editor
|
||||
additionalData["files"] = uploadedFiles.ToList();
|
||||
}
|
||||
else if (propDef.EditorState != null && propDef.EditorState.FileNames != null && propDef.EditorState.FileNames.Any())
|
||||
{
|
||||
// pass the uploaded files that belongs to this property (if any) to the value editor
|
||||
var propertyFiles = propDef.EditorState.FileNames.Select(f => uploadedFiles.FirstOrDefault(u => u.FileName == f)).Where(f => f != null).ToList();
|
||||
if(propertyFiles.Any())
|
||||
{
|
||||
additionalData["files"] = propertyFiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
var propData = new ContentPropertyData(propDef.Value, preValues, additionalData);
|
||||
var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
|
||||
// make sure to send the current property value (if any) to the PE ValueEditor
|
||||
propDef.Value = propEditor.ValueEditor.ConvertEditorToDb(propData, currentProperty != null ? currentProperty.Value : null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<ArchetypePropertyValueEditor>(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return archetype.SerializeForPersistence();
|
||||
}
|
||||
|
||||
internal virtual PropertyEditor GetPropertyEditor(IDataTypeDefinition dtd)
|
||||
{
|
||||
if(dtd.Id != 0)
|
||||
return PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
|
||||
|
||||
return dtd.PropertyEditorAlias.Equals(Constants.PropertyEditorAlias)
|
||||
? new ArchetypePropertyEditor()
|
||||
: (PropertyEditor) new TextboxPropertyEditor();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,9 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
|
||||
<package id="ClientDependency" version="1.7.0.4" targetFramework="net45" />
|
||||
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
|
||||
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
|
||||
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
|
||||
<package id="ImageProcessor" version="1.9.0.0" targetFramework="net45" />
|
||||
<package id="ImageProcessor.Web" version="3.2.3.0" targetFramework="net45" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" targetFramework="net45" />
|
||||
@@ -17,8 +19,8 @@
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.0.1" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
|
||||
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -1,148 +0,0 @@
|
||||
[
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.CheckBoxList",
|
||||
"view": "checkboxlist"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.ColorPickerAlias",
|
||||
"view": "colorpicker"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.ContentPickerAlias",
|
||||
"view": "contentpicker"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.Date",
|
||||
"view": "datepicker",
|
||||
"defaultPreValues": [{ "format": "yyyy-MM-dd", "pickTime": false }]
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.DateTime",
|
||||
"view": "datepicker",
|
||||
"format": "yyyy-MM-dd hh:mm:ss"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.DropDown",
|
||||
"view": "dropdown"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.DropDownMultiple",
|
||||
"view": "dropdown"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.DropDownMultiplePublishKeys",
|
||||
"view": "dropdown"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.DropdownlistPublishingKeys",
|
||||
"view": "dropdown"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.EmailAddress",
|
||||
"view": "email"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.UploadField",
|
||||
"view": "fileupload"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.FolderBrowser",
|
||||
"view": "folderbrowser"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.Integer",
|
||||
"view": "integer"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.NoEdit",
|
||||
"view": "readonlyvalue"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.ListView",
|
||||
"view": "listview"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MacroContainer",
|
||||
"view": "macrocontainer"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MarkdownEditor",
|
||||
"view": "markdowneditor"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MediaPicker",
|
||||
"view": "mediapicker",
|
||||
"defaultPreValues": [{ "multiPicker": "0" }]
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MemberGroupPicker",
|
||||
"view": "membergrouppicker"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MemberPicker",
|
||||
"view": "memberpicker"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MultiNodeTreePicker",
|
||||
"view": "contentpicker",
|
||||
"defaultPreValues": [{ "multiPicker": "1" }]
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MultipleMediaPicker",
|
||||
"view": "mediapicker"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.MultipleTextstring",
|
||||
"view": "multipletextbox"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.RadioButtonList",
|
||||
"view": "radiobuttons"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.RelatedLinks",
|
||||
"view": "relatedlinks"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.TinyMCEv3",
|
||||
"view": "rte"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.Slider",
|
||||
"view": "slider"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.Tags",
|
||||
"view": "tags",
|
||||
"defaultPreValues": [{ "group": "default" }]
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.TextboxMultiple",
|
||||
"view": "textarea"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.Textbox",
|
||||
"view": "textbox"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.TrueFalse",
|
||||
"view": "boolean"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.UserPicker",
|
||||
"view": "entitypicker",
|
||||
"defaultPreValues": [{ "entityType": "User" }]
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.NoEdit",
|
||||
"view": "readonlyvalue"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Umbraco.Textbox",
|
||||
"view": "textbox"
|
||||
},
|
||||
{
|
||||
"propertyEditorAlias": "Imulus.Archetype",
|
||||
"view": "/App_Plugins/Archetype/views/archetype.html"
|
||||
}
|
||||
]
|
||||
@@ -1,19 +1,25 @@
|
||||
angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource) {
|
||||
|
||||
//$scope.model.value = "";
|
||||
//console.log($scope.model.value);
|
||||
|
||||
//$scope.model.value = "";
|
||||
//console.log($scope.model.value);
|
||||
|
||||
//define empty items
|
||||
var newPropertyModel = '{"alias": "", "remove": false, "collapse": false, "label": "", "helpText": "", "dataTypeId": "-88", "value": ""}';
|
||||
var newFieldsetModel = '{"alias": "", "remove": false, "collapse": false, "labelTemplate": "", "icon": "", "label": "", "properties": [' + newPropertyModel + ']}';
|
||||
var defaultFieldsetConfigModel = JSON.parse('{"showAdvancedOptions": false, "hideFieldsetToolbar": false, "enableMultipleFieldsets": false, "hideFieldsetControls": false, "hidePropertyLabel": false, "maxFieldsets": null, "fieldsets": [' + newFieldsetModel + ']}');
|
||||
var newPropertyModel = '{"alias": "", "remove": false, "collapse": false, "label": "", "helpText": "", "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae", "value": ""}';
|
||||
var newFieldsetModel = '{"alias": "", "remove": false, "collapse": false, "labelTemplate": "", "icon": "", "label": "", "properties": [' + newPropertyModel + '], "group": null}';
|
||||
var defaultFieldsetConfigModel = JSON.parse('{"showAdvancedOptions": false, "startWithAddButton": false, "hideFieldsetToolbar": false, "enableMultipleFieldsets": false, "hideFieldsetControls": false, "hidePropertyLabel": false, "maxFieldsets": null, "enableCollapsing": true, "enableCloning": false, "enableDisabling": true, "enableDeepDatatypeRequests": false, "fieldsets": [' + newFieldsetModel + '], "fieldsetGroups": []}');
|
||||
|
||||
//ini the model
|
||||
$scope.model.value = $scope.model.value || defaultFieldsetConfigModel;
|
||||
|
||||
|
||||
$scope.dllVersion = "";
|
||||
|
||||
archetypePropertyEditorResource.getDllVersion().then(function(data){
|
||||
$scope.dllVersion = data.dllVersion;
|
||||
});
|
||||
|
||||
//ini the render model
|
||||
initConfigRenderModel();
|
||||
|
||||
|
||||
//get the available datatypes
|
||||
archetypePropertyEditorResource.getAllDataTypes().then(function(data) {
|
||||
$scope.availableDataTypes = data;
|
||||
@@ -40,16 +46,16 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//function that determines how to manage expanding/collapsing fieldsets
|
||||
$scope.focusFieldset = function(fieldset){
|
||||
var iniState;
|
||||
|
||||
|
||||
if(fieldset)
|
||||
{
|
||||
iniState = fieldset.collapse;
|
||||
}
|
||||
|
||||
|
||||
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
|
||||
if($scope.archetypeConfigRenderModel.fieldsets.length == 1 && fieldset.remove == false)
|
||||
{
|
||||
@@ -66,7 +72,7 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
fieldset.collapse = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if(iniState)
|
||||
{
|
||||
fieldset.collapse = !iniState;
|
||||
@@ -79,7 +85,7 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
//function that determines how to manage expanding/collapsing properties
|
||||
$scope.focusProperty = function(properties, property){
|
||||
var iniState;
|
||||
|
||||
|
||||
if(property)
|
||||
{
|
||||
iniState = property.collapse;
|
||||
@@ -95,7 +101,7 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
property.collapse = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if(iniState)
|
||||
{
|
||||
property.collapse = !iniState;
|
||||
@@ -104,29 +110,47 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
|
||||
//ini the properties
|
||||
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
|
||||
$scope.focusProperty(fieldset.properties);
|
||||
$scope.focusProperty(fieldset.properties);
|
||||
});
|
||||
|
||||
|
||||
//setup JSON.stringify helpers
|
||||
$scope.archetypeConfigRenderModel.toString = stringify;
|
||||
|
||||
|
||||
//encapsulate stringify (should be built into browsers, not sure of IE support)
|
||||
function stringify() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
|
||||
//watch for changes
|
||||
$scope.$watch('archetypeConfigRenderModel', function (v) {
|
||||
//console.log(v);
|
||||
if (typeof v === 'string') {
|
||||
if (typeof v === 'string') {
|
||||
$scope.archetypeConfigRenderModel = JSON.parse(v);
|
||||
$scope.archetypeConfigRenderModel.toString = stringify;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$scope.autoPopulateAlias = function(s) {
|
||||
var modelType = s.hasOwnProperty('fieldset') ? 'fieldset' : 'property';
|
||||
var modelProperty = s[modelType];
|
||||
|
||||
if (!modelProperty.aliasIsDirty) {
|
||||
modelProperty.alias = modelProperty.label.toUmbracoAlias();
|
||||
}
|
||||
}
|
||||
|
||||
$scope.markAliasDirty = function(s) {
|
||||
var modelType = s.hasOwnProperty('fieldset') ? 'fieldset' : 'property';
|
||||
var modelProperty = s[modelType];
|
||||
|
||||
if (!modelProperty.aliasIsDirty) {
|
||||
modelProperty.aliasIsDirty = true;;
|
||||
}
|
||||
}
|
||||
|
||||
//helper that returns if an item can be removed
|
||||
$scope.canRemoveFieldset = function ()
|
||||
{
|
||||
{
|
||||
return countVisibleFieldset() > 1;
|
||||
}
|
||||
|
||||
@@ -135,10 +159,10 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
{
|
||||
return countVisibleFieldset() > 1;
|
||||
}
|
||||
|
||||
|
||||
//helper that returns if an item can be removed
|
||||
$scope.canRemoveProperty = function (fieldset)
|
||||
{
|
||||
{
|
||||
return countVisibleProperty(fieldset) > 1;
|
||||
}
|
||||
|
||||
@@ -148,17 +172,17 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
return countVisibleProperty(fieldset) > 1;
|
||||
}
|
||||
|
||||
$scope.getDataTypeNameById = function (id) {
|
||||
$scope.getDataTypeNameByGuid = function (guid) {
|
||||
if ($scope.availableDataTypes == null) // Might not be initialized yet?
|
||||
return "";
|
||||
|
||||
|
||||
var dataType = _.find($scope.availableDataTypes, function(d) {
|
||||
return d.id == id;
|
||||
return d.guid == guid;
|
||||
});
|
||||
|
||||
return dataType == null ? "" : dataType.name;
|
||||
}
|
||||
|
||||
|
||||
//helper to count what is visible
|
||||
function countVisibleFieldset()
|
||||
{
|
||||
@@ -172,7 +196,7 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
//determines how many properties are visible
|
||||
function countVisibleProperty(fieldset)
|
||||
{
|
||||
@@ -186,13 +210,13 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
//handles a fieldset add
|
||||
$scope.addFieldsetRow = function ($index, $event) {
|
||||
$scope.archetypeConfigRenderModel.fieldsets.splice($index + 1, 0, JSON.parse(newFieldsetModel));
|
||||
$scope.focusFieldset();
|
||||
}
|
||||
|
||||
|
||||
//rather than splice the archetypeConfigRenderModel, we're hiding this and cleaning onFormSubmitting
|
||||
$scope.removeFieldsetRow = function ($index) {
|
||||
if ($scope.canRemoveFieldset()) {
|
||||
@@ -201,12 +225,12 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//handles a property add
|
||||
$scope.addPropertyRow = function (fieldset, $index) {
|
||||
fieldset.properties.splice($index + 1, 0, JSON.parse(newPropertyModel));
|
||||
}
|
||||
|
||||
|
||||
//rather than splice the archetypeConfigRenderModel, we're hiding this and cleaning onFormSubmitting
|
||||
$scope.removePropertyRow = function (fieldset, $index) {
|
||||
if ($scope.canRemoveProperty(fieldset)) {
|
||||
@@ -215,15 +239,27 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//helper to ini the render model
|
||||
function initConfigRenderModel()
|
||||
{
|
||||
$scope.archetypeConfigRenderModel = $scope.model.value;
|
||||
if (!$scope.archetypeConfigRenderModel.fieldsetGroups) {
|
||||
$scope.archetypeConfigRenderModel.fieldsetGroups = [];
|
||||
}
|
||||
|
||||
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
|
||||
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset) {
|
||||
|
||||
if (fieldset.group) {
|
||||
// tie the fieldset group back up to the actual group object, not the clone that's been persisted
|
||||
fieldset.group = _.find($scope.archetypeConfigRenderModel.fieldsetGroups, function(fieldsetGroup) {
|
||||
return fieldsetGroup.name == fieldset.group.name;
|
||||
})
|
||||
}
|
||||
|
||||
fieldset.remove = false;
|
||||
if (fieldset.alias.length > 0)
|
||||
fieldset.aliasIsDirty = true;
|
||||
|
||||
if(fieldset.label)
|
||||
{
|
||||
@@ -232,41 +268,58 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
|
||||
_.each(fieldset.properties, function(fieldset){
|
||||
fieldset.remove = false;
|
||||
if (fieldset.alias.length > 0)
|
||||
fieldset.aliasIsDirty = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//sync things up on save
|
||||
$scope.$on("formSubmitting", function (ev, args) {
|
||||
syncModelToRenderModel();
|
||||
});
|
||||
|
||||
|
||||
//helper to sync the model to the renderModel
|
||||
function syncModelToRenderModel()
|
||||
{
|
||||
$scope.model.value = $scope.archetypeConfigRenderModel;
|
||||
var fieldsets = [];
|
||||
|
||||
|
||||
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
|
||||
//check fieldsets
|
||||
if (!fieldset.remove) {
|
||||
fieldsets.push(fieldset);
|
||||
|
||||
|
||||
var properties = [];
|
||||
|
||||
_.each(fieldset.properties, function(property){
|
||||
if (!property.remove) {
|
||||
properties.push(property);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
fieldset.properties = properties;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$scope.model.value.fieldsets = fieldsets;
|
||||
}
|
||||
|
||||
|
||||
$scope.showOptions = function ($event, template) {
|
||||
$event.preventDefault();
|
||||
|
||||
dialogService.closeAll();
|
||||
|
||||
dialogService.open({
|
||||
template: template,
|
||||
show: true,
|
||||
callback: function(data) {
|
||||
$scope.archetypeConfigRenderModel = data;
|
||||
},
|
||||
dialogData: $scope.archetypeConfigRenderModel
|
||||
});
|
||||
}
|
||||
|
||||
//archetype css
|
||||
assetsService.loadCss("/App_Plugins/Archetype/css/archetype.css");
|
||||
assetsService.loadCss("../App_Plugins/Archetype/css/archetype.css");
|
||||
});
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) {
|
||||
$scope.model = angular.copy($scope.dialogData);
|
||||
|
||||
//handles a fieldset group add
|
||||
$scope.addFieldsetGroup = function () {
|
||||
$scope.model.fieldsetGroups.push({ name: "" });
|
||||
}
|
||||
|
||||
//handles a fieldset group removal
|
||||
$scope.removeFieldsetGroup = function ($index) {
|
||||
$scope.model.fieldsetGroups.splice($index, 1);
|
||||
}
|
||||
|
||||
$scope.apply = function(index) {
|
||||
$scope.submit($scope.model);
|
||||
}
|
||||
});
|
||||
+324
-144
@@ -1,89 +1,195 @@
|
||||
angular.module("umbraco").controller("Imulus.ArchetypeController", function ($scope, $http, assetsService, angularHelper, notificationsService) {
|
||||
|
||||
{{VERSION}}
|
||||
angular.module("umbraco").controller("Imulus.ArchetypeController", function ($scope, $http, $filter, assetsService, angularHelper, notificationsService, $timeout, fileManager, entityResource, archetypeService, archetypeLabelService, archetypeCacheService, archetypePropertyEditorResource) {
|
||||
|
||||
//$scope.model.value = "";
|
||||
$scope.model.hideLabel = $scope.model.config.hideLabel == 1;
|
||||
|
||||
//get a reference to the current form
|
||||
var form = angularHelper.getCurrentForm($scope);
|
||||
$scope.form = $scope.form || angularHelper.getCurrentForm($scope);
|
||||
|
||||
//set the config equal to our prevalue config
|
||||
$scope.model.config = $scope.model.config.archetypeConfig;
|
||||
|
||||
|
||||
//ini the model
|
||||
$scope.model.value = $scope.model.value || { fieldsets: [getEmptyRenderFieldset($scope.model.config.fieldsets[0])] };
|
||||
$scope.model.value = $scope.model.value || getDefaultModel($scope.model.config);
|
||||
|
||||
//ini the render model
|
||||
$scope.archetypeRenderModel = {};
|
||||
initArchetypeRenderModel();
|
||||
|
||||
//helper to get $eval the labelTemplate
|
||||
$scope.getFieldsetTitle = function(fieldsetConfigModel, fieldsetIndex) {
|
||||
var fieldset = $scope.archetypeRenderModel.fieldsets[fieldsetIndex];
|
||||
var fieldsetConfig = $scope.getConfigFieldsetByAlias(fieldset.alias);
|
||||
var template = fieldsetConfigModel.labelTemplate;
|
||||
// store the umbraco property alias to help generate unique IDs. Hopefully there's a better way to get this in the future :)
|
||||
$scope.umbracoHostPropertyAlias = $scope.$parent.$parent.model.alias;
|
||||
|
||||
if (template.length < 1)
|
||||
return fieldsetConfig.label;
|
||||
|
||||
var rgx = /{{(.*?)}}*/g;
|
||||
var results;
|
||||
var parsedTemplate = template;
|
||||
|
||||
while ((results = rgx.exec(template)) !== null) {
|
||||
var propertyAlias = results[1];
|
||||
var propertyValue = $scope.getPropertyValueByAlias(fieldset, propertyAlias);
|
||||
parsedTemplate = parsedTemplate.replace(results[0], propertyValue);
|
||||
}
|
||||
|
||||
return parsedTemplate;
|
||||
$scope.overlayMenu = {
|
||||
show: false,
|
||||
style: {}
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
//hold references to helper resources
|
||||
$scope.resources = {
|
||||
entityResource: entityResource,
|
||||
archetypePropertyEditorResource: archetypePropertyEditorResource
|
||||
}
|
||||
|
||||
//hold references to helper services
|
||||
$scope.services = {
|
||||
archetypeService: archetypeService,
|
||||
archetypeLabelService: archetypeLabelService,
|
||||
archetypeCacheService: archetypeCacheService
|
||||
}
|
||||
|
||||
//helper to get $eval the labelTemplate
|
||||
$scope.getFieldsetTitle = function (fieldsetConfigModel, fieldsetIndex) {
|
||||
return archetypeLabelService.getFieldsetTitle($scope, fieldsetConfigModel, fieldsetIndex);
|
||||
}
|
||||
|
||||
var draggedRteSettings;
|
||||
var rteClass = ".umb-rte textarea";
|
||||
|
||||
//sort config
|
||||
$scope.sortableOptions = {
|
||||
axis: 'y',
|
||||
cursor: "move",
|
||||
handle: ".handle",
|
||||
start: function(ev, ui) {
|
||||
draggedRteSettings = {};
|
||||
$(rteClass, ui.item.parent()).each(function () {
|
||||
var id = $(this).attr("id");
|
||||
draggedRteSettings[id] = _.findWhere(tinyMCE.editors, { id: id }).settings;
|
||||
tinymce.execCommand('mceRemoveEditor', false, id);
|
||||
$(this).css("visibility", "hidden");
|
||||
});
|
||||
},
|
||||
update: function (ev, ui) {
|
||||
|
||||
$scope.setDirty();
|
||||
},
|
||||
stop: function (ev, ui) {
|
||||
|
||||
$(rteClass, ui.item.parent()).each(function () {
|
||||
var id = $(this).attr("id");
|
||||
draggedRteSettings[id] = draggedRteSettings[id] || _.findWhere(tinyMCE.editors, { id: id }).settings;
|
||||
tinyMCE.execCommand("mceRemoveEditor", false, id);
|
||||
tinyMCE.init(draggedRteSettings[id]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//handles a fieldset add
|
||||
$scope.openFieldsetPicker = function ($index, event) {
|
||||
if ($scope.canAdd() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
var allFieldsets = [];
|
||||
_.each($scope.model.config.fieldsets, function (fieldset) {
|
||||
var icon = fieldset.icon;
|
||||
allFieldsets.push({
|
||||
alias: fieldset.alias,
|
||||
label: fieldset.label,
|
||||
icon: (fieldset.icon || "icon-document-dashed-line"), // default icon if none is chosen
|
||||
group: fieldset.group ? fieldset.group.name : null
|
||||
});
|
||||
});
|
||||
// sanity check
|
||||
if (allFieldsets == 0) {
|
||||
return;
|
||||
}
|
||||
if (allFieldsets.length == 1) {
|
||||
// only one fieldset type - no need to display the picker
|
||||
$scope.addRow(allFieldsets[0].alias, $index);
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.overlayMenu.fieldsetGroups = [];
|
||||
if ($scope.model.config.fieldsetGroups && $scope.model.config.fieldsetGroups.length > 0) {
|
||||
_.each($scope.model.config.fieldsetGroups, function (fieldsetGroup) {
|
||||
$scope.overlayMenu.fieldsetGroups.push({ name: fieldsetGroup.name, fieldsets: $filter("filter")(allFieldsets, { group: fieldsetGroup.name }, true) });
|
||||
})
|
||||
}
|
||||
else {
|
||||
$scope.overlayMenu.fieldsetGroups.push({ name: "", fieldsets: allFieldsets });
|
||||
}
|
||||
$scope.overlayMenu.index = $index;
|
||||
$scope.overlayMenu.activeFieldsetGroup = $scope.overlayMenu.fieldsetGroups[0];
|
||||
|
||||
// calculate overlay position
|
||||
// - yeah... it's jQuery (ungh!) but that's how the Grid does it.
|
||||
var offset = $(event.target).offset();
|
||||
var scrollTop = $(event.target).closest(".umb-panel-body").scrollTop();
|
||||
if (offset.top < 400) {
|
||||
$scope.overlayMenu.style.top = 300 + scrollTop;
|
||||
}
|
||||
else {
|
||||
$scope.overlayMenu.style.top = offset.top - 150 + scrollTop;
|
||||
}
|
||||
$scope.overlayMenu.show = true;
|
||||
};
|
||||
|
||||
$scope.closeFieldsetPicker = function () {
|
||||
$scope.overlayMenu.show = false;
|
||||
};
|
||||
|
||||
$scope.pickFieldset = function (fieldsetAlias, $index) {
|
||||
$scope.closeFieldsetPicker();
|
||||
$scope.addRow(fieldsetAlias, $index);
|
||||
};
|
||||
|
||||
$scope.addRow = function (fieldsetAlias, $index) {
|
||||
if ($scope.canAdd())
|
||||
{
|
||||
if ($scope.model.config.fieldsets)
|
||||
{
|
||||
if ($scope.canAdd()) {
|
||||
if ($scope.model.config.fieldsets) {
|
||||
var newFieldset = getEmptyRenderFieldset($scope.getConfigFieldsetByAlias(fieldsetAlias));
|
||||
|
||||
if (typeof $index != 'undefined')
|
||||
{
|
||||
$scope.archetypeRenderModel.fieldsets.splice($index + 1, 0, newFieldset);
|
||||
$scope.model.value.fieldsets.splice($index + 1, 0, newFieldset);
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.archetypeRenderModel.fieldsets.push(newFieldset);
|
||||
$scope.model.value.fieldsets.push(newFieldset);
|
||||
}
|
||||
}
|
||||
newFieldset.collapse = true;
|
||||
|
||||
$scope.setDirty();
|
||||
|
||||
$scope.$broadcast("archetypeAddFieldset", {index: $index, visible: countVisible()});
|
||||
|
||||
newFieldset.collapse = $scope.model.config.enableCollapsing ? true : false;
|
||||
|
||||
$scope.focusFieldset(newFieldset);
|
||||
}
|
||||
}
|
||||
|
||||
//rather than splice the archetypeRenderModel, we're hiding this and cleaning onFormSubmitting
|
||||
$scope.removeRow = function ($index) {
|
||||
if ($scope.canRemove()) {
|
||||
if (confirm('Are you sure you want to remove this?')) {
|
||||
$scope.archetypeRenderModel.fieldsets[$index].remove = true;
|
||||
$scope.setDirty();
|
||||
$scope.model.value.fieldsets.splice($index, 1);
|
||||
$scope.$broadcast("archetypeRemoveFieldset", {index: $index});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scope.cloneRow = function ($index) {
|
||||
if ($scope.canClone() && typeof $index != 'undefined') {
|
||||
var newFieldset = angular.copy($scope.model.value.fieldsets[$index]);
|
||||
|
||||
if(newFieldset) {
|
||||
|
||||
$scope.model.value.fieldsets.splice($index + 1, 0, newFieldset);
|
||||
|
||||
$scope.setDirty();
|
||||
|
||||
newFieldset.collapse = $scope.model.config.enableCollapsing ? true : false;
|
||||
$scope.focusFieldset(newFieldset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scope.enableDisable = function (fieldset) {
|
||||
fieldset.disabled = !fieldset.disabled;
|
||||
// explicitly set the form as dirty when manipulating the enabled/disabled state of a fieldset
|
||||
$scope.setDirty();
|
||||
}
|
||||
|
||||
//helpers for determining if a user can do something
|
||||
$scope.canAdd = function ()
|
||||
{
|
||||
$scope.canAdd = function () {
|
||||
if ($scope.model.config.maxFieldsets)
|
||||
{
|
||||
return countVisible() < $scope.model.config.maxFieldsets;
|
||||
@@ -93,9 +199,24 @@
|
||||
}
|
||||
|
||||
//helper that returns if an item can be removed
|
||||
$scope.canRemove = function ()
|
||||
{
|
||||
return countVisible() > 1;
|
||||
$scope.canRemove = function () {
|
||||
return countVisible() > 1
|
||||
|| ($scope.model.config.maxFieldsets == 1 && $scope.model.config.fieldsets.length > 1)
|
||||
|| $scope.model.config.startWithAddButton;
|
||||
}
|
||||
|
||||
$scope.canClone = function () {
|
||||
|
||||
if (!$scope.model.config.enableCloning) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($scope.model.config.maxFieldsets)
|
||||
{
|
||||
return countVisible() < $scope.model.config.maxFieldsets;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//helper that returns if an item can be sorted
|
||||
@@ -104,16 +225,31 @@
|
||||
return countVisible() > 1;
|
||||
}
|
||||
|
||||
//helper, ini the render model from the server (model.value)
|
||||
function initArchetypeRenderModel() {
|
||||
$scope.archetypeRenderModel = $scope.model.value;
|
||||
//helper that returns if an item can be disabled
|
||||
$scope.canDisable = function () {
|
||||
return $scope.model.config.enableDisabling;
|
||||
}
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function (fieldset)
|
||||
//helpers for determining if the add button should be shown
|
||||
$scope.showAddButton = function () {
|
||||
return $scope.model.config.startWithAddButton
|
||||
&& countVisible() === 0;
|
||||
///&& $scope.model.config.fieldsets.length == 1;
|
||||
}
|
||||
|
||||
//helper, ini the render model from the server (model.value)
|
||||
function init() {
|
||||
$scope.model.value = removeNulls($scope.model.value);
|
||||
addDefaultProperties($scope.model.value.fieldsets);
|
||||
}
|
||||
|
||||
function addDefaultProperties(fieldsets)
|
||||
{
|
||||
_.each(fieldsets, function (fieldset)
|
||||
{
|
||||
fieldset.remove = false;
|
||||
fieldset.collapse = false;
|
||||
fieldset.isValid = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//helper to get the correct fieldset from config
|
||||
@@ -130,130 +266,150 @@
|
||||
});
|
||||
return (typeof property !== 'undefined') ? property.value : '';
|
||||
};
|
||||
|
||||
|
||||
$scope.isCollapsed = function(fieldset)
|
||||
{
|
||||
if(typeof fieldset.collapse === "undefined")
|
||||
{
|
||||
fieldset.collapse = true;
|
||||
}
|
||||
return fieldset.collapse;
|
||||
}
|
||||
|
||||
//helper for expanding/collapsing fieldsets
|
||||
$scope.focusFieldset = function(fieldset){
|
||||
|
||||
fixDisableSelection();
|
||||
|
||||
if (!$scope.model.config.enableCollapsing) {
|
||||
return;
|
||||
}
|
||||
|
||||
var iniState;
|
||||
|
||||
|
||||
if(fieldset)
|
||||
{
|
||||
iniState = fieldset.collapse;
|
||||
}
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function(fieldset){
|
||||
if($scope.archetypeRenderModel.fieldsets.length == 1 && fieldset.remove == false)
|
||||
{
|
||||
fieldset.collapse = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_.each($scope.model.value.fieldsets, function(fieldset){
|
||||
fieldset.collapse = true;
|
||||
});
|
||||
|
||||
if(iniState)
|
||||
|
||||
if(!fieldset && $scope.model.value.fieldsets.length == 1)
|
||||
{
|
||||
$scope.model.value.fieldsets[0].collapse = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if(iniState && fieldset)
|
||||
{
|
||||
fieldset.collapse = !iniState;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ini the fieldset expand/collapse
|
||||
$scope.focusFieldset();
|
||||
|
||||
//developerMode helpers
|
||||
$scope.archetypeRenderModel.toString = stringify;
|
||||
$scope.model.value.toString = stringify;
|
||||
|
||||
// issue 114: register handler for file selection
|
||||
$scope.model.value.setFiles = setFiles;
|
||||
|
||||
//encapsulate stringify (should be built into browsers, not sure of IE support)
|
||||
function stringify() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
// issue 114: handler for file selection
|
||||
function setFiles(files) {
|
||||
// get all currently selected files from file manager
|
||||
var currentFiles = fileManager.getFiles();
|
||||
|
||||
// get the files already selected for this archetype (by alias)
|
||||
var archetypeFiles = [];
|
||||
_.each(currentFiles, function (item) {
|
||||
if (item.alias === $scope.model.alias) {
|
||||
archetypeFiles.push(item.file);
|
||||
}
|
||||
});
|
||||
|
||||
// add the newly selected files
|
||||
_.each(files, function (file) {
|
||||
archetypeFiles.push(file);
|
||||
});
|
||||
|
||||
// update the selected files for this archetype (by alias)
|
||||
fileManager.setFiles($scope.model.alias, archetypeFiles);
|
||||
}
|
||||
|
||||
//watch for changes
|
||||
$scope.$watch('archetypeRenderModel', function (v) {
|
||||
$scope.$watch('model.value', function (v) {
|
||||
if ($scope.model.config.developerMode) {
|
||||
console.log(v);
|
||||
if (typeof v === 'string') {
|
||||
$scope.archetypeRenderModel = JSON.parse(v);
|
||||
$scope.archetypeRenderModel.toString = stringify;
|
||||
$scope.model.value = JSON.parse(v);
|
||||
$scope.model.value.toString = stringify;
|
||||
}
|
||||
}
|
||||
|
||||
// issue 114: re-register handler for files selection and reset the currently selected files on the file manager
|
||||
$scope.model.value.setFiles = setFiles;
|
||||
fileManager.setFiles($scope.model.alias, []);
|
||||
|
||||
// reset submit watcher counter on save
|
||||
$scope.activeSubmitWatcher = 0;
|
||||
});
|
||||
|
||||
//helper to count what is visible
|
||||
function countVisible()
|
||||
{
|
||||
var count = 0;
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function(fieldset){
|
||||
if (fieldset.remove == false) {
|
||||
count++;
|
||||
}
|
||||
});
|
||||
|
||||
return count;
|
||||
return $scope.model.value.fieldsets.length;
|
||||
}
|
||||
|
||||
//helper to sync the model to the renderModel
|
||||
function syncModelToRenderModel()
|
||||
{
|
||||
$scope.model.value = { fieldsets: [] };
|
||||
// helper to get initial model if none was provided
|
||||
function getDefaultModel(config) {
|
||||
if (config.startWithAddButton)
|
||||
return { fieldsets: [] };
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function(fieldset){
|
||||
var cleanedFieldset = cleanFieldset(fieldset);
|
||||
|
||||
if(cleanFieldset){
|
||||
$scope.model.value.fieldsets.push(cleanedFieldset);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//helper to remove properties only used during editing that we don't want in the saved data
|
||||
//also removes properties that are no longer in the config
|
||||
function cleanFieldset(fieldset)
|
||||
{
|
||||
if (typeof fieldset != 'function' && !fieldset.remove){
|
||||
|
||||
var fieldsetConfig = $scope.getConfigFieldsetByAlias(fieldset.alias);
|
||||
|
||||
//clone and clean
|
||||
var tempFieldset = JSON.parse(JSON.stringify(fieldset));
|
||||
delete tempFieldset.remove;
|
||||
delete tempFieldset.isValid;
|
||||
delete tempFieldset.collapse;
|
||||
|
||||
_.each(tempFieldset.properties, function(property, index){
|
||||
var propertyConfig = _.find(fieldsetConfig.properties, function(p){
|
||||
return property.alias == p.alias;
|
||||
});
|
||||
|
||||
//just prune the property
|
||||
if(propertyConfig){
|
||||
delete property.isValid;
|
||||
}
|
||||
else
|
||||
{
|
||||
//need to remove the whole property
|
||||
tempFieldset.properties.splice(index, 1);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return tempFieldset;
|
||||
}
|
||||
return { fieldsets: [getEmptyRenderFieldset(config.fieldsets[0])] };
|
||||
}
|
||||
|
||||
//helper to add an empty fieldset to the render model
|
||||
function getEmptyRenderFieldset (fieldsetModel)
|
||||
{
|
||||
return JSON.parse('{"alias": "' + fieldsetModel.alias + '", "remove": false, "isValid": true, "properties": []}');
|
||||
function getEmptyRenderFieldset (fieldsetModel) {
|
||||
return {alias: fieldsetModel.alias, collapse: false, isValid: true, properties: []};
|
||||
}
|
||||
|
||||
//helper to ensure no nulls make it into the model
|
||||
function removeNulls(model){
|
||||
if(model.fieldsets){
|
||||
_.each(model.fieldsets, function(fieldset, index){
|
||||
if(!fieldset){
|
||||
model.fieldsets.splice(index, 1);
|
||||
removeNulls(model);
|
||||
}
|
||||
});
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
// Hack for U4-4281 / #61
|
||||
function fixDisableSelection() {
|
||||
$timeout(function() {
|
||||
$('.archetypeEditor .controls')
|
||||
.bind('mousedown.ui-disableSelection selectstart.ui-disableSelection', function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
//helper to lookup validity when given a fieldsetIndex and property alias
|
||||
$scope.getPropertyValidity = function(fieldsetIndex, alias)
|
||||
{
|
||||
if($scope.archetypeRenderModel.fieldsets[fieldsetIndex])
|
||||
if($scope.model.value.fieldsets[fieldsetIndex])
|
||||
{
|
||||
var property = _.find($scope.archetypeRenderModel.fieldsets[fieldsetIndex].properties, function(property){
|
||||
var property = _.find($scope.model.value.fieldsets[fieldsetIndex].properties, function(property){
|
||||
return property.alias == alias;
|
||||
});
|
||||
}
|
||||
@@ -261,34 +417,58 @@
|
||||
return (typeof property == 'undefined') ? true : property.isValid;
|
||||
}
|
||||
|
||||
//sync things up on save
|
||||
$scope.$on("formSubmitting", function (ev, args) {
|
||||
|
||||
//test for form; may have to do this differently for nested archetypes
|
||||
if(!form)
|
||||
return;
|
||||
|
||||
if(form.$invalid)
|
||||
{
|
||||
notificationsService.warning("Cannot Save Document", "The document could not be saved because of missing required fields.")
|
||||
//helper to lookup validity when given a fieldset
|
||||
$scope.getFieldsetValidity = function (fieldset) {
|
||||
if (fieldset.isValid == false) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
syncModelToRenderModel();
|
||||
|
||||
// recursive validation of nested fieldsets
|
||||
var nestedFieldsetsValid = true;
|
||||
_.each(fieldset.properties, function (property) {
|
||||
if (property != null && property.value != null && property.propertyEditorAlias == "Imulus.Archetype") {
|
||||
_.each(property.value.fieldsets, function (inner) {
|
||||
if ($scope.getFieldsetValidity(inner) == false) {
|
||||
nestedFieldsetsValid = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return nestedFieldsetsValid;
|
||||
}
|
||||
|
||||
// helper to force the current form into the dirty state
|
||||
$scope.setDirty = function () {
|
||||
if($scope.form) {
|
||||
$scope.form.$setDirty();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//custom js
|
||||
if ($scope.model.config.customJsPath) {
|
||||
assetsService.loadJs($scope.model.config.customJsPath);
|
||||
}
|
||||
}
|
||||
|
||||
//archetype css
|
||||
assetsService.loadCss("/App_Plugins/Archetype/css/archetype.css");
|
||||
assetsService.loadCss("../App_Plugins/Archetype/css/archetype.css");
|
||||
|
||||
//custom css
|
||||
if($scope.model.config.customCssPath)
|
||||
{
|
||||
assetsService.loadCss($scope.model.config.customCssPath);
|
||||
}
|
||||
|
||||
// submit watcher handling:
|
||||
// because some property editors use the "formSubmitting" event to set/clean up their model.value,
|
||||
// we need to monitor the "formSubmitting" event from a custom property and broadcast our own event
|
||||
// to forcefully update the appropriate model.value's
|
||||
$scope.activeSubmitWatcher = 0;
|
||||
$scope.submitWatcherOnLoad = function () {
|
||||
$scope.activeSubmitWatcher++;
|
||||
return $scope.activeSubmitWatcher;
|
||||
}
|
||||
$scope.submitWatcherOnSubmit = function () {
|
||||
$scope.$broadcast("archetypeFormSubmitting");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ angular.module("umbraco.directives").directive('archetypeLocalize', function (ar
|
||||
|
||||
return {
|
||||
restrict: "E",
|
||||
rep1ace: true,
|
||||
replace: true,
|
||||
link: linker,
|
||||
scope: {
|
||||
key: '@'
|
||||
@@ -0,0 +1,29 @@
|
||||
angular.module("umbraco.directives")
|
||||
.directive('archetypeClickOutside', function ($timeout, $parse) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, element, attrs, ctrl) {
|
||||
var fn = $parse(attrs.archetypeClickOutside);
|
||||
|
||||
// add click event handler (delayed so we don't trigger the callback immediately if this directive itself was triggered by a mouse click)
|
||||
$timeout(function () {
|
||||
$(document).on("click", mouseClick);
|
||||
}, 500);
|
||||
|
||||
function mouseClick(event) {
|
||||
if($(event.target).closest(element).length > 0) {
|
||||
return;
|
||||
}
|
||||
var callback = function () {
|
||||
fn(scope, { $event: event });
|
||||
};
|
||||
scope.$apply(callback);
|
||||
}
|
||||
|
||||
// unbind event
|
||||
scope.$on('$destroy', function () {
|
||||
$(document).off("click", mouseClick);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
angular.module("umbraco.directives").directive('archetypeCustomView', function ($compile, $http) {
|
||||
var linker = function (scope, element, attrs) {
|
||||
|
||||
var view = "/App_plugins/Archetype/views/archetype.default.html";
|
||||
if(scope.model.config.customViewPath) {
|
||||
view = scope.model.config.customViewPath;
|
||||
}
|
||||
|
||||
$http.get(view, { cache: true }).then(function(data) {
|
||||
|
||||
element.html(data.data).show();
|
||||
|
||||
$compile(element.contents())(scope);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: "A",
|
||||
replace: true,
|
||||
link: linker
|
||||
}
|
||||
});
|
||||
@@ -1,120 +1,54 @@
|
||||
angular.module("umbraco.directives").directive('archetypeProperty', function ($compile, $http, archetypePropertyEditorResource, umbPropEditorHelper) {
|
||||
|
||||
function getFieldsetByAlias(fieldsets, alias)
|
||||
{
|
||||
return _.find(fieldsets, function(fieldset){
|
||||
return fieldset.alias == alias;
|
||||
});
|
||||
}
|
||||
|
||||
function getPropertyIndexByAlias(properties, alias){
|
||||
for (var i in properties)
|
||||
{
|
||||
if (properties[i].alias == alias) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getPropertyByAlias(fieldset, alias){
|
||||
return _.find(fieldset.properties, function(property){
|
||||
return property.alias == alias;
|
||||
});
|
||||
}
|
||||
|
||||
//helper that returns a JS ojbect from 'value' string or the original string
|
||||
function jsonOrString(value, developerMode, debugLabel){
|
||||
if(value && typeof value == 'string'){
|
||||
try{
|
||||
if(developerMode == '1'){
|
||||
console.log("Trying to parse " + debugLabel + ": " + value);
|
||||
}
|
||||
value = JSON.parse(value);
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
if(developerMode == '1'){
|
||||
console.log("Failed to parse " + debugLabel + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(value && developerMode == '1'){
|
||||
console.log(debugLabel + " post-parsing: ");
|
||||
console.log(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
angular.module("umbraco.directives").directive('archetypeProperty', function ($compile, $http, archetypePropertyEditorResource, umbPropEditorHelper, $timeout, $rootScope, $q, fileManager, editorState, archetypeService, archetypeCacheService) {
|
||||
|
||||
var linker = function (scope, element, attrs, ngModelCtrl) {
|
||||
var configFieldsetModel = getFieldsetByAlias(scope.archetypeConfig.fieldsets, scope.fieldset.alias);
|
||||
var configFieldsetModel = archetypeService.getFieldsetByAlias(scope.archetypeConfig.fieldsets, scope.fieldset.alias);
|
||||
var view = "";
|
||||
var label = configFieldsetModel.properties[scope.propertyConfigIndex].label;
|
||||
var dataTypeId = configFieldsetModel.properties[scope.propertyConfigIndex].dataTypeId;
|
||||
var dataTypeGuid = configFieldsetModel.properties[scope.propertyConfigIndex].dataTypeGuid;
|
||||
var config = null;
|
||||
var alias = configFieldsetModel.properties[scope.propertyConfigIndex].alias;
|
||||
var defaultValue = configFieldsetModel.properties[scope.propertyConfigIndex].value;
|
||||
|
||||
var propertyAliasParts = [];
|
||||
var propertyAlias = archetypeService.getUniquePropertyAlias(scope, propertyAliasParts);
|
||||
|
||||
//try to convert the defaultValue to a JS object
|
||||
defaultValue = jsonOrString(defaultValue, scope.archetypeConfig.developerMode, "defaultValue");
|
||||
defaultValue = archetypeService.jsonOrString(defaultValue, scope.archetypeConfig.developerMode, "defaultValue");
|
||||
|
||||
//grab info for the selected datatype, prepare for view
|
||||
archetypePropertyEditorResource.getDataType(dataTypeId).then(function (data) {
|
||||
archetypePropertyEditorResource.getDataType(dataTypeGuid, scope.archetypeConfig.enableDeepDatatypeRequests, editorState.current.contentTypeAlias, scope.propertyEditorAlias, alias, editorState.current.id).then(function (data) {
|
||||
//transform preValues array into object expected by propertyeditor views
|
||||
var configObj = {};
|
||||
|
||||
_.each(data.preValues, function(p) {
|
||||
configObj[p.key] = p.value;
|
||||
});
|
||||
|
||||
config = configObj;
|
||||
|
||||
//caching for use by label templates later
|
||||
archetypeCacheService.addDatatypeToCache(data, dataTypeGuid);
|
||||
|
||||
//determine the view to use [...] and load it
|
||||
archetypePropertyEditorResource.getPropertyEditorMapping(data.selectedEditor).then(function(propertyEditor) {
|
||||
var pathToView = umbPropEditorHelper.getViewPath(propertyEditor.view);
|
||||
|
||||
//load in the DefaultPreValues for the PropertyEditor, if any
|
||||
var defaultConfigObj = {};
|
||||
if (propertyEditor.hasOwnProperty('defaultPreValues')) {
|
||||
_.each(propertyEditor.defaultPreValues, function(p) {
|
||||
_.extend(defaultConfigObj, p)
|
||||
});
|
||||
if (propertyEditor.hasOwnProperty('defaultPreValues') && propertyEditor.defaultPreValues != null) {
|
||||
_.extend(defaultConfigObj, propertyEditor.defaultPreValues);
|
||||
}
|
||||
|
||||
var mergedConfig = _.extend(defaultConfigObj, config);
|
||||
|
||||
loadView(pathToView, mergedConfig, defaultValue, alias, scope, element, ngModelCtrl);
|
||||
loadView(pathToView, mergedConfig, defaultValue, alias, propertyAlias, scope, element, ngModelCtrl, configFieldsetModel);
|
||||
});
|
||||
});
|
||||
|
||||
ngModelCtrl.$parsers.push(validate);
|
||||
ngModelCtrl.$formatters.push(validate);
|
||||
|
||||
function validate(renderModel){
|
||||
var valid = true;
|
||||
|
||||
_.each(renderModel, function(fieldset){
|
||||
fieldset.isValid = true;
|
||||
_.each(fieldset.properties, function(property){
|
||||
property.isValid = true;
|
||||
|
||||
var propertyConfig = getPropertyByAlias(configFieldsetModel, property.alias);
|
||||
|
||||
if(propertyConfig && propertyConfig.required && property.value == ""){
|
||||
fieldset.isValid = false;
|
||||
property.isValid = false;
|
||||
valid = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ngModelCtrl.$setValidity('validation', valid);
|
||||
return renderModel;
|
||||
}
|
||||
}
|
||||
|
||||
function loadView(view, config, defaultValue, alias, scope, element, ngModelCtrl) {
|
||||
function loadView(view, config, defaultValue, alias, propertyAlias, scope, element, ngModelCtrl, configFieldsetModel) {
|
||||
if (view)
|
||||
{
|
||||
$http.get(view).success(function (data) {
|
||||
$http.get(view, { cache: true }).success(function (data) {
|
||||
if (data) {
|
||||
if (scope.archetypeConfig.developerMode == '1')
|
||||
{
|
||||
@@ -122,35 +56,119 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c
|
||||
}
|
||||
|
||||
//define the initial model and config
|
||||
scope.form = scope.umbracoForm;
|
||||
scope.model = {};
|
||||
scope.model.config = {};
|
||||
|
||||
//ini the property value after test to make sure a prop exists in the renderModel
|
||||
var renderModelPropertyIndex = getPropertyIndexByAlias(scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties, alias);
|
||||
scope.renderModelPropertyIndex = archetypeService.getPropertyIndexByAlias(archetypeService.getFieldset(scope).properties, alias);
|
||||
|
||||
if (!renderModelPropertyIndex)
|
||||
if (!scope.renderModelPropertyIndex)
|
||||
{
|
||||
scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties.push(JSON.parse('{"alias": "' + alias + '", "value": "' + defaultValue + '"}'));
|
||||
renderModelPropertyIndex = getPropertyIndexByAlias(scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties, alias);
|
||||
archetypeService.getFieldset(scope).properties.push(JSON.parse('{"alias": "' + alias + '", "value": "' + defaultValue + '"}'));
|
||||
scope.renderModelPropertyIndex = archetypeService.getPropertyIndexByAlias(archetypeService.getFieldset(scope).properties, alias);
|
||||
}
|
||||
scope.model.value = scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties[renderModelPropertyIndex].value;
|
||||
|
||||
scope.renderModel = {};
|
||||
scope.model.value = archetypeService.getFieldsetProperty(scope).value;
|
||||
|
||||
//init the property editor state
|
||||
archetypeService.getFieldsetProperty(scope).editorState = {};
|
||||
|
||||
//set the config from the prevalues
|
||||
scope.model.config = config;
|
||||
|
||||
/*
|
||||
Property Specific Hacks
|
||||
|
||||
Preference is to not do these, but unless we figure out core issues, this is quickest fix.
|
||||
*/
|
||||
|
||||
//MNTP *single* hack
|
||||
if(scope.model.config.maxNumber && scope.model.config.multiPicker)
|
||||
{
|
||||
if(scope.model.config.maxNumber == "1")
|
||||
{
|
||||
scope.model.config.multiPicker = "0";
|
||||
}
|
||||
}
|
||||
|
||||
//upload datatype hack
|
||||
if(view.indexOf('fileupload.html') != -1) {
|
||||
scope.propertyForm = scope.form;
|
||||
scope.model.validation = {};
|
||||
scope.model.validation.mandatory = 0;
|
||||
}
|
||||
|
||||
//some items need an alias
|
||||
scope.model.alias = "archetype-property-" + scope.fieldsetIndex + "-" + scope.propertyConfigIndex;
|
||||
scope.model.alias = "archetype-property-" + propertyAlias;
|
||||
//some items also need an id (file upload for example)
|
||||
scope.model.id = propertyAlias;
|
||||
|
||||
//watch for changes since there is no two-way binding with the local model.value
|
||||
scope.$watch('model.value', function (newValue, oldValue) {
|
||||
scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties[renderModelPropertyIndex].value = newValue;
|
||||
|
||||
archetypeService.getFieldsetProperty(scope).value = newValue;
|
||||
|
||||
//trigger the validation pipeline
|
||||
ngModelCtrl.$setViewValue(ngModelCtrl.$viewValue);
|
||||
// notify the linker that the property value changed
|
||||
archetypeService.propertyValueChanged(archetypeService.getFieldset(scope), archetypeService.getFieldsetProperty(scope));
|
||||
});
|
||||
|
||||
scope.$on('archetypeFormSubmitting', function (ev, args) {
|
||||
// validate all fieldset properties
|
||||
_.each(scope.fieldset.properties, function (property) {
|
||||
archetypeService.validateProperty(scope.fieldset, property, configFieldsetModel);
|
||||
});
|
||||
|
||||
var validationKey = "validation-f" + scope.fieldsetIndex;
|
||||
|
||||
ngModelCtrl.$setValidity(validationKey, scope.fieldset.isValid);
|
||||
|
||||
// did the value change (if it did, it most likely did so during the "formSubmitting" event)
|
||||
var property = archetypeService.getFieldsetProperty(scope);
|
||||
|
||||
var currentValue = property.value;
|
||||
|
||||
if (currentValue != scope.model.value) {
|
||||
archetypeService.getFieldsetProperty(scope).value = scope.model.value;
|
||||
|
||||
// notify the linker that the property value changed
|
||||
archetypeService.propertyValueChanged(archetypeService.getFieldset(scope), archetypeService.getFieldsetProperty(scope));
|
||||
}
|
||||
});
|
||||
|
||||
// issue 114: handle file selection on property editors
|
||||
scope.$on("filesSelected", function (event, args) {
|
||||
// populate the fileNames collection on the property editor state
|
||||
var property = archetypeService.getFieldsetProperty(scope);
|
||||
|
||||
property.editorState.fileNames = [];
|
||||
|
||||
_.each(args.files, function (item) {
|
||||
property.editorState.fileNames.push(item.name);
|
||||
});
|
||||
|
||||
// remove the files set for this property
|
||||
// NOTE: we can't use property.alias because the file manager registers the selected files on the assigned Archetype property alias (e.g. "archetype-property-archetype-property-archetype-property-content-0-2-0-1-0-0")
|
||||
fileManager.setFiles(scope.model.alias, []);
|
||||
|
||||
// now tell the containing Archetype to pick up the selected files
|
||||
scope.archetypeRenderModel.setFiles(args.files);
|
||||
});
|
||||
|
||||
scope.$on("archetypeRemoveFieldset", function (ev, args) {
|
||||
var validationKey = "validation-f" + args.index;
|
||||
ngModelCtrl.$setValidity(validationKey, true);
|
||||
});
|
||||
|
||||
element.html(data).show();
|
||||
$compile(element.contents())(scope);
|
||||
|
||||
$timeout(function() {
|
||||
var def = $q.defer();
|
||||
def.resolve(true);
|
||||
$rootScope.$apply();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -159,15 +177,18 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c
|
||||
return {
|
||||
require: "^ngModel",
|
||||
restrict: "E",
|
||||
rep1ace: true,
|
||||
replace: true,
|
||||
link: linker,
|
||||
scope: {
|
||||
property: '=',
|
||||
propertyConfigIndex: '=',
|
||||
propertyEditorAlias: '=',
|
||||
archetypeConfig: '=',
|
||||
fieldset: '=',
|
||||
fieldsetIndex: '=',
|
||||
archetypeRenderModel: '='
|
||||
archetypeRenderModel: '=',
|
||||
umbracoPropertyAlias: '=',
|
||||
umbracoForm: '='
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
angular.module("umbraco.directives").directive('archetypeSubmitWatcher', function ($rootScope) {
|
||||
var linker = function (scope, element, attrs, ngModelCtrl) {
|
||||
// call the load callback on scope to obtain the ID of this submit watcher
|
||||
var id = scope.loadCallback();
|
||||
scope.$on("formSubmitting", function (ev, args) {
|
||||
// on the "formSubmitting" event, call the submit callback on scope to notify the Archetype controller to do it's magic
|
||||
if (id == scope.activeSubmitWatcher) {
|
||||
scope.submitCallback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: "E",
|
||||
replace: true,
|
||||
link: linker,
|
||||
template: "",
|
||||
scope: {
|
||||
loadCallback: '=',
|
||||
submitCallback: '=',
|
||||
activeSubmitWatcher: '='
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,15 +0,0 @@
|
||||
angular.module('umbraco.filters').filter("archetypeLocale", function(){
|
||||
return function(key, locales){
|
||||
|
||||
if(!locales)
|
||||
return key;
|
||||
|
||||
if(!locales.defaultLocale)
|
||||
return key;
|
||||
|
||||
if(!locales.locale)
|
||||
return key;
|
||||
|
||||
return locales.locale[key] || locales.defaultLocale[key] || key;
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,70 @@
|
||||
var ArchetypeSampleLabelTemplates = (function() {
|
||||
|
||||
//public functions
|
||||
return {
|
||||
Entity: function (value, scope, args) {
|
||||
|
||||
if(!args.entityType) {
|
||||
args = {entityType: "Document", propertyName: "name"}
|
||||
}
|
||||
|
||||
if (value) {
|
||||
//if handed a csv list, take the first only
|
||||
var id = value.split(",")[0];
|
||||
|
||||
if (id) {
|
||||
var entity = scope.services.archetypeLabelService.getEntityById(scope, id, args.entityType);
|
||||
|
||||
if(entity) {
|
||||
return entity[args.propertyName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
UrlPicker: function(value, scope, args) {
|
||||
|
||||
if(!args.propertyName) {
|
||||
args = {propertyName: "name"}
|
||||
}
|
||||
|
||||
var entity;
|
||||
|
||||
switch (value.type) {
|
||||
case "content":
|
||||
if(value.typeData.contentId) {
|
||||
entity = scope.services.archetypeLabelService.getEntityById(scope, value.typeData.contentId, "Document");
|
||||
}
|
||||
break;
|
||||
|
||||
case "media":
|
||||
if(value.typeData.mediaId) {
|
||||
entity = scope.services.archetypeLabelService.getEntityById(scope, value.typeData.mediaId, "Media");
|
||||
}
|
||||
break;
|
||||
|
||||
case "url":
|
||||
return value.typeData.url;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(entity) {
|
||||
return entity[args.propertyName];
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
Rte: function (value, scope, args) {
|
||||
|
||||
if(!args.contentLength) {
|
||||
args = {contentLength: 50}
|
||||
}
|
||||
|
||||
return $(value).text().substring(0, args.contentLength);
|
||||
}
|
||||
}
|
||||
})();
|
||||
+44
-30
@@ -1,34 +1,48 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
"toggleAdvancedDescription": "Show advanced options.",
|
||||
"hidePropertyLabels": "Hide Property Labels?",
|
||||
"hidePropertyLabelsDescription": "Hides the property labels.",
|
||||
"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.",
|
||||
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
|
||||
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
|
||||
"customWrapperClass": "Custom Wrapper Class",
|
||||
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
|
||||
"cssFile": "CSS File",
|
||||
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
|
||||
"jsFile": "JS File",
|
||||
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
|
||||
"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.",
|
||||
"helpText": "Help Text",
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"addFieldset": "Tilføj et element",
|
||||
"hideFieldsetControls": "Skjul fieldsets?",
|
||||
"hideFieldsetControlsDescription": "Skjuler kontrollerne tilføj/fjern/sortér.",
|
||||
"toggleAdvanced": "Slå avancerede muligheder til/fra",
|
||||
"toggleAdvancedDescription": "Vis avancerede muligheder.",
|
||||
"hidePropertyLabels": "Skjul labels på egenskaber?",
|
||||
"hidePropertyLabelsDescription": "Skjuler labels på egenskaber.",
|
||||
"maxFieldsets": "Maks antal fieldsets",
|
||||
"maxFieldsetsDescription": "Hvor mange fieldsets er tilladt? Hvis der skrives '1' vil deaktivere kontrollerne. Som standard er det ubegrænset.",
|
||||
"enableMultipleFieldsets": "Aktivér flere Fieldsets?",
|
||||
"enableMultipleFieldsetsDescription": "Tillader flere typer af fieldsets i denne archetype.",
|
||||
"hideFieldsetToolbar": "Skjul Fieldset værktøjslinie?",
|
||||
"hideFieldsetToolbarDescription": "Skjuler den fieldset værktøjslinie der fremkommer når der findes mere end ét fieldset.",
|
||||
"customWrapperClass": "Egen Wrapper Class",
|
||||
"customWrapperClassDescription": "(Mulighed) Angiv din egen CSS class som tilføjes på wrapper div'en.",
|
||||
"cssFile": "CSS fil",
|
||||
"cssFileDescription": "(Mulighed) Tilføj en sti til din egen CSS fil der skal inkluderes på siden.",
|
||||
"jsFile": "JavaScript fil",
|
||||
"jsFileDescription": "(Mulighed) Tilføj en sti til din egen JavaScript fil der skal inkluderes på siden.",
|
||||
"toggleDeveloperMode": "Slå udvikler muligheder til/fra.",
|
||||
"toggleDeveloperModeDescription": "Aktivér på udvikler muligheder.",
|
||||
"configModel": "Konfigurationsmodel",
|
||||
"configModelDescription": "Vær forsigt med at redigere teksten for neden, den kontrollerer skemaet for denne archetype.",
|
||||
"helpText": "Hjælpe tekst",
|
||||
"defaultValue": "Standard værdi",
|
||||
"dataType": "Datatype",
|
||||
"required": "Påkrævet",
|
||||
"regEx": "RegEx validering",
|
||||
"properties": "Egenskaber",
|
||||
"labelTemplate": "Label skabelon",
|
||||
"select": "Vælg",
|
||||
"icon": "Ikon",
|
||||
"enableDisabling": "Aktivér fieldset-deaktivering?",
|
||||
"enableDisablingDescription": "Tillad brugere at aktivere/deaktivere individuelle fieldsets.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset-grupper",
|
||||
"fieldsetGroupsDescription":"Hvis du har mange fieldsets, skal du måske overveje at gruppere dem i fieldset-vælgeren. Når du først har defineret dine grupper her, vil en gruppe-vælger dukke op i fieldset-editoren, og du kan derefter vælge grupper for alle dine fieldsets.",
|
||||
"fieldsetGroupName":"Navn",
|
||||
"addFieldsetGroup":"Tilføj gruppe"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Tilføj et element",
|
||||
"hideFieldsetControls": "Skjul fieldsets?",
|
||||
"hideFieldsetControlsDescription": "Skjuler kontrollerne tilføj/fjern/sortér.",
|
||||
"toggleAdvanced": "Slå avancerede muligheder til/fra",
|
||||
"toggleAdvancedDescription": "Vis avancerede muligheder.",
|
||||
"hidePropertyLabels": "Skjul labels på egenskaber?",
|
||||
"hidePropertyLabelsDescription": "Skjuler labels på egenskaber.",
|
||||
"maxFieldsets": "Maks antal fieldsets",
|
||||
"maxFieldsetsDescription": "Hvor mange fieldsets er tilladt? Hvis der skrives '1' vil deaktivere kontrollerne. Som standard er det ubegrænset.",
|
||||
"enableMultipleFieldsets": "Aktivér flere Fieldsets?",
|
||||
"enableMultipleFieldsetsDescription": "Tillader flere typer af fieldsets i denne archetype.",
|
||||
"hideFieldsetToolbar": "Skjul Fieldset værktøjslinie?",
|
||||
"hideFieldsetToolbarDescription": "Skjuler den fieldset værktøjslinie der fremkommer når der findes mere end ét fieldset.",
|
||||
"customWrapperClass": "Egen Wrapper Class",
|
||||
"customWrapperClassDescription": "(Mulighed) Angiv din egen CSS class som tilføjes på wrapper div'en.",
|
||||
"cssFile": "CSS fil",
|
||||
"cssFileDescription": "(Mulighed) Tilføj en sti til din egen CSS fil der skal inkluderes på siden.",
|
||||
"jsFile": "JavaScript fil",
|
||||
"jsFileDescription": "(Mulighed) Tilføj en sti til din egen JavaScript fil der skal inkluderes på siden.",
|
||||
"toggleDeveloperMode": "Slå udvikler muligheder til/fra.",
|
||||
"toggleDeveloperModeDescription": "Aktivér på udvikler muligheder.",
|
||||
"configModel": "Konfigurationsmodel",
|
||||
"configModelDescription": "Vær forsigt med at redigere teksten for neden, den kontrollerer skemaet for denne archetype.",
|
||||
"helpText": "Hjælpe tekst",
|
||||
"defaultValue": "Standard værdi",
|
||||
"dataType": "Datatype",
|
||||
"required": "Påkrævet",
|
||||
"regEx": "RegEx validering",
|
||||
"properties": "Egenskaber",
|
||||
"labelTemplate": "Label skabelon",
|
||||
"select": "Vælg",
|
||||
"icon": "Ikon",
|
||||
"enableDisabling": "Aktivér fieldset-deaktivering?",
|
||||
"enableDisablingDescription": "Tillad brugere at aktivere/deaktivere individuelle fieldsets.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset-grupper",
|
||||
"fieldsetGroupsDescription":"Hvis du har mange fieldsets, skal du måske overveje at gruppere dem i fieldset-vælgeren. Når du først har defineret dine grupper her, vil en gruppe-vælger dukke op i fieldset-editoren, og du kan derefter vælge grupper for alle dine fieldsets.",
|
||||
"fieldsetGroupName":"Navn",
|
||||
"addFieldsetGroup":"Tilføj gruppe"
|
||||
}
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
"toggleAdvancedDescription": "Show advanced options.",
|
||||
"hidePropertyLabels": "Hide Property Labels?",
|
||||
"hidePropertyLabelsDescription": "Hides the property labels.",
|
||||
"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.",
|
||||
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
|
||||
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
|
||||
"customWrapperClass": "Custom Wrapper Class",
|
||||
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
|
||||
"cssFile": "CSS File",
|
||||
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
|
||||
"jsFile": "JS File",
|
||||
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
|
||||
"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.",
|
||||
"helpText": "Help Text",
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
"toggleAdvancedDescription": "Show advanced options.",
|
||||
"hidePropertyLabels": "Hide Property Labels?",
|
||||
"hidePropertyLabelsDescription": "Hides the property labels.",
|
||||
"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.",
|
||||
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
|
||||
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
|
||||
"customWrapperClass": "Custom Wrapper Class",
|
||||
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
|
||||
"cssFile": "CSS File",
|
||||
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
|
||||
"jsFile": "JS File",
|
||||
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
|
||||
"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.",
|
||||
"helpText": "Help Text",
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
"toggleAdvancedDescription": "Show advanced options.",
|
||||
"hidePropertyLabels": "Hide Property Labels?",
|
||||
"hidePropertyLabelsDescription": "Hides the property labels.",
|
||||
"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.",
|
||||
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
|
||||
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
|
||||
"customWrapperClass": "Custom Wrapper Class",
|
||||
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
|
||||
"cssFile": "CSS File",
|
||||
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
|
||||
"jsFile": "JS File",
|
||||
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
|
||||
"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.",
|
||||
"helpText": "Help Text",
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"label": "Label",
|
||||
"alias": "Alias",
|
||||
"addFieldset": "Add an item",
|
||||
"hideFieldsetControls": "Hide Fieldset Controls?",
|
||||
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
|
||||
"toggleAdvanced": "Toggle Advanced Options",
|
||||
@@ -27,8 +28,21 @@
|
||||
"defaultValue": "Default Value",
|
||||
"dataType": "DataType",
|
||||
"required": "Required",
|
||||
"regEx": "RegEx Validation",
|
||||
"properties": "Properties",
|
||||
"labelTemplate": "Label Template",
|
||||
"select": "Select",
|
||||
"icon": "Icon"
|
||||
"icon": "Icon",
|
||||
"enableDisabling": "Enable Fieldset Disabling?",
|
||||
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
|
||||
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
|
||||
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
|
||||
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
|
||||
"overrideDefaultConverter":"Override Default Property Value Converter?",
|
||||
"enableCloning":"Enable Cloning?",
|
||||
"enableCloningDescription":"Enable Fieldset Cloning.",
|
||||
"fieldsetGroups":"Fieldset groups",
|
||||
"fieldsetGroupsDescription":"If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.",
|
||||
"fieldsetGroupName":"Name",
|
||||
"addFieldsetGroup":"Add group"
|
||||
}
|
||||
|
||||
+415
-223
@@ -1,266 +1,468 @@
|
||||
.archetypeEditor {
|
||||
width: 98%;
|
||||
}
|
||||
{{VERSION}}
|
||||
|
||||
.archetypeEditor fieldset{
|
||||
border: 1px solid #dddddd;
|
||||
padding: 0;
|
||||
margin-bottom: 5px;
|
||||
background-color: #f1f1f1;
|
||||
clear: both;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetLabel {
|
||||
padding: 8px 25px 8px 3px;
|
||||
float: left;
|
||||
.archetypeEditor {
|
||||
width: 98%;
|
||||
|
||||
span {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
|
||||
label span {
|
||||
text-decoration: underline;
|
||||
.usky-grid {
|
||||
.cell-tools-menu {
|
||||
height: 385px;
|
||||
}
|
||||
&.withGroups {
|
||||
.cell-tools-menu {
|
||||
height: 415px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.caret {
|
||||
float:left;
|
||||
margin: 8px 1px 0 7px;
|
||||
&.caret-right {
|
||||
border-bottom: 4px solid transparent;
|
||||
border-top: 4px solid transparent;
|
||||
border-left: 4px solid #000000;
|
||||
content: "";
|
||||
margin-top: 6px;
|
||||
.open {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
top: auto;
|
||||
> li > a {
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
label{
|
||||
.controls-no-label {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
a+ul.dropdown-menu {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.icon {
|
||||
color: #ddd;
|
||||
padding: 2px;
|
||||
font-size: 16px;
|
||||
&:hover {
|
||||
color: #333;
|
||||
}
|
||||
&.icon-delete:hover {
|
||||
color: #b94a48;
|
||||
}
|
||||
}
|
||||
|
||||
.fieldsetIcon {
|
||||
float: left;
|
||||
width: 80%;
|
||||
margin-bottom: 0;
|
||||
margin-left: 5px;
|
||||
padding: 0 4px 0 0;
|
||||
color: #333;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border-bottom: 1px dashed #dddddd;
|
||||
padding: 0;
|
||||
span {
|
||||
display: inline-block;
|
||||
margin-bottom: 5px;
|
||||
clear: both;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
|
||||
.archetypeProperty {
|
||||
clear: both;
|
||||
overflow: visible;
|
||||
margin-top: 3px;
|
||||
|
||||
label {
|
||||
padding-left: 5px !important;
|
||||
|
||||
span {
|
||||
color: #343434;
|
||||
}
|
||||
&.dimmed span {
|
||||
color: #d9d9d9;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeFieldsetLabel {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 42px;
|
||||
|
||||
.label-sub {
|
||||
padding: 8px 0 8px 0;
|
||||
display: inline-block;
|
||||
min-height: 20px; /* this makes the header clickable when there's no icon and no text */
|
||||
&.module-label {
|
||||
width: 100%;
|
||||
}
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
|
||||
label {
|
||||
span {
|
||||
text-decoration: underline;
|
||||
}
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.caret-right {
|
||||
border-left-color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-weight: bold;
|
||||
|
||||
&.menu-label { font-weight: normal; }
|
||||
}
|
||||
|
||||
label:hover {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.caret {
|
||||
margin: 8px 1px 0 2px;
|
||||
position: absolute;
|
||||
|
||||
&.caret-right {
|
||||
border-bottom: 4px solid transparent;
|
||||
border-top: 4px solid transparent;
|
||||
border-left: 4px solid #ddd;
|
||||
content: "";
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 0;
|
||||
margin-left: 18px;
|
||||
white-space: nowrap;
|
||||
padding: 0;
|
||||
width: ~"calc(100% - 144px)";
|
||||
position: absolute;
|
||||
span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
&.dimmed {
|
||||
i, span {
|
||||
color: #d9d9d9 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditorControls {
|
||||
float: none;
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
}
|
||||
}
|
||||
|
||||
.archetypePropertyError {
|
||||
margin-bottom: 5px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
|
||||
label {
|
||||
|
||||
span {
|
||||
color: #b94a48;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeCollapser {
|
||||
clear: both;
|
||||
height: 100%;
|
||||
padding: 12px 0 0 20px;
|
||||
background-color: #fff;
|
||||
border-radius: 0 0 0 5px;
|
||||
|
||||
form {
|
||||
margin-left:20px;
|
||||
|
||||
.control-label {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeFieldsetHelpText {
|
||||
clear:both;
|
||||
margin-bottom: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeCollapser{
|
||||
clear: both;
|
||||
height: 100%;
|
||||
margin-top: 10px;
|
||||
padding-top: 12px;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid silver;
|
||||
border-radius: 0 0 0 5px;
|
||||
}
|
||||
.archetypeDeveloperModel
|
||||
{
|
||||
font-family: monospace;
|
||||
width: 98%;
|
||||
min-height: 100px;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.archetypeEditor .multiPropertyTextbox{
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.archetypeFieldsetError {
|
||||
border: 1px solid #b94a48;
|
||||
}
|
||||
|
||||
.archetypeEditor ul{
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.archetypeEditor, .archetypeConfig{
|
||||
.archetypeEditorControls{
|
||||
float: right;
|
||||
i {
|
||||
.archetypeAddButton {
|
||||
color: #ddd;
|
||||
.icon {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
&:hover {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
&.handle {
|
||||
cursor: move;
|
||||
|
||||
.archetypeAddButtonText {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.icon {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.multiPropertyTextbox {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.show-validation.ng-invalid .control-group.error .control-label {
|
||||
span {
|
||||
color: #343434;
|
||||
}
|
||||
}
|
||||
|
||||
.fieldsetPicker {
|
||||
.icon {
|
||||
color: #333;
|
||||
}
|
||||
ul.elements li {
|
||||
overflow: visible;
|
||||
vertical-align: top;
|
||||
height: 90px;
|
||||
}
|
||||
ul.groups {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
li {
|
||||
width: auto;
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
font-weight: bold;
|
||||
a {
|
||||
color: #d9d9d9;
|
||||
cursor: pointer;
|
||||
}
|
||||
&.active a, a:hover {
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditor form {
|
||||
margin-left:20px;
|
||||
|
||||
.control-label {
|
||||
padding-top: 0 !important;
|
||||
.archetypeEditor, .archetypeConfig {
|
||||
.archetypeEditorControls {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeProperty{
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeDeveloperModel
|
||||
{
|
||||
font-family: monospace;
|
||||
width: 98%;
|
||||
min-height: 100px;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetToolbar {
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
|
||||
li {
|
||||
float: left;
|
||||
padding: 2px 4px;
|
||||
margin-right: 10px;
|
||||
border: 1px solid #ddd;
|
||||
cursor: pointer;
|
||||
.archetypeEditorControls, .archetypeFieldsetGroups {
|
||||
i {
|
||||
cursor: pointer;
|
||||
&.handle {
|
||||
cursor: move;
|
||||
}
|
||||
&.dimmed {
|
||||
color: #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetHeaderText{
|
||||
clear:both;
|
||||
margin-bottom: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetFooterText{
|
||||
clear:both;
|
||||
margin-bottom: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetHelpText{
|
||||
clear:both;
|
||||
margin-bottom: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.archetypeConfig {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.archetypeConfig ul{
|
||||
list-style: none;
|
||||
}
|
||||
.archetype-headline {
|
||||
|
||||
.archetypeConfig li{
|
||||
background-color: #fff;
|
||||
}
|
||||
img {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.archetypeConfig label{
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetWrapper{
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetOption{
|
||||
margin-bottom: 15px;
|
||||
input[type=text]{
|
||||
max-width: 300px;
|
||||
small {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeDeveloperModel {
|
||||
font-family: monospace;
|
||||
width: 88%;
|
||||
margin: 5px 10px 10px;
|
||||
height: 130px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertiesWrapper {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
margin: -40px 10px 10px 140px;
|
||||
max-width: 475px;
|
||||
.manual-link {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
label {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.archetypeEditorControls {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.archetypeFieldsets {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.archetypeFieldsetWrapper {
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
max-width: 190px;
|
||||
width: auto;
|
||||
}
|
||||
.archetypeFieldsetTitle {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
select {
|
||||
max-width: 160px;
|
||||
.archetypeFieldsetOption {
|
||||
margin-bottom: 15px;
|
||||
input[type=text]{
|
||||
max-width: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
li:last-child {
|
||||
margin-bottom: 0;
|
||||
.archetypeDeveloperModel {
|
||||
font-family: monospace;
|
||||
width: 88%;
|
||||
margin: 5px 10px 10px;
|
||||
height: 130px;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsets {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetTitle {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeOptions label{
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeAdvancedOptions {
|
||||
margin-top: 15px;
|
||||
div {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
label {
|
||||
.archetypeOptions label{
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeMaxFieldsets{
|
||||
border: 1px solid #ddd;
|
||||
width: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
.archetypePropertiesWrapper {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
margin: -40px 10px 10px 140px;
|
||||
max-width: 475px;
|
||||
|
||||
.archetypeConfig .archetypePropertyTitle {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertyCollapser{
|
||||
margin-top: 10px;
|
||||
div {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetError{
|
||||
border: 1px solid #b94a48;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypePropertyError{
|
||||
margin-bottom: 5px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
|
||||
label {
|
||||
|
||||
span {
|
||||
color: #b94a48;
|
||||
font-weight: bold;
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #eee;
|
||||
|
||||
input[type=text] {
|
||||
max-width: 190px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
select {
|
||||
max-width: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeAdvancedOptions {
|
||||
label {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
input[type=checkbox] {
|
||||
margin-top: 0;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
small {
|
||||
color: #b3b3b3;
|
||||
}
|
||||
|
||||
.archetypeFieldsetGroups {
|
||||
padding: 0 10px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin-top: 15px;
|
||||
|
||||
li {
|
||||
|
||||
label {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
input {
|
||||
vertical-align: middle;
|
||||
width: 240px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeMaxFieldsets{
|
||||
border: 1px solid #ddd;
|
||||
width: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.archetypePropertyTitle {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.archetypePropertyCollapser {
|
||||
margin-top: 10px;
|
||||
div {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeFieldsetCollapser {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.fieldsetIcon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,16 +471,6 @@
|
||||
background-color: #d0e7f1 !important;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetCollapser {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.archetypeConfig .fieldsetIcon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.archetypeEditor .show-validation.ng-invalid .control-group.error .control-label {
|
||||
span {
|
||||
color: #343434;
|
||||
}
|
||||
.archetype-dialog {
|
||||
margin: 10px;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
propertyEditors: [
|
||||
{
|
||||
alias: "Imulus.Archetype",
|
||||
name: "Archetype",
|
||||
editor: {
|
||||
view: "~/App_Plugins/Archetype/views/archetype.html",
|
||||
valueType: "JSON"
|
||||
},
|
||||
prevalues: {
|
||||
fields: [
|
||||
{
|
||||
label: "Config",
|
||||
description: "(Required) Describe your Archetype.",
|
||||
key: "archetypeConfig",
|
||||
view: "/App_Plugins/Archetype/views/archetype.config.html",
|
||||
validation: [
|
||||
{
|
||||
type: "Required"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
javascript: [
|
||||
'~/App_Plugins/Archetype/js/archetype.js'
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
angular.module('umbraco.resources').factory('archetypePropertyEditorResource', function($q, $http, umbRequestHelper){
|
||||
return {
|
||||
getAllDataTypes: function() {
|
||||
// Hack - grab DataTypes from Tree API, as `dataTypeService.getAll()` isn't implemented yet
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("backoffice/ArchetypeApi/ArchetypeDataType/GetAll"), 'Failed to retrieve datatypes from tree service'
|
||||
);
|
||||
},
|
||||
getDataType: function (guid, useDeepDatatypeLookup, contentTypeAlias, propertyTypeAlias, archetypeAlias, nodeId) {
|
||||
if(useDeepDatatypeLookup) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid + "&contentTypeAlias=" + contentTypeAlias + "&propertyTypeAlias=" + propertyTypeAlias + "&archetypeAlias=" + archetypeAlias + "&nodeId=" + nodeId), 'Failed to retrieve datatype'
|
||||
);
|
||||
}
|
||||
else {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid , { cache: true }), 'Failed to retrieve datatype'
|
||||
);
|
||||
}
|
||||
},
|
||||
getPropertyEditorMapping: function(alias) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("backoffice/ArchetypeApi/ArchetypeDataType/GetAllPropertyEditors", { cache: true }), 'Failed to retrieve datatype mappings'
|
||||
).then(function (data) {
|
||||
var result = _.find(data, function(d) {
|
||||
return d.alias === alias;
|
||||
});
|
||||
|
||||
if (result != null)
|
||||
return result;
|
||||
|
||||
return "";
|
||||
});
|
||||
},
|
||||
getDllVersion: function() {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("backoffice/ArchetypeApi/ArchetypeDataType/GetDllVersion", { cache: true }), 'Failed to retrieve dll version'
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,33 +0,0 @@
|
||||
angular.module('umbraco.resources').factory('archetypePropertyEditorResource', function($q, $http, umbRequestHelper){
|
||||
return {
|
||||
getAllDataTypes: function() {
|
||||
// Hack - grab DataTypes from Tree API, as `dataTypeService.getAll()` isn't implemented yet
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("/umbraco/backoffice/UmbracoTrees/DataTypeTree/GetNodes?id=-1&application=developer&tree=&isDialog=false"), 'Failed to retrieve datatypes from tree service'
|
||||
).then(function (data) {
|
||||
return data.map(function(d) {
|
||||
return { "id": d.id, "name": d.name }
|
||||
});
|
||||
});
|
||||
},
|
||||
getDataType: function(id) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("/umbraco/backoffice/UmbracoApi/DataType/GetById?id=" + id), 'Failed to retrieve datatype'
|
||||
);
|
||||
},
|
||||
getPropertyEditorMapping: function(alias) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("/App_plugins/Archetype/js/propertyEditors.views.js"), 'Failed to retrieve datatype mappings'
|
||||
).then(function (data) {
|
||||
var result = _.find(data, function(d) {
|
||||
return d.propertyEditorAlias === alias;
|
||||
});
|
||||
|
||||
if (result != null)
|
||||
return result;
|
||||
|
||||
return "";
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,78 @@
|
||||
angular.module('umbraco.services').factory('archetypeCacheService', function (archetypePropertyEditorResource) {
|
||||
//private
|
||||
|
||||
var isEntityLookupLoading = false;
|
||||
var entityCache = [];
|
||||
|
||||
var isDatatypeLookupLoading = false;
|
||||
var datatypeCache = [];
|
||||
|
||||
return {
|
||||
getDataTypeFromCache: function(guid) {
|
||||
return _.find(datatypeCache, function (dt){
|
||||
return dt.dataTypeGuid == guid;
|
||||
});
|
||||
},
|
||||
|
||||
addDatatypeToCache: function(datatype, dataTypeGuid) {
|
||||
var cachedDatatype = this.getDataTypeFromCache(dataTypeGuid);
|
||||
|
||||
if(!cachedDatatype) {
|
||||
datatype.dataTypeGuid = dataTypeGuid;
|
||||
datatypeCache.push(datatype);
|
||||
}
|
||||
},
|
||||
|
||||
getDatatypeByGuid: function(guid) {
|
||||
var cachedDatatype = this.getDataTypeFromCache(guid);
|
||||
|
||||
if(cachedDatatype) {
|
||||
return cachedDatatype;
|
||||
}
|
||||
|
||||
//go get it from server, but this should already be pre-populated from the directive, but I suppose I'll leave this in in case used ad-hoc
|
||||
if (!isDatatypeLookupLoading) {
|
||||
isDatatypeLookupLoading = true;
|
||||
|
||||
archetypePropertyEditorResource.getDataType(guid).then(function(datatype) {
|
||||
|
||||
datatype.dataTypeGuid = guid;
|
||||
|
||||
datatypeCache.push(datatype);
|
||||
|
||||
isDatatypeLookupLoading = false;
|
||||
|
||||
return datatype;
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
getEntityById: function(scope, id, type) {
|
||||
var cachedEntity = _.find(entityCache, function (e){
|
||||
return e.id == id;
|
||||
});
|
||||
|
||||
if(cachedEntity) {
|
||||
return cachedEntity;
|
||||
}
|
||||
|
||||
//go get it from server
|
||||
if (!isEntityLookupLoading) {
|
||||
isEntityLookupLoading = true;
|
||||
|
||||
scope.resources.entityResource.getById(id, type).then(function(entity) {
|
||||
|
||||
entityCache.push(entity);
|
||||
|
||||
isEntityLookupLoading = false;
|
||||
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,265 @@
|
||||
angular.module('umbraco.services').factory('archetypeLabelService', function (archetypeCacheService) {
|
||||
//private
|
||||
|
||||
function executeFunctionByName(functionName, context) {
|
||||
var args = Array.prototype.slice.call(arguments).splice(2);
|
||||
|
||||
var namespaces = functionName.split(".");
|
||||
var func = namespaces.pop();
|
||||
|
||||
for(var i = 0; i < namespaces.length; i++) {
|
||||
context = context[namespaces[i]];
|
||||
}
|
||||
|
||||
if(context && context[func]) {
|
||||
return context[func].apply(this, args);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function getNativeLabel(datatype, value, scope) {
|
||||
|
||||
switch (datatype.selectedEditor) {
|
||||
case "Imulus.UrlPicker":
|
||||
return imulusUrlPicker(value, scope, {});
|
||||
case "Umbraco.TinyMCEv3":
|
||||
return coreTinyMce(value, scope, {});
|
||||
case "Umbraco.MultiNodeTreePicker":
|
||||
return coreMntp(value, scope, datatype);
|
||||
case "Umbraco.MediaPicker":
|
||||
return coreMediaPicker(value, scope, datatype);
|
||||
case "Umbraco.DropDown":
|
||||
return coreDropdown(value, scope, datatype);
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function coreDropdown(value, scope, args) {
|
||||
|
||||
if(!value)
|
||||
return "";
|
||||
|
||||
var prevalue = args.preValues[0].value[value];
|
||||
|
||||
if(prevalue) {
|
||||
return prevalue.value;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function coreMntp(value, scope, args) {
|
||||
var ids = value.split(',');
|
||||
var type = "Document";
|
||||
|
||||
switch(args.preValues[0].value.type) {
|
||||
case 'content':
|
||||
type = 'Document';
|
||||
break;
|
||||
case 'media':
|
||||
type = 'media';
|
||||
break;
|
||||
case 'member':
|
||||
type = 'member';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
var entityArray = [];
|
||||
|
||||
_.each(ids, function(id){
|
||||
if(id) {
|
||||
|
||||
var entity = archetypeCacheService.getEntityById(scope, id, type);
|
||||
|
||||
if(entity) {
|
||||
entityArray.push(entity.name);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return entityArray.join(', ');
|
||||
}
|
||||
|
||||
function coreMediaPicker(value, scope, args) {
|
||||
if(value) {
|
||||
var entity = archetypeCacheService.getEntityById(scope, value, "media");
|
||||
|
||||
if(entity) {
|
||||
return entity.name;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function imulusUrlPicker(value, scope, args) {
|
||||
|
||||
if(!args.propertyName) {
|
||||
args = {propertyName: "name"}
|
||||
}
|
||||
|
||||
var entity;
|
||||
|
||||
switch (value.type) {
|
||||
case "content":
|
||||
if(value.typeData.contentId) {
|
||||
entity = archetypeCacheService.getEntityById(scope, value.typeData.contentId, "Document");
|
||||
}
|
||||
break;
|
||||
|
||||
case "media":
|
||||
if(value.typeData.mediaId) {
|
||||
entity = archetypeCacheService.getEntityById(scope, value.typeData.mediaId, "Media");
|
||||
}
|
||||
break;
|
||||
|
||||
case "url":
|
||||
return value.typeData.url;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(entity) {
|
||||
return entity[args.propertyName];
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function coreTinyMce(value, scope, args) {
|
||||
|
||||
if(!args.contentLength) {
|
||||
args = {contentLength: 50}
|
||||
}
|
||||
|
||||
var suffix = "";
|
||||
var strippedText = $("<div/>").html(value).text();
|
||||
|
||||
if(strippedText.length > args.contentLength) {
|
||||
suffix = "…";
|
||||
}
|
||||
|
||||
return strippedText.substring(0, args.contentLength) + suffix;
|
||||
}
|
||||
|
||||
return {
|
||||
getFieldsetTitle: function(scope, fieldsetConfigModel, fieldsetIndex) {
|
||||
|
||||
//console.log(scope.model.config);
|
||||
|
||||
if(!fieldsetConfigModel)
|
||||
return "";
|
||||
|
||||
var fieldset = scope.model.value.fieldsets[fieldsetIndex];
|
||||
var fieldsetConfig = scope.getConfigFieldsetByAlias(fieldset.alias);
|
||||
var template = fieldsetConfigModel.labelTemplate;
|
||||
|
||||
if (template.length < 1)
|
||||
return fieldsetConfig.label;
|
||||
|
||||
var rgx = /({{(.*?)}})*/g;
|
||||
var results;
|
||||
var parsedTemplate = template;
|
||||
|
||||
var rawMatches = template.match(rgx);
|
||||
|
||||
var matches = [];
|
||||
|
||||
_.each(rawMatches, function(match){
|
||||
if(match) {
|
||||
matches.push(match);
|
||||
}
|
||||
});
|
||||
|
||||
_.each(matches, function (match) {
|
||||
|
||||
// split the template in case it consists of multiple property aliases and/or functions
|
||||
var templates = match.replace("{{", '').replace("}}", '').split("|");
|
||||
var templateLabelValue = "";
|
||||
|
||||
for(var i = 0; i < templates.length; i++) {
|
||||
// stop looking for a template label value if a previous template part already yielded a value
|
||||
if(templateLabelValue != "") {
|
||||
break;
|
||||
}
|
||||
|
||||
var template = templates[i];
|
||||
|
||||
//test for function
|
||||
var beginParamsIndexOf = template.indexOf("(");
|
||||
var endParamsIndexOf = template.indexOf(")");
|
||||
|
||||
//if passed a function
|
||||
if(beginParamsIndexOf != -1 && endParamsIndexOf != -1)
|
||||
{
|
||||
var functionName = template.substring(0, beginParamsIndexOf);
|
||||
var propertyAlias = template.substring(beginParamsIndexOf + 1, endParamsIndexOf).split(',')[0];
|
||||
|
||||
var args = {};
|
||||
|
||||
var beginArgsIndexOf = template.indexOf(',');
|
||||
|
||||
if(beginArgsIndexOf != -1) {
|
||||
|
||||
var argsString = template.substring(beginArgsIndexOf + 1, endParamsIndexOf).trim();
|
||||
|
||||
var normalizedJsonString = argsString.replace(/(\w+)\s*:/g, '"$1":');
|
||||
|
||||
args = JSON.parse(normalizedJsonString);
|
||||
}
|
||||
|
||||
templateLabelValue = executeFunctionByName(functionName, window, scope.getPropertyValueByAlias(fieldset, propertyAlias), scope, args);
|
||||
}
|
||||
//normal {{foo}} syntax
|
||||
else {
|
||||
propertyAlias = template;
|
||||
var rawValue = scope.getPropertyValueByAlias(fieldset, propertyAlias);
|
||||
|
||||
templateLabelValue = rawValue;
|
||||
|
||||
//determine the type of editor
|
||||
var propertyConfig = _.find(fieldsetConfigModel.properties, function(property){
|
||||
return property.alias == propertyAlias;
|
||||
});
|
||||
|
||||
if(propertyConfig) {
|
||||
var datatype = archetypeCacheService.getDatatypeByGuid(propertyConfig.dataTypeGuid);
|
||||
|
||||
if(datatype) {
|
||||
|
||||
//try to get built-in label
|
||||
var label = getNativeLabel(datatype, templateLabelValue, scope);
|
||||
|
||||
if(label) {
|
||||
templateLabelValue = label;
|
||||
}
|
||||
else {
|
||||
templateLabelValue = templateLabelValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return templateLabelValue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!templateLabelValue) {
|
||||
templateLabelValue = "";
|
||||
}
|
||||
|
||||
parsedTemplate = parsedTemplate.replace(match, templateLabelValue);
|
||||
});
|
||||
|
||||
return parsedTemplate;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -24,7 +24,7 @@ angular.module('umbraco.services').factory('archetypeLocalizationService', funct
|
||||
initLocalizedResources:function () {
|
||||
var deferred = $q.defer();
|
||||
userService.getCurrentUser().then(function(user){
|
||||
$http.get("/App_plugins/Archetype/langs/" + user.locale + ".js")
|
||||
$http.get("../App_plugins/Archetype/langs/" + user.locale + ".js", { cache: true })
|
||||
.then(function(response){
|
||||
service.resourceFileLoaded = true;
|
||||
service.dictionary = response.data;
|
||||
@@ -0,0 +1,104 @@
|
||||
angular.module('umbraco.services').factory('archetypeService', function () {
|
||||
//public
|
||||
return {
|
||||
//helper that returns a JS ojbect from 'value' string or the original string
|
||||
jsonOrString: function (value, developerMode, debugLabel){
|
||||
if(value && typeof value == 'string'){
|
||||
try{
|
||||
if(developerMode == '1'){
|
||||
console.log("Trying to parse " + debugLabel + ": " + value);
|
||||
}
|
||||
value = JSON.parse(value);
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
if(developerMode == '1'){
|
||||
console.log("Failed to parse " + debugLabel + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(value && developerMode == '1'){
|
||||
console.log(debugLabel + " post-parsing: ");
|
||||
console.log(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
getFieldsetByAlias: function (fieldsets, alias)
|
||||
{
|
||||
return _.find(fieldsets, function(fieldset){
|
||||
return fieldset.alias == alias;
|
||||
});
|
||||
},
|
||||
getPropertyIndexByAlias: function(properties, alias){
|
||||
for (var i in properties)
|
||||
{
|
||||
if (properties[i].alias == alias) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
},
|
||||
getPropertyByAlias: function (fieldset, alias){
|
||||
return _.find(fieldset.properties, function(property){
|
||||
return property.alias == alias;
|
||||
});
|
||||
},
|
||||
getUniquePropertyAlias: function (currentScope, propertyAliasParts) {
|
||||
if (currentScope.hasOwnProperty('fieldsetIndex') && currentScope.hasOwnProperty('property') && currentScope.hasOwnProperty('propertyConfigIndex'))
|
||||
{
|
||||
var currentPropertyAlias = "f" + currentScope.fieldsetIndex + "-" + currentScope.property.alias + "-p" + currentScope.propertyConfigIndex;
|
||||
propertyAliasParts.push(currentPropertyAlias);
|
||||
}
|
||||
else if (currentScope.hasOwnProperty('isPreValue')) // Crappy way to identify this is the umbraco property scope
|
||||
{
|
||||
var umbracoPropertyAlias = currentScope.$parent.$parent.property.alias; // Crappy way to get the umbraco host alias once we identify its scope
|
||||
propertyAliasParts.push(umbracoPropertyAlias);
|
||||
}
|
||||
|
||||
if (currentScope.$parent)
|
||||
this.getUniquePropertyAlias(currentScope.$parent, propertyAliasParts);
|
||||
|
||||
return _.unique(propertyAliasParts).reverse().join("-");
|
||||
},
|
||||
getFieldset: function(scope) {
|
||||
return scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex];
|
||||
},
|
||||
getFieldsetProperty: function (scope) {
|
||||
return this.getFieldset(scope).properties[scope.renderModelPropertyIndex];
|
||||
},
|
||||
setFieldsetValidity: function (fieldset) {
|
||||
// mark the entire fieldset as invalid if there are any invalid properties in the fieldset, otherwise mark it as valid
|
||||
fieldset.isValid =
|
||||
_.find(fieldset.properties, function (property) {
|
||||
return property.isValid == false
|
||||
}) == null;
|
||||
},
|
||||
validateProperty: function (fieldset, property, configFieldsetModel) {
|
||||
var propertyConfig = this.getPropertyByAlias(configFieldsetModel, property.alias);
|
||||
|
||||
if (propertyConfig) {
|
||||
// use property.value !== property.value to check for NaN values on numeric inputs
|
||||
if (propertyConfig.required && (property.value == null || property.value === "" || property.value !== property.value)) {
|
||||
property.isValid = false;
|
||||
}
|
||||
// issue 116: RegEx validate property value
|
||||
// Only validate the property value if anything has been entered - RegEx is considered a supplement to "required".
|
||||
if (property.isValid == true && propertyConfig.regEx && property.value) {
|
||||
var regEx = new RegExp(propertyConfig.regEx);
|
||||
if (regEx.test(property.value) == false) {
|
||||
property.isValid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setFieldsetValidity(fieldset);
|
||||
},
|
||||
// called when the value of any property in a fieldset changes
|
||||
propertyValueChanged: function (fieldset, property) {
|
||||
// it's the Umbraco way to hide the invalid state when altering an invalid property, even if the new value isn't valid either
|
||||
property.isValid = true;
|
||||
this.setFieldsetValidity(fieldset);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
{{VERSION_HTML}}
|
||||
<div class="umb-panel archetype-dialog archetypeConfig" ng-controller="ArchetypeConfigOptionsController">
|
||||
<div class="umb-panel-body no-header with-footer umb-scrollable archetypeAdvancedOptions">
|
||||
<h3><archetype-localize key="developer_options">Developer Options</archetype-localize></h3>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsDeepDatatypeRequest"><input type="checkbox" id="archetypeAdvancedOptionsDeepDatatypeRequest" ng-model="model.enableDeepDatatypeRequests"/><archetype-localize key="deepDatatypeRequest">Enable Deep Datatype Requests?</archetype-localize><small><archetype-localize key="deepDatatypeRequestDescription">Allows for easier datatype interception at the cost of caching performance.</archetype-localize></small></label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsDeveloperMode"><input type="checkbox" id="archetypeAdvancedOptionsDeveloperMode" ng-model="model.developerMode"/><archetype-localize key="toggleDeveloperMode">Enable Developer Mode?</archetype-localize><small><archetype-localize key="toggleDeveloperModeDescription">Toggle Developer Mode</archetype-localize></small></label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeOverrideDefaultConverter"><input type="checkbox" id="archetypeOverrideDefaultConverter" ng-model="model.overrideDefaultPropertyValueConverter" /><archetype-localize key="overrideDefaultConverter">Override Default Property Value Converter?</archetype-localize><small><archetype-localize key="overrideDefaultConverterDescription">Check this if you wish to use your own custom property value converter.</archetype-localize></small></label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsConfigModel"><archetype-localize key="configModel">Config Model</archetype-localize><small><archetype-localize key="configModelDescription">Be careful editing the text below, it controls the schema for this archetype.</archetype-localize></small></label>
|
||||
<textarea class="archetypeDeveloperModel" id="archetypeAdvancedOptionsConfigModel" ng-model="model"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<a href="" ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_cancel" class="ng-isolate-scope ng-scope">Cancel</localize>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-primary" ng-click="apply()">
|
||||
<archetype-localize key="button_apply">Apply</archetype-localize>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,66 @@
|
||||
{{VERSION_HTML}}
|
||||
<div class="umb-panel archetype-dialog archetypeConfig" ng-controller="ArchetypeConfigOptionsController">
|
||||
<div class="umb-panel-body no-header with-footer umb-scrollable archetypeAdvancedOptions">
|
||||
<h3><archetype-localize key="global_fieldset_options">Global Fieldset Options</archetype-localize></h3>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsStartWithAddButton"><input type="checkbox" id="archetypeAdvancedOptionsStartWithAddButton" ng-model="model.startWithAddButton"/><archetype-localize key="startWithAddButton">Start With Add Button?</archetype-localize><small><archetype-localize key="startWithAddButtonDescription">Empty property shows an add button instead of providing a default fieldset.</archetype-localize></small></label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsHideLabels"><input type="checkbox" id="archetypeAdvancedOptionsHideLabels" ng-model="model.hidePropertyLabels"/><archetype-localize key="hidePropertyLabels">Hide Property Labels?</archetype-localize><small><archetype-localize key="hidePropertyLabelsDescription">Hides the property labels.</archetype-localize></small></label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCollapsing"><input type="checkbox" id="archetypeAdvancedOptionsCollapsing" ng-model="model.enableCollapsing"/><archetype-localize key="enableCollapsing">Enable Collapsing?</archetype-localize><small><archetype-localize key="enableCollapsingDescription">Enable fieldset collapsing.</archetype-localize></small></label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsMaxFieldsets"><archetype-localize key="maxFieldsets">Max Fieldsets</archetype-localize><small><archetype-localize key="maxFieldsetsDescription">How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.</archetype-localize></small></label>
|
||||
<input type="number" id="archetypeAdvancedOptionsMaxFieldsets" class="archetypeMaxFieldsets" ng-model="model.maxFieldsets"/>
|
||||
</div>
|
||||
|
||||
<h4><archetype-localize key="fieldsetControls">Fieldset controls</archetype-localize></h4>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsHideControls"><input type="checkbox" id="archetypeAdvancedOptionsHideControls" ng-model="model.hideFieldsetControls"/><archetype-localize key="hideFieldsetControls">Hide Fieldset Controls?</archetype-localize><small><archetype-localize key="hideFieldsetControlsDescription">Hides the fieldset add/remove/sort controls.</archetype-localize></small></label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCloning"><input type="checkbox" id="archetypeAdvancedOptionsCloning" ng-model="model.enableCloning"/><archetype-localize key="enableCloning">Enable Cloning?</archetype-localize><small><archetype-localize key="enableCloningDescription">Enable fieldset cloning.</archetype-localize></small></label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsDisabling"><input type="checkbox" id="archetypeAdvancedOptionsDisabling" ng-model="model.enableDisabling" /><archetype-localize key="enableDisabling">Enable Fieldset Disabling?</archetype-localize><small><archetype-localize key="enableDisablingDescription">Allows fieldsets to be individually enabled/disabled.</archetype-localize></small></label>
|
||||
</div>
|
||||
|
||||
<h4><archetype-localize key="multipleFieldsets">Multiple fieldsets</archetype-localize></h4>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsMultipleFieldsets"><input type="checkbox" id="archetypeAdvancedOptionsMultipleFieldsets" ng-model="model.enableMultipleFieldsets"/><archetype-localize key="enableMultipleFieldsets">Enable Multiple Fieldsets?</archetype-localize><small><archetype-localize key="enableMultipleFieldsetsDescription">Allows multiple types of fieldsets within this archetype.</archetype-localize></small></label>
|
||||
</div>
|
||||
|
||||
<div ng-show="model.enableMultipleFieldsets">
|
||||
<label><archetype-localize key="fieldsetGroups">Fieldset groups</archetype-localize></label>
|
||||
<small><archetype-localize key="fieldsetGroupsDescription">If you have a lot of fieldsets to choose from, you may want to consider grouping them in the fieldset picker. Once you have created your groups here, a group picker will be displayed in the fieldset editor and you can assign your fieldsets to their respective groups.</archetype-localize></small>
|
||||
<div class="archetypeFieldsetGroups">
|
||||
<ul ui-sortable="sortableOptions" ng-model="model.fieldsetGroups">
|
||||
<li ng-repeat="fieldsetGroup in model.fieldsetGroups">
|
||||
<div>
|
||||
<input id="archetypeFieldsetGroupName_{{$index}}" type="text" ng-model="fieldsetGroup.name" />
|
||||
<i class="icon icon-delete" ng-click="removeFieldsetGroup($index)"></i>
|
||||
<i class="icon icon-navigation handle" ng-show="model.fieldsetGroups.length > 1"></i>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<label ng-click="addFieldsetGroup($index)"><i class="icon icon-add"></i> <archetype-localize key="addFieldsetGroup">Add fieldset group</archetype-localize></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<a href="" ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_cancel" class="ng-isolate-scope ng-scope">Cancel</localize>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-primary" ng-click="apply()">
|
||||
<archetype-localize key="button_apply">Apply</archetype-localize>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,8 @@
|
||||
{{VERSION_HTML}}
|
||||
<div class="archetypeConfig" ng-controller="Imulus.ArchetypeConfigController">
|
||||
<h2 class="archetype-headline"><img src="../App_Plugins/Archetype/assets/logo_50.png"/>Archetype<small>{{dllVersion}}</small><a href="https://twitter.com/archetypekit" target="_blank"><img src="../App_Plugins/Archetype/assets/twitter.png"/></a></h2>
|
||||
<p>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:</p>
|
||||
<p><a class="manual-link" href="https://github.com/kgiszewski/ArchetypeManual" target="_blank">Archetype Manual</a></p>
|
||||
<ul class="archetypeFieldsets" ui-sortable="sortableOptions" ng-model="archetypeConfigRenderModel.fieldsets">
|
||||
<li ng-repeat="fieldset in archetypeConfigRenderModel.fieldsets" ng-hide="fieldset.remove">
|
||||
<div class="archetypeFieldsetWrapper" >
|
||||
@@ -11,11 +15,15 @@
|
||||
<div class="archetypeFieldsetCollapser" ng-hide="fieldset.collapse && fieldset.label">
|
||||
<div class="archetypeFieldsetOption">
|
||||
<label for="archetypeFieldLabel_{{$index}}"><archetype-localize key="label">Label</archetype-localize></label>
|
||||
<input type="text" id="archetypeFieldLabel_{{$index}}" ng-model="fieldset.label" />
|
||||
<input type="text" id="archetypeFieldLabel_{{$index}}" ng-model="fieldset.label" on-keyup="autoPopulateAlias(this)" />
|
||||
</div>
|
||||
<div class="archetypeFieldsetOption">
|
||||
<label for="archetypeFieldAlias_{{$index}}"><archetype-localize key="alias">Alias</archetype-localize></label>
|
||||
<input type="text" id="archetypeFieldAlias_{{$index}}" ng-model="fieldset.alias" required/>
|
||||
<input type="text" id="archetypeFieldAlias_{{$index}}" ng-model="fieldset.alias" on-keyup="markAliasDirty(this)" required/>
|
||||
</div>
|
||||
<div class="archetypeFieldsetOption" ng-show="archetypeConfigRenderModel.fieldsetGroups.length">
|
||||
<label for="archetypeFieldsetGroup_{{$index}}"><archetype-localize key="fieldsetGroup">Group</archetype-localize></label>
|
||||
<select id="archetypeFieldsetGroup_{{$index}}" ng-model="fieldset.group" ng-options="fieldsetGroup as fieldsetGroup.name for fieldsetGroup in archetypeConfigRenderModel.fieldsetGroups"></select>
|
||||
</div>
|
||||
<div class="archetypeFieldsetOption">
|
||||
<label for="archetypeFieldLabelTemplate_{{$index}}"><archetype-localize key="labelTemplate">Label Template</archetype-localize></label>
|
||||
@@ -27,7 +35,7 @@
|
||||
</div>
|
||||
<div class="archetypeFieldsetOption">
|
||||
<label><archetype-localize key="properties">Properties</archetype-localize></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="archetypePropertiesWrapper">
|
||||
<ul ui-sortable="sortableOptions" ng-model="fieldset.properties">
|
||||
<li ng-repeat="property in fieldset.properties" ng-hide="property.remove">
|
||||
@@ -37,16 +45,16 @@
|
||||
<i class="icon icon-navigation handle" ng-show="canSortProperty(fieldset)"></i>
|
||||
</div>
|
||||
<div class="archetypePropertyTitle" ng-click="focusProperty(fieldset.properties, property)">
|
||||
{{property.label}} ({{property.alias}}) - <span>{{getDataTypeNameById(property.dataTypeId)}}</span>
|
||||
{{property.label}} ({{property.alias}}) - <span>{{getDataTypeNameByGuid(property.dataTypeGuid)}}</span>
|
||||
</div>
|
||||
<div class="archetypePropertyCollapser" ng-hide="property.collapse && property.label">
|
||||
<div>
|
||||
<label for="archetypePropertyLabel_{{$parent.$index}}_{{$index}}"><archetype-localize key="label">Label</archetype-localize></label>
|
||||
<input type="text" id="archetypePropertyLabel_{{$parent.$index}}_{{$index}}" ng-model="property.label" />
|
||||
<input type="text" id="archetypePropertyLabel_{{$parent.$index}}_{{$index}}" ng-model="property.label" on-keyup="autoPopulateAlias(this)"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypePropertyAlias_{{$parent.$index}}_{{$index}}"><archetype-localize key="alias">Alias</archetype-localize></label>
|
||||
<input type="text" id="archetypePropertyAlias_{{$parent.$index}}_{{$index}}" ng-model="property.alias" required/>
|
||||
<input type="text" id="archetypePropertyAlias_{{$parent.$index}}_{{$index}}" ng-model="property.alias" on-keyup="markAliasDirty(this)" required/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypePropertyHelpText_{{$parent.$index}}_{{$index}}"><archetype-localize key="helpText">Help Text</archetype-localize></label>
|
||||
@@ -54,7 +62,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypePropertyDataType_{{$parent.$index}}_{{$index}}"><archetype-localize key="dataType">Datatype</archetype-localize></label>
|
||||
<select id="archetypePropertyDataType_{{$parent.$index}}_{{$index}}" ng-model="property.dataTypeId" ng-options="datatype.id as datatype.name for datatype in availableDataTypes"></select>
|
||||
<select id="archetypePropertyDataType_{{$parent.$index}}_{{$index}}" ng-model="property.dataTypeGuid" ng-options="datatype.guid as datatype.name for datatype in availableDataTypes | orderBy:'name'"></select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypePropertyDefaultValue_{{$parent.$index}}_{{$index}}"><archetype-localize key="defaultValue">Default Value</archetype-localize></label>
|
||||
@@ -64,6 +72,10 @@
|
||||
<label for="archetypePropertyRequired_{{$parent.$index}}_{{$index}}"><archetype-localize key="required">Required</archetype-localize></label>
|
||||
<input type="checkbox" id="archetypePropertyRequired_{{$parent.$index}}_{{$index}}" ng-model="property.required" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypePropertyRegEx_{{$parent.$index}}_{{$index}}"><archetype-localize key="regEx">RegEx Validation</archetype-localize></label>
|
||||
<input type="text" id="archetypePropertyRegExValue_{{$parent.$index}}_{{$index}}" ng-model="property.regEx" />
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -75,51 +87,9 @@
|
||||
|
||||
<div class="archetypeOptions">
|
||||
<div>
|
||||
<label for="archetypeOptionsToggle"><archetype-localize key="toggleAdvanced">Toggle Advanced Options</archetype-localize><small><archetype-localize key="toggleAdvancedDescription">Show advanced options.</archetype-localize></small></label>
|
||||
<input type="checkbox" id="archetypeOptionsToggle" ng-model="archetypeConfigRenderModel.showAdvancedOptions"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="archetypeAdvancedOptions" ng-show="archetypeConfigRenderModel.showAdvancedOptions">
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsHideControls"><archetype-localize key="hideFieldsetControls">Hide Fieldset Controls?</archetype-localize><small><archetype-localize key="hideFieldsetControlsDescription">Hides the fieldset add/remove/sort controls.</archetype-localize></small></label>
|
||||
<input type="checkbox" id="archetypeAdvancedOptionsHideControls" ng-model="archetypeConfigRenderModel.hideFieldsetControls"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsHideLabels"><archetype-localize key="hidePropertyLabels">Hide Property Labels?</archetype-localize><small><archetype-localize key="hidePropertyLabelsDescription">Hides the property labels.</archetype-localize></small></label>
|
||||
<input type="checkbox" id="archetypeAdvancedOptionsHideLabels" ng-model="archetypeConfigRenderModel.hidePropertyLabels"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsMaxFieldsets"><archetype-localize key="maxFieldsets">Max Fieldsets</archetype-localize><small><archetype-localize key="maxFieldsetsDescription">How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.</archetype-localize></small></label>
|
||||
<input type="number" id="archetypeAdvancedOptionsMaxFieldsets" class="archetypeMaxFieldsets" ng-model="archetypeConfigRenderModel.maxFieldsets"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsMultipleFieldsets"><archetype-localize key="enableMultipleFieldsets">Enable Multiple Fieldsets?</archetype-localize><small><archetype-localize key="enableMultipleFieldsetsDescription">Allows multiple types of fieldsets within this archetype.</archetype-localize></small></label>
|
||||
<input type="checkbox" id="archetypeAdvancedOptionsMultipleFieldsets" ng-model="archetypeConfigRenderModel.enableMultipleFieldsets"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsFieldsetToolbar"><archetype-localize key="hideFieldsetToolbar">Hide Fieldset Toolbar?</archetype-localize><small><archetype-localize key="hideFieldsetToolbarDescription">Hides the fieldset toolbar that appears when more than one fieldset model appears.</archetype-localize></small></label>
|
||||
<input type="checkbox" id="archetypeAdvancedOptionsFieldsetToolbar" ng-model="archetypeConfigRenderModel.hideFieldsetToolbar"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCustomClass"><archetype-localize key="customWrapperClass">Custom Wrapper Class</archetype-localize><small><archetype-localize key="customWrapperClassDescription">(Optional) Enter a custom CSS class that will be applied to the wrapper div.</archetype-localize></small></label>
|
||||
<input type="text" id="archetypeAdvancedOptionsCustomClass" ng-model="archetypeConfigRenderModel.customCssClass"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCustomCss"><archetype-localize key="cssFile">CSS File</archetype-localize><small><archetype-localize key="cssFileDescription">(Optional) Enter a path for a custom CSS file to be included on the page.</archetype-localize></small></label>
|
||||
<input type="text" id="archetypeAdvancedOptionsCustomCss" ng-model="archetypeConfigRenderModel.customCssPath"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCustomJs"><archetype-localize key="jsFile">JS File</archetype-localize><small><archetype-localize key="jsFileDescription">(Optional) Enter a path for a custom JS file to be included on the page.</archetype-localize></small></label>
|
||||
<input type="text" id="archetypeAdvancedOptionsCustomJs" ng-model="archetypeConfigRenderModel.customJsPath"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsDeveloperMode"><archetype-localize key="toggleDeveloperMode">Toggle Developer Mode</archetype-localize><small><archetype-localize key="toggleDeveloperModeDescription">Toggle Developer Mode</archetype-localize></small></label>
|
||||
<input type="checkbox" id="archetypeAdvancedOptionsDeveloperMode" ng-model="archetypeConfigRenderModel.developerMode"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsConfigModel"><archetype-localize key="configModel">Config Model</archetype-localize><small><archetype-localize key="configModelDescription">Be careful editing the text below, it controls the schema for this archetype.</archetype-localize></small></label>
|
||||
<textarea class="archetypeDeveloperModel" id="archetypeAdvancedOptionsConfigModel" ng-model="archetypeConfigRenderModel"></textarea>
|
||||
<button class="btn btn-default" ng-click="showOptions($event, '../App_Plugins/archetype/views/archetype.config.fieldset.dialog.html')"><archetype-localize key="global_fieldset_options">Global Fieldset Options</archetype-localize></button>
|
||||
<button class="btn btn-default" ng-click="showOptions($event, '../App_Plugins/archetype/views/archetype.config.stylescript.dialog.html')"><archetype-localize key="custom_style_script_options">Custom Style/Script Options</archetype-localize></button>
|
||||
<button class="btn btn-default" ng-click="showOptions($event, '../App_Plugins/archetype/views/archetype.config.developer.dialog.html')"><archetype-localize key="developer_options">Developer Options</archetype-localize></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
{{VERSION_HTML}}
|
||||
<div class="umb-panel archetype-dialog archetypeConfig" ng-controller="ArchetypeConfigOptionsController">
|
||||
<div class="umb-panel-body no-header with-footer umb-scrollable archetypeAdvancedOptions">
|
||||
<h3><archetype-localize key="custom_style_script_options">Custom Style/Script Options</archetype-localize></h3>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCustomClass"><archetype-localize key="customWrapperClass">Custom Wrapper Class</archetype-localize><small><archetype-localize key="customWrapperClassDescription">(Optional) Enter a custom CSS class that will be applied to the wrapper div.</archetype-localize></small></label>
|
||||
<input type="text" id="archetypeAdvancedOptionsCustomClass" ng-model="model.customCssClass"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCustomCss"><archetype-localize key="cssFile">CSS File</archetype-localize><small><archetype-localize key="cssFileDescription">(Optional) Enter a path for a custom CSS file to be included on the page.</archetype-localize></small></label>
|
||||
<input type="text" id="archetypeAdvancedOptionsCustomCss" ng-model="model.customCssPath"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCustomJs"><archetype-localize key="jsFile">JS File</archetype-localize><small><archetype-localize key="jsFileDescription">(Optional) Enter a path for a custom JS file to be included on the page.</archetype-localize></small></label>
|
||||
<input type="text" id="archetypeAdvancedOptionsCustomJs" ng-model="model.customJsPath"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="archetypeAdvancedOptionsCustomView"><archetype-localize key="viewFile">View File</archetype-localize><small><archetype-localize key="viewFileDescription">(Optional) Enter a path for a custom view file to be used to render this Archetype.</archetype-localize></small></label>
|
||||
<input type="text" id="archetypeAdvancedOptionsCustomView" ng-model="model.customViewPath"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<a href="" ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_cancel" class="ng-isolate-scope ng-scope">Cancel</localize>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-primary" ng-click="apply()">
|
||||
<archetype-localize key="button_apply">Apply</archetype-localize>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,72 @@
|
||||
{{VERSION_HTML}}
|
||||
<div class="archetypeEditor ng-class:model.config.customCssClass">
|
||||
<textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="model.value"></textarea>
|
||||
<ul ui-sortable="sortableOptions" ng-model="model.value.fieldsets" ng-show="!showAddButton()">
|
||||
<li ng-repeat="fieldset in model.value.fieldsets">
|
||||
<fieldset ng-class="['archetype-fieldset-' + fieldset.alias, (getFieldsetValidity(fieldset) == false ? 'archetypeFieldsetError' : '')]" ng-init="fieldsetConfigModel = getConfigFieldsetByAlias(fieldset.alias)">
|
||||
<div class="archetypeFieldsetLabel" ng-class="{enableCollapsing: model.config.enableCollapsing}">
|
||||
<div ng-click="focusFieldset(fieldset)" class="label-sub module-label">
|
||||
<span class="caret" ng-hide="fieldset.collapse || !model.config.enableCollapsing"></span>
|
||||
<span class="caret caret-right" ng-show="fieldset.collapse && model.config.enableCollapsing"></span>
|
||||
<label ng-class="{dimmed: fieldset.disabled}">
|
||||
<i class="fieldsetIcon icon ng-class:fieldsetConfigModel.icon"></i>
|
||||
<span ng-bind="getFieldsetTitle(fieldsetConfigModel, $index)"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="archetypeEditorControls label-sub" ng-hide="model.config.hideFieldsetControls">
|
||||
<i class="icon icon-add" ng-show="canAdd()" ng-click="openFieldsetPicker($index, $event)"></i>
|
||||
<i class="icon icon-navigation handle" ng-show="canSort()"></i>
|
||||
<i class="icon icon-documents" ng-click="cloneRow($index)" ng-show="canClone()"></i>
|
||||
<i class="icon icon-power" ng-click="enableDisable(fieldset)" ng-show="canDisable()"></i>
|
||||
<i class="icon icon-delete" ng-click="removeRow($index)" ng-show="canRemove()"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="archetypeCollapser animate-hide" ng-hide="model.config.enableCollapsing && isCollapsed(fieldset)">
|
||||
<form class="form-inline">
|
||||
<div ng-class="[('archetype-property-' + property.alias), (getPropertyValidity($parent.$index, property.alias) === false ? 'archetypePropertyError' : '')]" class="archetypeProperty control-group" ng-repeat="property in fieldsetConfigModel.properties">
|
||||
<label ng-hide="model.config.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{model.alias}}-{{$parent.$index}}-{{$index}}">
|
||||
<span>{{property.label}}</span>
|
||||
<div class="archetypeFieldsetHelpText" ng-show="property.helpText">
|
||||
<small>{{property.helpText}}</small>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<div ng-class="[(model.config.hidePropertyLabels == '1' ? 'controls-no-label' : 'controls')]">
|
||||
<archetype-property class="archetypeEditor" property="property" property-editor-alias="model.alias" fieldset-index="$parent.$index" fieldset="fieldset" archetype-config="model.config" property-config-index="$index" archetype-render-model="model.value" umbraco-form="form"></archetype-property>
|
||||
<archetype-submit-watcher active-submit-watcher="activeSubmitWatcher" load-callback="submitWatcherOnLoad" submit-callback="submitWatcherOnSubmit"></archetype-submit-watcher>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
</li>
|
||||
</ul>
|
||||
<div ng-show="showAddButton()">
|
||||
<a class="archetypeAddButton" ng-click="openFieldsetPicker(0, $event)" prevent-default>
|
||||
<i class="icon icon-add"></i>
|
||||
<archetype-localize key="addFieldset">Add an item</archetype-localize>
|
||||
</a>
|
||||
</div>
|
||||
<div class="usky-grid fieldsetPicker" ng-class="{withGroups: overlayMenu.fieldsetGroups.length > 1}" ng-if="overlayMenu.show">
|
||||
<div class="cell-tools-menu" ng-style="overlayMenu.style" delayed-mouseleave="closeFieldsetPicker()" archetype-click-outside="closeFieldsetPicker()">
|
||||
<h5>
|
||||
<archetype-localize key="addFieldset">Add an item</archetype-localize>
|
||||
</h5>
|
||||
<ul class="groups" ng-show="overlayMenu.fieldsetGroups.length > 1">
|
||||
<li ng-repeat="fieldsetGroup in overlayMenu.fieldsetGroups" ng-class="{active: fieldsetGroup == overlayMenu.activeFieldsetGroup}">
|
||||
<a ng-click="overlayMenu.activeFieldsetGroup = fieldsetGroup">
|
||||
{{fieldsetGroup.name}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="elements">
|
||||
<li ng-repeat="fieldset in overlayMenu.activeFieldsetGroup.fieldsets">
|
||||
<a ng-click="pickFieldset(fieldset.alias, overlayMenu.index)" href>
|
||||
<i class="icon {{fieldset.icon}}"></i>
|
||||
{{fieldset.label}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,49 +1,2 @@
|
||||
<div class="archetypeEditor ng-class:model.config.customCssClass" ng-controller="Imulus.ArchetypeController">
|
||||
<textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="archetypeRenderModel"></textarea>
|
||||
<div class="archetypeFieldsetToolbar" ng-show="model.config.fieldsets.length > 1 && model.config.hideFieldsetToolbar != '1'">
|
||||
<ul>
|
||||
<li ng-repeat="fieldsetModel in model.config.fieldsets" ng-click="addRow(fieldsetModel.alias)">
|
||||
<i class="fieldsetIcon icon ng-class:fieldsetModel.icon"></i>
|
||||
<span>{{fieldsetModel.label}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<ul ui-sortable="sortableOptions" ng-model="archetypeRenderModel.fieldsets">
|
||||
<li ng-repeat="fieldset in archetypeRenderModel.fieldsets" ng-hide="fieldset.remove">
|
||||
<fieldset ng-class="{archetypeFieldsetError: !fieldset.isValid}" ng-init="fieldsetConfigModel = getConfigFieldsetByAlias(fieldset.alias)">
|
||||
<div class="archetypeFieldsetLabel">
|
||||
<span class="caret" ng-hide="fieldset.collapse"></span>
|
||||
<span class="caret caret-right" ng-show="fieldset.collapse"></span>
|
||||
|
||||
<label ng-click="focusFieldset(fieldset)">
|
||||
<i class="fieldsetIcon icon ng-class:fieldsetConfigModel.icon"></i>
|
||||
<span ng-bind="getFieldsetTitle(fieldsetConfigModel, $index)"></span>
|
||||
</label>
|
||||
|
||||
<div class="archetypeEditorControls" ng-hide="model.config.hideFieldsetControls || model.config.maxFieldsets == '1'">
|
||||
<i class="icon icon-add" ng-click="addRow(fieldset.alias, $index)" ng-show="canAdd()"></i>
|
||||
<i class="icon icon-delete" ng-click="removeRow($index)" ng-show="canRemove()"></i>
|
||||
<i class="icon icon-navigation handle" ng-show="canSort()"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="archetypeCollapser animate-hide" ng-hide="fieldset.collapse">
|
||||
<form class="form-inline">
|
||||
<div ng-class="{archetypePropertyError: getPropertyValidity($parent.$index, property.alias) === false}" class="archetypeProperty control-group" ng-repeat="property in fieldsetConfigModel.properties">
|
||||
<label ng-hide="archetypeConfig.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{$parent.$index}}-{{$index}}">
|
||||
<span>{{property.label}}</span>
|
||||
<div class="archetypeFieldsetHelpText" ng-show="property.helpText">
|
||||
<em>{{property.helpText}}</em>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<div class="controls">
|
||||
<archetype-property class="archetypeEditor ng-class:property.alias" property="property" fieldset-index="$parent.$index" fieldset="fieldset" archetype-config="model.config" property-config-index="$index" archetype-render-model="archetypeRenderModel"></archetype-property>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{VERSION_HTML}}
|
||||
<div archetype-custom-view ng-controller="Imulus.ArchetypeController"></div>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "Archetype",
|
||||
"version": "0.4.0-alpha",
|
||||
"version": "1.11",
|
||||
"url": "http://github.com/imulus/archetype/",
|
||||
"author": "Imulus",
|
||||
"author": "Imulus - Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Et. Al.",
|
||||
"authorUrl": "http://imulus.com/",
|
||||
"license": "MIT",
|
||||
"licenseUrl": "http://opensource.org/licenses/MIT"
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Archetype</id>
|
||||
<version><%= version %></version>
|
||||
<title><%= name %></title>
|
||||
<authors>imulus, kgiszewski, tomfulton</authors>
|
||||
<owners>imulus, kgiszewski, tomfulton</owners>
|
||||
<projectUrl>http://github.com/imulus/archetype</projectUrl>
|
||||
<description><![CDATA[Archetype for Umbraco]]></description>
|
||||
<tags>umbraco</tags>
|
||||
<iconUrl>http://github.com/imulus/archetype/raw/master/assets/logo.png</iconUrl>
|
||||
<licenseUrl><%= licenseUrl %></licenseUrl>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="7.1.6" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
</package>
|
||||
+9
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "archetype",
|
||||
"version": "0.0.0",
|
||||
"devDependencies": {
|
||||
"dependencies": {
|
||||
"grunt": "~0.4.2",
|
||||
"bower": "~1.2.8",
|
||||
"grunt-contrib-copy": "~0.5.0",
|
||||
@@ -18,12 +18,18 @@
|
||||
"rimraf": "~2.2.5",
|
||||
"grunt-nuget": "~0.1.1",
|
||||
"grunt-template": "~0.2.2",
|
||||
"grunt-touch": "~0.1.0",
|
||||
"fs-extra": "~0.8.1",
|
||||
"grunt-msbuild": "~0.1.9"
|
||||
"grunt-msbuild": "~0.1.9",
|
||||
"grunt-dotnet-assembly-info": "~1.0.9",
|
||||
"load-grunt-tasks": "~0.4.0",
|
||||
"grunt-umbraco-package": "0.0.6"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/imulus/Archetype.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt-msbuild": "^0.1.12",
|
||||
"grunt-string-replace": "^1.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Archetype</id>
|
||||
<version><%= version %></version>
|
||||
<title><%= name %></title>
|
||||
<authors>imulus, kgiszewski, tomfulton</authors>
|
||||
<owners>imulus, kgiszewski, tomfulton</owners>
|
||||
<projectUrl>http://github.com/imulus/archetype</projectUrl>
|
||||
<description><![CDATA[Archetype for Umbraco]]></description>
|
||||
<tags>umbraco</tags>
|
||||
<iconUrl>http://github.com/imulus/archetype/raw/master/assets/logo.png</iconUrl>
|
||||
<licenseUrl><%= licenseUrl %></licenseUrl>
|
||||
</metadata>
|
||||
<files>
|
||||
<% files.forEach(function(file) { %>
|
||||
<file src="<%- file.path %>" target="<%= file.target %>" />
|
||||
<% }); %>
|
||||
</files>
|
||||
</package>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user