Compare commits
451 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fec91ebd75 | |||
| 335c7a4333 | |||
| 648ac811e8 | |||
| f6475b3812 | |||
| ef5cb3dd4c | |||
| 4c76081568 | |||
| 0889e9c033 | |||
| 700aa48a2e | |||
| 43ccf77d7e | |||
| 24d5eefe38 | |||
| 551bcdde2f | |||
| 6f1776fb69 | |||
| 33618f9c2a | |||
| ff39e069db | |||
| a2357bad85 | |||
| 3d02429285 | |||
| cef7401ff8 | |||
| 8fb62265b7 | |||
| 62db053500 | |||
| 0edf5a5e5e | |||
| dc1be04202 | |||
| 5c70ba1eb8 | |||
| 38b1385b66 | |||
| b9849a2ded | |||
| 792450328d | |||
| babf5dabe2 | |||
| 1e3eaf8094 | |||
| fec878227e | |||
| a1abd9dd18 | |||
| 44e01c09d6 | |||
| 6eb738e0d3 | |||
| c50d2e994e | |||
| 058b195a12 | |||
| bff788f048 | |||
| cc96e01b4c | |||
| b57b18c0b1 | |||
| 631eb1fecb | |||
| 564fa2659b | |||
| 2177686e43 | |||
| 36e0b28e70 | |||
| 4ac3a5537e | |||
| 51977637b7 | |||
| ee4477f6ab | |||
| 8baa2db7e7 | |||
| 5d3aeee02f | |||
| 6da0a00e06 | |||
| 7d69bed9c9 | |||
| d182a297b8 | |||
| aa3b8fb808 | |||
| 73e552d105 | |||
| 8f2f81b558 | |||
| 48ff65e597 | |||
| 58874238cc | |||
| 8062df53f8 | |||
| 9df031c6fd | |||
| b17e54976f | |||
| 28479e5257 | |||
| fb90e44dad | |||
| 76fc41f14e | |||
| 60a3d581ab | |||
| c4385335a1 | |||
| 2f90f76348 | |||
| 873ee6a7d1 | |||
| fa54d0a1e8 | |||
| 413fe775d1 | |||
| dd1119bcad | |||
| 9efc931b92 | |||
| 09a785537e | |||
| d851afd8e2 | |||
| e883a22093 | |||
| 7dea3b872f | |||
| 6795f700d5 | |||
| 682104a1f1 | |||
| d29eb77383 | |||
| 07804c149b | |||
| b89257b96c | |||
| 288ae8826c | |||
| d00e9c502a | |||
| f4c976e600 | |||
| 83322a1916 | |||
| 8a9a625964 | |||
| b0dcfec61e | |||
| 13d93de517 | |||
| 0a39ee90c2 | |||
| b8b39ae890 | |||
| feff4a5713 | |||
| d3df402d4a | |||
| 87d96f389d | |||
| fc23004a1b | |||
| 4ec0aaab24 | |||
| cbf9a2e7e0 | |||
| 6bf2b10231 | |||
| 792aff0f1a | |||
| 2bbf3c8af2 | |||
| c239578bd8 | |||
| 0c3f57f537 | |||
| 6b423f5082 | |||
| cbea0ad4e7 | |||
| f18fe684cd | |||
| 4795bb9f43 | |||
| 63d5615698 | |||
| 216ab8c966 | |||
| e5f734acf3 | |||
| 3646f8af4b | |||
| 8d16887ba9 | |||
| fb7f28e00d | |||
| 057ab8cd15 | |||
| 9203fb6fed | |||
| 389454868d | |||
| 25daf42363 | |||
| 7b91c3beab | |||
| a36cda81e3 | |||
| aa5f57432d | |||
| 386f008dd7 | |||
| 34e0b10633 | |||
| 4f5d4c05c1 | |||
| 0e6bb6fb10 | |||
| 93f934b0c1 | |||
| 8c7636558b | |||
| 7d4430855f | |||
| abacb50ee8 | |||
| 0b1c8e39e6 | |||
| b0a46e6a06 | |||
| f27c625439 | |||
| d027fdb3d0 | |||
| 4a40b1046e | |||
| 10c9c14037 | |||
| f29a93422e | |||
| 2c3c6ce391 | |||
| 5105a2c9ef | |||
| 6a92a2f321 | |||
| 4578054f1b | |||
| 1d26a0353b | |||
| b375ddf1f8 | |||
| df2cfec816 | |||
| 89182fc3a9 | |||
| bf73588b6e | |||
| e29fe682b7 | |||
| c9c7eed6d9 | |||
| 9b56b76ad4 | |||
| 94722e82dd | |||
| a03fe234e8 | |||
| 5e83d590f9 | |||
| ddbbf5e799 | |||
| 6e51d690ce | |||
| 6a69202f5e | |||
| 06f6111876 | |||
| 0d91a841ff | |||
| 47e9aa6088 | |||
| 7c7df808b4 | |||
| 34eea0742b | |||
| 78c97971aa | |||
| 4f37fb0c00 | |||
| 60ca487ea3 | |||
| 777a857b6b | |||
| 712571fc38 | |||
| 1c08fc0351 | |||
| e765df10fe | |||
| 84d88161fa | |||
| accb94c415 | |||
| 4c0852c0e8 | |||
| e21057e9c8 | |||
| 03de5ca711 | |||
| 99d0b8c37e | |||
| cfa1143eed | |||
| f65bd2b9e3 | |||
| 8fa3ff08b3 | |||
| a2b6626f29 | |||
| 5ba0bb281c | |||
| 38c5a9dcf6 | |||
| badf9784c6 | |||
| 119c1f8eb3 | |||
| 326abb482e | |||
| 23bbc1f785 | |||
| f700525220 | |||
| a9f22c92c8 | |||
| 41497919d1 | |||
| eb131c3f3b | |||
| c5667818e2 | |||
| b2902c18e9 | |||
| 91b4e00ddd | |||
| a345d8c2f1 | |||
| 08a024273b | |||
| c8b81701b9 | |||
| 11c2ff2ec9 | |||
| 0a02e0c90c | |||
| 9e89e158ae | |||
| dabafcc972 | |||
| 2a252dafa4 | |||
| a7b0695ced | |||
| e0c3ed98a5 | |||
| d1fd368fdd | |||
| 41c3db56a0 | |||
| 7e7ca233c0 | |||
| dcfa5662e6 | |||
| 09a371e525 | |||
| 74b134842c | |||
| b77f6496b1 | |||
| 94c1cf0681 | |||
| 9dfe873de0 | |||
| 290e3338f7 | |||
| 90450428c7 | |||
| 934fe90e68 | |||
| 724dc74e8b | |||
| 6b81546606 | |||
| a6ed629fe6 | |||
| 3253310743 | |||
| d172ed2761 | |||
| 071d10445d | |||
| cc29cc8067 | |||
| bbfdfdc372 | |||
| bc6cc2ac00 | |||
| 190419393e | |||
| c9afa582b8 | |||
| 2a96b993e4 | |||
| 6b7697b259 | |||
| cca1a275f0 | |||
| aa3f7b0def | |||
| 75e3c9c8b2 | |||
| 7caa7aea88 | |||
| 75d62d6eae | |||
| 185e5163d4 | |||
| 3fc13e3a12 | |||
| ce3851828c | |||
| 28c9f0c4f6 | |||
| 460e385a07 | |||
| 1d182bdc41 | |||
| aafbb3bfb0 | |||
| 63011b2611 | |||
| b3881002de | |||
| de0fba669a | |||
| 37e2f4bbd8 | |||
| 68dcf4d521 | |||
| df3aef381d | |||
| de049a81bf | |||
| 0cd73c3273 | |||
| abb97482fe | |||
| 864a9ac94a | |||
| d726348bef | |||
| ad205fc928 | |||
| bed8310f7e | |||
| 172f0a53ce | |||
| 931bc4e9bb | |||
| b3b80399d0 | |||
| fbdad77bac | |||
| 730ded46a6 | |||
| 8d3d2fff28 | |||
| c59c66bc33 | |||
| ccd89bef07 | |||
| 9d985b11ba | |||
| 3f68d19ce0 | |||
| af57cc12e4 | |||
| c4e5bae76e | |||
| 64b43ce189 | |||
| 15d0cf2f89 | |||
| 802b33da94 | |||
| 8cdfec1cc0 | |||
| 97897c3062 | |||
| b180f1614f | |||
| 1fdbfff8fe | |||
| a21cbe6512 | |||
| 97e55544a0 | |||
| ea4038f16a | |||
| edc7bb000c | |||
| d17393bcd1 | |||
| 0f457e9874 | |||
| 1d7d959a80 | |||
| 4c52b7e97b | |||
| 252a6f06f8 | |||
| 9adff7e4a9 | |||
| 4d76c17b02 | |||
| 7f565e8df4 | |||
| 79f6f2a2a4 | |||
| 7d65e881c2 | |||
| 793fff9154 | |||
| d98a8543b0 | |||
| c9527ebf8f | |||
| e496f7076d | |||
| d9896f43c6 | |||
| 5b6e34b4da | |||
| 948fb920b7 | |||
| 1bad5aeafe | |||
| 33b7ade10d | |||
| 63dfc251c4 | |||
| 6a185bdc85 | |||
| 3861ecf41d | |||
| 174bc41560 | |||
| bd045838df | |||
| 469c248db5 | |||
| 34dc9036bd | |||
| a61c9d2a77 | |||
| 4671e462eb | |||
| 6bfb41999f | |||
| 4df3ef191a | |||
| 4dc4698b6c | |||
| 82df347d41 | |||
| 3e70a975bb | |||
| f745aedf2a | |||
| 0f93826e17 | |||
| 0cb1877924 | |||
| 325a9e8e0a | |||
| 384b7e852f | |||
| 1ea5bc5d7c | |||
| df18581cd2 | |||
| 0c88c4b776 | |||
| 220983171d | |||
| 07d5ce913c | |||
| 072c3a67bf | |||
| d17197a2dc | |||
| 132bd824a7 | |||
| 91c5ae4204 | |||
| deab9251d3 | |||
| 66ddc8c095 | |||
| ef58e75076 | |||
| 954f8e82c9 | |||
| de0c85f40c | |||
| e94274e9e6 | |||
| 36563d7699 | |||
| 39c6aca833 | |||
| 13615ea270 | |||
| 2e6613cc56 | |||
| 0c86e352b7 | |||
| fc2ed864f5 | |||
| 64cc5eb3e7 | |||
| a71d0f58cb | |||
| ac44fc9646 | |||
| c05750ee63 | |||
| b1b605f3bd | |||
| e65448d28e | |||
| 8a0a33870b | |||
| c0942cdf6b | |||
| ded62dba58 | |||
| dca59ce159 | |||
| a23a937813 | |||
| 7161ff4146 | |||
| bab35e30d8 | |||
| e45583eed2 | |||
| d0ba157501 | |||
| f12a545cd1 | |||
| 06334d1f06 | |||
| fdbfe72fb1 | |||
| b3ea418c15 | |||
| 5b6961a297 | |||
| bc6c01f44c | |||
| 72fb76e4e0 | |||
| 6b3ef0e3bf | |||
| e9f7cc59d5 | |||
| d46eec95de | |||
| f2e207d11e | |||
| 0b3c137fd8 | |||
| 92643f641e | |||
| 46a2c183b3 | |||
| 0369bb46e6 | |||
| 111fcc4967 | |||
| c609fc69ae | |||
| b8832b3ab3 | |||
| 31115465a0 | |||
| 8ec8147b69 | |||
| ee6f92596d | |||
| 4610fc14ea | |||
| af640662bb | |||
| 440ad4a1c5 | |||
| d76bdb80a9 | |||
| f91530777f | |||
| b458eb5b97 | |||
| 4fff2f7906 | |||
| 8ade52ca07 | |||
| 88ef7df6b4 | |||
| 78f96b2556 | |||
| fad4da5eb3 | |||
| b14e2fdaf7 | |||
| bd6232861c | |||
| cd51d592e4 | |||
| 3551c59548 | |||
| 30a3b3f4d8 | |||
| 42db92ba69 | |||
| 0f01f8d588 | |||
| eb7ef0f26e | |||
| 56a2b011f6 | |||
| 06e57f5024 | |||
| 79278e4199 | |||
| 84a3e8dcc6 | |||
| a83ea36dd2 | |||
| a53de5a181 | |||
| ed543a6af4 | |||
| 9c8436d286 | |||
| fd5e6afbbf | |||
| 1ca82c5871 | |||
| d348265950 | |||
| f42ec68a3a | |||
| 5cadb1c360 | |||
| e7c8be2d51 | |||
| bb0a4eb023 | |||
| 358374ebad | |||
| 6c172e79d0 | |||
| 234840b7c4 | |||
| c51936b242 | |||
| ed9ac1d002 | |||
| 3f319b8f11 | |||
| b01a35722a | |||
| b5b66b3f4a | |||
| 3e58afbc8b | |||
| 18488563fa | |||
| e5d1d481c1 | |||
| ffa111617f | |||
| e7b2d77b98 | |||
| ad165945e3 | |||
| bab260c032 | |||
| dcd73c5207 | |||
| 3319ded749 | |||
| 437538b23f | |||
| b2d00d39ac | |||
| 59a5c6692b | |||
| e9325ec857 | |||
| c3044f41fc | |||
| a64dff4f6e | |||
| 56bfaabc7a | |||
| 092732d748 | |||
| f498c0635f | |||
| a2cbadec4e | |||
| 69e5e5d32f | |||
| a2ab040cef | |||
| f8e1994cfe | |||
| da6229be9b | |||
| 0a2517668a | |||
| 949257ca00 | |||
| 9d7065e117 | |||
| 7114de6c36 | |||
| 4ac5f26db0 | |||
| 6a4b9fb906 | |||
| 63edf72bc3 | |||
| ab54ccc918 | |||
| 5c7de15653 | |||
| 6aeffb161d | |||
| 14a177b81e | |||
| 386cd44012 | |||
| 2741d99af9 | |||
| 46a826902a | |||
| 771110c09d | |||
| cbde836c59 | |||
| 51efc8f934 | |||
| b7c9c61182 | |||
| c689870e13 | |||
| 1ee12522f4 | |||
| ffd6debefb | |||
| 6349d400d3 | |||
| 7737059326 | |||
| 3eab36a3ab | |||
| 88d06f54d3 | |||
| 541bb38285 | |||
| 54dfd6d44a |
@@ -0,0 +1,24 @@
|
||||
# use glob syntax
|
||||
syntax: glob
|
||||
|
||||
*.obj
|
||||
*.exe
|
||||
*.pdb
|
||||
*.user
|
||||
*.aps
|
||||
*.pch
|
||||
*.vspscc
|
||||
[Bb]in
|
||||
[Db]ebug*/
|
||||
obj/
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
[Tt]est[Rr]esult*
|
||||
[Bb]uild[Ll]og.*
|
||||
*.[Pp]ublish.xml
|
||||
*.suo
|
||||
[sS]ource
|
||||
[sS]andbox
|
||||
umbraco.config
|
||||
*.vs10x
|
||||
App_Data\TEMP\*
|
||||
@@ -0,0 +1,6 @@
|
||||
d0aba247db91d1b70c39c6397b965ca370a67497 Sprint-Juno-A
|
||||
0b8f67be2ca8faf008151d87f232c698de69e735 Release-4.5.0
|
||||
5960c073250926d202861a09472f5f334da6e283 Sprint-Juno-B
|
||||
f15d4ff81a8368e9d42788f7e0ae726f7a70a3b1 Release-4.0.3
|
||||
283065df4d3c27245267709dd2644a479c4f62a5 Release-4.0.4.2
|
||||
ffc34b23e1a03785e4098afa4290d8c03cf10115 Release-4.5.2
|
||||
@@ -0,0 +1,24 @@
|
||||
Hi! Thanks for grabbing the Umbraco sourcecode.
|
||||
|
||||
===========================================
|
||||
NOTE - DEFAULT BRANCH EMPTY - December 2010
|
||||
===========================================
|
||||
|
||||
|
||||
- With the help of CodePlex we have migrated much of our previous changesets (as of Dec 13th 2010) from TFS to Mercurial.
|
||||
|
||||
- However, not everything could be migrated to our new branching workflow. So for each nominal group of 4.x changes, we've created named branches. For upcoming 5.x changesets, we'll adhere to our new workflow which we'll describe on the Wiki for contributors.
|
||||
|
||||
- FOR THE MOMENT, the 'default' branch is empty - pending the addition of the 5.0 changesets
|
||||
|
||||
- To switch to the codebase on which you want to work, 'hg update' to the named branch (e.g. "4.6.0") or tag (e.g. "Release-4.5.2") and browse or work from that point.
|
||||
|
||||
|
||||
Thanks to Matt Hawley at CodePlex for his help in our migration!
|
||||
|
||||
Cheers,
|
||||
The Umbraco Team
|
||||
|
||||
http://umbraco.org
|
||||
http://our.umbraco.org
|
||||
http://umbraco.codeplex.com
|
||||
+8
-216
@@ -1,221 +1,13 @@
|
||||
umbraco v3 is licensed under the open source license CPL - Common Public License (attached below). Please notice that it's only v3 that uses the CPL. The prior versions (v2.0, v2.1 and v2.1.x) uses GPL.
|
||||
Umbraco CMS version 4.5 is licensed under the OSI approved MIT License:
|
||||
|
||||
Important License Guidelines - How we see and adopt the CPL
|
||||
- You're free to choose whatever license (both open source and properary licenses) for any umbraco extensions you make as long as these are distributed alone and not bundled with umbraco.
|
||||
- umbraco may only be distributed as a whole. You may not use part of umbraco to create another stand-alone application, this could be using the UI parts to create another CMS.
|
||||
- You may not re-brand umbraco
|
||||
- If in doubt, please contact us (http://umbraco.org) before using our software for other than the original purpose. We have a commercial non-CPL license for those in doubt, wishes not to use CPL licensed software or wishes to build a new product based on parts of umbraco (see http://umbraco.org).
|
||||
Copyright (c) 2007-2010 umbraco I/S
|
||||
|
||||
Common Public License Version 1.0
|
||||
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 the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
|
||||
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
|
||||
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
1. DEFINITIONS
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
"Contribution" means:
|
||||
|
||||
a) in the case of the initial Contributor, the initial code and
|
||||
documentation distributed under this Agreement, and
|
||||
|
||||
b) in the case of each subsequent Contributor:
|
||||
|
||||
i) changes to the Program, and
|
||||
|
||||
ii) additions to the Program;
|
||||
|
||||
where such changes and/or additions to the Program originate from and are
|
||||
distributed by that particular Contributor. A Contribution 'originates' from a
|
||||
Contributor if it was added to the Program by such Contributor itself or anyone
|
||||
acting on such Contributor's behalf. Contributions do not include additions to
|
||||
the Program which: (i) are separate modules of software distributed in
|
||||
conjunction with the Program under their own license agreement, and (ii) are not
|
||||
derivative works of the Program.
|
||||
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
|
||||
"Licensed Patents " mean patent claims licensable by a Contributor which are
|
||||
necessarily infringed by the use or sale of its Contribution alone or when
|
||||
combined with the Program.
|
||||
|
||||
"Program" means the Contributions distributed in accordance with this Agreement.
|
||||
|
||||
"Recipient" means anyone who receives the Program under this Agreement,
|
||||
including all Contributors.
|
||||
|
||||
2. GRANT OF RIGHTS
|
||||
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby grants
|
||||
Recipient a non-exclusive, worldwide, royalty-free copyright license to
|
||||
reproduce, prepare derivative works of, publicly display, publicly perform,
|
||||
distribute and sublicense the Contribution of such Contributor, if any, and such
|
||||
derivative works, in source code and object code form.
|
||||
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby grants
|
||||
Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
|
||||
Patents to make, use, sell, offer to sell, import and otherwise transfer the
|
||||
Contribution of such Contributor, if any, in source code and object code form.
|
||||
This patent license shall apply to the combination of the Contribution and the
|
||||
Program if, at the time the Contribution is added by the Contributor, such
|
||||
addition of the Contribution causes such combination to be covered by the
|
||||
Licensed Patents. The patent license shall not apply to any other combinations
|
||||
which include the Contribution. No hardware per se is licensed hereunder.
|
||||
|
||||
c) Recipient understands that although each Contributor grants the licenses
|
||||
to its Contributions set forth herein, no assurances are provided by any
|
||||
Contributor that the Program does not infringe the patent or other intellectual
|
||||
property rights of any other entity. Each Contributor disclaims any liability to
|
||||
Recipient for claims brought by any other entity based on infringement of
|
||||
intellectual property rights or otherwise. As a condition to exercising the
|
||||
rights and licenses granted hereunder, each Recipient hereby assumes sole
|
||||
responsibility to secure any other intellectual property rights needed, if any.
|
||||
For example, if a third party patent license is required to allow Recipient to
|
||||
distribute the Program, it is Recipient's responsibility to acquire that license
|
||||
before distributing the Program.
|
||||
|
||||
d) Each Contributor represents that to its knowledge it has sufficient
|
||||
copyright rights in its Contribution, if any, to grant the copyright license set
|
||||
forth in this Agreement.
|
||||
|
||||
3. REQUIREMENTS
|
||||
|
||||
A Contributor may choose to distribute the Program in object code form under its
|
||||
own license agreement, provided that:
|
||||
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
|
||||
b) its license agreement:
|
||||
|
||||
i) effectively disclaims on behalf of all Contributors all warranties and
|
||||
conditions, express and implied, including warranties or conditions of title and
|
||||
non-infringement, and implied warranties or conditions of merchantability and
|
||||
fitness for a particular purpose;
|
||||
|
||||
ii) effectively excludes on behalf of all Contributors all liability for
|
||||
damages, including direct, indirect, special, incidental and consequential
|
||||
damages, such as lost profits;
|
||||
|
||||
iii) states that any provisions which differ from this Agreement are offered
|
||||
by that Contributor alone and not by any other party; and
|
||||
|
||||
iv) states that source code for the Program is available from such
|
||||
Contributor, and informs licensees how to obtain it in a reasonable manner on or
|
||||
through a medium customarily used for software exchange.
|
||||
|
||||
When the Program is made available in source code form:
|
||||
|
||||
a) it must be made available under this Agreement; and
|
||||
|
||||
b) a copy of this Agreement must be included with each copy of the Program.
|
||||
|
||||
Contributors may not remove or alter any copyright notices contained within the
|
||||
Program.
|
||||
|
||||
Each Contributor must identify itself as the originator of its Contribution, if
|
||||
any, in a manner that reasonably allows subsequent Recipients to identify the
|
||||
originator of the Contribution.
|
||||
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
|
||||
Commercial distributors of software may accept certain responsibilities with
|
||||
respect to end users, business partners and the like. While this license is
|
||||
intended to facilitate the commercial use of the Program, the Contributor who
|
||||
includes the Program in a commercial product offering should do so in a manner
|
||||
which does not create potential liability for other Contributors. Therefore, if
|
||||
a Contributor includes the Program in a commercial product offering, such
|
||||
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
|
||||
every other Contributor ("Indemnified Contributor") against any losses, damages
|
||||
and costs (collectively "Losses") arising from claims, lawsuits and other legal
|
||||
actions brought by a third party against the Indemnified Contributor to the
|
||||
extent caused by the acts or omissions of such Commercial Contributor in
|
||||
connection with its distribution of the Program in a commercial product
|
||||
offering. The obligations in this section do not apply to any claims or Losses
|
||||
relating to any actual or alleged intellectual property infringement. In order
|
||||
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
|
||||
Contributor in writing of such claim, and b) allow the Commercial Contributor to
|
||||
control, and cooperate with the Commercial Contributor in, the defense and any
|
||||
related settlement negotiations. The Indemnified Contributor may participate in
|
||||
any such claim at its own expense.
|
||||
|
||||
For example, a Contributor might include the Program in a commercial product
|
||||
offering, Product X. That Contributor is then a Commercial Contributor. If that
|
||||
Commercial Contributor then makes performance claims, or offers warranties
|
||||
related to Product X, those performance claims and warranties are such
|
||||
Commercial Contributor's responsibility alone. Under this section, the
|
||||
Commercial Contributor would have to defend claims against the other
|
||||
Contributors related to those performance claims and warranties, and if a court
|
||||
requires any other Contributor to pay any damages as a result, the Commercial
|
||||
Contributor must pay those damages.
|
||||
|
||||
5. NO WARRANTY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
|
||||
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
|
||||
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
|
||||
Recipient is solely responsible for determining the appropriateness of using and
|
||||
distributing the Program and assumes all risks associated with its exercise of
|
||||
rights under this Agreement, including but not limited to the risks and costs of
|
||||
program errors, compliance with applicable laws, damage to or loss of data,
|
||||
programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
|
||||
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
|
||||
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
|
||||
GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. GENERAL
|
||||
|
||||
If any provision of this Agreement is invalid or unenforceable under applicable
|
||||
law, it shall not affect the validity or enforceability of the remainder of the
|
||||
terms of this Agreement, and without further action by the parties hereto, such
|
||||
provision shall be reformed to the minimum extent necessary to make such
|
||||
provision valid and enforceable.
|
||||
|
||||
If Recipient institutes patent litigation against a Contributor with respect to
|
||||
a patent applicable to software (including a cross-claim or counterclaim in a
|
||||
lawsuit), then any patent licenses granted by that Contributor to such Recipient
|
||||
under this Agreement shall terminate as of the date such litigation is filed. In
|
||||
addition, if Recipient institutes patent litigation against any entity
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
|
||||
itself (excluding combinations of the Program with other software or hardware)
|
||||
infringes such Recipient's patent(s), then such Recipient's rights granted under
|
||||
Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
|
||||
All Recipient's rights under this Agreement shall terminate if it fails to
|
||||
comply with any of the material terms or conditions of this Agreement and does
|
||||
not cure such failure in a reasonable period of time after becoming aware of
|
||||
such noncompliance. If all Recipient's rights under this Agreement terminate,
|
||||
Recipient agrees to cease use and distribution of the Program as soon as
|
||||
reasonably practicable. However, Recipient's obligations under this Agreement
|
||||
and any licenses granted by Recipient relating to the Program shall continue and
|
||||
survive.
|
||||
|
||||
Everyone is permitted to copy and distribute copies of this Agreement, but in
|
||||
order to avoid inconsistency the Agreement is copyrighted and may only be
|
||||
modified in the following manner. The Agreement Steward reserves the right to
|
||||
publish new versions (including revisions) of this Agreement from time to time.
|
||||
No one other than the Agreement Steward has the right to modify this Agreement.
|
||||
IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
|
||||
as the Agreement Steward to a suitable separate entity. Each new version of the
|
||||
Agreement will be given a distinguishing version number. The Program (including
|
||||
Contributions) may always be distributed subject to the version of the Agreement
|
||||
under which it was received. In addition, after a new version of the Agreement
|
||||
is published, Contributor may elect to distribute the Program (including its
|
||||
Contributions) under the new version. Except as expressly stated in Sections
|
||||
2(a) and 2(b) above, Recipient receives no rights or licenses to the
|
||||
intellectual property of any Contributor under this Agreement, whether
|
||||
expressly, by implication, estoppel or otherwise. All rights in the Program not
|
||||
expressly granted under this Agreement are reserved.
|
||||
|
||||
This Agreement is governed by the laws of the State of New York and the
|
||||
intellectual property laws of the United States of America. No party to this
|
||||
Agreement will bring a legal action under this Agreement more than one year
|
||||
after the cause of action arose. Each party waives its rights to a jury trial in
|
||||
any resulting litigation.
|
||||
Umbraco versions prior to 4.5 were licensed under a combination of MIT and a propriatary UI license. The license history can be found here:
|
||||
http://umbraco.codeplex.com/license
|
||||
@@ -250,7 +250,7 @@ namespace umbraco.Linq.Core.Node
|
||||
|
||||
foreach (var ancestor in elements)
|
||||
{
|
||||
var alias = Casing.SafeAliasWithForcingCheck(ancestor.Name.LocalName);
|
||||
var alias = Casing.SafeAlias(ancestor.Name.LocalName);
|
||||
var t = KnownTypes[alias];
|
||||
var instaceOfT = (DocTypeBase)Activator.CreateInstance(t); //create an instance of the type and down-cast so we can use it
|
||||
this.LoadFromXml(ancestor, instaceOfT);
|
||||
@@ -276,7 +276,7 @@ namespace umbraco.Linq.Core.Node
|
||||
});
|
||||
|
||||
foreach (var type in types)
|
||||
this._knownTypes.Add(Casing.SafeAliasWithForcingCheck(type.Key), type.Value);
|
||||
this._knownTypes.Add(Casing.SafeAlias(type.Key), type.Value);
|
||||
|
||||
}
|
||||
|
||||
@@ -327,30 +327,67 @@ namespace umbraco.Linq.Core.Node
|
||||
{
|
||||
var attr = ReflectionAssistance.GetUmbracoInfoAttribute(p);
|
||||
|
||||
XElement propertyXml = xml.Element(Casing.SafeAliasWithForcingCheck(attr.Alias));
|
||||
XElement propertyXml = xml.Element(Casing.SafeAlias(attr.Alias));
|
||||
string data = null;
|
||||
//if the XML doesn't contain the property it means that the node hasn't been re-published with the property
|
||||
//so then we'll leave the data at null, otherwise let's grab it
|
||||
if (propertyXml != null)
|
||||
data = propertyXml.Value;
|
||||
//Check if the propertyXml and propertyXml.FirstNode aren't null. If they are we don't need to set the value.
|
||||
if (propertyXml != null && propertyXml.FirstNode != null)
|
||||
{
|
||||
//If the FirstNode is an XElement it means the property contains inner xml and we should return it. Otherwise just return the normal value.
|
||||
if (propertyXml.FirstNode is XElement)
|
||||
{
|
||||
var reader = propertyXml.CreateReader();
|
||||
reader.MoveToContent();
|
||||
data = reader.ReadInnerXml();
|
||||
}
|
||||
else
|
||||
{
|
||||
data = propertyXml.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (p.PropertyType.IsValueType && p.PropertyType.GetGenericArguments().Length > 0 && typeof(Nullable<>).IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition()))
|
||||
{
|
||||
if (string.IsNullOrEmpty(data))
|
||||
{
|
||||
//non-mandatory structs which have no value will be null
|
||||
p.SetValue(node, null, null);
|
||||
try
|
||||
{
|
||||
p.SetValue(node, null, null);
|
||||
}
|
||||
catch (FormatException ex)
|
||||
{
|
||||
throw new FormatException(
|
||||
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//non-mandatory structs which do have a value have to be cast based on the type of their Nullable<T>, found from the first (well, only) GenericArgument
|
||||
p.SetValue(node, Convert.ChangeType(data, p.PropertyType.GetGenericArguments()[0]), null);
|
||||
try
|
||||
{
|
||||
p.SetValue(node, Convert.ChangeType(data, p.PropertyType.GetGenericArguments()[0]), null);
|
||||
}
|
||||
catch (FormatException ex)
|
||||
{
|
||||
throw new FormatException(
|
||||
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Address how Convert.ChangeType works in globalisation
|
||||
p.SetValue(node, Convert.ChangeType(data, p.PropertyType), null);
|
||||
try
|
||||
{
|
||||
p.SetValue(node, Convert.ChangeType(data, p.PropertyType), null);
|
||||
}
|
||||
catch (FormatException ex)
|
||||
{
|
||||
throw new FormatException(
|
||||
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,14 @@
|
||||
<AssemblyName>umbraco.Linq.Core</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<umbracoPresentationPath>..\..\..\..\..\umbraco\presentation\bin</umbracoPresentationPath>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
@@ -146,4 +150,4 @@
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>XCOPY "$(TargetPath)" "$(SolutionDir)\umbraco\presentation\bin" /Y</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
!! Umbraco - the simple, flexible and friendly ASP.NET CMS
|
||||
For the first time on the Microsoft platform a free user and developer friendly cms that makes it quick and easy to create websites - or a breeze to build complex web applications. umbraco got award-winning integration capabilities and supports your ASP.NET User and Custom Controls out of the box. It's a developers dream and your users will love it too. Used by more than 57.000 active websites including Heinz.com, Peugeot.com, NAIAS.com and Microsofts documentinteropinitiative.org website you can be sure that the technology is proven, stable and scales.
|
||||
[url:More info at http://umbraco.org|http://umbraco.org]
|
||||
|
||||
!! Forums
|
||||
We have a forum running on [url:http://our.umbraco.org]. The discussions area on CodePlex will be for discussions on developing the core, and not on Umbraco-implementations or extensions in general. For those topics, please use [url:http://our.umbraco.org].
|
||||
|
||||
!! Submitting Issues
|
||||
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [url:online guide|http://our.umbraco.org/wiki/how-tos/submitting-bug-reports].
|
||||
@@ -4,8 +4,8 @@
|
||||
<Deployment enabled="false" />
|
||||
<Execution>
|
||||
<Hosts type="ASP.NET" skipUnhostableTests="false">
|
||||
<AspNet name="ASP.NET" executionType="WebDev" urlToTest="http://localhost:52453">
|
||||
<DevelopmentServer pathToWebSite="C:\Users\hartvig\Documents\Visual Studio 2008\Projects\Core\branches\4.1.0\umbraco\presentation" webApplicationRoot="/" />
|
||||
<AspNet name="ASP.NET" executionType="WebDev" urlToTest="http://localhost:6557">
|
||||
<DevelopmentServer pathToWebSite="C:\Users\hartvig\Documents\Visual Studio 2010\Projects\Core\umbraco\presentation" webApplicationRoot="/" />
|
||||
</AspNet>
|
||||
</Hosts>
|
||||
<TestTypeSpecific>
|
||||
|
||||
+3
-3
@@ -1,19 +1,19 @@
|
||||
<?xml version="1.0" ?>
|
||||
<project name="umbraco" default="test" basedir=".">
|
||||
<description>Build the umbraco 4.5 Application for asp.net 3.5</description>
|
||||
<description>Build the umbraco 4.6 alpha Application for asp.net 3.5</description>
|
||||
|
||||
<property name="nant.settings.currentframework" value="net-2.0" />
|
||||
|
||||
<!-- filenames and directories, generally won't change -->
|
||||
|
||||
<property name="web.dir" value="D:\inetpub\wwwroot\v4.umbraco.org" />
|
||||
<property name="public.dir" value="D:\inetpub\wwwroot\nightlies\umbraco 4.1 for asp.net 3.5" />
|
||||
<property name="public.dir" value="D:\inetpub\wwwroot\nightlies\umbraco 4.6 for asp.net 3.5" />
|
||||
<property name="root.dir" value="${directory::get-current-directory()}" />
|
||||
<property name="source.dir" value="${root.dir}\umbraco\presentation" />
|
||||
<property name="build.dir" value="${root.dir}\build" />
|
||||
<property name="dlls.dir" value="${root.dir}\foreign dlls" />
|
||||
|
||||
<property name="build.version" value="4.1"/>
|
||||
<property name="build.version" value="4.6 Alpha"/>
|
||||
|
||||
<property name="docs.dir" value="${root.dir}\docs" />
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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("SqlCE4Umbraco")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("SqlCE4Umbraco")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
|
||||
[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("04436b0a-1dc6-4ee1-9d96-4c04f1a9f429")]
|
||||
|
||||
// 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,985 @@
|
||||
/*******************************************************************************************
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Umbraco database installation script for SQL Server CE 4
|
||||
|
||||
IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
|
||||
|
||||
Database version: 4.1.0.0
|
||||
|
||||
Please increment this version number if ANY change is made to this script,
|
||||
so compatibility with scripts for other database systems can be verified easily.
|
||||
The first 3 digits depict the Umbraco version, the last digit is the database version.
|
||||
(e.g. version 4.0.0.3 means "Umbraco version 4.0.0, database version 3")
|
||||
|
||||
Check-in policy: only commit this script if
|
||||
* you ran the Umbraco installer completely;
|
||||
* you ran it on the targetted database system;
|
||||
* you ran the Runway and Module installations;
|
||||
* you were able to browse the Boost site;
|
||||
* you were able to open the Umbraco administration panel;
|
||||
* you have documented the code change in this script;
|
||||
* you have incremented the version number in this script.
|
||||
|
||||
IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
********************************************************************************************/
|
||||
|
||||
CREATE TABLE [umbracoRelation]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[parentId] [int] NOT NULL,
|
||||
[childId] [int] NOT NULL,
|
||||
[relType] [int] NOT NULL,
|
||||
[datetime] [datetime] NOT NULL CONSTRAINT [DF_umbracoRelation_datetime] DEFAULT (getdate()),
|
||||
[comment] [nvarchar] (1000) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoRelation] ADD CONSTRAINT [PK_umbracoRelation] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [cmsDocument]
|
||||
(
|
||||
[nodeId] [int] NOT NULL,
|
||||
[published] [bit] NOT NULL,
|
||||
[documentUser] [int] NOT NULL,
|
||||
[versionId] [uniqueidentifier] NOT NULL,
|
||||
[text] [nvarchar] (255) NOT NULL,
|
||||
[releaseDate] [datetime] NULL,
|
||||
[expireDate] [datetime] NULL,
|
||||
[updateDate] [datetime] NOT NULL CONSTRAINT [DF_cmsDocument_updateDate] DEFAULT (getdate()),
|
||||
[templateId] [int] NULL,
|
||||
[alias] [nvarchar] (255) NULL ,
|
||||
[newest] [bit] NOT NULL CONSTRAINT [DF_cmsDocument_newest] DEFAULT (0)
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsDocument] ADD CONSTRAINT [PK_cmsDocument] PRIMARY KEY ([versionId])
|
||||
;
|
||||
CREATE TABLE [umbracoLog]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[userId] [int] NOT NULL,
|
||||
[NodeId] [int] NOT NULL,
|
||||
[Datestamp] [datetime] NOT NULL CONSTRAINT [DF_umbracoLog_Datestamp] DEFAULT (getdate()),
|
||||
[logHeader] [nvarchar] (50) NOT NULL,
|
||||
[logComment] [nvarchar] (1000) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoLog] ADD CONSTRAINT [PK_umbracoLog] PRIMARY KEY ([id])
|
||||
;
|
||||
|
||||
/* TABLES ARE NEVER USED, REMOVED FOR 4.1
|
||||
|
||||
CREATE TABLE [umbracoUserGroup]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[userGroupName] [nvarchar] (255) NOT NULL
|
||||
)
|
||||
;
|
||||
ALTER TABLE [umbracoUserGroup] ADD CONSTRAINT [PK_userGroup] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [umbracoUser2userGroup]
|
||||
(
|
||||
[user] [int] NOT NULL,
|
||||
[userGroup] [int] NOT NULL
|
||||
)
|
||||
;
|
||||
ALTER TABLE [umbracoUser2userGroup] ADD CONSTRAINT [PK_user2userGroup] PRIMARY KEY ([user], [userGroup])
|
||||
;
|
||||
|
||||
*/
|
||||
|
||||
CREATE TABLE [umbracoApp]
|
||||
(
|
||||
[sortOrder] [tinyint] NOT NULL CONSTRAINT [DF_app_sortOrder] DEFAULT (0),
|
||||
[appAlias] [nvarchar] (50) NOT NULL,
|
||||
[appIcon] [nvarchar] (255) NOT NULL,
|
||||
[appName] [nvarchar] (255) NOT NULL,
|
||||
[appInitWithTreeAlias] [nvarchar] (255) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoApp] ADD CONSTRAINT [PK_umbracoApp] PRIMARY KEY ([appAlias])
|
||||
;
|
||||
CREATE TABLE [cmsPropertyData]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[contentNodeId] [int] NOT NULL,
|
||||
[versionId] [uniqueidentifier] NULL,
|
||||
[propertytypeid] [int] NOT NULL,
|
||||
[dataInt] [int] NULL,
|
||||
[dataDate] [datetime] NULL,
|
||||
[dataNvarchar] [nvarchar] (500) NULL,
|
||||
[dataNtext] [ntext] NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsPropertyData] ADD CONSTRAINT [PK_cmsPropertyData] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE INDEX [IX_cmsPropertyData] ON [cmsPropertyData] ([id])
|
||||
;
|
||||
CREATE TABLE [cmsContent]
|
||||
(
|
||||
[pk] [int] NOT NULL IDENTITY(1, 1),
|
||||
[nodeId] [int] NOT NULL,
|
||||
[contentType] [int] NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsContent] ADD CONSTRAINT [PK_cmsContent] PRIMARY KEY ([pk])
|
||||
;
|
||||
CREATE TABLE [cmsContentType]
|
||||
(
|
||||
[pk] [int] NOT NULL IDENTITY(1, 1),
|
||||
[nodeId] [int] NOT NULL,
|
||||
[alias] [nvarchar] (255) NULL,
|
||||
[icon] [nvarchar] (255) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsContentType] ADD CONSTRAINT [PK_cmsContentType] PRIMARY KEY ([pk])
|
||||
;
|
||||
CREATE TABLE [cmsMacroPropertyType]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[macroPropertyTypeAlias] [nvarchar] (50) NULL,
|
||||
[macroPropertyTypeRenderAssembly] [nvarchar] (255) NULL,
|
||||
[macroPropertyTypeRenderType] [nvarchar] (255) NULL,
|
||||
[macroPropertyTypeBaseType] [nvarchar] (255) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsMacroPropertyType] ADD CONSTRAINT [PK_macroPropertyType] PRIMARY KEY ([id])
|
||||
;
|
||||
|
||||
/* TABLE IS NEVER USED, REMOVED FOR 4.1
|
||||
|
||||
CREATE TABLE [umbracoStylesheetProperty]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[stylesheetPropertyEditor] [bit] NOT NULL CONSTRAINT [DF_stylesheetProperty_stylesheetPropertyEditor] DEFAULT (0),
|
||||
[stylesheet] [int] NOT NULL,
|
||||
[stylesheetPropertyAlias] [nvarchar] (50) NULL,
|
||||
[stylesheetPropertyName] [nvarchar] (255) NULL,
|
||||
[stylesheetPropertyValue] [nvarchar] (400) NULL
|
||||
)
|
||||
;
|
||||
|
||||
ALTER TABLE [umbracoStylesheetProperty] ADD CONSTRAINT [PK_stylesheetProperty] PRIMARY KEY ([id])
|
||||
;
|
||||
|
||||
*/
|
||||
|
||||
CREATE TABLE [cmsTab]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[contenttypeNodeId] [int] NOT NULL,
|
||||
[text] [nvarchar] (255) NOT NULL,
|
||||
[sortorder] [int] NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsTab] ADD CONSTRAINT [PK_cmsTab] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [cmsTemplate]
|
||||
(
|
||||
[pk] [int] NOT NULL IDENTITY(1, 1),
|
||||
[nodeId] [int] NOT NULL,
|
||||
[master] [int] NULL,
|
||||
[alias] [nvarchar] (100) NULL,
|
||||
[design] [ntext] NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsTemplate] ADD CONSTRAINT [PK_templates] PRIMARY KEY ([pk])
|
||||
;
|
||||
CREATE TABLE [umbracoUser2app]
|
||||
(
|
||||
[user] [int] NOT NULL,
|
||||
[app] [nvarchar] (50) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoUser2app] ADD CONSTRAINT [PK_user2app] PRIMARY KEY ([user], [app])
|
||||
;
|
||||
CREATE TABLE [umbracoUserType]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[userTypeAlias] [nvarchar] (50) NULL,
|
||||
[userTypeName] [nvarchar] (255) NOT NULL,
|
||||
[userTypeDefaultPermissions] [nvarchar] (50) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoUserType] ADD CONSTRAINT [PK_userType] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [umbracoUser]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[userDisabled] [bit] NOT NULL CONSTRAINT [DF_umbracoUser_userDisabled] DEFAULT (0),
|
||||
[userNoConsole] [bit] NOT NULL CONSTRAINT [DF_umbracoUser_userNoConsole] DEFAULT (0),
|
||||
[userType] [int] NOT NULL,
|
||||
[startStructureID] [int] NOT NULL,
|
||||
[startMediaID] [int] NULL,
|
||||
[userName] [nvarchar] (255) NOT NULL,
|
||||
[userLogin] [nvarchar] (125) NOT NULL,
|
||||
[userPassword] [nvarchar] (125) NOT NULL,
|
||||
[userEmail] [nvarchar] (255) NOT NULL,
|
||||
[userDefaultPermissions] [nvarchar] (50) NULL,
|
||||
[userLanguage] [nvarchar] (10) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoUser] ADD CONSTRAINT [PK_user] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [cmsDocumentType]
|
||||
(
|
||||
[contentTypeNodeId] [int] NOT NULL,
|
||||
[templateNodeId] [int] NOT NULL,
|
||||
[IsDefault] [bit] NOT NULL CONSTRAINT [DF_cmsDocumentType_IsDefault] DEFAULT (0)
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsDocumentType] ADD CONSTRAINT [PK_cmsDocumentType] PRIMARY KEY ([contentTypeNodeId], [templateNodeId])
|
||||
;
|
||||
CREATE TABLE [cmsMemberType]
|
||||
(
|
||||
[pk] [int] NOT NULL IDENTITY(1, 1),
|
||||
[NodeId] [int] NOT NULL,
|
||||
[propertytypeId] [int] NOT NULL,
|
||||
[memberCanEdit] [bit] NOT NULL CONSTRAINT [DF_cmsMemberType_memberCanEdit] DEFAULT (0),
|
||||
[viewOnProfile] [bit] NOT NULL CONSTRAINT [DF_cmsMemberType_viewOnProfile] DEFAULT (0)
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsMemberType] ADD CONSTRAINT [PK_cmsMemberType] PRIMARY KEY ([pk])
|
||||
;
|
||||
CREATE TABLE [cmsMember]
|
||||
(
|
||||
[nodeId] [int] NOT NULL,
|
||||
[Email] [nvarchar] (1000) NOT NULL CONSTRAINT [DF_cmsMember_Email] DEFAULT (''),
|
||||
[LoginName] [nvarchar] (1000) NOT NULL CONSTRAINT [DF_cmsMember_LoginName] DEFAULT (''),
|
||||
[Password] [nvarchar] (1000) NOT NULL CONSTRAINT [DF_cmsMember_Password] DEFAULT ('')
|
||||
)
|
||||
|
||||
;
|
||||
CREATE TABLE [umbracoNode]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[trashed] [bit] NOT NULL CONSTRAINT [DF_umbracoNode_trashed] DEFAULT (0),
|
||||
[parentID] [int] NOT NULL,
|
||||
[nodeUser] [int] NULL,
|
||||
[level] [int] NOT NULL,
|
||||
[path] [nvarchar] (150) NOT NULL,
|
||||
[sortOrder] [int] NOT NULL,
|
||||
[uniqueID] [uniqueidentifier] NULL,
|
||||
[text] [nvarchar] (255) NULL,
|
||||
[nodeObjectType] [uniqueidentifier] NULL,
|
||||
[createDate] [datetime] NOT NULL CONSTRAINT [DF_umbracoNode_createDate] DEFAULT (getdate())
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoNode] ADD CONSTRAINT [PK_structure] PRIMARY KEY ([id])
|
||||
;
|
||||
;
|
||||
CREATE TABLE [cmsPropertyType]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[dataTypeId] [int] NOT NULL,
|
||||
[contentTypeId] [int] NOT NULL,
|
||||
[tabId] [int] NULL,
|
||||
[Alias] [nvarchar] (255) NOT NULL,
|
||||
[Name] [nvarchar] (255) NULL,
|
||||
[helpText] [nvarchar] (1000) NULL,
|
||||
[sortOrder] [int] NOT NULL CONSTRAINT [DF__cmsProper__sortO__1EA48E88] DEFAULT (0),
|
||||
[mandatory] [bit] NOT NULL CONSTRAINT [DF__cmsProper__manda__2180FB33] DEFAULT (0),
|
||||
[validationRegExp] [nvarchar] (255) NULL,
|
||||
[Description] [nvarchar] (2000) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsPropertyType] ADD CONSTRAINT [PK_cmsPropertyType] PRIMARY KEY ([id])
|
||||
;
|
||||
|
||||
CREATE TABLE [cmsMacroProperty]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[macroPropertyHidden] [bit] NOT NULL CONSTRAINT [DF_macroProperty_macroPropertyHidden] DEFAULT (0),
|
||||
[macroPropertyType] [int] NOT NULL,
|
||||
[macro] [int] NOT NULL,
|
||||
[macroPropertySortOrder] [tinyint] NOT NULL CONSTRAINT [DF_macroProperty_macroPropertySortOrder] DEFAULT (0),
|
||||
[macroPropertyAlias] [nvarchar] (50) NOT NULL,
|
||||
[macroPropertyName] [nvarchar] (255) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsMacroProperty] ADD CONSTRAINT [PK_macroProperty] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [cmsMacro]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[macroUseInEditor] [bit] NOT NULL CONSTRAINT [DF_macro_macroUseInEditor] DEFAULT (0),
|
||||
[macroRefreshRate] [int] NOT NULL CONSTRAINT [DF_macro_macroRefreshRate] DEFAULT (0),
|
||||
[macroAlias] [nvarchar] (255) NOT NULL,
|
||||
[macroName] [nvarchar] (255) NULL,
|
||||
[macroScriptType] [nvarchar] (255) NULL,
|
||||
[macroScriptAssembly] [nvarchar] (255) NULL,
|
||||
[macroXSLT] [nvarchar] (255) NULL,
|
||||
[macroCacheByPage] [bit] NOT NULL CONSTRAINT [DF_cmsMacro_macroCacheByPage] DEFAULT (1),
|
||||
[macroCachePersonalized] [bit] NOT NULL CONSTRAINT [DF_cmsMacro_macroCachePersonalized] DEFAULT (0),
|
||||
[macroDontRender] [bit] NOT NULL CONSTRAINT [DF_cmsMacro_macroDontRender] DEFAULT (0)
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsMacro] ADD CONSTRAINT [PK_macro] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [cmsContentVersion]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
||||
[ContentId] [int] NOT NULL,
|
||||
[VersionId] [uniqueidentifier] NOT NULL,
|
||||
[VersionDate] [datetime] NOT NULL CONSTRAINT [DF_cmsContentVersion_VersionDate] DEFAULT (getdate())
|
||||
)
|
||||
|
||||
;
|
||||
CREATE TABLE [umbracoAppTree]
|
||||
(
|
||||
[treeSilent] [bit] NOT NULL CONSTRAINT [DF_umbracoAppTree_treeSilent] DEFAULT (0),
|
||||
[treeInitialize] [bit] NOT NULL CONSTRAINT [DF_umbracoAppTree_treeInitialize] DEFAULT (1),
|
||||
[treeSortOrder] [tinyint] NOT NULL,
|
||||
[appAlias] [nvarchar] (50) NOT NULL,
|
||||
[treeAlias] [nvarchar] (150) NOT NULL,
|
||||
[treeTitle] [nvarchar] (255) NOT NULL,
|
||||
[treeIconClosed] [nvarchar] (255) NOT NULL,
|
||||
[treeIconOpen] [nvarchar] (255) NOT NULL,
|
||||
[treeHandlerAssembly] [nvarchar] (255) NOT NULL,
|
||||
[treeHandlerType] [nvarchar] (255) NOT NULL,
|
||||
[action] [nvarchar] (255) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoAppTree] ADD CONSTRAINT [PK_umbracoAppTree] PRIMARY KEY ([appAlias], [treeAlias])
|
||||
;
|
||||
|
||||
CREATE TABLE [cmsContentTypeAllowedContentType]
|
||||
(
|
||||
[Id] [int] NOT NULL,
|
||||
[AllowedId] [int] NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsContentTypeAllowedContentType] ADD CONSTRAINT [PK_cmsContentTypeAllowedContentType] PRIMARY KEY ([Id], [AllowedId])
|
||||
;
|
||||
CREATE TABLE [cmsContentXml]
|
||||
(
|
||||
[nodeId] [int] NOT NULL,
|
||||
[xml] [ntext] NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsContentXml] ADD CONSTRAINT [PK_cmsContentXml] PRIMARY KEY ([nodeId])
|
||||
;
|
||||
CREATE TABLE [cmsDataType]
|
||||
(
|
||||
[pk] [int] NOT NULL IDENTITY(1, 1),
|
||||
[nodeId] [int] NOT NULL,
|
||||
[controlId] [uniqueidentifier] NOT NULL,
|
||||
[dbType] [nvarchar] (50) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsDataType] ADD CONSTRAINT [PK_cmsDataType] PRIMARY KEY ([pk])
|
||||
;
|
||||
CREATE TABLE [cmsDataTypePreValues]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[datatypeNodeId] [int] NOT NULL,
|
||||
[value] [nvarchar] (255) NULL,
|
||||
[sortorder] [int] NOT NULL,
|
||||
[alias] [nvarchar] (50) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsDataTypePreValues] ADD CONSTRAINT [PK_cmsDataTypePreValues] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [cmsDictionary]
|
||||
(
|
||||
[pk] [int] NOT NULL IDENTITY(1, 1),
|
||||
[id] [uniqueidentifier] NOT NULL,
|
||||
[parent] [uniqueidentifier] NOT NULL,
|
||||
[key] [nvarchar] (1000) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsDictionary] ADD CONSTRAINT [PK_cmsDictionary] PRIMARY KEY ([pk])
|
||||
;
|
||||
CREATE TABLE [cmsLanguageText]
|
||||
(
|
||||
[pk] [int] NOT NULL IDENTITY(1, 1),
|
||||
[languageId] [int] NOT NULL,
|
||||
[UniqueId] [uniqueidentifier] NOT NULL,
|
||||
[value] [nvarchar] (1000) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsLanguageText] ADD CONSTRAINT [PK_cmsLanguageText] PRIMARY KEY ([pk])
|
||||
;
|
||||
CREATE TABLE [cmsMember2MemberGroup]
|
||||
(
|
||||
[Member] [int] NOT NULL,
|
||||
[MemberGroup] [int] NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [cmsMember2MemberGroup] ADD CONSTRAINT [PK_cmsMember2MemberGroup] PRIMARY KEY ([Member], [MemberGroup])
|
||||
;
|
||||
CREATE TABLE [cmsStylesheet]
|
||||
(
|
||||
[nodeId] [int] NOT NULL,
|
||||
[filename] [nvarchar] (100) NOT NULL,
|
||||
[content] [ntext] NULL
|
||||
)
|
||||
|
||||
;
|
||||
CREATE TABLE [cmsStylesheetProperty]
|
||||
(
|
||||
[nodeId] [int] NOT NULL,
|
||||
[stylesheetPropertyEditor] [bit] NULL,
|
||||
[stylesheetPropertyAlias] [nvarchar] (50) NULL,
|
||||
[stylesheetPropertyValue] [nvarchar] (400) NULL
|
||||
)
|
||||
|
||||
;
|
||||
CREATE TABLE [umbracoDomains]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[domainDefaultLanguage] [int] NULL,
|
||||
[domainRootStructureID] [int] NULL,
|
||||
[domainName] [nvarchar] (255) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoDomains] ADD CONSTRAINT [PK_domains] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [umbracoLanguage]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[languageISOCode] [nvarchar] (10) NULL,
|
||||
[languageCultureName] [nvarchar] (100) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoLanguage] ADD CONSTRAINT [PK_language] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [umbracoRelationType]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[dual] [bit] NOT NULL,
|
||||
[parentObjectType] [uniqueidentifier] NOT NULL,
|
||||
[childObjectType] [uniqueidentifier] NOT NULL,
|
||||
[name] [nvarchar] (255) NOT NULL,
|
||||
[alias] [nvarchar] (100) NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoRelationType] ADD CONSTRAINT [PK_umbracoRelationType] PRIMARY KEY ([id])
|
||||
;
|
||||
|
||||
/* TABLE IS NEVER USED, REMOVED FOR 4.1
|
||||
|
||||
CREATE TABLE [umbracoStylesheet]
|
||||
(
|
||||
[nodeId] [int] NOT NULL,
|
||||
[filename] [nvarchar] (100) NOT NULL,
|
||||
[content] [ntext] NULL
|
||||
)
|
||||
;
|
||||
|
||||
ALTER TABLE [umbracoStylesheet] ADD CONSTRAINT [PK_umbracoStylesheet] PRIMARY KEY ([nodeId])
|
||||
;
|
||||
|
||||
*/
|
||||
|
||||
CREATE TABLE [umbracoUser2NodeNotify]
|
||||
(
|
||||
[userId] [int] NOT NULL,
|
||||
[nodeId] [int] NOT NULL,
|
||||
[action] [nchar] (1) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoUser2NodeNotify] ADD CONSTRAINT [PK_umbracoUser2NodeNotify] PRIMARY KEY ([userId], [nodeId], [action])
|
||||
;
|
||||
CREATE TABLE [umbracoUser2NodePermission]
|
||||
(
|
||||
[userId] [int] NOT NULL,
|
||||
[nodeId] [int] NOT NULL,
|
||||
[permission] [nchar] (1) NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoUser2NodePermission] ADD CONSTRAINT [PK_umbracoUser2NodePermission] PRIMARY KEY ([userId], [nodeId], [permission])
|
||||
;
|
||||
CREATE TABLE [umbracoUserLogins]
|
||||
(
|
||||
[contextID] [uniqueidentifier] NOT NULL,
|
||||
[userID] [int] NOT NULL,
|
||||
[timeout] [bigint] NOT NULL
|
||||
)
|
||||
|
||||
;
|
||||
ALTER TABLE [umbracoAppTree] ADD
|
||||
CONSTRAINT [FK_umbracoAppTree_umbracoApp] FOREIGN KEY ([appAlias]) REFERENCES [umbracoApp] ([appAlias])
|
||||
;
|
||||
ALTER TABLE [cmsPropertyData] ADD
|
||||
CONSTRAINT [FK_cmsPropertyData_umbracoNode] FOREIGN KEY ([contentNodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
|
||||
/* TABLES ARE NEVER USED, REMOVED FOR 4.1
|
||||
|
||||
ALTER TABLE [umbracoUser2userGroup] ADD
|
||||
CONSTRAINT [FK_user2userGroup_user] FOREIGN KEY ([user]) REFERENCES [umbracoUser] ([id]),
|
||||
CONSTRAINT [FK_user2userGroup_userGroup] FOREIGN KEY ([userGroup]) REFERENCES [umbracoUserGroup] ([id])
|
||||
;
|
||||
|
||||
*/
|
||||
|
||||
ALTER TABLE [cmsDocument] ADD
|
||||
CONSTRAINT [FK_cmsDocument_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsMacroProperty] ADD
|
||||
CONSTRAINT [FK_umbracoMacroProperty_umbracoMacroPropertyType] FOREIGN KEY ([macroPropertyType]) REFERENCES [cmsMacroPropertyType] ([id])
|
||||
;
|
||||
ALTER TABLE [umbracoUser] ADD
|
||||
CONSTRAINT [FK_user_userType] FOREIGN KEY ([userType]) REFERENCES [umbracoUserType] ([id])
|
||||
;
|
||||
ALTER TABLE [umbracoNode] ADD
|
||||
CONSTRAINT [FK_umbracoNode_umbracoNode] FOREIGN KEY ([parentID]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsTemplate] ADD
|
||||
CONSTRAINT [FK_cmsTemplate_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsContentType] ADD
|
||||
CONSTRAINT [FK_cmsContentType_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsPropertyType] ADD
|
||||
CONSTRAINT [FK_cmsPropertyType_cmsTab] FOREIGN KEY ([tabId]) REFERENCES [cmsTab] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsContent] ADD
|
||||
CONSTRAINT [FK_cmsContent_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [umbracoUser2app] ADD
|
||||
CONSTRAINT [FK_umbracoUser2app_umbracoApp] FOREIGN KEY ([app]) REFERENCES [umbracoApp] ([appAlias]),
|
||||
CONSTRAINT [FK_umbracoUser2app_umbracoUser] FOREIGN KEY ([user]) REFERENCES [umbracoUser] ([id])
|
||||
;
|
||||
|
||||
ALTER TABLE [cmsTemplate] DROP CONSTRAINT [FK_cmsTemplate_umbracoNode]
|
||||
;
|
||||
ALTER TABLE [cmsPropertyType] DROP CONSTRAINT [FK_cmsPropertyType_cmsTab]
|
||||
;
|
||||
ALTER TABLE [cmsContent] DROP CONSTRAINT [FK_cmsContent_umbracoNode]
|
||||
;
|
||||
ALTER TABLE [cmsMacroProperty] DROP CONSTRAINT [FK_umbracoMacroProperty_umbracoMacroPropertyType]
|
||||
;
|
||||
ALTER TABLE [umbracoAppTree] DROP CONSTRAINT [FK_umbracoAppTree_umbracoApp]
|
||||
;
|
||||
ALTER TABLE [umbracoUser2app] DROP CONSTRAINT [FK_umbracoUser2app_umbracoApp]
|
||||
;
|
||||
ALTER TABLE [umbracoUser2app] DROP CONSTRAINT [FK_umbracoUser2app_umbracoUser]
|
||||
;
|
||||
ALTER TABLE [cmsPropertyData] DROP CONSTRAINT [FK_cmsPropertyData_umbracoNode]
|
||||
;
|
||||
|
||||
/* TABLE IS NEVER USED, REMOVED FOR 4.1
|
||||
|
||||
ALTER TABLE [umbracoUser2userGroup] DROP CONSTRAINT [FK_user2userGroup_user]
|
||||
;
|
||||
ALTER TABLE [umbracoUser2userGroup] DROP CONSTRAINT [FK_user2userGroup_userGroup]
|
||||
;
|
||||
|
||||
*/
|
||||
|
||||
ALTER TABLE [umbracoUser] DROP CONSTRAINT [FK_user_userType]
|
||||
;
|
||||
ALTER TABLE [cmsContentType] DROP CONSTRAINT [FK_cmsContentType_umbracoNode]
|
||||
;
|
||||
ALTER TABLE [cmsDocument] DROP CONSTRAINT [FK_cmsDocument_umbracoNode]
|
||||
;
|
||||
ALTER TABLE [umbracoNode] DROP CONSTRAINT [FK_umbracoNode_umbracoNode]
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [umbracoNode] ON
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-92, 0, -1, 0, 11, N'-1,-92', 37, 'f0bc4bfb-b499-40d6-ba86-058885a5178c', N'Label', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-90, 0, -1, 0, 11, N'-1,-90', 35, '84c6b441-31df-4ffe-b67e-67d5bc3ae65a', N'Upload', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-89, 0, -1, 0, 11, N'-1,-89', 34, 'c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3', N'Textbox multiple', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-88, 0, -1, 0, 11, N'-1,-88', 33, '0cc0eba1-9960-42c9-bf9b-60e150b429ae', N'Textstring', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-87, 0, -1, 0, 11, N'-1,-87', 32, 'ca90c950-0aff-4e72-b976-a30b1ac57dad', N'Richtext editor', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
||INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-51, 0, -1, 0, 11, N'-1,-51', 4, '2e6d3631-066e-44b8-aec4-96f09099b2b5', N'Numeric', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
||INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-49, 0, -1, 0, 11, N'-1,-49', 2, '92897bc6-a5f3-4ffe-ae27-f2e7e33dda49', N'True/false', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-43, 0, -1, 0, 1, N'-1,-43', 2, 'fbaf13a8-4036-41f2-93a3-974f678c312a', N'Checkbox list', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:11:04.367')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-42, 0, -1, 0, 1, N'-1,-42', 2, '0b6a45e7-44ba-430d-9da5-4e46060b9e03', N'Dropdown', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:10:59.000')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-41, 0, -1, 0, 1, N'-1,-41', 2, '5046194e-4237-453c-a547-15db3a07c4e1', N'Date Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:10:54.303')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-40, 0, -1, 0, 1, N'-1,-40', 2, 'bb5f57c9-ce2b-4bb9-b697-4caca783a805', N'Radiobox', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:10:49.253')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-39, 0, -1, 0, 1, N'-1,-39', 2, 'f38f0ac7-1d27-439c-9f3f-089cd8825a53', N'Dropdown multiple', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:10:44.480')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-38, 0, -1, 0, 1, N'-1,-38', 2, 'fd9f1447-6c61-4a7c-9595-5aa39147d318', N'Folder Browser', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:10:37.020')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-37, 0, -1, 0, 1, N'-1,-37', 2, '0225af17-b302-49cb-9176-b9f35cab9c17', N'Approved Color', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:10:30.580')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-36, 0, -1, 0, 1, N'-1,-36', 2, 'e4d66c0f-b935-4200-81f0-025f7256b89a', N'Date Picker with time', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20041015 14:10:23.007')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-1, 0, -1, 0, 0, N'-1', 0, '916724a5-173d-4619-b97e-b9de133dd6f5', N'SYSTEM DATA: umbraco master root', 'ea7d8624-4cfe-4578-a871-24aa946bf34d', '20040930 14:01:49.920')
|
||||
||INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1031, 0, -1, 1, 1, N'-1,1031', 2, 'f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d', N'Folder', '4ea4382b-2f5a-4c2b-9587-ae9b3cf3602e', '20041201 00:13:40.743')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1032, 0, -1, 1, 1, N'-1,1032', 2, 'cc07b313-0843-4aa8-bbda-871c8da728c8', N'Image', '4ea4382b-2f5a-4c2b-9587-ae9b3cf3602e', '20041201 00:13:43.737')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1033, 0, -1, 1, 1, N'-1,1033', 2, '4c52d8ab-54e6-40cd-999c-7a5f24903e4d', N'File', '4ea4382b-2f5a-4c2b-9587-ae9b3cf3602e', '20041201 00:13:46.210')
|
||||
||INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1034, 0, -1, 0, 1, N'-1,1034', 2, 'a6857c73-d6e9-480c-b6e6-f15f6ad11125', N'Content Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20060103 13:07:29.203')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1035, 0, -1, 0, 1, N'-1,1035', 2, '93929b9a-93a2-4e2a-b239-d99334440a59', N'Media Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20060103 13:07:36.143')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1036, 0, -1, 0, 1, N'-1,1036', 2, '2b24165f-9782-4aa3-b459-1de4a4d21f60', N'Member Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20060103 13:07:40.260')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1038, 0, -1, 0, 1, N'-1,1038', 2, '1251c96c-185c-4e9b-93f4-b48205573cbd', N'Simple Editor', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20060103 13:07:55.250')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1039, 0, -1, 0, 1, N'-1,1039', 2, '06f349a9-c949-4b6a-8660-59c10451af42', N'Ultimate Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20060103 13:07:55.250')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1040, 0, -1, 0, 1, N'-1,1040', 2, '21e798da-e06e-4eda-a511-ed257f78d4fa', N'Related Links', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20060103 13:07:55.250')
|
||||
|INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (1041, 0, -1, 0, 1, N'-1,1041', 2, 'b6b73142-b9c1-4bf8-a16d-e1c23320b549', N'Tags', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20060103 13:07:55.250')
|
||||
|SET IDENTITY_INSERT [umbracoNode] OFF
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [cmsContentType] ON
|
||||
|INSERT INTO [cmsContentType] ([pk], [nodeId], [alias], [icon]) VALUES (532, 1031, N'Folder', N'folder.gif')
|
||||
|INSERT INTO [cmsContentType] ([pk], [nodeId], [alias], [icon]) VALUES (533, 1032, N'Image', N'mediaPhoto.gif')
|
||||
|INSERT INTO [cmsContentType] ([pk], [nodeId], [alias], [icon]) VALUES (534, 1033, N'File', N'mediaMulti.gif')
|
||||
|SET IDENTITY_INSERT [cmsContentType] OFF
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [umbracoUser] ON
|
||||
|INSERT INTO [umbracoUser] ([id], [userDisabled], [userNoConsole], [userType], [startStructureID], [startMediaID], [userName], [userLogin], [userPassword], [userEmail], [userDefaultPermissions], [userLanguage]) VALUES (0, 0, 0, 1, -1, -1, N'Administrator', N'admin', N'default', N'', NULL, N'en')
|
||||
|SET IDENTITY_INSERT [umbracoUser] OFF
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [umbracoUserType] ON
|
||||
|INSERT INTO [umbracoUserType] ([id], [userTypeAlias], [userTypeName], [userTypeDefaultPermissions]) VALUES (1, N'admin', N'Administrators', N'CADMOSKTPIURZ:')
|
||||
|INSERT INTO [umbracoUserType] ([id], [userTypeAlias], [userTypeName], [userTypeDefaultPermissions]) VALUES (2, N'writer', N'Writer', N'CAH:')
|
||||
|INSERT INTO [umbracoUserType] ([id], [userTypeAlias], [userTypeName], [userTypeDefaultPermissions]) VALUES (3, N'editor', N'Editors', N'CADMOSKTPUZ:')
|
||||
|insert into umbracoUserType ([id], [userTypeAlias], [userTypeName], [userTypeDefaultPermissions]) values (4, N'translator', N'Translator', 'A')
|
||||
|SET IDENTITY_INSERT [umbracoUserType] OFF
|
||||
;
|
||||
!!!INSERT INTO [umbracoUser2app] ([user], [app]) VALUES (0, N'content')
|
||||
|INSERT INTO [umbracoUser2app] ([user], [app]) VALUES (0, N'developer')
|
||||
|INSERT INTO [umbracoUser2app] ([user], [app]) VALUES (0, N'media')
|
||||
|INSERT INTO [umbracoUser2app] ([user], [app]) VALUES (0, N'member')
|
||||
|INSERT INTO [umbracoUser2app] ([user], [app]) VALUES (0, N'settings')
|
||||
|INSERT INTO [umbracoUser2app] ([user], [app]) VALUES (0, N'users')
|
||||
|INSERT INTO [umbracoApp] ([appAlias], [sortOrder], [appIcon], [appName], [appInitWithTreeAlias]) VALUES (N'content', 0, N'.traycontent', N'Indhold', N'content')
|
||||
|INSERT INTO [umbracoApp] ([appAlias], [sortOrder], [appIcon], [appName], [appInitWithTreeAlias]) VALUES (N'developer', 7, N'.traydeveloper', N'Developer', NULL)
|
||||
|INSERT INTO [umbracoApp] ([appAlias], [sortOrder], [appIcon], [appName], [appInitWithTreeAlias]) VALUES (N'media', 1, N'.traymedia', N'Mediearkiv', NULL)
|
||||
|INSERT INTO [umbracoApp] ([appAlias], [sortOrder], [appIcon], [appName], [appInitWithTreeAlias]) VALUES (N'member', 8, N'.traymember', N'Medlemmer', NULL)
|
||||
|INSERT INTO [umbracoApp] ([appAlias], [sortOrder], [appIcon], [appName], [appInitWithTreeAlias]) VALUES (N'settings', 6, N'.traysettings', N'Indstillinger', NULL)
|
||||
|INSERT INTO [umbracoApp] ([appAlias], [sortOrder], [appIcon], [appName], [appInitWithTreeAlias]) VALUES (N'users', 5, N'.trayusers', N'Brugere', NULL)
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'content', N'content', 1, 1, 0, N'Indhold', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadContent')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'cacheBrowser', 0, 1, 0, N'CacheBrowser', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadCache')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'CacheItem', 0, 0, 0, N'Cachebrowser', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadCacheItem')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'datatype', 0, 1, 1, N'Datatyper', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadDataTypes')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'macros', 0, 1, 2, N'Macros', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadMacros')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'xslt', 0, 1, 5, N'XSLT Files', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadXslt')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'media', N'media', 0, 1, 0, N'Medier', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadMedia')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'member', N'member', 0, 1, 0, N'Medlemmer', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadMembers')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'member', N'memberGroup', 0, 1, 1, N'MemberGroups', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadMemberGroups')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'member', N'memberType', 0, 1, 2, N'Medlemstyper', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadMemberTypes')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType], [action]) VALUES (N'settings', N'dictionary', 0, 1, 3, N'Dictionary', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadDictionary', N'openDictionary()')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'settings', N'languages', 0, 1, 4, N'Languages', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadLanguages')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'settings', N'mediaTypes', 0, 1, 5, N'Medietyper', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadMediaTypes')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'settings', N'nodeTypes', 0, 1, 6, N'Dokumenttyper', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadNodeTypes')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'settings', N'stylesheetProperty', 0, 0, 0, N'Stylesheet Property', N'', N'', N'umbraco', N'loadStylesheetProperty')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'settings', N'stylesheets', 0, 1, 0, N'Stylesheets', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadStylesheets')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'settings', N'templates', 0, 1, 1, N'Templates', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadTemplates')
|
||||
|INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'users', N'users', 0, 1, 0, N'Brugere', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadUsers')
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [cmsMacroPropertyType] ON
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (3, N'mediaCurrent', N'umbraco.macroRenderings', N'media', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (4, N'contentSubs', N'umbraco.macroRenderings', N'content', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (5, N'contentRandom', N'umbraco.macroRenderings', N'content', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (6, N'contentPicker', N'umbraco.macroRenderings', N'content', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (13, N'number', N'umbraco.macroRenderings', N'numeric', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (14, N'bool', N'umbraco.macroRenderings', N'yesNo', N'Boolean')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (16, N'text', N'umbraco.macroRenderings', N'text', N'String')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (17, N'contentTree', N'umbraco.macroRenderings', N'content', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (18, N'contentType', N'umbraco.macroRenderings', N'contentTypeSingle', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (19, N'contentTypeMultiple', N'umbraco.macroRenderings', N'contentTypeMultiple', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (20, N'contentAll', N'umbraco.macroRenderings', N'content', N'Int32')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (21, N'tabPicker', N'umbraco.macroRenderings', N'tabPicker', N'String')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (22, N'tabPickerMultiple', N'umbraco.macroRenderings', N'tabPickerMultiple', N'String')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (23, N'propertyTypePicker', N'umbraco.macroRenderings', N'propertyTypePicker', N'String')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (24, N'propertyTypePickerMultiple', N'umbraco.macroRenderings', N'propertyTypePickerMultiple', N'String')
|
||||
|INSERT INTO [cmsMacroPropertyType] ([id], [macroPropertyTypeAlias], [macroPropertyTypeRenderAssembly], [macroPropertyTypeRenderType], [macroPropertyTypeBaseType]) VALUES (25, N'textMultiLine', N'umbraco.macroRenderings', N'textMultiple', N'String')
|
||||
|SET IDENTITY_INSERT [cmsMacroPropertyType] OFF
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [cmsTab] ON
|
||||
|INSERT INTO [cmsTab] ([id], [contenttypeNodeId], [text], [sortorder]) VALUES (3, 1032, N'Image', 1)
|
||||
|INSERT INTO [cmsTab] ([id], [contenttypeNodeId], [text], [sortorder]) VALUES (4, 1033, N'File', 1)
|
||||
|INSERT INTO [cmsTab] ([id], [contenttypeNodeId], [text], [sortorder]) VALUES (5, 1031, N'Contents', 1)
|
||||
|SET IDENTITY_INSERT [cmsTab] OFF
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [cmsPropertyType] ON
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (6, -90, 1032, 3, N'umbracoFile', N'Upload image', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (7, -92, 1032, 3, N'umbracoWidth', N'Width', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (8, -92, 1032, 3, N'umbracoHeight', N'Height', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (9, -92, 1032, 3, N'umbracoBytes', N'Size', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (10, -92, 1032, 3, N'umbracoExtension', N'Type', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (24, -90, 1033, 4, N'umbracoFile', N'Upload file', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (25, -92, 1033, 4, N'umbracoExtension', N'Type', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (26, -92, 1033, 4, N'umbracoBytes', N'Size', NULL, 0, 0, NULL, NULL)
|
||||
|INSERT INTO [cmsPropertyType] ([id], [dataTypeId], [contentTypeId], [tabId], [Alias], [Name], [helpText], [sortOrder], [mandatory], [validationRegExp], [Description]) VALUES (27, -38, 1031, 5, N'contents', N'Contents:', NULL, 0, 0, NULL, NULL)
|
||||
|SET IDENTITY_INSERT [cmsPropertyType] OFF
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [umbracoLanguage] ON
|
||||
|INSERT INTO [umbracoLanguage] ([id], [languageISOCode], [languageCultureName]) VALUES (1, N'en-US', N'en-US')
|
||||
|SET IDENTITY_INSERT [umbracoLanguage] OFF
|
||||
;
|
||||
INSERT INTO [cmsContentTypeAllowedContentType] ([Id], [AllowedId]) VALUES (1031, 1031)
|
||||
;
|
||||
INSERT INTO [cmsContentTypeAllowedContentType] ([Id], [AllowedId]) VALUES (1031, 1032)
|
||||
;
|
||||
INSERT INTO [cmsContentTypeAllowedContentType] ([Id], [AllowedId]) VALUES (1031, 1033)
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [cmsDataType] ON
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (4, -49, '38b352c1-e9f8-4fd8-9324-9a2eab06d97a', 'Integer')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (6, -51, '1413afcb-d19a-4173-8e9a-68288d2a73b8', 'Integer')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (8, -87, '5E9B75AE-FACE-41c8-B47E-5F4B0FD82F83', 'Ntext')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (9, -88, 'ec15c1e5-9d90-422a-aa52-4f7622c63bea', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (10, -89, '67db8357-ef57-493e-91ac-936d305e0f2a', 'Ntext')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (11, -90, '5032a6e6-69e3-491d-bb28-cd31cd11086c', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (12, -91, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (13, -92, '6c738306-4c17-4d88-b9bd-6546f3771597', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (14, -36, 'b6fb1622-afa5-4bbf-a3cc-d9672a442222', 'Date')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (15, -37, 'f8d60f68-ec59-4974-b43b-c46eb5677985', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (16, -38, 'cccd4ae9-f399-4ed2-8038-2e88d19e810c', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (17, -39, '928639ed-9c73-4028-920c-1e55dbb68783', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (18, -40, 'a52c7c1c-c330-476e-8605-d63d3b84b6a6', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (19, -41, '23e93522-3200-44e2-9f29-e61a6fcbb79a', 'Date')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (20, -42, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Integer')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (21, -43, 'b4471851-82b6-4c75-afa4-39fa9c6a75e9', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (22, -44, 'a3776494-0574-4d93-b7de-efdfdec6f2d1', 'Ntext')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (23, -128, 'a52c7c1c-c330-476e-8605-d63d3b84b6a6', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (24, -129, '928639ed-9c73-4028-920c-1e55dbb68783', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (25, -130, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (26, -131, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (27, -132, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (28, -133, '6c738306-4c17-4d88-b9bd-6546f3771597', 'Ntext')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (29, -134, '928639ed-9c73-4028-920c-1e55dbb68783', 'Nvarchar')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (30, -50, 'aaf99bb2-dbbe-444d-a296-185076bf0484', 'Date')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (31, 1034, '158aa029-24ed-4948-939e-c3da209e5fba', 'Integer')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (32, 1035, 'ead69342-f06d-4253-83ac-28000225583b', 'Integer')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (33, 1036, '39f533e4-0551-4505-a64b-e0425c5ce775', 'Integer')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (35, 1038, '60b7dabf-99cd-41eb-b8e9-4d2e669bbde9', 'Ntext')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (36, 1039, 'cdbf0b5d-5cb2-445f-bc12-fcaaec07cf2c', 'Ntext')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (37, 1040, '71b8ad1a-8dc2-425c-b6b8-faa158075e63', 'Ntext')
|
||||
|INSERT INTO [cmsDataType] ([pk], [nodeId], [controlId], [dbType]) VALUES (38, 1041, '4023e540-92f5-11dd-ad8b-0800200c9a66', 'Ntext')
|
||||
|SET IDENTITY_INSERT [cmsDataType] OFF
|
||||
;
|
||||
ALTER TABLE [cmsTemplate] ADD CONSTRAINT [FK_cmsTemplate_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsPropertyType] ADD CONSTRAINT [FK_cmsPropertyType_cmsTab] FOREIGN KEY ([tabId]) REFERENCES [cmsTab] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsContent] ADD CONSTRAINT [FK_cmsContent_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsMacroProperty] ADD CONSTRAINT [FK_umbracoMacroProperty_umbracoMacroPropertyType] FOREIGN KEY ([macroPropertyType]) REFERENCES [cmsMacroPropertyType] ([id])
|
||||
;
|
||||
ALTER TABLE [umbracoAppTree] ADD CONSTRAINT [FK_umbracoAppTree_umbracoApp] FOREIGN KEY ([appAlias]) REFERENCES [umbracoApp] ([appAlias])
|
||||
;
|
||||
ALTER TABLE [umbracoUser2app] ADD CONSTRAINT [FK_umbracoUser2app_umbracoApp] FOREIGN KEY ([app]) REFERENCES [umbracoApp] ([appAlias])
|
||||
;
|
||||
ALTER TABLE [umbracoUser2app] ADD CONSTRAINT [FK_umbracoUser2app_umbracoUser] FOREIGN KEY ([user]) REFERENCES [umbracoUser] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsPropertyData] ADD CONSTRAINT [FK_cmsPropertyData_umbracoNode] FOREIGN KEY ([contentNodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [umbracoUser] ADD CONSTRAINT [FK_user_userType] FOREIGN KEY ([userType]) REFERENCES [umbracoUserType] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsContentType] ADD CONSTRAINT [FK_cmsContentType_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [cmsDocument] ADD CONSTRAINT [FK_cmsDocument_umbracoNode] FOREIGN KEY ([nodeId]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
ALTER TABLE [umbracoNode] ADD CONSTRAINT [FK_umbracoNode_umbracoNode] FOREIGN KEY ([parentID]) REFERENCES [umbracoNode] ([id])
|
||||
;
|
||||
!!!set identity_insert umbracoNode on
|
||||
|insert into umbracoNode (id, trashed, parentID, nodeUser, level, path, sortOrder, uniqueID, text, nodeObjectType) values (-20, 0, -1, 0, 0, '-1,-20', 0, '0F582A79-1E41-4CF0-BFA0-76340651891A', 'Recycle Bin', '01BB7FF2-24DC-4C0C-95A2-C24EF72BBAC8')
|
||||
|set identity_insert umbracoNode off
|
||||
;
|
||||
ALTER TABLE cmsDataTypePreValues ALTER COLUMN value NVARCHAR(2500) NULL
|
||||
;
|
||||
CREATE TABLE [cmsTask]
|
||||
(
|
||||
[closed] [bit] NOT NULL CONSTRAINT [DF__cmsTask__closed__04E4BC85] DEFAULT ((0)),
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[taskTypeId] [int] NOT NULL,
|
||||
[nodeId] [int] NOT NULL,
|
||||
[parentUserId] [int] NOT NULL,
|
||||
[userId] [int] NOT NULL,
|
||||
[DateTime] [datetime] NOT NULL CONSTRAINT [DF__cmsTask__DateTim__05D8E0BE] DEFAULT (getdate()),
|
||||
[Comment] [nvarchar] (500) NULL
|
||||
)
|
||||
;
|
||||
ALTER TABLE [cmsTask] ADD CONSTRAINT [PK_cmsTask] PRIMARY KEY ([id])
|
||||
;
|
||||
CREATE TABLE [cmsTaskType]
|
||||
(
|
||||
[id] [int] NOT NULL IDENTITY(1, 1),
|
||||
[alias] [nvarchar] (255) NOT NULL
|
||||
)
|
||||
;
|
||||
ALTER TABLE [cmsTaskType] ADD CONSTRAINT [PK_cmsTaskType] PRIMARY KEY ([id])
|
||||
;
|
||||
ALTER TABLE [cmsTask] ADD
|
||||
CONSTRAINT [FK_cmsTask_cmsTaskType] FOREIGN KEY ([taskTypeId]) REFERENCES [cmsTaskType] ([id])
|
||||
;
|
||||
insert into cmsTaskType (alias) values ('toTranslate')
|
||||
;
|
||||
/* Add send to translate actions to admins and editors */
|
||||
update umbracoUserType set userTypeDefaultPermissions = userTypeDefaultPermissions + '5' where userTypeAlias in ('editor','admin')
|
||||
;
|
||||
/* Add translator usertype */
|
||||
;
|
||||
insert into umbracoRelationType (dual, parentObjectType, childObjectType, name, alias) values (1, 'c66ba18e-eaf3-4cff-8a22-41b16d66a972', 'c66ba18e-eaf3-4cff-8a22-41b16d66a972', 'Relate Document On Copy','relateDocumentOnCopy')
|
||||
;
|
||||
ALTER TABLE cmsMacro ADD macroPython nvarchar(255)
|
||||
;
|
||||
|
||||
INSERT INTO [umbracoAppTree]([treeSilent], [treeInitialize], [treeSortOrder], [appAlias], [treeAlias], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES(0, 1, 4, 'developer', 'python', 'Python Files', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadPython')
|
||||
;
|
||||
INSERT INTO [umbracoAppTree]([treeSilent], [treeInitialize], [treeSortOrder], [appAlias], [treeAlias], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES(0, 1, 2, 'settings', 'scripts', 'Scripts', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadScripts')
|
||||
;
|
||||
alter TABLE [cmsContentType]
|
||||
add [thumbnail] nvarchar(255) NOT NULL CONSTRAINT
|
||||
[DF_cmsContentType_thumbnail] DEFAULT ('folder.png')
|
||||
;
|
||||
alter TABLE [cmsContentType]
|
||||
add [description] nvarchar(1500) NULL
|
||||
;
|
||||
ALTER TABLE umbracoLog ALTER COLUMN logComment NVARCHAR(4000) NULL
|
||||
;
|
||||
!!!SET IDENTITY_INSERT [cmsDataTypePreValues] ON
|
||||
|insert into cmsDataTypePreValues (id, dataTypeNodeId, [value], sortorder, alias) values (3,-87,',code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,mcecharmap,' + nchar(124) + '1' + nchar(124) + '1,2,3,' + nchar(124) + '0' + nchar(124) + '500,400' + nchar(124) + '1049,' + nchar(124) + '', 0, '')
|
||||
|insert into cmsDataTypePreValues (id, dataTypeNodeId, [value], sortorder, alias) values (4,1041,'default', 0, 'group')
|
||||
|SET IDENTITY_INSERT [cmsDataTypePreValues] OFF
|
||||
;
|
||||
/* 3.1 SQL changes */
|
||||
INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'packager', 0, 1, 3, N'Packages', N'folder.gif', N'folder_o.gif', N'umbraco', N'loadPackager')
|
||||
;
|
||||
INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'packagerPackages', 0, 0, 1, N'Packager Packages', N'folder.gif', N'folder_o.gif', N'umbraco', N'loadPackages');
|
||||
|
||||
|
||||
/* Add ActionBrowse as a default permission to all user types that have ActionUpdate */
|
||||
UPDATE umbracoUserType SET userTypeDefaultPermissions = userTypeDefaultPermissions + 'F' WHERE CHARINDEX('A',userTypeDefaultPermissions,0) >= 1
|
||||
AND CHARINDEX('F',userTypeDefaultPermissions,0) < 1
|
||||
;
|
||||
/* Add ActionToPublish to all users types that have the alias 'writer' */
|
||||
UPDATE umbracoUserType SET userTypeDefaultPermissions = userTypeDefaultPermissions + 'H' WHERE userTypeAlias = 'writer'
|
||||
AND CHARINDEX('F',userTypeDefaultPermissions,0) < 1
|
||||
;
|
||||
/* Add ActionBrowse to all user permissions for nodes that have the ActionUpdate permission */
|
||||
INSERT INTO umbracoUser2NodePermission (userID, nodeId, permission)
|
||||
SELECT userID, nodeId, 'F' FROM umbracoUser2NodePermission WHERE permission='A'
|
||||
;
|
||||
/* Add ActionToPublish permissions to all nodes for users that are of type 'writer' */
|
||||
INSERT INTO umbracoUser2NodePermission (userID, nodeId, permission)
|
||||
SELECT DISTINCT userID, nodeId, 'H' FROM umbracoUser2NodePermission WHERE userId IN
|
||||
(SELECT umbracoUser.id FROM umbracoUserType INNER JOIN umbracoUser ON umbracoUserType.id = umbracoUser.userType WHERE (umbracoUserType.userTypeAlias = 'writer'))
|
||||
;
|
||||
/* Add the contentRecycleBin tree type */
|
||||
INSERT INTO umbracoAppTree (treeSilent, treeInitialize, treeSortOrder, appAlias, treeAlias, treeTitle, treeIconClosed, treeIconOpen, treeHandlerAssembly, treeHandlerType)
|
||||
VALUES (0, 0, 0, 'content', 'contentRecycleBin', 'RecycleBin', 'folder.gif', 'folder_o.gif', 'umbraco', 'cms.presentation.Trees.ContentRecycleBin')
|
||||
;
|
||||
/* Add the UserType tree type */
|
||||
INSERT INTO umbracoAppTree (treeSilent, treeInitialize, treeSortOrder, appAlias, treeAlias, treeTitle, treeIconClosed, treeIconOpen, treeHandlerAssembly, treeHandlerType)
|
||||
VALUES (0, 1, 1, 'users', 'userTypes', 'User Types', 'folder.gif', 'folder_o.gif', 'umbraco', 'cms.presentation.Trees.UserTypes')
|
||||
;
|
||||
/* Add the User Permission tree type */
|
||||
INSERT INTO umbracoAppTree (treeSilent, treeInitialize, treeSortOrder, appAlias, treeAlias, treeTitle, treeIconClosed, treeIconOpen, treeHandlerAssembly, treeHandlerType)
|
||||
VALUES (0, 1, 2, 'users', 'userPermissions', 'User Permissions', 'folder.gif', 'folder_o.gif', 'umbraco', 'cms.presentation.Trees.UserPermissions');
|
||||
|
||||
|
||||
/* TRANSLATION RELATED SQL */
|
||||
INSERT INTO [umbracoApp] ([appAlias], [sortOrder], [appIcon], [appName], [appInitWithTreeAlias]) VALUES (N'translation', 5, N'.traytranslation', N'Translation', NULL)
|
||||
;
|
||||
INSERT INTO umbracoAppTree (treeSilent, treeInitialize, treeSortOrder, appAlias, treeAlias, treeTitle, treeIconClosed, treeIconOpen, treeHandlerAssembly, treeHandlerType)
|
||||
VALUES (0, 1, 1, 'translation','openTasks', 'Tasks assigned to you', '.sprTreeFolder', '.sprTreeFolder_o', 'umbraco', 'loadOpenTasks');
|
||||
;
|
||||
INSERT INTO umbracoAppTree (treeSilent, treeInitialize, treeSortOrder, appAlias, treeAlias, treeTitle, treeIconClosed, treeIconOpen, treeHandlerAssembly, treeHandlerType)
|
||||
VALUES (0, 1, 2, 'translation','yourTasks', 'Tasks created by you', '.sprTreeFolder', '.sprTreeFolder_o', 'umbraco', 'loadYourTasks');
|
||||
;
|
||||
alter TABLE [cmsContentType]
|
||||
add [masterContentType] int NULL CONSTRAINT
|
||||
[DF_cmsContentType_masterContentType] DEFAULT (0)
|
||||
;
|
||||
CREATE TABLE [cmsTagRelationship](
|
||||
[nodeId] [int] NOT NULL,
|
||||
[tagId] [int] NOT NULL)
|
||||
;
|
||||
|
||||
CREATE TABLE [cmsTags](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[tag] [nvarchar](200) NULL,
|
||||
[parentId] [int] NULL,
|
||||
[group] [nvarchar](100) NULL)
|
||||
;
|
||||
alter TABLE [umbracoUser]
|
||||
add [defaultToLiveEditing] bit NOT NULL CONSTRAINT
|
||||
[DF_umbracoUser_defaultToLiveEditing] DEFAULT (0)
|
||||
;
|
||||
|
||||
/* INSERT NEW MEDIA RECYCLE BIN NODE */
|
||||
!!!SET IDENTITY_INSERT [umbracoNode] ON
|
||||
|INSERT INTO umbracoNode (id, trashed, parentID, nodeUser, level, path, sortOrder, uniqueID, text, nodeObjectType) VALUES (-21, 0, -1, 0, 0, '-1,-21', 0, 'BF7C7CBC-952F-4518-97A2-69E9C7B33842', 'Recycle Bin', 'CF3D8E34-1C1C-41e9-AE56-878B57B32113')
|
||||
|SET IDENTITY_INSERT [umbracoNode] OFF
|
||||
;
|
||||
/* Add the mediaRecycleBin tree type */
|
||||
INSERT INTO umbracoAppTree (treeSilent, treeInitialize, treeSortOrder, appAlias, treeAlias, treeTitle, treeIconClosed, treeIconOpen, treeHandlerAssembly, treeHandlerType)
|
||||
VALUES (0, 0, 0, 'media', 'mediaRecycleBin', 'RecycleBin', 'folder.gif', 'folder_o.gif', 'umbraco', 'cms.presentation.Trees.MediaRecycleBin')
|
||||
;
|
||||
|
||||
/* PREVIEW */
|
||||
CREATE TABLE [cmsPreviewXml](
|
||||
[nodeId] [int] NOT NULL,
|
||||
[versionId] [uniqueidentifier] NOT NULL,
|
||||
[timestamp] [datetime] NOT NULL,
|
||||
[xml] [ntext] NOT NULL)
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************************************************
|
||||
|
||||
ADD NEW PRIMARY KEYS, FOREIGN KEYS AND INDEXES FOR VERSION 4.1
|
||||
|
||||
IMPORTANT!!!!!
|
||||
YOU MUST MAKE SURE THAT THE SCRIPT BELOW THIS MATCHES THE KeysIndexesAndConstraints.sql FILE FOR THE MANUAL UPGRADE
|
||||
|
||||
*/
|
||||
|
||||
/************************** CLEANUP ***********************************************/
|
||||
|
||||
/************************** CLEANUP END ********************************************/
|
||||
|
||||
/************************** RESEEDING NEEDED FOR SQL CE 4 ************************/
|
||||
ALTER TABLE [umbracoNode] ALTER COLUMN id IDENTITY(1042,1)
|
||||
;
|
||||
ALTER TABLE [cmsContentType] ALTER COLUMN pk IDENTITY(535,1)
|
||||
;
|
||||
ALTER TABLE [umbracoUser] ALTER COLUMN id IDENTITY(1,1)
|
||||
;
|
||||
ALTER TABLE [umbracoUserType] ALTER COLUMN id IDENTITY(5,1)
|
||||
;
|
||||
ALTER TABLE [cmsMacroPropertyType] ALTER COLUMN id IDENTITY(26,1)
|
||||
;
|
||||
ALTER TABLE [cmsTab] ALTER COLUMN id IDENTITY(6,1)
|
||||
;
|
||||
ALTER TABLE [cmsPropertyType] ALTER COLUMN id IDENTITY(28,1)
|
||||
;
|
||||
ALTER TABLE [umbracoLanguage] ALTER COLUMN id IDENTITY(2,1)
|
||||
;
|
||||
ALTER TABLE [cmsDataType] ALTER COLUMN pk IDENTITY(39,1)
|
||||
;
|
||||
ALTER TABLE [cmsDataTypePreValues] ALTER COLUMN id IDENTITY(5,1)
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{5BA5425F-27A7-4677-865E-82246498AA2E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SQLCE4Umbraco</RootNamespace>
|
||||
<AssemblyName>SQLCE4Umbraco</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</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="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\foreign dlls\SQLCE4\System.Data.SqlServerCe.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" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SqlCeApplicationBlock.cs" />
|
||||
<Compile Include="SqlCEDataReader.cs" />
|
||||
<Compile Include="SqlCEHelper.cs" />
|
||||
<Compile Include="SqlCEInstaller.cs" />
|
||||
<Compile Include="SqlCEParameter.cs" />
|
||||
<Compile Include="SqlCeProviderException.cs" />
|
||||
<Compile Include="SqlCEResources1.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>SqlCEResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SqlCETableUtility.cs" />
|
||||
<Compile Include="SqlCEUtility.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Sql\Total.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="SqlCEResources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>SqlCEResources1.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\umbraco\datalayer\umbraco.datalayer.csproj">
|
||||
<Project>{C7CB79F0-1C97-4B33-BFA7-00731B579AE2}</Project>
|
||||
<Name>umbraco.datalayer</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<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,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/************************************************************************************
|
||||
*
|
||||
* Umbraco Data Layer
|
||||
* MIT Licensed work
|
||||
* ©2008 Ruben Verborgh
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
using System.Data.SqlServerCe;
|
||||
using umbraco.DataLayer;
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that adapts a SqlDataReader.SqlDataReader to a RecordsReaderAdapter.
|
||||
/// </summary>
|
||||
public class SqlCeDataReaderHelper : RecordsReaderAdapter<SqlCeDataReader>
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqlServerDataReader"/> class.
|
||||
/// </summary>
|
||||
/// <param name="dataReader">The data reader.</param>
|
||||
public SqlCeDataReaderHelper(System.Data.SqlServerCe.SqlCeDataReader dataReader) : base(dataReader) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region RecordsReaderAdapter Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance has records.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if this instance has records; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public override bool HasRecords
|
||||
{
|
||||
get { return DataReader.HasRows; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/************************************************************************************
|
||||
*
|
||||
* Umbraco Data Layer
|
||||
* MIT Licensed work
|
||||
* ©2008 Ruben Verborgh
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.Xml;
|
||||
using System.Diagnostics;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.DataLayer.SqlHelpers.SqlServer;
|
||||
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
/// <summary>
|
||||
/// Sql Helper for an SQL Server database.
|
||||
/// </summary>
|
||||
public class SqlCEHelper : SqlHelper<SqlCeParameter>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqlCEHelper"/> class.
|
||||
/// </summary>
|
||||
/// <param name="connectionString">The connection string.</param>
|
||||
public SqlCEHelper(string connectionString) : base(connectionString)
|
||||
{
|
||||
m_Utility = new SqlCEUtility(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new parameter for use with this specific implementation of ISqlHelper.
|
||||
/// </summary>
|
||||
/// <param name="parameterName">Name of the parameter.</param>
|
||||
/// <param name="value">Value of the parameter.</param>
|
||||
/// <returns>A new parameter of the correct type.</returns>
|
||||
/// <remarks>Abstract factory pattern</remarks>
|
||||
public override IParameter CreateParameter(string parameterName, object value)
|
||||
{
|
||||
return new SqlCEParameter(parameterName, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes a command that returns a single value.
|
||||
/// </summary>
|
||||
/// <param name="commandText">The command text.</param>
|
||||
/// <param name="parameters">The parameters.</param>
|
||||
/// <returns>The return value of the command.</returns>
|
||||
protected override object ExecuteScalar(string commandText, SqlCeParameter[] parameters)
|
||||
{
|
||||
#if DEBUG && DebugDataLayer
|
||||
// Log Query Execution
|
||||
Trace.TraceInformation(GetType().Name + " SQL ExecuteScalar: " + commandText);
|
||||
#endif
|
||||
|
||||
return SqlCeApplicationBlock.ExecuteScalar(ConnectionString, CommandType.Text, commandText, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes a command and returns the number of rows affected.
|
||||
/// </summary>
|
||||
/// <param name="commandText">The command text.</param>
|
||||
/// <param name="parameters">The parameters.</param>
|
||||
/// <returns>
|
||||
/// The number of rows affected by the command.
|
||||
/// </returns>
|
||||
protected override int ExecuteNonQuery(string commandText, SqlCeParameter[] parameters)
|
||||
{
|
||||
#if DEBUG && DebugDataLayer
|
||||
// Log Query Execution
|
||||
Trace.TraceInformation(GetType().Name + " SQL ExecuteNonQuery: " + commandText);
|
||||
#endif
|
||||
|
||||
return SqlCeApplicationBlock.ExecuteNonQuery(ConnectionString, CommandType.Text, commandText, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes a command and returns a records reader containing the results.
|
||||
/// </summary>
|
||||
/// <param name="commandText">The command text.</param>
|
||||
/// <param name="parameters">The parameters.</param>
|
||||
/// <returns>
|
||||
/// A data reader containing the results of the command.
|
||||
/// </returns>
|
||||
protected override IRecordsReader ExecuteReader(string commandText, SqlCeParameter[] parameters)
|
||||
{
|
||||
#if DEBUG && DebugDataLayer
|
||||
// Log Query Execution
|
||||
Trace.TraceInformation(GetType().Name + " SQL ExecuteReader: " + commandText);
|
||||
#endif
|
||||
|
||||
return new SqlCeDataReaderHelper(SqlCeApplicationBlock.ExecuteReader(ConnectionString, CommandType.Text,
|
||||
commandText, parameters));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/************************************************************************************
|
||||
*
|
||||
* Umbraco Data Layer
|
||||
* MIT Licensed work
|
||||
* ©2008 Ruben Verborgh
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Resources;
|
||||
using umbraco.DataLayer.Utility.Installer;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
/// <summary>
|
||||
/// Database installer for an SQL Server data source.
|
||||
/// </summary>
|
||||
public class SqlCEInstaller : DefaultInstallerUtility<SqlCEHelper>
|
||||
{
|
||||
#region Private Constants
|
||||
|
||||
/// <summary>The latest database version this installer supports.</summary>
|
||||
private const DatabaseVersion LatestVersionSupported = DatabaseVersion.Version4_1;
|
||||
|
||||
/// <summary>The specifications to determine the database version.</summary>
|
||||
private static readonly VersionSpecs[] m_VersionSpecs = new VersionSpecs[] {
|
||||
new VersionSpecs("id","umbracoNode", "-21", DatabaseVersion.Version4_1),
|
||||
new VersionSpecs("action","umbracoAppTree",DatabaseVersion.Version4),
|
||||
new VersionSpecs("description","cmsContentType",DatabaseVersion.Version3),
|
||||
new VersionSpecs("id","sysobjects",DatabaseVersion.None) };
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the installer can upgrade the data source.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if the installer can upgrade the data source; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
/// <remarks>Empty data sources can't be upgraded, just installed.</remarks>
|
||||
public override bool CanUpgrade
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets the version specification for evaluation by DetermineCurrentVersion.
|
||||
/// Only first matching specification is taken into account.
|
||||
/// </summary>
|
||||
/// <value>The version specifications.</value>
|
||||
protected override VersionSpecs[] VersionSpecs
|
||||
{
|
||||
get { return m_VersionSpecs; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqlCEInstaller"/> class.
|
||||
/// </summary>
|
||||
/// <param name="sqlHelper">The SQL helper.</param>
|
||||
public SqlCEInstaller(SqlCEHelper sqlHelper) : base(sqlHelper, LatestVersionSupported)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region DefaultInstaller Members
|
||||
|
||||
/// <summary>
|
||||
/// Returns the sql to do a full install
|
||||
/// </summary>
|
||||
protected override string FullInstallSql
|
||||
{
|
||||
get { return SqlCEResources.Total; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the sql to do an upgrade
|
||||
/// </summary>
|
||||
protected override string UpgradeSql
|
||||
{
|
||||
get
|
||||
{
|
||||
string upgradeFile = string.Format("{0}_Upgrade", CurrentVersion.ToString());
|
||||
return SqlCEResources.ResourceManager.GetString(upgradeFile);
|
||||
}
|
||||
}
|
||||
|
||||
// We need to override this as the default way of detection a db connection checks for systables that doesn't exist
|
||||
// in a CE db
|
||||
protected override DatabaseVersion DetermineCurrentVersion()
|
||||
{
|
||||
DatabaseVersion version = base.DetermineCurrentVersion();
|
||||
if (version != DatabaseVersion.Unavailable)
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
// verify connection
|
||||
try
|
||||
{
|
||||
if (SqlCeApplicationBlock.VerifyConnection(base.SqlHelper.ConnectionString))
|
||||
return DatabaseVersion.None;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Trace.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return DatabaseVersion.Unavailable;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/************************************************************************************
|
||||
*
|
||||
* Umbraco Data Layer
|
||||
* MIT Licensed work
|
||||
* ©2008 Ruben Verborgh
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.Data.SqlTypes;
|
||||
using umbraco.DataLayer;
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameter class for the SqlCEHelper.
|
||||
/// </summary>
|
||||
public class SqlCEParameter : SqlParameterAdapter<SqlCeParameter>
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqlCEParameter"/> class.
|
||||
/// </summary>
|
||||
/// <param name="parameterName">Name of the parameter.</param>
|
||||
/// <param name="value">Value of the parameter.</param>
|
||||
public SqlCEParameter(string parameterName, object value)
|
||||
: base(new SqlCeParameter(parameterName, value))
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Total" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>sql\total.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,88 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SqlCE4Umbraco {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class SqlCEResources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal SqlCEResources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SQLCE4Umbraco.SqlCEResources", typeof(SqlCEResources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to /*******************************************************************************************
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
/// Umbraco database installation script for SQL Server
|
||||
///
|
||||
///IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
|
||||
///
|
||||
/// Database version: 4.1.0.0
|
||||
///
|
||||
/// Please increment this version number if ANY change is made to this script,
|
||||
/// so compatibility with scripts for other database systems can be verified easily.
|
||||
/// The first 3 digits depict the Umbraco versi [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string Total {
|
||||
get {
|
||||
return ResourceManager.GetString("Total", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using umbraco.DataLayer.Utility.Table;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco;
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
/// <summary>
|
||||
/// SQL Server implementation of <see cref="DefaultTableUtility<S>"/>.
|
||||
/// </summary>
|
||||
public class SqlCETableUtility : DefaultTableUtility<SqlCEHelper>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqlCETableUtility"/> class.
|
||||
/// </summary>
|
||||
/// <param name="sqlHelper">The SQL helper.</param>
|
||||
public SqlCETableUtility(SqlCEHelper sqlHelper)
|
||||
: base(sqlHelper)
|
||||
{ }
|
||||
|
||||
#region DefaultTableUtility<SqlCEHelper> members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the table with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns>The table, or <c>null</c> if no table with that name exists.</returns>
|
||||
public override ITable GetTable(string name)
|
||||
{
|
||||
if (name == null)
|
||||
throw new ArgumentNullException("name");
|
||||
|
||||
ITable table = null;
|
||||
|
||||
// get name in correct casing
|
||||
name = SqlHelper.ExecuteScalar<string>("SELECT name FROM sys.tables WHERE name=@name",
|
||||
SqlHelper.CreateParameter("name", name));
|
||||
if (name != null)
|
||||
{
|
||||
table = new DefaultTable(name);
|
||||
|
||||
using (IRecordsReader reader = SqlHelper.ExecuteReader(
|
||||
@"SELECT c.name AS Name, st.name AS DataType, c.max_length, c.is_nullable, c.is_identity
|
||||
FROM sys.tables AS t
|
||||
JOIN sys.columns AS c ON t.object_id = c.object_id
|
||||
JOIN sys.schemas AS s ON s.schema_id = t.schema_id
|
||||
JOIN sys.types AS ty ON ty.user_type_id = c.user_type_id
|
||||
JOIN sys.types st ON ty.system_type_id = st.user_type_id
|
||||
WHERE t.name = @name
|
||||
ORDER BY c.column_id", SqlHelper.CreateParameter("name", name)))
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
table.AddField(table.CreateField(reader.GetString("Name"), GetType(reader)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves or updates the table.
|
||||
/// </summary>
|
||||
/// <param name="table">The table to be saved.</param>
|
||||
public override void SaveTable(ITable table)
|
||||
{
|
||||
if (table == null)
|
||||
throw new ArgumentNullException("table");
|
||||
|
||||
ITable oldTable = GetTable(table.Name);
|
||||
|
||||
// create the table if it didn't exist, update fields otherwise
|
||||
if (oldTable == null)
|
||||
{
|
||||
CreateTable(table);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (IField field in table)
|
||||
{
|
||||
// create the field if it did't exist in the old table
|
||||
if (oldTable.FindField(field.Name)==null)
|
||||
{
|
||||
CreateColumn(table, field);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected Helper Methods
|
||||
|
||||
/// <summary>
|
||||
/// Creates the table in the data source.
|
||||
/// </summary>
|
||||
/// <param name="table">The table.</param>
|
||||
protected virtual void CreateTable(ITable table)
|
||||
{
|
||||
Debug.Assert(table != null);
|
||||
|
||||
// create enumerator and check for first field
|
||||
IEnumerator<IField> fieldEnumerator = table.GetEnumerator();
|
||||
bool hasNext = fieldEnumerator.MoveNext();
|
||||
if(!hasNext)
|
||||
throw new ArgumentException("The table must contain at least one field.");
|
||||
|
||||
// create query
|
||||
StringBuilder createTableQuery = new StringBuilder();
|
||||
createTableQuery.AppendFormat("CREATE TABLE [{0}] (", SqlHelper.EscapeString(table.Name));
|
||||
|
||||
// add fields
|
||||
while (hasNext)
|
||||
{
|
||||
// add field name and type
|
||||
IField field = fieldEnumerator.Current;
|
||||
createTableQuery.Append('[').Append(field.Name).Append(']');
|
||||
createTableQuery.Append(' ').Append(GetDatabaseType(field));
|
||||
|
||||
// append comma if a following field exists
|
||||
hasNext = fieldEnumerator.MoveNext();
|
||||
if (hasNext)
|
||||
{
|
||||
createTableQuery.Append(',');
|
||||
}
|
||||
}
|
||||
|
||||
// close CREATE TABLE x (...) bracket
|
||||
createTableQuery.Append(')');
|
||||
|
||||
// execute query
|
||||
try
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(createTableQuery.ToString());
|
||||
}
|
||||
catch (Exception executeException)
|
||||
{
|
||||
throw new UmbracoException(String.Format("Could not create table '{0}'.", table), executeException);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new column in the table.
|
||||
/// </summary>
|
||||
/// <param name="table">The table.</param>
|
||||
/// <param name="field">The field used to create the column.</param>
|
||||
protected virtual void CreateColumn(ITable table, IField field)
|
||||
{
|
||||
Debug.Assert(table != null && field != null);
|
||||
|
||||
StringBuilder addColumnQuery = new StringBuilder();
|
||||
addColumnQuery.AppendFormat("ALTER TABLE [{0}] ADD [{1}] {2}",
|
||||
SqlHelper.EscapeString(table.Name),
|
||||
SqlHelper.EscapeString(field.Name),
|
||||
SqlHelper.EscapeString(GetDatabaseType(field)));
|
||||
try
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(addColumnQuery.ToString());
|
||||
}
|
||||
catch (Exception executeException)
|
||||
{
|
||||
throw new UmbracoException(String.Format("Could not create column '{0}' in table '{1}'.",
|
||||
field, table.Name), executeException);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the .Net type corresponding to the specified database data type.
|
||||
/// </summary>
|
||||
/// <param name="dataTypeReader">The data type reader.</param>
|
||||
/// <returns>The .Net type</returns>
|
||||
protected virtual Type GetType(IRecordsReader dataTypeReader)
|
||||
{
|
||||
string typeName = dataTypeReader.GetString("DataType");
|
||||
|
||||
switch (typeName)
|
||||
{
|
||||
case "bit": return typeof(bool);
|
||||
case "tinyint": return typeof(byte);
|
||||
case "datetime": return typeof(DateTime);
|
||||
// TODO: return different decimal type according to field precision
|
||||
case "decimal": return typeof(decimal);
|
||||
case "uniqueidentifier": return typeof(Guid);
|
||||
case "smallint": return typeof(Int16);
|
||||
case "int": return typeof(Int32);
|
||||
case "bigint": return typeof(Int64);
|
||||
case "nvarchar": return typeof(string);
|
||||
default:
|
||||
throw new ArgumentException(String.Format("Cannot convert database type '{0}' to a .Net type.",
|
||||
typeName));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the database type corresponding to the field, complete with field properties.
|
||||
/// </summary>
|
||||
/// <param name="field">The field.</param>
|
||||
/// <returns>The database type.</returns>
|
||||
protected virtual string GetDatabaseType(IField field)
|
||||
{
|
||||
StringBuilder fieldBuilder = new StringBuilder();
|
||||
|
||||
fieldBuilder.Append(GetDatabaseTypeName(field));
|
||||
fieldBuilder.Append(field.HasProperty(FieldProperties.Identity) ? " IDENTITY(1,1)" : String.Empty);
|
||||
fieldBuilder.Append(field.HasProperty(FieldProperties.NotNull) ? " NOT NULL" : " NULL");
|
||||
|
||||
return fieldBuilder.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the database type, without field properties.
|
||||
/// </summary>
|
||||
/// <param name="field">The field.</param>
|
||||
/// <returns></returns>
|
||||
protected virtual string GetDatabaseTypeName(IField field)
|
||||
{
|
||||
switch (field.DataType.FullName)
|
||||
{
|
||||
case "System.Boolean": return "bit";
|
||||
case "System.Byte": return "tinyint";
|
||||
case "System.DateTime": return "datetime";
|
||||
case "System.Decimal": return "decimal(28)";
|
||||
case "System.Double": return "decimal(15)";
|
||||
case "System.Single": return "decimal(7)";
|
||||
case "System.Guid": return "uniqueidentifier";
|
||||
case "System.Int16": return "smallint";
|
||||
case "System.Int32": return "int";
|
||||
case "System.Int64": return "bigint";;
|
||||
case "System.String":
|
||||
string type = "nvarchar";
|
||||
return field.Size == 0 ? type : String.Format("{0}({1})", type, field.Size);
|
||||
default:
|
||||
throw new ArgumentException(String.Format("Cannot convert '{0}' to a database type.", field));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/************************************************************************************
|
||||
*
|
||||
* Umbraco Data Layer
|
||||
* MIT Licensed work
|
||||
* ©2008 Ruben Verborgh
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
using umbraco.DataLayer.Utility;
|
||||
using umbraco.DataLayer.Utility.Installer;
|
||||
using umbraco.DataLayer.Utility.Table;
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility for an SQL Server data source.
|
||||
/// </summary>
|
||||
public class SqlCEUtility : DefaultUtility<SqlCEHelper>
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqlServerUtility"/> class.
|
||||
/// </summary>
|
||||
/// <param name="sqlHelper">The SQL helper.</param>
|
||||
public SqlCEUtility(SqlCEHelper sqlHelper) : base(sqlHelper)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region DefaultUtility Members
|
||||
|
||||
/// <summary>
|
||||
/// Creates an installer.
|
||||
/// </summary>
|
||||
/// <returns>The SQL Server installer.</returns>
|
||||
public override IInstallerUtility CreateInstaller()
|
||||
{
|
||||
return new SqlCEInstaller(SqlHelper);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a table utility.
|
||||
/// </summary>
|
||||
/// <returns>The table utility</returns>
|
||||
public override ITableUtility CreateTableUtility()
|
||||
{
|
||||
return new SqlCETableUtility(SqlHelper);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
public class SqlCeApplicationBlock
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
/// <param name="commandType"></param>
|
||||
/// <param name="commandText"></param>
|
||||
/// <param name="commandParameters"></param>
|
||||
/// <returns></returns>
|
||||
public static object ExecuteScalar(
|
||||
string connectionString,
|
||||
CommandType commandType,
|
||||
string commandText,
|
||||
params SqlCeParameter[] commandParameters
|
||||
)
|
||||
{
|
||||
object retVal;
|
||||
|
||||
try
|
||||
{
|
||||
using (SqlCeConnection conn = new SqlCeConnection())
|
||||
{
|
||||
conn.ConnectionString = connectionString;
|
||||
conn.Open();
|
||||
using (SqlCeCommand cmd = new SqlCeCommand(commandText, conn))
|
||||
{
|
||||
AttachParameters(cmd, commandParameters);
|
||||
Debug.WriteLine("---------------------------------SCALAR-------------------------------------");
|
||||
Debug.WriteLine(commandText);
|
||||
Debug.WriteLine("----------------------------------------------------------------------------");
|
||||
retVal = cmd.ExecuteScalar();
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
throw new SqlCeProviderException("Error running Scalar: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
/// <param name="commandType"></param>
|
||||
/// <param name="commandText"></param>
|
||||
/// <param name="commandParameters"></param>
|
||||
public static int ExecuteNonQuery(
|
||||
string connectionString,
|
||||
CommandType commandType,
|
||||
string commandText,
|
||||
params SqlCeParameter[] commandParameters
|
||||
)
|
||||
{
|
||||
try
|
||||
{
|
||||
int rowsAffected;
|
||||
using (SqlCeConnection conn = new SqlCeConnection())
|
||||
{
|
||||
// this is for multiple queries in the installer
|
||||
if (commandText.Trim().StartsWith("!!!"))
|
||||
{
|
||||
commandText = commandText.Trim().Trim('!');
|
||||
string[] commands = commandText.Split('|');
|
||||
string currentCmd = String.Empty;
|
||||
conn.ConnectionString = connectionString;
|
||||
conn.Open();
|
||||
|
||||
foreach (string cmd in commands)
|
||||
{
|
||||
try
|
||||
{
|
||||
currentCmd = cmd;
|
||||
if (!String.IsNullOrWhiteSpace(cmd))
|
||||
{
|
||||
SqlCeCommand c = new SqlCeCommand(cmd, conn);
|
||||
c.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.WriteLine("*******************************************************************");
|
||||
Debug.WriteLine(currentCmd);
|
||||
Debug.WriteLine(e);
|
||||
Debug.WriteLine("*******************************************************************");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.WriteLine("----------------------------------------------------------------------------");
|
||||
Debug.WriteLine(commandText);
|
||||
Debug.WriteLine("----------------------------------------------------------------------------");
|
||||
conn.ConnectionString = connectionString;
|
||||
conn.Open();
|
||||
SqlCeCommand cmd = new SqlCeCommand(commandText, conn);
|
||||
AttachParameters(cmd, commandParameters);
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
return rowsAffected;
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
throw new SqlCeProviderException("Error running NonQuery: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
/// <param name="commandType"></param>
|
||||
/// <param name="commandText"></param>
|
||||
/// <param name="commandParameters"></param>
|
||||
/// <returns></returns>
|
||||
public static SqlCeDataReader ExecuteReader(
|
||||
string connectionString,
|
||||
CommandType commandType,
|
||||
string commandText,
|
||||
params SqlCeParameter[] commandParameters
|
||||
)
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.WriteLine("---------------------------------READER-------------------------------------");
|
||||
Debug.WriteLine(commandText);
|
||||
Debug.WriteLine("----------------------------------------------------------------------------");
|
||||
SqlCeDataReader reader;
|
||||
SqlCeConnection conn = new SqlCeConnection();
|
||||
conn.ConnectionString = connectionString;
|
||||
conn.Open();
|
||||
try
|
||||
{
|
||||
SqlCeCommand cmd = new SqlCeCommand(commandText, conn);
|
||||
AttachParameters(cmd, commandParameters);
|
||||
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
|
||||
}
|
||||
catch
|
||||
{
|
||||
conn.Close();
|
||||
throw;
|
||||
}
|
||||
|
||||
return reader;
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
throw new SqlCeProviderException("Error running Reader: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static bool VerifyConnection(string connectionString)
|
||||
{
|
||||
bool isConnected = false;
|
||||
using (SqlCeConnection conn = new SqlCeConnection())
|
||||
{
|
||||
conn.ConnectionString = connectionString;
|
||||
conn.Open();
|
||||
isConnected = conn.State == ConnectionState.Open;
|
||||
}
|
||||
|
||||
return isConnected;
|
||||
}
|
||||
|
||||
private static void AttachParameters(SqlCeCommand command, SqlCeParameter[] commandParameters)
|
||||
{
|
||||
foreach (SqlCeParameter parameter in commandParameters)
|
||||
{
|
||||
if ((parameter.Direction == ParameterDirection.InputOutput) && (parameter.Value == null))
|
||||
{
|
||||
parameter.Value = DBNull.Value;
|
||||
}
|
||||
command.Parameters.Add(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlCE4Umbraco
|
||||
{
|
||||
public class SqlCeProviderException : Exception
|
||||
{
|
||||
public SqlCeProviderException() : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SqlCeProviderException(string message) : base(message)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,12 @@ using System.Web.UI.WebControls;
|
||||
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.DataLayer;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
|
||||
[assembly: System.Web.UI.WebResource("umbraco.editorControls.KeyValuePrevalueEditor.js", "text/js")]
|
||||
[assembly: System.Web.UI.WebResource("umbraco.editorControls.KeyValuePrevalueEditor.css", "text/css")]
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
/// <summary>
|
||||
@@ -17,6 +22,7 @@ namespace umbraco.editorControls
|
||||
// UI controls
|
||||
public System.Web.UI.WebControls.DropDownList _dropdownlist;
|
||||
public TextBox _textbox;
|
||||
private TextBox _tbhidden;
|
||||
public umbraco.uicontrols.PropertyPanel pp1 = new umbraco.uicontrols.PropertyPanel();
|
||||
public umbraco.uicontrols.PropertyPanel pp2 = new umbraco.uicontrols.PropertyPanel();
|
||||
|
||||
@@ -56,10 +62,15 @@ namespace umbraco.editorControls
|
||||
_textbox = new TextBox();
|
||||
_textbox.ID = "AddValue";
|
||||
|
||||
_tbhidden = new TextBox();
|
||||
_tbhidden.Attributes.Add("style", "display:none;");
|
||||
_tbhidden.CssClass = "valuesHiddenInput";
|
||||
|
||||
// put the childcontrols in context - ensuring that
|
||||
// the viewstate is persisted etc.
|
||||
this.Controls.Add(_dropdownlist);
|
||||
this.Controls.Add(_textbox);
|
||||
this.Controls.Add(_tbhidden);
|
||||
|
||||
_dropdownlist.Items.Add(DBTypes.Date.ToString());
|
||||
_dropdownlist.Items.Add(DBTypes.Integer.ToString());
|
||||
@@ -70,6 +81,22 @@ namespace umbraco.editorControls
|
||||
protected override void OnInit(EventArgs e) {
|
||||
base.OnInit(e);
|
||||
|
||||
|
||||
System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
|
||||
|
||||
|
||||
page.ClientScript.RegisterClientScriptInclude(
|
||||
"umbraco.editorControls.KeyValuePrevalueEditor.js",
|
||||
page.ClientScript.GetWebResourceUrl(typeof(KeyValuePrevalueEditor), "umbraco.editorControls.KeyValuePrevalueEditor.js"));
|
||||
|
||||
|
||||
HtmlHead head = (HtmlHead)page.Header;
|
||||
HtmlLink link = new HtmlLink();
|
||||
link.Attributes.Add("href", page.ClientScript.GetWebResourceUrl(typeof(KeyValuePrevalueEditor), "umbraco.editorControls.KeyValuePrevalueEditor.css"));
|
||||
link.Attributes.Add("type", "text/css");
|
||||
link.Attributes.Add("rel", "stylesheet");
|
||||
head.Controls.Add(link);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
@@ -96,13 +123,55 @@ namespace umbraco.editorControls
|
||||
public void Save()
|
||||
{
|
||||
_datatype.DBType = (cms.businesslogic.datatype.DBTypes)Enum.Parse(typeof(cms.businesslogic.datatype.DBTypes), _dropdownlist.SelectedValue, true);
|
||||
// If the add new prevalue textbox is filled out - add the value to the collection.
|
||||
|
||||
//changes in name and sortorder
|
||||
if (!string.IsNullOrEmpty(_tbhidden.Text))
|
||||
{
|
||||
int so = 0;
|
||||
foreach (string row in _tbhidden.Text.Split(';'))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(row))
|
||||
{
|
||||
|
||||
int id = 0;
|
||||
|
||||
if (row.Split('|').Length == 2 && int.TryParse(row.Split('|')[0], out id) && row.Split('|')[1].Length > 0)
|
||||
{
|
||||
|
||||
IParameter[] SqlParams = new IParameter[] {
|
||||
SqlHelper.CreateParameter("@value",row.Split('|')[1]),
|
||||
SqlHelper.CreateParameter("@sortorder",so),
|
||||
SqlHelper.CreateParameter("@id",id)};
|
||||
SqlHelper.ExecuteNonQuery("update cmsDataTypePreValues set [value] = @value, sortorder = @sortorder where id = @id", SqlParams);
|
||||
|
||||
}
|
||||
|
||||
so++;
|
||||
}
|
||||
}
|
||||
|
||||
_tbhidden.Text = "";
|
||||
}
|
||||
|
||||
// If the add new prevalue textbox is filled out - add the value to the collection.
|
||||
if (_textbox.Text != "")
|
||||
{
|
||||
|
||||
int so = -1;
|
||||
|
||||
try
|
||||
{
|
||||
so = SqlHelper.ExecuteScalar<int>("select max(sortorder) from cmsDataTypePreValues where datatypenodeid = @dtdefid",
|
||||
SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId));
|
||||
so++;
|
||||
}
|
||||
catch { }
|
||||
|
||||
IParameter[] SqlParams = new IParameter[] {
|
||||
SqlHelper.CreateParameter("@value",_textbox.Text),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')",SqlParams);
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId),
|
||||
SqlHelper.CreateParameter("@so",so)};
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,@so,'')",SqlParams);
|
||||
_textbox.Text = "";
|
||||
|
||||
ScriptManager.GetCurrent(Page).SetFocus(_textbox);
|
||||
@@ -115,13 +184,14 @@ namespace umbraco.editorControls
|
||||
_dropdownlist.RenderControl(writer);
|
||||
writer.Write("<br style='clear: both'/></div>");
|
||||
|
||||
SortedList _prevalues = Prevalues;
|
||||
List<KeyValuePair<int, String>> _prevalues = PrevaluesAsKeyValuePairList;
|
||||
if (_prevalues.Count > 0) {
|
||||
writer.Write("<div class='propertyItem'><table style='width: 100%'>");
|
||||
writer.Write("<tr><th style='width: 15%'>Text</th><td colspan='2'>Value</td></tr>");
|
||||
writer.Write("<div class='propertyItem'><table style='width: 100%' id=\"prevalues\">");
|
||||
writer.Write("<tr class='header'><th style='width: 15%'>Text</th><td colspan='2'>Value</td></tr>");
|
||||
|
||||
foreach (object key in _prevalues.Keys) {
|
||||
writer.Write("<tr><td>" + _prevalues[key].ToString() + "</td><td> " + key + "</td><td><a href='?id=" + _datatype.DataTypeDefinitionId + "&delete=" + key.ToString() + "'>" + ui.Text("delete") + "</a></td></tr>");
|
||||
foreach (KeyValuePair<int, String> item in _prevalues)
|
||||
{
|
||||
writer.Write("<tr class=\"row\"><td class=\"text\">" + item.Value + "</td><td class=\"value\"> " + item.Key.ToString() + "</td><td><a href='?id=" + _datatype.DataTypeDefinitionId + "&delete=" + item.Key.ToString() + "'>" + ui.Text("delete") + "</a> <span class=\"handle\" style=\"cursor:move\">sort<span></td></tr>");
|
||||
}
|
||||
writer.Write("</table><br style='clear: both'/></div>");
|
||||
}
|
||||
@@ -129,14 +199,16 @@ namespace umbraco.editorControls
|
||||
writer.Write("<div class='propertyItem'><div class='propertyItemheader'>" + ui.Text("addPrevalue") + "</div>");
|
||||
_textbox.RenderControl(writer);
|
||||
writer.Write("<br style='clear: both'/></div>");
|
||||
|
||||
|
||||
|
||||
_tbhidden.RenderControl(writer);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SortedList Prevalues {
|
||||
get
|
||||
{
|
||||
|
||||
SortedList retval = new SortedList();
|
||||
IRecordsReader dr = SqlHelper.ExecuteReader(
|
||||
"Select id, [value] from cmsDataTypePreValues where DataTypeNodeId = "
|
||||
@@ -148,5 +220,23 @@ namespace umbraco.editorControls
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public List<KeyValuePair<int, String>> PrevaluesAsKeyValuePairList
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
List<KeyValuePair<int, String>> items = new List<KeyValuePair<int, String>>();
|
||||
|
||||
IRecordsReader dr = SqlHelper.ExecuteReader(
|
||||
"Select id, [value] from cmsDataTypePreValues where DataTypeNodeId = "
|
||||
+ _datatype.DataTypeDefinitionId + " order by sortorder");
|
||||
|
||||
while (dr.Read())
|
||||
items.Add(new KeyValuePair<int, string>(dr.GetInt("id"), dr.GetString("value")));
|
||||
dr.Close();
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
#prevalues .ui-sortable-helper
|
||||
{
|
||||
border: 2px dotted #ccc;
|
||||
background-color: #EEE;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
jQuery("#prevalues .text").valuesInlineEdit();
|
||||
|
||||
jQuery("#prevalues tbody").sortable({
|
||||
items: "tr:not(.header)",
|
||||
handle: '.handle',
|
||||
update: function () {
|
||||
|
||||
ResetValues();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function ResetValues() {
|
||||
|
||||
var val = "";
|
||||
|
||||
jQuery("#prevalues .row").each(function () {
|
||||
|
||||
var text = jQuery(".text", this).html();
|
||||
var value = jQuery(".value", this).html();
|
||||
|
||||
|
||||
val += value + "|" + text + ";";
|
||||
|
||||
});
|
||||
|
||||
jQuery(".valuesHiddenInput").val(val);
|
||||
}
|
||||
|
||||
//inline edit
|
||||
(function ($) {
|
||||
|
||||
$.fn.valuesInlineEdit = function (options) {
|
||||
|
||||
options = $.extend({
|
||||
hover: 'hover',
|
||||
value: '',
|
||||
save: '',
|
||||
placeholder: 'Click to edit'
|
||||
}, options);
|
||||
|
||||
return $.each(this, function () {
|
||||
$.valuesInlineEdit(this, options);
|
||||
});
|
||||
}
|
||||
|
||||
$.valuesInlineEdit = function (obj, options) {
|
||||
|
||||
var self = $(obj),
|
||||
placeholderHtml = '<span class="inlineEdit-placeholder">' + options.placeholder + '</span>';
|
||||
|
||||
self.value = function (newValue) {
|
||||
if (arguments.length) {
|
||||
self.data('value', $(newValue).hasClass('inlineEdit-placeholder') ? '' : newValue);
|
||||
}
|
||||
return self.data('value');
|
||||
}
|
||||
|
||||
self.value($.trim(self.text()) || options.value);
|
||||
|
||||
self.bind('click', function (event) {
|
||||
var $this = $(event.target);
|
||||
|
||||
if ($this.is(self[0].tagName) || $this.hasClass('inlineEdit-placeholder')) {
|
||||
self
|
||||
.html('<input type="text" value="' + self.value() + '">')
|
||||
.find('input')
|
||||
.bind('blur', function () {
|
||||
if ($this.children('input').val().length > 0) {
|
||||
|
||||
try {
|
||||
self.value($this.children('input').val());
|
||||
|
||||
|
||||
|
||||
} catch (err) { }
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
self.value('Click to edit');
|
||||
}
|
||||
if (self.timer) {
|
||||
window.clearTimeout(self.timer);
|
||||
}
|
||||
self.timer = window.setTimeout(function () {
|
||||
self.html(self.value() || placeholderHtml);
|
||||
self.removeClass(options.hover);
|
||||
ResetValues();
|
||||
}, 200);
|
||||
})
|
||||
.focus();
|
||||
}
|
||||
})
|
||||
.hover(
|
||||
function () {
|
||||
$(this).addClass(options.hover);
|
||||
},
|
||||
function () {
|
||||
$(this).removeClass(options.hover);
|
||||
}
|
||||
);
|
||||
|
||||
if (!self.value()) {
|
||||
self.html($(placeholderHtml));
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class CheckBox: DataEditorSettingType
|
||||
{
|
||||
private System.Web.UI.WebControls.CheckBox cb = new System.Web.UI.WebControls.CheckBox();
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return cb.Checked.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true.ToString())
|
||||
cb.Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
cb.ID = sender.GetName();
|
||||
return cb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class CheckBoxList : DataEditorSettingType
|
||||
{
|
||||
private System.Web.UI.WebControls.CheckBoxList cbl = new System.Web.UI.WebControls.CheckBoxList();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
string retVal = string.Empty;
|
||||
|
||||
foreach (System.Web.UI.WebControls.ListItem item in cbl.Items)
|
||||
{
|
||||
if (item.Selected)
|
||||
retVal += item.Value + ";";
|
||||
}
|
||||
return retVal;
|
||||
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
cbl.ID = sender.GetName();
|
||||
|
||||
cbl.Items.Clear();
|
||||
|
||||
foreach (string s in Prevalues)
|
||||
{
|
||||
System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem(s);
|
||||
|
||||
if(_val.Contains(s + ";"))
|
||||
item.Selected = true;
|
||||
|
||||
cbl.Items.Add(item);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return cbl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class DropDownList: DataEditorSettingType
|
||||
{
|
||||
private System.Web.UI.WebControls.DropDownList ddl = new System.Web.UI.WebControls.DropDownList();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return ddl.SelectedValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
ddl.ID = sender.GetName();
|
||||
|
||||
ddl.Items.Clear();
|
||||
|
||||
foreach (string s in Prevalues)
|
||||
{
|
||||
ddl.Items.Add(s);
|
||||
}
|
||||
|
||||
ddl.SelectedValue = _val;
|
||||
|
||||
return ddl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class ListBox : DataEditorSettingType
|
||||
{
|
||||
private System.Web.UI.WebControls.ListBox lb = new System.Web.UI.WebControls.ListBox();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return lb.SelectedValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
lb.ID = sender.GetName();
|
||||
|
||||
lb.CssClass = "guiInputStandardSize";
|
||||
|
||||
lb.Items.Clear();
|
||||
|
||||
foreach (string s in Prevalues)
|
||||
{
|
||||
lb.Items.Add(s);
|
||||
}
|
||||
|
||||
lb.SelectedValue = _val;
|
||||
|
||||
return lb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class ListBoxMultiple : DataEditorSettingType
|
||||
{
|
||||
private System.Web.UI.WebControls.ListBox lb = new System.Web.UI.WebControls.ListBox();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
string retVal = string.Empty;
|
||||
|
||||
foreach (System.Web.UI.WebControls.ListItem item in lb.Items)
|
||||
{
|
||||
if (item.Selected)
|
||||
retVal += item.Value + ";";
|
||||
}
|
||||
return retVal;
|
||||
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
lb.ID = sender.GetName();
|
||||
lb.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple;
|
||||
lb.CssClass = "guiInputStandardSize";
|
||||
lb.Items.Clear();
|
||||
|
||||
foreach (string s in Prevalues)
|
||||
{
|
||||
System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem(s);
|
||||
|
||||
if (_val.Contains(s + ";"))
|
||||
item.Selected = true;
|
||||
|
||||
lb.Items.Add(item);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return lb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class Password : DataEditorSettingType
|
||||
{
|
||||
private TextBox tb = new TextBox();
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return tb.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
tb.Text = value;
|
||||
tb.Attributes["value"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
tb.ID = sender.GetName();
|
||||
|
||||
tb.TextMode = TextBoxMode.Password;
|
||||
tb.CssClass = "guiInputText guiInputStandardSize";
|
||||
return tb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class BasePicker: DataEditorSettingType
|
||||
{
|
||||
public Guid ObjectGuid { get; set; }
|
||||
|
||||
private System.Web.UI.WebControls.DropDownList ddl = new System.Web.UI.WebControls.DropDownList();
|
||||
|
||||
private string _val = string.Empty;
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return ddl.SelectedValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
|
||||
ddl.ID = sender.GetName();
|
||||
|
||||
ddl.Items.Clear();
|
||||
List<KeyValuePair<String, String>> items = new List<KeyValuePair<String, String>>();
|
||||
|
||||
if (ObjectGuid != Guid.Empty)
|
||||
{
|
||||
Guid[] guids = umbraco.cms.businesslogic.CMSNode.getAllUniquesFromObjectType(ObjectGuid);
|
||||
foreach (Guid g in guids)
|
||||
{
|
||||
umbraco.cms.businesslogic.CMSNode node = new umbraco.cms.businesslogic.CMSNode(g);
|
||||
items.Add(new KeyValuePair<string, string>(node.Id.ToString(), node.Text));
|
||||
}
|
||||
}
|
||||
|
||||
items.Sort(delegate(KeyValuePair<String, String> x, KeyValuePair<String, String> y) { return x.Value.CompareTo(y.Value); });
|
||||
|
||||
foreach (KeyValuePair<String, String> kv in items)
|
||||
{
|
||||
ddl.Items.Add(new System.Web.UI.WebControls.ListItem(kv.Value, kv.Key));
|
||||
}
|
||||
|
||||
System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("Choose...", "");
|
||||
li.Selected = true;
|
||||
ddl.Items.Insert(0, li);
|
||||
|
||||
|
||||
|
||||
ddl.SelectedValue = _val;
|
||||
|
||||
return ddl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class Content : DataEditorSettingType
|
||||
{
|
||||
private ContentPickerWithXpathOption cc = new ContentPickerWithXpathOption();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return cc.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
|
||||
cc.ShowXPath = false;
|
||||
cc.ID = sender.GetName().Replace(" ", "_");
|
||||
|
||||
cc.Value = _val;
|
||||
return cc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ContentWithXpath : DataEditorSettingType
|
||||
{
|
||||
private ContentPickerWithXpathOption cc = new ContentPickerWithXpathOption();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return cc.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
cc.ShowXPath = true;
|
||||
cc.ID = sender.GetName().Replace(" ", "_");
|
||||
|
||||
cc.Value = _val;
|
||||
return cc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class ContentPickerWithXpathOption : WebControl
|
||||
{
|
||||
private bool _showXPath = true;
|
||||
|
||||
public bool ShowXPath
|
||||
{
|
||||
get { return _showXPath; }
|
||||
set { _showXPath = value; }
|
||||
}
|
||||
|
||||
private umbraco.controls.ContentPicker cc;
|
||||
private TextBox tb;
|
||||
|
||||
public ContentPickerWithXpathOption()
|
||||
{
|
||||
EnsureChildControls();
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "contentpickerxpath", @"
|
||||
|
||||
function showXpathTextbox(control)
|
||||
{
|
||||
$('.picker',$('#' + control)).hide();
|
||||
$('.xpath',$('#' + control)).show();
|
||||
}
|
||||
|
||||
function showContentPicker(control)
|
||||
{
|
||||
$('.xpath',$('#' + control)).hide();
|
||||
$('.xpath input',$('#' + control)).val('');
|
||||
$('.picker',$('#' + control)).show();
|
||||
}
|
||||
", true);
|
||||
|
||||
base.OnInit(e);
|
||||
}
|
||||
|
||||
protected override void CreateChildControls()
|
||||
{
|
||||
cc = new umbraco.controls.ContentPicker();
|
||||
this.Controls.Add(cc);
|
||||
|
||||
|
||||
if (_showXPath)
|
||||
{
|
||||
tb = new TextBox();
|
||||
tb.CssClass = "guiInputText guiInputStandardSize";
|
||||
this.Controls.Add(tb);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RenderChildren(System.Web.UI.HtmlTextWriter writer)
|
||||
{
|
||||
|
||||
writer.Write(string.Format("<div class=\"picker\"{0}>", tb.Text != string.Empty ? " style=\"display:none\"" : ""));
|
||||
cc.RenderControl(writer);
|
||||
|
||||
if (_showXPath)
|
||||
{
|
||||
writer.Write(string.Format(
|
||||
" <a href=\"javascript:showXpathTextbox('{0}');\">Or enter Xpath</a>",
|
||||
this.ClientID));
|
||||
|
||||
writer.Write("</div>");
|
||||
|
||||
writer.Write(string.Format("<div class=\"xpath\"{0}>", !(tb.Text != string.Empty) ? " style=\"display:none\"" : ""));
|
||||
tb.RenderControl(writer);
|
||||
|
||||
writer.Write(string.Format(
|
||||
" <a href=\"javascript:showContentPicker('{0}');\">Or pick node</a>",
|
||||
this.ClientID));
|
||||
}
|
||||
|
||||
writer.Write("</div>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private string _val = string.Empty;
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
if (_showXPath && tb.Text != string.Empty)
|
||||
return tb.Text;
|
||||
else
|
||||
return cc.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
_val = value;
|
||||
|
||||
int nodeId;
|
||||
|
||||
if (int.TryParse(_val, out nodeId))
|
||||
cc.Text = _val;
|
||||
else if (ShowXPath)
|
||||
tb.Text = _val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.uicontrols.DatePicker;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class Date: DataEditorSettingType
|
||||
{
|
||||
private DateTimePicker dp = new DateTimePicker();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return dp.DateTime.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
|
||||
dp.ShowTime = false;
|
||||
|
||||
dp.ID = sender.GetName().Replace(" ", "_");
|
||||
|
||||
if(!string.IsNullOrEmpty(_val))
|
||||
dp.DateTime = Convert.ToDateTime(_val);
|
||||
|
||||
return dp;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.uicontrols.DatePicker;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class DateWithTime : DataEditorSettingType
|
||||
{
|
||||
private DateTimePicker dp = new DateTimePicker();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return dp.DateTime.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
|
||||
dp.ShowTime = true;
|
||||
|
||||
dp.ID = sender.GetName().Replace(" ", "_");
|
||||
|
||||
if (!string.IsNullOrEmpty(_val))
|
||||
dp.DateTime = Convert.ToDateTime(_val);
|
||||
|
||||
return dp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
|
||||
public class DocumentType: BasePicker {
|
||||
public DocumentType() {
|
||||
ObjectGuid = new Guid("a2cb7800-f571-4787-9638-bc48539a0efb");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class Field : DataEditorSettingType
|
||||
{
|
||||
private System.Web.UI.WebControls.DropDownList ddl = new System.Web.UI.WebControls.DropDownList();
|
||||
|
||||
private string _val = string.Empty;
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return ddl.SelectedValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
|
||||
ddl.ID = sender.GetName();
|
||||
|
||||
ddl.Items.Clear();
|
||||
List<KeyValuePair<String, String>> items = new List<KeyValuePair<String, String>>();
|
||||
|
||||
|
||||
string[] preValuesSource = { "@createDate", "@creatorName", "@level", "@nodeType", "@nodeTypeAlias", "@pageID", "@pageName", "@parentID", "@path", "@template", "@updateDate", "@writerID", "@writerName" };
|
||||
|
||||
string fieldSql = "select distinct alias from cmsPropertyType order by alias";
|
||||
|
||||
IRecordsReader dataTypes = umbraco.BusinessLogic.Application.SqlHelper.ExecuteReader(fieldSql);
|
||||
ddl.DataTextField = "alias";
|
||||
ddl.DataValueField = "alias";
|
||||
ddl.DataSource = dataTypes;
|
||||
ddl.DataBind();
|
||||
|
||||
foreach (string s in preValuesSource)
|
||||
{
|
||||
ddl.Items.Add(new System.Web.UI.WebControls.ListItem(s, s.Replace("@", "")));
|
||||
}
|
||||
|
||||
|
||||
System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("Choose...", "");
|
||||
li.Selected = true;
|
||||
ddl.Items.Insert(0, li);
|
||||
|
||||
ddl.SelectedValue = _val;
|
||||
|
||||
return ddl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class Media : DataEditorSettingType
|
||||
{
|
||||
|
||||
private umbraco.controls.ContentPicker mp = new umbraco.controls.ContentPicker();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
return mp.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
int output;
|
||||
if (!string.IsNullOrEmpty(value) && int.TryParse(value, out output))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
|
||||
mp.ID = sender.GetName().Replace(" ", "_");
|
||||
|
||||
mp.AppAlias = "media";
|
||||
mp.TreeAlias = "media";
|
||||
|
||||
int output;
|
||||
if (!string.IsNullOrEmpty(_val) && int.TryParse(_val, out output))
|
||||
{
|
||||
mp.Value = _val;
|
||||
|
||||
}
|
||||
return mp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class MediaType : BasePicker
|
||||
{
|
||||
public MediaType()
|
||||
{
|
||||
ObjectGuid = new Guid("4ea4382b-2f5a-4c2b-9587-ae9b3cf3602e");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class MemberGroup : BasePicker
|
||||
{
|
||||
public MemberGroup()
|
||||
{
|
||||
ObjectGuid = new Guid("366e63b9-880f-4e13-a61c-98069b029728");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class MemberType : BasePicker
|
||||
{
|
||||
public MemberType()
|
||||
{
|
||||
ObjectGuid = new Guid("9b5416fb-e72f-45a9-a07b-5a9a2709ce43");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
|
||||
namespace umbraco.editorControls.SettingControls.Pickers
|
||||
{
|
||||
public class Path : DataEditorSettingType
|
||||
{
|
||||
private PathPicker pp = new PathPicker();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return pp.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
|
||||
|
||||
pp.ID = sender.GetName().Replace(" ", "_");
|
||||
|
||||
pp.Value = _val;
|
||||
return pp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class PathPicker : WebControl
|
||||
{
|
||||
private TextBox tb;
|
||||
|
||||
public PathPicker()
|
||||
{
|
||||
EnsureChildControls();
|
||||
}
|
||||
|
||||
protected override void CreateChildControls()
|
||||
{
|
||||
|
||||
tb = new TextBox();
|
||||
tb.CssClass = "guiInputText guiInputStandardSize";
|
||||
tb.ID = this.ID + "input";
|
||||
this.Controls.Add(tb);
|
||||
|
||||
}
|
||||
|
||||
protected override void Render(System.Web.UI.HtmlTextWriter writer)
|
||||
{
|
||||
tb.RenderControl(writer);
|
||||
|
||||
writer.WriteLine(string.Format(" <a onclick=\"{0}\"href=\"javascript:void(0);\">Select</a>",
|
||||
string.Format("javascript:UmbClientMgr.openModalWindow('developer/packages/directoryBrowser.aspx?target={0}', 'Choose a file or a folder', true, 400, 500, 0, 0); return false;", tb.ClientID)));
|
||||
|
||||
}
|
||||
|
||||
private string _val = string.Empty;
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return tb.Text;
|
||||
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
_val = value;
|
||||
tb.Text = _val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class RadioButtonList: DataEditorSettingType
|
||||
{
|
||||
private System.Web.UI.WebControls.RadioButtonList rbl = new System.Web.UI.WebControls.RadioButtonList();
|
||||
|
||||
private string _val = string.Empty;
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return rbl.SelectedValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
_val = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
rbl.ID = sender.GetName();
|
||||
|
||||
rbl.Items.Clear();
|
||||
|
||||
foreach (string s in Prevalues)
|
||||
{
|
||||
rbl.Items.Add(s);
|
||||
}
|
||||
|
||||
rbl.SelectedValue = _val;
|
||||
|
||||
return rbl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class TextArea : DataEditorSettingType
|
||||
{
|
||||
private TextBox tb = new TextBox();
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return tb.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
tb.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
tb.ID = sender.GetName();
|
||||
tb.TextMode = TextBoxMode.MultiLine;
|
||||
tb.CssClass = "guiInputText guiInputStandardSize";
|
||||
tb.Rows = 7;
|
||||
|
||||
if (string.IsNullOrEmpty(tb.Text) && this.Prevalues.Count > 0)
|
||||
tb.Text = this.Prevalues[0];
|
||||
|
||||
return tb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
public class TextField : DataEditorSettingType
|
||||
{
|
||||
private TextBox tb = new TextBox();
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return tb.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
tb.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
tb.ID = sender.GetName();
|
||||
tb.TextMode = TextBoxMode.SingleLine;
|
||||
tb.CssClass = "guiInputText guiInputStandardSize";
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(tb.Text) && !string.IsNullOrEmpty(DefaultValue))
|
||||
tb.Text = DefaultValue;
|
||||
|
||||
return tb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
[assembly: System.Web.UI.WebResource("umbraco.editorControls.SettingControls.js.Values.js", "text/js")]
|
||||
[assembly: System.Web.UI.WebResource("umbraco.editorControls.SettingControls.css.Values.css", "text/css")]
|
||||
namespace umbraco.editorControls.SettingControls
|
||||
{
|
||||
|
||||
public class Values : DataEditorSettingType
|
||||
{
|
||||
|
||||
private Panel p = new Panel();
|
||||
private TextBox tb = new TextBox();
|
||||
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return tb.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
tb.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
||||
{
|
||||
tb.ID = sender.GetName();
|
||||
tb.CssClass = "valuesInput";
|
||||
tb.Attributes.Add("style", "display:none;");
|
||||
|
||||
|
||||
string html = "<div class='values'>";
|
||||
|
||||
html += "</div>";
|
||||
|
||||
html += "<input type='text' class='valueInput' />";
|
||||
html += " <a onclick=\"valuesDataEditorSettingTypeAddValue(this); return false;\" href='#' class='Add'>Add Value</a>";
|
||||
|
||||
|
||||
p.Controls.Add(new System.Web.UI.LiteralControl("<div class='valuesDataEditorSettingType'>"));
|
||||
p.Controls.Add(new System.Web.UI.LiteralControl(html));
|
||||
p.Controls.Add(tb);
|
||||
p.Controls.Add(new System.Web.UI.LiteralControl("</div>"));
|
||||
|
||||
|
||||
System.Web.UI.Page page = (System.Web.UI.Page)HttpContext.Current.Handler;
|
||||
|
||||
|
||||
page.ClientScript.RegisterClientScriptInclude(
|
||||
"umbraco.editorControls.SettingControls.js.Values.js",
|
||||
page.ClientScript.GetWebResourceUrl(typeof(Values), "umbraco.editorControls.SettingControls.js.Values.js"));
|
||||
|
||||
|
||||
HtmlHead head = (HtmlHead)page.Header;
|
||||
HtmlLink link = new HtmlLink();
|
||||
link.Attributes.Add("href", page.ClientScript.GetWebResourceUrl(typeof(Values), "umbraco.editorControls.SettingControls.css.Values.css"));
|
||||
link.Attributes.Add("type", "text/css");
|
||||
link.Attributes.Add("rel", "stylesheet");
|
||||
head.Controls.Add(link);
|
||||
|
||||
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
.valuesDataEditorSettingType .value
|
||||
{
|
||||
padding-bottom:5px;
|
||||
}
|
||||
|
||||
.valuesDataEditorSettingType .value .del
|
||||
{
|
||||
color:Red;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.valuesDataEditorSettingType .value .handle
|
||||
{
|
||||
cursor:move;
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
|
||||
|
||||
jQuery(".valuesDataEditorSettingType").each(function () {
|
||||
|
||||
var vals = jQuery(".valuesInput", this).val();
|
||||
|
||||
var values = jQuery(".values", this);
|
||||
|
||||
var vals_array = vals.split(";");
|
||||
var part_num = 0;
|
||||
while (part_num < vals_array.length) {
|
||||
|
||||
if (vals_array[part_num] != "") {
|
||||
var existingValue = "<div class='value'><span>" + vals_array[part_num] + "</span> <a class='del'>Delete</a> <a class='handle'>Drag</a></div>";
|
||||
|
||||
values.append(existingValue);
|
||||
}
|
||||
part_num++;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery(".valuesDataEditorSettingType .value .del").click(function () {
|
||||
jQuery(this).parent().remove();
|
||||
valuesDataEditorSettingTypeResetValues();
|
||||
});
|
||||
|
||||
|
||||
jQuery(".valuesDataEditorSettingType .value span").valuesInlineEdit();
|
||||
|
||||
|
||||
jQuery(".valuesDataEditorSettingType .values").sortable({
|
||||
handle : '.handle',
|
||||
update : function () {
|
||||
|
||||
valuesDataEditorSettingTypeResetValues();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function valuesDataEditorSettingTypeAddValue(sender) {
|
||||
|
||||
|
||||
var valuesDataEditorSettingType = jQuery(sender).parent();
|
||||
|
||||
var value = jQuery(".valueInput", valuesDataEditorSettingType).val();
|
||||
|
||||
if (value != "") {
|
||||
|
||||
var values = jQuery(".values", valuesDataEditorSettingType);
|
||||
|
||||
var newValue = "<div class='value'><span>" + value + "</span> <a class='del'>Delete</a> <a class='handle'>Drag</a></div>";
|
||||
|
||||
values.append(newValue);
|
||||
|
||||
jQuery(".valuesDataEditorSettingType .value span").valuesInlineEdit();
|
||||
|
||||
jQuery(".valueInput", valuesDataEditorSettingType).val("");
|
||||
|
||||
|
||||
valuesDataEditorSettingTypeSetValues(values, jQuery(".valuesInput", valuesDataEditorSettingType));
|
||||
}
|
||||
|
||||
|
||||
jQuery(".valuesDataEditorSettingType .value .del").click(function () {
|
||||
jQuery(this).parent().remove();
|
||||
valuesDataEditorSettingTypeResetValues();
|
||||
});
|
||||
|
||||
jQuery(".valuesDataEditorSettingType .values").sortable({
|
||||
handle : '.handle',
|
||||
update : function () {
|
||||
|
||||
valuesDataEditorSettingTypeResetValues();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function valuesDataEditorSettingTypeSetValues(valuesContainer,valuesInput) {
|
||||
|
||||
var vals = "";
|
||||
jQuery(".value", valuesContainer).each(function () {
|
||||
|
||||
vals += jQuery("span",this).html() + ";";
|
||||
});
|
||||
|
||||
valuesInput.val(vals);
|
||||
}
|
||||
|
||||
function valuesDataEditorSettingTypeResetValues() {
|
||||
jQuery(".valuesDataEditorSettingType").each(function () {
|
||||
|
||||
valuesDataEditorSettingTypeSetValues(jQuery(".values", this), jQuery(".valuesInput", this));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
(function ($) {
|
||||
|
||||
$.fn.valuesInlineEdit = function (options) {
|
||||
|
||||
options = $.extend({
|
||||
hover: 'hover',
|
||||
value: '',
|
||||
save: '',
|
||||
placeholder: 'Click to edit'
|
||||
}, options);
|
||||
|
||||
return $.each(this, function () {
|
||||
$.valuesInlineEdit(this, options);
|
||||
});
|
||||
}
|
||||
|
||||
$.valuesInlineEdit = function (obj, options) {
|
||||
|
||||
var self = $(obj),
|
||||
placeholderHtml = '<span class="inlineEdit-placeholder">' + options.placeholder + '</span>';
|
||||
|
||||
self.value = function (newValue) {
|
||||
if (arguments.length) {
|
||||
self.data('value', $(newValue).hasClass('inlineEdit-placeholder') ? '' : newValue);
|
||||
}
|
||||
return self.data('value');
|
||||
}
|
||||
|
||||
self.value($.trim(self.text()) || options.value);
|
||||
|
||||
self.bind('click', function (event) {
|
||||
var $this = $(event.target);
|
||||
|
||||
if ($this.is(self[0].tagName) || $this.hasClass('inlineEdit-placeholder')) {
|
||||
self
|
||||
.html('<input type="text" value="' + self.value() + '">')
|
||||
.find('input')
|
||||
.bind('blur', function () {
|
||||
if ($this.children('input').val().length > 0) {
|
||||
|
||||
try {
|
||||
self.value($this.children('input').val());
|
||||
|
||||
|
||||
|
||||
} catch (err) { }
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
self.value('Click to edit');
|
||||
}
|
||||
if (self.timer) {
|
||||
window.clearTimeout(self.timer);
|
||||
}
|
||||
self.timer = window.setTimeout(function () {
|
||||
self.html(self.value() || placeholderHtml);
|
||||
self.removeClass(options.hover);
|
||||
valuesDataEditorSettingTypeResetValues();
|
||||
}, 200);
|
||||
})
|
||||
.focus();
|
||||
}
|
||||
})
|
||||
.hover(
|
||||
function () {
|
||||
$(this).addClass(options.hover);
|
||||
},
|
||||
function () {
|
||||
$(this).removeClass(options.hover);
|
||||
}
|
||||
);
|
||||
|
||||
if (!self.value()) {
|
||||
self.html($(placeholderHtml));
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
@@ -13,7 +13,7 @@ namespace umbraco.editorControls.checkboxlist
|
||||
get
|
||||
{
|
||||
if (_Editor == null)
|
||||
_Editor = new checkboxlistEditor(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new checkboxlistEditor(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
return _Editor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.ComponentModel;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace umbraco.editorControls.checkboxlist
|
||||
{
|
||||
@@ -18,6 +19,13 @@ namespace umbraco.editorControls.checkboxlist
|
||||
_prevalues = Prevalues;
|
||||
}
|
||||
|
||||
List<KeyValuePair<int, String>> Prevalues;
|
||||
public checkboxlistEditor(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
|
||||
{
|
||||
_data = Data;
|
||||
this.Prevalues = Prevalues;
|
||||
}
|
||||
|
||||
public Control Editor { get {return this;}}
|
||||
|
||||
public virtual bool TreatAsRichTextEditor
|
||||
@@ -53,16 +61,32 @@ namespace umbraco.editorControls.checkboxlist
|
||||
|
||||
if (_data != null && _data.Value != null && _data.Value.ToString() != "")
|
||||
_text = _data.Value.ToString();
|
||||
|
||||
foreach(object key in _prevalues.Keys)
|
||||
{
|
||||
ListItem li = new ListItem(_prevalues[key].ToString(),key.ToString());
|
||||
|
||||
if ((","+_text+",").IndexOf(","+li.Value.ToString()+",") > -1)
|
||||
li.Selected = true;
|
||||
|
||||
Items.Add(li);
|
||||
}
|
||||
|
||||
if (_prevalues != null)
|
||||
{
|
||||
foreach (object key in _prevalues.Keys)
|
||||
{
|
||||
ListItem li = new ListItem(_prevalues[key].ToString(), key.ToString());
|
||||
|
||||
if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1)
|
||||
li.Selected = true;
|
||||
|
||||
Items.Add(li);
|
||||
}
|
||||
}
|
||||
else if (Prevalues != null)
|
||||
{
|
||||
foreach (KeyValuePair<int, String> item in Prevalues)
|
||||
{
|
||||
ListItem li = new ListItem(item.Value, item.Key.ToString());
|
||||
|
||||
if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1)
|
||||
li.Selected = true;
|
||||
|
||||
Items.Add(li);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.colorpicker
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new colorPicker(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new colorPicker(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Web.UI.WebControls;
|
||||
using System.ComponentModel;
|
||||
using System.Collections;
|
||||
using umbraco.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
@@ -23,6 +24,14 @@ namespace umbraco.editorControls
|
||||
_data = Data;
|
||||
_prevalues = Prevalues;
|
||||
}
|
||||
|
||||
List<KeyValuePair<int, String>> Prevalues;
|
||||
public colorPicker(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
|
||||
{
|
||||
_data = Data;
|
||||
this.Prevalues = Prevalues;
|
||||
}
|
||||
|
||||
private ArrayList _colors = new ArrayList();
|
||||
|
||||
public Control Editor { get { return this; } }
|
||||
@@ -56,9 +65,19 @@ namespace umbraco.editorControls
|
||||
|
||||
try
|
||||
{
|
||||
foreach (string val in _prevalues.Values)
|
||||
if (_prevalues != null)
|
||||
{
|
||||
_colors.Add(new ListItem(val));
|
||||
foreach (string val in _prevalues.Values)
|
||||
{
|
||||
_colors.Add(new ListItem(val));
|
||||
}
|
||||
}
|
||||
else if (Prevalues != null)
|
||||
{
|
||||
foreach (KeyValuePair<int, String> item in Prevalues)
|
||||
{
|
||||
_colors.Add(new ListItem(item.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@@ -71,7 +90,7 @@ namespace umbraco.editorControls
|
||||
_bgColor = "FFF";
|
||||
|
||||
base.Render(writer);
|
||||
writer.WriteLine("<div style=\"clear:both;padding-top:5px\"><span id=\"" + this.ClientID + "holder\" style=\"border: 1px solid black; background-color: #" + _bgColor + "\"><img src=\"" + SystemDirectories.Umbraco + "/images/nada.gif\" width=\"15\" height=\"15\" border=\"0\" /></span> - ");
|
||||
writer.WriteLine("<div style=\"clear:both;padding-top:5px\"><span id=\"" + this.ClientID + "holder\" style=\"border: 1px solid black; background-color: #" + _bgColor + "\"><img src=\"" + this.ResolveUrl(SystemDirectories.Umbraco) + "/images/nada.gif\" width=\"15\" height=\"15\" border=\"0\" /></span> - ");
|
||||
|
||||
foreach (object color in _colors)
|
||||
{
|
||||
@@ -79,7 +98,7 @@ namespace umbraco.editorControls
|
||||
if (colorValue == "")
|
||||
colorValue = "FFF";
|
||||
|
||||
writer.WriteLine("<span style=\"margin: 2px; border: 1px solid black; background-color: #" + color.ToString() + "\"><a href=\"javascript:void(0);\" onClick=\"document.forms[0]['" + this.ClientID + "'].value = '" + color.ToString() + "'; document.getElementById('" + this.ClientID + "holder').style.backgroundColor = '#" + colorValue + "'\"><img src=\"" + SystemDirectories.Umbraco + "/images/nada.gif\" width=\"15\" height=\"15\" border=\"0\" /></a></span>");
|
||||
writer.WriteLine("<span style=\"margin: 2px; border: 1px solid black; background-color: #" + color.ToString() + "\"><a href=\"javascript:void(0);\" onClick=\"document.forms[0]['" + this.ClientID + "'].value = '" + color.ToString() + "'; document.getElementById('" + this.ClientID + "holder').style.backgroundColor = '#" + colorValue + "'\"><img src=\"" + this.ResolveUrl(SystemDirectories.Umbraco) + "/images/nada.gif\" width=\"15\" height=\"15\" border=\"0\" /></a></span>");
|
||||
}
|
||||
|
||||
writer.WriteLine("</div>");
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace umbraco.editorControls
|
||||
/// </summary>
|
||||
[DefaultProperty("Text"),
|
||||
ToolboxData("<{0}:dateField runat=server></{0}:dateField>")]
|
||||
[ValidationProperty("Text")]
|
||||
public class dateField : DateTimePicker, interfaces.IDataEditor
|
||||
{
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.dropdownlist
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.dropdownlist
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections;
|
||||
|
||||
using umbraco.cms.businesslogic;
|
||||
using umbraco.cms.businesslogic.language;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
@@ -20,6 +21,15 @@ namespace umbraco.editorControls
|
||||
_prevalues = Prevalues;
|
||||
}
|
||||
|
||||
|
||||
List<KeyValuePair<int, String>> Prevalues;
|
||||
public dropdown(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
|
||||
{
|
||||
_data = Data;
|
||||
this.Prevalues = Prevalues;
|
||||
}
|
||||
|
||||
|
||||
public Control Editor {
|
||||
get {return this;}
|
||||
}
|
||||
@@ -44,10 +54,23 @@ namespace umbraco.editorControls
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit (e);
|
||||
foreach (object key in _prevalues.Keys)
|
||||
|
||||
if (_prevalues != null)
|
||||
{
|
||||
this.Items.Add(new ListItem(dropdown.DictionaryReplace(_prevalues[key].ToString()), key.ToString()));
|
||||
}
|
||||
foreach (object key in _prevalues.Keys)
|
||||
{
|
||||
this.Items.Add(new ListItem(dropdown.DictionaryReplace(_prevalues[key].ToString()), key.ToString()));
|
||||
}
|
||||
|
||||
}
|
||||
else if (Prevalues != null)
|
||||
{
|
||||
foreach (KeyValuePair<int, String> item in Prevalues)
|
||||
{
|
||||
this.Items.Add(new ListItem(dropdown.DictionaryReplace(item.Value), item.Key.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
base.Items.Insert(0, new ListItem(ui.Text("choose") + "...",""));
|
||||
|
||||
if (_data != null && _data.Value != null)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.listbox
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new dropdownMultiple(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new dropdownMultiple(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.listbox
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new dropdownMultiple(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new dropdownMultiple(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.ComponentModel;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
@@ -21,6 +22,13 @@ namespace umbraco.editorControls
|
||||
_prevalues = Prevalues;
|
||||
}
|
||||
|
||||
List<KeyValuePair<int, String>> Prevalues;
|
||||
public dropdownMultiple(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
|
||||
{
|
||||
_data = Data;
|
||||
this.Prevalues = Prevalues;
|
||||
}
|
||||
|
||||
public Control Editor { get {return this;}}
|
||||
|
||||
public virtual bool TreatAsRichTextEditor
|
||||
@@ -69,15 +77,30 @@ namespace umbraco.editorControls
|
||||
|
||||
base.OnInit(e);
|
||||
|
||||
foreach (object key in _prevalues.Keys)
|
||||
{
|
||||
ListItem li = new ListItem(_prevalues[key].ToString(),key.ToString());
|
||||
|
||||
if ((","+_text+",").IndexOf(","+li.Value.ToString()+",") > -1)
|
||||
li.Selected = true;
|
||||
|
||||
Items.Add(li);
|
||||
}
|
||||
if (_prevalues != null)
|
||||
{
|
||||
foreach (object key in _prevalues.Keys)
|
||||
{
|
||||
ListItem li = new ListItem(_prevalues[key].ToString(), key.ToString());
|
||||
|
||||
if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1)
|
||||
li.Selected = true;
|
||||
|
||||
Items.Add(li);
|
||||
}
|
||||
}
|
||||
else if (Prevalues != null)
|
||||
{
|
||||
foreach (KeyValuePair<int, String> item in Prevalues)
|
||||
{
|
||||
ListItem li = new ListItem(item.Value, item.Key.ToString());
|
||||
|
||||
if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1)
|
||||
li.Selected = true;
|
||||
|
||||
Items.Add(li);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
using umbraco.interfaces;
|
||||
using umbraco.cms.businesslogic.macro;
|
||||
using umbraco.presentation.webservices;
|
||||
@@ -19,234 +18,234 @@ namespace umbraco.editorControls.macrocontainer
|
||||
{
|
||||
|
||||
[ClientDependency(ClientDependencyType.Javascript, "ui/jqueryui.js", "UmbracoClient")]
|
||||
[ClientDependency(ClientDependencyType.Css, "/macroContainer/macroContainer.css", "UmbracoClient")]
|
||||
[ClientDependency(ClientDependencyType.Css, "macroContainer/macroContainer.css", "UmbracoClient")]
|
||||
public class Editor : UpdatePanel, IDataEditor
|
||||
{
|
||||
private IData _data;
|
||||
private List<string> _allowedMacros;
|
||||
private int _maxNumber, _preferedHeight, _preferedWidth;
|
||||
private IData _data;
|
||||
private List<string> _allowedMacros;
|
||||
private int _maxNumber, _preferedHeight, _preferedWidth;
|
||||
|
||||
private LinkButton _addMacro;
|
||||
private Literal _limit;
|
||||
private LinkButton _addMacro;
|
||||
private Literal _limit;
|
||||
|
||||
|
||||
|
||||
public Editor(IData data, List<string> allowedMacros, int maxNumber, int preferedHeight, int preferedWidth)
|
||||
public Editor(IData data, List<string> allowedMacros, int maxNumber, int preferedHeight, int preferedWidth)
|
||||
{
|
||||
_data = data;
|
||||
_allowedMacros = allowedMacros;
|
||||
_maxNumber = maxNumber;
|
||||
_preferedHeight = preferedHeight;
|
||||
_preferedWidth = preferedWidth;
|
||||
_data = data;
|
||||
_allowedMacros = allowedMacros;
|
||||
_maxNumber = maxNumber;
|
||||
_preferedHeight = preferedHeight;
|
||||
_preferedWidth = preferedWidth;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
//SD: This is useless as it won't work in live editing anyways whilst using MS Ajax/ScriptManager for ajax calls
|
||||
if (!UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
{
|
||||
presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page);
|
||||
ScriptManager sm = ScriptManager.GetCurrent(base.Page);
|
||||
ServiceReference webservicePath = new ServiceReference(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/webservices/MacroContainerService.asmx");
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
if (!sm.Services.Contains(webservicePath))
|
||||
sm.Services.Add(webservicePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientDependencyLoader.Instance.RegisterDependency("webservices/legacyAjaxCalls.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
|
||||
ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
|
||||
}
|
||||
//SD: This is useless as it won't work in live editing anyways whilst using MS Ajax/ScriptManager for ajax calls
|
||||
if (!UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
{
|
||||
presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page);
|
||||
ScriptManager sm = ScriptManager.GetCurrent(base.Page);
|
||||
ServiceReference webservicePath = new ServiceReference(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/webservices/MacroContainerService.asmx");
|
||||
|
||||
_addMacro = new LinkButton();
|
||||
_addMacro.ID = ID + "_btnaddmacro";
|
||||
if (!sm.Services.Contains(webservicePath))
|
||||
sm.Services.Add(webservicePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientDependencyLoader.Instance.RegisterDependency("webservices/legacyAjaxCalls.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
|
||||
ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
|
||||
}
|
||||
|
||||
_addMacro = new LinkButton();
|
||||
_addMacro.ID = ID + "_btnaddmacro";
|
||||
|
||||
|
||||
_addMacro.Click += new EventHandler(_addMacro_Click);
|
||||
_addMacro.Text = ui.Text("insertMacro");
|
||||
_addMacro.CssClass = "macroContainerAdd";
|
||||
_addMacro.Click += new EventHandler(_addMacro_Click);
|
||||
_addMacro.Text = ui.Text("insertMacro");
|
||||
_addMacro.CssClass = "macroContainerAdd";
|
||||
|
||||
this.ContentTemplateContainer.Controls.Add(_addMacro);
|
||||
this.ContentTemplateContainer.Controls.Add(_addMacro);
|
||||
|
||||
|
||||
_limit = new Literal();
|
||||
_limit.Text = string.Format(" Only {0} macros are allowed", _maxNumber);
|
||||
_limit.ID = ID + "_litlimit";
|
||||
_limit.Visible = false;
|
||||
_limit = new Literal();
|
||||
_limit.Text = string.Format(" Only {0} macros are allowed", _maxNumber);
|
||||
_limit.ID = ID + "_litlimit";
|
||||
_limit.Visible = false;
|
||||
|
||||
this.ContentTemplateContainer.Controls.Add(_limit);
|
||||
this.ContentTemplateContainer.Controls.Add(_limit);
|
||||
|
||||
string widthHeight = "";
|
||||
if (_preferedHeight > 0 && _preferedWidth > 0)
|
||||
{
|
||||
widthHeight = String.Format(" style=\"min-width: {0}px; min-height: {1}px;\"", _preferedWidth, _preferedHeight);
|
||||
}
|
||||
string widthHeight = "";
|
||||
if (_preferedHeight > 0 && _preferedWidth > 0)
|
||||
{
|
||||
widthHeight = String.Format(" style=\"min-width: {0}px; min-height: {1}px;\"", _preferedWidth, _preferedHeight);
|
||||
}
|
||||
|
||||
this.ContentTemplateContainer.Controls.Add(new LiteralControl(String.Format("<div id=\"" + ID + "container\" class=\"macrocontainer\"{0}>", widthHeight)));
|
||||
this.ContentTemplateContainer.Controls.Add(new LiteralControl(String.Format("<div id=\"" + ID + "container\" class=\"macrocontainer\"{0}>", widthHeight)));
|
||||
|
||||
Regex tagregex = new Regex("<[^>]*(>|$)", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
|
||||
MatchCollection tags = tagregex.Matches(_data.Value.ToString());
|
||||
Regex tagregex = new Regex("<[^>]*(>|$)", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
|
||||
MatchCollection tags = tagregex.Matches(_data.Value.ToString());
|
||||
|
||||
List<int> editornumbers = new List<int>();
|
||||
string sortorder = string.Empty;
|
||||
List<int> editornumbers = new List<int>();
|
||||
string sortorder = string.Empty;
|
||||
|
||||
|
||||
for (int i = 0; i < _maxNumber; i++)
|
||||
{
|
||||
if (!editornumbers.Contains(i))
|
||||
{
|
||||
string data = string.Empty;
|
||||
for (int i = 0; i < _maxNumber; i++)
|
||||
{
|
||||
if (!editornumbers.Contains(i))
|
||||
{
|
||||
string data = string.Empty;
|
||||
|
||||
if (tags.Count > i)
|
||||
data = tags[i].Value;
|
||||
if (tags.Count > i)
|
||||
data = tags[i].Value;
|
||||
|
||||
MacroEditor macroEditor = new MacroEditor(data, _allowedMacros);
|
||||
macroEditor.ID = ID + "macroeditor_" + i;
|
||||
MacroEditor macroEditor = new MacroEditor(data, _allowedMacros);
|
||||
macroEditor.ID = ID + "macroeditor_" + i;
|
||||
|
||||
this.ContentTemplateContainer.Controls.Add(macroEditor);
|
||||
}
|
||||
this.ContentTemplateContainer.Controls.Add(macroEditor);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
this.ContentTemplateContainer.Controls.Add(new LiteralControl("</div>"));
|
||||
this.ContentTemplateContainer.Controls.Add(new LiteralControl("</div>"));
|
||||
|
||||
if (tags.Count == _maxNumber)
|
||||
{
|
||||
_addMacro.Enabled = false;
|
||||
_limit.Visible = true;
|
||||
}
|
||||
if (tags.Count == _maxNumber)
|
||||
{
|
||||
_addMacro.Enabled = false;
|
||||
_limit.Visible = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MacroContainerEvent.Execute += new MacroContainerEvent.ExecuteHandler(MacroContainerEvent_Execute);
|
||||
|
||||
}
|
||||
private void CheckLimit()
|
||||
{
|
||||
bool allowadd = false;
|
||||
for (int i = 0; i < _maxNumber; i++)
|
||||
{
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + i.ToString()));
|
||||
MacroContainerEvent.Execute += new MacroContainerEvent.ExecuteHandler(MacroContainerEvent_Execute);
|
||||
|
||||
if (!current.Visible)
|
||||
{
|
||||
allowadd = true;
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
private void CheckLimit()
|
||||
{
|
||||
bool allowadd = false;
|
||||
for (int i = 0; i < _maxNumber; i++)
|
||||
{
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + i.ToString()));
|
||||
|
||||
if (!allowadd)
|
||||
{
|
||||
_addMacro.Enabled = false;
|
||||
_limit.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_addMacro.Enabled = true;
|
||||
_limit.Visible = false;
|
||||
}
|
||||
}
|
||||
if (!current.Visible)
|
||||
{
|
||||
allowadd = true;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
private void MacroContainerEvent_Execute()
|
||||
{
|
||||
CheckLimit();
|
||||
|
||||
}
|
||||
if (!allowadd)
|
||||
{
|
||||
_addMacro.Enabled = false;
|
||||
_limit.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_addMacro.Enabled = true;
|
||||
_limit.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void _addMacro_Click(object sender, EventArgs e)
|
||||
{
|
||||
private void MacroContainerEvent_Execute()
|
||||
{
|
||||
CheckLimit();
|
||||
|
||||
for (int i = 0; i < _maxNumber; i++)
|
||||
{
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + i.ToString()));
|
||||
}
|
||||
|
||||
if (!current.Visible)
|
||||
{
|
||||
current.Visible = true;
|
||||
MacroContainerEvent.Add();
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
private void _addMacro_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
for (int i = 0; i < _maxNumber; i++)
|
||||
{
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + i.ToString()));
|
||||
|
||||
if (!current.Visible)
|
||||
{
|
||||
current.Visible = true;
|
||||
MacroContainerEvent.Add();
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
// And a reference to the macro container calls
|
||||
//if (!UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
//{
|
||||
// ScriptManager sm = ScriptManager.GetCurrent(base.Page);
|
||||
// ServiceReference webservicePath = new ServiceReference(SystemDirectories.Webservices + "/MacroContainerService.asmx");
|
||||
// And a reference to the macro container calls
|
||||
//if (!UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
//{
|
||||
// ScriptManager sm = ScriptManager.GetCurrent(base.Page);
|
||||
// ServiceReference webservicePath = new ServiceReference(SystemDirectories.Webservices + "/MacroContainerService.asmx");
|
||||
|
||||
// if (!sm.Services.Contains(webservicePath))
|
||||
// sm.Services.Add(webservicePath);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
|
||||
//}
|
||||
// if (!sm.Services.Contains(webservicePath))
|
||||
// sm.Services.Add(webservicePath);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
string script = "function "+ ID +"makesortable(){ ";
|
||||
script += " jQuery('.macrocontainer').sortable({ update : function () { ";
|
||||
script += " umbraco.presentation.webservices.MacroContainerService.SetSortOrder('" + ID + "',jQuery('.macrocontainer').sortable('serialize'));";
|
||||
script +=" }}); ";
|
||||
script += " ";
|
||||
script += "}";
|
||||
|
||||
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), ID + "macrocontainersortable",
|
||||
script, true);
|
||||
string script = "function " + ID + "makesortable(){ ";
|
||||
script += " jQuery('#" + ID + "container').sortable({ update : function () { ";
|
||||
script += " umbraco.presentation.webservices.MacroContainerService.SetSortOrder('" + ID + "', jQuery('#" + ID + "container').sortable('serialize'));";
|
||||
script += " }}); ";
|
||||
script += " ";
|
||||
script += "}";
|
||||
|
||||
if (!Page.IsPostBack)
|
||||
HttpContext.Current.Session[ID + "sortorder"] = null;
|
||||
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), ID + "macrocontainersortable",
|
||||
script, true);
|
||||
|
||||
ScriptManager.RegisterStartupScript(this, this.GetType(), ID + "initsort", ID + "makesortable();", true);
|
||||
if (!Page.IsPostBack)
|
||||
HttpContext.Current.Session[ID + "sortorder"] = null;
|
||||
|
||||
string sortscript = string.Empty;
|
||||
ScriptManager.RegisterStartupScript(this, this.GetType(), ID + "initsort", ID + "makesortable();", true);
|
||||
|
||||
string sortorder = string.Empty;
|
||||
if (HttpContext.Current.Session[ID + "sortorder"] != null)
|
||||
{
|
||||
sortorder = HttpContext.Current.Session[ID + "sortorder"].ToString();
|
||||
}
|
||||
if (sortorder != string.Empty)
|
||||
{
|
||||
string sortscript = string.Empty;
|
||||
|
||||
foreach (string temp in sortorder.Split('&'))
|
||||
{
|
||||
string number = temp.Substring(temp.LastIndexOf('=') + 1);
|
||||
string sortorder = string.Empty;
|
||||
if (HttpContext.Current.Session[ID + "sortorder"] != null)
|
||||
{
|
||||
sortorder = HttpContext.Current.Session[ID + "sortorder"].ToString();
|
||||
}
|
||||
if (sortorder != string.Empty)
|
||||
{
|
||||
|
||||
foreach (string temp in sortorder.Split('&'))
|
||||
{
|
||||
string number = temp.Substring(temp.LastIndexOf('=') + 1);
|
||||
|
||||
|
||||
sortscript += "jQuery('#container"+ID+"macroeditor_" + number + "').appendTo('#"+ID+"container');";
|
||||
}
|
||||
}
|
||||
if(sortscript != string.Empty)
|
||||
ScriptManager.RegisterStartupScript(this, this.GetType(), ID + "resort", sortscript, true);
|
||||
sortscript += "jQuery('#container" + ID + "macroeditor_" + number + "').appendTo('#" + ID + "container');";
|
||||
}
|
||||
}
|
||||
if (sortscript != string.Empty)
|
||||
ScriptManager.RegisterStartupScript(this, this.GetType(), ID + "resort", sortscript, true);
|
||||
|
||||
EnsureChildControls();
|
||||
EnsureChildControls();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region IDataEditor Members
|
||||
|
||||
public void Save()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
string value = string.Empty;
|
||||
|
||||
@@ -258,18 +257,24 @@ namespace umbraco.editorControls.macrocontainer
|
||||
{
|
||||
string number = temp.Substring(temp.LastIndexOf('=') + 1);
|
||||
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + number));
|
||||
if (current.Visible)
|
||||
value += current.MacroTag;
|
||||
if (this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + number) != null)
|
||||
{
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + number));
|
||||
if (current.Visible)
|
||||
value += current.MacroTag;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i< _maxNumber; i++)
|
||||
for (int i = 0; i < _maxNumber; i++)
|
||||
{
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + i.ToString()));
|
||||
if(current.Visible)
|
||||
value += current.MacroTag;
|
||||
if (this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + i.ToString()) != null)
|
||||
{
|
||||
MacroEditor current = ((MacroEditor)this.ContentTemplateContainer.FindControl(ID + "macroeditor_" + i.ToString()));
|
||||
if (current.Visible)
|
||||
value += current.MacroTag;
|
||||
}
|
||||
}
|
||||
}
|
||||
_data.Value = value;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace umbraco.editorControls.macrocontainer
|
||||
_macroSelectDropdown.Items.Add(new ListItem(umbraco.ui.Text("choose"), ""));
|
||||
foreach (string item in _allowedMacros)
|
||||
{
|
||||
_macroSelectDropdown.Items.Add(new ListItem(Macro.GetByAlias(item).Name, item));
|
||||
_macroSelectDropdown.Items.Add(new ListItem(GetMacroNameFromAlias(item), item));
|
||||
}
|
||||
_macroSelectDropdown.AutoPostBack = true;
|
||||
|
||||
@@ -58,6 +58,20 @@ namespace umbraco.editorControls.macrocontainer
|
||||
this.Controls.Add(_formTable);
|
||||
}
|
||||
|
||||
//using this to solve to eager loading,
|
||||
// replaces _macroSelectDropdown.Items.Add(new ListItem(Macro.GetByAlias(item).Name, item));
|
||||
// with _macroSelectDropdown.Items.Add(new ListItem(GetMacroNameFromAlias(item), item));
|
||||
private string GetMacroNameFromAlias(string alias)
|
||||
{
|
||||
umbraco.DataLayer.IRecordsReader dr = umbraco.BusinessLogic.Application.SqlHelper.ExecuteReader("select macroName from cmsMacro where macroAlias = @alias",
|
||||
umbraco.BusinessLogic.Application.SqlHelper.CreateParameter("@alias", alias));
|
||||
|
||||
if (dr.Read())
|
||||
return dr.GetString("macroName");
|
||||
else
|
||||
return string.Empty;
|
||||
|
||||
}
|
||||
void _delete_Click(object sender, EventArgs e)
|
||||
{
|
||||
_macroSelectDropdown.SelectedIndex = 0;
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace umbraco.editorControls.macrocontainer
|
||||
if (_maxNumber == null)
|
||||
{
|
||||
int output = 0;
|
||||
if (Configuration.Split('|').Length > 1)
|
||||
if (Configuration != null && Configuration.Split('|').Length > 1)
|
||||
{
|
||||
int.TryParse(Configuration.Split('|')[1], out output);
|
||||
return output;
|
||||
@@ -216,7 +216,7 @@ namespace umbraco.editorControls.macrocontainer
|
||||
if (_preferedHeight == null)
|
||||
{
|
||||
int output = 0;
|
||||
if (Configuration.Split('|').Length > 2)
|
||||
if (Configuration != null && Configuration.Split('|').Length > 2)
|
||||
{
|
||||
int.TryParse(Configuration.Split('|')[2], out output);
|
||||
return output;
|
||||
@@ -238,7 +238,7 @@ namespace umbraco.editorControls.macrocontainer
|
||||
if (_preferedWidth == null)
|
||||
{
|
||||
int output = 0;
|
||||
if (Configuration.Split('|').Length > 3)
|
||||
if (Configuration != null && Configuration.Split('|').Length > 3)
|
||||
{
|
||||
int.TryParse(Configuration.Split('|')[3], out output);
|
||||
return output;
|
||||
|
||||
@@ -90,6 +90,11 @@ namespace umbraco.editorControls.mediapicker
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid", SqlParams);
|
||||
|
||||
// For SQL CE 4 support we need this again!
|
||||
SqlParams = new IParameter[] {
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')", SqlParams);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace umbraco.editorControls.radiobuttonlist
|
||||
{
|
||||
if (_Editor == null)
|
||||
{
|
||||
_Editor = new radiobox(Data,((KeyValuePrevalueEditor)PrevalueEditor).Prevalues);
|
||||
_Editor = new radiobox(Data, ((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList);
|
||||
}
|
||||
return _Editor;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.ComponentModel;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
public class radiobox : System.Web.UI.WebControls.RadioButtonList, interfaces.IDataEditor
|
||||
@@ -16,6 +17,13 @@ namespace umbraco.editorControls
|
||||
_prevalues = Prevalues;
|
||||
}
|
||||
|
||||
List<KeyValuePair<int, String>> Prevalues;
|
||||
public radiobox(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
|
||||
{
|
||||
_data = Data;
|
||||
this.Prevalues = Prevalues;
|
||||
}
|
||||
|
||||
public Control Editor
|
||||
{
|
||||
get {return this;}
|
||||
@@ -40,11 +48,22 @@ namespace umbraco.editorControls
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit (e);
|
||||
foreach (object key in _prevalues.Keys)
|
||||
{
|
||||
this.Items.Add(new ListItem(_prevalues[key].ToString(),key.ToString()));
|
||||
}
|
||||
|
||||
|
||||
if (_prevalues != null)
|
||||
{
|
||||
foreach (object key in _prevalues.Keys)
|
||||
{
|
||||
this.Items.Add(new ListItem(_prevalues[key].ToString(), key.ToString()));
|
||||
}
|
||||
}
|
||||
else if (Prevalues != null)
|
||||
{
|
||||
foreach (KeyValuePair<int, String> item in Prevalues)
|
||||
{
|
||||
this.Items.Add(new ListItem(item.Value, item.Key.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (_data != null && _data.Value != null)
|
||||
this.SelectedValue = _data.Value.ToString();
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.presentation.nodeFactory;
|
||||
using umbraco.presentation;
|
||||
using ClientDependency.Core.Controls;
|
||||
using ClientDependency.Core;
|
||||
@@ -41,8 +40,8 @@ namespace umbraco.editorControls.tags
|
||||
int.TryParse(_data.NodeId.ToString(), out _nodeID);
|
||||
string allTags = "";
|
||||
int tagId = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
//first clear out all items associated with this ID...
|
||||
umbraco.cms.businesslogic.Tags.Tag.RemoveTagsFromNode(_nodeID, _group);
|
||||
|
||||
@@ -139,18 +138,27 @@ namespace umbraco.editorControls.tags
|
||||
|
||||
ClientDependencyLoader.Instance.RegisterDependency("Application/JQuery/jquery.autocomplete.js", "UmbracoClient", ClientDependencyType.Javascript);
|
||||
ClientDependencyLoader.Instance.RegisterDependency("css/umbracoGui.css", "UmbracoRoot", ClientDependencyType.Css);
|
||||
|
||||
|
||||
string _alias = ((umbraco.cms.businesslogic.datatype.DefaultData)_data).PropertyId.ToString();
|
||||
|
||||
//making sure that we have a ID for context
|
||||
string pageId = UmbracoContext.Current.Request["id"];
|
||||
|
||||
if (string.IsNullOrEmpty(pageId.Trim()))
|
||||
if (pageId != null) pageId = pageId.Trim();
|
||||
|
||||
if (string.IsNullOrEmpty(pageId))
|
||||
{
|
||||
Node currentNode = Node.GetCurrent();
|
||||
if (currentNode != null)
|
||||
// we need an empty try/catch as Node.GetCurrent() will throw an exception if we're outside of Umbraco Context
|
||||
try
|
||||
{
|
||||
NodeFactory.Node currentNode = NodeFactory.Node.GetCurrent();
|
||||
if (currentNode != null)
|
||||
{
|
||||
pageId = currentNode.Id.ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
pageId = currentNode.Id.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,13 +176,16 @@ namespace umbraco.editorControls.tags
|
||||
|
||||
tagCheckList.ID = "tagCheckList_" + _alias;
|
||||
|
||||
var tags = umbraco.cms.businesslogic.Tags.Tag.GetTags(int.Parse(pageId), _group);
|
||||
|
||||
foreach(var t in tags)
|
||||
if (!String.IsNullOrEmpty(pageId))
|
||||
{
|
||||
ListItem li = new ListItem(t.TagCaption, t.Id.ToString());
|
||||
li.Selected = true;
|
||||
tagCheckList.Items.Add(li);
|
||||
var tags = umbraco.cms.businesslogic.Tags.Tag.GetTags(int.Parse(pageId), _group);
|
||||
|
||||
foreach (var t in tags)
|
||||
{
|
||||
ListItem li = new ListItem(t.TagCaption, t.Id.ToString());
|
||||
li.Selected = true;
|
||||
tagCheckList.Items.Add(li);
|
||||
}
|
||||
}
|
||||
|
||||
this.ContentTemplateContainer.Controls.Add(tagBox);
|
||||
@@ -186,12 +197,12 @@ namespace umbraco.editorControls.tags
|
||||
+ tagBox.ClientID + "\").autocomplete(\""
|
||||
+ umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)
|
||||
+ "/webservices/TagsAutoCompleteHandler.ashx\",{minChars: 2,max: 100, extraParams:{group:\"" + _group + "\",id:\"" + pageId + "\",rnd:\"" + DateTime.Now.Ticks + "\"}}).result(function(e, data){jQuery(\"#" + tagButton.ClientID + "\").trigger('click');});";
|
||||
|
||||
|
||||
|
||||
|
||||
string tagsAutoCompleteInitScript =
|
||||
"jQuery(document).ready(function(){"
|
||||
+ tagsAutoCompleteScript
|
||||
+"});";
|
||||
+ "});";
|
||||
|
||||
Page.ClientScript.RegisterStartupScript(GetType(), ClientID + "_tagsinit", tagsAutoCompleteInitScript, true);
|
||||
|
||||
@@ -201,7 +212,7 @@ namespace umbraco.editorControls.tags
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -6,43 +6,38 @@ using System.Web.UI;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.editorControls.tinymce;
|
||||
using umbraco.editorControls.tinyMCE3.webcontrol;
|
||||
using umbraco.editorControls.wysiwyg;
|
||||
using umbraco.interfaces;
|
||||
using umbraco.uicontrols;
|
||||
using umbraco.editorControls.tinymce;
|
||||
using umbraco.IO;
|
||||
|
||||
using umbraco.presentation;
|
||||
using umbraco.uicontrols;
|
||||
|
||||
namespace umbraco.editorControls.tinyMCE3
|
||||
{
|
||||
public class TinyMCE : webcontrol.TinyMCEWebControl, IDataEditor, IMenuElement, ILiveEditingDataEditor
|
||||
public class TinyMCE : TinyMCEWebControl, IDataEditor, IMenuElement, ILiveEditingDataEditor
|
||||
{
|
||||
private IData _data;
|
||||
private bool m_isInLiveEditingMode = false;
|
||||
private bool _enableContextMenu = false;
|
||||
private string _editorButtons = "";
|
||||
private string _advancedUsers = "";
|
||||
private bool _fullWidth = false;
|
||||
private int _width = 0;
|
||||
private int _height = 0;
|
||||
private bool _showLabel = false;
|
||||
private readonly string _activateButtons = "";
|
||||
private readonly string _advancedUsers = "";
|
||||
private readonly SortedList _buttons = new SortedList();
|
||||
private readonly IData _data;
|
||||
private readonly string _disableButtons = "help,visualaid,";
|
||||
private readonly string _editorButtons = "";
|
||||
private readonly bool _enableContextMenu;
|
||||
private readonly bool _fullWidth;
|
||||
private readonly int _height;
|
||||
private readonly SortedList _mceButtons = new SortedList();
|
||||
private readonly ArrayList _menuIcons = new ArrayList();
|
||||
private readonly bool _showLabel;
|
||||
private readonly ArrayList _stylesheets = new ArrayList();
|
||||
private readonly int _width;
|
||||
|
||||
private readonly int m_maxImageWidth = 500;
|
||||
private bool _isInitialized;
|
||||
private string _plugins = "";
|
||||
private ArrayList _stylesheets = new ArrayList();
|
||||
private bool m_isInLiveEditingMode;
|
||||
|
||||
private ArrayList _menuIcons = new ArrayList();
|
||||
private SortedList _buttons = new SortedList();
|
||||
private SortedList _mceButtons = new SortedList();
|
||||
private bool _isInitialized = false;
|
||||
private string _activateButtons = "";
|
||||
private string _disableButtons = "help,visualaid,";
|
||||
private int m_maxImageWidth = 500;
|
||||
|
||||
|
||||
public virtual string Plugins
|
||||
{
|
||||
get { return _plugins; }
|
||||
set { _plugins = value; }
|
||||
}
|
||||
|
||||
public TinyMCE(IData Data, string Configuration)
|
||||
{
|
||||
@@ -89,7 +84,7 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
if (configSettings.Length > 6 && configSettings[6] != "")
|
||||
_showLabel = bool.Parse(configSettings[6]);
|
||||
if (configSettings.Length > 7 && configSettings[7] != "")
|
||||
m_maxImageWidth = int.Parse(configSettings[7].ToString());
|
||||
m_maxImageWidth = int.Parse(configSettings[7]);
|
||||
|
||||
// sizing
|
||||
if (!_fullWidth)
|
||||
@@ -109,7 +104,8 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
|
||||
// If the editor is used in umbraco, use umbraco's own toolbar
|
||||
bool onFront = false;
|
||||
if (GlobalSettings.RequestIsInUmbracoApplication(HttpContext.Current) || umbraco.presentation.UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
if (GlobalSettings.RequestIsInUmbracoApplication(HttpContext.Current) ||
|
||||
UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
{
|
||||
config.Add("theme_umbraco_toolbar_location", "external");
|
||||
config.Add("skin", "umbraco");
|
||||
@@ -122,10 +118,10 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
}
|
||||
|
||||
// load plugins
|
||||
IDictionaryEnumerator pluginEnum = umbraco.editorControls.tinymce.tinyMCEConfiguration.Plugins.GetEnumerator();
|
||||
IDictionaryEnumerator pluginEnum = tinyMCEConfiguration.Plugins.GetEnumerator();
|
||||
while (pluginEnum.MoveNext())
|
||||
{
|
||||
umbraco.editorControls.tinymce.tinyMCEPlugin plugin = (umbraco.editorControls.tinymce.tinyMCEPlugin)pluginEnum.Value;
|
||||
var plugin = (tinyMCEPlugin) pluginEnum.Value;
|
||||
if (plugin.UseOnFrontend || (!onFront && !plugin.UseOnFrontend))
|
||||
_plugins += "," + plugin.Name;
|
||||
}
|
||||
@@ -137,7 +133,8 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
config.Add("plugins", _plugins);
|
||||
|
||||
// Check advanced settings
|
||||
if (("," + _advancedUsers + ",").IndexOf("," + UmbracoEnsuredPage.CurrentUser.UserType.Id + ",") > -1)
|
||||
if (("," + _advancedUsers + ",").IndexOf("," + UmbracoEnsuredPage.CurrentUser.UserType.Id + ",") >
|
||||
-1)
|
||||
config.Add("umbraco_advancedMode", "true");
|
||||
else
|
||||
config.Add("umbraco_advancedMode", "false");
|
||||
@@ -153,7 +150,7 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
if (styleSheetId.Trim() != "")
|
||||
try
|
||||
{
|
||||
StyleSheet s = new StyleSheet(int.Parse(styleSheetId));
|
||||
var s = new StyleSheet(int.Parse(styleSheetId));
|
||||
if (s.nodeObjectType == StyleSheet.ModuleObjectType)
|
||||
{
|
||||
cssFiles += IOHelper.ResolveUrl(SystemDirectories.Css + "/" + s.Text + ".css");
|
||||
@@ -194,10 +191,10 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
config.Add("theme_umbraco_styles", styles);
|
||||
|
||||
// Add buttons
|
||||
IDictionaryEnumerator ide = umbraco.editorControls.tinymce.tinyMCEConfiguration.Commands.GetEnumerator();
|
||||
IDictionaryEnumerator ide = tinyMCEConfiguration.Commands.GetEnumerator();
|
||||
while (ide.MoveNext())
|
||||
{
|
||||
umbraco.editorControls.tinymce.tinyMCECommand cmd = (umbraco.editorControls.tinymce.tinyMCECommand)ide.Value;
|
||||
var cmd = (tinyMCECommand) ide.Value;
|
||||
if (_editorButtons.IndexOf("," + cmd.Alias + ",") > -1)
|
||||
_activateButtons += cmd.Alias + ",";
|
||||
else
|
||||
@@ -218,12 +215,12 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
while (ide.MoveNext())
|
||||
{
|
||||
string mceCommand = ide.Value.ToString();
|
||||
int curPriority = (int)ide.Key;
|
||||
var curPriority = (int) ide.Key;
|
||||
|
||||
// Check priority
|
||||
if (separatorPriority > 0 &&
|
||||
Math.Floor(decimal.Parse(curPriority.ToString()) / 10) >
|
||||
Math.Floor(decimal.Parse(separatorPriority.ToString()) / 10))
|
||||
Math.Floor(decimal.Parse(curPriority.ToString())/10) >
|
||||
Math.Floor(decimal.Parse(separatorPriority.ToString())/10))
|
||||
_activateButtons += "separator,";
|
||||
|
||||
_activateButtons += mceCommand + ",";
|
||||
@@ -246,7 +243,10 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
config.Add("event_elements", "div");
|
||||
config.Add("paste_auto_cleanup_on_paste", "true");
|
||||
|
||||
config.Add("valid_elements", tinyMCEConfiguration.ValidElements.Substring(1, tinyMCEConfiguration.ValidElements.Length - 2));
|
||||
config.Add("valid_elements",
|
||||
tinyMCEConfiguration.ValidElements.Substring(1,
|
||||
tinyMCEConfiguration.ValidElements.Length -
|
||||
2));
|
||||
config.Add("invalid_elements", tinyMCEConfiguration.InvalidElements);
|
||||
|
||||
// custom commands
|
||||
@@ -284,8 +284,6 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
}
|
||||
}
|
||||
|
||||
#region IDataEditor Members
|
||||
|
||||
#region TreatAsRichTextEditor
|
||||
|
||||
public virtual bool TreatAsRichTextEditor
|
||||
@@ -357,7 +355,7 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
parsedString = parsedString.Replace("|||?", "<?").Replace("/|||", "/>").Replace("|*|", "\"");
|
||||
|
||||
// fix images
|
||||
parsedString = umbraco.editorControls.tinymce.tinyMCEImageHelper.cleanImages(parsedString);
|
||||
parsedString = tinyMCEImageHelper.cleanImages(parsedString);
|
||||
|
||||
// parse current domain and instances of slash before anchor (to fix anchor bug)
|
||||
// NH 31-08-2007
|
||||
@@ -379,40 +377,108 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
|
||||
#endregion
|
||||
|
||||
public virtual string Plugins
|
||||
{
|
||||
get { return _plugins; }
|
||||
set { _plugins = value; }
|
||||
}
|
||||
|
||||
public object[] MenuIcons
|
||||
{
|
||||
get
|
||||
{
|
||||
initButtons();
|
||||
|
||||
var tempIcons = new object[_menuIcons.Count];
|
||||
for (int i = 0; i < _menuIcons.Count; i++)
|
||||
tempIcons[i] = _menuIcons[i];
|
||||
return tempIcons;
|
||||
}
|
||||
}
|
||||
|
||||
#region ILiveEditingDataEditor Members
|
||||
|
||||
public Control LiveEditingControl
|
||||
{
|
||||
get
|
||||
{
|
||||
m_isInLiveEditingMode = true;
|
||||
base.IsInLiveEditingMode = true;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IMenuElement Members
|
||||
|
||||
public string ElementName
|
||||
{
|
||||
get { return "div"; }
|
||||
}
|
||||
|
||||
public string ElementIdPreFix
|
||||
{
|
||||
get { return "umbTinymceMenu"; }
|
||||
}
|
||||
|
||||
public string ElementClass
|
||||
{
|
||||
get { return "tinymceMenuBar"; }
|
||||
}
|
||||
|
||||
public int ExtraMenuWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
initButtons();
|
||||
return _buttons.Count*40 + 300;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// add current page info
|
||||
base.NodeId = ((cms.businesslogic.datatype.DefaultData)_data).NodeId;
|
||||
base.VersionId = ((cms.businesslogic.datatype.DefaultData)_data).Version;
|
||||
config.Add("theme_umbraco_pageId", base.NodeId.ToString());
|
||||
config.Add("theme_umbraco_versionId", base.VersionId.ToString());
|
||||
|
||||
// we'll need to make an extra check for the liveediting as that value is set after the constructor have initialized
|
||||
if (IsInLiveEditingMode)
|
||||
base.NodeId = ((cms.businesslogic.datatype.DefaultData) _data).NodeId;
|
||||
if (NodeId != 0)
|
||||
{
|
||||
if (config["theme_umbraco_toolbar_location"] == null)
|
||||
config.Add("theme_umbraco_toolbar_location", "");
|
||||
config["theme_umbraco_toolbar_location"] = "external";
|
||||
config.Add("umbraco_toolbar_id",
|
||||
"LiveEditingClientToolbar");
|
||||
base.VersionId = ((cms.businesslogic.datatype.DefaultData) _data).Version;
|
||||
config.Add("theme_umbraco_pageId", base.NodeId.ToString());
|
||||
config.Add("theme_umbraco_versionId", base.VersionId.ToString());
|
||||
|
||||
// we'll need to make an extra check for the liveediting as that value is set after the constructor have initialized
|
||||
if (IsInLiveEditingMode)
|
||||
{
|
||||
if (config["theme_umbraco_toolbar_location"] == null)
|
||||
config.Add("theme_umbraco_toolbar_location", "");
|
||||
config["theme_umbraco_toolbar_location"] = "external";
|
||||
config.Add("umbraco_toolbar_id",
|
||||
"LiveEditingClientToolbar");
|
||||
}
|
||||
else
|
||||
{
|
||||
config.Add("umbraco_toolbar_id",
|
||||
ElementIdPreFix +
|
||||
((cms.businesslogic.datatype.DefaultData) _data).PropertyId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is for use when tinymce is used for non default Umbraco pages
|
||||
config.Add("umbraco_toolbar_id",
|
||||
ElementIdPreFix + ((cms.businesslogic.datatype.DefaultData)_data).PropertyId.ToString());
|
||||
|
||||
ElementIdPreFix + "_" + this.ClientID);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Empty catch as this is caused by the document doesn't exists yet,
|
||||
// like when using this on an autoform
|
||||
// like when using this on an autoform, partly replaced by the if/else check on nodeId above though
|
||||
}
|
||||
base.OnLoad(e);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
@@ -447,8 +513,8 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
if (orgKey == "umb_macroalias")
|
||||
orgKey = "umb_macroAlias";
|
||||
|
||||
macroTag += orgKey.Substring(4, orgKey.ToString().Length - 4) + "=|*|" +
|
||||
ide.Value.ToString().Replace("\\r\\n", Environment.NewLine) + "|*| ";
|
||||
macroTag += orgKey.Substring(4, orgKey.Length - 4) + "=|*|" +
|
||||
ide.Value.ToString().Replace("\\r\\n", Environment.NewLine) + "|*| ";
|
||||
}
|
||||
}
|
||||
macroTag += "/|||";
|
||||
@@ -458,13 +524,13 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
|
||||
public static Hashtable ReturnAttributes(String tag)
|
||||
{
|
||||
Hashtable ht = new Hashtable();
|
||||
var ht = new Hashtable();
|
||||
MatchCollection m =
|
||||
Regex.Matches(tag, "(?<attributeName>\\S*)=\"(?<attributeValue>[^\"]*)\"",
|
||||
RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
|
||||
foreach (Match attributeSet in m)
|
||||
ht.Add(attributeSet.Groups["attributeName"].Value.ToString(),
|
||||
attributeSet.Groups["attributeValue"].Value.ToString());
|
||||
ht.Add(attributeSet.Groups["attributeName"].Value,
|
||||
attributeSet.Groups["attributeValue"].Value);
|
||||
|
||||
return ht;
|
||||
}
|
||||
@@ -486,7 +552,8 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
string find = "<!-- endumbmacro -->";
|
||||
|
||||
int endMacroIndex = text.ToLower().IndexOf(find);
|
||||
string tempText = text.ToLower().Substring(endMacroIndex + find.Length, text.Length - endMacroIndex - find.Length);
|
||||
string tempText = text.ToLower().Substring(endMacroIndex + find.Length,
|
||||
text.Length - endMacroIndex - find.Length);
|
||||
int finalEndPos = 0;
|
||||
while (tempText.Length > 5)
|
||||
if (tempText.Substring(finalEndPos, 6) == "</div>")
|
||||
@@ -497,23 +564,6 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
return endMacroIndex + find.Length + finalEndPos + 6;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDataFieldWithButtons Members
|
||||
|
||||
public object[] MenuIcons
|
||||
{
|
||||
get
|
||||
{
|
||||
initButtons();
|
||||
|
||||
object[] tempIcons = new object[_menuIcons.Count];
|
||||
for (int i = 0; i < _menuIcons.Count; i++)
|
||||
tempIcons[i] = _menuIcons[i];
|
||||
return tempIcons;
|
||||
}
|
||||
}
|
||||
|
||||
private void initButtons()
|
||||
{
|
||||
if (!_isInitialized)
|
||||
@@ -536,7 +586,7 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
{
|
||||
try
|
||||
{
|
||||
umbraco.editorControls.tinymce.tinyMCECommand cmd = (umbraco.editorControls.tinymce.tinyMCECommand)umbraco.editorControls.tinymce.tinyMCEConfiguration.Commands[button];
|
||||
var cmd = (tinyMCECommand) tinyMCEConfiguration.Commands[button];
|
||||
|
||||
string appendValue = "";
|
||||
if (cmd.Value != "")
|
||||
@@ -550,7 +600,7 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
catch (Exception ee)
|
||||
{
|
||||
Log.Add(LogTypes.Error, User.GetUser(0), -1,
|
||||
string.Format("TinyMCE: Error initializing button '{0}': {1}", button, ee.ToString()));
|
||||
string.Format("TinyMCE: Error initializing button '{0}': {1}", button, ee));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -561,17 +611,17 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
while (ide.MoveNext())
|
||||
{
|
||||
object buttonObj = ide.Value;
|
||||
int curPriority = (int)ide.Key;
|
||||
var curPriority = (int) ide.Key;
|
||||
|
||||
// Check priority
|
||||
if (separatorPriority > 0 &&
|
||||
Math.Floor(decimal.Parse(curPriority.ToString()) / 10) >
|
||||
Math.Floor(decimal.Parse(separatorPriority.ToString()) / 10))
|
||||
Math.Floor(decimal.Parse(curPriority.ToString())/10) >
|
||||
Math.Floor(decimal.Parse(separatorPriority.ToString())/10))
|
||||
_menuIcons.Add("|");
|
||||
|
||||
try
|
||||
{
|
||||
editorButton e = (editorButton)buttonObj;
|
||||
var e = (editorButton) buttonObj;
|
||||
|
||||
MenuIconI menuItem = new MenuIconClass();
|
||||
|
||||
@@ -589,50 +639,5 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IMenuElement Members
|
||||
|
||||
public string ElementName
|
||||
{
|
||||
get { return "div"; }
|
||||
}
|
||||
|
||||
public string ElementIdPreFix
|
||||
{
|
||||
get { return "umbTinymceMenu"; }
|
||||
}
|
||||
|
||||
public string ElementClass
|
||||
{
|
||||
get { return "tinymceMenuBar"; }
|
||||
}
|
||||
|
||||
public int ExtraMenuWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
initButtons();
|
||||
return _buttons.Count * 40 + 300;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ILiveEditingDataEditor Members
|
||||
|
||||
public Control LiveEditingControl
|
||||
{
|
||||
get
|
||||
{
|
||||
m_isInLiveEditingMode = true;
|
||||
base.IsInLiveEditingMode = true;
|
||||
return this;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -260,6 +260,10 @@ namespace umbraco.editorControls.tinymce
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid",SqlParams);
|
||||
// we need to populate the parameters again due to an issue with SQL CE
|
||||
SqlParams = new IParameter[] {
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')",SqlParams);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +126,10 @@ namespace umbraco.editorControls.ultimatepicker
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid", SqlParams);
|
||||
// need to unlock the parameters (for SQL CE compat)
|
||||
SqlParams = new IParameter[] {
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')", SqlParams);
|
||||
|
||||
|
||||
|
||||
@@ -27,10 +27,14 @@
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<IsWebBootstrapper>true</IsWebBootstrapper>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
@@ -299,6 +303,27 @@
|
||||
<Compile Include="relatedlinks\RelatedLinksDataEditor.cs" />
|
||||
<Compile Include="relatedlinks\RelatedLinksDataType.cs" />
|
||||
<Compile Include="relatedlinks\RelatedLinksPrevalueEditor.cs" />
|
||||
<Compile Include="SettingControls\CheckBox.cs" />
|
||||
<Compile Include="SettingControls\CheckBoxList.cs" />
|
||||
<Compile Include="SettingControls\DropDownList.cs" />
|
||||
<Compile Include="SettingControls\ListBox.cs" />
|
||||
<Compile Include="SettingControls\ListBoxMultiple.cs" />
|
||||
<Compile Include="SettingControls\Password.cs" />
|
||||
<Compile Include="SettingControls\Pickers\BasePicker.cs" />
|
||||
<Compile Include="SettingControls\Pickers\Content.cs" />
|
||||
<Compile Include="SettingControls\Pickers\Date.cs" />
|
||||
<Compile Include="SettingControls\Pickers\DateWithTime.cs" />
|
||||
<Compile Include="SettingControls\Pickers\DocumentType.cs" />
|
||||
<Compile Include="SettingControls\Pickers\Field.cs" />
|
||||
<Compile Include="SettingControls\Pickers\Media.cs" />
|
||||
<Compile Include="SettingControls\Pickers\MediaType.cs" />
|
||||
<Compile Include="SettingControls\Pickers\MemberGroup.cs" />
|
||||
<Compile Include="SettingControls\Pickers\MemberType.cs" />
|
||||
<Compile Include="SettingControls\Pickers\Path.cs" />
|
||||
<Compile Include="SettingControls\RadioButtonList.cs" />
|
||||
<Compile Include="SettingControls\TextArea.cs" />
|
||||
<Compile Include="SettingControls\TextField.cs" />
|
||||
<Compile Include="SettingControls\Values.cs" />
|
||||
<Compile Include="simpleEditor\simpleEditor.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -323,6 +348,7 @@
|
||||
<Compile Include="tinymce\TinyMCELegacyControl.cs" />
|
||||
<Compile Include="tinymce\tinyMCEImageHelper.cs" />
|
||||
<Compile Include="tinymce\tinyMCEPreValueConfigurator.cs" />
|
||||
<Compile Include="userControlWrapper\usercontrolData.cs" />
|
||||
<Compile Include="wysiwyg\editorButton.cs" />
|
||||
<Compile Include="tinyMCE3\TinyMCE.cs" />
|
||||
<Compile Include="tinyMCE3\tinyMCE3dataType.cs" />
|
||||
@@ -395,8 +421,12 @@
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="KeyValuePrevalueEditor.js" />
|
||||
<Content Include="mediapicker\MediaPicker.js" />
|
||||
<EmbeddedResource Include="SettingControls\css\Values.css" />
|
||||
<EmbeddedResource Include="SettingControls\js\Values.js" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using umbraco.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
@@ -36,15 +37,24 @@ namespace umbraco.editorControls
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public string SafeUrl(string url)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(url))
|
||||
return Regex.Replace(url, @"[^a-zA-Z0-9\-\.\/\:]{1}", "_");
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal logic for validation controls to detect whether or not it's valid (has to be public though)
|
||||
/// </summary>
|
||||
/// <value>Am I valid?</value>
|
||||
public string IsValid
|
||||
{
|
||||
get {
|
||||
get
|
||||
{
|
||||
string tempText = Text;
|
||||
bool isEmpty = String.IsNullOrEmpty(this.PostedFile.FileName);
|
||||
bool isEmpty = this.PostedFile == null || String.IsNullOrEmpty(this.PostedFile.FileName);
|
||||
// checkbox, if it's used the file will be deleted and we should throw a validation error
|
||||
if (Page.Request[this.ClientID + "clear"] != null && Page.Request[this.ClientID + "clear"].ToString() != "")
|
||||
return "";
|
||||
@@ -91,10 +101,11 @@ namespace umbraco.editorControls
|
||||
//{
|
||||
// //delete old file
|
||||
// deleteFile(_text);
|
||||
|
||||
|
||||
//}
|
||||
|
||||
// Find filename
|
||||
// Find filename (removed the safe url here as it removes fullpath characters (such as c:\ becomes c:) - the safe url should only be used when saving the
|
||||
// local filename
|
||||
_text = this.PostedFile.FileName;
|
||||
string filename;
|
||||
string _fullFilePath;
|
||||
@@ -103,11 +114,12 @@ namespace umbraco.editorControls
|
||||
|
||||
if (umbraco.UmbracoSettings.UploadAllowDirectories)
|
||||
{
|
||||
filename = _text.Substring(_text.LastIndexOf( IOHelper.DirSepChar ) + 1, _text.Length - _text.LastIndexOf( IOHelper.DirSepChar ) - 1).ToLower();
|
||||
// moved the safeUrl call to here as it's the local file name to be stored
|
||||
filename = SafeUrl(_text.Substring(_text.LastIndexOf(IOHelper.DirSepChar) + 1, _text.Length - _text.LastIndexOf(IOHelper.DirSepChar) - 1).ToLower());
|
||||
// Create a new folder in the /media folder with the name /media/propertyid
|
||||
|
||||
|
||||
System.IO.Directory.CreateDirectory( IOHelper.MapPath( SystemDirectories.Media + "/" + _data.PropertyId.ToString() ) );
|
||||
|
||||
System.IO.Directory.CreateDirectory(IOHelper.MapPath(SystemDirectories.Media + "/" + _data.PropertyId.ToString()));
|
||||
|
||||
_fullFilePath = IOHelper.MapPath(SystemDirectories.Media + "/" + _data.PropertyId.ToString() + "/" + filename);
|
||||
this.PostedFile.SaveAs(_fullFilePath);
|
||||
@@ -122,7 +134,7 @@ namespace umbraco.editorControls
|
||||
else
|
||||
{
|
||||
//filename = this.
|
||||
filename = System.IO.Path.GetFileName(this.PostedFile.FileName);
|
||||
filename = System.IO.Path.GetFileName(SafeUrl(this.PostedFile.FileName));
|
||||
filename = _data.PropertyId + "-" + filename;
|
||||
_fullFilePath = IOHelper.MapPath(SystemDirectories.Media + "/" + filename);
|
||||
this.PostedFile.SaveAs(_fullFilePath);
|
||||
@@ -188,7 +200,7 @@ namespace umbraco.editorControls
|
||||
//cms.businesslogic.Content.GetContentFromVersion(_data.Version).getProperty("umbracoWidth").Value = fileWidth.ToString();
|
||||
//cms.businesslogic.Content.GetContentFromVersion(_data.Version).getProperty("umbracoHeight").Value = fileHeight.ToString();
|
||||
content.getProperty("umbracoWidth").Value = fileWidth.ToString();
|
||||
noEdit widthControl = uploadField.FindControlRecursive<noEdit>(this.Page, "umbracoWidth");
|
||||
noEdit widthControl = uploadField.FindControlRecursive<noEdit>(this.Page, "umbracoWidth");
|
||||
if (widthControl != null)
|
||||
{
|
||||
widthControl.RefreshLabel(content.getProperty("umbracoWidth").Value.ToString());
|
||||
@@ -211,7 +223,7 @@ namespace umbraco.editorControls
|
||||
{
|
||||
char sep = ';';
|
||||
|
||||
if(!_thumbnails.Contains(sep.ToString()) && _thumbnails.Contains(","))
|
||||
if (!_thumbnails.Contains(sep.ToString()) && _thumbnails.Contains(","))
|
||||
sep = ',';
|
||||
|
||||
string[] thumbnailSizes = _thumbnails.Split(sep);
|
||||
@@ -387,7 +399,7 @@ namespace umbraco.editorControls
|
||||
}
|
||||
else
|
||||
output.WriteLine("<a href=\"" + IOHelper.FindFile(this.Text) + "\" target=\"_blank\">" + IOHelper.FindFile(this.Text) + "</a><br/>");
|
||||
|
||||
|
||||
output.WriteLine("<input type=\"checkbox\" id=\"" + this.ClientID + "clear\" name=\"" + this.ClientID + "clear\" value=\"1\"/> <label for=\"" + this.ClientID + "clear\">" + ui.Text("uploadClear") + "</label><br/>");
|
||||
}
|
||||
base.Render(output);
|
||||
|
||||
@@ -84,7 +84,11 @@ namespace umbraco.editorControls.uploadfield
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid",SqlParams);
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')",SqlParams);
|
||||
// need to unlock the parameters (for SQL CE compat)
|
||||
SqlParams = new IParameter[] {
|
||||
SqlHelper.CreateParameter("@value",data),
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')", SqlParams);
|
||||
}
|
||||
|
||||
protected override void Render(HtmlTextWriter writer)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace umbraco.editorControls.userControlGrapper
|
||||
{
|
||||
public class usercontrolData : umbraco.cms.businesslogic.datatype.DefaultData
|
||||
{
|
||||
public usercontrolData(umbraco.cms.businesslogic.datatype.BaseDataType DataType) : base(DataType) { }
|
||||
|
||||
|
||||
public override System.Xml.XmlNode ToXMl(System.Xml.XmlDocument data)
|
||||
{
|
||||
|
||||
if (this.Value != null)
|
||||
{
|
||||
|
||||
XmlDocument xd = new XmlDocument();
|
||||
|
||||
try
|
||||
{
|
||||
xd.LoadXml(this.Value.ToString());
|
||||
return data.ImportNode(xd.DocumentElement, true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return base.ToXMl(data);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return base.ToXMl(data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,25 @@ using System.Web.UI.HtmlControls;
|
||||
|
||||
using umbraco.interfaces;
|
||||
using umbraco.editorControls;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
using System.Collections.Generic;
|
||||
using umbraco.IO;
|
||||
|
||||
namespace umbraco.editorControls.userControlGrapper
|
||||
{
|
||||
[ValidationProperty("Value")]
|
||||
public class usercontrolDataEditor : System.Web.UI.WebControls.PlaceHolder, umbraco.interfaces.IDataEditor
|
||||
{
|
||||
private umbraco.interfaces.IData _data;
|
||||
private string _usercontrolPath;
|
||||
|
||||
public object Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((IUsercontrolDataEditor)Controls[0]).value;
|
||||
}
|
||||
}
|
||||
|
||||
public usercontrolDataEditor(umbraco.interfaces.IData Data, string UsercontrolPath)
|
||||
{
|
||||
@@ -49,13 +60,52 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
{
|
||||
base.OnInit (e);
|
||||
|
||||
this.Controls.Add(
|
||||
new System.Web.UI.UserControl().LoadControl(_usercontrolPath));
|
||||
Control oControl = new System.Web.UI.UserControl().LoadControl(_usercontrolPath);
|
||||
|
||||
if (HasSettings(oControl.GetType()))
|
||||
{
|
||||
DataEditorSettingsStorage ss = new DataEditorSettingsStorage();
|
||||
List<Setting<string, string>> s = ss.GetSettings(((umbraco.cms.businesslogic.datatype.DefaultData)_data).DataTypeDefinitionId);
|
||||
ss.Dispose();
|
||||
|
||||
foreach (Setting<string, string> setting in s)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!string.IsNullOrEmpty(setting.Key))
|
||||
{
|
||||
oControl.GetType().InvokeMember(setting.Key, System.Reflection.BindingFlags.SetProperty, null, oControl, new object[] { setting.Value });
|
||||
}
|
||||
|
||||
}
|
||||
catch (MissingMethodException ex) { }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.Controls.Add(oControl);
|
||||
|
||||
if (!Page.IsPostBack)
|
||||
((IUsercontrolDataEditor)Controls[0] as IUsercontrolDataEditor).value = _data.Value;
|
||||
|
||||
}
|
||||
|
||||
private bool HasSettings(Type t)
|
||||
{
|
||||
bool hasSettings = false;
|
||||
foreach (System.Reflection.PropertyInfo p in t.GetProperties())
|
||||
{
|
||||
object[] o = p.GetCustomAttributes(typeof(DataEditorSetting), true);
|
||||
|
||||
if (o.Length > 0)
|
||||
{
|
||||
hasSettings = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return hasSettings;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
get
|
||||
{
|
||||
if (_baseData == null)
|
||||
_baseData = new umbraco.cms.businesslogic.datatype.DefaultData(this);
|
||||
_baseData = new usercontrolData(this);
|
||||
return _baseData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ using umbraco.BusinessLogic;
|
||||
|
||||
using umbraco.editorControls;
|
||||
using umbraco.IO;
|
||||
using System.Collections.Generic;
|
||||
using umbraco.cms.businesslogic.datatype;
|
||||
|
||||
namespace umbraco.editorControls.userControlGrapper
|
||||
{
|
||||
@@ -30,7 +32,9 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
|
||||
private DropDownList _dropdownlist;
|
||||
private DropDownList _dropdownlistUserControl;
|
||||
private PlaceHolder _phSettings;
|
||||
|
||||
private Dictionary<string, DataEditorSettingType> dtSettings = new Dictionary<string, DataEditorSettingType>();
|
||||
|
||||
public usercontrolPrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType DataType)
|
||||
{
|
||||
@@ -52,15 +56,20 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
_dropdownlistUserControl = new DropDownList();
|
||||
_dropdownlistUserControl.ID = "usercontrol";
|
||||
|
||||
_phSettings = new PlaceHolder();
|
||||
_phSettings.ID = "settings";
|
||||
|
||||
// put the childcontrols in context - ensuring that
|
||||
// the viewstate is persisted etc.
|
||||
Controls.Add(_dropdownlist);
|
||||
Controls.Add(_dropdownlistUserControl);
|
||||
Controls.Add(_phSettings);
|
||||
|
||||
// populate the usercontrol dropdown
|
||||
_dropdownlistUserControl.Items.Add(new ListItem(ui.Text("choose"), ""));
|
||||
populateUserControls( IOHelper.MapPath( SystemDirectories.Usercontrols) );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void populateUserControls(string path)
|
||||
@@ -104,9 +113,93 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
if (config != "")
|
||||
{
|
||||
_dropdownlistUserControl.SelectedValue = config;
|
||||
|
||||
|
||||
}
|
||||
_dropdownlist.SelectedValue = _datatype.DBType.ToString();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//check for settings
|
||||
if (!string.IsNullOrEmpty(Configuration))
|
||||
LoadSetttings(Configuration);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private Dictionary<string, DataEditorSetting> GetSettings(Type t)
|
||||
{
|
||||
Dictionary<string, DataEditorSetting> settings = new Dictionary<string, DataEditorSetting>();
|
||||
|
||||
foreach (System.Reflection.PropertyInfo p in t.GetProperties())
|
||||
{
|
||||
|
||||
object[] o = p.GetCustomAttributes(typeof(DataEditorSetting), true);
|
||||
|
||||
if (o.Length > 0)
|
||||
settings.Add(p.Name, (DataEditorSetting)o[0]);
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
private bool HasSettings(Type t)
|
||||
{
|
||||
bool hasSettings = false;
|
||||
foreach (System.Reflection.PropertyInfo p in t.GetProperties())
|
||||
{
|
||||
object[] o = p.GetCustomAttributes(typeof(DataEditorSetting), true);
|
||||
|
||||
if (o.Length > 0)
|
||||
{
|
||||
hasSettings = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return hasSettings;
|
||||
}
|
||||
|
||||
private void LoadSetttings(string fileName)
|
||||
{
|
||||
if (System.IO.File.Exists(IOHelper.MapPath("~/" + fileName)))
|
||||
{
|
||||
|
||||
UserControl oControl = (UserControl)this.Page.LoadControl(@"~/" + fileName);
|
||||
|
||||
Type type = oControl.GetType();
|
||||
|
||||
|
||||
Dictionary<string, DataEditorSetting> settings = GetSettings(type);
|
||||
|
||||
foreach (KeyValuePair<string, DataEditorSetting> kv in settings)
|
||||
{
|
||||
DataEditorSettingType dst = kv.Value.GetDataEditorSettingType();
|
||||
dtSettings.Add(kv.Key, dst);
|
||||
|
||||
DataEditorPropertyPanel panel = new DataEditorPropertyPanel();
|
||||
panel.Text = kv.Value.GetName();
|
||||
panel.Text += "<br/><small>" + kv.Value.description + "</small>";
|
||||
|
||||
|
||||
if (HasSettings(type))
|
||||
{
|
||||
DataEditorSettingsStorage ss = new DataEditorSettingsStorage();
|
||||
|
||||
List<Setting<string, string>> s = ss.GetSettings(_datatype.DataTypeDefinitionId);
|
||||
ss.Dispose();
|
||||
|
||||
if (s.Find(set => set.Key == kv.Key).Value != null)
|
||||
dst.Value = s.Find(set => set.Key == kv.Key).Value;
|
||||
|
||||
}
|
||||
|
||||
panel.Controls.Add(dst.RenderControl(kv.Value));
|
||||
|
||||
_phSettings.Controls.Add(panel);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,18 +216,48 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId)};
|
||||
SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid", SqlParams);
|
||||
SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')", SqlParams);
|
||||
|
||||
|
||||
//settings
|
||||
|
||||
DataEditorSettingsStorage ss = new DataEditorSettingsStorage();
|
||||
|
||||
//ss.ClearSettings(_datatype.DataTypeDefinitionId);
|
||||
|
||||
int i = 0;
|
||||
foreach (KeyValuePair<string, DataEditorSettingType> k in dtSettings)
|
||||
{
|
||||
ss.InsertSetting(_datatype.DataTypeDefinitionId, k.Key, k.Value.Value, i);
|
||||
i++;
|
||||
|
||||
}
|
||||
|
||||
ss.Dispose();
|
||||
|
||||
if (dtSettings.Count == 0)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Configuration))
|
||||
LoadSetttings(Configuration);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override void Render(HtmlTextWriter writer)
|
||||
{
|
||||
writer.WriteLine("<table>");
|
||||
writer.WriteLine("<tr><th>Database datatype</th><td>");
|
||||
writer.WriteLine("<div class=\"propertyItem\">");
|
||||
writer.WriteLine("<div class=\"propertyItemheader\">Database datatype</div>");
|
||||
writer.WriteLine("<div class=\"propertyItemContent\">");
|
||||
_dropdownlist.RenderControl(writer);
|
||||
writer.Write("</td></tr>");
|
||||
writer.Write("<tr><th>Usercontrol:</th><td>");
|
||||
writer.Write("</div></div>");
|
||||
|
||||
writer.WriteLine("<div class=\"propertyItem\">");
|
||||
writer.WriteLine("<div class=\"propertyItemheader\">Usercontrol:</div>");
|
||||
writer.WriteLine("<div class=\"propertyItemContent\">");
|
||||
_dropdownlistUserControl.RenderControl(writer);
|
||||
writer.Write("</td></tr>");
|
||||
writer.Write("</table>");
|
||||
writer.Write("</div></div>");
|
||||
|
||||
_phSettings.RenderControl(writer);
|
||||
}
|
||||
|
||||
public string Configuration
|
||||
|
||||
@@ -27,10 +27,14 @@
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
|
||||
@@ -38,30 +38,17 @@ namespace umbraco.macroRenderings
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
if (_value != null)
|
||||
{
|
||||
if (_value == "1")
|
||||
this.Checked = true;
|
||||
else
|
||||
this.Checked = false;
|
||||
}
|
||||
|
||||
this.Text = "Yes";
|
||||
base.OnInit (e);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Render this control to the output parameter specified.
|
||||
/// </summary>
|
||||
/// <param name="output"> The HTML writer to write out to </param>
|
||||
protected override void Render(HtmlTextWriter output)
|
||||
{
|
||||
if (_value != null)
|
||||
{
|
||||
if (_value == "1")
|
||||
{
|
||||
this.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
base.Render(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,14 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>umbraco.uicontrols</RootNamespace>
|
||||
<AssemblyName>controls</AssemblyName>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
|
||||
@@ -12,10 +12,14 @@
|
||||
<AssemblyName>umbraco.webservices</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
|
||||
@@ -1,21 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<dashBoard>
|
||||
<!--
|
||||
<section>
|
||||
<areas>
|
||||
<area>default</area>
|
||||
<area>content</area>
|
||||
</areas>
|
||||
<section alias="StartupSettingsDashboardSection">
|
||||
<areas>
|
||||
<area>settings</area>
|
||||
</areas>
|
||||
<tab caption="Get Started">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/settingsdashboardintro.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/settingsdashboardvideos.ascx
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<tab caption="Last Edits">
|
||||
<control>/usercontrols/dashboard/latestEdits.ascx</control>
|
||||
</tab>
|
||||
<tab caption="Latest Items">
|
||||
<control>/usercontrols/dashboard/newestItems.ascx</control>
|
||||
</tab>
|
||||
<tab caption="Create blog post">
|
||||
<control>/usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx</control>
|
||||
</tab>
|
||||
</section>
|
||||
-->
|
||||
<section alias="StartupDeveloperDashboardSection">
|
||||
<areas>
|
||||
<area>developer</area>
|
||||
</areas>
|
||||
<tab caption="Get Started">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/developerdashboardintro.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/developerdashboardvideos.ascx
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupMediaDashboardSection">
|
||||
<areas>
|
||||
<area>media</area>
|
||||
</areas>
|
||||
<tab caption="Get Started">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/mediadashboardintro.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/zipupload.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/mediadashboardvideos.ascx
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupDashboardSection">
|
||||
<access>
|
||||
<deny>translator</deny>
|
||||
</access>
|
||||
<areas>
|
||||
<area>content</area>
|
||||
</areas>
|
||||
<tab caption="Get Started">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/startupdashboardintro.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/startupdashboardkits.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/startupdashboardvideos.ascx
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Last Edits">
|
||||
<control>/umbraco/dashboard/latestEdits.ascx</control>
|
||||
</tab>
|
||||
<tab caption="Change Password">
|
||||
<control addPanel="true">/umbraco/dashboard/changepassword.ascx</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupMemberDashboardSection">
|
||||
<areas>
|
||||
<area>member</area>
|
||||
</areas>
|
||||
<tab caption="Get Started">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/membersdashboardintro.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/members/membersearch.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/dashboard/membersdashboardvideos.ascx
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
</dashBoard>
|
||||
|
||||
@@ -9,27 +9,28 @@ More information and documentation can be found on CodePlex: http://umbracoexami
|
||||
<Examine>
|
||||
<ExamineIndexProviders>
|
||||
<providers>
|
||||
<add name="InternalIndexer" type="UmbracoExamine.LuceneExamineIndexer, UmbracoExamine"
|
||||
runAsync="true"
|
||||
<add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
|
||||
supportUnpublished="true"
|
||||
supportProtected="true"
|
||||
interval="10"
|
||||
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
|
||||
<add name="InternalMemberIndexer" type="UmbracoExamine.MemberLuceneExamineIndexer, UmbracoExamine"
|
||||
runAsync="true"
|
||||
|
||||
<add name="InternalMemberIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"
|
||||
supportUnpublished="true"
|
||||
supportProtected="true"
|
||||
interval="10"
|
||||
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
|
||||
</providers>
|
||||
</ExamineIndexProviders>
|
||||
|
||||
<ExamineSearchProviders defaultProvider="InternalSearcher">
|
||||
<providers>
|
||||
<add name="InternalSearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
|
||||
<add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
|
||||
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
|
||||
<add name="InternalMemberSearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
|
||||
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true"/>
|
||||
|
||||
<add name="InternalMemberSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
|
||||
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true"/>
|
||||
</providers>
|
||||
</ExamineSearchProviders>
|
||||
|
||||
</Examine>
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<createUI>
|
||||
<nodeType alias="nodeTypes">
|
||||
<header>Nodetype</header>
|
||||
<usercontrol>/create/nodeType.ascx</usercontrol>
|
||||
<tasks>
|
||||
<create assembly="umbraco" type="nodetypeTasks" />
|
||||
<delete assembly="umbraco" type="nodetypeTasks" />
|
||||
</tasks>
|
||||
</nodeType>
|
||||
<nodeType alias="initnodeTypes">
|
||||
<header>Nodetype</header>
|
||||
<usercontrol>/create/nodeType.ascx</usercontrol>
|
||||
<tasks>
|
||||
<create assembly="umbraco" type="nodetypeTasks" />
|
||||
</tasks>
|
||||
</nodeType>
|
||||
<nodeType alias="nodeTypes">
|
||||
<header>Nodetype</header>
|
||||
<usercontrol>/create/simple.ascx</usercontrol>
|
||||
<tasks>
|
||||
<delete assembly="umbraco" type="nodetypeTasks" />
|
||||
</tasks>
|
||||
</nodeType>
|
||||
@@ -50,6 +52,13 @@
|
||||
<delete assembly="umbraco" type="XsltTasks" />
|
||||
</tasks>
|
||||
</nodeType>
|
||||
<nodeType alias="xsltFolder">
|
||||
<header>Xslt</header>
|
||||
<usercontrol>/create/xslt.ascx</usercontrol>
|
||||
<tasks>
|
||||
<delete assembly="umbraco" type="XsltTasks" />
|
||||
</tasks>
|
||||
</nodeType>
|
||||
<nodeType alias="content">
|
||||
<header>Page</header>
|
||||
<usercontrol>/create/content.ascx</usercontrol>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
look at http://www.urlrewriting.net/.
|
||||
|
||||
Remember to read the manual!
|
||||
http://umbraco.org/redir/urlRewritingManual
|
||||
http://our.umbraco.org/wiki/recommendations/recommended-reading-for-web-developers
|
||||
|
||||
The sample below rewrites a url from
|
||||
"/product/someproductid.aspx" to
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RestExtensions>
|
||||
<!--
|
||||
<ext assembly="/bin/umbraco" type="umbraco.presentation.umbracoBase.library.member" alias="currentMember">
|
||||
<ext assembly="umbraco" type="umbraco.presentation.umbracoBase.library.member" alias="currentMember">
|
||||
<permission method="login" allowAll="true" />
|
||||
<permission method="logout" allowAll="true" />
|
||||
<permission method="id" allowAll="true" />
|
||||
|
||||
@@ -73,6 +73,8 @@
|
||||
<requestHandler>
|
||||
<!-- this will ensure that urls are unique when running with multiple root nodes -->
|
||||
<useDomainPrefixes>false</useDomainPrefixes>
|
||||
<!-- this will add a trailing slash (/) to urls when in directory url mode -->
|
||||
<addTrailingSlash>true</addTrailingSlash>
|
||||
<urlReplacing removeDoubleDashes="true">
|
||||
<char org=" ">-</char>
|
||||
<char org="""></char>
|
||||
@@ -111,6 +113,9 @@
|
||||
<disabledLogTypes>
|
||||
<!-- <logTypeAlias>[alias-of-log-type-in-lowercase]</logTypeAlias> -->
|
||||
</disabledLogTypes>
|
||||
<!-- You can add your own logging tool by implementing the umbraco.BusinessLogic.Interfaces.ILog interface and add the reference here -->
|
||||
<!-- The external logger can also act as the audit trail storage by setting the logAuditTrail attribute to true -->
|
||||
<!--<externalLogger assembly="~/bin/assemblyFileName.dll" type="fully.qualified.namespace.and.type" logAuditTrail="false" /> -->
|
||||
</logging>
|
||||
|
||||
<scheduledTasks>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<XsltExtensions>
|
||||
<!--
|
||||
This file is used to register 3rt party xslt extensions (methods you can execute from xslt, like umbraco.library:NiceUrl)
|
||||
<ext assembly="assemblyName" type="assemblyName.namespace.type" alias="custom">
|
||||
-->
|
||||
</XsltExtensions>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<zipUpload>
|
||||
<fileNodeTypeId>1033</fileNodeTypeId>
|
||||
<imageNodeTypeId>1032</imageNodeTypeId>
|
||||
<folderNodeTypeId>1031</folderNodeTypeId>
|
||||
<imageFileExtensions>jpeg,jpg,gif,bmp,png,tiff,tif</imageFileExtensions>
|
||||
</zipUpload>
|
||||
+22
-7
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" ?>
|
||||
<project name="umbraco" default="test" basedir=".">
|
||||
<description>Build the umbraco 3.1.x Application</description>
|
||||
<description>Build the umbraco 4.5 Application</description>
|
||||
|
||||
<!-- global properties, generally won't change -->
|
||||
<!--
|
||||
@@ -12,13 +12,13 @@
|
||||
<!-- filenames and directories, generally won't change -->
|
||||
|
||||
<property name="web.dir" value="D:\inetpub\wwwroot\v4.umbraco.org" />
|
||||
<property name="public.dir" value="D:\inetpub\wwwroot\nightlies\umbraco 4.1" />
|
||||
<property name="public.dir" value="D:\inetpub\wwwroot\nightlies\umbraco 4.6" />
|
||||
<property name="root.dir" value="${directory::get-current-directory()}" />
|
||||
<property name="source.dir" value="${root.dir}\umbraco\presentation" />
|
||||
<property name="build.dir" value="${root.dir}\build" />
|
||||
<property name="dlls.dir" value="${root.dir}\foreign dlls" />
|
||||
|
||||
<property name="build.version" value="4.1"/>
|
||||
<property name="build.version" value="4.6 RC 1"/>
|
||||
|
||||
<property name="docs.dir" value="${root.dir}\docs" />
|
||||
|
||||
@@ -71,7 +71,14 @@
|
||||
<arg value="/p:ToolsVersion=4.0" />
|
||||
</exec>
|
||||
<exec program="${win.dir}\microsoft.net\framework\v4.0.30319\aspnet_compiler.exe" commandline="-f -u -p umbraco/presentation -v / "${build.dir}""/>
|
||||
</target>
|
||||
|
||||
<exec program="${win.dir}\microsoft.net\framework\v4.0.30319\msbuild.exe">
|
||||
<arg value="${root.dir}\umbraco.MacroEngines.Juno\umbraco.MacroEngines.csproj" />
|
||||
<arg value="/v:n" />
|
||||
<arg value="/p:WarningLevel=0" />
|
||||
<arg value="/p:ToolsVersion=4.0" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
||||
<!-- Directories and files -->
|
||||
@@ -85,7 +92,6 @@
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
|
||||
<!-- DLR FILES -->
|
||||
<delete>
|
||||
<fileset>
|
||||
@@ -117,12 +123,20 @@
|
||||
<copy file="${root.dir}\config templates\config\umbracosettings.config" tofile="${build.dir}\config\umbracosettings.config" failonerror="false" overwrite="true"/>
|
||||
<copy file="${root.dir}\config templates\config\urlrewriting.config" tofile="${build.dir}\config\urlrewriting.config" failonerror="false" overwrite="true"/>
|
||||
|
||||
<!-- new 4.1 files -->
|
||||
<!-- new 4.5 files -->
|
||||
<copy file="${root.dir}\config templates\config\ClientDependency.config" tofile="${build.dir}\config\ClientDependency.config" failonerror="false" overwrite="true"/>
|
||||
<copy file="${root.dir}\config templates\config\ExamineSettings.config" tofile="${build.dir}\config\ExamineSettings.config" failonerror="false" overwrite="true"/>
|
||||
<copy file="${root.dir}\config templates\config\ExamineIndex.config" tofile="${build.dir}\config\ExamineIndex.config" failonerror="false" overwrite="true"/>
|
||||
<copy file="${root.dir}\config templates\config\scripting.config" tofile="${build.dir}\config\scripting.config" failonerror="false" overwrite="true"/>
|
||||
|
||||
|
||||
<!-- 4.6 Files -->
|
||||
<copy file="${root.dir}\umbraco.MacroEngines.Juno\bin\Debug\umbraco.MacroEngines.dll" tofile="${build.dir}\bin\umbraco.MacroEngines.dll" failonerror="false" overwrite="true"/>
|
||||
<copy file="${root.dir}\umbraco.MacroEngines.Juno\bin\Debug\umbraco.MacroEngines.pdb" tofile="${build.dir}\bin\umbraco.MacroEngines.pdb" failonerror="false" overwrite="true"/>
|
||||
|
||||
<copy file="${root.dir}\foreign dlls\System.Web.Razor.dll" tofile="${build.dir}\bin\System.Web.Razor.dll" failonerror="false" overwrite="true"/>
|
||||
<copy file="${root.dir}\foreign dlls\RazorEngine.Core.dll" tofile="${build.dir}\bin\RazorEngine.Core.dll" failonerror="false" overwrite="true"/>
|
||||
<copy file="${root.dir}\foreign dlls\RazorEngine.Templates.dll" tofile="${build.dir}\bin\RazorEngine.Templates.dll" failonerror="false" overwrite="true"/>
|
||||
|
||||
<!--standard /data/packages files-->
|
||||
<mkdir dir="${build.dir}\App_Data" />
|
||||
@@ -170,12 +184,13 @@
|
||||
<include name="${build.dir}/**/*.resx" />
|
||||
<include name="${build.dir}/**/*.user" />
|
||||
<include name="${build.dir}/**/*.bak" />
|
||||
|
||||
<include name="${build.dir}/**/*.pdb" />
|
||||
|
||||
<include name="${build.dir}/PrecompiledApp.config" />
|
||||
<include name="${build.dir}/web.config.template" />
|
||||
<include name="${build.dir}/*.xslt" />
|
||||
<include name="${build.dir}/web.STANDARD.config" />
|
||||
<include name="${build.dir}/web.*.config" />
|
||||
<include name="${build.dir}/site.py" />
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user