Compare commits
202 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8fae55e44e | |||
| a8ca3a89bd | |||
| 765f959f20 | |||
| 2cf90477ed | |||
| 6ca6a08233 | |||
| 0119f1eb1b | |||
| cd4f66e7c5 | |||
| 3fdc0e5361 | |||
| 4bfb8569c8 | |||
| df9a887032 | |||
| 1e0a4690fc | |||
| 52163494db | |||
| 8416764a83 | |||
| 2d3eb8c208 | |||
| aa84a3f7f2 | |||
| 3594693f4b | |||
| c573459626 | |||
| b99de245bf | |||
| 222723b8fe | |||
| f758b33da5 | |||
| eeb0e0026a | |||
| 082dacf737 | |||
| afc2fd9420 | |||
| ff6715d42a | |||
| b776675ac8 | |||
| 1e21671b62 | |||
| 59184981cb | |||
| 0632ffb93d | |||
| 034aa6d8f9 | |||
| 1484fba1ad | |||
| 82fc1a5304 | |||
| f0aab6ae81 | |||
| 9ac325c1a4 | |||
| 8c257d39f9 | |||
| 76f040aef4 | |||
| 721f813d1e | |||
| 7ed5a6f706 | |||
| 35a698cdc9 | |||
| 6c9e82e735 | |||
| f7ddb1ed49 | |||
| c0fd974cc1 | |||
| e9c4a031c9 | |||
| 123e65c55f | |||
| e5e4e7b685 | |||
| 88795b86fd | |||
| 378a544c1a | |||
| a159b50c05 | |||
| 3891e46549 | |||
| e7bcc642a9 | |||
| 4983990d39 | |||
| e9a496df4f | |||
| 2f6dada481 | |||
| 580123cb87 | |||
| de0e47d7ef | |||
| ff5dc324fe | |||
| 096c5ad69f | |||
| eba7582a97 | |||
| 0cf2a1fc2a | |||
| 77ee87178e | |||
| a6997a5cb7 | |||
| ff3fc5d825 | |||
| 3b9bf7b0f9 | |||
| 3882e1984d | |||
| b32ea68fd0 | |||
| eb2db791b8 | |||
| 158f4d0614 | |||
| 7a38970cf4 | |||
| 7f6d8b6bdd | |||
| 22fb7e1706 | |||
| 12b1168de9 | |||
| 01290f8174 | |||
| 26a7bf8187 | |||
| ba1d0fa193 | |||
| 97355bde6f | |||
| ed35f234de | |||
| c874fa6507 | |||
| ba387598ed | |||
| 3ff1b01e46 | |||
| 36e803713c | |||
| a3e7f644de | |||
| 1586f1679a | |||
| 809badd1cf | |||
| da92ece774 | |||
| a531afb819 | |||
| 1d6009e3c7 | |||
| 8dfeb1e616 | |||
| 1b086e2267 | |||
| 1f86d8c562 | |||
| 25b9262cf1 | |||
| 1012a4814d | |||
| bae41cde14 | |||
| b3260f05c0 | |||
| e33a79ac65 | |||
| c4dbabf654 | |||
| 423643d66c | |||
| 4ccb655f73 | |||
| c8330d60f9 | |||
| a9aa3a04b5 | |||
| 0bffa8e3f4 | |||
| 436322f58c | |||
| e90c46dd78 | |||
| deda2534f8 | |||
| 8112c13857 | |||
| 57792de185 | |||
| e1f93029a5 | |||
| f64e0c7eb7 | |||
| bf024e9011 | |||
| 036b888d30 | |||
| 1838a8dac5 | |||
| 205bf5fe4e | |||
| a50e192ab7 | |||
| 9684255e6e | |||
| 72790d74f5 | |||
| bb70bee6ae | |||
| 0430e7966c | |||
| 2e9a52b1f8 | |||
| db4ed70d70 | |||
| e6ccd8a5b5 | |||
| a9781d79e2 | |||
| 7ae8b28466 | |||
| 29a4cb8b71 | |||
| ffb39de003 | |||
| 527375b238 | |||
| a4ed0e266c | |||
| 1929f60ea8 | |||
| b9cc2efc8c | |||
| eadb1bb194 | |||
| 30be665a40 | |||
| bad284515c | |||
| 5b660d95f1 | |||
| 106ac44e64 | |||
| 64bb7e1db0 | |||
| 25b9ca3b0e | |||
| b928170103 | |||
| e25ee246fb | |||
| 8e8ec41dae | |||
| fb34c4716a | |||
| 29bf61b1f2 | |||
| 9803309e34 | |||
| 3a539629dc | |||
| 74b970d586 | |||
| 518898b04b | |||
| a773e0a018 | |||
| 99fe89addc | |||
| 668d4f9f91 | |||
| 90e73cb89f | |||
| dcd6477030 | |||
| 13b73231de | |||
| 50a70c28df | |||
| 7d5589118f | |||
| c39b698d4c | |||
| 103efbdc27 | |||
| 3d51dd767b | |||
| e22988e435 | |||
| 9736aaafaa | |||
| bf3fa20a53 | |||
| f936f8b0dd | |||
| 1bd20c9b06 | |||
| 099b713947 | |||
| 165d9c7dff | |||
| 09400be6e0 | |||
| 7934ba7ec4 | |||
| 7edbc34e6c | |||
| 60b6608289 | |||
| 792599a42f | |||
| 7610ee5f8b | |||
| eab9be4ef7 | |||
| e48a030aab | |||
| e207b1f1e1 | |||
| fd3540f92d | |||
| b9d7f0c5a5 | |||
| 3d76614a78 | |||
| de0e6f3179 | |||
| 39edb9b7e2 | |||
| a638488eb7 | |||
| a2a539f7db | |||
| 6768bb4793 | |||
| 19c2841576 | |||
| 71aa248a4e | |||
| eeaef5ac5c | |||
| bea50f4562 | |||
| ff337457f8 | |||
| 49b5ddf850 | |||
| b449b8762b | |||
| 13e555f50b | |||
| 48c809a797 | |||
| 55c7f72d8e | |||
| 8612113fc0 | |||
| 69b0c7cf09 | |||
| 37a97a2e7c | |||
| 5f4eaef4a2 | |||
| 44f5c3a34f | |||
| a33ae696a2 | |||
| 2705efb809 | |||
| 648d631151 | |||
| 27c0c4d64e | |||
| 52cf559536 | |||
| c9b0362c62 | |||
| 11e5bdf556 | |||
| 3d0be3836c | |||
| 2bc33e0115 | |||
| 8576d9c67e |
@@ -26,4 +26,6 @@ ff3bb24ea0c915878396a6ae27f1ff164e8ac150 Release-6.0.0-beta
|
||||
56015ac26f5ab60e3c61b1d09075297b660afa07 Release-6.0.0-RC
|
||||
1719fbd857f28b376639ac2aa0abada0ef2e7560 Release-6.0.0
|
||||
e02f5aebb87e3f07d27376647756caa9762931d8 Release-4.11.4
|
||||
14338b0ab1738fbd8987677ecdb9a73d79fc229d release-4.11.6
|
||||
b247b35d821144849f551e02da8ba719f91d5fb0 Release-6.0.2
|
||||
aed55cba29009ad3db48880a7cfb66407ce9805f release-6.0.3
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
@ECHO OFF
|
||||
SET release=6.0.3
|
||||
SET release=6.0.4
|
||||
SET comment=
|
||||
SET version=%release%
|
||||
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
@ECHO OFF
|
||||
|
||||
:choice
|
||||
set /P c=WARNING! Are you sure you want to continue, this will remove all package files, view files, sqlce database, etc... Press 'Y' to auto-remove all files/folders, 'N' to cancel or 'C' to prompt for each folder removal?
|
||||
if /I "%c%" EQU "C" goto :prompt
|
||||
if /I "%c%" EQU "Y" goto :auto
|
||||
if /I "%c%" EQU "N" goto :exit
|
||||
goto :choice
|
||||
|
||||
|
||||
:prompt
|
||||
|
||||
echo Current folder: %CD%
|
||||
|
||||
echo Regenerating SQL CE database
|
||||
SET buildfolder=%CD%
|
||||
CD ..\tools\RegenerateUmbracoSQLCEDatabase\
|
||||
RegenerateUmbracoSQLCEDatabase.exe %CD%\..\..\src\Umbraco.Web.UI
|
||||
CD %buildfolder%
|
||||
|
||||
echo Removing bin files
|
||||
del ..\src\Umbraco.Web.UI\bin\*.*
|
||||
|
||||
echo Building solution
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ..\src\umbraco.sln /t:Clean,Build
|
||||
|
||||
echo Resetting installedPackages.config
|
||||
echo ^<?xml version="1.0" encoding="utf-8"?^>^<packages^>^</packages^> >..\src\Umbraco.Web.UI\App_Data\packages\installed\installedPackages.config
|
||||
|
||||
echo Removing plugin cache files
|
||||
del ..\src\Umbraco.Web.UI\App_Data\TEMP\PluginCache\*.*
|
||||
|
||||
echo Removing cache files and examine index
|
||||
del ..\src\Umbraco.Web.UI\App_Data\TEMP\*.*
|
||||
|
||||
echo Removing log files
|
||||
del ..\src\Umbraco.Web.UI\App_Data\Logs\*.*
|
||||
|
||||
echo Removing packages
|
||||
del ..\src\Umbraco.Web.UI\App_Data\packages\*.*
|
||||
|
||||
echo Removing previews
|
||||
del ..\src\Umbraco.Web.UI\App_Data\preview\*.*
|
||||
|
||||
echo Removing app code files (typically added by starterkits)
|
||||
del ..\src\Umbraco.Web.UI\App_Code\*.*
|
||||
|
||||
echo Removing xslt files
|
||||
del ..\src\Umbraco.Web.UI\xslt\*.*
|
||||
|
||||
echo Removing user control files
|
||||
del ..\src\Umbraco.Web.UI\UserControls\*.*
|
||||
|
||||
echo Removing masterpage files
|
||||
del ..\src\Umbraco.Web.UI\masterpages\*.*
|
||||
|
||||
echo Removing view files
|
||||
del ..\src\Umbraco.Web.UI\Views\*.*
|
||||
|
||||
echo Removing razor files
|
||||
del ..\src\Umbraco.Web.UI\macroScripts\*.*
|
||||
|
||||
echo Removing media files
|
||||
del ..\src\Umbraco.Web.UI\media\*.*
|
||||
|
||||
echo Removing script files
|
||||
del ..\src\Umbraco.Web.UI\scripts\*.*
|
||||
|
||||
echo Removing css files
|
||||
del ..\src\Umbraco.Web.UI\css\*.*
|
||||
|
||||
echo "Umbraco install reverted to clean install"
|
||||
pause
|
||||
exit
|
||||
|
||||
|
||||
|
||||
:auto
|
||||
|
||||
echo Current folder: %CD%
|
||||
|
||||
echo Regenerating SQL CE database
|
||||
SET buildfolder=%CD%
|
||||
CD ..\tools\RegenerateUmbracoSQLCEDatabase\
|
||||
RegenerateUmbracoSQLCEDatabase.exe %CD%\..\..\src\Umbraco.Web.UI
|
||||
CD %buildfolder%
|
||||
|
||||
echo Removing bin files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\bin\*.*) DO DEL %%A
|
||||
|
||||
echo Building solution
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ..\src\umbraco.sln /t:Clean,Build
|
||||
|
||||
echo Resetting installedPackages.config
|
||||
echo ^<?xml version="1.0" encoding="utf-8"?^>^<packages^>^</packages^> >..\src\Umbraco.Web.UI\App_Data\packages\installed\installedPackages.config
|
||||
|
||||
echo Removing plugin cache files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\TEMP\PluginCache\*.*) DO DEL %%A
|
||||
|
||||
echo Removing cache files and examine index
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\TEMP\*.*) DO DEL %%A
|
||||
|
||||
echo Removing log files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\Logs\*.*) DO DEL %%A
|
||||
|
||||
echo Removing packages
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\packages\*.*) DO DEL %%A
|
||||
|
||||
echo Removing previews
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\preview\*.*) DO DEL %%A
|
||||
|
||||
echo Removing app code files (typically added by starterkits)
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Code\*.*) DO DEL %%A
|
||||
|
||||
echo Removing xslt files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\xslt\*.*) DO DEL %%A
|
||||
|
||||
echo Removing masterpage files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\masterpages\*.*) DO DEL %%A
|
||||
|
||||
echo Removing user control files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\usercontrols\*.*) DO DEL %%A
|
||||
|
||||
echo Removing view files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\Views\*.*) DO DEL %%A
|
||||
|
||||
echo Removing razor files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\macroScripts\*.*) DO DEL %%A
|
||||
|
||||
echo Removing media files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\media\*.*) DO DEL %%A
|
||||
|
||||
echo Removing script files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\scripts\*.*) DO DEL %%A
|
||||
|
||||
echo Removing css files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\css\*.*) DO DEL %%A
|
||||
|
||||
echo Removing Courier files
|
||||
del ..\src\Umbraco.Web.UI\config\courier.config
|
||||
del ..\src\Umbraco.Web.UI\umbraco\images\tray\courier.jpg
|
||||
rmdir "..\src\Umbraco.Web.UI\umbraco\plugins\courier\" /S /Q
|
||||
|
||||
echo Removing Contour files
|
||||
del ..\src\Umbraco.Web.UI\umbraco\images\tray\contour.png
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\umbraco\images\umbraco\icon_*.*) DO DEL %%A
|
||||
rmdir "..\src\Umbraco.Web.UI\umbraco\plugins\umbracoContour\" /S /Q
|
||||
del ..\src\Umbraco.Web.UI\umbraco\xslt\templates\UmbracoContour*.* /S /Q
|
||||
rmdir "..\src\Umbraco.Web.UI\usercontrols\umbracoContour\" /S /Q
|
||||
|
||||
echo Start with a clean web.config
|
||||
copy ..\src\Umbraco.Web.UI\web.Template.config ..\src\Umbraco.Web.UI\web.config /Y
|
||||
|
||||
echo "Umbraco install reverted to clean install"
|
||||
pause
|
||||
exit
|
||||
|
||||
|
||||
|
||||
:exit
|
||||
exit
|
||||
Binary file not shown.
@@ -1,24 +0,0 @@
|
||||
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
|
||||
@@ -1,82 +0,0 @@
|
||||
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
|
||||
{\f39\froman\fcharset238\fprq2 Times New Roman CE;}{\f40\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f42\froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\f44\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f46\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\f399\fswiss\fcharset238\fprq2 Tahoma CE;}{\f400\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f402\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f403\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f404\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
|
||||
{\f405\fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f406\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f407\fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f408\fswiss\fcharset222\fprq2 Tahoma (Thai);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
|
||||
\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
|
||||
\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive
|
||||
\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
|
||||
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
|
||||
\f36\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 \ssemihidden \styrsid668380 Balloon Text;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid130696116{\listlevel\levelnfc0\levelnfcn0\leveljc0
|
||||
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
|
||||
{\leveltext\'02\'01.;}{\levelnumbers\'01;}\fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\fi-360\li2160
|
||||
\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
|
||||
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
|
||||
{\leveltext\'02\'05.;}{\levelnumbers\'01;}\fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\fi-360\li5040
|
||||
\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
|
||||
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid723138990}}{\*\listoverridetable{\listoverride\listid723138990\listoverridecount0\ls1}}
|
||||
{\*\pgptbl {\pgp\ipgp2\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp4\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid288726\rsid668380\rsid1077358\rsid1250157\rsid1778664
|
||||
\rsid2232581\rsid3018318\rsid3766585\rsid4417501\rsid4531485\rsid4807452\rsid5341002\rsid7018004\rsid7880391\rsid10749719\rsid12150908\rsid12939982\rsid13596669\rsid15149892\rsid15551579\rsid16128754\rsid16674677}{\*\generator Microsoft Word 11.0.6359;}
|
||||
{\info{\title Shared Source License for Software included in Workspaces}{\author suev}{\operator Martin Maly}{\creatim\yr2005\mo3\dy22\hr10\min45}{\revtim\yr2005\mo3\dy22\hr15\min54}{\printim\yr2002\mo9\dy20\hr15\min39}{\version3}{\edmins1}{\nofpages1}
|
||||
{\nofwords672}{\nofchars3837}{\*\company Microsoft}{\nofcharsws4501}{\vern24703}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984
|
||||
\dghshow1\dgvshow1\jexpand\viewkind5\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
|
||||
\asianbrkrule\nojkernpunct\rsidroot15149892 \fet0\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
|
||||
\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
|
||||
{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
|
||||
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\fs28\insrsid1250157\charrsid1250157 Shared Source License for }{\b\fs28\insrsid16674677 IronPython}{
|
||||
\b\fs28\insrsid1250157
|
||||
\par }{\b\fs28\insrsid5341002
|
||||
\par }{\b\insrsid5341002\charrsid5341002 This license governs use of the accompanying software}{\b\insrsid5341002 (\'93Software\'94)}{\b\insrsid5341002\charrsid5341002 , and your use of the }{\b\insrsid5341002 S}{\b\insrsid5341002\charrsid5341002
|
||||
oftware constitutes acceptance of this license.
|
||||
\par }{\insrsid1250157\charrsid5341002
|
||||
\par }{\b\insrsid1250157\charrsid1250157 You }{\b\insrsid5341002 may}{\b\insrsid1250157\charrsid1250157 use }{\b\insrsid5341002 the}{\b\insrsid1250157\charrsid1250157 Software for any }{\b\insrsid1250157 commercial or }{\b\insrsid1250157\charrsid1250157
|
||||
noncommercial purpose, including distributing derivative}{\b\insrsid4417501 work}{\b\insrsid1250157\charrsid1250157 s}{\b\insrsid1250157 .
|
||||
\par }{\insrsid1250157
|
||||
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1250157 {\insrsid1250157\charrsid1250157 In return, we simply require that you agree:
|
||||
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0\pararsid1250157 {\insrsid1250157\charrsid1250157
|
||||
Not to remove any copyright}{\insrsid5341002 or other}{\insrsid1250157\charrsid1250157 notices from the Software.
|
||||
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 2.\tab}That if you distribute the Software in source code form you do so only under this }{\insrsid5341002 l}{\insrsid1250157\charrsid1250157
|
||||
icense (i.e. you must include a complete copy of this }{\insrsid5341002 l}{\insrsid1250157\charrsid1250157 icense with your distribution), and if you distribute the Software solely in object form you only do so under a license that complies with this }{
|
||||
\insrsid5341002 l}{\insrsid1250157\charrsid1250157 icense.
|
||||
\par {\listtext\pard\plain\b\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 3.\tab}}{\b\insrsid1250157\charrsid1250157
|
||||
That the Software comes "as is", with no warranties. None whatsoever. This means no express, implied or statutory warranty, including without limitation, warranties of merchantability or fitness for a particular purpose or any warranty of }{
|
||||
\b\insrsid5341002 title or }{\b\insrsid1250157\charrsid1250157 non}{\b\insrsid5341002 -}{\b\insrsid1250157\charrsid1250157 infringement. Also, you must pass this disclaimer on whenever you distribute the Software}{\b\insrsid5341002 or derivative works}{
|
||||
\b\insrsid1250157\charrsid1250157 .}{\insrsid1250157\charrsid1250157
|
||||
\par {\listtext\pard\plain\b\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 4.\tab}}{\b\insrsid1250157\charrsid1250157 That neither Microsoft nor }{\b\insrsid1250157 any contributor to the Software}{\b\insrsid1250157\charrsid1250157
|
||||
will be liable for any of those types of damages known as}{\b\insrsid5341002 }{\b\insrsid1250157\charrsid1250157 indirect, special, consequential, or incidental related to the Software or this }{\b\insrsid5341002 l}{\b\insrsid1250157\charrsid1250157
|
||||
icense, to the maximum extent the law permits, no matter what legal theory it\rquote s based on. Also, you must pass this limitation of liability on whenever you distribute the Software}{\b\insrsid5341002 or derivative works}{
|
||||
\b\insrsid1250157\charrsid1250157 .}{\insrsid1250157\charrsid1250157
|
||||
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 5.\tab}That if you sue anyone over patents that you think may apply to the Software for a person's use of the Software, your license to the Software ends automatically.
|
||||
|
||||
\par {\listtext\pard\plain\insrsid1250157 \hich\af0\dbch\af0\loch\f0 6.\tab}}{\insrsid1250157 That the patent rights, if any, }{\insrsid288726 granted in this license}{\insrsid1250157\charrsid1250157 only apply to the Software, not to any derivative}{
|
||||
\insrsid4417501 work}{\insrsid1250157\charrsid1250157 s you make.}{\insrsid3018318
|
||||
\par {\listtext\pard\plain\insrsid3018318\charrsid3018318 \hich\af0\dbch\af0\loch\f0 7.\tab}}{\insrsid3018318\charrsid3018318 That if you are an agency of the U.S. Government, (i) Software provided pursuant to a solicitation issued on or after Dece
|
||||
mber 1, 1995, is provided with the commercial license rights set forth in this license, and (ii) Software provided pursuant to a solicitation issued prior to December 1, 1995, is provided with \'93Restricted Rights\'94
|
||||
as set forth in FAR, 48 C.F.R. 52.227-14 (June 1987) or DFAR, 48 C.F.R. 252.227-7013 (Oct 1988), as applicable.}{\insrsid1250157
|
||||
\par {\listtext\pard\plain\insrsid1250157 \hich\af0\dbch\af0\loch\f0 8.\tab}That your rights under this License end automatically if you breach it in any way.
|
||||
\par {\listtext\pard\plain\insrsid5341002 \hich\af0\dbch\af0\loch\f0 9.\tab}}{\insrsid5341002 That all rights not expressly granted to you in this license are reserved.
|
||||
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1778664 {\insrsid1778664
|
||||
\par }{\insrsid12150908 Read below}{\insrsid1778664 for answers to frequently asked questions about this license.
|
||||
\par }{\insrsid12150908
|
||||
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12150908 {\b\insrsid12150908\charrsid12150908 Q: Is this license OSI compliant?
|
||||
\par }{\insrsid12150908
|
||||
A: This license has not been submitted to OSI, but it allows developers to take full advantage of a dynamic language on the CLR and to have the freedom to distribute their works for the benefit of the community at large. The license is half of a
|
||||
page long and very straight forward. We believe it stands up to what developers demand of an "open" license.
|
||||
\par
|
||||
\par }{\b\insrsid12150908\charrsid12150908 Q: What copyright rights does the license grant me?
|
||||
\par }{\insrsid12150908 A: The license grants you a copyright license to make unlimited copies of the Software in sour
|
||||
ce or object code form, as well as to create Derivative Works (as that term is defined under US copyright law). This means that in addition to making unlimited copies of the Software, you have a copyright license to modify the Software and to use all or p
|
||||
art of the Software to create a Derivative Work.
|
||||
\par
|
||||
\par }{\b\insrsid12150908\charrsid12150908 Q: What patent rights does the license grant me?
|
||||
\par }{\insrsid12150908 A: This license grants you a patent license to use and distribute the Software under any Microsoft patent claims that read on the Software itself. In other wo
|
||||
rds, if you create a modified version of the Software, you still retain the patent license to use and distribute the original portions of the Software under the specific Microsoft patent claims that read on the Software, but you do not have a patent licen
|
||||
s
|
||||
e as to the new functionality you may have added by modifying the Software. This result is typical of many common open source licenses, including the Common Public License (CPL) and the Mozilla Public License (MPL). In addition, this license grants no rig
|
||||
h
|
||||
ts to any Microsoft patents that read on other components or files not included in the Software. This means that no patent license is granted to use or distribute any other software or technology that may be needed to use the Software or was created from
|
||||
t
|
||||
he Software (for example, any compiled output of the Software, the combination of the Software with other hardware or other software, or any additional enabling technologies that may be necessary to make or use the Software or any final product that inclu
|
||||
des the Software).}{\insrsid12150908
|
||||
\par }{\insrsid12150908\charrsid1250157
|
||||
\par }}
|
||||
+30
-6
@@ -1,9 +1,33 @@
|
||||
!! Umbraco - the simple, flexible and friendly ASP.NET CMS
|
||||
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].
|
||||
More info at http://umbraco.com
|
||||
|
||||
!! 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].
|
||||
Exploring the repository
|
||||
========================
|
||||
Most contributors will work on their own fork and should pick the branch in which they need their fix. For more information see:
|
||||
http://our.umbraco.org/contribute/guidelines-for-core-contribution
|
||||
|
||||
Exploring the source
|
||||
====================
|
||||
The Umbraco source code is never required for you to start building sites. If you are not using the source code for debugging purposes or to contribute to the source then please download the binaries listed at http://umbraco.codeplex.com
|
||||
|
||||
With that said, the Umbraco solution can be opened in Visual Studio 2010 with SP1 installed or Visual Studio 2012.
|
||||
|
||||
Contributing
|
||||
============
|
||||
Umbraco is Open Source which means you can contribute to make it great!
|
||||
Read all about it at http://our.umbraco.org/contribute
|
||||
|
||||
Forums
|
||||
======
|
||||
We have a forum running on http://our.umbraco.org for friendly community support.
|
||||
|
||||
Documentation
|
||||
=============
|
||||
Our documentation section provides help on installing and using Umbraco including API reference documentation: http://our.umbraco.org/documentation
|
||||
|
||||
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 online guide at http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature
|
||||
@@ -100,6 +100,18 @@ namespace Umbraco.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The original/first url that the web application executes
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// we need to set the initial url in our ApplicationContext, this is so our keep alive service works and this must
|
||||
/// exist on a global context because the keep alive service doesn't run in a web context.
|
||||
/// we are NOT going to put a lock on this because locking will slow down the application and we don't really care
|
||||
/// if two threads write to this at the exact same time during first page hit.
|
||||
/// see: http://issues.umbraco.org/issue/U4-2059
|
||||
/// </remarks>
|
||||
internal string OriginalRequestUrl { get; set; }
|
||||
|
||||
private bool Configured
|
||||
{
|
||||
get
|
||||
@@ -140,7 +152,6 @@ namespace Umbraco.Core
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void AssertIsReady()
|
||||
{
|
||||
if (!this.IsReady)
|
||||
|
||||
@@ -671,6 +671,18 @@ namespace Umbraco.Core.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// File types that will not be allowed to be uploaded via the content/media upload control
|
||||
/// </summary>
|
||||
public static IEnumerable<string> DisallowedUploadFiles
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = GetKey("/settings/content/disallowedUploadFiles");
|
||||
return val.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the allowed image file types.
|
||||
/// </summary>
|
||||
@@ -1250,6 +1262,41 @@ namespace Umbraco.Core.Configuration
|
||||
return _macroErrorBehaviour.Value;
|
||||
}
|
||||
}
|
||||
|
||||
private static IconPickerBehaviour? _iconPickerBehaviour;
|
||||
|
||||
/// <summary>
|
||||
/// This configuration setting defines how to show icons in the document type editor.
|
||||
/// - ShowDuplicates - Show duplicates in files and sprites. (default and current Umbraco 'normal' behaviour)
|
||||
/// - HideSpriteDuplicates - Show files on disk and hide duplicates from the sprite
|
||||
/// - HideFileDuplicates - Show files in the sprite and hide duplicates on disk
|
||||
/// </summary>
|
||||
/// <value>MacroErrorBehaviour enum defining how to show icons in the document type editor.</value>
|
||||
public static IconPickerBehaviour IconPickerBehaviour
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_iconPickerBehaviour == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var behaviour = IconPickerBehaviour.ShowDuplicates;
|
||||
var value = GetKey("/settings/content/DocumentTypeIconList");
|
||||
if (value != null)
|
||||
{
|
||||
Enum<IconPickerBehaviour>.TryParse(value, true, out behaviour);
|
||||
}
|
||||
_iconPickerBehaviour = behaviour;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<UmbracoSettings>("Could not load /settings/content/DocumentTypeIconList from umbracosettings.config", ex);
|
||||
_iconPickerBehaviour = IconPickerBehaviour.ShowDuplicates;
|
||||
}
|
||||
}
|
||||
return _iconPickerBehaviour.Value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configuration regarding webservices
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
public class UmbracoVersion
|
||||
{
|
||||
private static readonly Version Version = new Version("6.0.3");
|
||||
private static readonly Version Version = new Version("6.0.4");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version of Umbraco.
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public enum IconPickerBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Default umbraco behavior - show duplicates in files and sprites
|
||||
/// </summary>
|
||||
ShowDuplicates,
|
||||
|
||||
/// <summary>
|
||||
/// If a file exists on disk with the same name as one in the sprite
|
||||
/// then the file on disk overrules the one in the sprite, the
|
||||
/// sprite icon will not be shown
|
||||
/// </summary>
|
||||
HideSpriteDuplicates,
|
||||
|
||||
/// <summary>
|
||||
/// If a file exists on disk with the same name as one in the sprite
|
||||
/// then the file in the sprite overrules the one on disk, the file
|
||||
/// on disk will be shown
|
||||
/// </summary>
|
||||
HideFileDuplicates
|
||||
}
|
||||
}
|
||||
@@ -168,19 +168,6 @@ namespace Umbraco.Core.Models.EntityBase
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator ==(Entity left, Entity right)
|
||||
{
|
||||
if (ReferenceEquals(null, left))
|
||||
return false;
|
||||
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(Entity left, Entity right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
public virtual bool SameIdentityAs(IEntity other)
|
||||
{
|
||||
if (ReferenceEquals(null, other))
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace Umbraco.Core.Models
|
||||
[DataContract(IsReference = true)]
|
||||
public class PropertyType : Entity, IEquatable<PropertyType>
|
||||
{
|
||||
//private SerializationService _service;
|
||||
private string _name;
|
||||
private string _alias;
|
||||
private string _description;
|
||||
@@ -33,22 +32,12 @@ namespace Umbraco.Core.Models
|
||||
|
||||
DataTypeId = dataTypeDefinition.ControlId;
|
||||
DataTypeDatabaseType = dataTypeDefinition.DatabaseType;
|
||||
|
||||
EnsureSerializationService();
|
||||
}
|
||||
|
||||
internal PropertyType(Guid dataTypeControlId, DataTypeDatabaseType dataTypeDatabaseType)
|
||||
{
|
||||
DataTypeId = dataTypeControlId;
|
||||
DataTypeDatabaseType = dataTypeDatabaseType;
|
||||
|
||||
EnsureSerializationService();
|
||||
}
|
||||
|
||||
private void EnsureSerializationService()
|
||||
{
|
||||
/*var serviceStackSerializer = new ServiceStackXmlSerializer();
|
||||
_service = new SerializationService(serviceStackSerializer);*/
|
||||
}
|
||||
|
||||
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Name);
|
||||
@@ -181,6 +170,7 @@ namespace Umbraco.Core.Models
|
||||
/// Gets of Sets the Help text for the current PropertyType
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
[Obsolete("Not used anywhere in the UI")]
|
||||
public string HelpText
|
||||
{
|
||||
get { return _helpText; }
|
||||
@@ -209,7 +199,7 @@ namespace Umbraco.Core.Models
|
||||
/// Gets or Sets the RegEx for validation of legacy DataTypes
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
internal string ValidationRegExp
|
||||
public string ValidationRegExp
|
||||
{
|
||||
get { return _validationRegExp; }
|
||||
set
|
||||
@@ -218,7 +208,6 @@ namespace Umbraco.Core.Models
|
||||
OnPropertyChanged(ValidationRegExpSelector);
|
||||
}
|
||||
}
|
||||
//Note that Validation should eventually come from PropertyEditors like in v5
|
||||
|
||||
/// <summary>
|
||||
/// Create a new Property object from a "raw" database value.
|
||||
|
||||
@@ -28,12 +28,8 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
base.Path = path;
|
||||
ParentId = -1;
|
||||
Key = name.EncodeAsGuid();
|
||||
_name = name.Replace("/", ".").Replace("\\", "");
|
||||
_alias = alias.ToSafeAlias();
|
||||
|
||||
CreateDate = DateTime.Now;
|
||||
UpdateDate = DateTime.Now;
|
||||
}
|
||||
|
||||
[DataMember]
|
||||
@@ -116,5 +112,17 @@ namespace Umbraco.Core.Models
|
||||
|
||||
return validFile && validExtension;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to call when Entity is being saved
|
||||
/// </summary>
|
||||
/// <remarks>Created date is set and a Unique key is assigned</remarks>
|
||||
internal override void AddingEntity()
|
||||
{
|
||||
base.AddingEntity();
|
||||
|
||||
if (Key == Guid.Empty)
|
||||
Key = Guid.NewGuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
UpdateDate = dto.ContentVersionDto.VersionDate,
|
||||
ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?)null,
|
||||
ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?)null,
|
||||
Version = dto.ContentVersionDto.VersionId
|
||||
Version = dto.ContentVersionDto.VersionId,
|
||||
PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
private readonly IContentTypeComposition _contentType;
|
||||
private readonly Guid _version;
|
||||
private readonly int _id;
|
||||
private readonly DateTime _createDate;
|
||||
private readonly DateTime _updateDate;
|
||||
|
||||
public PropertyFactory(IContentTypeComposition contentType, Guid version, int id)
|
||||
{
|
||||
@@ -19,6 +21,15 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
_id = id;
|
||||
}
|
||||
|
||||
public PropertyFactory(IContentTypeComposition contentType, Guid version, int id, DateTime createDate, DateTime updateDate)
|
||||
{
|
||||
_contentType = contentType;
|
||||
_version = version;
|
||||
_id = id;
|
||||
_createDate = createDate;
|
||||
_updateDate = updateDate;
|
||||
}
|
||||
|
||||
#region Implementation of IEntityFactory<IContent,PropertyDataDto>
|
||||
|
||||
public IEnumerable<Property> BuildEntity(IEnumerable<PropertyDataDto> dtos)
|
||||
@@ -34,6 +45,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
propertyDataDto.VersionId.Value,
|
||||
propertyDataDto.Id);
|
||||
|
||||
property.CreateDate = _createDate;
|
||||
property.UpdateDate = _updateDate;
|
||||
property.ResetDirtyProperties();
|
||||
properties.Add(property);
|
||||
}
|
||||
|
||||
@@ -9,12 +9,21 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
internal class PropertyGroupFactory : IEntityFactory<IEnumerable<PropertyGroup>, IEnumerable<PropertyTypeGroupDto>>
|
||||
{
|
||||
private readonly int _id;
|
||||
private readonly DateTime _createDate;
|
||||
private readonly DateTime _updateDate;
|
||||
|
||||
public PropertyGroupFactory(int id)
|
||||
{
|
||||
_id = id;
|
||||
}
|
||||
|
||||
public PropertyGroupFactory(int id, DateTime createDate, DateTime updateDate)
|
||||
{
|
||||
_id = id;
|
||||
_createDate = createDate;
|
||||
_updateDate = updateDate;
|
||||
}
|
||||
|
||||
#region Implementation of IEntityFactory<IEnumerable<PropertyGroup>,IEnumerable<TabDto>>
|
||||
|
||||
public IEnumerable<PropertyGroup> BuildEntity(IEnumerable<PropertyTypeGroupDto> dto)
|
||||
@@ -58,7 +67,9 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
Mandatory = typeDto.Mandatory,
|
||||
SortOrder = typeDto.SortOrder,
|
||||
ValidationRegExp = typeDto.ValidationRegExp,
|
||||
PropertyGroupId = new Lazy<int>(() => tempGroupDto.Id)
|
||||
PropertyGroupId = new Lazy<int>(() => tempGroupDto.Id),
|
||||
CreateDate = _createDate,
|
||||
UpdateDate = _updateDate
|
||||
};
|
||||
|
||||
propertyType.ResetDirtyProperties();
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
@@ -54,15 +55,39 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
{34, typeof (TaskTypeDto)},
|
||||
{35, typeof (TaskDto)},
|
||||
{36, typeof (ContentType2ContentTypeDto)},
|
||||
{
|
||||
37,
|
||||
typeof (ContentTypeAllowedContentTypeDto)
|
||||
},
|
||||
{37, typeof (ContentTypeAllowedContentTypeDto)},
|
||||
{38, typeof (User2AppDto)},
|
||||
{39, typeof (User2NodeNotifyDto)},
|
||||
{40, typeof (User2NodePermissionDto)}
|
||||
};
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// Drops all Umbraco tables in the db
|
||||
/// </summary>
|
||||
internal void UninstallDatabaseSchema()
|
||||
{
|
||||
LogHelper.Info<DatabaseSchemaCreation>("Start UninstallDatabaseSchema");
|
||||
|
||||
foreach (var item in OrderedTables.OrderByDescending(x => x.Key))
|
||||
{
|
||||
var tableNameAttribute = item.Value.FirstAttribute<TableNameAttribute>();
|
||||
|
||||
string tableName = tableNameAttribute == null ? item.Value.Name : tableNameAttribute.Value;
|
||||
|
||||
LogHelper.Info<DatabaseSchemaCreation>("Uninstall" + tableName);
|
||||
|
||||
try
|
||||
{
|
||||
_database.DropTable(tableName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//swallow this for now, not sure how best to handle this with diff databases... though this is internal
|
||||
// and only used for unit tests. If this fails its because the table doesn't exist... generally!
|
||||
LogHelper.Error<DatabaseSchemaCreation>("Could not drop table " + tableName, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DatabaseSchemaCreation(Database database)
|
||||
{
|
||||
|
||||
@@ -401,6 +401,24 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
|
||||
#region Implementation of IContentRepository
|
||||
|
||||
public IEnumerable<IContent> GetByPublishedVersion(IQuery<IContent> query)
|
||||
{
|
||||
var sqlClause = GetBaseQuery(false);
|
||||
var translator = new SqlTranslator<IContent>(sqlClause, query);
|
||||
var sql = translator.Translate()
|
||||
.Where<DocumentDto>(x => x.Published)
|
||||
.OrderByDescending<ContentVersionDto>(x => x.VersionDate)
|
||||
.OrderBy<NodeDto>(x => x.SortOrder);
|
||||
|
||||
//NOTE: This doesn't allow properties to be part of the query
|
||||
var dtos = Database.Fetch<DocumentDto, ContentVersionDto, ContentDto, NodeDto>(sql);
|
||||
|
||||
foreach (var dto in dtos)
|
||||
{
|
||||
yield return CreateContentFromDto(dto, dto.VersionId);
|
||||
}
|
||||
}
|
||||
|
||||
public IContent GetByLanguage(int id, string language)
|
||||
{
|
||||
var sql = GetBaseQuery(false);
|
||||
@@ -437,13 +455,13 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
content.Template = _templateRepository.Get(dto.TemplateId.Value);
|
||||
}
|
||||
|
||||
content.Properties = GetPropertyCollection(dto.NodeId, versionId, contentType);
|
||||
content.Properties = GetPropertyCollection(dto.NodeId, versionId, contentType, content.CreateDate, content.UpdateDate);
|
||||
|
||||
((ICanBeDirty)content).ResetDirtyProperties();
|
||||
return content;
|
||||
}
|
||||
|
||||
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IContentType contentType)
|
||||
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IContentType contentType, DateTime createDate, DateTime updateDate)
|
||||
{
|
||||
var sql = new Sql();
|
||||
sql.Select("*")
|
||||
@@ -454,7 +472,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
.Where<PropertyDataDto>(x => x.VersionId == versionId);
|
||||
|
||||
var propertyDataDtos = Database.Fetch<PropertyDataDto, PropertyTypeDto>(sql);
|
||||
var propertyFactory = new PropertyFactory(contentType, versionId, id);
|
||||
var propertyFactory = new PropertyFactory(contentType, versionId, id, createDate, updateDate);
|
||||
var properties = propertyFactory.BuildEntity(propertyDataDtos);
|
||||
|
||||
var newProperties = properties.Where(x => x.HasIdentity == false);
|
||||
|
||||
@@ -312,7 +312,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
return allowedContentTypeDtos.Select(x => new ContentTypeSort { Id = new Lazy<int>(() => x.AllowedId), SortOrder = x.SortOrder }).ToList();
|
||||
}
|
||||
|
||||
protected PropertyGroupCollection GetPropertyGroupCollection(int id)
|
||||
protected PropertyGroupCollection GetPropertyGroupCollection(int id, DateTime createDate, DateTime updateDate)
|
||||
{
|
||||
var sql = new Sql();
|
||||
sql.Select("*")
|
||||
@@ -326,12 +326,12 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
|
||||
var dtos = Database.Fetch<PropertyTypeGroupDto, PropertyTypeDto, DataTypeDto, PropertyTypeGroupDto>(new GroupPropertyTypeRelator().Map, sql);
|
||||
|
||||
var propertyGroupFactory = new PropertyGroupFactory(id);
|
||||
var propertyGroupFactory = new PropertyGroupFactory(id, createDate, updateDate);
|
||||
var propertyGroups = propertyGroupFactory.BuildEntity(dtos);
|
||||
return new PropertyGroupCollection(propertyGroups);
|
||||
}
|
||||
|
||||
protected PropertyTypeCollection GetPropertyTypeCollection(int id)
|
||||
protected PropertyTypeCollection GetPropertyTypeCollection(int id, DateTime createDate, DateTime updateDate)
|
||||
{
|
||||
var sql = new Sql();
|
||||
sql.Select("*")
|
||||
@@ -357,7 +357,9 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
HelpText = dto.HelpText,
|
||||
Mandatory = dto.Mandatory,
|
||||
SortOrder = dto.SortOrder,
|
||||
ValidationRegExp = dto.ValidationRegExp
|
||||
ValidationRegExp = dto.ValidationRegExp,
|
||||
CreateDate = createDate,
|
||||
UpdateDate = updateDate
|
||||
}).ToList();
|
||||
|
||||
//Reset dirty properties
|
||||
|
||||
@@ -51,8 +51,8 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var contentType = factory.BuildEntity(dto);
|
||||
|
||||
contentType.AllowedContentTypes = GetAllowedContentTypeIds(id);
|
||||
contentType.PropertyGroups = GetPropertyGroupCollection(id);
|
||||
((ContentType)contentType).PropertyTypes = GetPropertyTypeCollection(id);
|
||||
contentType.PropertyGroups = GetPropertyGroupCollection(id, contentType.CreateDate, contentType.UpdateDate);
|
||||
((ContentType)contentType).PropertyTypes = GetPropertyTypeCollection(id, contentType.CreateDate, contentType.UpdateDate);
|
||||
|
||||
var templates = Database.Fetch<DocumentTypeDto>("WHERE contentTypeNodeId = @Id", new { Id = id });
|
||||
if(templates.Any())
|
||||
|
||||
@@ -111,6 +111,20 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
|
||||
#endregion
|
||||
|
||||
protected IEnumerable<string> FindAllFiles(string path)
|
||||
{
|
||||
var list = new List<string>();
|
||||
list.AddRange(FileSystem.GetFiles(path, "*"));
|
||||
|
||||
var directories = FileSystem.GetDirectories(path);
|
||||
foreach (var directory in directories)
|
||||
{
|
||||
list.AddRange(FindAllFiles(directory));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose any disposable properties
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Umbraco.Core.Models;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Repositories
|
||||
{
|
||||
@@ -11,5 +13,12 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
/// <param name="language">Culture code for the language to retrieve</param>
|
||||
/// <returns>An <see cref="IContent"/> item</returns>
|
||||
IContent GetByLanguage(int id, string language);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all published Content byh the specified query
|
||||
/// </summary>
|
||||
/// <param name="query">Query to execute against published versions</param>
|
||||
/// <returns>An enumerable list of <see cref="IContent"/></returns>
|
||||
IEnumerable<IContent> GetByPublishedVersion(IQuery<IContent> query);
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var factory = new MediaFactory(mediaType, NodeObjectTypeId, id);
|
||||
var media = factory.BuildEntity(dto);
|
||||
|
||||
media.Properties = GetPropertyCollection(id, dto.VersionId, mediaType);
|
||||
media.Properties = GetPropertyCollection(id, dto.VersionId, mediaType, media.CreateDate, media.UpdateDate);
|
||||
|
||||
((ICanBeDirty)media).ResetDirtyProperties();
|
||||
return media;
|
||||
@@ -118,6 +118,8 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
{
|
||||
"DELETE FROM umbracoUser2NodeNotify WHERE nodeId = @Id",
|
||||
"DELETE FROM umbracoUser2NodePermission WHERE nodeId = @Id",
|
||||
"DELETE FROM umbracoRelation WHERE parentId = @Id",
|
||||
"DELETE FROM umbracoRelation WHERE childId = @Id",
|
||||
"DELETE FROM cmsTagRelationship WHERE nodeId = @Id",
|
||||
"DELETE FROM cmsDocument WHERE NodeId = @Id",
|
||||
"DELETE FROM cmsPropertyData WHERE contentNodeId = @Id",
|
||||
@@ -155,7 +157,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var factory = new MediaFactory(mediaType, NodeObjectTypeId, dto.NodeId);
|
||||
var media = factory.BuildEntity(dto);
|
||||
|
||||
media.Properties = GetPropertyCollection(dto.NodeId, dto.VersionId, mediaType);
|
||||
media.Properties = GetPropertyCollection(dto.NodeId, dto.VersionId, mediaType, media.CreateDate, media.UpdateDate);
|
||||
|
||||
((ICanBeDirty)media).ResetDirtyProperties();
|
||||
return media;
|
||||
@@ -338,7 +340,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
|
||||
#endregion
|
||||
|
||||
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IMediaType contentType)
|
||||
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IMediaType contentType, DateTime createDate, DateTime updateDate)
|
||||
{
|
||||
var sql = new Sql();
|
||||
sql.Select("*")
|
||||
@@ -349,7 +351,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
.Where<PropertyDataDto>(x => x.VersionId == versionId);
|
||||
|
||||
var propertyDataDtos = Database.Fetch<PropertyDataDto, PropertyTypeDto>(sql);
|
||||
var propertyFactory = new PropertyFactory(contentType, versionId, id);
|
||||
var propertyFactory = new PropertyFactory(contentType, versionId, id, createDate, updateDate);
|
||||
var properties = propertyFactory.BuildEntity(propertyDataDtos);
|
||||
|
||||
var newProperties = properties.Where(x => x.HasIdentity == false);
|
||||
|
||||
@@ -42,8 +42,8 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var contentType = factory.BuildEntity(dto);
|
||||
|
||||
contentType.AllowedContentTypes = GetAllowedContentTypeIds(id);
|
||||
contentType.PropertyGroups = GetPropertyGroupCollection(id);
|
||||
((MediaType)contentType).PropertyTypes = GetPropertyTypeCollection(id);
|
||||
contentType.PropertyGroups = GetPropertyGroupCollection(id, contentType.CreateDate, contentType.UpdateDate);
|
||||
((MediaType)contentType).PropertyTypes = GetPropertyTypeCollection(id, contentType.CreateDate, contentType.UpdateDate);
|
||||
|
||||
var list = Database.Fetch<ContentType2ContentTypeDto>("WHERE childContentTypeId = @Id", new{ Id = id});
|
||||
foreach (var contentTypeDto in list)
|
||||
|
||||
@@ -45,12 +45,11 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var path = FileSystem.GetRelativePath(id);
|
||||
var created = FileSystem.GetCreated(path).UtcDateTime;
|
||||
var updated = FileSystem.GetLastModified(path).UtcDateTime;
|
||||
var name = new FileInfo(path).Name;
|
||||
|
||||
var script = new Script(path)
|
||||
{
|
||||
Content = content,
|
||||
Key = name.EncodeAsGuid(),
|
||||
Key = path.EncodeAsGuid(),
|
||||
CreateDate = created,
|
||||
UpdateDate = updated
|
||||
};
|
||||
@@ -71,7 +70,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
}
|
||||
else
|
||||
{
|
||||
var files = FileSystem.GetFiles("", "*");
|
||||
var files = FindAllFiles("");
|
||||
foreach (var file in files)
|
||||
{
|
||||
yield return Get(file);
|
||||
|
||||
@@ -47,12 +47,11 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var path = FileSystem.GetRelativePath(id);
|
||||
var created = FileSystem.GetCreated(path).UtcDateTime;
|
||||
var updated = FileSystem.GetLastModified(path).UtcDateTime;
|
||||
var name = new FileInfo(path).Name;
|
||||
|
||||
var stylesheet = new Stylesheet(path)
|
||||
{
|
||||
Content = content,
|
||||
Key = name.EncodeAsGuid(),
|
||||
Key = path.EncodeAsGuid(),
|
||||
CreateDate = created,
|
||||
UpdateDate = updated
|
||||
};
|
||||
@@ -73,7 +72,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
}
|
||||
else
|
||||
{
|
||||
var files = FileSystem.GetFiles("", "*");
|
||||
var files = FindAllFiles("");
|
||||
foreach (var file in files)
|
||||
{
|
||||
yield return Get(file);
|
||||
|
||||
@@ -186,6 +186,8 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
|
||||
//Save to db
|
||||
var template = entity as Template;
|
||||
template.AddingEntity();
|
||||
|
||||
var factory = new TemplateFactory(NodeObjectTypeId);
|
||||
var dto = factory.BuildDto(template);
|
||||
|
||||
@@ -254,6 +256,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var templateDto = Database.SingleOrDefault<TemplateDto>("WHERE nodeId = @Id", new { Id = entity.Id });
|
||||
//Save updated entity to db
|
||||
var template = entity as Template;
|
||||
template.UpdateDate = DateTime.Now;
|
||||
var factory = new TemplateFactory(templateDto.PrimaryKey, NodeObjectTypeId);
|
||||
var dto = factory.BuildDto(template);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -393,7 +393,7 @@ namespace Umbraco.Core.Services
|
||||
return;
|
||||
|
||||
//Find Descendants, which will be moved to the recycle bin along with the parent/grandparent.
|
||||
var descendants = GetDescendants(media).ToList();
|
||||
var descendants = GetDescendants(media).OrderBy(x => x.Level).ToList();
|
||||
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
|
||||
@@ -426,8 +426,8 @@ namespace Umbraco.Core.Services
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
|
||||
{
|
||||
var query = Query<IMedia>.Builder.Where(x => x.Path.Contains("-21"));
|
||||
var contents = repository.GetByQuery(query).OrderByDescending(x => x.ParentId);
|
||||
var query = Query<IMedia>.Builder.Where(x => x.Trashed == true);
|
||||
var contents = repository.GetByQuery(query).OrderByDescending(x => x.Level);
|
||||
|
||||
foreach (var content in contents)
|
||||
{
|
||||
@@ -489,11 +489,11 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Permanently deletes an <see cref="IMedia"/> object
|
||||
/// Permanently deletes an <see cref="IMedia"/> object as well as all of its Children.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Please note that this method will completely remove the Media from the database,
|
||||
/// but current not from the file system.
|
||||
/// as well as associated media files from the file system.
|
||||
/// </remarks>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
@@ -502,6 +502,13 @@ namespace Umbraco.Core.Services
|
||||
if (Deleting.IsRaisedEventCancelled(new DeleteEventArgs<IMedia>(media), this))
|
||||
return;
|
||||
|
||||
//Delete children before deleting the 'possible parent'
|
||||
var children = GetChildren(media.Id);
|
||||
foreach (var child in children)
|
||||
{
|
||||
Delete(child, userId);
|
||||
}
|
||||
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
|
||||
{
|
||||
|
||||
@@ -196,9 +196,21 @@ namespace Umbraco.Core.Services
|
||||
/// Imports and saves package xml as <see cref="IContentType"/>
|
||||
/// </summary>
|
||||
/// <param name="element">Xml to import</param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
public IEnumerable<IContentType> ImportContentTypes(XElement element, int userId = 0)
|
||||
{
|
||||
return ImportContentTypes(element, true, userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imports and saves package xml as <see cref="IContentType"/>
|
||||
/// </summary>
|
||||
/// <param name="element">Xml to import</param>
|
||||
/// <param name="importStructure">Boolean indicating whether or not to import the </param>
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
public IEnumerable<IContentType> ImportContentTypes(XElement element, bool importStructure, int userId = 0)
|
||||
{
|
||||
var name = element.Name.LocalName;
|
||||
if (name.Equals("DocumentTypes") == false && name.Equals("DocumentType") == false)
|
||||
@@ -209,7 +221,7 @@ namespace Umbraco.Core.Services
|
||||
_importedContentTypes = new Dictionary<string, IContentType>();
|
||||
var documentTypes = name.Equals("DocumentTypes")
|
||||
? (from doc in element.Elements("DocumentType") select doc).ToList()
|
||||
: new List<XElement> {element.Element("DocumentType")};
|
||||
: new List<XElement> {element};
|
||||
//NOTE it might be an idea to sort the doctype XElements based on dependencies
|
||||
//before creating the doc types - should also allow for a better structure/inheritance support.
|
||||
foreach (var documentType in documentTypes)
|
||||
@@ -227,22 +239,25 @@ namespace Umbraco.Core.Services
|
||||
var list = _importedContentTypes.Select(x => x.Value).ToList();
|
||||
_contentTypeService.Save(list, userId);
|
||||
|
||||
var updatedContentTypes = new List<IContentType>();
|
||||
//Update the structure here - we can't do it untill all DocTypes have been created
|
||||
foreach (var documentType in documentTypes)
|
||||
if (importStructure)
|
||||
{
|
||||
var alias = documentType.Element("Info").Element("Alias").Value;
|
||||
var structureElement = documentType.Element("Structure");
|
||||
//Ensure that we only update ContentTypes which has actual structure-elements
|
||||
if (structureElement == null || structureElement.Elements("DocumentType").Any() == false) continue;
|
||||
var updatedContentTypes = new List<IContentType>();
|
||||
//Update the structure here - we can't do it untill all DocTypes have been created
|
||||
foreach (var documentType in documentTypes)
|
||||
{
|
||||
var alias = documentType.Element("Info").Element("Alias").Value;
|
||||
var structureElement = documentType.Element("Structure");
|
||||
//Ensure that we only update ContentTypes which has actual structure-elements
|
||||
if (structureElement == null || structureElement.Elements("DocumentType").Any() == false) continue;
|
||||
|
||||
var updated = UpdateContentTypesStructure(_importedContentTypes[alias], structureElement);
|
||||
updatedContentTypes.Add(updated);
|
||||
var updated = UpdateContentTypesStructure(_importedContentTypes[alias], structureElement);
|
||||
updatedContentTypes.Add(updated);
|
||||
}
|
||||
//Update ContentTypes with a newly added structure/list of allowed children
|
||||
if (updatedContentTypes.Any())
|
||||
_contentTypeService.Save(updatedContentTypes, userId);
|
||||
}
|
||||
//Update ContentTypes with a newly added structure/list of allowed children
|
||||
if(updatedContentTypes.Any())
|
||||
_contentTypeService.Save(updatedContentTypes, userId);
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -423,6 +438,8 @@ namespace Umbraco.Core.Services
|
||||
if (_importedContentTypes.ContainsKey(alias))
|
||||
{
|
||||
var allowedChild = _importedContentTypes[alias];
|
||||
if (allowedChild == null || allowedChildren.Any(x => x.Id.IsValueCreated && x.Id.Value == allowedChild.Id)) continue;
|
||||
|
||||
allowedChildren.Add(new ContentTypeSort(new Lazy<int>(() => allowedChild.Id), sortOrder, allowedChild.Alias));
|
||||
sortOrder++;
|
||||
}
|
||||
@@ -580,13 +597,26 @@ namespace Umbraco.Core.Services
|
||||
foreach (XElement tempElement in templateElements)
|
||||
{
|
||||
var dependencies = new List<string>();
|
||||
if(tempElement.Element("Master") != null && string.IsNullOrEmpty(tempElement.Element("Master").Value) == false)
|
||||
dependencies.Add(tempElement.Element("Master").Value);
|
||||
var elementCopy = tempElement;
|
||||
//Ensure that the Master of the current template is part of the import, otherwise we ignore this dependency as part of the dependency sorting.
|
||||
if (elementCopy.Element("Master") != null &&
|
||||
string.IsNullOrEmpty(elementCopy.Element("Master").Value) == false &&
|
||||
templateElements.Any(x => x.Element("Alias").Value == elementCopy.Element("Master").Value))
|
||||
{
|
||||
dependencies.Add(elementCopy.Element("Master").Value);
|
||||
}
|
||||
else if (elementCopy.Element("Master") != null &&
|
||||
string.IsNullOrEmpty(elementCopy.Element("Master").Value) == false &&
|
||||
templateElements.Any(x => x.Element("Alias").Value == elementCopy.Element("Master").Value) ==
|
||||
false)
|
||||
{
|
||||
LogHelper.Info<PackagingService>(string.Format("Template '{0}' has an invalid Master '{1}', so the reference has been ignored.", elementCopy.Element("Alias").Value, elementCopy.Element("Master").Value));
|
||||
}
|
||||
|
||||
var field = new TopologicalSorter.DependencyField<XElement>
|
||||
{
|
||||
Alias = tempElement.Element("Alias").Value,
|
||||
Item = new Lazy<XElement>(() => tempElement),
|
||||
Alias = elementCopy.Element("Alias").Value,
|
||||
Item = new Lazy<XElement>(() => elementCopy),
|
||||
DependsOn = dependencies.ToArray()
|
||||
};
|
||||
|
||||
@@ -604,7 +634,9 @@ namespace Umbraco.Core.Services
|
||||
var isMasterPage = IsMasterPageSyntax(design);
|
||||
var path = isMasterPage ? MasterpagePath(alias) : ViewPath(alias);
|
||||
|
||||
var template = new Template(path, templateName, alias) { Content = design };
|
||||
var existingTemplate = _fileService.GetTemplate(alias) as Template;
|
||||
var template = existingTemplate ?? new Template(path, templateName, alias);
|
||||
template.Content = design;
|
||||
if (masterElement != null && string.IsNullOrEmpty(masterElement.Value) == false)
|
||||
{
|
||||
template.MasterTemplateAlias = masterElement.Value;
|
||||
|
||||
@@ -835,7 +835,7 @@ namespace Umbraco.Core
|
||||
public static string ToSafeAlias(this string alias)
|
||||
{
|
||||
const string validAliasCharacters = "_-abcdefghijklmnopqrstuvwxyz1234567890";
|
||||
const string invalidFirstCharacters = "01234567890";
|
||||
const string invalidFirstCharacters = "0123456789";
|
||||
var safeString = new StringBuilder();
|
||||
int aliasLength = alias.Length;
|
||||
for (int i = 0; i < aliasLength; i++)
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Umbraco.Core
|
||||
//add vertices
|
||||
for (int i = 0; i < fields.Count(); i++)
|
||||
{
|
||||
indexes[fields[i].Alias.ToLower()] = g.AddVertex(i);
|
||||
indexes[fields[i].Alias.ToLowerInvariant()] = g.AddVertex(i);
|
||||
}
|
||||
|
||||
//add edges
|
||||
@@ -141,8 +141,13 @@ namespace Umbraco.Core
|
||||
{
|
||||
for (int j = 0; j < fields[i].DependsOn.Length; j++)
|
||||
{
|
||||
g.AddEdge(i,
|
||||
indexes[fields[i].DependsOn[j].ToLower()]);
|
||||
if (indexes.ContainsKey(fields[i].DependsOn[j].ToLowerInvariant()) == false)
|
||||
throw new IndexOutOfRangeException(
|
||||
string.Format(
|
||||
"The alias '{0}' has an invalid dependency. The dependency '{1}' does not exist in the list of aliases",
|
||||
fields[i], fields[i].DependsOn[j]));
|
||||
|
||||
g.AddEdge(i, indexes[fields[i].DependsOn[j].ToLowerInvariant()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
<Compile Include="Enum.cs" />
|
||||
<Compile Include="Events\MacroErrorEventArgs.cs" />
|
||||
<Compile Include="HashCodeCombiner.cs" />
|
||||
<Compile Include="IconPickerBehaviour.cs" />
|
||||
<Compile Include="IO\FileSystemWrapper.cs" />
|
||||
<Compile Include="MacroErrorBehaviour.cs" />
|
||||
<Compile Include="Media\IImageUrlProvider.cs" />
|
||||
|
||||
@@ -9,6 +9,79 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
internal static class XmlExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts from an XDocument to an XmlDocument
|
||||
/// </summary>
|
||||
/// <param name="xDocument"></param>
|
||||
/// <returns></returns>
|
||||
public static XmlDocument ToXmlDocument(this XDocument xDocument)
|
||||
{
|
||||
var xmlDocument = new XmlDocument();
|
||||
using (var xmlReader = xDocument.CreateReader())
|
||||
{
|
||||
xmlDocument.Load(xmlReader);
|
||||
}
|
||||
return xmlDocument;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from an XmlDocument to an XDocument
|
||||
/// </summary>
|
||||
/// <param name="xmlDocument"></param>
|
||||
/// <returns></returns>
|
||||
public static XDocument ToXDocument(this XmlDocument xmlDocument)
|
||||
{
|
||||
using (var nodeReader = new XmlNodeReader(xmlDocument))
|
||||
{
|
||||
nodeReader.MoveToContent();
|
||||
return XDocument.Load(nodeReader);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from an XElement to an XmlElement
|
||||
/// </summary>
|
||||
/// <param name="xElement"></param>
|
||||
/// <returns></returns>
|
||||
public static XmlNode ToXmlElement(this XElement xElement)
|
||||
{
|
||||
var xmlDocument = new XmlDocument();
|
||||
using (var xmlReader = xElement.CreateReader())
|
||||
{
|
||||
xmlDocument.Load(xmlReader);
|
||||
}
|
||||
return xmlDocument.DocumentElement;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from an XmlElement to an XElement
|
||||
/// </summary>
|
||||
/// <param name="xmlElement"></param>
|
||||
/// <returns></returns>
|
||||
public static XElement ToXElement(this XmlNode xmlElement)
|
||||
{
|
||||
using (var nodeReader = new XmlNodeReader(xmlElement))
|
||||
{
|
||||
nodeReader.MoveToContent();
|
||||
return XElement.Load(nodeReader);
|
||||
}
|
||||
}
|
||||
|
||||
public static T AttributeValue<T>(this XElement xml, string attributeName)
|
||||
{
|
||||
if (xml == null) throw new ArgumentNullException("xml");
|
||||
if (xml.HasAttributes == false) return default(T);
|
||||
|
||||
if (xml.Attribute(attributeName) == null)
|
||||
return default(T);
|
||||
|
||||
var val = xml.Attribute(attributeName).Value;
|
||||
var result = val.TryConvertTo<T>();
|
||||
if (result.Success)
|
||||
return result.Result;
|
||||
|
||||
return default(T);
|
||||
}
|
||||
public static T AttributeValue<T>(this XmlNode xml, string attributeName)
|
||||
{
|
||||
if (xml == null) throw new ArgumentNullException("xml");
|
||||
|
||||
@@ -5,6 +5,9 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
namespace Umbraco.Core
|
||||
@@ -14,6 +17,61 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public class XmlHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Sorts the children of the parentNode that match the xpath selector
|
||||
/// </summary>
|
||||
/// <param name="parentNode"></param>
|
||||
/// <param name="childXPathSelector">An xpath expression used to select child nodes of the XmlElement</param>
|
||||
/// <param name="childSelector">An expression that returns true if the XElement passed in is a valid child node to be sorted</param>
|
||||
/// <param name="orderByValue">The value to order the results by</param>
|
||||
internal static void SortNodes(
|
||||
XmlNode parentNode,
|
||||
string childXPathSelector,
|
||||
Func<XElement, bool> childSelector,
|
||||
Func<XElement, object> orderByValue)
|
||||
{
|
||||
|
||||
var xElement = parentNode.ToXElement();
|
||||
var children = xElement.Elements().Where(x => childSelector(x)).ToArray(); //(DONT conver to method group, the build server doesn't like it)
|
||||
|
||||
var data = children
|
||||
.OrderByDescending(orderByValue) //order by the sort order desc
|
||||
.Select(x => children.IndexOf(x)) //store the current item's index (DONT conver to method group, the build server doesn't like it)
|
||||
.ToList();
|
||||
|
||||
//get the minimum index that a content node exists in the parent
|
||||
var minElementIndex = xElement.Elements()
|
||||
.TakeWhile(x => childSelector(x) == false)
|
||||
.Count();
|
||||
|
||||
//if the minimum index is zero, then it is the very first node inside the parent,
|
||||
// if it is not, we need to store the child property node that exists just before the
|
||||
// first content node found so we can insert elements after it when we're sorting.
|
||||
var insertAfter = minElementIndex == 0 ? null : parentNode.ChildNodes[minElementIndex - 1];
|
||||
|
||||
var selectedChildren = parentNode.SelectNodes(childXPathSelector);
|
||||
if (selectedChildren == null)
|
||||
{
|
||||
throw new InvalidOperationException(string.Format("The childXPathSelector value did not return any results {0}", childXPathSelector));
|
||||
}
|
||||
|
||||
var childElements = selectedChildren.Cast<XmlElement>().ToArray();
|
||||
|
||||
//iterate over the ndoes starting with the node with the highest sort order.
|
||||
//then we insert this node at the begginning of the parent so that by the end
|
||||
//of the iteration the node with the least sort order will be at the top.
|
||||
foreach (var node in data.Select(index => childElements[index]))
|
||||
{
|
||||
if (insertAfter == null)
|
||||
{
|
||||
parentNode.PrependChild(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentNode.InsertAfter(node, insertAfter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string StripDashesInElementOrAttributeNames(string xml)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Interactions;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
|
||||
namespace Umbraco.Tests.Integration
|
||||
{
|
||||
[Ignore("We don't want to run Selenium tests on TeamCity")]
|
||||
[TestFixture]
|
||||
public class CreateContent : BaseSeleniumTest
|
||||
{
|
||||
[SetUp]
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
base.TearDown();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Install_StarterKit_And_Create_Textpage()
|
||||
{
|
||||
// Login to Umbraco
|
||||
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
|
||||
Driver.FindElement(By.Id("lname")).Clear();
|
||||
Driver.FindElement(By.Id("lname")).SendKeys("admin");
|
||||
Driver.FindElement(By.Id("passw")).Clear();
|
||||
Driver.FindElement(By.Id("passw")).SendKeys("test");
|
||||
Driver.FindElement(By.Id("Button1")).Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Install starter kit
|
||||
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
|
||||
Thread.Sleep(2000);
|
||||
|
||||
var builder = new Actions(Driver);
|
||||
var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
|
||||
builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
|
||||
Thread.Sleep(500);
|
||||
|
||||
var installStarterKitNode = Driver.FindElement(By.XPath("(//li[@id='-1']/a/div)[4]"));
|
||||
builder.MoveToElement(installStarterKitNode).Click().Build().Perform();
|
||||
Thread.Sleep(500);
|
||||
|
||||
var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
|
||||
Driver.SwitchTo().Frame(rightFrame);
|
||||
Thread.Sleep(500);
|
||||
|
||||
var simpleKit = Driver.FindElement(By.XPath("/html/body/form/div[2]/div[2]/div/div/div/div/div[4]/nav/ul/li[1]/a"));
|
||||
builder.MoveToElement(simpleKit).Click().Build().Perform();
|
||||
Thread.Sleep(6000);
|
||||
|
||||
// Create new content
|
||||
Driver.SwitchTo().DefaultContent();
|
||||
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#content");
|
||||
Thread.Sleep(500);
|
||||
|
||||
var contentNode = Driver.FindElement(By.XPath("//*[@id = 'JTree_TreeContainer']/div/ul/li/ul/li/a/div"));
|
||||
builder.MoveToElement(contentNode).ContextClick().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var createButton = Driver.FindElement(By.XPath("//*[@id = 'jstree-contextmenu']/li[1]/a/span/div[2]"));
|
||||
createButton.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
var umbracoModalBoxIframe = Driver.FindElement(By.CssSelector(".umbModalBoxIframe"));
|
||||
Driver.SwitchTo().Frame(umbracoModalBoxIframe);
|
||||
|
||||
var createTextBox = Driver.FindElement(By.XPath("//input[@type='text'][1]"));
|
||||
createTextBox.Clear();
|
||||
createTextBox.SendKeys("Test Page");
|
||||
|
||||
var submitButton = Driver.FindElement(By.XPath("//input[@type='submit'][1]"));
|
||||
submitButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
Driver.SwitchTo().Frame(rightFrame);
|
||||
var saveAndPublishButton = Driver.FindElement(By.XPath("//*[@id='body_TabView1_tab01layer_publish']"));
|
||||
saveAndPublishButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
var contentArea = Driver.FindElement(By.XPath("//*[@id='body_TabView1']"));
|
||||
Assert.IsNotNull(contentArea);
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Perform delete
|
||||
Driver.SwitchTo().DefaultContent();
|
||||
var installingModulesNode = Driver.FindElement(By.XPath("//*[@id='1052']/a/div"));
|
||||
builder.MoveToElement(installingModulesNode).ContextClick().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var deleteButton = Driver.FindElement(By.CssSelector(".sprDelete"));
|
||||
deleteButton.Click();
|
||||
var alert = Driver.SwitchTo().Alert();
|
||||
alert.Accept();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Perform move
|
||||
var goFurtherNode = Driver.FindElement(By.XPath("//*[@id='1053']/a/div"));
|
||||
builder.MoveToElement(goFurtherNode).ContextClick().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var moveButton = Driver.FindElement(By.CssSelector(".sprMove"));
|
||||
moveButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
umbracoModalBoxIframe = Driver.FindElement(By.CssSelector(".umbModalBoxIframe"));
|
||||
Driver.SwitchTo().Frame(umbracoModalBoxIframe);
|
||||
|
||||
var rootNode = Driver.FindElement(By.XPath("//*[@id='1051']"));
|
||||
builder.MoveToElement(rootNode).DoubleClick().Build().Perform();
|
||||
Thread.Sleep(500);
|
||||
var gettinStartedNode = Driver.FindElement(By.XPath("//*[@id='1055']/a/div"));
|
||||
builder.MoveToElement(gettinStartedNode).Click().Build().Perform();
|
||||
Thread.Sleep(500);
|
||||
submitButton = Driver.FindElement(By.XPath("//input[@type='submit'][1]"));
|
||||
builder.MoveToElement(submitButton).Click().Build().Perform();
|
||||
Thread.Sleep(2000);
|
||||
var closeLink = Driver.FindElement(By.XPath("/html/body/form/div[2]/p[2]/a"));
|
||||
builder.MoveToElement(closeLink).Click().Build().Perform();
|
||||
|
||||
Driver.SwitchTo().DefaultContent();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Perform copy
|
||||
var gettingStartedNode = Driver.FindElement(By.XPath("//*[@id='1054']/a/div"));
|
||||
builder.MoveToElement(gettingStartedNode).ContextClick().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var copyButton = Driver.FindElement(By.CssSelector(".sprCopy"));
|
||||
copyButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
umbracoModalBoxIframe = Driver.FindElement(By.CssSelector(".umbModalBoxIframe"));
|
||||
Driver.SwitchTo().Frame(umbracoModalBoxIframe);
|
||||
|
||||
rootNode = Driver.FindElement(By.XPath("//*[@id='1051']"));
|
||||
builder.MoveToElement(rootNode).DoubleClick().Build().Perform();
|
||||
Thread.Sleep(500);
|
||||
|
||||
submitButton = Driver.FindElement(By.XPath("//input[@type='submit'][1]"));
|
||||
builder.MoveToElement(submitButton).Click().Build().Perform();
|
||||
Thread.Sleep(2000);
|
||||
closeLink = Driver.FindElement(By.XPath("/html/body/form/div[2]/p[2]/a"));
|
||||
builder.MoveToElement(closeLink).Click().Build().Perform();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Interactions;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
|
||||
namespace Umbraco.Tests.Integration
|
||||
{
|
||||
[Ignore("We don't want to run Selenium tests on TeamCity")]
|
||||
[TestFixture]
|
||||
public class InstallPackage : BaseSeleniumTest
|
||||
{
|
||||
[SetUp]
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
base.TearDown();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Install_Courier_Package()
|
||||
{
|
||||
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
|
||||
Driver.FindElement(By.Id("lname")).Clear();
|
||||
Driver.FindElement(By.Id("lname")).SendKeys("admin");
|
||||
Driver.FindElement(By.Id("passw")).Clear();
|
||||
Driver.FindElement(By.Id("passw")).SendKeys("test");
|
||||
Driver.FindElement(By.Id("Button1")).Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
|
||||
Thread.Sleep(2000);
|
||||
|
||||
var builder = new Actions(Driver);
|
||||
var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
|
||||
builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var installPackageNode = Driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[2]/div/div/div/div/ul/li/ul/li[3]/ul/li[4]/a/div"));
|
||||
builder.MoveToElement(installPackageNode).Click().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
|
||||
Driver.SwitchTo().Frame(rightFrame);
|
||||
|
||||
const string packagesDir = @"C:\\Downloads\\Packages\\";
|
||||
var file = new DirectoryInfo(packagesDir).GetFiles().First(f => f.Name.ToLowerInvariant().StartsWith("Courier".ToLowerInvariant()));
|
||||
|
||||
Driver.FindElement(By.Id("cb")).Click();
|
||||
Driver.FindElement(By.XPath("//input[@type='file']")).SendKeys(file.FullName);
|
||||
Driver.FindElement(By.Id("body_ButtonLoadPackage")).Click();
|
||||
Driver.FindElement(By.Id("body_acceptCheckbox")).Click();
|
||||
Driver.FindElement(By.Id("body_ButtonInstall")).Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var successPanel = Driver.FindElement(By.XPath("//*[@id='body_Panel1_content']"));
|
||||
Assert.IsNotNull(successPanel);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Install_Contour_Package()
|
||||
{
|
||||
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
|
||||
Driver.FindElement(By.Id("lname")).Clear();
|
||||
Driver.FindElement(By.Id("lname")).SendKeys("admin");
|
||||
Driver.FindElement(By.Id("passw")).Clear();
|
||||
Driver.FindElement(By.Id("passw")).SendKeys("test");
|
||||
Driver.FindElement(By.Id("Button1")).Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
|
||||
Thread.Sleep(2000);
|
||||
|
||||
var builder = new Actions(Driver);
|
||||
var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
|
||||
builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var installPackageNode = Driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[2]/div/div/div/div/ul/li/ul/li[3]/ul/li[4]/a/div"));
|
||||
builder.MoveToElement(installPackageNode).Click().Build().Perform();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
|
||||
Driver.SwitchTo().Frame(rightFrame);
|
||||
|
||||
const string packagesDir = @"C:\\Downloads\\Packages\\";
|
||||
var file = new DirectoryInfo(packagesDir).GetFiles().First(f => f.Name.ToLowerInvariant().StartsWith("UmbracoContour".ToLowerInvariant()));
|
||||
|
||||
Driver.FindElement(By.Id("cb")).Click();
|
||||
Driver.FindElement(By.XPath("//input[@type='file']")).SendKeys(file.FullName);
|
||||
Driver.FindElement(By.Id("body_ButtonLoadPackage")).Click();
|
||||
Driver.FindElement(By.Id("body_acceptCheckbox")).Click();
|
||||
Driver.FindElement(By.Id("body_ButtonInstall")).Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var successPanel = Driver.FindElement(By.XPath("//*[@id='body_Panel1_content']"));
|
||||
Assert.IsNotNull(successPanel);
|
||||
}
|
||||
|
||||
//[Test]
|
||||
//public void Install_CMS_Import_Package()
|
||||
//{
|
||||
// Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
|
||||
// Driver.FindElement(By.Id("lname")).Clear();
|
||||
// Driver.FindElement(By.Id("lname")).SendKeys("admin");
|
||||
// Driver.FindElement(By.Id("passw")).Clear();
|
||||
// Driver.FindElement(By.Id("passw")).SendKeys("test");
|
||||
// Driver.FindElement(By.Id("Button1")).Click();
|
||||
// Thread.Sleep(1000);
|
||||
|
||||
// Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
|
||||
// Thread.Sleep(2000);
|
||||
|
||||
// var builder = new Actions(Driver);
|
||||
// var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
|
||||
// builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
|
||||
// Thread.Sleep(1000);
|
||||
|
||||
// var installPackageNode = Driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[2]/div/div/div/div/ul/li/ul/li[3]/ul/li[4]/a/div"));
|
||||
// builder.MoveToElement(installPackageNode).Click().Build().Perform();
|
||||
// Thread.Sleep(1000);
|
||||
|
||||
// var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
|
||||
// Driver.SwitchTo().Frame(rightFrame);
|
||||
|
||||
// Driver.FindElement(By.Id("cb")).Click();
|
||||
// Driver.FindElement(By.Id("body_file1")).SendKeys("C:\\Downloads\\Packages\\CMSImport-2.3.1.zip");
|
||||
// Driver.FindElement(By.Id("body_ButtonLoadPackage")).Click();
|
||||
// Driver.FindElement(By.Id("body_acceptCheckbox")).Click();
|
||||
// Driver.FindElement(By.Id("body_ButtonInstall")).Click();
|
||||
// Thread.Sleep(1000);
|
||||
|
||||
// var successPanel = Driver.FindElement(By.XPath("//*[@id='body_Panel1_content']"));
|
||||
// Assert.IsNotNull(successPanel);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using Umbraco.Tests.TestHelpers.Entities;
|
||||
|
||||
namespace Umbraco.Tests.Models.Collections
|
||||
{
|
||||
[TestFixture]
|
||||
public class PropertyCollectionTests
|
||||
{
|
||||
[Test]
|
||||
public void SimpleOrder_Returns_Null_On_FirstOrDefault_When_Empty()
|
||||
{
|
||||
var orders = new SimpleOrder();
|
||||
var item = orders.FirstOrDefault();
|
||||
|
||||
Assert.That(item == null, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PropertyCollection_Returns_Null_On_FirstOrDefault_When_Empty()
|
||||
{
|
||||
var list = new List<Property>();
|
||||
var collection = new PropertyCollection(list);
|
||||
|
||||
var first = collection.FirstOrDefault();
|
||||
var second = collection.FirstOrDefault(x => x.Alias.InvariantEquals("Test"));
|
||||
|
||||
Assert.That(first, Is.Null);
|
||||
Assert.That(first == null, Is.True);
|
||||
Assert.That(second == null, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PropertyTypeCollection_Returns_Null_On_FirstOrDefault_When_Empty()
|
||||
{
|
||||
var list = new List<PropertyType>();
|
||||
var collection = new PropertyTypeCollection(list);
|
||||
|
||||
Assert.That(collection.FirstOrDefault(), Is.Null);
|
||||
Assert.That(collection.FirstOrDefault(x => x.Alias.InvariantEquals("Test")) == null, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PropertyGroupCollection_Returns_Null_On_FirstOrDefault_When_Empty()
|
||||
{
|
||||
var list = new List<PropertyGroup>();
|
||||
var collection = new PropertyGroupCollection(list);
|
||||
|
||||
Assert.That(collection.FirstOrDefault(), Is.Null);
|
||||
Assert.That(collection.FirstOrDefault(x => x.Name.InvariantEquals("Test")) == null, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PropertyGroups_Collection_FirstOrDefault_Returns_Null()
|
||||
{
|
||||
var contentType = MockedContentTypes.CreateTextpageContentType();
|
||||
|
||||
Assert.That(contentType.PropertyGroups, Is.Not.Null);
|
||||
Assert.That(contentType.PropertyGroups.FirstOrDefault(x => x.Name.InvariantEquals("Content")) == null, Is.False);
|
||||
Assert.That(contentType.PropertyGroups.FirstOrDefault(x => x.Name.InvariantEquals("Test")) == null, Is.True);
|
||||
Assert.That(contentType.PropertyGroups.Any(x => x.Name.InvariantEquals("Test")), Is.False);
|
||||
}
|
||||
}
|
||||
|
||||
public class SimpleOrder : KeyedCollection<int, OrderItem>, INotifyCollectionChanged
|
||||
{
|
||||
// The parameterless constructor of the base class creates a
|
||||
// KeyedCollection with an internal dictionary. For this code
|
||||
// example, no other constructors are exposed.
|
||||
//
|
||||
public SimpleOrder() : base() { }
|
||||
|
||||
public SimpleOrder(IEnumerable<OrderItem> properties)
|
||||
{
|
||||
Reset(properties);
|
||||
}
|
||||
|
||||
// This is the only method that absolutely must be overridden,
|
||||
// because without it the KeyedCollection cannot extract the
|
||||
// keys from the items. The input parameter type is the
|
||||
// second generic type argument, in this case OrderItem, and
|
||||
// the return value type is the first generic type argument,
|
||||
// in this case int.
|
||||
//
|
||||
protected override int GetKeyForItem(OrderItem item)
|
||||
{
|
||||
// In this example, the key is the part number.
|
||||
return item.PartNumber;
|
||||
}
|
||||
|
||||
internal void Reset(IEnumerable<OrderItem> properties)
|
||||
{
|
||||
Clear();
|
||||
properties.ForEach(Add);
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||
}
|
||||
|
||||
protected override void SetItem(int index, OrderItem item)
|
||||
{
|
||||
base.SetItem(index, item);
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));
|
||||
}
|
||||
|
||||
protected override void RemoveItem(int index)
|
||||
{
|
||||
var removed = this[index];
|
||||
base.RemoveItem(index);
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removed));
|
||||
}
|
||||
|
||||
protected override void InsertItem(int index, OrderItem item)
|
||||
{
|
||||
base.InsertItem(index, item);
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item));
|
||||
}
|
||||
|
||||
protected override void ClearItems()
|
||||
{
|
||||
base.ClearItems();
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||
}
|
||||
|
||||
public new bool Contains(int partNumber)
|
||||
{
|
||||
return this.Any(x => x.PartNumber == partNumber);
|
||||
}
|
||||
|
||||
public event NotifyCollectionChangedEventHandler CollectionChanged;
|
||||
|
||||
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
|
||||
{
|
||||
if (CollectionChanged != null)
|
||||
{
|
||||
CollectionChanged(this, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class OrderItem : Item
|
||||
{
|
||||
public readonly int PartNumber;
|
||||
public readonly string Description;
|
||||
public readonly double UnitPrice;
|
||||
|
||||
private int _quantity = 0;
|
||||
|
||||
public OrderItem(int partNumber, string description,
|
||||
int quantity, double unitPrice)
|
||||
{
|
||||
this.PartNumber = partNumber;
|
||||
this.Description = description;
|
||||
this.Quantity = quantity;
|
||||
this.UnitPrice = unitPrice;
|
||||
}
|
||||
|
||||
public int Quantity
|
||||
{
|
||||
get { return _quantity; }
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
throw new ArgumentException("Quantity cannot be negative.");
|
||||
|
||||
_quantity = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format(
|
||||
"{0,9} {1,6} {2,-12} at {3,8:#,###.00} = {4,10:###,###.00}",
|
||||
PartNumber, _quantity, Description, UnitPrice,
|
||||
UnitPrice * _quantity);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class Item : IEntity, ICanBeDirty
|
||||
{
|
||||
private bool _hasIdentity;
|
||||
private int? _hash;
|
||||
private int _id;
|
||||
private Guid _key;
|
||||
|
||||
protected Item()
|
||||
{
|
||||
_propertyChangedInfo = new Dictionary<string, bool>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Integer Id
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public int Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
set
|
||||
{
|
||||
_id = value;
|
||||
HasIdentity = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Guid based Id
|
||||
/// </summary>
|
||||
/// <remarks>The key is currectly used to store the Unique Id from the
|
||||
/// umbracoNode table, which many of the entities are based on.</remarks>
|
||||
[DataMember]
|
||||
public Guid Key
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_key == Guid.Empty)
|
||||
return _id.ToGuid();
|
||||
|
||||
return _key;
|
||||
}
|
||||
set { _key = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Created Date
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public DateTime CreateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Modified Date
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public DateTime UpdateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the WasCancelled flag, which is used to track
|
||||
/// whether some action against an entity was cancelled through some event.
|
||||
/// This only exists so we have a way to check if an event was cancelled through
|
||||
/// the new api, which also needs to take effect in the legacy api.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
internal bool WasCancelled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Property changed event
|
||||
/// </summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Method to call on a property setter.
|
||||
/// </summary>
|
||||
/// <param name="propertyInfo">The property info.</param>
|
||||
protected virtual void OnPropertyChanged(PropertyInfo propertyInfo)
|
||||
{
|
||||
_propertyChangedInfo[propertyInfo.Name] = true;
|
||||
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyInfo.Name));
|
||||
}
|
||||
}
|
||||
|
||||
internal virtual void ResetIdentity()
|
||||
{
|
||||
_hasIdentity = false;
|
||||
_id = default(int);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to call on entity saved when first added
|
||||
/// </summary>
|
||||
internal virtual void AddingEntity()
|
||||
{
|
||||
CreateDate = DateTime.Now;
|
||||
UpdateDate = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to call on entity saved/updated
|
||||
/// </summary>
|
||||
internal virtual void UpdatingEntity()
|
||||
{
|
||||
UpdateDate = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tracks the properties that have changed
|
||||
/// </summary>
|
||||
//private readonly IDictionary<string, bool> _propertyChangedInfo = new Dictionary<string, bool>();
|
||||
private IDictionary<string, bool> _propertyChangedInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether a specific property on the current entity is dirty.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">Name of the property to check</param>
|
||||
/// <returns>True if Property is dirty, otherwise False</returns>
|
||||
public virtual bool IsPropertyDirty(string propertyName)
|
||||
{
|
||||
return _propertyChangedInfo.Any(x => x.Key == propertyName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the current entity is dirty.
|
||||
/// </summary>
|
||||
/// <returns>True if entity is dirty, otherwise False</returns>
|
||||
public virtual bool IsDirty()
|
||||
{
|
||||
return _propertyChangedInfo.Any();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets dirty properties by clearing the dictionary used to track changes.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Please note that resetting the dirty properties could potentially
|
||||
/// obstruct the saving of a new or updated entity.
|
||||
/// </remarks>
|
||||
public virtual void ResetDirtyProperties()
|
||||
{
|
||||
_propertyChangedInfo.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the current entity has an identity, eg. Id.
|
||||
/// </summary>
|
||||
public virtual bool HasIdentity
|
||||
{
|
||||
get
|
||||
{
|
||||
return _hasIdentity;
|
||||
}
|
||||
protected set
|
||||
{
|
||||
_hasIdentity = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator ==(Item left, Item right)
|
||||
{
|
||||
/*if (ReferenceEquals(null, left))
|
||||
return false;
|
||||
|
||||
if(ReferenceEquals(null, right))
|
||||
return false;*/
|
||||
|
||||
return ReferenceEquals(left, right);
|
||||
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(Item left, Item right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
/*public virtual bool SameIdentityAs(IEntity other)
|
||||
{
|
||||
if (ReferenceEquals(null, other))
|
||||
return false;
|
||||
if (ReferenceEquals(this, other))
|
||||
return true;
|
||||
|
||||
return SameIdentityAs(other as Entity);
|
||||
}
|
||||
|
||||
public virtual bool Equals(Entity other)
|
||||
{
|
||||
if (ReferenceEquals(null, other))
|
||||
return false;
|
||||
if (ReferenceEquals(this, other))
|
||||
return true;
|
||||
|
||||
return SameIdentityAs(other);
|
||||
}
|
||||
|
||||
public virtual Type GetRealType()
|
||||
{
|
||||
return GetType();
|
||||
}
|
||||
|
||||
public virtual bool SameIdentityAs(Entity other)
|
||||
{
|
||||
if (ReferenceEquals(null, other))
|
||||
return false;
|
||||
|
||||
if (ReferenceEquals(this, other))
|
||||
return true;
|
||||
|
||||
if (GetType() == other.GetRealType() && HasIdentity && other.HasIdentity)
|
||||
return other.Id.Equals(Id);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
|
||||
return SameIdentityAs(obj as IEntity);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
if (!_hash.HasValue)
|
||||
_hash = !HasIdentity ? new int?(base.GetHashCode()) : new int?(Id.GetHashCode() * 397 ^ GetType().GetHashCode());
|
||||
return _hash.Value;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
UmbracoSettings.SettingsFilePath = Core.IO.IOHelper.MapPath(Core.IO.SystemDirectories.Config + Path.DirectorySeparatorChar, false);
|
||||
|
||||
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public override void TearDown()
|
||||
{
|
||||
base.TearDown();
|
||||
|
||||
|
||||
PropertyEditorValueConvertersResolver.Reset();
|
||||
PublishedContentStoreResolver.Reset();
|
||||
PublishedMediaStoreResolver.Reset();
|
||||
|
||||
@@ -25,9 +25,6 @@ namespace Umbraco.Tests.Routing
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
//the module requires that the singleton is setup
|
||||
ApplicationContext.Current = ApplicationContext;
|
||||
|
||||
//create the module
|
||||
_module = new UmbracoModule();
|
||||
|
||||
|
||||
@@ -468,6 +468,50 @@ namespace Umbraco.Tests.Services
|
||||
Assert.That(published, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Get_Published_Descendant_Versions()
|
||||
{
|
||||
// Arrange
|
||||
var contentService = ServiceContext.ContentService;
|
||||
var root = contentService.GetById(1046);
|
||||
var rootPublished = contentService.Publish(root);
|
||||
var content = contentService.GetById(1048);
|
||||
content.Properties["title"].Value = content.Properties["title"].Value + " Published";
|
||||
bool published = contentService.SaveAndPublish(content);
|
||||
|
||||
var publishedVersion = content.Version;
|
||||
|
||||
content.Properties["title"].Value = content.Properties["title"].Value + " Saved";
|
||||
contentService.Save(content);
|
||||
|
||||
var savedVersion = content.Version;
|
||||
|
||||
// Act
|
||||
var publishedDescendants = ((ContentService) contentService).GetPublishedDescendants(root);
|
||||
|
||||
// Assert
|
||||
Assert.That(rootPublished, Is.True);
|
||||
Assert.That(published, Is.True);
|
||||
Assert.That(publishedDescendants.Any(x => x.Version == publishedVersion), Is.True);
|
||||
Assert.That(publishedDescendants.Any(x => x.Version == savedVersion), Is.False);
|
||||
|
||||
//Ensure that the published content version has the correct property value and is marked as published
|
||||
var publishedContentVersion = publishedDescendants.First(x => x.Version == publishedVersion);
|
||||
Assert.That(publishedContentVersion.Published, Is.True);
|
||||
Assert.That(publishedContentVersion.Properties["title"].Value, Contains.Substring("Published"));
|
||||
|
||||
//Ensure that the saved content version has the correct property value and is not marked as published
|
||||
var savedContentVersion = contentService.GetByVersion(savedVersion);
|
||||
Assert.That(savedContentVersion.Published, Is.False);
|
||||
Assert.That(savedContentVersion.Properties["title"].Value, Contains.Substring("Saved"));
|
||||
|
||||
//Ensure that the latest version of the content is the saved and not-yet-published one
|
||||
var currentContent = contentService.GetById(1048);
|
||||
Assert.That(currentContent.Published, Is.False);
|
||||
Assert.That(currentContent.Properties["title"].Value, Contains.Substring("Saved"));
|
||||
Assert.That(currentContent.Version, Is.EqualTo(savedVersion));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Save_Content()
|
||||
{
|
||||
@@ -567,6 +611,34 @@ namespace Umbraco.Tests.Services
|
||||
Assert.That(content.Trashed, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Move_Content_Structure_To_RecycleBin_And_Empty_RecycleBin()
|
||||
{
|
||||
// Arrange
|
||||
var contentService = ServiceContext.ContentService;
|
||||
var contentType = ServiceContext.ContentTypeService.GetContentType("umbTextpage");
|
||||
Content subsubpage = MockedContent.CreateSimpleContent(contentType, "Text Page 3", 1047);
|
||||
contentService.Save(subsubpage, 0);
|
||||
|
||||
var content = contentService.GetById(1046);
|
||||
|
||||
// Act
|
||||
contentService.MoveToRecycleBin(content, 0);
|
||||
var descendants = contentService.GetDescendants(content);
|
||||
|
||||
// Assert
|
||||
Assert.That(content.ParentId, Is.EqualTo(-20));
|
||||
Assert.That(content.Trashed, Is.True);
|
||||
Assert.That(descendants.Count(), Is.EqualTo(3));
|
||||
Assert.That(descendants.Any(x => x.Path.Contains("-20") == false), Is.False);
|
||||
|
||||
//Empty Recycle Bin
|
||||
contentService.EmptyRecycleBin();
|
||||
var trashed = contentService.GetContentInRecycleBin();
|
||||
|
||||
Assert.That(trashed.Any(), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Empty_RecycleBin()
|
||||
{
|
||||
|
||||
@@ -85,6 +85,34 @@ namespace Umbraco.Tests.Services.Importing {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?>
|
||||
///<DocumentType>
|
||||
/// <Info>
|
||||
/// <Name>test</Name>
|
||||
/// <Alias>test</Alias>
|
||||
/// <Icon>folder.gif</Icon>
|
||||
/// <Thumbnail>folder.png</Thumbnail>
|
||||
/// <Description>
|
||||
/// </Description>
|
||||
/// <AllowAtRoot>False</AllowAtRoot>
|
||||
/// <AllowedTemplates>
|
||||
/// <Template>test</Template>
|
||||
/// </AllowedTemplates>
|
||||
/// <DefaultTemplate>test</DefaultTemplate>
|
||||
/// </Info>
|
||||
/// <Structure>
|
||||
/// <DocumentType>test</DocumentType>
|
||||
/// </Structure>
|
||||
/// <GenericProperties>
|
||||
/// <GenericProperty> [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string SingleDocType {
|
||||
get {
|
||||
return ResourceManager.GetString("SingleDocType", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
///<umbPackage>
|
||||
@@ -112,6 +140,58 @@ namespace Umbraco.Tests.Services.Importing {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
///<umbPackage>
|
||||
/// <files />
|
||||
/// <info>
|
||||
/// <package>
|
||||
/// <name>Template-Update</name>
|
||||
/// <version>0.1</version>
|
||||
/// <license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
|
||||
/// <url>http://our.umbraco.org/projects</url>
|
||||
/// <requirements>
|
||||
/// <major>3</major>
|
||||
/// <minor>0</minor>
|
||||
/// <patch>0</patch>
|
||||
/// </requirements>
|
||||
/// </package>
|
||||
/// <author>
|
||||
/// <name>Morten Christensen</name>
|
||||
/// [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string TemplateOnly_Package {
|
||||
get {
|
||||
return ResourceManager.GetString("TemplateOnly_Package", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
///<umbPackage>
|
||||
/// <files />
|
||||
/// <info>
|
||||
/// <package>
|
||||
/// <name>Template-Update</name>
|
||||
/// <version>0.1</version>
|
||||
/// <license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
|
||||
/// <url>http://our.umbraco.org/projects</url>
|
||||
/// <requirements>
|
||||
/// <major>3</major>
|
||||
/// <minor>0</minor>
|
||||
/// <patch>0</patch>
|
||||
/// </requirements>
|
||||
/// </package>
|
||||
/// <author>
|
||||
/// <name>Morten Christensen</name>
|
||||
/// [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string TemplateOnly_Updated_Package {
|
||||
get {
|
||||
return ResourceManager.GetString("TemplateOnly_Updated_Package", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
///<umbPackage>
|
||||
@@ -136,5 +216,32 @@ namespace Umbraco.Tests.Services.Importing {
|
||||
return ResourceManager.GetString("uBlogsy_Package", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
///<umbPackage>
|
||||
/// <files>
|
||||
/// <file>
|
||||
/// <guid>XSLTsearch.xslt</guid>
|
||||
/// <orgPath>/xslt</orgPath>
|
||||
/// <orgName>XSLTsearch.xslt</orgName>
|
||||
/// </file>
|
||||
/// <file>
|
||||
/// <guid>XSLTsearch.cs</guid>
|
||||
/// <orgPath>/App_Code</orgPath>
|
||||
/// <orgName>XSLTsearch.cs</orgName>
|
||||
/// </file>
|
||||
/// </files>
|
||||
/// <info>
|
||||
/// <package>
|
||||
/// <name>XSLTsearch</name>
|
||||
/// <version>3.0.4</version>
|
||||
/// <license url="http://www.opensource.org/licenses/mit-li [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string XsltSearch_Package {
|
||||
get {
|
||||
return ResourceManager.GetString("XsltSearch_Package", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,4 +127,16 @@
|
||||
<data name="uBlogsy_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>ublogsy-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="XsltSearch_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>xsltsearch-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="SingleDocType" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>singledoctype.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="TemplateOnly_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>templateonly-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="TemplateOnly_Updated_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>templateonly-updated-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -188,5 +188,88 @@ namespace Umbraco.Tests.Services.Importing
|
||||
Assert.That(contents.Any(), Is.True);
|
||||
Assert.That(contents.Count(), Is.EqualTo(numberOfDocs));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PackagingService_Can_Import_Templates_Package_Xml_With_Invalid_Master()
|
||||
{
|
||||
// Arrange
|
||||
string strXml = ImportResources.XsltSearch_Package;
|
||||
var xml = XElement.Parse(strXml);
|
||||
var templateElement = xml.Descendants("Templates").First();
|
||||
var packagingService = ServiceContext.PackagingService;
|
||||
|
||||
// Act
|
||||
var templates = packagingService.ImportTemplates(templateElement);
|
||||
var numberOfTemplates = (from doc in templateElement.Elements("Template") select doc).Count();
|
||||
|
||||
// Assert
|
||||
Assert.That(templates.Any(), Is.True);
|
||||
Assert.That(templates.Count(), Is.EqualTo(numberOfTemplates));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PackagingService_Can_Import_Single_DocType()
|
||||
{
|
||||
// Arrange
|
||||
string strXml = ImportResources.SingleDocType;
|
||||
var docTypeElement = XElement.Parse(strXml);
|
||||
var packagingService = ServiceContext.PackagingService;
|
||||
|
||||
// Act
|
||||
var contentTypes = packagingService.ImportContentTypes(docTypeElement);
|
||||
|
||||
// Assert
|
||||
Assert.That(contentTypes.Any(), Is.True);
|
||||
Assert.That(contentTypes.Any(x => x.HasIdentity == false), Is.False);
|
||||
Assert.That(contentTypes.Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PackagingService_Can_ReImport_Single_DocType()
|
||||
{
|
||||
// Arrange
|
||||
string strXml = ImportResources.SingleDocType;
|
||||
var docTypeElement = XElement.Parse(strXml);
|
||||
|
||||
// Act
|
||||
var contentTypes = ServiceContext.PackagingService.ImportContentTypes(docTypeElement);
|
||||
var contentTypesUpdated = ServiceContext.PackagingService.ImportContentTypes(docTypeElement);
|
||||
|
||||
// Assert
|
||||
Assert.That(contentTypes.Any(), Is.True);
|
||||
Assert.That(contentTypes.Any(x => x.HasIdentity == false), Is.False);
|
||||
Assert.That(contentTypes.Count(), Is.EqualTo(1));
|
||||
Assert.That(contentTypes.First().AllowedContentTypes.Count(), Is.EqualTo(1));
|
||||
|
||||
Assert.That(contentTypesUpdated.Any(), Is.True);
|
||||
Assert.That(contentTypesUpdated.Any(x => x.HasIdentity == false), Is.False);
|
||||
Assert.That(contentTypesUpdated.Count(), Is.EqualTo(1));
|
||||
Assert.That(contentTypesUpdated.First().AllowedContentTypes.Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PackagingService_Can_ReImport_Templates_To_Update()
|
||||
{
|
||||
var newPackageXml = XElement.Parse(ImportResources.TemplateOnly_Package);
|
||||
var updatedPackageXml = XElement.Parse(ImportResources.TemplateOnly_Updated_Package);
|
||||
|
||||
var templateElement = newPackageXml.Descendants("Templates").First();
|
||||
var templateElementUpdated = updatedPackageXml.Descendants("Templates").First();
|
||||
var packagingService = ServiceContext.PackagingService;
|
||||
var fileService = ServiceContext.FileService;
|
||||
|
||||
// Act
|
||||
var numberOfTemplates = (from doc in templateElement.Elements("Template") select doc).Count();
|
||||
var templates = packagingService.ImportTemplates(templateElement);
|
||||
var templatesAfterUpdate = packagingService.ImportTemplates(templateElementUpdated);
|
||||
var allTemplates = fileService.GetTemplates();
|
||||
|
||||
// Assert
|
||||
Assert.That(templates.Any(), Is.True);
|
||||
Assert.That(templates.Count(), Is.EqualTo(numberOfTemplates));
|
||||
Assert.That(templatesAfterUpdate.Count(), Is.EqualTo(numberOfTemplates));
|
||||
Assert.That(allTemplates.Count(), Is.EqualTo(numberOfTemplates));
|
||||
Assert.That(allTemplates.First(x => x.Alias == "umbHomepage").Content, Contains.Substring("THIS HAS BEEN UPDATED!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<DocumentType>
|
||||
<Info>
|
||||
<Name>test</Name>
|
||||
<Alias>test</Alias>
|
||||
<Icon>folder.gif</Icon>
|
||||
<Thumbnail>folder.png</Thumbnail>
|
||||
<Description>
|
||||
</Description>
|
||||
<AllowAtRoot>False</AllowAtRoot>
|
||||
<AllowedTemplates>
|
||||
<Template>test</Template>
|
||||
</AllowedTemplates>
|
||||
<DefaultTemplate>test</DefaultTemplate>
|
||||
</Info>
|
||||
<Structure>
|
||||
<DocumentType>test</DocumentType>
|
||||
</Structure>
|
||||
<GenericProperties>
|
||||
<GenericProperty>
|
||||
<Name>test</Name>
|
||||
<Alias>test</Alias>
|
||||
<Type>b4471851-82b6-4c75-afa4-39fa9c6a75e9</Type>
|
||||
<Definition>fbaf13a8-4036-41f2-93a3-974f678c312a</Definition>
|
||||
<Tab>
|
||||
</Tab>
|
||||
<Mandatory>False</Mandatory>
|
||||
<Validation>
|
||||
</Validation>
|
||||
<Description><![CDATA[]]></Description>
|
||||
</GenericProperty>
|
||||
</GenericProperties>
|
||||
<Tabs />
|
||||
</DocumentType>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<umbPackage>
|
||||
<files />
|
||||
<info>
|
||||
<package>
|
||||
<name>Template-Update</name>
|
||||
<version>0.1</version>
|
||||
<license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
|
||||
<url>http://our.umbraco.org/projects</url>
|
||||
<requirements>
|
||||
<major>3</major>
|
||||
<minor>0</minor>
|
||||
<patch>0</patch>
|
||||
</requirements>
|
||||
</package>
|
||||
<author>
|
||||
<name>Morten Christensen</name>
|
||||
<website>http://blog.sitereactor.dk</website>
|
||||
</author>
|
||||
<readme><![CDATA[]]></readme>
|
||||
</info>
|
||||
<DocumentTypes />
|
||||
<Templates>
|
||||
<Template>
|
||||
<Name>Homepage</Name>
|
||||
<Alias>umbHomepage</Alias>
|
||||
<Master>umbMaster</Master>
|
||||
<Design>
|
||||
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
|
||||
<asp:content id="Content1" contentplaceholderid="cp_content" runat="server">
|
||||
<div id="skinHeader" class="clearfix">
|
||||
<h1>
|
||||
don't panic<br>
|
||||
just yet*
|
||||
</h1>
|
||||
<p>
|
||||
*<br>
|
||||
Most of the time ghosts are friendly and there is really no need to panic.
|
||||
Ghosts are lost souls looking to be released and pass on to whatever
|
||||
heaven they attend (depending on religion).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="content" class="frontPage">
|
||||
<umbraco:item id="Item1" runat="server" field="bodyText"></umbraco:item>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:content>]]>
|
||||
</Design>
|
||||
</Template>
|
||||
<Template>
|
||||
<Name>Textpage</Name>
|
||||
<Alias>umbTextpage</Alias>
|
||||
<Master>umbMaster</Master>
|
||||
<Design>
|
||||
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="cp_top" runat="server">
|
||||
<div id="top">
|
||||
<div id="topInner">
|
||||
<h1 id="siteName"><a href="/"><umbraco:Item runat="server" field="siteName" recursive="true" /></a></h1>
|
||||
<h2 id="siteDescription"><umbraco:Item runat="server" field="siteDescription" recursive="true" /></h2>
|
||||
</div>
|
||||
<div id="naviWrap">
|
||||
<umbraco:Macro ID="Macro1" Alias="umbTopNavigation" runat="server" />
|
||||
</div>
|
||||
<div id="subNavigation">
|
||||
<umbraco:Macro ID="Macro2" Alias="umb2ndLevelNavigation" runat="server"></umbraco:Macro>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="cp_content" runat="server">
|
||||
<div id="content" class="textpage">
|
||||
<div id="contentHeader">
|
||||
<h2><umbraco:Item runat="server" field="pageName"/></h2>
|
||||
</div>
|
||||
<umbraco:Item runat="server" field="bodyText" />
|
||||
</div>
|
||||
</asp:Content>]]>
|
||||
</Design>
|
||||
</Template>
|
||||
</Templates>
|
||||
<Stylesheets />
|
||||
<Macros />
|
||||
<DictionaryItems />
|
||||
<Languages />
|
||||
<DataTypes />
|
||||
</umbPackage>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<umbPackage>
|
||||
<files />
|
||||
<info>
|
||||
<package>
|
||||
<name>Template-Update</name>
|
||||
<version>0.1</version>
|
||||
<license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
|
||||
<url>http://our.umbraco.org/projects</url>
|
||||
<requirements>
|
||||
<major>3</major>
|
||||
<minor>0</minor>
|
||||
<patch>0</patch>
|
||||
</requirements>
|
||||
</package>
|
||||
<author>
|
||||
<name>Morten Christensen</name>
|
||||
<website>http://blog.sitereactor.dk</website>
|
||||
</author>
|
||||
<readme><![CDATA[]]></readme>
|
||||
</info>
|
||||
<DocumentTypes />
|
||||
<Templates>
|
||||
<Template>
|
||||
<Name>Homepage</Name>
|
||||
<Alias>umbHomepage</Alias>
|
||||
<Master>umbMaster</Master>
|
||||
<Design>
|
||||
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
|
||||
<asp:content id="Content1" contentplaceholderid="cp_content" runat="server">
|
||||
<div id="skinHeader" class="clearfix">
|
||||
<h1> THIS HAS BEEN UPDATED! </h1>
|
||||
<p>
|
||||
*<br>
|
||||
Most of the time ghosts are friendly and there is really no need to panic.
|
||||
Ghosts are lost souls looking to be released and pass on to whatever
|
||||
heaven they attend (depending on religion).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="content" class="frontPage">
|
||||
<umbraco:item id="Item1" runat="server" field="bodyText"></umbraco:item>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:content>]]>
|
||||
</Design>
|
||||
</Template>
|
||||
<Template>
|
||||
<Name>Textpage</Name>
|
||||
<Alias>umbTextpage</Alias>
|
||||
<Master>umbMaster</Master>
|
||||
<Design>
|
||||
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="cp_top" runat="server">
|
||||
<div id="top">
|
||||
<div id="topInner">
|
||||
<h1 id="siteName"><a href="/"><umbraco:Item runat="server" field="siteName" recursive="true" /></a></h1>
|
||||
<h2 id="siteDescription"><umbraco:Item runat="server" field="siteDescription" recursive="true" /></h2>
|
||||
</div>
|
||||
<div id="naviWrap">
|
||||
<umbraco:Macro ID="Macro1" Alias="umbTopNavigation" runat="server" />
|
||||
</div>
|
||||
<div id="subNavigation">
|
||||
<umbraco:Macro ID="Macro2" Alias="umb2ndLevelNavigation" runat="server"></umbraco:Macro>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="cp_content" runat="server">
|
||||
<div id="content" class="textpage">
|
||||
<div id="contentHeader">
|
||||
<h2><umbraco:Item runat="server" field="pageName"/></h2>
|
||||
</div>
|
||||
<umbraco:Item runat="server" field="bodyText" />
|
||||
</div>
|
||||
</asp:Content>]]>
|
||||
</Design>
|
||||
</Template>
|
||||
</Templates>
|
||||
<Stylesheets />
|
||||
<Macros />
|
||||
<DictionaryItems />
|
||||
<Languages />
|
||||
<DataTypes />
|
||||
</umbPackage>
|
||||
@@ -0,0 +1,254 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<umbPackage>
|
||||
<files>
|
||||
<file>
|
||||
<guid>XSLTsearch.xslt</guid>
|
||||
<orgPath>/xslt</orgPath>
|
||||
<orgName>XSLTsearch.xslt</orgName>
|
||||
</file>
|
||||
<file>
|
||||
<guid>XSLTsearch.cs</guid>
|
||||
<orgPath>/App_Code</orgPath>
|
||||
<orgName>XSLTsearch.cs</orgName>
|
||||
</file>
|
||||
</files>
|
||||
<info>
|
||||
<package>
|
||||
<name>XSLTsearch</name>
|
||||
<version>3.0.4</version>
|
||||
<license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
|
||||
<url>http://www.percipientstudios.com</url>
|
||||
<requirements>
|
||||
<major>3</major>
|
||||
<minor>0</minor>
|
||||
<patch>0</patch>
|
||||
</requirements>
|
||||
</package>
|
||||
<author>
|
||||
<name>Percipient Studios</name>
|
||||
<website>http://www.percipientstudios.com</website>
|
||||
</author>
|
||||
<readme>
|
||||
<![CDATA[XSLTsearch is the easy search solution for Umbraco web sites with up to a few thousand pages. It is fast, completely self-contained, and extremely configurable.
|
||||
|
||||
With XSLTsearch you can search for all words and phrases in all document properties and attributes, including your custom properties. Search results are automatically sorted by relevance with search terms highlighted in the results.
|
||||
|
||||
XSLTsearch installs in all Umbraco sites.
|
||||
|
||||
New in 3.0:
|
||||
- Multi-lingual support with dictionary items
|
||||
- Medium trust support (helper functions now in /app_code/xsltsearch.cs)
|
||||
- Many bug fixes
|
||||
|
||||
Version 3.0.1
|
||||
- For umbraco 4.5+ and new XML schema
|
||||
- Fixed xslt error when a previewed field had fewer than six characters
|
||||
- Changed default behavior to only search within current site if source node id is not specified (better for multiple sites in one installation)
|
||||
- Multi-site searching made easier. Now searches only within the current site if the source= parameter is not specified (better for multiple sites in one installation)
|
||||
|
||||
Version 3.0.2
|
||||
- Fixed issue of PreviewMode="CONTEXT" in which the search term would not be highlighted if it were the last word in the content being searched
|
||||
|
||||
Version 3.0.3
|
||||
- Removed extraneous whitespace and empty quotes from search term
|
||||
|
||||
Version 3.0.4
|
||||
- Additional fix for PreviewMode="CONTEXT" in which the search term would not be displayed if it were the last word in the content being search and the search term were more than $maxChars from the beginning of the search field
|
||||
- Removed errant 'xmp' debug statement that appeared in v3.0.3
|
||||
]]>
|
||||
</readme>
|
||||
</info>
|
||||
<Documents>
|
||||
<DocumentSet importMode="root">
|
||||
<XSLTsearch id="1090" parentID="-1" level="1" writerID="0" creatorID="0" nodeType="1087" template="1086" sortOrder="39" createDate="2010-11-09T13:45:22" updateDate="2010-11-09T14:18:04" nodeName="Search" urlName="search" writerName="Administrator" creatorName="Administrator" path="-1,1090" isDoc="">
|
||||
<umbracoNaviHide>0</umbracoNaviHide>
|
||||
</XSLTsearch>
|
||||
</DocumentSet>
|
||||
</Documents>
|
||||
<DocumentTypes>
|
||||
<DocumentType>
|
||||
<Info>
|
||||
<Name>XSLTsearch</Name>
|
||||
<Alias>XSLTsearch</Alias>
|
||||
<Icon>.sprTreeDoc2</Icon>
|
||||
<Thumbnail>doc.png</Thumbnail>
|
||||
<Description>
|
||||
XSLTsearch page.
|
||||
(adjust settings via the macro in the XSLTsearch template)
|
||||
</Description>
|
||||
<AllowedTemplates>
|
||||
<Template>XSLTsearch</Template>
|
||||
</AllowedTemplates>
|
||||
<DefaultTemplate>XSLTsearch</DefaultTemplate>
|
||||
</Info>
|
||||
<Structure />
|
||||
<GenericProperties>
|
||||
<GenericProperty>
|
||||
<Name>Hide in navigation</Name>
|
||||
<Alias>umbracoNaviHide</Alias>
|
||||
<Type>38b352c1-e9f8-4fd8-9324-9a2eab06d97a</Type>
|
||||
<Definition>92897bc6-a5f3-4ffe-ae27-f2e7e33dda49</Definition>
|
||||
<Tab>
|
||||
</Tab>
|
||||
<Mandatory>False</Mandatory>
|
||||
<Validation>
|
||||
</Validation>
|
||||
<Description><![CDATA[]]></Description>
|
||||
</GenericProperty>
|
||||
</GenericProperties>
|
||||
<Tabs />
|
||||
</DocumentType>
|
||||
</DocumentTypes>
|
||||
<Templates>
|
||||
<Template>
|
||||
<Name>XSLTsearch</Name>
|
||||
<Alias>XSLTsearch</Alias>
|
||||
<Master>RunwayMaster</Master>
|
||||
<Design>
|
||||
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/RunwayMaster.master" AutoEventWireup="true" %>
|
||||
|
||||
|
||||
<asp:Content ContentPlaceHolderId="RunwayMasterContentPlaceHolder" runat="server">
|
||||
<div id="content">
|
||||
<div id="contentHeader">
|
||||
<h2><umbraco:Item runat="server" field="pageName"/></h2>
|
||||
</div>
|
||||
|
||||
<umbraco:Macro runat="server" Alias="XSLTsearch"
|
||||
macroAlias="XSLTsearch"
|
||||
source="-1"
|
||||
searchFields="@nodeName,metaKeywords,metaDescription,bodyText"
|
||||
previewFields="bodyText,metaDescription"
|
||||
previewType="beginning"
|
||||
searchBoxLocation="bottom"
|
||||
resultsPerPage="5"
|
||||
previewChars="255"
|
||||
showPageRange="0"
|
||||
showOrdinals="0"
|
||||
showScores="0"
|
||||
showStats="1">
|
||||
</umbraco:Macro>
|
||||
|
||||
</div>
|
||||
</asp:Content>]]>
|
||||
</Design>
|
||||
</Template>
|
||||
</Templates>
|
||||
<Stylesheets>
|
||||
<Stylesheet>
|
||||
<Name>XSLTsearch</Name>
|
||||
<FileName>
|
||||
</FileName>
|
||||
<Content>
|
||||
<![CDATA[#xsltsearch {margin: 0; padding-bottom: 20px;}
|
||||
#xsltsearch_navigation {text-align: center;}
|
||||
#xsltsearch_navigation .disabled {color: #AAA;}
|
||||
#xsltsearch_stats {font-size: 75%; color: #999;}
|
||||
#xsltsearch_results {padding-bottom: 20px;}
|
||||
#xsltsearch h2 {font-size: 150%;}
|
||||
.xsltsearch_result p {margin: 0; padding: 0;}
|
||||
.xsltsearch_result:hover {background: #fafafa;}
|
||||
.xsltsearch_ordinal {font-weight: bold; font-size: 75%;}
|
||||
.xsltsearch_title {font-weight: bold;}
|
||||
.xsltsearch_score {font-size: 75%;}
|
||||
p.xsltsearch_result_description {padding-bottom: 10px;}
|
||||
.xsltsearch_description strong {background: #FFD;} /* highlighting */
|
||||
]]>
|
||||
</Content>
|
||||
</Stylesheet>
|
||||
</Stylesheets>
|
||||
<Macros>
|
||||
<macro>
|
||||
<name>XSLTsearch</name>
|
||||
<alias>XSLTsearch</alias>
|
||||
<scriptType>
|
||||
</scriptType>
|
||||
<scriptAssembly>
|
||||
</scriptAssembly>
|
||||
<xslt>XSLTsearch.xslt</xslt>
|
||||
<useInEditor>False</useInEditor>
|
||||
<refreshRate>0</refreshRate>
|
||||
<scriptingFile>
|
||||
</scriptingFile>
|
||||
<properties>
|
||||
<property name="Source" alias="source" show="True" propertyType="contentTree" />
|
||||
<property name="Umbraco fields to search" alias="searchFields" show="True" propertyType="text" />
|
||||
<property name="Umbraco fields shown in results preview" alias="previewFields" show="True" propertyType="text" />
|
||||
<property name="Display search box at TOP, BOTTOM, BOTH, or NONE" alias="searchBoxLocation" show="True" propertyType="text" />
|
||||
<property name="Display BEGINNING or CONTEXT of each result" alias="previewType" show="True" propertyType="text" />
|
||||
<property name="Number of search results to display per page" alias="resultsPerPage" show="True" propertyType="number" />
|
||||
<property name="Number of characters of preview text to display" alias="previewChars" show="True" propertyType="number" />
|
||||
<property name="Display 'Showing result X to Y'?" alias="showPageRange" show="True" propertyType="bool" />
|
||||
<property name="Display numbers before each result?" alias="showOrdinals" show="True" propertyType="bool" />
|
||||
<property name="Display search score for each result?" alias="showScores" show="True" propertyType="bool" />
|
||||
<property name="Display 'Searched X documents in Y seconds'?" alias="showStats" show="True" propertyType="bool" />
|
||||
</properties>
|
||||
</macro>
|
||||
</Macros>
|
||||
<DictionaryItems>
|
||||
<DictionaryItem Key="XSLTsearch">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[]]></Value>
|
||||
<DictionaryItem Key="[XSLTsearch]Button-Search">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Search]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Description-Context">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Context]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Description-ContextUnavailable">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[unavailable]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Heading-SearchResults">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Search Results]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Navigation-Next">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Next]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Navigation-Previous">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Previous]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]PageRange-ShowingResults">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Showing results]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]PageRange-To">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[to]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Score-Score">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[score]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Stats-PagesIn">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[pages in]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Stats-Searched">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Searched]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Stats-Seconds">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[seconds]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Summary-Matches">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[matches]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Summary-NoMatchesWereFoundFor">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[No matches were found for]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Summary-Page">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[page]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Summary-Pages">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[pages]]></Value>
|
||||
</DictionaryItem>
|
||||
<DictionaryItem Key="[XSLTsearch]Summary-YourSearchFor">
|
||||
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Your search for]]></Value>
|
||||
</DictionaryItem>
|
||||
</DictionaryItem>
|
||||
</DictionaryItems>
|
||||
<Languages>
|
||||
<Language Id="2" CultureAlias="en-US" FriendlyName="English (United States)" />
|
||||
</Languages>
|
||||
<DataTypes />
|
||||
<Actions>
|
||||
<Action runat="install" alias="addStringToHtmlElement" templateAlias="RunwayMaster" htmlElementId="head" position="end"><![CDATA[ <link rel="stylesheet" type="text/css" href="/css/XSLTsearch.css" />]]></Action>
|
||||
<Action runat="install" alias="publishRootDocument" documentName="Search" />
|
||||
<Action runat="install" alias="allowDocumenttype" documentTypeAlias="XSLTsearch" parentDocumentTypeAlias="RunwayHomepage" />
|
||||
<Action runat="install" alias="moveRootDocument" documentName="Search" parentDocumentType="RunwayHomepage" />
|
||||
</Actions>
|
||||
</umbPackage>
|
||||
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Dynamic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Web.Management;
|
||||
using NUnit.Framework;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Firefox;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.Migrations.Initial;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Tests.TestHelpers
|
||||
{
|
||||
public class BaseSeleniumTest
|
||||
{
|
||||
internal IWebDriver Driver;
|
||||
internal string BaseUrl;
|
||||
|
||||
private StringBuilder _verificationErrors;
|
||||
private UmbracoDatabase _database;
|
||||
|
||||
protected ApplicationContext ApplicationContext
|
||||
{
|
||||
get { return ApplicationContext.Current; }
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public virtual void Initialize()
|
||||
{
|
||||
|
||||
// Disable medium trust
|
||||
var transform = TransformWebConfig("Release");
|
||||
|
||||
var assemblyPath = TestHelper.CurrentAssemblyDirectory;
|
||||
assemblyPath = Path.Combine(assemblyPath, @"..\..\..\Umbraco.Web.UI\");
|
||||
var webUiPath = Path.GetFullPath(new Uri(assemblyPath).LocalPath);
|
||||
|
||||
var installedPackagesConfig = string.Format("{0}App_Data\\packages\\installed\\installedPackages.config", webUiPath);
|
||||
if (File.Exists(installedPackagesConfig))
|
||||
File.Delete(installedPackagesConfig);
|
||||
|
||||
var databaseDataPath = string.Format(@"{0}\App_Data\Umbraco.sdf", webUiPath);
|
||||
var connectionString = string.Format(@"Data Source={0}", databaseDataPath);
|
||||
|
||||
//Create the Sql CE database
|
||||
var engine = new SqlCeEngine(connectionString);
|
||||
if (File.Exists(databaseDataPath) == false)
|
||||
engine.CreateDatabase();
|
||||
|
||||
SqlSyntaxContext.SqlSyntaxProvider = new SqlCeSyntaxProvider();
|
||||
|
||||
_database = new UmbracoDatabase(connectionString, "System.Data.SqlServerCe.4.0");
|
||||
|
||||
// First remove anything in the database
|
||||
var creation = new DatabaseSchemaCreation(_database);
|
||||
creation.UninstallDatabaseSchema();
|
||||
|
||||
// Then populate it with fresh data
|
||||
_database.CreateDatabaseSchema(false);
|
||||
|
||||
_database.Execute("UPDATE umbracoUser SET userName = 'admin', userPassword = 'W477AMlLwwJQeAGlPZKiEILr8TA=', userEmail = 'none' WHERE id = 0"); // password: test
|
||||
|
||||
// Recycle app pool so the new user can log in
|
||||
//var webConfigFilePath = string.Format(@"{0}\web.config", webUiPath);
|
||||
//File.SetLastWriteTime(webConfigFilePath, DateTime.Now);
|
||||
|
||||
// Disable medium trust
|
||||
transform = TransformWebConfig("Release");
|
||||
|
||||
Driver = new FirefoxDriver();
|
||||
BaseUrl = "http://localhost:61639/";
|
||||
_verificationErrors = new StringBuilder();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
try
|
||||
{
|
||||
Driver.Quit();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore errors if unable to close the browser
|
||||
}
|
||||
|
||||
// Re-enable medium trust
|
||||
var transform = TransformWebConfig("Debug");
|
||||
|
||||
Assert.AreEqual("", _verificationErrors.ToString());
|
||||
}
|
||||
|
||||
private static string TransformWebConfig(string configurationToUse)
|
||||
{
|
||||
var assemblyPath = TestHelper.CurrentAssemblyDirectory;
|
||||
var toolsPath = Path.Combine(assemblyPath, @"..\..\..\..\tools\ConfigTransformTool\");
|
||||
var webUiPath = Path.GetFullPath(new Uri(Path.Combine(assemblyPath, @"..\..\..\Umbraco.Web.UI\")).LocalPath);
|
||||
|
||||
var fileToTransform = webUiPath + "web.config";
|
||||
var transformFile = string.Format("{0}web.Template.{1}.config", webUiPath, configurationToUse);
|
||||
|
||||
var psi = new ProcessStartInfo(string.Format("{0}ctt.exe", toolsPath), string.Format("s:\"{0}\" t:\"{1}\" d:\"{2}\" pw v", fileToTransform, transformFile, fileToTransform))
|
||||
{
|
||||
WorkingDirectory = Environment.CurrentDirectory,
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
CreateNoWindow = true
|
||||
};
|
||||
|
||||
string[] result = {string.Empty};
|
||||
using (var process = new Process { StartInfo = psi })
|
||||
{
|
||||
// delegate for writing the process output to the response output
|
||||
Action<Object, DataReceivedEventArgs> dataReceived = ((sender, e) =>
|
||||
{
|
||||
if (e.Data != null) // sometimes a random event is received with null data, not sure why - I prefer to leave it out
|
||||
{
|
||||
result[0] += e.Data;
|
||||
result[0] += "\r\n";
|
||||
}
|
||||
});
|
||||
|
||||
process.OutputDataReceived += new DataReceivedEventHandler(dataReceived);
|
||||
process.ErrorDataReceived += new DataReceivedEventHandler(dataReceived);
|
||||
|
||||
// start the process and start reading the standard and error outputs
|
||||
process.Start();
|
||||
process.BeginErrorReadLine();
|
||||
process.BeginOutputReadLine();
|
||||
|
||||
// wait for the process to exit
|
||||
process.WaitForExit();
|
||||
|
||||
// an exit code other than 0 generally means an error
|
||||
if (process.ExitCode != 0)
|
||||
{
|
||||
result[0] = result[0] + "\r\n - Exited with exitcode " + process.ExitCode;
|
||||
}
|
||||
}
|
||||
|
||||
return result[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,8 @@ namespace Umbraco.Tests.TestHelpers
|
||||
{
|
||||
if (RequiresDbSetup)
|
||||
base.InitializeDatabase();
|
||||
//init the singleton too!
|
||||
ApplicationContext.Current = ApplicationContext;
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
@@ -121,6 +122,9 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoExamine.0.1.42.2941\lib\UmbracoExamine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WebDriver">
|
||||
<HintPath>..\packages\Selenium.WebDriver.2.32.0\lib\net40\WebDriver.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Auditing\AuditTests.cs" />
|
||||
@@ -160,6 +164,9 @@
|
||||
<Compile Include="CodeFirst\TypeInheritanceTest.cs" />
|
||||
<Compile Include="Configurations\FileSystemProviderTests.cs" />
|
||||
<Compile Include="ContentStores\PublishMediaStoreTests.cs" />
|
||||
<Compile Include="Integration\CreateContent.cs" />
|
||||
<Compile Include="TestHelpers\BaseSeleniumTest.cs" />
|
||||
<Compile Include="Integration\InstallPackage.cs" />
|
||||
<Compile Include="LegacyApi\MediaTypeTests.cs" />
|
||||
<Compile Include="Migrations\AlterMigrationTests.cs" />
|
||||
<Compile Include="Migrations\Upgrades\BaseUpgradeTest.cs" />
|
||||
@@ -178,6 +185,7 @@
|
||||
<Compile Include="Migrations\Upgrades\SqlCeUpgradeTest.cs" />
|
||||
<Compile Include="Migrations\Upgrades\SqlServerUpgradeTest.cs" />
|
||||
<Compile Include="Migrations\Upgrades\ValidateOlderSchemaTest.cs" />
|
||||
<Compile Include="Models\Collections\PropertyCollectionTests.cs" />
|
||||
<Compile Include="Models\MediaXmlTest.cs" />
|
||||
<Compile Include="Persistence\Mappers\MappingResolverTests.cs" />
|
||||
<Compile Include="Persistence\Querying\ContentRepositorySqlClausesTest.cs" />
|
||||
@@ -325,6 +333,7 @@
|
||||
<Compile Include="TestHelpers\FakeHttpContextFactory.cs" />
|
||||
<Compile Include="TypeFinderTests.cs" />
|
||||
<Compile Include="Routing\UmbracoModuleTests.cs" />
|
||||
<Compile Include="XmlHelperTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config">
|
||||
@@ -426,12 +435,17 @@
|
||||
<Content Include="Migrations\SqlScripts\SqlCeTotal-480.sql" />
|
||||
<Content Include="Migrations\SqlScripts\SqlServerTotal-480.sql" />
|
||||
<Content Include="Services\Importing\InheritedDocTypes-Package.xml" />
|
||||
<Content Include="Services\Importing\SingleDocType.xml" />
|
||||
<Content Include="Services\Importing\StandardMvc-Package.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Services\Importing\TemplateOnly-Package.xml" />
|
||||
<Content Include="Services\Importing\TemplateOnly-Updated-Package.xml" />
|
||||
<Content Include="Services\Importing\uBlogsy-Package.xml" />
|
||||
<Content Include="Services\Importing\XsltSearch-Package.xml" />
|
||||
<Content Include="TestHelpers\ExamineHelpers\media.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /D
|
||||
|
||||
@@ -0,0 +1,279 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using umbraco;
|
||||
|
||||
namespace Umbraco.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class XmlHelperTests
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
TestHelper.SetupLog4NetForTests();
|
||||
}
|
||||
|
||||
[Ignore("This is a benchmark test so is ignored by default")]
|
||||
[Test]
|
||||
public void Sort_Nodes_Benchmark_Legacy()
|
||||
{
|
||||
var xmlContent = GetXmlContent(1);
|
||||
var xml = new XmlDocument();
|
||||
xml.LoadXml(xmlContent);
|
||||
var original = xml.GetElementById(1173.ToString());
|
||||
Assert.IsNotNull(original);
|
||||
|
||||
long totalTime = 0;
|
||||
var watch = new Stopwatch();
|
||||
var iterations = 10000;
|
||||
|
||||
for (var i = 0; i < iterations; i++)
|
||||
{
|
||||
//don't measure the time for clone!
|
||||
var parentNode = original.Clone();
|
||||
watch.Start();
|
||||
LegacySortNodes(ref parentNode);
|
||||
watch.Stop();
|
||||
totalTime += watch.ElapsedMilliseconds;
|
||||
watch.Reset();
|
||||
|
||||
//do assertions just to make sure it is working properly.
|
||||
var currSort = 0;
|
||||
foreach (var child in parentNode.SelectNodes("./* [@id]").Cast<XmlNode>())
|
||||
{
|
||||
Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value));
|
||||
currSort++;
|
||||
}
|
||||
|
||||
//ensure the parent node's properties still exist first
|
||||
Assert.AreEqual("content", parentNode.ChildNodes[0].Name);
|
||||
Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name);
|
||||
//then the child nodes should come straight after
|
||||
Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null);
|
||||
}
|
||||
|
||||
Debug.WriteLine("Total time for " + iterations + " iterations is " + totalTime);
|
||||
}
|
||||
|
||||
[Ignore("This is a benchmark test so is ignored by default")]
|
||||
[Test]
|
||||
public void Sort_Nodes_Benchmark_New()
|
||||
{
|
||||
var xmlContent = GetXmlContent(1);
|
||||
var xml = new XmlDocument();
|
||||
xml.LoadXml(xmlContent);
|
||||
var original = xml.GetElementById(1173.ToString());
|
||||
Assert.IsNotNull(original);
|
||||
|
||||
long totalTime = 0;
|
||||
var watch = new Stopwatch();
|
||||
var iterations = 10000;
|
||||
|
||||
for (var i = 0; i < iterations; i++)
|
||||
{
|
||||
//don't measure the time for clone!
|
||||
var parentNode = (XmlElement)original.Clone();
|
||||
watch.Start();
|
||||
XmlHelper.SortNodes(
|
||||
parentNode,
|
||||
"./* [@id]",
|
||||
element => element.Attribute("id") != null,
|
||||
element => element.AttributeValue<int>("sortOrder"));
|
||||
watch.Stop();
|
||||
totalTime += watch.ElapsedMilliseconds;
|
||||
watch.Reset();
|
||||
|
||||
//do assertions just to make sure it is working properly.
|
||||
var currSort = 0;
|
||||
foreach (var child in parentNode.SelectNodes("./* [@id]").Cast<XmlNode>())
|
||||
{
|
||||
Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value));
|
||||
currSort++;
|
||||
}
|
||||
//ensure the parent node's properties still exist first
|
||||
Assert.AreEqual("content", parentNode.ChildNodes[0].Name);
|
||||
Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name);
|
||||
//then the child nodes should come straight after
|
||||
Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null);
|
||||
|
||||
}
|
||||
|
||||
Debug.WriteLine("Total time for " + iterations + " iterations is " + totalTime);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void Sort_Nodes()
|
||||
{
|
||||
var xmlContent = GetXmlContent(1);
|
||||
var xml = new XmlDocument();
|
||||
xml.LoadXml(xmlContent);
|
||||
var original = xml.GetElementById(1173.ToString());
|
||||
Assert.IsNotNull(original);
|
||||
|
||||
var parentNode = (XmlElement)original.Clone();
|
||||
|
||||
XmlHelper.SortNodes(
|
||||
parentNode,
|
||||
"./* [@id]",
|
||||
element => element.Attribute("id") != null,
|
||||
element => element.AttributeValue<int>("sortOrder"));
|
||||
|
||||
//do assertions just to make sure it is working properly.
|
||||
var currSort = 0;
|
||||
foreach (var child in parentNode.SelectNodes("./* [@id]").Cast<XmlNode>())
|
||||
{
|
||||
Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value));
|
||||
currSort++;
|
||||
}
|
||||
//ensure the parent node's properties still exist first
|
||||
Assert.AreEqual("content", parentNode.ChildNodes[0].Name);
|
||||
Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name);
|
||||
//then the child nodes should come straight after
|
||||
Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This was the logic to sort before and now lives here just to show the benchmarks tests above.
|
||||
/// </summary>
|
||||
/// <param name="parentNode"></param>
|
||||
private static void LegacySortNodes(ref XmlNode parentNode)
|
||||
{
|
||||
XmlNode n = parentNode.CloneNode(true);
|
||||
|
||||
// remove all children from original node
|
||||
string xpath = UmbracoSettings.UseLegacyXmlSchema ? "./node" : "./* [@id]";
|
||||
foreach (XmlNode child in parentNode.SelectNodes(xpath))
|
||||
parentNode.RemoveChild(child);
|
||||
|
||||
|
||||
XPathNavigator nav = n.CreateNavigator();
|
||||
XPathExpression expr = nav.Compile(xpath);
|
||||
expr.AddSort("@sortOrder", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number);
|
||||
XPathNodeIterator iterator = nav.Select(expr);
|
||||
while (iterator.MoveNext())
|
||||
parentNode.AppendChild(
|
||||
((IHasXmlNode)iterator.Current).GetNode());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// returns xml with a reverse sort order
|
||||
/// </summary>
|
||||
/// <param name="templateId"></param>
|
||||
/// <returns></returns>
|
||||
private string GetXmlContent(int templateId)
|
||||
{
|
||||
return @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<!DOCTYPE root[
|
||||
<!ELEMENT Home ANY>
|
||||
<!ATTLIST Home id ID #REQUIRED>
|
||||
<!ELEMENT CustomDocument ANY>
|
||||
<!ATTLIST CustomDocument id ID #REQUIRED>
|
||||
]>
|
||||
<root id=""-1"">
|
||||
<Home id=""1046"" parentID=""-1"" level=""1"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""0"" createDate=""2012-06-12T14:13:17"" updateDate=""2012-07-20T18:50:43"" nodeName=""Home"" urlName=""home"" writerName=""admin"" creatorName=""admin"" path=""-1,1046"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
<umbracoUrlAlias><![CDATA[this/is/my/alias, anotheralias]]></umbracoUrlAlias>
|
||||
<umbracoNaviHide>1</umbracoNaviHide>
|
||||
<Home id=""1173"" parentID=""1046"" level=""2"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""0"" createDate=""2012-07-20T18:06:45"" updateDate=""2012-07-20T19:07:31"" nodeName=""Sub1"" urlName=""sub1"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173"" isDoc="""">
|
||||
<content><![CDATA[<div>This is some content</div>]]></content>
|
||||
<umbracoUrlAlias><![CDATA[page2/alias, 2ndpagealias]]></umbracoUrlAlias>
|
||||
<Home id=""1174"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""3"" createDate=""2012-07-20T18:07:54"" updateDate=""2012-07-20T19:10:27"" nodeName=""Sub2"" urlName=""sub2"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1174"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
<umbracoUrlAlias><![CDATA[only/one/alias]]></umbracoUrlAlias>
|
||||
<creatorName><![CDATA[Custom data with same property name as the member name]]></creatorName>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""2"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<CustomDocument id=""1177"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1234"" template=""" + templateId + @""" sortOrder=""1"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-18T14:23:35"" nodeName=""custom sub 1"" urlName=""custom-sub-1"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1177"" isDoc="""" />
|
||||
<CustomDocument id=""1178"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1234"" template=""" + templateId + @""" sortOrder=""0"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-16T14:23:35"" nodeName=""custom sub 2"" urlName=""custom-sub-2"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1178"" isDoc="""" />
|
||||
|
||||
<Home id=""1176"" parentID=""1179"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""26"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1180"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""25"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1181"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""24"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1182"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""23"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1183"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""22"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1184"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""21"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1185"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""20"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1186"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""19"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1187"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""18"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1188"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""17"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1189"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""16"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1190"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""15"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1191"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""14"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1192"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""13"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1193"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""12"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1194"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""11"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1195"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""10"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1196"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""9"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1197"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""8"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1198"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""7"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1199"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""6"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1200"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""5"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
<Home id=""1176"" parentID=""1201"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""4"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
|
||||
<content><![CDATA[]]></content>
|
||||
</Home>
|
||||
</Home>
|
||||
<Home id=""1175"" parentID=""1046"" level=""2"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""1"" createDate=""2012-07-20T18:08:01"" updateDate=""2012-07-20T18:49:32"" nodeName=""Sub 2"" urlName=""sub-2"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1175"" isDoc=""""><content><![CDATA[]]></content>
|
||||
</Home>
|
||||
</Home>
|
||||
<CustomDocument id=""1172"" parentID=""-1"" level=""1"" writerID=""0"" creatorID=""0"" nodeType=""1234"" template=""" + templateId + @""" sortOrder=""1"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-18T14:23:35"" nodeName=""Test"" urlName=""test-page"" writerName=""admin"" creatorName=""admin"" path=""-1,1172"" isDoc="""" />
|
||||
</root>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
|
||||
<package id="NUnit" version="2.6.2" targetFramework="net40" />
|
||||
<package id="RhinoMocks" version="3.6.1" targetFramework="net40" />
|
||||
<package id="Selenium.WebDriver" version="2.32.0" targetFramework="net40" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net40" />
|
||||
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net40" />
|
||||
<package id="UmbracoExamine" version="0.1.42.2941" targetFramework="net40" />
|
||||
|
||||
@@ -260,6 +260,14 @@
|
||||
<DependentUpon>default.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="config\splashes\NoNodes.aspx.cs">
|
||||
<DependentUpon>noNodes.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="config\splashes\NoNodes.aspx.designer.cs">
|
||||
<DependentUpon>noNodes.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Default.aspx.designer.cs">
|
||||
<DependentUpon>default.aspx</DependentUpon>
|
||||
</Compile>
|
||||
@@ -277,6 +285,20 @@
|
||||
<DependentUpon>loadStarterKits.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Umbraco\controls\ContentTypeControlNew.ascx.cs">
|
||||
<DependentUpon>ContentTypeControlNew.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\controls\ContentTypeControlNew.ascx.designer.cs">
|
||||
<DependentUpon>ContentTypeControlNew.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\Create.aspx.cs">
|
||||
<DependentUpon>create.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\Create.aspx.designer.cs">
|
||||
<DependentUpon>create.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\Create\PartialViewMacro.ascx.cs">
|
||||
<DependentUpon>PartialViewMacro.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -291,7 +313,14 @@
|
||||
<Compile Include="Umbraco\Developer\Macros\EditMacro.aspx.designer.cs">
|
||||
<DependentUpon>editMacro.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\Developer\Packages\StarterKits.aspx.cs">
|
||||
<Compile Include="Umbraco\developer\Packages\DirectoryBrowser.aspx.cs">
|
||||
<DependentUpon>directoryBrowser.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\developer\Packages\DirectoryBrowser.aspx.designer.cs">
|
||||
<DependentUpon>directoryBrowser.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\developer\Packages\StarterKits.aspx.cs">
|
||||
<DependentUpon>StarterKits.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
@@ -302,6 +331,14 @@
|
||||
<DependentUpon>EditMacro.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\dialogs\Sort.aspx.cs">
|
||||
<DependentUpon>sort.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\dialogs\Sort.aspx.designer.cs">
|
||||
<DependentUpon>sort.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\Dialogs\EditMacro.aspx.designer.cs">
|
||||
<DependentUpon>EditMacro.aspx</DependentUpon>
|
||||
</Compile>
|
||||
@@ -324,6 +361,13 @@
|
||||
<Compile Include="Umbraco\Search\QuickSearch.ascx.designer.cs">
|
||||
<DependentUpon>QuickSearch.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\settings\EditNodeTypeNew.aspx.cs">
|
||||
<DependentUpon>EditNodeTypeNew.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\settings\EditNodeTypeNew.aspx.designer.cs">
|
||||
<DependentUpon>EditNodeTypeNew.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Umbraco\Settings\EditTemplate.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
@@ -383,6 +427,7 @@
|
||||
</None>
|
||||
<None Include="Config\umbracoSettings.Release.config">
|
||||
<DependentUpon>umbracoSettings.config</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Config\trees.Release.config">
|
||||
<DependentUpon>trees.config</DependentUpon>
|
||||
@@ -427,8 +472,10 @@
|
||||
<Content Include="Umbraco\Config\Lang\ru.xml" />
|
||||
<Content Include="Umbraco\Config\Lang\zh.xml" />
|
||||
<Content Include="Umbraco\Controls\Tree\CustomTreeService.asmx" />
|
||||
<Content Include="Umbraco\create.aspx" />
|
||||
<Content Include="Umbraco\Create\PartialViewMacro.ascx" />
|
||||
<Content Include="Umbraco\Dashboard\Images\access-denied.png" />
|
||||
<Content Include="Umbraco\developer\Packages\directoryBrowser.aspx" />
|
||||
<Content Include="Umbraco\Dashboard\Scripts\swfobject.js" />
|
||||
<Content Include="Umbraco\Dashboard\MediaDashboardFolderBrowser.ascx" />
|
||||
<Content Include="Umbraco\Developer\RelationTypes\EditRelationType.aspx" />
|
||||
@@ -639,8 +686,11 @@
|
||||
<Content Include="Umbraco_Client\CodeMirror\Js\Theme\xq-dark.css" />
|
||||
<Content Include="Umbraco_Client\ContextMenu\Css\jquery.contextMenu.css" />
|
||||
<Content Include="Umbraco_Client\ContextMenu\Js\jquery.contextMenu.js" />
|
||||
<Content Include="umbraco_Client\Dialogs\SortDialog.css" />
|
||||
<Content Include="umbraco_client\Dialogs\SortDialog.js" />
|
||||
<Content Include="Umbraco_Client\Dialogs\CreateDialog.css" />
|
||||
<Content Include="Umbraco_Client\Dialogs\EditMacro.css" />
|
||||
<Content Include="umbraco_Client\Editors\DirectoryBrowser.css" />
|
||||
<Content Include="Umbraco_Client\Dialogs\EditMacro.js" />
|
||||
<Content Include="Umbraco_Client\Dialogs\UmbracoField.js" />
|
||||
<Content Include="Umbraco_Client\Editors\EditMacro.css" />
|
||||
@@ -658,6 +708,9 @@
|
||||
<Content Include="Umbraco_Client\Installer\Images\pbar.gif" />
|
||||
<Content Include="Umbraco_Client\Installer\Js\PackageInstaller.js" />
|
||||
<Content Include="Umbraco_Client\Splitbutton\InsertMacroSplitButton.js" />
|
||||
<Content Include="umbraco_Client\tablesorting\img\asc.gif" />
|
||||
<Content Include="umbraco_Client\tablesorting\img\desc.gif" />
|
||||
<Content Include="umbraco_Client\tablesorting\jquery.tablesorter.min.js" />
|
||||
<Content Include="Umbraco_Client\Splitbutton\jquery.splitbutton.js" />
|
||||
<Content Include="Umbraco_Client\Tags\Css\jquery.tagsinput.css" />
|
||||
<Content Include="Umbraco_Client\Tags\Js\jquery.tagsinput.js" />
|
||||
@@ -1700,7 +1753,6 @@
|
||||
<Content Include="Umbraco\Images\Umbraco\uploadpackage.gif" />
|
||||
<Content Include="Umbraco_Client\Application\JQuery\jquery.autocomplete.js" />
|
||||
<Content Include="Umbraco\Developer\Packages\BrowseRepository.aspx" />
|
||||
<Content Include="Umbraco\Developer\Packages\directoryBrowser.aspx" />
|
||||
<Content Include="Umbraco\Developer\Packages\editPackage.aspx" />
|
||||
<Content Include="Umbraco\Developer\Packages\installedPackage.aspx" />
|
||||
<Content Include="Umbraco\Developer\Packages\LoadNitros.ascx" />
|
||||
@@ -1864,6 +1916,7 @@
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Views\Web.config.transform" />
|
||||
<None Include="web.Template.Debug.config">
|
||||
<DependentUpon>Web.Template.config</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -1906,7 +1959,6 @@
|
||||
<Content Include="Umbraco\Translation\default.aspx" />
|
||||
<Content Include="Umbraco\Translation\preview.aspx" />
|
||||
<Content Include="Umbraco\Translation\xml.aspx" />
|
||||
<Content Include="Umbraco\create.aspx" />
|
||||
<Content Include="Umbraco\Create\content.ascx" />
|
||||
<Content Include="Umbraco\Create\language.ascx">
|
||||
<SubType>UserControl</SubType>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="Umbraco.Web" />
|
||||
<add namespace="Umbraco.Core" />
|
||||
<add namespace="Umbraco.Core.Models" />
|
||||
<add namespace="Umbraco.Web.Mvc" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.WebPages;
|
||||
|
||||
namespace Umbraco.Web.UI.Config.Splashes
|
||||
{
|
||||
public partial class NoNodes : System.Web.UI.Page
|
||||
{
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
var store = UmbracoContext.Current.RoutingContext.PublishedContentStore;
|
||||
if (store.HasContent(UmbracoContext.Current))
|
||||
{
|
||||
//if there is actually content, go to the root
|
||||
Response.Redirect("~/");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
@@ -7,18 +7,18 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace umbraco.presentation.channels {
|
||||
namespace Umbraco.Web.UI.Config.Splashes {
|
||||
|
||||
|
||||
public partial class wlwmanifest {
|
||||
public partial class NoNodes {
|
||||
|
||||
/// <summary>
|
||||
/// xhtml control.
|
||||
/// Form1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal xhtml;
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm Form1;
|
||||
}
|
||||
}
|
||||
@@ -1,183 +1,149 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %>
|
||||
<%@ Page Language="C#" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Config.Splashes.NoNodes" CodeBehind="NoNodes.aspx.cs" %>
|
||||
<%@ Import Namespace="Umbraco.Core.Configuration" %>
|
||||
<%@ Import Namespace="Umbraco.Core.IO" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>Umbraco
|
||||
<%=UmbracoVersion.Current.ToString(3)%>
|
||||
- no pages found</title>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>Umbraco - no pages found</title>
|
||||
<link rel="icon" type="image/png" href="<%=umbraco.GlobalSettings.Path + "/images/pinnedIcons/umb.ico" %>" />
|
||||
|
||||
<link media="all" rel="stylesheet" href="../../umbraco_client/installer/css/jquery-ui-1.8.6.custom.css" />
|
||||
|
||||
|
||||
<link media="all" type="text/css" rel="stylesheet" href="../../umbraco_client/installer/css/reset.css" />
|
||||
|
||||
|
||||
<link media="all" rel="stylesheet" href="../../umbraco_client/installer/css/all.css" />
|
||||
|
||||
|
||||
<link media="all" type="text/css" rel="stylesheet" href="../../umbraco_client/installer/css/form.css" />
|
||||
|
||||
<script src="../../umbraco_client/installer/js/jquery.1.4.4.js" type="text/javascript"></script>
|
||||
<script src="../../umbraco_client/installer/js/jquery.ui.selectmenu.js" type="text/javascript"></script>
|
||||
<script src="../../umbraco_client/installer/js/jquery.main.js" type="text/javascript"></script>
|
||||
<script src="../../umbraco_client/installer/js/jquery.1.4.4.js" type="text/javascript"></script>
|
||||
<script src="../../umbraco_client/installer/js/jquery.ui.selectmenu.js" type="text/javascript"></script>
|
||||
<script src="../../umbraco_client/installer/js/jquery.main.js" type="text/javascript"></script>
|
||||
|
||||
<script src="../../umbraco_client/passwordStrength/passwordstrength.js" type="text/javascript"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<!--[if lt IE 9]>
|
||||
<link media="all" rel="stylesheet" href="../../umbraco_client/installer/css/lt7.css" />
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!--[if lt IE 7]><script type="text/javascript" src="../../umbraco_client/installer/js/ie-png.js"></script><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 7]><script type="text/javascript" src="../../umbraco_client/installer/js/ie-png.js"></script><![endif]-->
|
||||
|
||||
</head>
|
||||
<body class="theend">
|
||||
<form id="Form1" method="post" runat="server">
|
||||
|
||||
<!-- all page -->
|
||||
<!-- all page -->
|
||||
|
||||
<section id="wrapper">
|
||||
<section id="wrapper">
|
||||
|
||||
<div class="wholder">
|
||||
<div class="wholder">
|
||||
|
||||
<!-- header -->
|
||||
<!-- header -->
|
||||
|
||||
<header id="header">
|
||||
<header id="header">
|
||||
<div class="holder">
|
||||
<strong class="logo"><a href="#">Umbraco</a></strong>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="holder">
|
||||
<!-- all content -->
|
||||
|
||||
<strong class="logo"><a href="#">Umbraco</a></strong>
|
||||
<section id="main">
|
||||
|
||||
<!-- content -->
|
||||
|
||||
</div>
|
||||
<section class="content">
|
||||
|
||||
</header>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
$.post("../../install/utills/p.aspx?feed=sitebuildervids",
|
||||
function(data) {
|
||||
jQuery("#ajax-sitebuildervids").html(data);
|
||||
});
|
||||
|
||||
<!-- all content -->
|
||||
$.post("../../install/utills/p.aspx?feed=developervids",
|
||||
function(data) {
|
||||
jQuery("#ajax-developervids").html(data);
|
||||
});
|
||||
});
|
||||
|
||||
<section id="main">
|
||||
</script>
|
||||
|
||||
|
||||
<!-- done box -->
|
||||
|
||||
<!-- content -->
|
||||
<div class="tab main-tabinfo">
|
||||
<div class="container">
|
||||
<h1>Looks like there's still work to do</h1>
|
||||
<p>
|
||||
You're seeing the wonderful page because your website doesn't contain any <strong>published</strong> content yet.
|
||||
</p>
|
||||
<p>
|
||||
So get rid of this page by starting umbraco and publishing some content. You can do this by clicking the "set up your new website" button below.
|
||||
</p>
|
||||
<ul class="btn-web">
|
||||
<li class="btn-set"><a href="<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>/umbraco.aspx"><span>Launch umbraco</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="threcol">
|
||||
<div class="t">
|
||||
|
||||
</div>
|
||||
<div class="hold">
|
||||
<aside class="col1">
|
||||
<h2>Useful links</h2>
|
||||
<p>We’ve put together some useful links to help you get started with Umbraco.</p>
|
||||
<nav class="links">
|
||||
<ul>
|
||||
<li><a href="http://our.umbraco.org?ref=ourFromInstaller">our.umbraco.org</a></li>
|
||||
</ul>
|
||||
|
||||
<section class="content">
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
$.post("../../install/utills/p.aspx?feed=sitebuildervids",
|
||||
function (data) {
|
||||
jQuery("#ajax-sitebuildervids").html(data);
|
||||
});
|
||||
|
||||
$.post("../../install/utills/p.aspx?feed=developervids",
|
||||
function (data) {
|
||||
jQuery("#ajax-developervids").html(data);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- done box -->
|
||||
|
||||
<div class="tab main-tabinfo">
|
||||
<div class="container">
|
||||
<h1>
|
||||
Looks like there's still work to do</h1>
|
||||
<p>
|
||||
You're seeing the wonderful page because your website doesn't contain any
|
||||
<strong>published</strong> content yet.
|
||||
</p>
|
||||
<p>
|
||||
So get rid of this page by starting umbraco and publishing
|
||||
some content. You can do this by clicking the "set up your new website" button below.
|
||||
</p>
|
||||
<ul class="btn-web">
|
||||
|
||||
|
||||
<li class="btn-set"><a href="<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/umbraco.aspx"><span>Launch umbraco</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="threcol">
|
||||
<div class="t">
|
||||
</div>
|
||||
<div class="hold">
|
||||
|
||||
<aside class="col1">
|
||||
<h2>Useful links</h2>
|
||||
<p>We’ve put together some useful links to help you get started with Umbraco.</p>
|
||||
<nav class="links">
|
||||
<ul>
|
||||
<li><a href="http://our.umbraco.org?ref=ourFromInstaller">our.umbraco.org</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://our.umbraco.org/wiki?ref=LatestDocsFromInstaller">New documentation</a></li>
|
||||
<li><a href="http://our.umbraco.org/projects?ref=LatestProjectsFromInstaller">New Projects</a></li>
|
||||
<li><a href="http://our.umbraco.org/forum?ref=LatesTalkFromInstaller">Forum Talk</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<aside class="col2">
|
||||
<h2>Sitebuilder introduction</h2>
|
||||
<div id="ajax-sitebuildervids"><small>Loading...</small></div>
|
||||
</aside>
|
||||
<aside class="col3">
|
||||
<h2>Developer introduction</h2>
|
||||
<div id="ajax-developervids"><small>Loading...</small></div>
|
||||
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<!-- bg page -->
|
||||
<div class="bg-main">
|
||||
<div class="color2">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color3">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color1">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color4">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color5">
|
||||
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://our.umbraco.org/wiki?ref=LatestDocsFromInstaller">New documentation</a></li>
|
||||
<li><a href="http://our.umbraco.org/projects?ref=LatestProjectsFromInstaller">New Projects</a></li>
|
||||
<li><a href="http://our.umbraco.org/forum?ref=LatesTalkFromInstaller">Forum Talk</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
<aside class="col2">
|
||||
<h2>Sitebuilder introduction</h2>
|
||||
<div id="ajax-sitebuildervids"><small>Loading...</small></div>
|
||||
</aside>
|
||||
<aside class="col3">
|
||||
<h2>Developer introduction</h2>
|
||||
<div id="ajax-developervids"><small>Loading...</small></div>
|
||||
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- bg page -->
|
||||
<div class="bg-main">
|
||||
<div class="color2">
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
<div class="color3">
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
<div class="color1">
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
<div class="color4">
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
<div class="color5">
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<!-- Setting this to true can increase render time for pages with a large number of links -->
|
||||
<!-- If running Umbraco in virtual directory this *must* be set to true! -->
|
||||
<ResolveUrlsFromTextString>false</ResolveUrlsFromTextString>
|
||||
|
||||
|
||||
<!-- How Umbraco should handle errors during macro execution. Can be one of the following values:
|
||||
- inline - show an inline error within the macro but allow the page to continue rendering. Historial Umbraco behaviour.
|
||||
- silent - Silently suppress the error and do not render the offending macro.
|
||||
@@ -94,6 +94,23 @@
|
||||
error handler is defined then you'll see the Yellow Screen Of Death (YSOD) error page.
|
||||
Note the error can also be handled by the umbraco.macro.Error event, where you can log/alarm with your own code and change the behaviour per event. -->
|
||||
<MacroErrors>inline</MacroErrors>
|
||||
|
||||
<!-- How Umbraco should show icons in the document type editor. Historically, the list has included all the files in
|
||||
/Umbraco/Images/Umbraco plus a CSS sprite defined in Umbraco_Client/Tree/treeIcons.css, unfortunately these
|
||||
contain many duplicates. The DocumentTypeIconList setting allows you to favor one list over the other.
|
||||
|
||||
Can be one of the following values:
|
||||
- ShowDuplicates - Show duplicates in files and sprites. Historial Umbraco behaviour.
|
||||
- HideSpriteDuplicates - If a file exists on disk with the same name as one in the sprite
|
||||
then the file on disk overrules the one in the sprite, the
|
||||
sprite icon will not be shown
|
||||
- HideFileDuplicates - If a file exists on disk with the same name as one in the sprite
|
||||
then the file in the sprite overrules the one on disk, the file
|
||||
on disk will be shown (recommended) -->
|
||||
<DocumentTypeIconList>ShowDuplicates</DocumentTypeIconList>
|
||||
|
||||
<!-- These file types will not be allowed to be uploaded via the upload control for media and content -->
|
||||
<disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd</disallowedUploadFiles>
|
||||
</content>
|
||||
|
||||
<security>
|
||||
@@ -143,7 +160,7 @@
|
||||
<!-- If you want to switch to Mvc then do NOT change useAspNetMasterPages to false -->
|
||||
<!-- This (old!) setting is still used to control how macros are inserted into your pages -->
|
||||
<useAspNetMasterPages>true</useAspNetMasterPages>
|
||||
|
||||
|
||||
<!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
|
||||
<!-- Do not set useAspNetMasterPages to false, it is not relevant to MVC usage -->
|
||||
<defaultRenderingEngine>WebForms</defaultRenderingEngine>
|
||||
|
||||
@@ -1,203 +1,220 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<settings>
|
||||
<content>
|
||||
<imaging>
|
||||
<!-- what file extension that should cause umbraco to create thumbnails -->
|
||||
<imageFileTypes>jpeg,jpg,gif,bmp,png,tiff,tif</imageFileTypes>
|
||||
<!-- what attributes that are allowed in the editor on an img tag -->
|
||||
<allowedAttributes>src,alt,border,class,style,align,id,name,onclick,usemap</allowedAttributes>
|
||||
<!-- automatically updates dimension, filesize and extension attributes on upload -->
|
||||
<autoFillImageProperties>
|
||||
<uploadField alias="umbracoFile">
|
||||
<widthFieldAlias>umbracoWidth</widthFieldAlias>
|
||||
<heightFieldAlias>umbracoHeight</heightFieldAlias>
|
||||
<lengthFieldAlias>umbracoBytes</lengthFieldAlias>
|
||||
<extensionFieldAlias>umbracoExtension</extensionFieldAlias>
|
||||
</uploadField>
|
||||
</autoFillImageProperties>
|
||||
</imaging>
|
||||
<scripteditor>
|
||||
<!-- Path to script folder - no ending "/" -->
|
||||
<scriptFolderPath>/scripts</scriptFolderPath>
|
||||
<!-- what files can be opened/created in the script editor -->
|
||||
<scriptFileTypes>js,xml</scriptFileTypes>
|
||||
<!-- disable the codemirror editor and use a simple textarea instead -->
|
||||
<scriptDisableEditor>false</scriptDisableEditor>
|
||||
</scripteditor>
|
||||
<content>
|
||||
<imaging>
|
||||
<!-- what file extension that should cause umbraco to create thumbnails -->
|
||||
<imageFileTypes>jpeg,jpg,gif,bmp,png,tiff,tif</imageFileTypes>
|
||||
<!-- what attributes that are allowed in the editor on an img tag -->
|
||||
<allowedAttributes>src,alt,border,class,style,align,id,name,onclick,usemap</allowedAttributes>
|
||||
<!-- automatically updates dimension, filesize and extension attributes on upload -->
|
||||
<autoFillImageProperties>
|
||||
<uploadField alias="umbracoFile">
|
||||
<widthFieldAlias>umbracoWidth</widthFieldAlias>
|
||||
<heightFieldAlias>umbracoHeight</heightFieldAlias>
|
||||
<lengthFieldAlias>umbracoBytes</lengthFieldAlias>
|
||||
<extensionFieldAlias>umbracoExtension</extensionFieldAlias>
|
||||
</uploadField>
|
||||
</autoFillImageProperties>
|
||||
</imaging>
|
||||
<scripteditor>
|
||||
<!-- Path to script folder - no ending "/" -->
|
||||
<scriptFolderPath>/scripts</scriptFolderPath>
|
||||
<!-- what files can be opened/created in the script editor -->
|
||||
<scriptFileTypes>js,xml</scriptFileTypes>
|
||||
<!-- disable the codemirror editor and use a simple textarea instead -->
|
||||
<scriptDisableEditor>false</scriptDisableEditor>
|
||||
</scripteditor>
|
||||
|
||||
<!-- should umbraco store the uploaded files like /media/xxx/filename.ext or like /media/xxx-filename.ext
|
||||
<!-- should umbraco store the uploaded files like /media/xxx/filename.ext or like /media/xxx-filename.ext
|
||||
should be set to false if the application pool's user account hasn't got readrights of the driveroot up to the /media directory -->
|
||||
<UploadAllowDirectories>True</UploadAllowDirectories>
|
||||
<errors>
|
||||
<!-- the id of the page that should be shown if the page is not found -->
|
||||
<!--<error404>
|
||||
<UploadAllowDirectories>True</UploadAllowDirectories>
|
||||
<errors>
|
||||
<!-- the id of the page that should be shown if the page is not found -->
|
||||
<!--<error404>
|
||||
<errorPage culture="default">1</errorPage>
|
||||
<errorPage culture="en-US">200</errorPage>
|
||||
</error404>-->
|
||||
<error404>
|
||||
<errorPage culture="default">1047</errorPage>
|
||||
<errorPage culture="en-US">1047</errorPage>
|
||||
<errorPage culture="en-UK">1047</errorPage>
|
||||
</error404>
|
||||
</errors>
|
||||
<notifications>
|
||||
<!-- the email that should be used as from mail when umbraco sends a notification -->
|
||||
<email>robot@umbraco.dk</email>
|
||||
</notifications>
|
||||
<error404>
|
||||
<errorPage culture="default">1047</errorPage>
|
||||
<errorPage culture="en-US">1047</errorPage>
|
||||
<errorPage culture="en-UK">1047</errorPage>
|
||||
</error404>
|
||||
</errors>
|
||||
<notifications>
|
||||
<!-- the email that should be used as from mail when umbraco sends a notification -->
|
||||
<email>robot@umbraco.dk</email>
|
||||
</notifications>
|
||||
|
||||
<!-- if true umbraco will ensure that no page under the same parent has an identical name -->
|
||||
<ensureUniqueNaming>True</ensureUniqueNaming>
|
||||
<!-- if true umbraco will ensure that no page under the same parent has an identical name -->
|
||||
<ensureUniqueNaming>True</ensureUniqueNaming>
|
||||
|
||||
<!-- clean editor content with use of tidy -->
|
||||
<TidyEditorContent>False</TidyEditorContent>
|
||||
<!-- clean editor content with use of tidy -->
|
||||
<TidyEditorContent>False</TidyEditorContent>
|
||||
|
||||
<!-- the encoding type for tidy. Default is Raw, options are ASCII, Raw, Latin1, UTF8, ISO2022, MacroMan-->
|
||||
<TidyCharEncoding>Raw</TidyCharEncoding>
|
||||
<!-- the encoding type for tidy. Default is Raw, options are ASCII, Raw, Latin1, UTF8, ISO2022, MacroMan-->
|
||||
<TidyCharEncoding>Raw</TidyCharEncoding>
|
||||
|
||||
<!-- Enable / disable xml content cache -->
|
||||
<XmlCacheEnabled>True</XmlCacheEnabled>
|
||||
<!-- Enable / disable xml content cache -->
|
||||
<XmlCacheEnabled>True</XmlCacheEnabled>
|
||||
|
||||
<!-- Update disk cache every time content has changed -->
|
||||
<ContinouslyUpdateXmlDiskCache>True</ContinouslyUpdateXmlDiskCache>
|
||||
<!-- Update disk cache every time content has changed -->
|
||||
<ContinouslyUpdateXmlDiskCache>True</ContinouslyUpdateXmlDiskCache>
|
||||
|
||||
<!-- Update in-memory cache if xml file is changed -->
|
||||
<XmlContentCheckForDiskChanges>True</XmlContentCheckForDiskChanges>
|
||||
<!-- Update in-memory cache if xml file is changed -->
|
||||
<XmlContentCheckForDiskChanges>True</XmlContentCheckForDiskChanges>
|
||||
|
||||
<!-- Show the /config/splashes/booting.aspx page while initializing content -->
|
||||
<EnableSplashWhileLoading>False</EnableSplashWhileLoading>
|
||||
<!-- Show the /config/splashes/booting.aspx page while initializing content -->
|
||||
<EnableSplashWhileLoading>False</EnableSplashWhileLoading>
|
||||
|
||||
<!-- Show property descriptions in editing view "icon|text|none" -->
|
||||
<PropertyContextHelpOption>text</PropertyContextHelpOption>
|
||||
<!-- Show property descriptions in editing view "icon|text|none" -->
|
||||
<PropertyContextHelpOption>text</PropertyContextHelpOption>
|
||||
|
||||
<UseLegacyXmlSchema>false</UseLegacyXmlSchema>
|
||||
<UseLegacyXmlSchema>false</UseLegacyXmlSchema>
|
||||
|
||||
<cloneXmlContent>true</cloneXmlContent>
|
||||
<cloneXmlContent>true</cloneXmlContent>
|
||||
|
||||
<ForceSafeAliases>true</ForceSafeAliases>
|
||||
<ForceSafeAliases>true</ForceSafeAliases>
|
||||
|
||||
<PreviewBadge><![CDATA[<a id="umbracoPreviewBadge" style="position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;" href="{0}/endPreview.aspx?redir={2}"><span style="display:none;">In Preview Mode - click to end</span></a>]]></PreviewBadge>
|
||||
<PreviewBadge><![CDATA[<a id="umbracoPreviewBadge" style="position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;" href="{0}/endPreview.aspx?redir={2}"><span style="display:none;">In Preview Mode - click to end</span></a>]]></PreviewBadge>
|
||||
|
||||
<!-- Cache cycle of Media and Member data fetched from the umbraco.library methods -->
|
||||
<!-- In seconds. 0 will disable cache -->
|
||||
<UmbracoLibraryCacheDuration>1800</UmbracoLibraryCacheDuration>
|
||||
<!-- Cache cycle of Media and Member data fetched from the umbraco.library methods -->
|
||||
<!-- In seconds. 0 will disable cache -->
|
||||
<UmbracoLibraryCacheDuration>1800</UmbracoLibraryCacheDuration>
|
||||
|
||||
<!-- How Umbraco should handle errors during macro execution. Can be one of the following values:
|
||||
<!-- How Umbraco should handle errors during macro execution. Can be one of the following values:
|
||||
- inline - show an inline error within the macro but allow the page to continue rendering. Historial Umbraco behaviour.
|
||||
- silent - Silently suppress the error and do not render the offending macro.
|
||||
- throw - Throw an exception which can be caught by the global error handler defined in Application_OnError. If no such
|
||||
error handler is defined then you'll see the Yellow Screen Of Death (YSOD) error page.
|
||||
Note the error can also be handled by the umbraco.macro.Error event, where you can log/alarm with your own code and change the behaviour per event. -->
|
||||
<MacroErrors>inline</MacroErrors>
|
||||
</content>
|
||||
<MacroErrors>inline</MacroErrors>
|
||||
|
||||
<security>
|
||||
<!-- set to true to auto update login interval (and there by disabling the lock screen -->
|
||||
<keepUserLoggedIn>true</keepUserLoggedIn>
|
||||
|
||||
<!-- change in 4.8: Disabled users are now showed dimmed and last in the tree. If you prefer not to display them set this to true -->
|
||||
<hideDisabledUsersInBackoffice>false</hideDisabledUsersInBackoffice>
|
||||
</security>
|
||||
|
||||
<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>false</addTrailingSlash>
|
||||
<urlReplacing removeDoubleDashes="true">
|
||||
<char org=" ">-</char>
|
||||
<char org="""></char>
|
||||
<char org="."></char>
|
||||
<char org=";"></char>
|
||||
<char org="/"></char>
|
||||
<char org=":"></char>
|
||||
<char org="+">plus</char>
|
||||
<char org="*">star</char>
|
||||
<char org="&"></char>
|
||||
<char org="?"></char>
|
||||
<char org="æ">ae</char>
|
||||
<char org="ø">oe</char>
|
||||
<char org="å">aa</char>
|
||||
</urlReplacing>
|
||||
</requestHandler>
|
||||
<!-- How Umbraco should show icons in the document type editor. Historically, the list has included all the files in
|
||||
/Umbraco/Images/Umbraco plus a CSS sprite defined in Umbraco_Client/Tree/treeIcons.css, unfortunately these
|
||||
contain many duplicates. The DocumentTypeIconList setting allows you to favor one list over the other.
|
||||
|
||||
Can be one of the following values:
|
||||
- ShowDuplicates - Show duplicates in files and sprites. Historial Umbraco behaviour.
|
||||
- HideSpriteDuplicates - If a file exists on disk with the same name as one in the sprite
|
||||
then the file on disk overrules the one in the sprite, the
|
||||
sprite icon will not be shown
|
||||
- HideFileDuplicates - If a file exists on disk with the same name as one in the sprite
|
||||
then the file in the sprite overrules the one on disk, the file
|
||||
on disk will be shown (recommended) -->
|
||||
<DocumentTypeIconList>HideFileDuplicates</DocumentTypeIconList>
|
||||
|
||||
<templates>
|
||||
<useAspNetMasterPages>true</useAspNetMasterPages>
|
||||
<enableSkinSupport>true</enableSkinSupport>
|
||||
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
|
||||
</templates>
|
||||
<!-- These file types will not be allowed to be uploaded via the upload control for media and content -->
|
||||
<disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd</disallowedUploadFiles>
|
||||
</content>
|
||||
|
||||
<!-- this is used by Umbraco to determine if there's valid classes in the /App_Code folder to be used for Rest/XSLT extensions -->
|
||||
<developer>
|
||||
<appCodeFileExtensions>
|
||||
<ext>cs</ext>
|
||||
<ext>vb</ext>
|
||||
</appCodeFileExtensions>
|
||||
</developer>
|
||||
|
||||
<viewstateMoverModule enable="false" />
|
||||
<security>
|
||||
<!-- set to true to auto update login interval (and there by disabling the lock screen -->
|
||||
<keepUserLoggedIn>true</keepUserLoggedIn>
|
||||
|
||||
<!--
|
||||
<!-- change in 4.8: Disabled users are now showed dimmed and last in the tree. If you prefer not to display them set this to true -->
|
||||
<hideDisabledUsersInBackoffice>false</hideDisabledUsersInBackoffice>
|
||||
</security>
|
||||
|
||||
<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>false</addTrailingSlash>
|
||||
<urlReplacing removeDoubleDashes="true">
|
||||
<char org=" ">-</char>
|
||||
<char org="""></char>
|
||||
<char org="."></char>
|
||||
<char org=";"></char>
|
||||
<char org="/"></char>
|
||||
<char org=":"></char>
|
||||
<char org="+">plus</char>
|
||||
<char org="*">star</char>
|
||||
<char org="&"></char>
|
||||
<char org="?"></char>
|
||||
<char org="æ">ae</char>
|
||||
<char org="ø">oe</char>
|
||||
<char org="å">aa</char>
|
||||
</urlReplacing>
|
||||
</requestHandler>
|
||||
|
||||
<templates>
|
||||
<useAspNetMasterPages>true</useAspNetMasterPages>
|
||||
<enableSkinSupport>true</enableSkinSupport>
|
||||
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
|
||||
</templates>
|
||||
|
||||
<!-- this is used by Umbraco to determine if there's valid classes in the /App_Code folder to be used for Rest/XSLT extensions -->
|
||||
<developer>
|
||||
<appCodeFileExtensions>
|
||||
<ext>cs</ext>
|
||||
<ext>vb</ext>
|
||||
</appCodeFileExtensions>
|
||||
</developer>
|
||||
|
||||
<viewstateMoverModule enable="false" />
|
||||
|
||||
<!--
|
||||
Now that we have Log4Net logging enabled, this section is only used for what gets logged to the umbracoLog table
|
||||
which currently logs items used in the audit trail and roll back scenarios.
|
||||
-->
|
||||
<logging>
|
||||
<enableLogging>true</enableLogging>
|
||||
<enableAsyncLogging>true</enableAsyncLogging>
|
||||
<disabledLogTypes>
|
||||
<!-- <logTypeAlias>[alias-of-log-type-in-lowercase]</logTypeAlias> -->
|
||||
</disabledLogTypes>
|
||||
<autoCleanLogs>falses</autoCleanLogs>
|
||||
<cleaningMiliseconds>86400</cleaningMiliseconds>
|
||||
<maxLogAge>1440</maxLogAge>
|
||||
</logging>
|
||||
<logging>
|
||||
<enableLogging>true</enableLogging>
|
||||
<enableAsyncLogging>true</enableAsyncLogging>
|
||||
<disabledLogTypes>
|
||||
<!-- <logTypeAlias>[alias-of-log-type-in-lowercase]</logTypeAlias> -->
|
||||
</disabledLogTypes>
|
||||
<autoCleanLogs>falses</autoCleanLogs>
|
||||
<cleaningMiliseconds>86400</cleaningMiliseconds>
|
||||
<maxLogAge>1440</maxLogAge>
|
||||
</logging>
|
||||
|
||||
<scheduledTasks>
|
||||
<!-- add tasks that should be called with an interval (seconds) -->
|
||||
<!-- <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>-->
|
||||
</scheduledTasks>
|
||||
<scheduledTasks>
|
||||
<!-- add tasks that should be called with an interval (seconds) -->
|
||||
<!-- <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>-->
|
||||
</scheduledTasks>
|
||||
|
||||
<!-- distributed calls make umbraco use webservices to handle cache refreshing -->
|
||||
<distributedCall enable="false">
|
||||
<!-- the id of the user who's making the calls -->
|
||||
<!-- needed for security, umbraco will automatically look up correct login and passwords -->
|
||||
<user>0</user>
|
||||
<servers>
|
||||
<!-- add ip number or hostname, make sure that it can be reached from all servers -->
|
||||
<!-- <server>127.0.0.1</server>-->
|
||||
</servers>
|
||||
</distributedCall>
|
||||
<!-- distributed calls make umbraco use webservices to handle cache refreshing -->
|
||||
<distributedCall enable="false">
|
||||
<!-- the id of the user who's making the calls -->
|
||||
<!-- needed for security, umbraco will automatically look up correct login and passwords -->
|
||||
<user>0</user>
|
||||
<servers>
|
||||
<!-- add ip number or hostname, make sure that it can be reached from all servers -->
|
||||
<!-- <server>127.0.0.1</server>-->
|
||||
</servers>
|
||||
</distributedCall>
|
||||
|
||||
<!-- configuration for webservices -->
|
||||
<!-- webservices are disabled by default. Set enable="True" to enable them -->
|
||||
<webservices enabled="True">
|
||||
<!-- You must set user-rights for each service. Enter the usernames seperated with comma (,) -->
|
||||
<documentServiceUsers>umbraco</documentServiceUsers>
|
||||
<fileServiceUsers>umbraco</fileServiceUsers>
|
||||
<fileServiceFolders>css,xslt</fileServiceFolders>
|
||||
<stylesheetServiceUsers>umbraco</stylesheetServiceUsers>
|
||||
<memberServiceUsers>umbraco</memberServiceUsers>
|
||||
<templateServiceUsers>umbraco</templateServiceUsers>
|
||||
</webservices>
|
||||
<!-- configuration for webservices -->
|
||||
<!-- webservices are disabled by default. Set enable="True" to enable them -->
|
||||
<webservices enabled="True">
|
||||
<!-- You must set user-rights for each service. Enter the usernames seperated with comma (,) -->
|
||||
<documentServiceUsers>umbraco</documentServiceUsers>
|
||||
<fileServiceUsers>umbraco</fileServiceUsers>
|
||||
<fileServiceFolders>css,xslt</fileServiceFolders>
|
||||
<stylesheetServiceUsers>umbraco</stylesheetServiceUsers>
|
||||
<memberServiceUsers>umbraco</memberServiceUsers>
|
||||
<templateServiceUsers>umbraco</templateServiceUsers>
|
||||
</webservices>
|
||||
|
||||
<!-- Configuration for repositories -->
|
||||
<!-- Add or remove repositories here. You will need the repository's unique key to be able to connect to it.-->
|
||||
<repositories>
|
||||
<repository name="Umbraco package Repository" guid="65194810-1f85-11dd-bd0b-0800200c9a66" />
|
||||
</repositories>
|
||||
<!-- Configuration for repositories -->
|
||||
<!-- Add or remove repositories here. You will need the repository's unique key to be able to connect to it.-->
|
||||
<repositories>
|
||||
<repository name="Umbraco package Repository" guid="65194810-1f85-11dd-bd0b-0800200c9a66" />
|
||||
</repositories>
|
||||
|
||||
<providers>
|
||||
<users>
|
||||
<!-- if you wish to use your own membershipprovider for authenticating to the umbraco back office -->
|
||||
<!-- specify it here (remember to add it to the web.config as well) -->
|
||||
<DefaultBackofficeProvider>UsersMembershipProvider</DefaultBackofficeProvider>
|
||||
</users>
|
||||
</providers>
|
||||
<providers>
|
||||
<users>
|
||||
<!-- if you wish to use your own membershipprovider for authenticating to the umbraco back office -->
|
||||
<!-- specify it here (remember to add it to the web.config as well) -->
|
||||
<DefaultBackofficeProvider>UsersMembershipProvider</DefaultBackofficeProvider>
|
||||
</users>
|
||||
</providers>
|
||||
|
||||
<!-- Maps language, usertype, application and application_url to help pages -->
|
||||
<help defaultUrl="http://our.umbraco.org/wiki/umbraco-help/{0}/{1}">
|
||||
<!-- Add links that should open custom help pages -->
|
||||
<!--<link application="content" applicationUrl="dashboard.aspx" language="en" userType="Administrators" helpUrl="http://www.xyz.no?{0}/{1}/{2}/{3}" /> -->
|
||||
</help>
|
||||
<!-- Maps language, usertype, application and application_url to help pages -->
|
||||
<help defaultUrl="http://our.umbraco.org/wiki/umbraco-help/{0}/{1}">
|
||||
<!-- Add links that should open custom help pages -->
|
||||
<!--<link application="content" applicationUrl="dashboard.aspx" language="en" userType="Administrators" helpUrl="http://www.xyz.no?{0}/{1}/{2}/{3}" /> -->
|
||||
</help>
|
||||
|
||||
<!--
|
||||
web.routing
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.cms.presentation.Trees;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco
|
||||
{
|
||||
public partial class CreateDialog : global::umbraco.cms.presentation.Create
|
||||
{
|
||||
|
||||
//protected override void OnLoad(EventArgs e)
|
||||
//{
|
||||
// if (SecurityCheck(Request.QueryString["nodeType"]))
|
||||
// {
|
||||
// //if we're allowed, then continue
|
||||
// base.OnLoad(e);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //otherwise show an error
|
||||
// UI.Visible = false;
|
||||
// AccessError.Visible = true;
|
||||
// }
|
||||
//}
|
||||
|
||||
//private bool SecurityCheck(string treeAlias)
|
||||
//{
|
||||
// var tree = TreeDefinitionCollection.Instance.FindTree(treeAlias);
|
||||
// if (tree != null)
|
||||
// {
|
||||
// //does the current user have access to the current app?
|
||||
// var user = this.getUser();
|
||||
// var userApps = user.Applications;
|
||||
// return userApps.Any(x => x.alias.InvariantEquals(tree.App.alias));
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -1,25 +1,25 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.3053
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace umbraco.cms.presentation {
|
||||
|
||||
|
||||
public partial class Create {
|
||||
namespace Umbraco.Web.UI.Umbraco {
|
||||
|
||||
|
||||
public partial class CreateDialog
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// UI control.
|
||||
/// AccessError control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder UI;
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder AccessError;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,20 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="rsd.aspx.cs" Inherits="umbraco.presentation.umbraco.channels.rsd" %><?xml version="1.0" encoding="UTF-8"?><rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %>
|
||||
<%@ Import Namespace="Umbraco.Core.IO" %>
|
||||
<script runat="server">
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
Response.ContentType = "text/xml";
|
||||
}
|
||||
</script>
|
||||
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
|
||||
<service>
|
||||
<engineName>umbraco</engineName>
|
||||
<engineLink>http://umbraco.org/</engineLink>
|
||||
<homePageLink>http://<%=Request.ServerVariables["SERVER_NAME"]%></homePageLink>
|
||||
<apis>
|
||||
<api name="MetaWeblog" blogID="1" preferred="true" apiLink="http://<%=Request.ServerVariables["SERVER_NAME"]%><%=umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/channels.aspx" />
|
||||
<api name="Blogger" blogID="1" preferred="false" apiLink="http://<%=Request.ServerVariables["SERVER_NAME"]%><%=umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/channels.aspx" />
|
||||
<api name="MetaWeblog" blogID="1" preferred="true" apiLink="http://<%=Request.ServerVariables["SERVER_NAME"]%><%=IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>/channels.aspx" />
|
||||
<api name="Blogger" blogID="1" preferred="false" apiLink="http://<%=Request.ServerVariables["SERVER_NAME"]%><%=IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>/channels.aspx" />
|
||||
</apis>
|
||||
</service>
|
||||
</rsd>
|
||||
</rsd>
|
||||
@@ -1,11 +1,33 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wlwmanifest.aspx.cs" Inherits="umbraco.presentation.channels.wlwmanifest" %><?xml version="1.0" encoding="utf-8" ?><manifest xmlns="http://schemas.microsoft.com/wlw/manifest/weblog">
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %>
|
||||
<%@ Import Namespace="Umbraco.Core.IO" %>
|
||||
<%@ Import Namespace="umbraco" %>
|
||||
<script runat="server">
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
Response.ContentType = "text/xml";
|
||||
}
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
var useXhtml = false;
|
||||
if (bool.TryParse(GlobalSettings.EditXhtmlMode, out useXhtml) && !useXhtml)
|
||||
{
|
||||
xhtml.Text = "no";
|
||||
}
|
||||
else
|
||||
{
|
||||
xhtml.Text = "yes";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<manifest xmlns="http://schemas.microsoft.com/wlw/manifest/weblog">
|
||||
<weblog>
|
||||
<imageUrl>http://umbraco.org/images/liveWriterIcon.png</imageUrl>
|
||||
<watermarkImageUrl>http://umbraco.org/images/liveWriterWatermark.png</watermarkImageUrl>
|
||||
<homepageLinkText>View your site/weblog</homepageLinkText>
|
||||
<adminLinkText>Edit your site/weblog</adminLinkText>
|
||||
<adminUrl>{blog-homepage-url}<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/</adminUrl>
|
||||
<postEditingUrl>{blog-homepage-url}<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/actions/editContent.aspx?id={post-id}</postEditingUrl>
|
||||
<adminUrl>{blog-homepage-url}<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>/</adminUrl>
|
||||
<postEditingUrl>{blog-homepage-url}<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/actions/editContent.aspx?id={post-id}</postEditingUrl>
|
||||
|
||||
</weblog>
|
||||
<views>
|
||||
@@ -25,4 +47,5 @@
|
||||
<supportsAutoUpdate>Yes</supportsAutoUpdate>
|
||||
<supportsMultipleCategories>Yes</supportsMultipleCategories>
|
||||
<requiresXHTML><asp:Literal runat="server" id="xhtml"></asp:Literal></requiresXHTML>
|
||||
</options></manifest>
|
||||
</options>
|
||||
</manifest>
|
||||
|
||||
@@ -228,6 +228,7 @@
|
||||
<key alias="errorRegExpWithoutTab">%0% is not in a correct format</key>
|
||||
</area>
|
||||
<area alias="errors">
|
||||
<key alias="dissallowedMediaType">The specified file type has been dissallowed by the administrator</key>
|
||||
<key alias="codemirroriewarning">NOTE! Even though CodeMirror is enabled by configuration, it is disabled in Internet Explorer because it's not stable enough.</key>
|
||||
<key alias="contentTypeAliasAndNameNotNull">Please fill both alias and name on the new propertytype!</key>
|
||||
<key alias="filePermissionsError">There is a problem with read/write access to a specific file or folder</key>
|
||||
|
||||
@@ -227,6 +227,7 @@
|
||||
<key alias="errorRegExpWithoutTab">%0% is not in a correct format</key>
|
||||
</area>
|
||||
<area alias="errors">
|
||||
<key alias="dissallowedMediaType">The specified file type has been dissallowed by the administrator</key>
|
||||
<key alias="codemirroriewarning">NOTE! Even though CodeMirror is enabled by configuration, it is disabled in Internet Explorer because it's not stable enough.</key>
|
||||
<key alias="contentTypeAliasAndNameNotNull">Please fill both alias and name on the new propertytype!</key>
|
||||
<key alias="filePermissionsError">There is a problem with read/write access to a specific file or folder</key>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%@ Control Language="c#" AutoEventWireup="True" Codebehind="ContentTypeControlNew.ascx.cs"
|
||||
Inherits="umbraco.controls.ContentTypeControlNew" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
|
||||
Inherits="Umbraco.Web.UI.Umbraco.Controls.ContentTypeControlNew" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Controls
|
||||
{
|
||||
public partial class ContentTypeControlNew : global::umbraco.controls.ContentTypeControlNew
|
||||
{
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -1,15 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace umbraco.presentation {
|
||||
namespace Umbraco.Web.UI.Umbraco.Controls {
|
||||
|
||||
public partial class ping {
|
||||
|
||||
public partial class ContentTypeControlNew {
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ Page Language="c#" MasterPageFile="masterpages/umbracoDialog.Master" Codebehind="create.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.Create" %>
|
||||
<%@ Page Language="c#" MasterPageFile="masterpages/umbracoDialog.Master" Codebehind="CreateDialog.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.CreateDialog" %>
|
||||
|
||||
<%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %>
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
|
||||
<asp:Content runat="server" ContentPlaceHolderID="body">
|
||||
<asp:PlaceHolder ID="UI" runat="server"></asp:PlaceHolder>
|
||||
<asp:PlaceHolder runat="server" Visible="False" ID="AccessError">
|
||||
<div class="error">
|
||||
<p>
|
||||
The current user does not have access to create this type of object
|
||||
</p>
|
||||
</div>
|
||||
</asp:PlaceHolder>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content runat="server" ContentPlaceHolderID="footer">
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
</p>
|
||||
|
||||
<div style="MARGIN-TOP: 0px"><%=umbraco.ui.Text("name")%>:
|
||||
<asp:RequiredFieldValidator id="RequiredFieldValidator1" ErrorMessage="*" ControlToValidate="rename" runat="server">*</asp:RequiredFieldValidator>
|
||||
<asp:TextBox id="rename" Runat="server" Width="350" CssClass="bigInput"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator id="RequiredFieldValidator1" ErrorMessage="*" ControlToValidate="rename" runat="server">*</asp:RequiredFieldValidator><br />
|
||||
<asp:TextBox id="rename" Runat="server" Width="350" CssClass="bigInput"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 0px; margin-left: -3px; margin-bottom: 0;">
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Developer.Packages
|
||||
{
|
||||
public partial class DirectoryBrowser : UmbracoEnsuredPage
|
||||
{
|
||||
public DirectoryBrowser()
|
||||
{
|
||||
CurrentApp = DefaultApps.developer.ToString();
|
||||
}
|
||||
|
||||
string _lsScriptName;
|
||||
string _lsWebPath;
|
||||
protected string Target = "";
|
||||
private readonly Regex _xssElementIdClean = new Regex(@"^([a-zA-Z0-9-_:\.]+)");
|
||||
|
||||
private readonly StringBuilder _sb = new StringBuilder();
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
Response.Cache.SetExpires(DateTime.Now.AddSeconds(5));
|
||||
Response.Cache.SetCacheability(HttpCacheability.Public);
|
||||
|
||||
//we need to clean this string:
|
||||
//http://issues.umbraco.org/issue/U4-2027
|
||||
var target = Request.QueryString.Get("target");
|
||||
if (target.IsNullOrWhiteSpace())
|
||||
throw new InvalidOperationException("The target query string must be set to a valid html element id");
|
||||
var matched = _xssElementIdClean.Matches(target);
|
||||
if (matched.Count == 0)
|
||||
throw new InvalidOperationException("The target query string must be set to a valid html element id");
|
||||
|
||||
Target = matched[0].Value;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
//Variables used in script
|
||||
var sebChar = IOHelper.DirSepChar.ToString();
|
||||
|
||||
//Work on path and ensure no back tracking
|
||||
string sSubDir = Request.QueryString.Get("path");
|
||||
if (string.IsNullOrEmpty(sSubDir)) { sSubDir = "/"; }
|
||||
|
||||
sSubDir = sSubDir.Replace(IOHelper.DirSepChar.ToString(), "");
|
||||
sSubDir = sSubDir.Replace("//", "/");
|
||||
sSubDir = sSubDir.Replace("..", "./");
|
||||
sSubDir = sSubDir.Replace('/', IOHelper.DirSepChar);
|
||||
|
||||
//Clean path for processing and collect path varitations
|
||||
if (sSubDir.Substring(0, 1) != sebChar) { sSubDir = sebChar + sSubDir; }
|
||||
if (sSubDir.Substring(sSubDir.Length - 1, 1) != "\\") { sSubDir = sSubDir + sebChar; }
|
||||
|
||||
//Get name of the browser script file
|
||||
_lsScriptName = Request.ServerVariables.Get("SCRIPT_NAME");
|
||||
var j = _lsScriptName.LastIndexOf("/");
|
||||
if (j > 0) { _lsScriptName = _lsScriptName.Substring(j + 1, _lsScriptName.Length - (j + 1)).ToLower(); }
|
||||
|
||||
//Create navigation string and other path strings
|
||||
GetNavLink("", "root");
|
||||
if (sSubDir != sebChar)
|
||||
{
|
||||
j = 0; int i = 0;
|
||||
do
|
||||
{
|
||||
i = sSubDir.IndexOf(sebChar, j + 1);
|
||||
_lsWebPath += sSubDir.Substring(j + 1, i - (j + 1)) + "/";
|
||||
GetNavLink(_lsWebPath, sSubDir.Substring(j + 1, i - (j + 1)));
|
||||
j = i;
|
||||
} while (i != sSubDir.Length - 1);
|
||||
}
|
||||
|
||||
//Output header
|
||||
_sb.Append("<table cellpadding=3 cellspacing=1><tbody>");
|
||||
|
||||
//Output directorys
|
||||
var oDirInfo = new DirectoryInfo(IOHelper.MapPath("~/" + sSubDir));
|
||||
var oDirs = oDirInfo.GetDirectories();
|
||||
foreach (var oDir in oDirs)
|
||||
{
|
||||
try
|
||||
{
|
||||
_sb.Append("<tr><td class=\"tdDir\"><a href=\"" + _lsScriptName + "?path=" + _lsWebPath + oDir.Name + "&target=" + Target + "\">" + oDir.Name + "</a> <small><a href=\"javascript:postPath('/" + _lsWebPath + oDir.Name + "')\"> (Include entire folder)</small></td></tr>");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_sb.Append("<tr><td class=\"tdDir\">" + oDir.Name + " (Access Denied)</td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
//Ouput files
|
||||
var oFiles = oDirInfo.GetFiles();
|
||||
foreach (var oFile in oFiles.Where(oFile => oFile.Name.ToLower() != _lsScriptName))
|
||||
{
|
||||
decimal iLen = oFile.Length;
|
||||
string sLen;
|
||||
if (iLen >= 1048960) { iLen = iLen / 1048960; sLen = "mb"; } else { iLen = iLen / 1024; sLen = "kb"; }
|
||||
sLen = Decimal.Round(iLen, 2).ToString() + sLen;
|
||||
_sb.Append("<tr><td class=\"tdFile\"><a href=\"javascript:postPath('/" + _lsWebPath + oFile.Name + "')\">" + oFile.Name + "</a></td></tr>");
|
||||
}
|
||||
|
||||
//Output footer
|
||||
_sb.Append("</tbody></table></center>");
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
RptErr(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPreRender(EventArgs e)
|
||||
{
|
||||
base.OnPreRender(e);
|
||||
Output.Controls.Add(new LiteralControl(_sb.ToString()));
|
||||
}
|
||||
|
||||
private void RptErr(string psMessage)
|
||||
{
|
||||
_sb.Append("<DIV align=\"left\" width=\"100%\"><B>Script Reported Error: </B> " + psMessage + "</DIV><BR>");
|
||||
}
|
||||
|
||||
private string GetNavLink(string psHref, string psText)
|
||||
{
|
||||
return ("/<a class=\"tdheadA\" href=\"" + _lsScriptName + "?path=" + psHref + "\">" + psText + "</a>");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
@@ -7,36 +7,36 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace umbraco.settings {
|
||||
namespace Umbraco.Web.UI.Umbraco.Developer.Packages {
|
||||
|
||||
|
||||
public partial class EditContentTypeNew {
|
||||
public partial class DirectoryBrowser {
|
||||
|
||||
/// <summary>
|
||||
/// tmpPane control.
|
||||
/// CssInclude1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane tmpPane;
|
||||
protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// templateList control.
|
||||
/// pane control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBoxList templateList;
|
||||
protected global::umbraco.uicontrols.Pane pane;
|
||||
|
||||
/// <summary>
|
||||
/// ddlTemplates control.
|
||||
/// Output control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlTemplates;
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder Output;
|
||||
}
|
||||
}
|
||||
@@ -1,142 +1,24 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master"Inherits="umbraco.presentation.developer.packages.directoryBrowser" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Import Namespace="System.IO" %>
|
||||
<%@ Page Language="C#" AutoEventWireup="True" MasterPageFile="../../masterpages/umbracoPage.Master" CodeBehind="DirectoryBrowser.aspx.cs" Inherits="Umbraco.Web.UI.Umbraco.Developer.Packages.DirectoryBrowser" %>
|
||||
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagPrefix="cdf" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="head" runat="server">
|
||||
<script language="C#" runat="server">
|
||||
//Import Namespace="System.Math"
|
||||
string lsTitle;
|
||||
string lsLink;
|
||||
string lsScriptName;
|
||||
string lsWebPath;
|
||||
string target = "";
|
||||
|
||||
public void Page_Load()
|
||||
{
|
||||
Response.Cache.SetExpires(DateTime.Now.AddSeconds(5));
|
||||
Response.Cache.SetCacheability(HttpCacheability.Public);
|
||||
lsTitle = Request.QueryString.Get("title");
|
||||
target = Request.QueryString.Get("target");
|
||||
if (lsTitle == null || lsTitle == "") { lsTitle = "Web Browse"; }
|
||||
}
|
||||
|
||||
private void RptErr(string psMessage)
|
||||
{
|
||||
Response.Write("<DIV align=\"left\" width=\"100%\"><B>Script Reported Error: </B> " + psMessage + "</DIV><BR>");
|
||||
}
|
||||
|
||||
private string GetNavLink(string psHref, string psText)
|
||||
{
|
||||
return ("/<a class=\"tdheadA\" href=\"" + lsScriptName + "?path=" + psHref + "&title=" + lsTitle + "&link=" + lsLink + "\">" + psText + "</a>");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
a{color:#3C6B96;}
|
||||
|
||||
.tdDir a{padding: 3px; padding-left: 25px; background: url(../../images/foldericon.png) no-repeat 2px 2px;}
|
||||
.tdFile a{padding: 3px; padding-left: 25px; background: url(../../images/file.png) no-repeat 2px 2px;}
|
||||
small a{color: #999; padding-left: 3px !Important; background-image: none !Important; text-decoration: none;}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
function postPath(path) {
|
||||
top.right.document.getElementById('<%=target%>').value = path;
|
||||
UmbClientMgr.closeModalWindow();
|
||||
}
|
||||
</script>
|
||||
|
||||
<cdf:CssInclude ID="CssInclude1" runat="server" FilePath="Editors/DirectoryBrowser.css" PathNameAlias="UmbracoClient"></cdf:CssInclude>
|
||||
|
||||
<script type="text/javascript">
|
||||
function postPath(path) {
|
||||
var elementId = '<%=Target%>';
|
||||
top.right.document.getElementById(elementId).value = path;
|
||||
UmbClientMgr.closeModalWindow();
|
||||
}
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="body" runat="server">
|
||||
<cc1:Pane runat="server" Width="100px" ID="pane">
|
||||
<%
|
||||
try
|
||||
{
|
||||
|
||||
//Variables used in script
|
||||
string sSubDir; int i; int j;
|
||||
string sPrevLink = "";
|
||||
string sebChar = umbraco.IO.IOHelper.DirSepChar.ToString();
|
||||
decimal iLen; string sLen;
|
||||
|
||||
//Write header, get link param
|
||||
lsLink = Request.QueryString.Get("link");
|
||||
if (lsLink != null && lsLink != "") { Response.Write("<A href=\"" + lsLink + "\">[ Return ]</A><BR>"); }
|
||||
|
||||
//Work on path and ensure no back tracking
|
||||
sSubDir = Request.QueryString.Get("path");
|
||||
if (sSubDir == null || sSubDir == "") { sSubDir = "/"; }
|
||||
|
||||
sSubDir = sSubDir.Replace(umbraco.IO.IOHelper.DirSepChar.ToString(), "");
|
||||
sSubDir = sSubDir.Replace("//", "/");
|
||||
sSubDir = sSubDir.Replace("..", "./");
|
||||
sSubDir = sSubDir.Replace('/', umbraco.IO.IOHelper.DirSepChar);
|
||||
|
||||
//Clean path for processing and collect path varitations
|
||||
if (sSubDir.Substring(0, 1) != sebChar) { sSubDir = sebChar + sSubDir; }
|
||||
if (sSubDir.Substring(sSubDir.Length - 1, 1) != "\\") { sSubDir = sSubDir + sebChar; }
|
||||
|
||||
//Get name of the browser script file
|
||||
lsScriptName = Request.ServerVariables.Get("SCRIPT_NAME");
|
||||
j = lsScriptName.LastIndexOf("/");
|
||||
if (j > 0) { lsScriptName = lsScriptName.Substring(j + 1, lsScriptName.Length - (j + 1)).ToLower(); }
|
||||
|
||||
//Create navigation string and other path strings
|
||||
sPrevLink += GetNavLink("", "root");
|
||||
if (sSubDir != sebChar)
|
||||
{
|
||||
j = 0; i = 0;
|
||||
do
|
||||
{
|
||||
i = sSubDir.IndexOf(sebChar, j + 1);
|
||||
lsWebPath += sSubDir.Substring(j + 1, i - (j + 1)) + "/";
|
||||
sPrevLink += GetNavLink(lsWebPath, sSubDir.Substring(j + 1, i - (j + 1)));
|
||||
j = i;
|
||||
} while (i != sSubDir.Length - 1);
|
||||
}
|
||||
|
||||
//Output header
|
||||
Response.Write("<table cellpadding=3 cellspacing=1><tbody>");
|
||||
|
||||
//Output directorys
|
||||
DirectoryInfo oDirInfo = new DirectoryInfo(umbraco.IO.IOHelper.MapPath("~/" + sSubDir));
|
||||
DirectoryInfo[] oDirs = oDirInfo.GetDirectories();
|
||||
foreach (DirectoryInfo oDir in oDirs)
|
||||
{
|
||||
try
|
||||
{
|
||||
Response.Write("<tr><td class=\"tdDir\"><a href=\"" + lsScriptName + "?path=" + lsWebPath + oDir.Name + "&title=" + lsTitle + "&link=" + lsLink + "&target=" + target + "\">" + oDir.Name + "</a> <small><a href=\"javascript:postPath('/" + lsWebPath + oDir.Name + "')\"> (Include entire folder)</small></td></tr>");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Response.Write("<tr><td class=\"tdDir\">" + oDir.Name + " (Access Denied)</td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
//Ouput files
|
||||
FileInfo[] oFiles = oDirInfo.GetFiles();
|
||||
foreach (FileInfo oFile in oFiles)
|
||||
{
|
||||
if (oFile.Name.ToLower() != lsScriptName)
|
||||
{
|
||||
iLen = oFile.Length;
|
||||
if (iLen >= 1048960) { iLen = iLen / 1048960; sLen = "mb"; } else { iLen = iLen / 1024; sLen = "kb"; }
|
||||
sLen = Decimal.Round(iLen, 2).ToString() + sLen;
|
||||
Response.Write("<tr><td class=\"tdFile\"><a href=\"javascript:postPath('/" + lsWebPath + oFile.Name + "')\">" + oFile.Name + "</a></td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
//Output footer
|
||||
Response.Write("</tbody></table></center>");
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
RptErr(ex.Message);
|
||||
}
|
||||
%>
|
||||
<cc1:Pane runat="server" Width="100px" ID="pane">
|
||||
<asp:PlaceHolder runat="server" ID="Output"></asp:PlaceHolder>
|
||||
</cc1:Pane>
|
||||
</asp:Content>
|
||||
</asp:Content>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Dialogs
|
||||
{
|
||||
public partial class Sort : global::umbraco.cms.presentation.sort
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Dialogs {
|
||||
|
||||
|
||||
public partial class Sort {
|
||||
|
||||
/// <summary>
|
||||
/// CssInclude1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// JsInclude3 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude3;
|
||||
}
|
||||
}
|
||||
@@ -1,135 +1,81 @@
|
||||
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master"Codebehind="sort.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.sort" %>
|
||||
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" CodeBehind="sort.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.Dialogs.Sort" %>
|
||||
|
||||
<%@ Import Namespace="System.Globalization" %>
|
||||
<%@ Import Namespace="Umbraco.Core.IO" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="head" runat="server">
|
||||
|
||||
<style type="text/css">
|
||||
#sortableFrame{height: 270px; overflow: auto; border: 1px solid #ccc;}
|
||||
#sortableNodes{padding: 4px; display: block}
|
||||
#sortableNodes thead tr th{border-bottom:1px solid #ccc; padding: 4px; padding-right: 25px;
|
||||
background-image: url(<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco_client) %>/tableSorting/img/bg.gif);
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center right;
|
||||
}
|
||||
|
||||
#sortableNodes thead tr th.headerSortDown {
|
||||
background-image: url(<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco_client) %>/tableSorting/img/desc.gif);
|
||||
}
|
||||
|
||||
#sortableNodes thead tr th.headerSortUp {
|
||||
background-image: url(<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco_client) %>/tableSorting/img/asc.gif);
|
||||
}
|
||||
|
||||
#sortableNodes tbody tr td{border-bottom:1px solid #efefef}
|
||||
#sortableNodes td{padding: 4px; cursor: move;}
|
||||
tr.tDnD_whileDrag , tr.tDnD_whileDrag td{background:#dcecf3; border-color: #a8d8eb !Important; margin-top: 20px;}
|
||||
#sortableNodes .nowrap{white-space: nowrap; }
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
<umb:CssInclude ID="CssInclude1" runat="server" FilePath="Dialogs/SortDialog.css" PathNameAlias="UmbracoClient"></umb:CssInclude>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="body" runat="server">
|
||||
|
||||
<umb:JsInclude ID="JsInclude3" runat="server" FilePath="Dialogs/SortDialog.js" PathNameAlias="UmbracoClient" />
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="tablesorting/jquery.tablesorter.min.js" PathNameAlias="UmbracoClient" />
|
||||
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="tablesorting/tableDragAndDrop.js" PathNameAlias="UmbracoClient" />
|
||||
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="tablesorting/tableFilter.js" PathNameAlias="UmbracoClient"/>
|
||||
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="tablesorting/tableDragAndDrop.js" PathNameAlias="UmbracoClient"/>
|
||||
<div id="loading" style="display: none;">
|
||||
<div class="notice">
|
||||
<p><%= umbraco.ui.Text("sort", "sortPleaseWait") %></p>
|
||||
</div>
|
||||
<br />
|
||||
<cc1:ProgressBar ID="prog1" runat="server" Title="sorting.." />
|
||||
</div>
|
||||
|
||||
<div id="loading" style="display: none;">
|
||||
<div class="notice">
|
||||
<p><%= umbraco.ui.Text("sort", "sortPleaseWait") %></p>
|
||||
</div>
|
||||
<br />
|
||||
<cc1:ProgressBar ID="prog1" runat="server" Title="sorting.." />
|
||||
</div>
|
||||
<div id="sortingDone" style="display: none;" class="success">
|
||||
<p>
|
||||
<asp:Literal runat="server" ID="sortDone"></asp:Literal></p>
|
||||
<p>
|
||||
<a href="#" onclick="UmbClientMgr.closeModalWindow()"><%= umbraco.ui.Text("defaultdialogs", "closeThisWindow")%></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="sortingDone" style="display: none;" class="success">
|
||||
<p><asp:Literal runat="server" ID="sortDone"></asp:Literal></p>
|
||||
<p>
|
||||
<a href="#" onclick="UmbClientMgr.closeModalWindow()"><%= umbraco.ui.Text("defaultdialogs", "closeThisWindow")%></a>
|
||||
</p>
|
||||
</div>
|
||||
<div id="sortArea">
|
||||
<cc1:Pane runat="server" ID="sortPane">
|
||||
|
||||
<p class="help">
|
||||
<%= umbraco.ui.Text("sort", "sortHelp") %>
|
||||
</p>
|
||||
|
||||
<div id="sortArea">
|
||||
<cc1:Pane runat="server" ID="sortPane">
|
||||
<p class="help">
|
||||
<%= umbraco.ui.Text("sort", "sortHelp") %>
|
||||
</p>
|
||||
|
||||
<div id="sortableFrame">
|
||||
<table id="sortableNodes" cellspacing="0">
|
||||
<colgroup>
|
||||
<col/>
|
||||
<col/>
|
||||
<col/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100%">Name</th>
|
||||
<th class="nowrap">Creation date</th>
|
||||
<th class="nowrap">Sort order</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<asp:Literal ID="lt_nodes" runat="server" />
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</cc1:Pane>
|
||||
<div id="sortableFrame">
|
||||
<table id="sortableNodes">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100%">Name</th>
|
||||
<th class="nowrap">Creation date</th>
|
||||
<th class="nowrap">Sort order</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<asp:Literal ID="lt_nodes" runat="server" />
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</cc1:Pane>
|
||||
|
||||
<br />
|
||||
<p>
|
||||
<input type="button" onclick="sort(); return false;" value="<%=umbraco.ui.Text("save") %>" />
|
||||
<em> or </em><a href="#" style="color: blue" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<br />
|
||||
<p>
|
||||
<input id="submitButton" type="button" value="<%=umbraco.ui.Text("save") %>" />
|
||||
<em>or </em><a id="closeWindowButton" href="#" style="color: blue"><%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#sortableNodes").tablesorter();
|
||||
jQuery("#sortableNodes").tableDnD({containment: jQuery("#sortableFrame") } );
|
||||
});
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
function sort() {
|
||||
var rows = jQuery('#sortableNodes tbody tr');
|
||||
var sortOrder = "";
|
||||
|
||||
jQuery.each(rows, function() {
|
||||
sortOrder += jQuery(this).attr("id").replace("node_","") + ",";
|
||||
});
|
||||
|
||||
document.getElementById("sortingDone").style.display = 'none';
|
||||
document.getElementById("sortArea").style.display = 'none';
|
||||
|
||||
document.getElementById("loading").style.display = 'block';
|
||||
|
||||
var _this = this;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/WebServices/NodeSorter.asmx/UpdateSortOrder?app=<%=umbraco.helper.Request("app")%>",
|
||||
data: '{ "ParentId": ' + parseInt(<%=umbraco.helper.Request("ID")%>) + ', "SortOrder": "' + sortOrder + '"}',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: function(msg) {
|
||||
showConfirm();
|
||||
}
|
||||
var sortDialog = new Umbraco.Dialogs.SortDialog({
|
||||
submitButton: jQuery("#submitButton"),
|
||||
closeWindowButton : jQuery("#closeWindowButton"),
|
||||
dateTimeFormat: "<%=CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern%> <%=CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern%>",
|
||||
currentId: "<%=umbraco.helper.Request("ID")%>",
|
||||
serviceUrl: "<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/WebServices/NodeSorter.asmx/UpdateSortOrder?app=<%=umbraco.helper.Request("app")%>"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showConfirm() {
|
||||
document.getElementById("loading").style.display = 'none';
|
||||
document.getElementById("sortingDone").style.display = 'block';
|
||||
UmbClientMgr.mainTree().reloadActionNode();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
sortDialog.init();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
function umbracoCheckUpgrade(result) {
|
||||
if (result.UpgradeType.toLowerCase() != 'none') {
|
||||
if (UmbSpeechBubble == null) {
|
||||
InitUmbracoSpeechBubble();
|
||||
if (result) {
|
||||
if (result.UpgradeType.toLowerCase() != 'none') {
|
||||
if (UmbSpeechBubble == null) {
|
||||
InitUmbracoSpeechBubble();
|
||||
}
|
||||
var icon = 'info';
|
||||
if (result.UpgradeType.toLowerCase() == 'critical') {
|
||||
icon = 'error';
|
||||
}
|
||||
|
||||
UmbSpeechBubble.ShowMessage(icon, 'Upgrade Available!', '<a style="text-decoration:none" target="_blank" href="' + result.UpgradeUrl + '">' + result.UpgradeComment + '</a>', true);
|
||||
}
|
||||
var icon = 'info';
|
||||
if (result.UpgradeType.toLowerCase() == 'critical') {
|
||||
icon = 'error';
|
||||
}
|
||||
|
||||
UmbSpeechBubble.ShowMessage(icon, 'Upgrade Available!', '<a style="text-decoration:none" target="_blank" href="' + result.UpgradeUrl + '">' + result.UpgradeComment + '</a>', true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
<%@ Page language="c#" Codebehind="ping.aspx.cs" AutoEventWireup="True" Inherits="umbraco.presentation.ping" %>
|
||||
<%@ Page language="c#" Codebehind="ping.aspx.cs" AutoEventWireup="True" Inherits="System.Web.UI.Page" %>
|
||||
I'm alive!
|
||||
@@ -1,5 +1,5 @@
|
||||
<%@ Page Language="c#" CodeBehind="EditNodeTypeNew.aspx.cs" AutoEventWireup="True"
|
||||
Trace="false" Inherits="umbraco.settings.EditContentTypeNew" MasterPageFile="../masterpages/umbracoPage.Master" %>
|
||||
Async="true" AsyncTimeOut="300" Trace="false" Inherits="Umbraco.Web.UI.Umbraco.Settings.EditNodeTypeNew" MasterPageFile="../masterpages/umbracoPage.Master" %>
|
||||
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagPrefix="uc1" TagName="ContentTypeControlNew" Src="../controls/ContentTypeControlNew.ascx" %>
|
||||
@@ -9,7 +9,7 @@
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
// Auto selection/de-selection of default template based on allow templates
|
||||
jQuery("#<%= templateList.ClientID %> input[type='checkbox']").on("change", function () {
|
||||
jQuery("#<%= templateList.ClientID %> input[type='checkbox']").on("change", function() {
|
||||
var checkbox = jQuery(this);
|
||||
var ddl = jQuery("#<%= ddlTemplates.ClientID %>");
|
||||
// If default template is not set, and an allowed template is selected, auto-select the default template
|
||||
@@ -17,7 +17,8 @@
|
||||
if (ddl.val() == "0") {
|
||||
ddl.val(checkbox.val());
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// If allowed template has been de-selected, and it's selected as the default, then de-select the default template
|
||||
if (ddl.val() == checkbox.val()) {
|
||||
ddl.val("0");
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Settings
|
||||
{
|
||||
public partial class EditNodeTypeNew : global::umbraco.settings.EditContentTypeNew
|
||||
{
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
@@ -7,9 +7,9 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace umbraco.presentation.umbraco.channels {
|
||||
namespace Umbraco.Web.UI.Umbraco.Settings {
|
||||
|
||||
|
||||
public partial class rsd {
|
||||
public partial class EditNodeTypeNew {
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<%@ Page Language="c#" MasterPageFile="../../masterpages/umbracoPage.Master" Title="ShowUmbracoTags"
|
||||
Codebehind="ShowUmbracoTags.aspx.cs" AutoEventWireup="True"
|
||||
Inherits="umbraco.cms.presentation.settings.modal.ShowUmbracoTags" %>
|
||||
<%@ Import Namespace="Umbraco.Core.IO" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
@@ -44,9 +45,9 @@
|
||||
</td></tr>
|
||||
<tr><th width="120">MetaBlogApi / Content Channels</th><td>
|
||||
<code>
|
||||
<link rel="EditURI" type="application/rsd+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/channels/rsd.aspx" />
|
||||
<link rel="EditURI" type="application/rsd+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/channels/rsd.aspx" />
|
||||
<br /><br />
|
||||
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/channels/wlwmanifest.aspx" />
|
||||
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/channels/wlwmanifest.aspx" />
|
||||
</code>
|
||||
<small>
|
||||
Insert the above two elements to the head element to gain optimal support for
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Web.Trees;
|
||||
using Umbraco.Web.UI.Controls;
|
||||
using umbraco;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.cms.businesslogic.template;
|
||||
@@ -166,7 +167,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views
|
||||
640, 550);
|
||||
umbDictionary.AltText = "Insert umbraco dictionary item";
|
||||
|
||||
var macroSplitButton = new Controls.InsertMacroSplitButton
|
||||
var macroSplitButton = new InsertMacroSplitButton
|
||||
{
|
||||
ClientCallbackInsertMacroMarkup = "function(alias) {editViewEditor.insertMacroMarkup(alias);}",
|
||||
ClientCallbackOpenMacroModel = "function(alias) {editViewEditor.openMacroModal(alias);}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference path="/umbraco_client/Application/NamespaceManager.js" />
|
||||
/// <reference name="MicrosoftAjax.js"/>
|
||||
/// <reference path="/umbraco_client/Application/Query/jquery.ba-bbq.min.js" />
|
||||
/// <reference path="/umbraco_client/Application/JQuery/jquery.ba-bbq.min.js" />
|
||||
|
||||
Umbraco.Sys.registerNamespace("Umbraco.Controls");
|
||||
|
||||
@@ -8,18 +8,28 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
|
||||
|
||||
Umbraco.Controls.HistoryManager = function() {
|
||||
/// <summary>This is a wrapper for the bbq plugin history manager, but we could do alot with history mgmt in the future!</summary>
|
||||
|
||||
var hashFragmentRegex = new RegExp(/^\w+/);
|
||||
function getHashFragment(frag) {
|
||||
//tests for xss and ensures only the first alphanumeric chars are matched
|
||||
var result = hashFragmentRegex.exec(frag);
|
||||
if (result != null && result.length > 0) {
|
||||
return result[0];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
var obj = {
|
||||
|
||||
onNavigate: function(e) {
|
||||
|
||||
var l = $.param.fragment();
|
||||
if (l != "") {
|
||||
jQuery(window.top).trigger("navigating", [$.param.fragment()]); //raise event!
|
||||
var fragment = getHashFragment($.param.fragment());
|
||||
if (fragment != "") {
|
||||
jQuery(window.top).trigger("navigating", [fragment]); //raise event!
|
||||
}
|
||||
|
||||
},
|
||||
addHistory: function(name, forceRefresh) {
|
||||
if ($.param.fragment() == name && forceRefresh) {
|
||||
var fragment = getHashFragment($.param.fragment());
|
||||
if (fragment == name && forceRefresh) {
|
||||
this.onNavigate();
|
||||
}
|
||||
else {
|
||||
@@ -27,8 +37,8 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
|
||||
}
|
||||
|
||||
},
|
||||
getCurrent: function() {
|
||||
return ($.param.fragment().length > 0) ? $.param.fragment() : "";
|
||||
getCurrent: function () {
|
||||
return getHashFragment($.param.fragment());
|
||||
},
|
||||
|
||||
addEventHandler: function(fnName, fn) {
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#sortableFrame
|
||||
{
|
||||
height: 270px;
|
||||
overflow: auto;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#sortableNodes
|
||||
{
|
||||
padding: 4px;
|
||||
display: block;
|
||||
border-spacing:0;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
#sortableNodes thead tr th
|
||||
{
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 4px;
|
||||
padding-right: 25px;
|
||||
background-image: url(../tableSorting/img/bg.gif);
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center right;
|
||||
}
|
||||
|
||||
#sortableNodes thead tr th.headerSortDown
|
||||
{
|
||||
background-image: url(../tableSorting/img/desc.gif);
|
||||
}
|
||||
|
||||
#sortableNodes thead tr th.headerSortUp
|
||||
{
|
||||
background-image: url(../tableSorting/img/asc.gif);
|
||||
}
|
||||
|
||||
#sortableNodes tbody tr td
|
||||
{
|
||||
border-bottom: 1px solid #efefef;
|
||||
}
|
||||
|
||||
#sortableNodes td
|
||||
{
|
||||
padding: 4px;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
tr.tDnD_whileDrag, tr.tDnD_whileDrag td
|
||||
{
|
||||
background: #dcecf3;
|
||||
border-color: #a8d8eb !Important;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#sortableNodes .nowrap
|
||||
{
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
Umbraco.Sys.registerNamespace("Umbraco.Dialogs");
|
||||
|
||||
(function ($) {
|
||||
|
||||
|
||||
Umbraco.Dialogs.SortDialog = base2.Base.extend({
|
||||
//private methods/variables
|
||||
_opts: null,
|
||||
|
||||
_setupTableSorter: function () {
|
||||
//adds a custom sorter to the tablesorter based on the current cultures date/time format
|
||||
$.tablesorter.addParser({
|
||||
// use a unique id
|
||||
id: 'cultureDateParser',
|
||||
is: function(s, table, cell) {
|
||||
//don't auto-detect this parser
|
||||
return false;
|
||||
},
|
||||
format: function(s, table, cell, cellIndex) {
|
||||
var c = table.config;
|
||||
|
||||
s = s.replace(/\-/g, "/");
|
||||
//all of these basically transform the string into year-month-day since that
|
||||
//is what JS understands when creating a Date object
|
||||
if (c.dateFormat.indexOf("dd/MM/yyyy") == 0 || c.dateFormat.indexOf("dd-MM-yyyy") == 0) {
|
||||
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3-$2-$1");
|
||||
}
|
||||
else if (c.dateFormat.indexOf("dd/MM/yy") == 0 || c.dateFormat.indexOf("dd-MM-yy") == 0) {
|
||||
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$3-$2-$1");
|
||||
}
|
||||
else if (c.dateFormat.indexOf("MM/dd/yyyy") == 0 || c.dateFormat.indexOf("MM-dd-yyyy") == 0) {
|
||||
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3-$1-$2");
|
||||
}
|
||||
else if (c.dateFormat.indexOf("MM/dd/yy") == 0 || c.dateFormat.indexOf("MM-dd-yy") == 0) {
|
||||
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$3-$1-$2");
|
||||
}
|
||||
return $.tablesorter.formatFloat(new Date(s).getTime());
|
||||
},
|
||||
// set the type to either numeric or text (text uses a natural sort function
|
||||
// so it will work for everything, but numeric is faster for numbers
|
||||
type: 'numeric'
|
||||
});
|
||||
},
|
||||
|
||||
_saveSort: function() {
|
||||
var rows = jQuery('#sortableNodes tbody tr');
|
||||
var sortOrder = "";
|
||||
|
||||
$.each(rows, function () {
|
||||
sortOrder += $(this).attr("id").replace("node_", "") + ",";
|
||||
});
|
||||
|
||||
document.getElementById("sortingDone").style.display = 'none';
|
||||
document.getElementById("sortArea").style.display = 'none';
|
||||
|
||||
document.getElementById("loading").style.display = 'block';
|
||||
|
||||
var self = this;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: self._opts.serviceUrl,
|
||||
data: '{ "ParentId": ' + parseInt(self._opts.currentId) + ', "SortOrder": "' + sortOrder + '"}',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: function(msg) {
|
||||
self._showConfirm();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_showConfirm: function() {
|
||||
document.getElementById("loading").style.display = 'none';
|
||||
document.getElementById("sortingDone").style.display = 'block';
|
||||
UmbClientMgr.mainTree().reloadActionNode();
|
||||
},
|
||||
|
||||
// Constructor
|
||||
constructor: function (opts) {
|
||||
// Merge options with default
|
||||
this._opts = $.extend({
|
||||
// Default options go here
|
||||
}, opts);
|
||||
|
||||
this._setupTableSorter();
|
||||
},
|
||||
|
||||
//public methods/variables
|
||||
|
||||
init: function () {
|
||||
var self = this;
|
||||
|
||||
//create the sorter
|
||||
$("#sortableNodes").tablesorter({
|
||||
dateFormat: self._opts.dateTimeFormat,
|
||||
headers: {
|
||||
0: { sorter: "text" },
|
||||
1: { sorter: "cultureDateParser" }, //ensure to set our custom parser here
|
||||
2: { sorter: "numeric" }
|
||||
}
|
||||
});
|
||||
|
||||
//setup the drag/drop sorting
|
||||
$("#sortableNodes").tableDnD({ containment: jQuery("#sortableFrame") });
|
||||
|
||||
//wire up the submit button
|
||||
self._opts.submitButton.click(function() {
|
||||
self._saveSort();
|
||||
});
|
||||
|
||||
//wire up the close button
|
||||
self._opts.closeWindowButton.click(function () {
|
||||
UmbClientMgr.closeModalWindow();
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,28 @@
|
||||
a
|
||||
{
|
||||
color: #3C6B96;
|
||||
}
|
||||
|
||||
.tdDir a
|
||||
{
|
||||
color: #3C6B96;
|
||||
padding: 3px;
|
||||
padding-left: 25px;
|
||||
background: url(../../umbraco/images/foldericon.png) no-repeat 2px 2px;
|
||||
}
|
||||
|
||||
.tdFile a
|
||||
{
|
||||
color: #3C6B96;
|
||||
padding: 3px;
|
||||
padding-left: 25px;
|
||||
background: url(../../umbraco/images/file.png) no-repeat 2px 2px;
|
||||
}
|
||||
|
||||
small a
|
||||
{
|
||||
color: #999;
|
||||
padding-left: 3px !Important;
|
||||
background-image: none !Important;
|
||||
text-decoration: none;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 830 B |
Binary file not shown.
|
After Width: | Height: | Size: 833 B |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -97,24 +97,23 @@
|
||||
var t = "";
|
||||
var clsName = "";
|
||||
var pH = ""; //addition html
|
||||
if (options.useSprite != false) {
|
||||
clsName = ' ' + options.useSprite + ' ' + currentOptOption.className;
|
||||
} else {
|
||||
arrow = $(currentOptOption).prop("title");
|
||||
var reg = new RegExp(/^\{.*\}$/);
|
||||
var isJson = reg.test(arrow);
|
||||
if (options.jsonTitle == true && isJson == true) {
|
||||
if (arrow.length != 0) {
|
||||
var obj = eval("[" + arrow + "]");
|
||||
img = (typeof obj[0].image == "undefined") ? "" : obj[0].image;
|
||||
t = (typeof obj[0].title == "undefined") ? "" : obj[0].title;
|
||||
pH = (typeof obj[0].postHTML == "undefined") ? "" : obj[0].postHTML;
|
||||
arrow = (img.length == 0) ? "" : '<img src="' + img + '" align="absmiddle" /> ';
|
||||
};
|
||||
} else {
|
||||
arrow = (arrow.length == 0) ? "" : '<img src="' + arrow + '" align="absmiddle" /> ';
|
||||
|
||||
clsName = ' ' + options.useSprite + ' ' + currentOptOption.className;
|
||||
arrow = $(currentOptOption).prop("title");
|
||||
var reg = new RegExp(/^\{.*\}$/);
|
||||
var isJson = reg.test(arrow);
|
||||
if (options.jsonTitle == true && isJson == true) {
|
||||
if (arrow.length != 0) {
|
||||
var obj = eval("[" + arrow + "]");
|
||||
img = (typeof obj[0].image == "undefined") ? "" : obj[0].image;
|
||||
t = (typeof obj[0].title == "undefined") ? "" : obj[0].title;
|
||||
pH = (typeof obj[0].postHTML == "undefined") ? "" : obj[0].postHTML;
|
||||
arrow = (img.length == 0) ? "" : '<img src="' + img + '" align="absmiddle" /> ';
|
||||
};
|
||||
} else {
|
||||
arrow = (arrow.length == 0) ? "" : '<img src="' + arrow + '" align="absmiddle" /> ';
|
||||
};
|
||||
|
||||
var sText = $(currentOptOption).text();
|
||||
var sValue = $(currentOptOption).val();
|
||||
var sEnabledClass = ($(currentOptOption).prop("disabled") == true) ? "disabled" : "enabled";
|
||||
@@ -325,7 +324,7 @@
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
$("#" + childid).bind("mouseout", function (event) { setInsideWindow(false); $(document).unbind("keydown", d_onkeydown); actionSettings.keyboardAction = false; actionSettings.currentKey = null; });
|
||||
@@ -385,7 +384,7 @@
|
||||
//shift
|
||||
var currentSelected = $(obj).prop("id");
|
||||
var currentIndex = a_array[currentSelected].index;
|
||||
for (var i = Math.min(oldIndex, currentIndex); i <= Math.max(oldIndex, currentIndex); i++) {
|
||||
for (var i = Math.min(oldIndex, currentIndex) ; i <= Math.max(oldIndex, currentIndex) ; i++) {
|
||||
$("#" + getByIndex(i).id).addClass(styles.selected);
|
||||
};
|
||||
} else {
|
||||
@@ -621,7 +620,7 @@
|
||||
if (has_handler('change') == true) {
|
||||
//alert(1);
|
||||
var currentSelected = a_array[$("#" + childid + " a.selected").prop("id")];
|
||||
if(currentSelected != undefined) {
|
||||
if (currentSelected != undefined) {
|
||||
var currentSelectedValue = currentSelected.text;
|
||||
if ($.trim(oldSelectedValue) !== $.trim(currentSelectedValue) && oldSelectedValue !== "") {
|
||||
$("#" + elementid).trigger("change");
|
||||
@@ -786,9 +785,9 @@
|
||||
};
|
||||
if ($("#" + childid).css("display") == "none") {
|
||||
var oldSelected = a_array[$("#" + childid + " a.selected").prop("id")];
|
||||
if(oldSelected != undefined)
|
||||
if (oldSelected != undefined)
|
||||
oldSelectedValue = oldSelected.text;
|
||||
|
||||
|
||||
//keyboard action
|
||||
inputText = "";
|
||||
oldHeight = $("#" + childid).height();
|
||||
|
||||
@@ -39,10 +39,10 @@ namespace Umbraco.Web
|
||||
// of course we should have a proper scheduler, see #U4-809
|
||||
|
||||
// ping/keepalive
|
||||
_pingTimer = new Timer(new TimerCallback(global::umbraco.presentation.keepAliveService.PingUmbraco), umbracoApplication.Context, 60000, 300000);
|
||||
_pingTimer = new Timer(new TimerCallback(global::umbraco.presentation.keepAliveService.PingUmbraco), applicationContext, 60000, 300000);
|
||||
|
||||
// (un)publishing _and_ also run scheduled tasks (!)
|
||||
_publishingTimer = new Timer(new TimerCallback(global::umbraco.presentation.publishingService.CheckPublishing), umbracoApplication.Context, 30000, 60000);
|
||||
_publishingTimer = new Timer(new TimerCallback(global::umbraco.presentation.publishingService.CheckPublishing), applicationContext, 30000, 60000);
|
||||
|
||||
// log scrubbing
|
||||
AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval());
|
||||
|
||||
@@ -784,128 +784,100 @@ namespace Umbraco.Web
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ancestors
|
||||
#region Ancestors
|
||||
|
||||
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content)
|
||||
{
|
||||
return content.AncestorsOrSelf(false, n => true);
|
||||
}
|
||||
|
||||
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content, int level)
|
||||
{
|
||||
return content.AncestorsOrSelf(false, n => n.Level <= level);
|
||||
}
|
||||
|
||||
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content, string nodeTypeAlias)
|
||||
{
|
||||
return content.AncestorsOrSelf(false, n => n.DocumentTypeAlias == nodeTypeAlias);
|
||||
}
|
||||
|
||||
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content, int level)
|
||||
{
|
||||
return content.Ancestors(n => n.Level <= level);
|
||||
}
|
||||
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content, string nodeTypeAlias)
|
||||
{
|
||||
return content.Ancestors(n => n.DocumentTypeAlias == nodeTypeAlias);
|
||||
}
|
||||
public static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content)
|
||||
{
|
||||
return content.Ancestors(n => true);
|
||||
}
|
||||
internal static IEnumerable<IPublishedContent> Ancestors(this IPublishedContent content, Func<IPublishedContent, bool> func)
|
||||
{
|
||||
var ancestorList = new List<IPublishedContent>();
|
||||
var node = content;
|
||||
while (node != null)
|
||||
{
|
||||
if (node.Level == 1) break;
|
||||
var parent = node.Parent;
|
||||
if (parent == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (content != parent)
|
||||
{
|
||||
node = parent;
|
||||
if (func(node))
|
||||
{
|
||||
ancestorList.Add(node);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
ancestorList.Reverse();
|
||||
return ancestorList;
|
||||
}
|
||||
{
|
||||
return content.AncestorsOrSelf(false, func);
|
||||
}
|
||||
|
||||
public static IPublishedContent AncestorOrSelf(this IPublishedContent content)
|
||||
{
|
||||
//TODO: Why is this query like this??
|
||||
return content.AncestorOrSelf(node => node.Level == 1);
|
||||
}
|
||||
public static IPublishedContent AncestorOrSelf(this IPublishedContent content, int level)
|
||||
{
|
||||
return content.AncestorOrSelf(node => node.Level == level);
|
||||
}
|
||||
public static IPublishedContent AncestorOrSelf(this IPublishedContent content, string nodeTypeAlias)
|
||||
{
|
||||
return content.AncestorOrSelf(node => node.DocumentTypeAlias == nodeTypeAlias);
|
||||
}
|
||||
internal static IPublishedContent AncestorOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func)
|
||||
{
|
||||
var node = content;
|
||||
while (node != null)
|
||||
{
|
||||
if (func(node)) return node;
|
||||
var parent = node.Parent;
|
||||
if (parent == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (content != parent)
|
||||
{
|
||||
node = parent;
|
||||
}
|
||||
else
|
||||
{
|
||||
return node;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static IPublishedContent AncestorOrSelf(this IPublishedContent content)
|
||||
{
|
||||
//TODO: Why is this query like this??
|
||||
return content.AncestorOrSelf(node => node.Level == 1);
|
||||
}
|
||||
|
||||
internal static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func)
|
||||
{
|
||||
var ancestorList = new List<IPublishedContent>();
|
||||
var node = content;
|
||||
ancestorList.Add(node);
|
||||
while (node != null)
|
||||
{
|
||||
if (node.Level == 1) break;
|
||||
var parent = node.Parent;
|
||||
if (parent == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (content != parent)
|
||||
{
|
||||
node = parent;
|
||||
if (func(node))
|
||||
{
|
||||
ancestorList.Add(node);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
ancestorList.Reverse();
|
||||
return ancestorList;
|
||||
}
|
||||
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content)
|
||||
{
|
||||
return content.AncestorsOrSelf(n => true);
|
||||
}
|
||||
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, string nodeTypeAlias)
|
||||
{
|
||||
return content.AncestorsOrSelf(n => n.DocumentTypeAlias == nodeTypeAlias);
|
||||
}
|
||||
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, int level)
|
||||
{
|
||||
return content.AncestorsOrSelf(n => n.Level <= level);
|
||||
}
|
||||
public static IPublishedContent AncestorOrSelf(this IPublishedContent content, int level)
|
||||
{
|
||||
return content.AncestorOrSelf(node => node.Level == level);
|
||||
}
|
||||
|
||||
#endregion
|
||||
public static IPublishedContent AncestorOrSelf(this IPublishedContent content, string nodeTypeAlias)
|
||||
{
|
||||
return content.AncestorOrSelf(node => node.DocumentTypeAlias == nodeTypeAlias);
|
||||
}
|
||||
|
||||
internal static IPublishedContent AncestorOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func)
|
||||
{
|
||||
if (func(content))
|
||||
return content;
|
||||
|
||||
while (content.Level > 1) // while we have a parent, consider the parent
|
||||
{
|
||||
content = content.Parent;
|
||||
|
||||
if (func(content))
|
||||
return content;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content)
|
||||
{
|
||||
return content.AncestorsOrSelf(true, n => true);
|
||||
}
|
||||
|
||||
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, int level)
|
||||
{
|
||||
return content.AncestorsOrSelf(true, n => n.Level <= level);
|
||||
}
|
||||
|
||||
public static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, string nodeTypeAlias)
|
||||
{
|
||||
return content.AncestorsOrSelf(true, n => n.DocumentTypeAlias == nodeTypeAlias);
|
||||
}
|
||||
|
||||
internal static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func)
|
||||
{
|
||||
return content.AncestorsOrSelf(true, func);
|
||||
}
|
||||
|
||||
internal static IEnumerable<IPublishedContent> AncestorsOrSelf(this IPublishedContent content, bool orSelf, Func<IPublishedContent, bool> func)
|
||||
{
|
||||
var ancestors = new List<IPublishedContent>();
|
||||
|
||||
if (orSelf && func(content))
|
||||
ancestors.Add(content);
|
||||
|
||||
while (content.Level > 1) // while we have a parent, consider the parent
|
||||
{
|
||||
content = content.Parent;
|
||||
|
||||
if (func(content))
|
||||
ancestors.Add(content);
|
||||
}
|
||||
|
||||
ancestors.Reverse();
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Descendants
|
||||
public static IEnumerable<IPublishedContent> Descendants(this IPublishedContent content, string nodeTypeAlias)
|
||||
|
||||
@@ -357,11 +357,32 @@
|
||||
<Compile Include="umbraco.presentation\MacroCacheContent.cs" />
|
||||
<Compile Include="umbraco.presentation\macroCacheRefresh.cs" />
|
||||
<Compile Include="umbraco.presentation\ScriptingMacroResult.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\wlwmanifest.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\rsd.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\ContentTypeControlNew.ascx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\dialogs\sort.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\ping.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\create.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\create\MacroPartialViewTasks.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\create\PartialViewTasks.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Macros\editMacro.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\directoryBrowser.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\StarterKits.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
@@ -387,9 +408,15 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\Search\QuickSearch.ascx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\EditNodeTypeNew.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\editTemplate.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\modals\ShowUmbracoTags.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\templateControls\Image.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\uQuery\IGetProperty.cs" />
|
||||
<Compile Include="umbraco.presentation\XsltExtensionAttribute.cs" />
|
||||
@@ -656,21 +683,7 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\MetaWeblog.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\api.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\remixWeblogApi.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\rsd.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
<DependentUpon>rsd.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\rsd.aspx.designer.cs">
|
||||
<DependentUpon>rsd.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\UmbracoMetaWeblogAPI.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\wlwmanifest.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
<DependentUpon>wlwmanifest.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\wlwmanifest.aspx.designer.cs">
|
||||
<DependentUpon>wlwmanifest.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\channels\wordApi.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\ContentControl.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\ContentPicker.cs" />
|
||||
@@ -693,13 +706,6 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\Images\UploadMediaImage.ascx.designer.cs">
|
||||
<DependentUpon>UploadMediaImage.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\ContentTypeControlNew.ascx.cs">
|
||||
<DependentUpon>ContentTypeControlNew.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\ContentTypeControlNew.ascx.designer.cs">
|
||||
<DependentUpon>ContentTypeControlNew.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\dualSelectBox.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\controls\GenericProperties\GenericProperty.ascx.cs">
|
||||
<DependentUpon>GenericProperty.ascx</DependentUpon>
|
||||
@@ -1003,13 +1009,6 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\dialogs\SendPublish.aspx.designer.cs">
|
||||
<DependentUpon>SendPublish.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\create.aspx.cs">
|
||||
<DependentUpon>create.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\create.aspx.designer.cs">
|
||||
<DependentUpon>create.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\create\content.ascx.cs">
|
||||
<DependentUpon>content.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1121,13 +1120,6 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\BrowseRepository.aspx.designer.cs">
|
||||
<DependentUpon>BrowseRepository.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\directoryBrowser.aspx.cs">
|
||||
<DependentUpon>directoryBrowser.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\directoryBrowser.aspx.designer.cs">
|
||||
<DependentUpon>directoryBrowser.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx.cs">
|
||||
<DependentUpon>editPackage.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1432,13 +1424,6 @@
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\nodeFactory\UmbracoSiteMapProvider.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\ping.aspx.cs">
|
||||
<DependentUpon>ping.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\ping.aspx.designer.cs">
|
||||
<DependentUpon>ping.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\plugins\tinymce3\GzipCompressor.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\plugins\tinymce3\GzipModule.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\plugins\tinymce3\IModule.cs" />
|
||||
@@ -1525,20 +1510,6 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\EditMediaType.aspx.designer.cs">
|
||||
<DependentUpon>EditMediaType.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\EditNodeTypeNew.aspx.cs">
|
||||
<DependentUpon>EditNodeTypeNew.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\EditNodeTypeNew.aspx.designer.cs">
|
||||
<DependentUpon>EditNodeTypeNew.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\modals\ShowUmbracoTags.aspx.cs">
|
||||
<DependentUpon>ShowUmbracoTags.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\modals\ShowUmbracoTags.aspx.designer.cs">
|
||||
<DependentUpon>ShowUmbracoTags.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\scripts\editScript.aspx.cs">
|
||||
<DependentUpon>editScript.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1557,13 +1528,6 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\settings\stylesheet\property\EditStyleSheetProperty.aspx.designer.cs">
|
||||
<DependentUpon>EditStyleSheetProperty.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\dialogs\sort.aspx.cs">
|
||||
<DependentUpon>sort.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\dialogs\sort.aspx.designer.cs">
|
||||
<DependentUpon>sort.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\templateControls\Script.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\Trees\BaseMediaTree.cs" />
|
||||
<Compile Include="umbraco.presentation\umbraco\Trees\loadDLRScripts.cs" />
|
||||
@@ -1854,7 +1818,15 @@
|
||||
<DependentUpon>Reference.map</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebServices\FolderBrowserService.cs" />
|
||||
<Compile Include="WebServices\UmbracoAuthorizedHttpHandler.cs" />
|
||||
<Compile Include="WebServices\SaveFileController.cs" />
|
||||
<Compile Include="WebServices\UmbracoAuthorizedWebService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebServices\UmbracoHttpHandler.cs" />
|
||||
<Compile Include="WebServices\UmbracoWebService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Content Include="umbraco.presentation\umbracobase\readme.txt" />
|
||||
<Content Include="umbraco.presentation\umbraco\controls\Tree\CustomTreeService.asmx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\RelationTypes\EditRelationType.aspx" />
|
||||
@@ -1901,9 +1873,6 @@
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\Preview.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\controls\passwordChanger.ascx" />
|
||||
<Content Include="umbraco.presentation\umbraco\controls\ProgressBar.ascx" />
|
||||
<Content Include="umbraco.presentation\umbraco\controls\ContentTypeControlNew.ascx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\controls\GenericProperties\GenericProperty.ascx" />
|
||||
<Content Include="umbraco.presentation\umbraco\create\DLRScripting.ascx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1921,8 +1890,6 @@
|
||||
<Content Include="umbraco.presentation\umbraco\actions\editContent.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\actions\preview.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\actions\publish.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\channels\rsd.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\channels\wlwmanifest.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\mediaPicker.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\webservices\MacroContainerService.asmx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Xslt\xsltVisualize.aspx" />
|
||||
@@ -1941,10 +1908,9 @@
|
||||
<Content Include="umbraco.presentation\umbraco\members\search.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\translation\details.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\BrowseRepository.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\directoryBrowser.aspx">
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\installedPackage.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\LoadNitros.ascx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\SubmitPackage.aspx" />
|
||||
@@ -1954,7 +1920,9 @@
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\AssignDomain.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\create.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\create.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\cruds.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\emptyTrashcan.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\exportDocumenttype.aspx" />
|
||||
@@ -2024,9 +1992,6 @@
|
||||
<Content Include="umbraco.presentation\umbraco\translation\preview.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\translation\translationTasks.dtd" />
|
||||
<Content Include="umbraco.presentation\umbraco\translation\xml.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\create.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\create\content.ascx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
@@ -2073,9 +2038,6 @@
|
||||
<SubType>Form</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\members\EditMemberType.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\ping.aspx">
|
||||
<SubType>Form</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\publishStatus.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\schemas\umbraco.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
@@ -2085,17 +2047,10 @@
|
||||
<Content Include="umbraco.presentation\umbraco\settings\EditMediaType.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\settings\EditNodeTypeNew.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\settings\modals\ShowUmbracoTags.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\settings\stylesheet\editstylesheet.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\settings\stylesheet\property\EditStyleSheetProperty.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\sort.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\test.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\tree.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Umbraco.Web
|
||||
private const string HttpContextItemName = "Umbraco.Web.UmbracoContext";
|
||||
private static readonly object Locker = new object();
|
||||
|
||||
private bool _replacing;
|
||||
private PreviewContent _previewContent;
|
||||
|
||||
/// <summary>
|
||||
@@ -78,8 +79,12 @@ namespace Umbraco.Web
|
||||
/// </remarks>
|
||||
internal static UmbracoContext EnsureContext(HttpContextBase httpContext, ApplicationContext applicationContext, bool replaceContext)
|
||||
{
|
||||
if (UmbracoContext.Current != null && !replaceContext)
|
||||
return UmbracoContext.Current;
|
||||
if (UmbracoContext.Current != null)
|
||||
{
|
||||
if (!replaceContext)
|
||||
return UmbracoContext.Current;
|
||||
UmbracoContext.Current._replacing = true;
|
||||
}
|
||||
|
||||
var umbracoContext = new UmbracoContext(httpContext, applicationContext, RoutesCacheResolver.Current.RoutesCache);
|
||||
|
||||
@@ -165,9 +170,9 @@ namespace Umbraco.Web
|
||||
lock (Locker)
|
||||
{
|
||||
//if running in a real HttpContext, this can only be set once
|
||||
if (System.Web.HttpContext.Current != null && Current != null)
|
||||
if (System.Web.HttpContext.Current != null && Current != null && !Current._replacing)
|
||||
{
|
||||
throw new ApplicationException("The current httpContext can only be set once during a request.");
|
||||
throw new ApplicationException("The current UmbracoContext can only be set once during a request.");
|
||||
}
|
||||
|
||||
//if there is an HttpContext, return the item
|
||||
|
||||
@@ -10,10 +10,10 @@ using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web.Routing;
|
||||
using umbraco;
|
||||
using umbraco.IO;
|
||||
using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings;
|
||||
using UmbracoSettings = Umbraco.Core.Configuration.UmbracoSettings;
|
||||
|
||||
@@ -35,6 +35,16 @@ namespace Umbraco.Web
|
||||
/// <param name="httpContext"></param>
|
||||
void BeginRequest(HttpContextBase httpContext)
|
||||
{
|
||||
//we need to set the initial url in our ApplicationContext, this is so our keep alive service works and this must
|
||||
//exist on a global context because the keep alive service doesn't run in a web context.
|
||||
//we are NOT going to put a lock on this because locking will slow down the application and we don't really care
|
||||
//if two threads write to this at the exact same time during first page hit.
|
||||
//see: http://issues.umbraco.org/issue/U4-2059
|
||||
if (ApplicationContext.Current.OriginalRequestUrl.IsNullOrWhiteSpace())
|
||||
{
|
||||
ApplicationContext.Current.OriginalRequestUrl = string.Format("{0}:{1}{2}", httpContext.Request.ServerVariables["SERVER_NAME"], httpContext.Request.ServerVariables["SERVER_PORT"], IOHelper.ResolveUrl(SystemDirectories.Umbraco));
|
||||
}
|
||||
|
||||
// do not process if client-side request
|
||||
if (IsClientSideRequest(httpContext.Request.Url))
|
||||
return;
|
||||
|
||||
@@ -68,10 +68,17 @@ namespace Umbraco.Web.WebServices
|
||||
if (System.IO.File.Exists(saveOldPath))
|
||||
System.IO.File.Delete(saveOldPath);
|
||||
}
|
||||
using (var sw = System.IO.File.CreateText(savePath))
|
||||
{
|
||||
sw.Write(val);
|
||||
}
|
||||
|
||||
//NOTE: I've left the below here just for informational purposes. If we save a file this way, then the UTF8
|
||||
// BOM mucks everything up, strangely, if we use WriteAllText everything is ok!
|
||||
// http://issues.umbraco.org/issue/U4-2118
|
||||
//using (var sw = System.IO.File.CreateText(savePath))
|
||||
//{
|
||||
// sw.Write(val);
|
||||
//}
|
||||
|
||||
System.IO.File.WriteAllText(savePath, val, Encoding.UTF8);
|
||||
|
||||
return Success(ui.Text("speechBubbles", "partialViewSavedText"), ui.Text("speechBubbles", "partialViewSavedHeader"));
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user