Compare commits
1011 Commits
v0.1-alpha
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| a4c1a59e23 | |||
| e164be1823 | |||
| f32451fffa | |||
| a541dbd038 | |||
| 69e0bb70e5 | |||
| c22a2623c2 | |||
| c229cc9953 | |||
| 7d155ee176 | |||
| 93659e5a22 | |||
| 46bbf24edf | |||
| da1057c681 | |||
| 81881a5734 | |||
| 25678a812c | |||
| ec2edce74c | |||
| 4756551518 | |||
| e053b42950 | |||
| ff21951ea1 | |||
| 18935b4a69 | |||
| cd93e17494 | |||
| 3a2190b232 | |||
| 46b0396652 | |||
| 0c3fcce58b | |||
| cef7a36bd4 | |||
| 03d511ca80 | |||
| 123546b11c | |||
| 4aa6b83d82 | |||
| 6f3a414c4d | |||
| 4443d628dc | |||
| 0f9a44c539 | |||
| dd47218bd3 | |||
| 5e3e37af31 | |||
| dbf1bffe34 | |||
| cbf87264ac | |||
| 353c3da22a | |||
| 9d15e0c696 | |||
| 7dc7b8f938 | |||
| f8302b0926 | |||
| 1cb3f4e266 | |||
| d2b7a9a92b | |||
| 245f4ed972 | |||
| 19ef383a71 | |||
| af2287d2fc | |||
| e4c206211f | |||
| 57a199d235 | |||
| 2a98005ae7 | |||
| 69a7256538 | |||
| 38dc405183 | |||
| d6874e7cd8 | |||
| c1e732e3de | |||
| 02ffe4db4a | |||
| c79be2f6db | |||
| f0c15ade5d | |||
| 9f8acedf6f | |||
| aba3bdd2c4 | |||
| de491f9687 | |||
| 2becf8a1ba | |||
| 68a5a9893d | |||
| 3ed08c447c | |||
| 9a2e14d8f6 | |||
| d557ec1edb | |||
| 4fb7cdc5e5 | |||
| 5fa225b460 | |||
| b1f8c6a732 | |||
| 7d8a6e28fa | |||
| 6a9c56df58 | |||
| fa265d3019 | |||
| 078f4a506e | |||
| 42661c27f4 | |||
| b398e0e677 | |||
| a54170b915 | |||
| 757ba890f5 | |||
| a127dac03a | |||
| 62e481d49c | |||
| 77ec2d7a9c | |||
| 0d55f0ed86 | |||
| 6a7ac205bc | |||
| 1cb2139137 | |||
| b14645f13f | |||
| b8741726bc | |||
| d392c4f705 | |||
| 119b0c7680 | |||
| b9179f4140 | |||
| d46d64c52b | |||
| 45318cf061 | |||
| b9abf0d6a3 | |||
| e00229984c | |||
| 155f212062 | |||
| 86a8112fbd | |||
| 810fa95c65 | |||
| 9bcd9d67ae | |||
| bae1ee508b | |||
| 20b6a78af1 | |||
| 014b407abb | |||
| 5aa16a6636 | |||
| 7206bba46a | |||
| af9db94fb6 | |||
| d2014be81b | |||
| 01b8b3b508 | |||
| 734125fa25 | |||
| 76678f538d | |||
| 7fe23fdf4c | |||
| c956c12cdf | |||
| 8706feb882 | |||
| c8364986a2 | |||
| 4d24150bdc | |||
| a16c4b4da9 | |||
| 75a312c309 | |||
| aa6505d7f6 | |||
| 6ed7af28bc | |||
| 526f4c147a | |||
| bb0df72dc7 | |||
| 3cba5677bf | |||
| c4f88ab528 | |||
| 7bc9584940 | |||
| 17be4b4253 | |||
| 2db196af6a | |||
| b4b27cd1f8 | |||
| a2cc052944 | |||
| 4d8a4f0b12 | |||
| 743f37c45f | |||
| 1ba45969ee | |||
| 349d6f69b3 | |||
| 9431a70156 | |||
| ab780f72a4 | |||
| 7d01be305f | |||
| 694b932e37 | |||
| a4f6334761 | |||
| 9316e7c3f6 | |||
| 8bc6c17921 | |||
| 1161c7e6da | |||
| 93db3eb2ee | |||
| b7b166562f | |||
| e3c4c91de1 | |||
| f79849cf8a | |||
| f0b27e1507 | |||
| 42e92a4e74 | |||
| 2c363a5d37 | |||
| 738e9282b6 | |||
| 20fa1efc8e | |||
| 718f2deb47 | |||
| 1cea5d156a | |||
| 109d4c7708 | |||
| 8306be60de | |||
| 27d0cb742b | |||
| 62a250cd83 | |||
| 6f94d608db | |||
| 854e9873c8 | |||
| 2a6d5eaddf | |||
| 3d7ddb58c2 | |||
| 4c7496840d | |||
| d816103981 | |||
| b38ccc12f6 | |||
| e1deba5b95 | |||
| 5bce4e856a | |||
| 6f4cb1e609 | |||
| 033cbbc8f6 | |||
| 7ee3cfca5c | |||
| e9b478c186 | |||
| 21e784424f | |||
| 155355aa00 | |||
| abf6917b1c | |||
| 40ad701f7f | |||
| a8113f926c | |||
| 3c527396de | |||
| 59bf66dcd1 | |||
| c125042a86 | |||
| 85ea472129 | |||
| f541b50b82 | |||
| 5767ea97d1 | |||
| e1fa7a3271 | |||
| c2e97e28ce | |||
| eda9bab02f | |||
| ce3cecbec9 | |||
| ef5faae254 | |||
| 547473e92c | |||
| 9857059906 | |||
| 7f7b054c14 | |||
| a40d95250e | |||
| 1e6004d3fa | |||
| 0671403732 | |||
| 8e00914370 | |||
| 104c369bcc | |||
| 4c02cf2921 | |||
| 74470b8e8f | |||
| de92147ec0 | |||
| c2b7d2c89d | |||
| d0fe30f08b | |||
| d22ae1244e | |||
| fa48d73630 | |||
| fb305c9d0e | |||
| be332d310f | |||
| d97bbb59dc | |||
| 3702ec484b | |||
| d8d4ec1a73 | |||
| 32cb89bba1 | |||
| 863f041fc9 | |||
| 5a83719dfc | |||
| 1b1940fe6a | |||
| b71564bfb5 | |||
| ba8a6cf65c | |||
| 7dd07b9f9c | |||
| 29652bb880 | |||
| 62b7420eaa | |||
| 333f17976b | |||
| 45981b0431 | |||
| 531ff0aab4 | |||
| 394572a8fc | |||
| c7114b63f5 | |||
| 9704a8b591 | |||
| 0b6af3b4e1 | |||
| 4b874dc5b5 | |||
| a081d97546 | |||
| ebf3fd1135 | |||
| 85157612f4 | |||
| 6b79a508bb | |||
| f57205dab9 | |||
| b6ccab10b3 | |||
| e1f67a738b | |||
| 4410f1bb81 | |||
| 5c2a99987a | |||
| 715a2bf6d5 | |||
| d9ffb4b097 | |||
| c409922469 | |||
| 6b40d1e20b | |||
| 3e91b1c2c3 | |||
| 38eafc0063 | |||
| 89aeca9bf0 | |||
| 2b6d87d97c | |||
| 1ca113b455 | |||
| 8228b2dae5 | |||
| 22f24ec882 | |||
| e33eb863e6 | |||
| 6bcf291c99 | |||
| b0f614c891 | |||
| a424a7e4f3 | |||
| 75fa2bb1bb | |||
| 5585244d32 | |||
| 41fa8fa40d | |||
| 9336f4508a | |||
| f9e5012b4e | |||
| 61d215e16c | |||
| e1e34be10d | |||
| 796be76d94 | |||
| 8f7024c32a | |||
| dea307ff8e | |||
| d69a10de48 | |||
| b93df7a4c0 | |||
| 48dbdebec5 | |||
| 65837fa74c | |||
| 29a73336e3 | |||
| 0dfa8edc95 | |||
| 0584c4eda5 | |||
| 4eb901fbba | |||
| b7875dd850 | |||
| 19989e556e | |||
| 9250d66953 | |||
| fa0b1a4b3b | |||
| 73e875e67c | |||
| e061311689 | |||
| b36f83eaf6 | |||
| d63f7a6a34 | |||
| 68c2f55111 | |||
| f22d3cdef3 | |||
| 13b59d0d61 | |||
| 188c09d3c1 | |||
| 6d8770907c | |||
| efbed9606d | |||
| c862ecc36f | |||
| 523630416f | |||
| 990836bc37 | |||
| bb194fff76 | |||
| 16351df692 | |||
| 213d3940ca | |||
| 8dfe1f3ca4 | |||
| 3291998171 | |||
| e640a9b4f4 | |||
| 7df4d4cfcd | |||
| bb056a01dd | |||
| 608b12aa10 | |||
| 6494327c77 | |||
| 293aa7f6f3 | |||
| 7e76e98c0f | |||
| f4e449f030 | |||
| 1e97caa7e8 | |||
| b0dcefaf06 | |||
| 716972bc17 | |||
| 4d4eab39e8 | |||
| 6acaf65ec3 | |||
| a2b2567350 | |||
| f5f4e80800 | |||
| b42695bd0d | |||
| f405239115 | |||
| 4be6a13fc0 | |||
| 99638ed0b0 | |||
| 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 | |||
| 54766df143 | |||
| 0878fd5b71 | |||
| a4d4de6d09 | |||
| c49af9821c | |||
| 574e2018fd | |||
| 84639f82a4 | |||
| fe913fdba8 | |||
| c597c712f4 | |||
| 6297302d61 | |||
| fd2f6a9967 | |||
| 7e28dd87b5 | |||
| 7d0d32b218 | |||
| bf9e4d53df | |||
| 33f95253f9 | |||
| 79761667cf | |||
| 7e959e9b0f | |||
| 4848bdc5d6 | |||
| d645fc12de | |||
| d5edb70e5b | |||
| 19c19c10ca | |||
| 6f0b7a2303 | |||
| f842172be5 | |||
| 6dff2518ff | |||
| 6a2af3cc19 | |||
| 79005262a0 | |||
| 6c7ec07068 | |||
| f26174725e | |||
| 15e65f15af | |||
| 4f199170ec | |||
| ba45e670e3 | |||
| 3d01149fe0 | |||
| d616b88f3e | |||
| 03e7b2956a | |||
| b81775b7e1 | |||
| 96878411c0 | |||
| 2ad9127830 | |||
| c06534b069 | |||
| a8d028fcbf | |||
| 18b0b7ab71 | |||
| 2d2658d8f4 | |||
| 1c05d8e37b | |||
| 945b790121 | |||
| 34d2420c75 | |||
| 139c22c560 | |||
| b7ef53f27c | |||
| 56095ef8ec | |||
| 9262d68070 | |||
| 57af9c4130 | |||
| dc32b94c15 | |||
| 61b1053b6e | |||
| b684bad840 | |||
| fc47d7174f | |||
| 901bf4dcb0 | |||
| 17312e6382 | |||
| 92e2c070f8 | |||
| 4dc21b3e18 | |||
| b55a1a4324 | |||
| 062c8be5d2 | |||
| 16d1dfc586 | |||
| 5311cc9323 | |||
| 3921d1340c | |||
| 8b96ccf3bf | |||
| 50f4e43cf6 | |||
| 5ad2c91700 | |||
| 1518bfd453 | |||
| c789485cdd | |||
| 61e0ef90dd | |||
| 6dc745f31d | |||
| a1f7d94ece | |||
| 6d1e9f1b9a | |||
| 7fd049f5b7 | |||
| b749891832 | |||
| f7a9b519e6 | |||
| 9a7131d5fc | |||
| 785199d7cf | |||
| c374ae7f3e | |||
| c85fd354a6 | |||
| 926e12fa8f | |||
| 081fc1ad6d | |||
| 110f8fc1b2 | |||
| 8077742c13 | |||
| 01a45477b8 | |||
| 8eb005941f | |||
| 04cda8c646 | |||
| cf3b8ee30e | |||
| 424740cdec | |||
| 80bda94265 | |||
| d431f24d27 | |||
| 2deb639d28 | |||
| 4d753d057c | |||
| 57d4ac42b5 | |||
| 340ab297ee | |||
| 4d4d94d0eb | |||
| 72a53b2711 | |||
| 852510fd70 | |||
| bc7025ec69 | |||
| 548113a34a | |||
| eb36f30c11 | |||
| daff37074e | |||
| f27949cfbb | |||
| 121cac5798 | |||
| 1fb5ab489e | |||
| 3cff83af72 | |||
| b78b4627db | |||
| 0a5b3f9c37 | |||
| b94a6048e7 | |||
| 12428c71a9 | |||
| ffc876eed2 | |||
| 41c43f1b7e | |||
| acc27c1976 | |||
| 41dfac827a | |||
| d5d05cef2f | |||
| 4900dcc5b6 | |||
| 1443149264 |
+8
-2
@@ -10,18 +10,23 @@ ehthumbs.db
|
||||
Desktop.ini
|
||||
$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
|
||||
@@ -57,4 +62,5 @@ pkg/*.zip
|
||||
.builds
|
||||
.svn
|
||||
.hg
|
||||
.hgignore
|
||||
.hgignore
|
||||
app/Umbraco/.vs/config/applicationhost.config
|
||||
+269
-144
@@ -1,54 +1,77 @@
|
||||
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,145 +80,247 @@ 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/controllers/config.global.controller.js',
|
||||
'app/directives/archetypeproperty.js',
|
||||
'app/services/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',
|
||||
'app/services/archetypeGlobalConfigService.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/Release/',
|
||||
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_binaries/lib/net40',
|
||||
expand: true
|
||||
},
|
||||
{
|
||||
cwd: 'app/Umbraco/Archetype.Courier/bin/Release/',
|
||||
src: ['Archetype.Courier.dll'],
|
||||
dest: 'tmp/nuget_courier/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'
|
||||
},
|
||||
dist_binaries: {
|
||||
src: 'tmp/nuget_binaries/package_binaries.nuspec',
|
||||
dest: 'pkg'
|
||||
},
|
||||
dist_courier: {
|
||||
src: 'tmp/nuget_courier/package_courier.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 %>',
|
||||
'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': {
|
||||
'tmp/nuget/package.nuspec': ['config/package.nuspec']
|
||||
}
|
||||
},
|
||||
'nuspec_binaries': {
|
||||
'options': {
|
||||
'data': {
|
||||
name: '<%= pkgMeta.name %>.Binaries',
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>'
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'tmp/nuget_binaries/package_binaries.nuspec': ['config/package_binaries.nuspec']
|
||||
}
|
||||
},
|
||||
'nuspec_courier': {
|
||||
'options': {
|
||||
'data': {
|
||||
name: '<%= pkgMeta.name %>.Courier',
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>'
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'tmp/nuget_courier/package_courier.nuspec': ['config/package_courier.nuspec']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
files: [{ path: '..\\..\\..\\<%= dest %>\\**', target: 'content\\App_Plugins\\Archetype'}]
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'<%= package_temp_dir %>/nuget/package.nuspec': ['<%= package_dir %>/nuget/package.nuspec']
|
||||
}
|
||||
}
|
||||
umbracoPackage: {
|
||||
dist: {
|
||||
src: 'tmp/umbraco',
|
||||
dest: 'pkg',
|
||||
options: {
|
||||
name: "<%= pkgMeta.name %>",
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
readme: '<%= grunt.file.read("config/readme.txt") %>'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clean: {
|
||||
build: ['<%= dest %>']
|
||||
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',
|
||||
'!app/controllers/config.global.controller.js'
|
||||
],
|
||||
less: [
|
||||
'app/less/*.less',
|
||||
'!app/less/archetype.less'
|
||||
]
|
||||
},
|
||||
|
||||
copy: {
|
||||
build: {
|
||||
files: [
|
||||
{expand: true, cwd: 'app/', src: ['package.manifest'], dest: '<%= dest %>', flatten: true},
|
||||
{expand: true, cwd: 'app/config/', src: ['config.views.js'], dest: '<%= dest %>/js', flatten: true},
|
||||
{expand: true, cwd: 'app/views/', src: ['archetype.html', 'archetype.config.html'], dest: '<%= dest %>/views', flatten: true},
|
||||
{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}
|
||||
]
|
||||
assemblyinfo: {
|
||||
options: {
|
||||
files: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj', 'app/Umbraco/Archetype.Courier/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: {
|
||||
options: {},
|
||||
webconfig: {
|
||||
src: ['<%= grunt.option("target") %>\\Web.config']
|
||||
}
|
||||
},
|
||||
|
||||
umbracoPackage: {
|
||||
options: {
|
||||
name: "<%= pkgMeta.name %>",
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
manifest: 'pkg/umbraco/package.xml',
|
||||
readme: 'pkg/umbraco/readme.txt',
|
||||
sourceDir: 'pkg/tmp/umbraco',
|
||||
outputDir: 'pkg',
|
||||
}
|
||||
},
|
||||
|
||||
clean: {
|
||||
build: ['<%= dest %>'],
|
||||
package_temp: ['pkg/tmp'],
|
||||
},
|
||||
|
||||
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: 'Release',
|
||||
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', ['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:html', 'copy:config', 'clean:html', 'clean:js', 'clean:less']);
|
||||
grunt.registerTask('nuget', ['copy:nuget', 'template:nuspec', 'template:nuspec_binaries', 'template:nuspec_courier', 'nugetpack']);
|
||||
grunt.registerTask('umbraco', ['copy:umbraco', 'umbracoPackage']);
|
||||
grunt.registerTask('package', ['clean:tmp', 'default', 'nuget', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']);
|
||||
grunt.registerTask('assets', ['clean', 'string-replace', 'less', 'concat', 'assemblyinfo', 'copy:assets', 'copy:html', 'copy:config', 'clean:html', 'clean:js', 'clean:less']);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
# Information Collection Disclosure
|
||||
|
||||
As of version v1.16.0, we are checking your installed version of Archetype against the current version. In this process we collect the current version of Archetype along with the current version of Umbraco that you are running. We use these values to help determine a response message to you. You may opt-out of this process by 'un-checking' the option in any of the Archetypes you have configured in the `Developer->Data Types` section of Umbraco.
|
||||
|
||||

|
||||
|
||||
This is a global setting that will set an `AppSetting` and update a file located at `~/config/archetype.config.js`. If you manually change the setting it will require an app reload to refresh to runtime values. If somehow this file becomes corrupt, a new file will be generated and you will again have to opt out.
|
||||
|
||||
We identify your install only by a randomly generated GUID. We WILL NOT store your IP address or hostname during the update check.
|
||||
|
||||
Part of the reason we collect this information is to also ascertain how many active installs exist. If this number is sufficiently high, we can plan accordingly and attempt to keep this project going.
|
||||
|
||||
We would ask that you reach out to the Archetype team via creating an issue on this site if you have any questions or concerns. We truly want Archetype to be a win-win for all involved.
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Imulus
|
||||
Copyright (c) 2016 Kevin Giszewski LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,66 +1,58 @@
|
||||
Archetype
|
||||
=========
|
||||

|
||||
|
||||
## Install Dependencies ##
|
||||

|
||||
|
||||
## Installation
|
||||
Install the selected <a href='https://github.com/kgiszewski/Archetype/releases'>release</a> through the Umbraco package installer or via <a href='http://www.nuget.org/packages/Archetype/'>NuGet</a>.
|
||||
|
||||
## Official Docs ##
|
||||
https://github.com/kgiszewski/ArchetypeManual
|
||||
|
||||
Get up and running in 15 minutes! https://www.youtube.com/watch?v=79LksNwGjLk
|
||||
|
||||
## News and Updates ##
|
||||
Follow us on Twitter https://twitter.com/ArchetypeKit
|
||||
|
||||
## Core Team ##
|
||||
* Kevin Giszewski (founder/project lead) - Tonic - https://kevin.giszewski.com/
|
||||
* Tom Fulton (founder) - Tonic - http://hellotonic.com/
|
||||
* Lee Kelleher - Umbrella - http://www.umbrellainc.co.uk/
|
||||
* Matt Brailsford - The Outfield - http://www.theoutfield.co.uk/
|
||||
* Kenn Jacobsen - Vertica - http://kennjacobsen.dk/
|
||||
|
||||
## Sponsor us\Donate!
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KBKWLURGLGU6L)
|
||||
|
||||
This project is funded by the core team members' time only. We don't charge for Archetype but it does take quite a bit of effort to keep it up-to-date with Umbraco core changes. If you're making a few bucks off of Archetype, we wouldn't refuse a donation :)
|
||||
|
||||
[Learn more](Sponsors.md) about sponsorship!
|
||||
|
||||
## Information Collection Disclosure
|
||||
Please read the information disclosure [here](Information%20Collection%20Disclosure.md).
|
||||
|
||||
## Contribute ##
|
||||
|
||||
Want to contribute to Archetype? You'll want to use Grunt (our task runner) to help you integrate with a local copy of Umbraco.
|
||||
|
||||
### Install Dependencies ###
|
||||
*Requires Node.js to be installed and in your system path*
|
||||
|
||||
npm install -g grunt-cli && npm install -g grunt
|
||||
npm install
|
||||
|
||||
## Build ##
|
||||
### 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
|
||||
|
||||
## Installation
|
||||
1) Install the <a href='http://bit.ly/1gUYKW8'>package</a> through the Umbraco package installer. Recommended if you want to just see the packaged version.
|
||||
|
||||
OR
|
||||
|
||||
2) Deploy with Grunt (see above). Recommended if you wish to extend this repo as this will inject this project into an existing v7 Umbraco install.
|
||||
|
||||
OR
|
||||
|
||||
3) Not recommended but a down and dirty way is to manually download and copy the files into the appropriate spot:
|
||||
|
||||
Your /App_Plugins and /bin should contain this structure:
|
||||
|
||||
/App_Plugins
|
||||
- package.manifest
|
||||
- /css
|
||||
-- archetype.css
|
||||
- /js
|
||||
-- archetype.js (our Grunt script concats the controller.js/config.controller.js, services and all directives into one file, you will have to do so manually)
|
||||
-- config.views.js
|
||||
- /views
|
||||
-- archetype.html
|
||||
-- archetype.config.html
|
||||
/bin
|
||||
-- archetype.dll (you'll have to build it)
|
||||
|
||||
## Prevalue Configs ##
|
||||
|
||||
Most of the fields are self evident, the following fields will be discussed further:
|
||||
|
||||
###Developer Mode###
|
||||
|
||||
By turning this on, you will get a textarea visible with the data model (not prevalue model). You can change the contents of the textarea for real-time editing. Additionally when in developer mode, the console will reflect the scope object of each property.
|
||||
|
||||
##View Compatibility##
|
||||
The basis of compatibility is based on the following:
|
||||
|
||||
- The model of the view must use `$scope.model.value` and the config must use `$scope.model.config`.
|
||||
|
||||
All core properties have not been tested yet :)
|
||||
|
||||
##Developer Notes##
|
||||
If you decide to extend this project locally, you'll want to set the `<compilation>` `debug` property in your `web.config` to `true`:
|
||||
|
||||
<compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.5">
|
||||
|
||||
This is in order to circumvent the minification and caching of the JavaScript files.
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# Sponsorship
|
||||
|
||||
Are you a company that depends on Archetype? We would love for you to sponsor us! Here's some suggested ways below!
|
||||
|
||||
## Sponsor a Sprint
|
||||
|
||||
We have a [backlog](https://github.com/kgiszewski/Archetype/issues), it gets worked on when either we have a personal need, we get bored or when we get a sponsorship. If you want to sponsor a sprint, we can give you thanks on social media and if you're really generous, we can put your logo and link on a well placed spot in a version release. [Contact us](https://twitter.com/ArchetypeKit) to get started.
|
||||
|
||||
## Donations
|
||||
|
||||
If you want to quietly support us, you can also send us a donation:
|
||||
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KBKWLURGLGU6L)
|
||||
@@ -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,260 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Lee Kelleher's implementation of Courier's PropertyDataResolverProvider for Archetype.
|
||||
/// </summary>
|
||||
public class ArchetypeDataResolver : PropertyDataResolverProvider
|
||||
{
|
||||
private enum Direction
|
||||
{
|
||||
Extracting,
|
||||
Packaging
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the editor alias.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The editor alias.
|
||||
/// </value>
|
||||
public override string EditorAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return Constants.PropertyEditorAlias;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extractings the type of the data.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
public override void ExtractingDataType(DataType item)
|
||||
{
|
||||
// No longer need to extract the DataType (int) Ids as Archetype now references the Guid [LK]
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extractings the property.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="propertyData">The property data.</param>
|
||||
public override void ExtractingProperty(Item item, ContentProperty propertyData)
|
||||
{
|
||||
ReplacePropertyDataIds(item, propertyData, Direction.Extracting);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Packagings the type of the data.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
public override void PackagingDataType(DataType item)
|
||||
{
|
||||
AddDataTypeDependencies(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Packages the property.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="propertyData">The property data.</param>
|
||||
public override void PackagingProperty(Item item, ContentProperty propertyData)
|
||||
{
|
||||
ReplacePropertyDataIds(item, propertyData, Direction.Packaging);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the datatype dependencies.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces the property data Ids.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="propertyData">The property data.</param>
|
||||
/// <param name="direction">The direction.</param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the additional properties.
|
||||
/// </summary>
|
||||
/// <param name="preValue">The pre value.</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the additional properties.
|
||||
/// </summary>
|
||||
/// <param name="archetype">The archetype.</param>
|
||||
/// <param name="preValue">The pre value.</param>
|
||||
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>
|
||||
@@ -0,0 +1,300 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.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>{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Archetype.Tests</RootNamespace>
|
||||
<AssemblyName>Archetype.Tests</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="AutoMapper.Net4">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||
<Private>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core">
|
||||
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core.Mvc">
|
||||
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
|
||||
<Private>True</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>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CookComputing.XmlRpcV2">
|
||||
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
<Private>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="HtmlAgilityPack">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib">
|
||||
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
<Private>True</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>True</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>True</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>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lucene.Net">
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
<Private>True</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>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="MiniProfiler">
|
||||
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq">
|
||||
<HintPath>..\packages\Moq.4.2.1312.1622\lib\net40\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
<Private>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
<Private>True</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>True</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.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.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>True</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>
|
||||
<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>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</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>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</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>
|
||||
<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>
|
||||
<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="TidyNet, Version=1.0.0.0, Culture=neutral">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
|
||||
<Private>True</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>True</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>True</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>True</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>True</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>True</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>True</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>True</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>True</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>True</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>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Models\FieldsetTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PropertyValueConverter\PropertyValueConverterTests.cs" />
|
||||
<Compile Include="PublishedContent\ArchetypePublishedContentTests.cs" />
|
||||
<Compile Include="PublishedContent\TypeConverterTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="Data\sample-1.json" />
|
||||
<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>
|
||||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</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">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1 @@
|
||||
{"fieldsets":[{"alias":"archUi","properties":[{"alias":"blurb","value":"A blurb here"},{"alias":"boxHeadline","value":"Box 1 Title"},{"alias":"link","value":"3175"},{"alias":"show","value":"1"}],"remove":false,"collapse":true,"isValid":true},{"alias":"archUi","properties":[{"alias":"boxHeadline","value":"Another Box"},{"alias":"blurb","value":"Some content"},{"alias":"link","value":"3175"},{"alias":"show","value":"0"}],"remove":false,"collapse":true,"isValid":true}]}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Archetype.PropertyConverters;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Archetype.Tests.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests designed for the fieldsets.
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class FieldsetTests
|
||||
{
|
||||
private string _sampleJson;
|
||||
|
||||
/// <summary>
|
||||
/// Sets up the test to use sample JSON data.
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
_sampleJson = File.ReadAllText("..\\..\\Data\\sample-1.json");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Get_Fieldset_Property_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("boxHeadline");
|
||||
|
||||
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.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.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
|
||||
var fieldset = result.Fieldsets.First();
|
||||
|
||||
var property = fieldset.GetValue("link");
|
||||
Assert.That(property is string);
|
||||
Assert.That(property == "3175");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("Archetype.Tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Archetype.Tests")]
|
||||
[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("de11df59-e1eb-4aae-87fd-59c33606a1f5")]
|
||||
|
||||
// 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,62 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Archetype.PropertyConverters;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Archetype.Tests.PropertyValueConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests designed to test the PVC.
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class PropertyValueConverterTests
|
||||
{
|
||||
private string _sampleJson;
|
||||
|
||||
/// <summary>
|
||||
/// Sets up the test to use JSON data.
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
_sampleJson = File.ReadAllText("..\\..\\Data\\sample-1.json");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[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, data, false);
|
||||
|
||||
Assert.AreEqual(result.GetType(), typeof (Archetype.Models.ArchetypeModel));
|
||||
|
||||
var fieldsets = (Archetype.Models.ArchetypeModel) result;
|
||||
Assert.IsTrue(fieldsets.Count() == 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
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(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.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
|
||||
|
||||
Assert.That(result != null);
|
||||
Assert.That(result.Fieldsets.Count() == 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Archetype.Extensions;
|
||||
using Archetype.Models;
|
||||
using Archetype.PropertyConverters;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace Archetype.Tests.PublishedContent
|
||||
{
|
||||
[TestFixture]
|
||||
public class ArchetypePublishedContentTests
|
||||
{
|
||||
private ArchetypeModel _archetype;
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void Init()
|
||||
{
|
||||
var archetypeJson = System.IO.File.ReadAllText("..\\..\\Data\\sample-1.json");
|
||||
var converter = new ArchetypeValueConverter();
|
||||
|
||||
_archetype = (ArchetypeModel)converter.ConvertDataToSource(null, archetypeJson, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypeModel_Initialized()
|
||||
{
|
||||
Assert.IsNotNull(_archetype);
|
||||
Assert.IsNotEmpty(_archetype.Fieldsets);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypeModel_To_PublishedContentSet()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
|
||||
Assert.That(contentSet, Is.Not.Null);
|
||||
Assert.That(contentSet, Is.Not.Empty);
|
||||
Assert.That(contentSet, Is.All.InstanceOf<IPublishedContent>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypeFieldsetModel_To_PublishedContent()
|
||||
{
|
||||
var fieldset = _archetype.Fieldsets.FirstOrDefault();
|
||||
var content = fieldset.ToPublishedContent();
|
||||
|
||||
Assert.That(content, Is.Not.Null);
|
||||
Assert.That(content, Is.InstanceOf<IPublishedContent>());
|
||||
Assert.That(content.Properties, Is.Not.Empty);
|
||||
Assert.That(content.Properties, Is.All.InstanceOf<IPublishedProperty>());
|
||||
}
|
||||
|
||||
[TestCase("boxHeadline", "Box 1 Title")]
|
||||
[TestCase("link", "3175")]
|
||||
[TestCase("link", 3175)]
|
||||
[TestCase("show", "1")]
|
||||
[TestCase("show", true)]
|
||||
[TestCase("show", 1)]
|
||||
public void ArchetypePublishedContent_Typed_Properties<T>(string propertyAlias, T expected)
|
||||
{
|
||||
var fieldset = _archetype.Fieldsets.FirstOrDefault();
|
||||
var content = fieldset.ToPublishedContent();
|
||||
|
||||
var actual = content.GetPropertyValue<T>(propertyAlias);
|
||||
|
||||
Assert.AreEqual(actual, expected);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Null_ArchetypeModel_Throws_Exception()
|
||||
{
|
||||
TestDelegate code = () =>
|
||||
{
|
||||
ArchetypeModel archetype = null;
|
||||
archetype.ToPublishedContentSet();
|
||||
};
|
||||
|
||||
Assert.Throws<ArgumentNullException>(code);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Null_ArchetypeFieldsetModel_Throws_Exception()
|
||||
{
|
||||
TestDelegate code = () =>
|
||||
{
|
||||
ArchetypeFieldsetModel fieldset = null;
|
||||
fieldset.ToPublishedContent();
|
||||
};
|
||||
|
||||
Assert.Throws<ArgumentNullException>(code);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypePublishedContent_GetIndex()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
var i = 0;
|
||||
|
||||
foreach (var content in contentSet)
|
||||
{
|
||||
Assert.AreEqual(content.GetIndex(), i);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypePublishedContentSet_IsFirstIsLast()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
|
||||
foreach (var content in contentSet)
|
||||
{
|
||||
var value = content.GetPropertyValue<string>("boxHeadline");
|
||||
|
||||
Assert.That(value == "Box 1 Title", Is.EqualTo(content.IsFirst()));
|
||||
Assert.That(value == "Another Box", Is.EqualTo(content.IsLast()));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypePublishedContentSet_PreviousNext()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
var list = contentSet.ToList();
|
||||
|
||||
Assert.That(list.Count, Is.EqualTo(2));
|
||||
|
||||
var first = list[0];
|
||||
var last = list[1];
|
||||
|
||||
var next = first.Next();
|
||||
Assert.AreEqual(next, last);
|
||||
|
||||
var prev = last.Previous();
|
||||
Assert.AreEqual(prev, first);
|
||||
}
|
||||
|
||||
[Test, ExpectedException(typeof(NullReferenceException))]
|
||||
public void ArchetypePublishedContentSet_Siblings()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
var content = contentSet.FirstOrDefault();
|
||||
|
||||
var siblings = content.Siblings();
|
||||
Assert.That(siblings, Is.Not.Null);
|
||||
|
||||
var following = content.FollowingSibling();
|
||||
Assert.That(following, Is.Not.Null);
|
||||
|
||||
var preceding = content.PrecedingSibling();
|
||||
Assert.That(preceding, Is.Not.Null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Models;
|
||||
using Archetype.PropertyConverters;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Archetype.Tests.PublishedContent
|
||||
{
|
||||
[TestFixture]
|
||||
public class TypeConverterTests
|
||||
{
|
||||
private ArchetypeModel _archetype;
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void Init()
|
||||
{
|
||||
var archetypeJson = System.IO.File.ReadAllText("..\\..\\Data\\sample-1.json");
|
||||
var converter = new ArchetypeValueConverter();
|
||||
|
||||
_archetype = (ArchetypeModel)converter.ConvertDataToSource(null, archetypeJson, false);
|
||||
}
|
||||
|
||||
[TestCase(typeof(ArchetypeModel), true)]
|
||||
[TestCase(typeof(ArchetypePublishedContentSet), true)]
|
||||
[TestCase(typeof(IEnumerable<IPublishedContent>), true)]
|
||||
[TestCase(typeof(string), true)]
|
||||
[TestCase(typeof(int), false)]
|
||||
[TestCase(typeof(ArchetypeFieldsetModel), false)]
|
||||
public void ArchetypeModel_ConvertsTo_EnumerablePublishedContent(Type destinationType, bool expected)
|
||||
{
|
||||
Assert.IsNotNull(_archetype);
|
||||
|
||||
var attempt = _archetype.TryConvertTo(destinationType);
|
||||
|
||||
Assert.That(attempt.Success, Is.EqualTo(expected));
|
||||
|
||||
if (attempt.Success)
|
||||
{
|
||||
Assert.IsNotNull(attempt.Result);
|
||||
Assert.That(attempt.Result, Is.InstanceOf(destinationType));
|
||||
}
|
||||
}
|
||||
|
||||
[TestCase(typeof(ArchetypeFieldsetModel), true)]
|
||||
[TestCase(typeof(ArchetypePublishedContent), true)]
|
||||
[TestCase(typeof(IPublishedContent), true)]
|
||||
[TestCase(typeof(string), true)]
|
||||
[TestCase(typeof(int), false)]
|
||||
[TestCase(typeof(ArchetypeModel), false)]
|
||||
public void ArchetypeFieldsetModel_ConvertsTo_PublishedContent(Type destinationType, bool expected)
|
||||
{
|
||||
CollectionAssert.IsNotEmpty(_archetype.Fieldsets);
|
||||
|
||||
var attempt = _archetype.First().TryConvertTo(destinationType);
|
||||
|
||||
Assert.That(attempt.Success, Is.EqualTo(expected));
|
||||
|
||||
if (attempt.Success)
|
||||
{
|
||||
Assert.IsNotNull(attempt.Result);
|
||||
Assert.That(attempt.Result, Is.InstanceOf(destinationType));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -0,0 +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.4" 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>
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.40629.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Umbraco", "Umbraco.Archetype\Archetype.Umbraco.csproj", "{7D185D41-4228-4978-ACB8-83F9A48AD94F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D84AA4ED-85A6-484F-9E72-BE7AC9835821}"
|
||||
@@ -10,6 +12,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D84AA4
|
||||
.nuget\NuGet.targets = .nuget\NuGet.targets
|
||||
EndProjectSection
|
||||
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}") = "Archetype.Courier", "Archetype.Courier\Archetype.Courier.csproj", "{FE8BE437-8B11-4E49-9B02-F45994E6D723}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -20,6 +26,14 @@ Global
|
||||
{7D185D41-4228-4978-ACB8-83F9A48AD94F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7D185D41-4228-4978-ACB8-83F9A48AD94F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7D185D41-4228-4978-ACB8-83F9A48AD94F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{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
|
||||
{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,171 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
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;
|
||||
using Archetype.Models;
|
||||
|
||||
namespace Archetype.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller that handles datatype related interactions.
|
||||
/// </summary>
|
||||
/// <seealso cref="Umbraco.Web.Editors.UmbracoAuthorizedJsonController" />
|
||||
[PluginController("ArchetypeApi")]
|
||||
public class ArchetypeDataTypeController : UmbracoAuthorizedJsonController
|
||||
{
|
||||
private static DateTime _lastVersionCheck;
|
||||
private const int IntervalInDaysBetweenVersionChecks = 7;
|
||||
|
||||
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 });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all datatypes.
|
||||
/// </summary>
|
||||
/// <returns>System.Object.</returns>
|
||||
public object GetAll()
|
||||
{
|
||||
var dataTypes = Services.DataTypeService.GetAllDataTypeDefinitions();
|
||||
return dataTypes.Select(t => new { guid = t.Key, name = t.Name });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all details.
|
||||
/// </summary>
|
||||
/// <returns>System.Object.</returns>
|
||||
public object GetAllDetails()
|
||||
{
|
||||
var dataTypes = Services.DataTypeService.GetAllDataTypeDefinitions();
|
||||
|
||||
var list = new List<object>();
|
||||
|
||||
foreach (var dataType in dataTypes)
|
||||
{
|
||||
var dataTypeDisplay = Mapper.Map<IDataTypeDefinition, DataTypeDisplay>(dataType);
|
||||
|
||||
list.Add(new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, dataTypeGuid = dataType.Key });
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the datatype by GUID.
|
||||
/// </summary>
|
||||
/// <param name="guid">The unique identifier.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.Web.Http.HttpResponseException"></exception>
|
||||
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 };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the datatype by GUID.
|
||||
/// </summary>
|
||||
/// <param name="guid">The unique identifier.</param>
|
||||
/// <param name="contentTypeAlias">The content type alias.</param>
|
||||
/// <param name="propertyTypeAlias">The property type alias.</param>
|
||||
/// <param name="archetypeAlias">The archetype alias.</param>
|
||||
/// <param name="nodeId">The node identifier.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.Web.Http.HttpResponseException"></exception>
|
||||
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 };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the DLL version from the file.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public object GetDllVersion()
|
||||
{
|
||||
return new { dllVersion = ArchetypeHelper.Instance.DllVersion() };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Globals the settings.
|
||||
/// </summary>
|
||||
/// <returns>System.Object.</returns>
|
||||
[HttpGet]
|
||||
public object GlobalSettings()
|
||||
{
|
||||
return new
|
||||
{
|
||||
isCheckingForUpdates = ArchetypeGlobalSettings.Instance.CheckForUpdates
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the check for updates.
|
||||
/// </summary>
|
||||
/// <param name="isChecking">if set to <c>true</c> [is checking].</param>
|
||||
[HttpPost]
|
||||
public void SetCheckForUpdates([FromBody] bool isChecking)
|
||||
{
|
||||
ArchetypeGlobalSettings.Instance.CheckForUpdates = isChecking;
|
||||
ArchetypeGlobalSettings.Instance.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks for updates.
|
||||
/// </summary>
|
||||
/// <returns>System.Object.</returns>
|
||||
[HttpPost]
|
||||
public object CheckForUpdates()
|
||||
{
|
||||
if (!ArchetypeGlobalSettings.Instance.CheckForUpdates || !IsItTimeToCheck())
|
||||
{
|
||||
return new
|
||||
{
|
||||
isUpdateAvailable = false
|
||||
};
|
||||
}
|
||||
|
||||
var updateNotificationModel = ArchetypeHelper.Instance.CheckForUpdates();
|
||||
_lastVersionCheck = DateTime.UtcNow;
|
||||
|
||||
return new
|
||||
{
|
||||
isUpdateAvailable = updateNotificationModel.IsUpdateAvailable,
|
||||
headline = updateNotificationModel.Headline,
|
||||
type = updateNotificationModel.Type,
|
||||
message = updateNotificationModel.Message,
|
||||
url = updateNotificationModel.Url
|
||||
};
|
||||
}
|
||||
|
||||
internal bool IsItTimeToCheck()
|
||||
{
|
||||
return _lastVersionCheck.AddDays(IntervalInDaysBetweenVersionChecks) < DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,148 @@
|
||||
<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.Configuration" />
|
||||
<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,48 +184,83 @@
|
||||
<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="Models\Fieldset.cs" />
|
||||
<Compile Include="Models\Property.cs" />
|
||||
<Compile Include="Api\ArchetypeDataTypeController.cs" />
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Events\ExpireCache.cs" />
|
||||
<Compile Include="Extensions\ArchetypeFieldsetModelExtensions.cs" />
|
||||
<Compile Include="Extensions\ArchetypeHelper.cs" />
|
||||
<Compile Include="Extensions\ArchetypeModelExtensions.cs" />
|
||||
<Compile Include="Extensions\HtmlHelperExtensions.cs" />
|
||||
<Compile Include="Extensions\ArchetypePropertyModelExtensions.cs" />
|
||||
<Compile Include="Extensions\PropertyEditorExtensions.cs" />
|
||||
<Compile Include="Extensions\StringExtensions.cs" />
|
||||
<Compile Include="Models\ArchetypeConfigFileModel.cs" />
|
||||
<Compile Include="Models\ArchetypeGlobalSettings.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\ArchetypeFieldsetModel.cs" />
|
||||
<Compile Include="Models\ArchetypePropertyModel.cs" />
|
||||
<Compile Include="Models\ArchetypePublishedContent.cs" />
|
||||
<Compile Include="Models\ArchetypePublishedContentSet.cs" />
|
||||
<Compile Include="Models\ArchetypePublishedProperty.cs" />
|
||||
<Compile Include="Models\ArchetypeUpdateNotification.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\VersionInfo.cs" />
|
||||
<Compile Include="PropertyConverters\ArchetypeValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ArchetypePropertyEditor.cs" />
|
||||
<Compile Include="TypeConverters\ArchetypeFieldsetModelConverter.cs" />
|
||||
<Compile Include="TypeConverters\ArchetypeModelConverter.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Archetype
|
||||
{
|
||||
/// <summary>
|
||||
/// Archetype constants.
|
||||
/// </summary>
|
||||
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_";
|
||||
|
||||
public const string UmbracoVersionAlias = "umbracoConfigurationStatus";
|
||||
public const string NotificationUrl = "https://api.gizmo42.com/v1/archetype/check-for-updates";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Archetype.Events
|
||||
{
|
||||
public class ExpireCache : ApplicationEventHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers our ExpirePreValueCache handler on app starting.
|
||||
/// </summary>
|
||||
/// <param name="umbracoApplication"></param>
|
||||
/// <param name="applicationContext"></param>
|
||||
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
|
||||
{
|
||||
base.ApplicationStarting(umbracoApplication, applicationContext);
|
||||
|
||||
DataTypeService.Saved += ExpirePreValueCache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Expires the pre value cache when a datatype is saved.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="Umbraco.Core.Events.SaveEventArgs{IDataTypeDefinition}"/> instance containing the event data.</param>
|
||||
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,25 @@
|
||||
using System.Linq;
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
public static class ArchetypeFieldsetModelExtensions
|
||||
{
|
||||
public static IPublishedContent ToPublishedContent(this ArchetypeFieldsetModel fieldset)
|
||||
{
|
||||
return new ArchetypePublishedContent(fieldset);
|
||||
}
|
||||
|
||||
public static IPublishedContent ToPublishedContent(this ArchetypeFieldsetModel fieldset, ArchetypeModel archetype)
|
||||
{
|
||||
var contentSet = archetype.ToPublishedContentSet();
|
||||
|
||||
var first = contentSet
|
||||
.Cast<ArchetypePublishedContent>()
|
||||
.FirstOrDefault(x => x.ArchetypeFieldset == fieldset);
|
||||
|
||||
return first ?? new ArchetypePublishedContent(fieldset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using Archetype.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
|
||||
/// <summary>
|
||||
/// The Extensions namespace.
|
||||
/// </summary>
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class that handles several Archetype related interactions.
|
||||
/// </summary>
|
||||
public class ArchetypeHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// The json settings
|
||||
/// </summary>
|
||||
protected JsonSerializerSettings _jsonSettings;
|
||||
/// <summary>
|
||||
/// The application
|
||||
/// </summary>
|
||||
protected ApplicationContext _app;
|
||||
/// <summary>
|
||||
/// The pad lock
|
||||
/// </summary>
|
||||
private static readonly object _padLock = new object();
|
||||
/// <summary>
|
||||
/// The instance
|
||||
/// </summary>
|
||||
private static ArchetypeHelper _instance = new ArchetypeHelper();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance.
|
||||
/// </summary>
|
||||
/// <value>The instance.</value>
|
||||
internal static ArchetypeHelper Instance {
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
lock (_padLock)
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new ArchetypeHelper();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArchetypeHelper" /> class.
|
||||
/// </summary>
|
||||
private ArchetypeHelper()
|
||||
{
|
||||
var dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver();
|
||||
dcr.DefaultMembersSearchFlags |= BindingFlags.NonPublic;
|
||||
|
||||
_jsonSettings = new JsonSerializerSettings { ContractResolver = dcr };
|
||||
_app = ApplicationContext.Current;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the json serializer settings.
|
||||
/// </summary>
|
||||
/// <value>The json serializer settings.</value>
|
||||
internal JsonSerializerSettings JsonSerializerSettings { get { return _jsonSettings; } }
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes the JSON to archetype.
|
||||
/// </summary>
|
||||
/// <param name="sourceJson">The source JSON.</param>
|
||||
/// <param name="dataTypePreValues">The data type pre values.</param>
|
||||
/// <returns>ArchetypeModel.</returns>
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes the JSON to archetype.
|
||||
/// </summary>
|
||||
/// <param name="sourceJson">The source JSON.</param>
|
||||
/// <param name="dataTypeId">The data type identifier.</param>
|
||||
/// <param name="hostContentType">Type of the host content.</param>
|
||||
/// <returns>ArchetypeModel.</returns>
|
||||
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 (Exception ex)
|
||||
{
|
||||
return new ArchetypeModel();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether datatypeId has had it's PVC overridden.
|
||||
/// </summary>
|
||||
/// <param name="dataTypeId">The data type identifier.</param>
|
||||
/// <returns><c>true</c> if [is property value converter overridden] [the specified data type identifier]; otherwise, <c>false</c>.</returns>
|
||||
internal bool IsPropertyValueConverterOverridden(int dataTypeId)
|
||||
{
|
||||
var prevalues = GetArchetypePreValueFromDataTypeId(dataTypeId);
|
||||
|
||||
if (prevalues == null)
|
||||
return false;
|
||||
|
||||
return prevalues.OverrideDefaultPropertyValueConverter;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks for updates.
|
||||
/// </summary>
|
||||
/// <returns>ArchetypeUpdateNotification.</returns>
|
||||
internal ArchetypeUpdateNotification CheckForUpdates()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var content = new StringContent(JsonConvert.SerializeObject(new
|
||||
{
|
||||
umbracoVersion = ConfigurationManager.AppSettings[Constants.UmbracoVersionAlias],
|
||||
archetypeVersion = DllVersion(),
|
||||
id = ArchetypeGlobalSettings.Instance.Id
|
||||
}), Encoding.UTF8, "application/json");
|
||||
|
||||
client.DefaultRequestHeaders.Add("x-api-key-id", ArchetypeGlobalSettings.Instance.ApiKey.ToString());
|
||||
|
||||
var response = client.PostAsync(new Uri(Constants.NotificationUrl), content).Result;
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
var responseString = response.Content.ReadAsStringAsync().Result;
|
||||
|
||||
return JsonConvert.DeserializeObject<ArchetypeUpdateNotification>(responseString);
|
||||
}
|
||||
|
||||
return new ArchetypeUpdateNotification
|
||||
{
|
||||
IsUpdateAvailable = false
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if anything goes wrong let's make sure we don't break their site
|
||||
return new ArchetypeUpdateNotification
|
||||
{
|
||||
IsUpdateAvailable = false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the archetype pre value from data type identifier.
|
||||
/// </summary>
|
||||
/// <param name="dataTypeId">The data type identifier.</param>
|
||||
/// <returns>ArchetypePreValue.</returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the archetype pre value from pre values collection.
|
||||
/// </summary>
|
||||
/// <param name="dataTypePreValues">The data type pre values.</param>
|
||||
/// <returns>ArchetypePreValue.</returns>
|
||||
private ArchetypePreValue GetArchetypePreValueFromPreValuesCollection(PreValueCollection dataTypePreValues)
|
||||
{
|
||||
var preValueAsString = dataTypePreValues.PreValuesAsDictionary.First().Value.Value;
|
||||
var preValue = JsonConvert.DeserializeObject<ArchetypePreValue>(preValueAsString, _jsonSettings);
|
||||
return preValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data type by unique identifier.
|
||||
/// </summary>
|
||||
/// <param name="guid">The unique identifier.</param>
|
||||
/// <returns>IDataTypeDefinition.</returns>
|
||||
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>
|
||||
/// <param name="hostContentType">Type of the host content.</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="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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the DLL version from the file.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
internal string DllVersion()
|
||||
{
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
var fvi = FileVersionInfo.GetVersionInfo(asm.Location);
|
||||
|
||||
return fvi.FileVersion;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
public static class ArchetypeModelExtensions
|
||||
{
|
||||
public static IEnumerable<IPublishedContent> ToPublishedContentSet(this ArchetypeModel archetype)
|
||||
{
|
||||
return new ArchetypePublishedContentSet(archetype);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// ArchetypePropertyModel extensions.
|
||||
/// </summary>
|
||||
public static class ArchetypePropertyModelExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines whether this instance is an archetype.
|
||||
/// </summary>
|
||||
/// <param name="prop">The property.</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsArchetype(this ArchetypePropertyModel prop)
|
||||
{
|
||||
return prop.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditorAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates dummy property type.
|
||||
/// </summary>
|
||||
/// <param name="prop">The property.</param>
|
||||
/// <returns></returns>
|
||||
internal static PublishedPropertyType CreateDummyPropertyType(this ArchetypePropertyModel prop)
|
||||
{
|
||||
// We need to check if `PropertyValueConvertersResolver` exists,
|
||||
// otherwise `PublishedPropertyType` will throw an exception outside of the Umbraco context.; e.g. unit-tests.
|
||||
if (!PropertyValueConvertersResolver.HasCurrent)
|
||||
return null;
|
||||
|
||||
return new PublishedPropertyType(prop.HostContentType, new PropertyType(new DataTypeDefinition(-1, prop.PropertyEditorAlias) { Id = prop.DataTypeId }));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Archetype.Umbraco.Extensions
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
//lifted from the core as it is marked 'internal'
|
||||
public static bool DetectIsJson(this string input)
|
||||
{
|
||||
input = input.Trim();
|
||||
return input.StartsWith("{") && input.EndsWith("}")
|
||||
|| input.StartsWith("[") && input.EndsWith("]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// HtmlHelper extenions used for rendering an Archetype.
|
||||
/// </summary>
|
||||
public static class HtmlHelperExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Renders the partials based on the model, partial path and given viewdata dictionary.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="archetypeModel">The archetype model.</param>
|
||||
/// <param name="partialPath">The partial path.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
private static IHtmlString _renderPartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach (var fieldsetModel in archetypeModel)
|
||||
{
|
||||
sb.AppendLine(_renderPartial(htmlHelper, fieldsetModel, partialPath, viewDataDictionary).ToString());
|
||||
}
|
||||
|
||||
return new HtmlString(sb.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the fieldset partial
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel"></param>
|
||||
/// <param name="partialPath">The partial path.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
private static IHtmlString _renderPartial(HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
var context = HttpContext.Current;
|
||||
|
||||
if (fieldsetModel == null || context == null)
|
||||
{
|
||||
return new HtmlString("");
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
//default
|
||||
var pathToPartials = "~/Views/Partials/Archetype/";
|
||||
|
||||
if (!string.IsNullOrEmpty(partialPath))
|
||||
{
|
||||
pathToPartials = partialPath;
|
||||
}
|
||||
|
||||
var partial = string.Format("{0}{1}.cshtml", pathToPartials, fieldsetModel.Alias);
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders a single archtype partial from a fieldset
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel">The fieldset model.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel)
|
||||
{
|
||||
return _renderPartial(htmlHelper, fieldsetModel, null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partial.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel">The fieldset model.</param>
|
||||
/// <param name="partialView">The partial view.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialView)
|
||||
{
|
||||
return _renderPartial(htmlHelper, fieldsetModel, partialView, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partial.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel">The fieldset model.</param>
|
||||
/// <param name="partialView">The partial view.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialView, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return _renderPartial(htmlHelper, fieldsetModel, partialView, viewDataDictionary);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partials.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="archetypeModel">The archetype model.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel)
|
||||
{
|
||||
return _renderPartials(htmlHelper, archetypeModel, null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partials.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="archetypeModel">The archetype model.</param>
|
||||
/// <param name="partialPath">The partial path.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath)
|
||||
{
|
||||
return _renderPartials(htmlHelper, archetypeModel, partialPath, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partials.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="archetypeModel">The archetype model.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return _renderPartials(htmlHelper, archetypeModel, null, viewDataDictionary);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partials.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="archetypeModel">The archetype model.</param>
|
||||
/// <param name="partialPath">The partial path.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return htmlHelper._renderPartials(archetypeModel, partialPath, viewDataDictionary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// PropertyEditor extensions.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace Archetype.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// String extensions.
|
||||
/// </summary>
|
||||
public static class StringExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Detects if the input string is JSON.
|
||||
/// </summary>
|
||||
/// <param name="input">The input.</param>
|
||||
/// <returns></returns>
|
||||
public static bool DetectIsJson(this string input)
|
||||
{
|
||||
input = input.Trim();
|
||||
return input.StartsWith("{") && input.EndsWith("}")
|
||||
|| input.StartsWith("[") && input.EndsWith("]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
{
|
||||
public class Archetype
|
||||
{
|
||||
public IEnumerable<Fieldset> Fieldsets { get; set; }
|
||||
|
||||
public Archetype()
|
||||
{
|
||||
Fieldsets = new List<Fieldset>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypeConfigFileModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public bool CheckForUpdates { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Web.Security;
|
||||
using Archetype.TypeConverters;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Model that represents a fieldset stored as content JSON.
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(ArchetypeFieldsetModelConverter))]
|
||||
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; }
|
||||
|
||||
[JsonProperty("releaseDate")]
|
||||
public DateTime? ReleaseDate { get; set; }
|
||||
|
||||
[JsonProperty("expireDate")]
|
||||
public DateTime? ExpireDate { get; set; }
|
||||
|
||||
[JsonProperty("allowedMemberGroups")]
|
||||
public string AllowedMemberGroups { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArchetypeFieldsetModel"/> class.
|
||||
/// </summary>
|
||||
public ArchetypeFieldsetModel()
|
||||
{
|
||||
Properties = new List<ArchetypePropertyModel>();
|
||||
}
|
||||
|
||||
#region Helper Methods
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value and returns as string.
|
||||
/// </summary>
|
||||
/// <param name="propertyAlias">The property alias.</param>
|
||||
/// <returns></returns>
|
||||
public string GetValue(string propertyAlias)
|
||||
{
|
||||
return GetValue<string>(propertyAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value based on the type passed in as a generic.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="propertyAlias">The property alias.</param>
|
||||
/// <returns></returns>
|
||||
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.
|
||||
/// <summary>
|
||||
/// Gets the value.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="propertyAlias">The property alias.</param>
|
||||
/// <param name="defaultValue">The default value.</param>
|
||||
/// <returns></returns>
|
||||
public T GetValue<T>(string propertyAlias, T defaultValue)
|
||||
{
|
||||
var property = GetProperty(propertyAlias);
|
||||
|
||||
if (IsEmptyProperty(property))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return property.GetValue<T>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the property is empty.
|
||||
/// </summary>
|
||||
/// <param name="property">The property.</param>
|
||||
/// <returns></returns>
|
||||
private bool IsEmptyProperty(ArchetypePropertyModel property)
|
||||
{
|
||||
return (property == null || property.Value == null || string.IsNullOrEmpty(property.Value.ToString()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified property alias has property.
|
||||
/// </summary>
|
||||
/// <param name="propertyAlias">The property alias.</param>
|
||||
/// <returns></returns>
|
||||
public bool HasProperty(string propertyAlias)
|
||||
{
|
||||
return GetProperty(propertyAlias) != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified property alias has value.
|
||||
/// </summary>
|
||||
/// <param name="propertyAlias">The property alias.</param>
|
||||
/// <returns></returns>
|
||||
public bool HasValue(string propertyAlias)
|
||||
{
|
||||
var property = GetProperty(propertyAlias);
|
||||
if (property == null || property.Value == null)
|
||||
return false;
|
||||
|
||||
return !string.IsNullOrEmpty(property.Value.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property.
|
||||
/// </summary>
|
||||
/// <param name="propertyAlias">The property alias.</param>
|
||||
/// <returns></returns>
|
||||
private ArchetypePropertyModel GetProperty(string propertyAlias)
|
||||
{
|
||||
return Properties.FirstOrDefault(p => p.Alias.InvariantEquals(propertyAlias));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is this fieldset disabled, either explicitly or by other means?
|
||||
/// </summary>
|
||||
/// <returns>true if this fieldset is disabled, false otherwise</returns>
|
||||
internal bool IsAvailable()
|
||||
{
|
||||
// explicitly disabled or implicitly disabled through publishing?
|
||||
var disabled = Disabled
|
||||
|| (ReleaseDate.HasValue && ReleaseDate > DateTime.UtcNow)
|
||||
|| (ExpireDate.HasValue && DateTime.UtcNow > ExpireDate);
|
||||
if (disabled)
|
||||
{
|
||||
// yes - the fieldset is not available
|
||||
return false;
|
||||
}
|
||||
// limitation on member group access?
|
||||
if (string.IsNullOrEmpty(AllowedMemberGroups))
|
||||
{
|
||||
// no - the fieldset is available
|
||||
return true;
|
||||
}
|
||||
// maybe - the fieldset is available if the current member is a member of the configured member groups
|
||||
var currentUserGroups = Roles.GetRolesForUser() ?? new string[0];
|
||||
return currentUserGroups.ContainsAny(AllowedMemberGroups.Split(','));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypeGlobalSettings
|
||||
{
|
||||
public bool CheckForUpdates { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid ApiKey = _getApiKey();
|
||||
|
||||
private static ArchetypeGlobalSettings _instance;
|
||||
|
||||
private static string _pathToConfig = @"~/Config/Archetype.config.js";
|
||||
|
||||
private static readonly string _mappedPathToConfig = IOHelper.MapPath(_pathToConfig);
|
||||
|
||||
private static object _padLock = new object();
|
||||
|
||||
private ArchetypeGlobalSettings()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static ArchetypeGlobalSettings Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
lock (_padLock)
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new ArchetypeGlobalSettings();
|
||||
|
||||
_loadSettingsFromConfigFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
lock (_padLock)
|
||||
{
|
||||
//write to JSON
|
||||
var configFileModel = new ArchetypeConfigFileModel
|
||||
{
|
||||
Id = _instance.Id,
|
||||
CheckForUpdates = _instance.CheckForUpdates
|
||||
};
|
||||
|
||||
var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented);
|
||||
|
||||
File.WriteAllText(_mappedPathToConfig, serializedJson);
|
||||
}
|
||||
}
|
||||
|
||||
private static void _loadSettingsFromConfigFile()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(_mappedPathToConfig))
|
||||
{
|
||||
//load
|
||||
var deserializedConfigFile = JsonConvert.DeserializeObject<ArchetypeConfigFileModel>(File.ReadAllText(_mappedPathToConfig));
|
||||
|
||||
if (deserializedConfigFile != null)
|
||||
{
|
||||
_instance.Id = deserializedConfigFile.Id;
|
||||
_instance.CheckForUpdates = deserializedConfigFile.CheckForUpdates;
|
||||
}
|
||||
else
|
||||
{
|
||||
_createNewConfigFile("Config file model was null!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_createNewConfigFile("Config file was missing!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<ArchetypeGlobalSettings>(ex.Message, ex);
|
||||
|
||||
_createNewConfigFile("Exception!");
|
||||
}
|
||||
}
|
||||
|
||||
private static void _createNewConfigFile(string reason)
|
||||
{
|
||||
//write a new file with defaults
|
||||
LogHelper.Info<ArchetypeGlobalSettings>(string.Format("Generating a new config file reason: {0}", reason));
|
||||
|
||||
_instance.Id = Guid.NewGuid();
|
||||
_instance.CheckForUpdates = true;
|
||||
_instance.Save();
|
||||
}
|
||||
|
||||
private static Guid _getApiKey()
|
||||
{
|
||||
//this is just obfuscation and an attempt to keep out most but not the determined hacker
|
||||
var array = new []
|
||||
{
|
||||
"RTA4MUZDRjA=",
|
||||
"NzkzQS1BRDIw",
|
||||
"OTI3QjFDNjkwQTYy",
|
||||
"MjI0OQ=="
|
||||
};
|
||||
|
||||
return new Guid(string.Format("{0}-{1}-{3}-{2}",
|
||||
_decodeBase64(array[0]),
|
||||
_decodeBase64(array[1]),
|
||||
_decodeBase64(array[2]),
|
||||
_decodeBase64(array[3])
|
||||
));
|
||||
}
|
||||
|
||||
private static string _decodeBase64(string input)
|
||||
{
|
||||
return Encoding.UTF8.GetString(Convert.FromBase64String(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Archetype.TypeConverters;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Model that represents an entire Archetype.
|
||||
/// </summary>
|
||||
[JsonObject]
|
||||
[TypeConverter(typeof(ArchetypeModelConverter))]
|
||||
public class ArchetypeModel : IEnumerable<ArchetypeFieldsetModel>
|
||||
{
|
||||
[JsonProperty("fieldsets")]
|
||||
public IEnumerable<ArchetypeFieldsetModel> Fieldsets { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArchetypeModel"/> class.
|
||||
/// </summary>
|
||||
public ArchetypeModel()
|
||||
{
|
||||
Fieldsets = new List<ArchetypeFieldsetModel>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates through the collection of fieldsets.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An enumerator that can be used to iterate through the collection.
|
||||
/// </returns>
|
||||
public IEnumerator<ArchetypeFieldsetModel> GetEnumerator()
|
||||
{
|
||||
return this.Fieldsets.Where(f => f.IsAvailable()).GetEnumerator();
|
||||
}
|
||||
|
||||
//possibly obsolete?
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes for persistence. This should be used for serialization as it cleans up the JSON before saving.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Model that represents the configured Archetype options.
|
||||
/// </summary>
|
||||
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("enableMultipleOpen")]
|
||||
public bool EnableMultipleOpen { get; set; }
|
||||
|
||||
[JsonProperty("enableCloning")]
|
||||
public bool EnableCloning { get; set; }
|
||||
|
||||
[JsonProperty("enableDisabling")]
|
||||
public bool EnableDisabling { get; set; }
|
||||
|
||||
[JsonProperty("enablePublishing")]
|
||||
public bool EnablePublishing { get; set; }
|
||||
|
||||
[JsonProperty("enableCrossDragging")]
|
||||
public bool EnableCrossDragging { get; set; }
|
||||
|
||||
[JsonProperty("enableMemberGroups")]
|
||||
public bool EnableMemberGroups { get; set; }
|
||||
|
||||
[JsonProperty("hideFieldsetControls")]
|
||||
public bool HideFieldsetControls { get; set; }
|
||||
|
||||
[JsonProperty("hidePropertyLabel")]
|
||||
public bool HidePropertyLabel { get; set; }
|
||||
|
||||
[JsonProperty("minFieldsets", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public int MinFieldsets { 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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Model that represents configured Archetype fieldsets.
|
||||
/// </summary>
|
||||
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("previewImage")]
|
||||
public string PreviewImage { get; set; }
|
||||
|
||||
[JsonProperty("properties")]
|
||||
public IEnumerable<ArchetypePreValueProperty> Properties { get; set; }
|
||||
|
||||
[JsonProperty("group")]
|
||||
public ArchetypePreValueFieldsetGroup Group { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Model that represents configured groupings of Archetype fieldsets.
|
||||
/// </summary>
|
||||
public class ArchetypePreValueFieldsetGroup
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Model that represents a configured property on an Archetype fieldset.
|
||||
/// </summary>
|
||||
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,120 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Model that represents a stored property in Archetype.
|
||||
/// </summary>
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value based on the type given.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to convert the value with property value converters.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="converters">The converters.</param>
|
||||
/// <returns></returns>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Model that represents the current UmbracoEditorState
|
||||
/// </summary>
|
||||
internal class UmbracoEditorState
|
||||
{
|
||||
// container for the names of any files selected for a property in the Umbraco backend
|
||||
[JsonProperty("fileNames")]
|
||||
public IEnumerable<string> FileNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypePublishedContent : IPublishedContent
|
||||
{
|
||||
private ArchetypeFieldsetModel _fieldset;
|
||||
|
||||
private IEnumerable<IPublishedContent> _parent;
|
||||
|
||||
private readonly Dictionary<string, IPublishedProperty> _properties;
|
||||
|
||||
public ArchetypePublishedContent(ArchetypeFieldsetModel fieldset, ArchetypePublishedContentSet parent = null)
|
||||
{
|
||||
if (fieldset == null)
|
||||
throw new ArgumentNullException("fieldset");
|
||||
|
||||
_fieldset = fieldset;
|
||||
_parent = parent ?? Enumerable.Empty<IPublishedContent>();
|
||||
|
||||
_properties = fieldset.Properties
|
||||
.ToDictionary(
|
||||
x => x.Alias,
|
||||
x => new ArchetypePublishedProperty(x) as IPublishedProperty,
|
||||
StringComparer.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
internal ArchetypeFieldsetModel ArchetypeFieldset
|
||||
{
|
||||
get { return _fieldset; }
|
||||
}
|
||||
|
||||
public IEnumerable<IPublishedContent> Children
|
||||
{
|
||||
get { return Enumerable.Empty<IPublishedContent>(); }
|
||||
}
|
||||
|
||||
public IEnumerable<IPublishedContent> ContentSet
|
||||
{
|
||||
get { return _parent; }
|
||||
}
|
||||
|
||||
public PublishedContentType ContentType
|
||||
{
|
||||
get { return default(PublishedContentType); }
|
||||
}
|
||||
|
||||
public DateTime CreateDate
|
||||
{
|
||||
get { return DateTime.MinValue; }
|
||||
}
|
||||
|
||||
public int CreatorId
|
||||
{
|
||||
get { return default(int); }
|
||||
}
|
||||
|
||||
public string CreatorName
|
||||
{
|
||||
get { return default(string); }
|
||||
}
|
||||
|
||||
public string DocumentTypeAlias
|
||||
{
|
||||
get { return _fieldset.Alias; }
|
||||
}
|
||||
|
||||
public int DocumentTypeId
|
||||
{
|
||||
get { return default(int); }
|
||||
}
|
||||
|
||||
public int GetIndex()
|
||||
{
|
||||
return _parent.IndexOf(this);
|
||||
}
|
||||
|
||||
public IPublishedProperty GetProperty(string alias, bool recurse)
|
||||
{
|
||||
IPublishedProperty property;
|
||||
return _properties.TryGetValue(alias, out property) ? property : null;
|
||||
}
|
||||
|
||||
public IPublishedProperty GetProperty(string alias)
|
||||
{
|
||||
return this.GetProperty(alias, false);
|
||||
}
|
||||
|
||||
public int Id
|
||||
{
|
||||
get { return default(int); }
|
||||
}
|
||||
|
||||
public bool IsDraft
|
||||
{
|
||||
get { return _fieldset.IsAvailable() == false; }
|
||||
}
|
||||
|
||||
public PublishedItemType ItemType
|
||||
{
|
||||
get { return PublishedItemType.Content; }
|
||||
}
|
||||
|
||||
public int Level
|
||||
{
|
||||
get { return default(int); }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return default(string); }
|
||||
}
|
||||
|
||||
public IPublishedContent Parent
|
||||
{
|
||||
get { return default(IPublishedContent); }
|
||||
}
|
||||
|
||||
public string Path
|
||||
{
|
||||
get { return default(string); }
|
||||
}
|
||||
|
||||
public ICollection<IPublishedProperty> Properties
|
||||
{
|
||||
get { return _properties.Values; }
|
||||
}
|
||||
|
||||
public int SortOrder
|
||||
{
|
||||
get { return default(int); }
|
||||
}
|
||||
|
||||
public int TemplateId
|
||||
{
|
||||
get { return default(int); }
|
||||
}
|
||||
|
||||
public DateTime UpdateDate
|
||||
{
|
||||
get { return default(DateTime); }
|
||||
}
|
||||
|
||||
public string Url
|
||||
{
|
||||
get { return default(string); }
|
||||
}
|
||||
|
||||
public string UrlName
|
||||
{
|
||||
get { return default(string); }
|
||||
}
|
||||
|
||||
public Guid Version
|
||||
{
|
||||
get { return Guid.Empty; }
|
||||
}
|
||||
|
||||
public int WriterId
|
||||
{
|
||||
get { return default(int); }
|
||||
}
|
||||
|
||||
public string WriterName
|
||||
{
|
||||
get { return default(string); }
|
||||
}
|
||||
|
||||
public object this[string alias]
|
||||
{
|
||||
get
|
||||
{
|
||||
var property = this.GetProperty(alias);
|
||||
|
||||
return property == null
|
||||
? null
|
||||
: property.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypePublishedContentSet : IEnumerable<ArchetypePublishedContent>
|
||||
{
|
||||
private IEnumerable<ArchetypePublishedContent> _items { get; set; }
|
||||
|
||||
public ArchetypePublishedContentSet(ArchetypeModel archetype)
|
||||
{
|
||||
if (archetype == null)
|
||||
throw new ArgumentNullException("archetype");
|
||||
|
||||
this.ArchetypeModel = archetype;
|
||||
|
||||
var count = archetype.Fieldsets.Count();
|
||||
|
||||
_items = archetype.Fieldsets
|
||||
.Where(x => x.IsAvailable())
|
||||
.Select(x => new ArchetypePublishedContent(x, this))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
internal ArchetypeModel ArchetypeModel { get; private set; }
|
||||
|
||||
public IEnumerator<ArchetypePublishedContent> GetEnumerator()
|
||||
{
|
||||
return _items.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using Archetype.Extensions;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypePublishedProperty : IPublishedProperty
|
||||
{
|
||||
private readonly object _rawValue;
|
||||
private readonly Lazy<object> _sourceValue;
|
||||
private readonly Lazy<object> _objectValue;
|
||||
private readonly Lazy<object> _xpathValue;
|
||||
private readonly ArchetypePropertyModel _property;
|
||||
private readonly PublishedPropertyType _propertyType;
|
||||
|
||||
public ArchetypePublishedProperty(ArchetypePropertyModel property)
|
||||
{
|
||||
if (property == null)
|
||||
throw new ArgumentNullException("property");
|
||||
|
||||
var preview = false;
|
||||
|
||||
_property = property;
|
||||
_rawValue = property.Value;
|
||||
|
||||
// #418 - need to wrap this in a try/catch to prevent orphaned properties from breaking everything
|
||||
try
|
||||
{
|
||||
_propertyType = property.CreateDummyPropertyType();
|
||||
|
||||
if (_propertyType != null)
|
||||
{
|
||||
_sourceValue = new Lazy<object>(() => _propertyType.ConvertDataToSource(_rawValue, preview));
|
||||
_objectValue = new Lazy<object>(() => _propertyType.ConvertSourceToObject(_sourceValue.Value, preview));
|
||||
_xpathValue = new Lazy<object>(() => _propertyType.ConvertSourceToXPath(_sourceValue.Value, preview));
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
LogHelper.Warn<ArchetypePublishedProperty>(string.Format("Could not create an IPublishedProperty for property: {0} - the error was: {1}", property.Alias, ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
internal ArchetypePropertyModel ArchetypeProperty
|
||||
{
|
||||
get { return _property; }
|
||||
}
|
||||
|
||||
public object DataValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return _sourceValue != null
|
||||
? _sourceValue.Value
|
||||
: _rawValue;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return _rawValue != null && !string.IsNullOrEmpty(_rawValue.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public string PropertyTypeAlias
|
||||
{
|
||||
get { return _property.Alias; }
|
||||
}
|
||||
|
||||
public object Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return _objectValue != null
|
||||
? _objectValue.Value
|
||||
: _rawValue;
|
||||
}
|
||||
}
|
||||
|
||||
public object XPathValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return _xpathValue != null
|
||||
? _xpathValue.Value
|
||||
: _rawValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Archetype.Models
|
||||
{
|
||||
public class ArchetypeUpdateNotification
|
||||
{
|
||||
public bool IsUpdateAvailable { get; set; }
|
||||
public string Headline { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string Message { get; set; }
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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>();
|
||||
}
|
||||
|
||||
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))
|
||||
return default(T);
|
||||
|
||||
var convertAttempt = property.Value.TryConvertTo<T>();
|
||||
|
||||
if (convertAttempt.Success)
|
||||
return convertAttempt.Result;
|
||||
|
||||
return default(T);
|
||||
}
|
||||
|
||||
private Property GetProperty(string propertyAlias)
|
||||
{
|
||||
return Properties.FirstOrDefault(p => p.Alias.InvariantEquals(propertyAlias));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
{
|
||||
public class Property
|
||||
{
|
||||
public string Alias { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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("Kevin Giszewski LLC")]
|
||||
[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.17.1")]
|
||||
[assembly: AssemblyFileVersion("1.17.1")]
|
||||
@@ -1,46 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Archetype.Umbraco.Models;
|
||||
using Archetype.Umbraco.Extensions;
|
||||
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
var archetype = JsonConvert.DeserializeObject <Archetype.Umbraco.Models.Archetype> (sourceString);
|
||||
return archetype;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return sourceString;
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Default property value converter that models the JSON to a C# object.
|
||||
/// </summary>
|
||||
[PropertyValueType(typeof(Models.ArchetypeModel))]
|
||||
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
|
||||
public class ArchetypeValueConverter : PropertyValueConverterBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the services.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The services.
|
||||
/// </value>
|
||||
public ServiceContext Services
|
||||
{
|
||||
get { return ApplicationContext.Current.Services; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified property type is converter for Archetype.
|
||||
/// </summary>
|
||||
/// <param name="propertyType">Type of the property.</param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the data to source.
|
||||
/// </summary>
|
||||
/// <param name="propertyType">Type of the property.</param>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <param name="preview">if set to <c>true</c> [preview].</param>
|
||||
/// <returns></returns>
|
||||
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,278 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Extensions;
|
||||
using Archetype.Models;
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// C# representation of the property editor. This is often done with package manifest instead.
|
||||
/// </summary>
|
||||
[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
|
||||
|
||||
/// <summary>
|
||||
/// Creates a pre value editor instance
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected override PreValueEditor CreatePreValueEditor()
|
||||
{
|
||||
return new ArchetypePreValueEditor();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class that represents the prevalue editor. This is often done with a package manifest instead.
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// Creates a value editor instance
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected override PropertyValueEditor CreateValueEditor()
|
||||
{
|
||||
return new ArchetypePropertyValueEditor(base.CreateValueEditor());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class that represents the actual data editor. This is often done with a package manifest instead.
|
||||
/// </summary>
|
||||
internal class ArchetypePropertyValueEditor : PropertyValueEditorWrapper
|
||||
{
|
||||
protected JsonSerializerSettings _jsonSettings;
|
||||
|
||||
public ArchetypePropertyValueEditor(PropertyValueEditor wrapped)
|
||||
: base(wrapped)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the property value for use in the front-end cache
|
||||
/// </summary>
|
||||
/// <param name="property"></param>
|
||||
/// <param name="propertyType"></param>
|
||||
/// <param name="dataTypeService"></param>
|
||||
/// <returns></returns>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A method used to format the database value to a value that can be used by the editor
|
||||
/// </summary>
|
||||
/// <param name="property"></param>
|
||||
/// <param name="propertyType"></param>
|
||||
/// <param name="dataTypeService"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// The object returned will automatically be serialized into json notation. For most property editors
|
||||
/// the value returned is probably just a string but in some cases a json structure will be returned.
|
||||
/// </remarks>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A method to deserialize the string value that has been saved in the content editor
|
||||
/// to an object to be stored in the database.
|
||||
/// </summary>
|
||||
/// <param name="editorValue"></param>
|
||||
/// <param name="currentValue">The current value that has been persisted to the database for this editor. This value may be usesful for
|
||||
/// how the value then get's deserialized again to be re-persisted. In most cases it will probably not be used.</param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// By default this will attempt to automatically convert the string value to the value type supplied by ValueType.
|
||||
/// If overridden then the object returned must match the type supplied in the ValueType, otherwise persisting the
|
||||
/// value to the DB will fail when it tries to validate the value type.
|
||||
/// </remarks>
|
||||
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)
|
||||
{
|
||||
// make sure the publishing dates are in UTC
|
||||
fieldset.ReleaseDate = EnsureUtcDate(fieldset.ReleaseDate);
|
||||
fieldset.ExpireDate = EnsureUtcDate(fieldset.ExpireDate);
|
||||
|
||||
// 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(fileName =>
|
||||
uploadedFiles.FirstOrDefault(u => u.FileName != null &&
|
||||
// #384, #389 and #394 - look for "safe" file names (using the ToSafeFileName() extension)
|
||||
// - for backwards compatibility we'll look for the raw filename as well as the "safe" file name
|
||||
(u.FileName.Equals(fileName, StringComparison.OrdinalIgnoreCase) || u.FileName.Equals(fileName.ToSafeFileName(), StringComparison.OrdinalIgnoreCase))
|
||||
)
|
||||
).Where(f => f != null).ToList();
|
||||
if(propertyFiles.Any())
|
||||
{
|
||||
additionalData["files"] = propertyFiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
// #397 - pass along "cuid" and "puid" (part of the Umbraco 7.6 scheme)
|
||||
if(editorValue.AdditionalData.ContainsKey("cuid"))
|
||||
{
|
||||
additionalData["cuid"] = editorValue.AdditionalData["cuid"];
|
||||
}
|
||||
if(editorValue.AdditionalData.ContainsKey("puid"))
|
||||
{
|
||||
additionalData["puid"] = editorValue.AdditionalData["puid"];
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property editor.
|
||||
/// </summary>
|
||||
/// <param name="dtd">The DTD.</param>
|
||||
/// <returns></returns>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensures that a datetime is in UTC
|
||||
/// </summary>
|
||||
/// <param name="dateTime">The datetime</param>
|
||||
/// <returns>The datetime in UTC (or null if it's not set)</returns>
|
||||
private DateTime? EnsureUtcDate(DateTime? dateTime)
|
||||
{
|
||||
if(dateTime.HasValue == false || dateTime.Value.Kind == DateTimeKind.Utc)
|
||||
{
|
||||
return dateTime;
|
||||
}
|
||||
return new DateTime(dateTime.Value.Ticks, DateTimeKind.Utc);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using Archetype.Extensions;
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Archetype.TypeConverters
|
||||
{
|
||||
public class ArchetypeFieldsetModelConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
if (destinationType == typeof(IPublishedContent) ||
|
||||
destinationType == typeof(ArchetypePublishedContent))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
// NOTE: The converter needs to return false here, otherwise `ArchetypeHelper.DeserializeJsonToArchetype` fails.
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (value is ArchetypeFieldsetModel && (destinationType == typeof(IPublishedContent) || destinationType == typeof(ArchetypePublishedContent)))
|
||||
{
|
||||
return ((ArchetypeFieldsetModel)value).ToPublishedContent();
|
||||
}
|
||||
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using Archetype.Extensions;
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Archetype.TypeConverters
|
||||
{
|
||||
public class ArchetypeModelConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
if (destinationType == typeof(ArchetypePublishedContentSet) ||
|
||||
destinationType == typeof(IEnumerable<IPublishedContent>))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (value is ArchetypeModel && (destinationType == typeof(ArchetypePublishedContentSet) || destinationType == typeof(IEnumerable<IPublishedContent>)))
|
||||
{
|
||||
return ((ArchetypeModel)value).ToPublishedContentSet();
|
||||
}
|
||||
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,22 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "Textstring",
|
||||
"path": "/umbraco/views/propertyeditors/textbox/textbox.html"
|
||||
},
|
||||
{
|
||||
"name": "Content Picker",
|
||||
"path": "/umbraco/views/propertyeditors/contentpicker/contentpicker.html"
|
||||
},
|
||||
{
|
||||
"name": "Boolean",
|
||||
"path": "/umbraco/views/propertyeditors/boolean/boolean.html"
|
||||
},
|
||||
{
|
||||
"name": "Checkbox List",
|
||||
"path": "/umbraco/views/propertyeditors/checkboxlist/checkboxlist.html"
|
||||
},
|
||||
{
|
||||
"name": "Radio Buttons",
|
||||
"path": "/umbraco/views/propertyeditors/radiobuttons/radiobuttons.html"
|
||||
}
|
||||
]
|
||||
@@ -1,21 +1,51 @@
|
||||
angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, propertyEditorService) {
|
||||
|
||||
//$scope.model.value = "";
|
||||
//console.log($scope.model.value);
|
||||
angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource, archetypeGlobalConfigService, notificationsService) {
|
||||
|
||||
var newPropertyModel = '{alias: "", remove: false, collapse: false, label: "", helpText: "", view: "", value: "", config: ""}';
|
||||
var newFieldsetModel = '{alias: "", remove: false, collapse: false, labelTemplate: "", tooltip: "", icon: "", label: "", headerText: "", footerText: "", properties:[' + newPropertyModel + ']}';
|
||||
var defaultFieldsetConfigModel = eval("({showAdvancedOptions: false, hideFieldsetToolbar: false, enableMultipleFieldsets: false, hideFieldsetControls: false, hideFieldsetLabels: false, hidePropertyLabel: false, maxFieldsets: null, fieldsets: [" + newFieldsetModel + "]})");
|
||||
|
||||
//$scope.model.value = "";
|
||||
//console.log($scope.model.value);
|
||||
|
||||
//define empty items
|
||||
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, "enableMultipleOpen": true, "enableCloning": false, "enableDisabling": true, "enableDeepDatatypeRequests": false, "enablePublishing": false, "enableMemberGroups": false, "enableCrossDragging": 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;
|
||||
});
|
||||
|
||||
archetypeGlobalConfigService.checkForUpdates().then(function(data) {
|
||||
if(data.isUpdateAvailable) {
|
||||
notificationsService.add({
|
||||
headline: data.headline,
|
||||
type: data.type,
|
||||
message: data.message,
|
||||
url: data.url
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//ini the render model
|
||||
initConfigRenderModel();
|
||||
|
||||
//get the available views
|
||||
propertyEditorService.getViews().then(function(data){
|
||||
$scope.availableViews = data;
|
||||
//get the available datatypes
|
||||
archetypePropertyEditorResource.getAllDataTypes().then(function(data) {
|
||||
$scope.availableDataTypes = data;
|
||||
});
|
||||
|
||||
|
||||
//iconPicker
|
||||
$scope.selectIcon = function(fieldset){
|
||||
var dialog = dialogService.iconPicker({
|
||||
callback: function(data){
|
||||
fieldset.icon = data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//config for the sorting
|
||||
$scope.sortableOptions = {
|
||||
axis: 'y',
|
||||
cursor: "move",
|
||||
@@ -27,19 +57,27 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// added to track loaded fieldsets
|
||||
$scope.loadedFieldsets = [];
|
||||
$scope.isLoaded = function (fieldset) {
|
||||
return $scope.loadedFieldsets.indexOf(fieldset) >= 0;
|
||||
}
|
||||
|
||||
//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)
|
||||
{
|
||||
fieldset.collapse = false;
|
||||
$scope.loadedFieldsets.push(fieldset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,20 +88,24 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
else
|
||||
{
|
||||
fieldset.collapse = false;
|
||||
$scope.loadedFieldsets.push(fieldset);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if(iniState)
|
||||
{
|
||||
fieldset.collapse = !iniState;
|
||||
$scope.loadedFieldsets.push(fieldset);
|
||||
}
|
||||
}
|
||||
//ini
|
||||
|
||||
//ini the fieldsets
|
||||
$scope.focusFieldset();
|
||||
|
||||
//function that determines how to manage expanding/collapsing properties
|
||||
$scope.focusProperty = function(properties, property){
|
||||
var iniState;
|
||||
|
||||
|
||||
if(property)
|
||||
{
|
||||
iniState = property.collapse;
|
||||
@@ -79,33 +121,49 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
property.collapse = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if(iniState)
|
||||
{
|
||||
property.collapse = !iniState;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ini the properties
|
||||
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
|
||||
$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;
|
||||
}
|
||||
}, true);
|
||||
|
||||
});
|
||||
|
||||
$scope.autoPopulateAlias = function (modelProperty) {
|
||||
if (modelProperty && !modelProperty.aliasIsDirty) {
|
||||
modelProperty.alias = modelProperty.label.toUmbracoAlias();
|
||||
}
|
||||
}
|
||||
|
||||
$scope.markAliasDirty = function (modelProperty) {
|
||||
if (modelProperty && !modelProperty.aliasIsDirty) {
|
||||
modelProperty.aliasIsDirty = true;;
|
||||
}
|
||||
}
|
||||
|
||||
//helper that returns if an item can be removed
|
||||
$scope.canRemoveFieldset = function ()
|
||||
{
|
||||
{
|
||||
return countVisibleFieldset() > 1;
|
||||
}
|
||||
|
||||
@@ -114,10 +172,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;
|
||||
}
|
||||
|
||||
@@ -126,7 +184,18 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
{
|
||||
return countVisibleProperty(fieldset) > 1;
|
||||
}
|
||||
|
||||
|
||||
$scope.getDataTypeNameByGuid = function (guid) {
|
||||
if ($scope.availableDataTypes == null) // Might not be initialized yet?
|
||||
return "";
|
||||
|
||||
var dataType = _.find($scope.availableDataTypes, function(d) {
|
||||
return d.guid == guid;
|
||||
});
|
||||
|
||||
return dataType == null ? "" : dataType.name;
|
||||
}
|
||||
|
||||
//helper to count what is visible
|
||||
function countVisibleFieldset()
|
||||
{
|
||||
@@ -140,7 +209,8 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
//determines how many properties are visible
|
||||
function countVisibleProperty(fieldset)
|
||||
{
|
||||
var count = 0;
|
||||
@@ -153,13 +223,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, eval("(" + newFieldsetModel + ")"));
|
||||
$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()) {
|
||||
@@ -168,12 +238,12 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//handles a property add
|
||||
$scope.addPropertyRow = function (fieldset, $index) {
|
||||
fieldset.properties.splice($index + 1, 0, eval("(" + newPropertyModel + ")"));
|
||||
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)) {
|
||||
@@ -182,15 +252,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)
|
||||
{
|
||||
@@ -199,41 +281,61 @@ 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) {
|
||||
// replace the entire render model if it was changed (in developer options)
|
||||
if (data.model && data.modelChanged) {
|
||||
$scope.archetypeConfigRenderModel = data.model;
|
||||
}
|
||||
},
|
||||
dialogData: { model: $scope.archetypeConfigRenderModel }
|
||||
});
|
||||
}
|
||||
|
||||
//archetype css
|
||||
assetsService.loadCss("/App_Plugins/Archetype/css/archetype.css");
|
||||
assetsService.loadCss("../App_Plugins/Archetype/css/archetype.css");
|
||||
});
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) {
|
||||
|
||||
//handles a fieldset group add
|
||||
$scope.addFieldsetGroup = function () {
|
||||
$scope.dialogData.model.fieldsetGroups.push({ name: "" });
|
||||
}
|
||||
|
||||
//handles a fieldset group removal
|
||||
$scope.removeFieldsetGroup = function ($index) {
|
||||
$scope.dialogData.model.fieldsetGroups.splice($index, 1);
|
||||
}
|
||||
|
||||
$scope.apply = function(index) {
|
||||
$scope.submit($scope.dialogData);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
angular.module('umbraco').controller('ArchetypeConfigGlobalOptionsController', function ($scope, archetypeGlobalConfigService) {
|
||||
$scope.globalSettings = {};
|
||||
|
||||
$scope.confirmCheckNewVersionChange = function() {
|
||||
archetypeGlobalConfigService.setCheckForUpdates($scope.globalSettings.checkForNewVersion);
|
||||
}
|
||||
|
||||
function getGlobalSettings()
|
||||
{
|
||||
archetypeGlobalConfigService.globalSettings().then(function(data) {
|
||||
$scope.globalSettings.checkForNewVersion = data.isCheckingForUpdates;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
function init()
|
||||
{
|
||||
getGlobalSettings();
|
||||
}
|
||||
});
|
||||
+860
-192
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
angular.module("umbraco.directives").directive('archetypeLocalize', function (archetypeLocalizationService) {
|
||||
var linker = function (scope, element, attrs){
|
||||
|
||||
var key = scope.key;
|
||||
|
||||
archetypeLocalizationService.localize(key).then(function(value){
|
||||
if(value){
|
||||
element.html(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: "E",
|
||||
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,130 +1,203 @@
|
||||
angular.module("umbraco").directive('archetypeProperty', function ($compile, $http) {
|
||||
|
||||
function getFieldsetByAlias(fieldsets, alias)
|
||||
{
|
||||
for (var i in fieldsets)
|
||||
{
|
||||
if (fieldsets[i].alias == alias)
|
||||
{
|
||||
return fieldsets[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
angular.module("umbraco.directives").directive('archetypeProperty', function ($compile, $http, archetypePropertyEditorResource, umbPropEditorHelper, $timeout, $rootScope, $q, fileManager, editorState, archetypeService) {
|
||||
|
||||
function getPropertyIdByAlias(properties, alias)
|
||||
{
|
||||
for (var i in properties)
|
||||
{
|
||||
if (properties[i].alias == alias) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var linker = function (scope, element, attrs) {
|
||||
|
||||
var configFieldsetModel = getFieldsetByAlias(scope.archetypeConfig.fieldsets, scope.fieldset.alias);
|
||||
|
||||
var view = configFieldsetModel.properties[scope.propertyConfigIndex].view;
|
||||
var linker = function (scope, element, attrs, ngModelCtrl) {
|
||||
var configFieldsetModel = archetypeService.getFieldsetByAlias(scope.archetypeConfig.fieldsets, scope.fieldset.alias);
|
||||
var view = "";
|
||||
var label = configFieldsetModel.properties[scope.propertyConfigIndex].label;
|
||||
var config = configFieldsetModel.properties[scope.propertyConfigIndex].config;
|
||||
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 config to a JS object
|
||||
if(config && typeof config == 'string'){
|
||||
try{
|
||||
if(scope.archetypeConfig.developerMode == '1'){
|
||||
console.log("Trying to eval config: " + config);
|
||||
}
|
||||
config = eval("(" + config + ")");
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
if(scope.archetypeConfig.developerMode == '1'){
|
||||
console.log("Failed to eval config.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(config && scope.archetypeConfig.developerMode == '1'){
|
||||
console.log("Config post-eval: " + config);
|
||||
}
|
||||
|
||||
//try to convert the defaultValue to a JS object
|
||||
if(defaultValue && typeof defaultValue == 'string'){
|
||||
try{
|
||||
if(scope.archetypeConfig.developerMode == '1'){
|
||||
console.log("Trying to eval default value: " + defaultValue);
|
||||
}
|
||||
defaultValue = eval("(" + defaultValue + ")");
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
if(scope.archetypeConfig.developerMode == '1'){
|
||||
console.log("Failed to eval defaultValue.");
|
||||
}
|
||||
}
|
||||
}
|
||||
defaultValue = archetypeService.jsonOrString(defaultValue, scope.archetypeConfig.developerMode, "defaultValue");
|
||||
|
||||
if(defaultValue && scope.archetypeConfig.developerMode == '1'){
|
||||
console.log("Default value post-eval: " + defaultValue);
|
||||
}
|
||||
//grab info for the selected datatype, prepare for view
|
||||
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;
|
||||
|
||||
//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') && propertyEditor.defaultPreValues != null) {
|
||||
_.extend(defaultConfigObj, propertyEditor.defaultPreValues);
|
||||
}
|
||||
|
||||
var mergedConfig = _.extend(defaultConfigObj, config);
|
||||
|
||||
loadView(pathToView, mergedConfig, defaultValue, alias, propertyAlias, scope, element, ngModelCtrl, configFieldsetModel);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
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')
|
||||
{
|
||||
console.log(scope);
|
||||
}
|
||||
|
||||
var rawTemplate = data;
|
||||
|
||||
//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 = getPropertyIdByAlias(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(eval("({alias: '" + alias + "', value:'" + defaultValue + "'})"));
|
||||
renderModelPropertyIndex = getPropertyIdByAlias(scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties, alias);
|
||||
var propertyValue = { alias: alias, value: defaultValue };
|
||||
archetypeService.getFieldset(scope).properties.push(propertyValue);
|
||||
scope.renderModelPropertyIndex = archetypeService.getPropertyIndexByAlias(archetypeService.getFieldset(scope).properties, alias);
|
||||
}
|
||||
|
||||
scope.renderModel = {};
|
||||
scope.model.value = archetypeService.getFieldsetProperty(scope).value;
|
||||
|
||||
// init the property editor state (while ensuring the temporary ID is retained
|
||||
// from any prior initializations).
|
||||
var fieldsetProperty = archetypeService.getFieldsetProperty(scope);
|
||||
var oldState = fieldsetProperty.editorState;
|
||||
archetypeService.ensureTemporaryId(fieldsetProperty);
|
||||
if (oldState) {
|
||||
fieldsetProperty.editorState.temporaryId = oldState.temporaryId;
|
||||
}
|
||||
scope.model.value = scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties[renderModelPropertyIndex].value;
|
||||
|
||||
//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";
|
||||
}
|
||||
}
|
||||
|
||||
//hacks for various built-in datatyps including upload, colorpicker and tags
|
||||
if (!scope.propertyForm) {
|
||||
scope.propertyForm = scope.form;
|
||||
}
|
||||
if (!scope.model.validation) {
|
||||
scope.model.validation = {};
|
||||
scope.model.validation.mandatory = 0;
|
||||
}
|
||||
|
||||
//some items need an alias
|
||||
scope.model.alias = "scope-" + scope.$id;
|
||||
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;
|
||||
|
||||
// notify the linker that the property value changed
|
||||
archetypeService.propertyValueChanged(archetypeService.getFieldset(scope), archetypeService.getFieldsetProperty(scope));
|
||||
});
|
||||
|
||||
element.html(rawTemplate).show();
|
||||
scope.$on('archetypeFormSubmitting', function (ev, args) {
|
||||
// #385 - revert the changes made in #311 to avoid publishing invalid fieldsets (leaving the code from #311 here, in case we figure out how to re-introduce "save as draft")
|
||||
// if(args.action !== 'save') {
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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,25 @@
|
||||
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.loadCallback() : 0;
|
||||
|
||||
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(args);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: "E",
|
||||
replace: true,
|
||||
link: linker,
|
||||
template: "",
|
||||
scope: {
|
||||
loadCallback: '=',
|
||||
submitCallback: '=',
|
||||
activeSubmitWatcher: '='
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,51 @@
|
||||
//create a namespace (optional)
|
||||
var ArchetypeSampleLabelHelpers = {};
|
||||
|
||||
//create a function
|
||||
//you will add it to your label template field as `{{ArchetypeSampleLabelHelpers.testPromise(someArchetypePropertyAlias)}}`
|
||||
ArchetypeSampleLabelHelpers.testPromise = function(value) {
|
||||
//you can inject services
|
||||
return function ($timeout, archetypeCacheService) {
|
||||
//best to return a promise
|
||||
//NOTE: $timeout returns a promise
|
||||
return $timeout(function () {
|
||||
return "As Promised: " + value;
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
ArchetypeSampleLabelHelpers.testEntityPromise = function(value, scope, args) {
|
||||
//hey look, args!
|
||||
//{{ArchetypeSampleLabelHelpers.testEntityPromise(someArchetypePropertyAlias, {foo: 1})}}
|
||||
console.log(args);
|
||||
|
||||
return function ($q, entityResource) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
entityResource.getById(args.foo, 'document').then(function(entity) {
|
||||
console.log("Hello from testEntityPromise");
|
||||
console.log(entity);
|
||||
deferred.resolve(entity.name);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
}
|
||||
|
||||
ArchetypeSampleLabelHelpers.testEntityPromise2 = function(value, scope, args) {
|
||||
//hey look, args but we're also using the built-in archetypeCacheService
|
||||
//{{ArchetypeSampleLabelHelpers.testEntityPromise(someArchetypePropertyAlias, {foo: 1234})}}
|
||||
console.log(args);
|
||||
|
||||
return function ($q, archetypeCacheService) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
archetypeCacheService.getEntityById(args.foo, 'document').then(function(entity) {
|
||||
console.log("Hello from testEntityPromise2");
|
||||
console.log(entity);
|
||||
deferred.resolve(entity.name);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"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",
|
||||
"enablePublishing": "Aktivér fieldset-publicering?",
|
||||
"enablePublishingDescription": "Tillad automatisk udgivelse og udløb for fieldsets",
|
||||
"publish": "Publicering",
|
||||
"publishHelpText": "Konfigurér udgivelses- og udløbsdato for dette element",
|
||||
"publishReleaseDate": "Udgivelsesdato",
|
||||
"publishExpireDate": "Udløbsdato",
|
||||
"settings": "Indstillinger",
|
||||
"enableMemberGroups": "Aktivér medlems-grupper",
|
||||
"enableMemerGroupsDescription": "Tillad at fieldsets kun vises for specifikke medlems-grupper",
|
||||
"allowedMemberGroups": "Tilladte medlems-grupper",
|
||||
"allowedMemberGroupsHelpText": "Vælg de medlems-grupper, der skal kunne se dette element. Hvis der ikke er valgt nogen, kan alle se elementet.",
|
||||
"previewFieldsetOpen": "(se eksempel)",
|
||||
"previewFieldsetHeader": "Eksempel: ",
|
||||
"previewFieldsetClose": "(luk eksempel)"
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"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",
|
||||
"enablePublishing": "Aktivér fieldset-publicering?",
|
||||
"enablePublishingDescription": "Tillad automatisk udgivelse og udløb for fieldsets",
|
||||
"publish": "Publicering",
|
||||
"publishHelpText": "Konfigurér udgivelses- og udløbsdato for dette element",
|
||||
"publishReleaseDate": "Udgivelsesdato",
|
||||
"publishExpireDate": "Udløbsdato",
|
||||
"settings": "Indstillinger",
|
||||
"enableMemberGroups": "Aktivér medlems-grupper",
|
||||
"enableMemerGroupsDescription": "Tillad at fieldsets kun vises for specifikke medlems-grupper",
|
||||
"allowedMemberGroups": "Tilladte medlems-grupper",
|
||||
"allowedMemberGroupsHelpText": "Vælg de medlems-grupper, der skal kunne se dette element. Hvis der ikke er valgt nogen, kan alle se elementet.",
|
||||
"previewFieldsetOpen": "(se eksempel)",
|
||||
"previewFieldsetHeader": "Eksempel: ",
|
||||
"previewFieldsetClose": "(luk eksempel)"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"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.",
|
||||
"enableCrossDragging":"Enable Cross-Archetype Dragging?",
|
||||
"enableCrossDraggingDescription":"Allows fieldsets to be dragged into other Archetypes.",
|
||||
"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,50 @@
|
||||
{
|
||||
"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.",
|
||||
"enableCrossDragging":"Enable Cross-Archetype Dragging?",
|
||||
"enableCrossDraggingDescription":"Allows fieldsets to be dragged into other Archetypes.",
|
||||
"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,50 @@
|
||||
{
|
||||
"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.",
|
||||
"enableCrossDragging":"Enable Cross-Archetype Dragging?",
|
||||
"enableCrossDraggingDescription":"Allows fieldsets to be dragged into other Archetypes.",
|
||||
"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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
+708
-176
@@ -1,190 +1,722 @@
|
||||
.archetypeEditor fieldset{
|
||||
border: 1px solid #666;
|
||||
padding: 5px;
|
||||
margin-bottom: 5px;
|
||||
background-color: #fff;
|
||||
clear: both;
|
||||
}
|
||||
{{VERSION}}
|
||||
|
||||
.archetypeEditor label{
|
||||
width: 75px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.archetypeEditor fieldset>label{
|
||||
float: left;
|
||||
width: 200px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.archetypeEditor .multiPropertyTextbox{
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.archetypeEditor ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeEditorControls{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeProperty{
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.archetypeEditor .umb-contentpicker{
|
||||
margin-left: 60px;
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeDeveloperModel
|
||||
{
|
||||
.archetypeEditor {
|
||||
width: 98%;
|
||||
min-height: 100px;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid red;
|
||||
|
||||
.usky-grid {
|
||||
.cell-tools-menu {
|
||||
height: 385px;
|
||||
}
|
||||
&.withGroups {
|
||||
.cell-tools-menu {
|
||||
height: 415px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.open {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
top: auto;
|
||||
> li > a {
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.controls-no-label {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
a+ul.dropdown-menu {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.fieldsetIcon {
|
||||
float: left;
|
||||
padding: 0 10px 0 0;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.caret {
|
||||
margin: 8px 1px 0 2px;
|
||||
&.caret-right {
|
||||
border-bottom: 4px solid transparent;
|
||||
border-top: 4px solid transparent;
|
||||
border-left: 4px solid #ddd;
|
||||
content: "";
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border-bottom: 1px dashed #dddddd;
|
||||
padding: 0;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.publishOptions {
|
||||
.publishDate {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 20px;
|
||||
|
||||
label {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeFieldsetLabel {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background: white;
|
||||
|
||||
.label-sub {
|
||||
padding: 18px 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 {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 0;
|
||||
margin-left: 18px;
|
||||
padding: 0;
|
||||
display: block;
|
||||
span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-height: 40px;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
display: -webkit-box;
|
||||
}
|
||||
}
|
||||
|
||||
&.dimmed {
|
||||
label {
|
||||
color: #d9d9d9 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditorControls {
|
||||
float: none;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
opacity: 0;
|
||||
transition: opacity .15s ease-in-out;
|
||||
-moz-transition: opacity .15s ease-in-out;
|
||||
-webkit-transition: opacity .15s ease-in-out;
|
||||
background: white;
|
||||
|
||||
&:before {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: -40px;
|
||||
width: 40px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background: -webkit-linear-gradient(90deg, rgba(255,255,255,0), white);
|
||||
background: -moz-linear-gradient(90deg, rgba(255,255,255,0), white);
|
||||
background: linear-gradient(90deg, rgba(255,255,255,0), white);
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: inline-block;
|
||||
height: 28px;
|
||||
width: 28px;
|
||||
line-height: 28px;
|
||||
border-radius: 14px;
|
||||
border: 1px solid #d6d6d6;
|
||||
color: #5f5f5f;
|
||||
background: white;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-left: 8px;
|
||||
|
||||
&:hover {
|
||||
background: #f3f3f5;
|
||||
}
|
||||
&.icon-trash:hover {
|
||||
background: #fe5b57;
|
||||
border-color: #fe5b57;
|
||||
color: white;
|
||||
}
|
||||
&.icon-disabled {
|
||||
cursor: default;
|
||||
&:hover {
|
||||
color: #ddd;
|
||||
background: white;
|
||||
}
|
||||
}
|
||||
&.icon-active {
|
||||
color: #bbb;
|
||||
&:hover {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover .archetypeEditorControls {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&.is-open > .archetypeFieldsetLabel .archetypeEditorControls {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.archetypePropertyError {
|
||||
margin-bottom: 5px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
|
||||
label {
|
||||
|
||||
span {
|
||||
color: #b94a48;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeCollapser {
|
||||
clear: both;
|
||||
height: 100%;
|
||||
padding: 24px 20px 0 20px;
|
||||
background-color: #fafafa;
|
||||
border-top: 1px dashed #e0e0e0;
|
||||
line-height: 20px;
|
||||
|
||||
.archetypeFieldsetLabel {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.archetypeEditorControls {
|
||||
background: #fafafa;
|
||||
|
||||
&:before {
|
||||
background: -webkit-linear-gradient(90deg, rgba(250,250,250,0), #fafafa);
|
||||
background: -moz-linear-gradient(90deg, rgba(250,250,250,0), #fafafa);
|
||||
background: linear-gradient(90deg, rgba(250,250,250,0), #fafafa);
|
||||
}
|
||||
}
|
||||
|
||||
form {
|
||||
margin-left:20px;
|
||||
|
||||
.control-label {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeFieldsetHelpText {
|
||||
clear:both;
|
||||
margin-bottom: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeDeveloperModel
|
||||
{
|
||||
font-family: monospace;
|
||||
width: 98%;
|
||||
min-height: 100px;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.archetypeFieldsetError {
|
||||
border: 1px solid #b94a48;
|
||||
}
|
||||
|
||||
.archetypeFooter {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.archetypeAddButton {
|
||||
display: inline-block;
|
||||
height: 28px;
|
||||
width: 28px;
|
||||
line-height: 28px;
|
||||
border-radius: 14px;
|
||||
border: 1px solid #b6b6b6;
|
||||
color: #5f5f5f;
|
||||
background: white;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: #00aea2;
|
||||
border-color: #00aea2;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEmptyContent {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
clear: both;
|
||||
font-size: 14px;
|
||||
color: #555;
|
||||
background: #f8f8f8;
|
||||
border-radius: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeCrossDraggable + .archetypeEmptyContent {
|
||||
margin-top: -42px;
|
||||
}
|
||||
|
||||
&.archetypeDragging .archetypeCrossDraggable + .archetypeEmptyContent {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Necessary to ensure empty lists can be dropped onto when sorting nested fieldsets.
|
||||
.archetypeSortable.archetypeEmpty.archetypeCrossDraggable {
|
||||
min-height: 40px;
|
||||
border: 1px dashed transparent;
|
||||
}
|
||||
|
||||
&.archetypeDragging .archetypeSortable.archetypeEmpty.archetypeCrossDraggable {
|
||||
min-height: 56px;
|
||||
border-color: #dddddd;
|
||||
}
|
||||
|
||||
|
||||
.archetypeCollapser .archetypeEmptyContent span {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.multiPropertyTextbox {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
}
|
||||
li {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.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;
|
||||
.fieldsetPreviewOpen {
|
||||
font-style: italic;
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fieldsetPreview {
|
||||
.fieldsetPreviewClose {
|
||||
font-style: italic;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
.fieldsetPreviewImage {
|
||||
padding: 6px 0px;
|
||||
img {
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.settingsWrapper {
|
||||
&:hover {
|
||||
caret {
|
||||
background-color: #333;
|
||||
}
|
||||
}
|
||||
.settingsHeader {
|
||||
label {
|
||||
display: inline-block;
|
||||
}
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
label {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.caret-right {
|
||||
border-left-color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.settings {
|
||||
padding: 14px;
|
||||
background-color: #f8f8f8;
|
||||
overflow: hidden;
|
||||
|
||||
.allowedGroups {
|
||||
.umb-membergrouppicker a {
|
||||
i {
|
||||
padding-right: 0;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
&:hover i {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetToolbar {
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetToolbar li {
|
||||
float: left;
|
||||
padding: 2px 4px;
|
||||
margin-right: 10px;
|
||||
border: 1px solid #ddd;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.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;
|
||||
.archetypeEditor, .archetypeConfig {
|
||||
.archetypeEditorControls {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.archetypeEditorControls, .archetypeFieldsetGroups {
|
||||
i {
|
||||
cursor: pointer;
|
||||
&.handle {
|
||||
cursor: move;
|
||||
}
|
||||
&.dimmed {
|
||||
color: #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeConfig {
|
||||
margin-bottom: 20px;
|
||||
|
||||
.archetype-headline {
|
||||
|
||||
img {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
small {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
a {
|
||||
float: right;
|
||||
|
||||
img {
|
||||
width: 35px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.manual-link {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.donate-link {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.sponsors {
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 5px;
|
||||
display: inline-table;
|
||||
float: right;
|
||||
|
||||
a {
|
||||
float: none;
|
||||
}
|
||||
|
||||
h4 {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
label {
|
||||
width: 120px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.archetypeEditorControls {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.archetypeFieldsets {
|
||||
margin-left: 0;
|
||||
border-top: 5px solid;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.archetypeFieldsetWrapper {
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.archetypeFieldsetTitle {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.archetypeFieldsetOption {
|
||||
margin-bottom: 15px;
|
||||
margin-right: 15px;
|
||||
|
||||
input[type=text] {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeDeveloperModel {
|
||||
font-family: monospace;
|
||||
width: 88%;
|
||||
margin: 5px 10px 10px;
|
||||
height: 130px;
|
||||
}
|
||||
|
||||
.archetypeOptions {
|
||||
.btn {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
label {
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypePropertiesWrapper {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
margin: -40px 10px 10px 140px;
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #eee;
|
||||
|
||||
input[type=text] {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
select {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeAdvancedOptions {
|
||||
label {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
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;
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeFieldsetCollapser {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.fieldsetIcon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
small {
|
||||
color: #817f85;
|
||||
}
|
||||
}
|
||||
|
||||
.archetypeConfig ul{
|
||||
list-style: none;
|
||||
.ui-sortable-placeholder {
|
||||
visibility: visible !important;
|
||||
background-color: #d0e7f1 !important;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeEditorControls{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.archetypeConfig li{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.archetypeConfig label{
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetWrapper{
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetOption input[type=text]{
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeDeveloperModel {
|
||||
width: 88%;
|
||||
margin-left: 30px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertiesWrapper{
|
||||
border: 1px solid #ddd;
|
||||
padding: 10px;
|
||||
.archetype-dialog {
|
||||
margin: 10px;
|
||||
margin-left: 50px;
|
||||
width: 665px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertiesWrapper ul{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertiesWrapper li{
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertiesWrapper li:last-child{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsets {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetTitle {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeFieldsetCollapser{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeOptions label{
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeAdvancedOptions label{
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeDeveloperModel {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypeMaxFieldsets{
|
||||
border: 1px solid #ddd;
|
||||
width: 25px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertyTitle{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.archetypeConfig .archetypePropertyCollapser{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypeFieldsetError{
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.archetypeEditor .archetypePropertyError{
|
||||
border: 1px solid red;
|
||||
background-color: #8b0000;
|
||||
color: #fff;
|
||||
margin-bottom: 5px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
@@ -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,46 @@
|
||||
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'
|
||||
);
|
||||
},
|
||||
getAllDataTypesForCache: function() {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("backoffice/ArchetypeApi/ArchetypeDataType/GetAllDetails"), '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'
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,87 @@
|
||||
angular.module('umbraco.services').factory('archetypeCacheService', function (archetypePropertyEditorResource, $q, entityResource) {
|
||||
//private
|
||||
var entityCache = [];
|
||||
var datatypeCache = [];
|
||||
|
||||
return {
|
||||
initialize: function() {
|
||||
return archetypePropertyEditorResource.getAllDataTypesForCache().then(function(data) {
|
||||
_.each(data, function(datatype) {
|
||||
datatypeCache[datatype.dataTypeGuid] = datatype;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
getDataTypeFromCache: function(guid) {
|
||||
return datatypeCache[guid];
|
||||
},
|
||||
|
||||
getDatatypeByGuid: function(guid) {
|
||||
var cachedDatatype = this.getDataTypeFromCache(guid);
|
||||
|
||||
if(cachedDatatype) {
|
||||
return cachedDatatype;
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
getEntityById: function(id, type) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
//console.log(entityCache);
|
||||
|
||||
var cachedEntity = entityCache[id];
|
||||
|
||||
if(cachedEntity) {
|
||||
//console.log("Found ID " + id);
|
||||
|
||||
deferred.resolve(cachedEntity);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
//go get it from server
|
||||
entityResource.getById(id, type).then(function(entity) {
|
||||
entityCache[id] = entity;
|
||||
|
||||
//console.log("entity ID is now resolved into cache...");
|
||||
//console.log(entityCache);
|
||||
|
||||
deferred.resolve(entity);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
},
|
||||
|
||||
//perhaps this should return a promise?
|
||||
getEntityByUmbracoId: function(udi, type) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
var cachedEntity = entityCache[udi];
|
||||
|
||||
if(cachedEntity) {
|
||||
//console.log("Found UDI " + udi);
|
||||
|
||||
deferred.resolve(cachedEntity);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
//go get it from server
|
||||
entityResource.getByIds([udi], type).then(function (entities) {
|
||||
// prevent infinite lookups with a default entity
|
||||
var entity = entities.length > 0 ? entities[0] : { udi: udi, name: "" };
|
||||
|
||||
entityCache[udi] = entity;
|
||||
|
||||
//console.log("entity UDI is now resolved into cache...");
|
||||
//console.log(entityCache);
|
||||
|
||||
deferred.resolve(entity);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
angular.module('umbraco.services').factory('archetypeGlobalConfigService', function ($q, $http, umbRequestHelper) {
|
||||
return {
|
||||
globalSettings: function () {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("backoffice/ArchetypeApi/ArchetypeDataType/globalSettings"), 'Failed to get whether or not we are checking for updates!'
|
||||
);
|
||||
},
|
||||
setCheckForUpdates: function (isChecking) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.post("backoffice/ArchetypeApi/ArchetypeDataType/SetCheckForUpdates", isChecking), 'Failed to update check status!'
|
||||
);
|
||||
},
|
||||
checkForUpdates: function () {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.post("backoffice/ArchetypeApi/ArchetypeDataType/checkForUpdates", { }), 'Failed to check for updates!'
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,582 @@
|
||||
angular.module('umbraco.services').factory('archetypeLabelService', function (archetypeCacheService, $q, $injector, $timeout) {
|
||||
//private
|
||||
|
||||
/**
|
||||
* This will repeatedly wait for all promises in an array of promises to resolve, and it allows
|
||||
* for promises to be added to the array (i.e., if you add more promises, those added promises
|
||||
* will also be resolved too).
|
||||
* @param promises The array of promises.
|
||||
* @returns {*} The promise that will resolve once all promises in the array resolve.
|
||||
*/
|
||||
function repeatedlyWaitForPromises(promises) {
|
||||
|
||||
// Remember the original number of promises being resolved.
|
||||
var originalLength = promises.length;
|
||||
|
||||
return $q.all(promises).then(function () {
|
||||
|
||||
// If there are new promises, resolve those too.
|
||||
if (promises.length > originalLength) {
|
||||
promises = promises.slice(originalLength);
|
||||
return repeatedlyWaitForPromises(promises);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes a value to be used in a fieldset label. Since it might be a promise or a function, the
|
||||
* value is repeatedly processed until it becomes a string.
|
||||
* @param labelValue The value to be used in the fieldset label.
|
||||
* @param promises The collection of promises to add any promises to.
|
||||
* @param match The current matched substring object in a label template.
|
||||
*/
|
||||
function processLabelValue(labelValue, promises, match) {
|
||||
|
||||
// Normalize null/undefined values to an empty string.
|
||||
if(!labelValue) {
|
||||
labelValue = "";
|
||||
}
|
||||
|
||||
// Check the type of value (may be a string, promise, function, or other).
|
||||
if (isString(labelValue)) {
|
||||
|
||||
// handle collapsing dollar signs in labels (#387)
|
||||
if (labelValue.indexOf("$$") >= 0) {
|
||||
labelValue = labelValue.replace(/\$\$/g, "$$$$$$$$");
|
||||
}
|
||||
|
||||
// Set a new value now that it has been processed.
|
||||
//console.log("Processing string..." + labelValue);
|
||||
match.value = labelValue;
|
||||
} else if (isPromise(labelValue)) {
|
||||
// Remember the promise so we can wait for it to be completed before constructing the
|
||||
// fieldset label.
|
||||
promises.push(labelValue);
|
||||
labelValue.then(function (value) {
|
||||
//console.log("Processing final value..." + value);
|
||||
// The value will probably be a string, but recursively process it in case it's
|
||||
// something else.
|
||||
processLabelValue(value, promises, match);
|
||||
});
|
||||
} else if (_.isFunction(labelValue)) {
|
||||
|
||||
// Allow for the function to accept injected parameters, and invoke it.
|
||||
labelValue = $injector.invoke(labelValue);
|
||||
|
||||
// Recursively check result (may be a string, promise, or another function (another
|
||||
// function would be pretty strange, though I see no reason to disallow it).
|
||||
processLabelValue(labelValue, promises, match);
|
||||
} else {
|
||||
// Some other data type (e.g., number, date, object).
|
||||
match.value = labelValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified value is of type string.
|
||||
* @param value The value to check the type of.
|
||||
* @returns {boolean} True, if the value is a string; otherwise, false.
|
||||
*/
|
||||
function isString(value) {
|
||||
if (value === null) {
|
||||
return false;
|
||||
} else if (typeof value === 'string') {
|
||||
return true;
|
||||
} else if (value instanceof String) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified value is a JavaScript promise.
|
||||
* @param value The value that may be a promise.
|
||||
* @returns {*} True, if the value appears to be a promise; otherwise, false.
|
||||
*/
|
||||
function isPromise(value) {
|
||||
return value && _.isFunction(value.then);
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits a string value into a collection based on a regular expression.
|
||||
* @param rgx The regular expression to use to find matches in the string value.
|
||||
* @param value The string value to split.
|
||||
* @returns {Array} A collection of objects, each representing a portion of the supplied
|
||||
* string. Each object will contain the substring value, as well as a property
|
||||
* indicating whether or not that substring was matched the regular expression.
|
||||
*/
|
||||
function splitByRegex(rgx, value) {
|
||||
// Validate input.
|
||||
if (!rgx || !value) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Variables.
|
||||
var substring,
|
||||
splitParts = [],
|
||||
nextIndex = 0,
|
||||
index;
|
||||
|
||||
// Reset regex so we get all the matches.
|
||||
rgx.lastIndex = 0;
|
||||
|
||||
// Loop through each match until there are no more matches.
|
||||
var match = rgx.exec(value);
|
||||
while (match) {
|
||||
|
||||
// Extract match index.
|
||||
index = match.index;
|
||||
|
||||
// Is there text between the prior match and this one?
|
||||
if (nextIndex < index) {
|
||||
substring = value.substring(nextIndex, index);
|
||||
splitParts.push({
|
||||
isMatch: false,
|
||||
value: substring
|
||||
});
|
||||
}
|
||||
|
||||
// Remember the end of this match for the next loop iteration.
|
||||
nextIndex = rgx.lastIndex;
|
||||
|
||||
// Store info about this match.
|
||||
substring = value.substring(index, nextIndex);
|
||||
splitParts.push({
|
||||
isMatch: true,
|
||||
value: substring
|
||||
});
|
||||
|
||||
// Get next match.
|
||||
match = rgx.exec(value);
|
||||
}
|
||||
|
||||
// The text after the last match.
|
||||
if (nextIndex < value.length) {
|
||||
substring = value.substring(nextIndex);
|
||||
splitParts.push({
|
||||
isMatch: false,
|
||||
value: substring
|
||||
});
|
||||
}
|
||||
|
||||
// Reset regex in case somebody else wants to use it.
|
||||
rgx.lastIndex = 0;
|
||||
|
||||
// Return information about the matches.
|
||||
return splitParts;
|
||||
}
|
||||
|
||||
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.MultiNodeTreePicker2":
|
||||
return coreMntpV2(value, scope, datatype);
|
||||
case "Umbraco.MultipleMediaPicker":
|
||||
case "Umbraco.MediaPicker":
|
||||
return coreMediaPicker(value, scope, datatype);
|
||||
case "Umbraco.MediaPicker2":
|
||||
return coreMediaPickerV2(value, scope, datatype);
|
||||
case "Umbraco.DropDown":
|
||||
return coreDropdown(value, scope, datatype);
|
||||
case "RJP.MultiUrlPicker":
|
||||
return rjpMultiUrlPicker(value, scope, {});
|
||||
case "Umbraco.ContentPickerAlias":
|
||||
return coreContentPicker(value, scope, datatype);
|
||||
case "Umbraco.ContentPicker2":
|
||||
return coreContentPickerV2(value, scope, datatype);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
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";
|
||||
var deferred = $q.defer();
|
||||
|
||||
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 = [];
|
||||
var promises = [];
|
||||
|
||||
_.each(ids, function(id){
|
||||
if(id) {
|
||||
promises.push(archetypeCacheService.getEntityById(id, type).then(function(entity){
|
||||
if(entity) {
|
||||
entityArray.push(entity.name);
|
||||
}
|
||||
}).promise);
|
||||
}
|
||||
});
|
||||
|
||||
$q.all(promises).then(function() {
|
||||
deferred.resolve(entityArray.join(', '));
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function coreMntpV2(value, scope, args) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
var ids = value.split(',');
|
||||
|
||||
if (ids.length == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
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 = [];
|
||||
var promises = [];
|
||||
|
||||
_.each(ids, function (id) {
|
||||
if(id) {
|
||||
promises.push(archetypeCacheService.getEntityByUmbracoId(id, type).then(function(entity) {
|
||||
if(entity) {
|
||||
entityArray.push(entity.name);
|
||||
}
|
||||
}).promise);
|
||||
}
|
||||
});
|
||||
|
||||
$q.all(promises).then(function() {
|
||||
if(entityArray.length == 0) {
|
||||
deferred.resolve("");
|
||||
}
|
||||
|
||||
var firstEntityName = entityArray[0];
|
||||
|
||||
var value = firstEntityName + (ids.length > 1 ? ", ..." : "");
|
||||
|
||||
deferred.resolve(value);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function coreMediaPicker(value, scope, args) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
if(value) {
|
||||
archetypeCacheService.getEntityById(value, "media").then(function(entity) {
|
||||
deferred.resolve(entity.name);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
deferred.resolve("");
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function coreMediaPickerV2(value, scope, args) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
//console.log("value=");
|
||||
//console.log(value);
|
||||
|
||||
if(value) {
|
||||
archetypeCacheService.getEntityByUmbracoId(value, "media").then(function(entity) {
|
||||
deferred.resolve(entity.name);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
deferred.resolve("");
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function coreContentPicker(value, scope, args) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
if(value) {
|
||||
archetypeCacheService.getEntityById(value, "document").then(function(entity) {
|
||||
deferred.resolve(entity.name);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
deferred.resolve("");
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function coreContentPickerV2(value, scope, args) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
if (value) {
|
||||
archetypeCacheService.getEntityByUmbracoId(value, "document").then(function(entity) {
|
||||
deferred.resolve(entity.name);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
deferred.resolve("");
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function imulusUrlPicker(value, scope, args) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
if(!value) {
|
||||
deferred.resolve("");
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
if(!args.propertyName) {
|
||||
args = {propertyName: "name"}
|
||||
}
|
||||
|
||||
if(typeof(value) != "object") {
|
||||
value = JSON.parse(value);
|
||||
}
|
||||
|
||||
//console.log("urlpicker value...");
|
||||
//console.log(value);
|
||||
|
||||
if(value.length) {
|
||||
value = value[0];
|
||||
}
|
||||
|
||||
switch (value.type) {
|
||||
case "content":
|
||||
if(value.typeData.contentId) {
|
||||
archetypeCacheService.getEntityById(value.typeData.contentId, "Document").then(function(entity) {
|
||||
//console.log("Retrived entity from cache!");
|
||||
//console.log("Resolving the entity name with " + entity[args.propertyName]);
|
||||
deferred.resolve(entity[args.propertyName]);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case "media":
|
||||
if(value.typeData.mediaId) {
|
||||
archetypeCacheService.getEntityById(value.typeData.mediaId, "Media").then(function(entity) {
|
||||
deferred.resolve(entity[args.propertyName]);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case "url":
|
||||
deferred.resolve(value.typeData.url);
|
||||
|
||||
return deferred.promise;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function coreTinyMce(value, scope, args) {
|
||||
if(!args.contentLength) {
|
||||
args = {contentLength: 160}
|
||||
}
|
||||
|
||||
var suffix = "";
|
||||
var strippedText = $("<div/>").html(value).text();
|
||||
|
||||
if(strippedText.length > args.contentLength) {
|
||||
suffix = "…";
|
||||
}
|
||||
|
||||
return strippedText.substring(0, args.contentLength) + suffix;
|
||||
}
|
||||
|
||||
function rjpMultiUrlPicker(values, scope, args) {
|
||||
var names = [];
|
||||
|
||||
_.each(values, function (value) {
|
||||
if (value.name) {
|
||||
names.push(value.name);
|
||||
}
|
||||
});
|
||||
|
||||
return names.join(", ");
|
||||
}
|
||||
|
||||
return {
|
||||
getFieldsetTitle: function(scope, fieldsetConfigModel, fieldsetIndex) {
|
||||
|
||||
if(!fieldsetConfigModel)
|
||||
return $q.when("");
|
||||
|
||||
var fieldset = scope.model.value.fieldsets[fieldsetIndex];
|
||||
var fieldsetConfig = scope.getConfigFieldsetByAlias(fieldset.alias);
|
||||
var template = fieldsetConfigModel.labelTemplate;
|
||||
var promises = [];
|
||||
|
||||
if (template.length < 1)
|
||||
return $q.when(fieldsetConfig.label);
|
||||
|
||||
var rgx = /{{.*?}}/g;
|
||||
var matches = splitByRegex(rgx, template);
|
||||
|
||||
_.each(matches, function (match) {
|
||||
|
||||
// Skip over substrings that didn't match the regex (they do not require a transformation).
|
||||
if (!match.isMatch) {
|
||||
return;
|
||||
}
|
||||
|
||||
// split the template in case it consists of multiple property aliases and/or functions
|
||||
var templates = match.value.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, rawValue, scope);
|
||||
|
||||
if (label) {
|
||||
templateLabelValue = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Process the value (i.e., reduce any functions or promises down to strings).
|
||||
processLabelValue(templateLabelValue, promises, match);
|
||||
});
|
||||
|
||||
// Wait for all of the promises to resolve before constructing the full fieldset label.
|
||||
return repeatedlyWaitForPromises(promises).then(function () {
|
||||
|
||||
//console.log("done waiting...")
|
||||
// Extract string values and combine them into a single string.
|
||||
var substrings = _.map(matches, function (value) {
|
||||
return value.value;
|
||||
});
|
||||
|
||||
var combinedSubstrings = substrings.join('');
|
||||
|
||||
//console.log(combinedSubstrings);
|
||||
|
||||
// Return the title.
|
||||
return combinedSubstrings;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
angular.module('umbraco.services').factory('archetypeLocalizationService', function($http, $q, userService){
|
||||
var service = {
|
||||
resourceFileLoaded: false,
|
||||
dictionary: {},
|
||||
localize: function(key) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
if(service.resourceFileLoaded){
|
||||
var value = service._lookup(key);
|
||||
deferred.resolve(value);
|
||||
}
|
||||
else{
|
||||
service.initLocalizedResources().then(function(dictionary){
|
||||
var value = service._lookup(key);
|
||||
deferred.resolve(value);
|
||||
});
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
},
|
||||
_lookup: function(key){
|
||||
return service.dictionary[key];
|
||||
},
|
||||
initLocalizedResources:function () {
|
||||
var deferred = $q.defer();
|
||||
userService.getCurrentUser().then(function(user){
|
||||
$http.get("../App_plugins/Archetype/langs/" + user.locale + ".js", { cache: true })
|
||||
.then(function(response){
|
||||
service.resourceFileLoaded = true;
|
||||
service.dictionary = response.data;
|
||||
|
||||
return deferred.resolve(service.dictionary);
|
||||
}, function(err){
|
||||
return deferred.reject("Lang file missing");
|
||||
});
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
}
|
||||
|
||||
return service;
|
||||
});
|
||||
@@ -0,0 +1,228 @@
|
||||
angular.module('umbraco.services').factory('archetypeService', function () {
|
||||
|
||||
// Variables.
|
||||
var draggedRteArchetype;
|
||||
var archetypeEditors;
|
||||
var rteClass = ".archetypeEditor .umb-rte textarea";
|
||||
var editorSettings = {};
|
||||
var disabledSortables = [];
|
||||
|
||||
//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, excludeUniqueId) {
|
||||
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, true);
|
||||
|
||||
var reversed = _.unique(propertyAliasParts).reverse();
|
||||
|
||||
if (!excludeUniqueId) {
|
||||
reversed.push(_.uniqueId("u-"));
|
||||
}
|
||||
|
||||
return reversed.join("-");
|
||||
},
|
||||
getFieldset: function(scope) {
|
||||
var renderModel = scope.archetypeRenderModel;
|
||||
return renderModel ? renderModel.fieldsets[scope.fieldsetIndex] : null;
|
||||
},
|
||||
getFieldsetProperty: function (scope) {
|
||||
var fieldset = this.getFieldset(scope);
|
||||
return fieldset ? fieldset.properties[scope.renderModelPropertyIndex] : null;
|
||||
},
|
||||
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);
|
||||
},
|
||||
// This stores the rich text editors in all Archetypes (e.g., during a drag operation).
|
||||
// Typically, the editors will be restored after the drag completes.
|
||||
storeEditors: function (element) {
|
||||
|
||||
// If there are not tinyMCE editors, this may be undefined.
|
||||
if (typeof tinyMCE === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Variables.
|
||||
var self = this;
|
||||
draggedRteArchetype = element;
|
||||
|
||||
// Empty the stored settings.
|
||||
editorSettings = {};
|
||||
|
||||
// For fast lookups, store each editor by the element ID.
|
||||
var editorsById = {};
|
||||
for (var i = 0; i < tinyMCE.editors.length; i++) {
|
||||
var tempEditor = tinyMCE.editors[i];
|
||||
editorsById[tempEditor.id] = tempEditor;
|
||||
}
|
||||
|
||||
// Process each rich text editor.
|
||||
$(rteClass).each(function() {
|
||||
|
||||
// Variables.
|
||||
var id = $(this).attr("id");
|
||||
var editor = editorsById[id];
|
||||
|
||||
// Get the property's temporary ID.
|
||||
var scope = angular.element(this).scope().$parent;
|
||||
var property = self.getFieldsetProperty(scope);
|
||||
var tempId = property ? property.editorState.temporaryId : null;
|
||||
|
||||
// Store the editor settings by the temporary ID?
|
||||
if (editor && editor.settings && tempId) {
|
||||
editorSettings[tempId] = editor.settings;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
// This restores the rich text editors in the specified Archetype
|
||||
// (e.g., after a drop drop operation).
|
||||
restoreEditors: function(element) {
|
||||
|
||||
// If there are not tinyMCE editors, this may be undefined.
|
||||
if (typeof tinyMCE === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Variables.
|
||||
var bothElements = element
|
||||
? element.add(draggedRteArchetype)
|
||||
: draggedRteArchetype;
|
||||
var self = this;
|
||||
|
||||
// Process each RTE in both Archetypes.
|
||||
$(rteClass, bothElements).each(function () {
|
||||
|
||||
// Variables.
|
||||
var id = $(this).attr("id");
|
||||
|
||||
// Get the stored editor settings.
|
||||
var scope = angular.element(this).scope().$parent;
|
||||
var property = self.getFieldsetProperty(scope);
|
||||
var tempId = property ? property.editorState.temporaryId : null;
|
||||
var settings = editorSettings[tempId];
|
||||
|
||||
// Remove and reinitialize the editor.
|
||||
if (settings) {
|
||||
tinyMCE.execCommand("mceRemoveEditor", false, id);
|
||||
tinyMCE.init(settings);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
// Ensures the specified property has a temporary ID in its editor state,
|
||||
// optionally forcing one to be regenerated (if specified).
|
||||
ensureTemporaryId: function(property, regenerateId) {
|
||||
if (!property.editorState) {
|
||||
property.editorState = {};
|
||||
}
|
||||
var editorState = property.editorState;
|
||||
if (!editorState.temporaryId || regenerateId) {
|
||||
editorState.temporaryId = _.uniqueId("property-temp-id-");
|
||||
}
|
||||
},
|
||||
// Remembers a sortable that has been disabled (so it can be enabled later).
|
||||
rememberDisabledSortable: function(sortable) {
|
||||
disabledSortables.push(sortable);
|
||||
},
|
||||
// Enables all of the sortables that were disabled.
|
||||
enableSortables: function() {
|
||||
_.each(disabledSortables, function(sortable) {
|
||||
sortable.enable();
|
||||
});
|
||||
disabledSortables = [];
|
||||
},
|
||||
// Get all active archetype editors on the current page
|
||||
getEditors: function() {
|
||||
if (archetypeEditors == null) {
|
||||
archetypeEditors = $('.archetypeEditor');
|
||||
}
|
||||
return archetypeEditors;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,9 +0,0 @@
|
||||
angular.module('umbraco').factory('propertyEditorService', function($q, $http, umbRequestHelper){
|
||||
return {
|
||||
getViews: function() {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get("/App_Plugins/Archetype/js/config.views.js"), 'Failed to retreive config for views.'
|
||||
);
|
||||
}
|
||||
};
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user