This commit is contained in:
starfighter83
2011-02-28 11:16:55 -01:00
12 changed files with 177 additions and 60 deletions

View File

@@ -14,7 +14,11 @@
<property name="public.dir" value="D:\inetpub\wwwroot\nightlies\umbraco 4.6" />
<property name="root.dir" value="${directory::get-current-directory()}" />
<property name="source.dir" value="${root.dir}\umbraco\presentation" />
<property name="build.dir" value="${root.dir}\build" />
<property name="build.symbolFiles.dir" value="${root.dir}\SymbolFiles" />
<property name="build.macroEnginesIron.dir" value="${root.dir}\umbraco.macroEngines.Iron_build" />
<property name="dlls.dir" value="${root.dir}\foreign dlls" />
<property name="WebPiAssets.dir" value="${root.dir}\config templates\WebPi" />
@@ -41,8 +45,7 @@
<!-- YUI -->
<property name="YUICompressor.dir" value="D:\inetpub\wwwroot\ccnet\buildTools\YUI" />
<!-- Build source -->
<target name="build" depends="init">
@@ -68,7 +71,26 @@
</fileset>
</delete>
<exec program="${win.dir}\microsoft.net\framework\v4.0.30319\msbuild.exe">
<exec program="${win.dir}\microsoft.net\framework\v4.0.30319\msbuild.exe">
<arg value="${root.dir}\umbraco.MacroEngines.Juno\umbraco.MacroEngines.csproj" />
<arg value="/v:n" />
<arg value="/p:WarningLevel=0" />
<arg value="/p:ToolsVersion=4.0" />
<arg value="/p:Configuration=${build.configuration}" />
</exec>
<copy file="${root.dir}\umbraco.MacroEngines.Juno\bin\${build.configuration}\umbraco.MacroEngines.dll" tofile="${source.dir}\bin\umbraco.MacroEngines.dll" failonerror="false" overwrite="true"/>
<copy todir="${source.dir}\bin" overwrite="true">
<fileset basedir="${dlls.dir}\WebPages">
<include name="*.dll" />
</fileset>
</copy>
<exec program="${win.dir}\microsoft.net\framework\v4.0.30319\msbuild.exe">
<arg value="${root.dir}\umbraco.sln" />
<arg value="/v:n" />
<arg value="/p:WarningLevel=0" />
@@ -77,16 +99,53 @@
</exec>
<exec program="${win.dir}\microsoft.net\framework\v4.0.30319\aspnet_compiler.exe" commandline="-f -u -p umbraco/presentation -v / &quot;${build.dir}&quot;"/>
<exec program="${win.dir}\microsoft.net\framework\v4.0.30319\msbuild.exe">
<arg value="${root.dir}\umbraco.MacroEngines.Juno\umbraco.MacroEngines.csproj" />
<arg value="/v:n" />
<arg value="/p:WarningLevel=0" />
<arg value="/p:ToolsVersion=4.0" />
<arg value="/p:Configuration=${build.configuration}" />
</exec>
<call target="buildMacroEnginesIron" />
<call target="buildSymbolFiles" />
</target>
<target name="buildMacroEnginesIron">
<mkdir dir="${build.macroEnginesIron.dir}" />
<mkdir dir="${build.macroEnginesIron.dir}\bin" />
<copy todir="${build.macroEnginesIron.dir}\bin" overwrite="true">
<fileset basedir="${dlls.dir}\DLR 4.0">
<include name="*.dll" />
<exclude name="Microsoft.Scripting.ExtensionAttribute.dll" />
</fileset>
</copy>
<copy file="${root.dir}\umbraco.MacroEngines.Iron\bin\${build.configuration}\umbraco.MacroEngines.Iron.dll" tofile="${build.macroEnginesIron.dir}\bin\umbraco.MacroEngines.Iron.dll" failonerror="false" overwrite="true"/>
</target>
<target name="buildSymbolFiles">
<!-- setup symbol files -->
<mkdir dir="${build.symbolFiles.dir}" />
<copy todir="${build.symbolFiles.dir}">
<fileset basedir="${build.dir}\bin">
<include name="*.xml" />
<include name="*.pdb" />
</fileset>
</copy>
<copy todir="${build.symbolFiles.dir}">
<fileset basedir="${docs.dir}">
<include name="*.xml" />
</fileset>
</copy>
</target>
<!-- Directories and files -->
<target name="directories" depends="build">
@@ -108,13 +167,15 @@
</fileset>
</delete>
<!--
<copy todir="${build.dir}\bin" overwrite="true">
<fileset basedir="${dlls.dir}\DLR 4.0">
<include name="*.dll" />
<exclude name="Microsoft.Scripting.ExtensionAttribute.dll" />
</fileset>
</copy>
-->
<!--standard web.config-->
<copy file="${root.dir}\config templates\web.config" tofile="${build.dir}\web.config" failonerror="false" overwrite="true"/>
@@ -133,13 +194,14 @@
<copy file="${root.dir}\config templates\config\ClientDependency.config" tofile="${build.dir}\config\ClientDependency.config" failonerror="false" overwrite="true"/>
<copy file="${root.dir}\config templates\config\ExamineSettings.config" tofile="${build.dir}\config\ExamineSettings.config" failonerror="false" overwrite="true"/>
<copy file="${root.dir}\config templates\config\ExamineIndex.config" tofile="${build.dir}\config\ExamineIndex.config" failonerror="false" overwrite="true"/>
<copy file="${root.dir}\config templates\config\scripting.config" tofile="${build.dir}\config\scripting.config" failonerror="false" overwrite="true"/>
<!-- Macro engines files + razor Files -->
<copy file="${root.dir}\umbraco.MacroEngines.Juno\bin\${build.configuration}\umbraco.MacroEngines.dll" tofile="${build.dir}\bin\umbraco.MacroEngines.dll" failonerror="false" overwrite="true"/>
<copy file="${root.dir}\umbraco.MacroEngines.Juno\bin\${build.configuration}\umbraco.MacroEngines.pdb" tofile="${build.dir}\bin\umbraco.MacroEngines.pdb" failonerror="false" overwrite="true"/>
<copy todir="${build.dir}\bin" overwrite="true">
<copy todir="${build.dir}\bin" overwrite="true">
<fileset basedir="${dlls.dir}\WebPages">
<include name="*.dll" />
</fileset>
@@ -232,35 +294,7 @@
<mkdir dir="${build.dir}\usercontrols" />
</target>
<!-- Minify -->
<target name="minify" description="minify JS files" depends="directories">
<fileset basedir="${build.dir}" id="jsFileSet">
<include name="umbraco/css/*.css"/>
<include name="umbraco/js/**/*.js"/>
<include name="umbraco_client/**/*.js"/>
<include name="umbraco_client/**/*.css"/>
</fileset>
<property name="js_files" value=""/>
<foreach item="File" property="file">
<in>
<items refid="jsFileSet"/>
</in>
<do>
<exec program="java" workingdir="${YUICompressor.dir}" failonerror="false">
<arg value="-jar" />
<arg value="yuicompressor.jar" />
<arg value="-o" />
<arg value="${file}.min" />
<arg value="${file}" />
</exec>
<move file="${file}.min" tofile="${file}" overwrite="true" failonerror="false"/>
</do>
</foreach>
</target>
<!-- Documentation -->
<target name="documentation" depends="directories">
@@ -329,7 +363,7 @@
<!-- do the full release with docs, minify and nightly file distribution -->
<target name="release" depends="zip,minify">
<target name="release" depends="zip">
<property name="assembly.name" value="${ assemblyname::get-version( assemblyname::get-assembly-name('umbraco/presentation/bin/umbraco.dll') ) }"/>
<property name="release.filename" value="${root.dir}\build_${build.version}_${assembly.name}.zip" />
@@ -339,7 +373,7 @@
<!-- do the full release with docs, minify and nightly file distribution -->
<target name="zip" depends="directories">
<property name="assembly.name" value="${ assemblyname::get-version( assemblyname::get-assembly-name('umbraco/presentation/bin/umbraco.dll') ) }"/>
<property name="assembly.name" value="${build.number}"/>
<property name="release.filename" value="${root.dir}\build_${build.version}_${assembly.name}.zip" />
<zip zipfile="${release.filename}" includeemptydirs="true" >
@@ -348,15 +382,34 @@
<include name="build/**/*" />
</fileset>
</zip>
<zip zipfile="${root.dir}\SymbolFiles.zip" includeemptydirs="true" >
<fileset basedir="${root.dir}">
<include name="SymbolFiles/*" />
<include name="SymbolFiles/**/*" />
</fileset>
</zip>
<zip zipfile="${root.dir}\Umbraco.MacroEngines.Iron.zip" includeemptydirs="true" >
<fileset basedir="${root.dir}">
<include name="umbraco.macroEngines.Iron_build/*" />
<include name="umbraco.macroEngines.Iron_build/**/*" />
</fileset>
</zip>
</target>
<!-- do a nightly build without the minification and docs -->
<target name="nightly" depends="zip">
<property name="assembly.name" value="${ assemblyname::get-version( assemblyname::get-assembly-name('umbraco/presentation/bin/umbraco.dll') ) }"/>
<property name="assembly.name" value="${build.number}"/>
<property name="release.filename" value="${root.dir}\build_${build.version}_${assembly.name}.zip" />
<mkdir dir="${public.dir}\${build.version}" />
<copy file="${release.filename}" tofile="${public.dir}\${build.version}\${assembly.name}.zip" />
<copy file="${root.dir}\Umbraco.MacroEngines.Iron.zip" tofile="${public.dir}\${build.version}\Umbraco.MacroEngines.Iron.zip" />
<copy file="${root.dir}\SymbolFiles.zip" tofile="${public.dir}\${build.version}\SymbolFiles.zip" />
</target>
<!-- will produce the a clean /build folder and nothing else-->

View File

@@ -205,20 +205,21 @@ namespace umbraco.MacroEngines
{
var name = binder.Name;
result = null; //this will never be returned
if (name == "ChildrenAsList" || name == "Children")
{
result = GetChildrenAsList;
return true;
}
bool propertyExists = false;
if (n != null)
{
var data = n.GetProperty(name);
var data = n.GetProperty(name, out propertyExists);
// check for nicer support of Pascal Casing EVEN if alias is camelCasing:
if (data == null && name.Substring(0, 1).ToUpper() == name.Substring(0, 1))
if (data == null && name.Substring(0, 1).ToUpper() == name.Substring(0, 1) && !propertyExists)
{
data = n.GetProperty(name.Substring(0, 1).ToLower() + name.Substring((1)));
data = n.GetProperty(name.Substring(0, 1).ToLower() + name.Substring((1)), out propertyExists);
}
if (data != null)
@@ -265,10 +266,17 @@ namespace umbraco.MacroEngines
//if property access, type lookup and member invoke all failed
//at this point, we're going to return null
//instead, we return an empty list
//instead, we return a DynamicNull - see comments in that file
//this will let things like Model.ChildItem work and return nothing instead of crashing
result = new DynamicNodeList(new List<INode>());
//changed this to a return true because it breaks testing when using .Children().Random().propertyName
if (!propertyExists && result == null)
{
//.Where explictly checks for this type
//and will make it false
//which means backwards equality (&& property != true) will pass
//forwwards equality (&& property or && property == true) will fail
result = new DynamicNull();
return true;
}
return true;
}
@@ -281,7 +289,7 @@ namespace umbraco.MacroEngines
if (dataType == DATATYPE_YESNO_GUID)
{
bool parseResult;
if (result.ToString() == "") result = "0";
if (string.Format("{0}", result) == "") result = "0";
if (Boolean.TryParse(result.ToString().Replace("1", "true").Replace("0", "false"), out parseResult))
{
result = parseResult;

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Dynamic;
namespace umbraco.MacroEngines
{
//This type is used as a return type when TryGetMember fails on a DynamicNode
//.Where explicitly checks for this type, to indicate that nothing was returned
//Because it's IEnumerable, if the user is actually trying @Model.TextPages or similar
//it will still return an enumerable object (assuming the call actually failed because there were no children of that type)
//but in .Where, if they use a property that doesn't exist, the lambda will bypass this and return false
public class DynamicNull : DynamicObject, IEnumerable
{
public IEnumerator GetEnumerator()
{
return (new List<DynamicNull>()).GetEnumerator();
}
public DynamicNull Where(string predicate, params object[] values)
{
return this;
}
public DynamicNull OrderBy(string orderBy)
{
return this;
}
public override string ToString()
{
return string.Empty;
}
}
}

View File

@@ -54,6 +54,7 @@ namespace System.Linq.Dynamic
{
return (bool)value;
}
return false;
}
catch (Exception)
@@ -1467,6 +1468,12 @@ namespace System.Linq.Dynamic
Expression.Assign(result, Expression.Constant(null)),
Expression.IfThen(Expression.NotEqual(Expression.Constant(null), instanceExpression),
Expression.Call(instanceExpression, method, binder, result)),
Expression.IfThen(
Expression.TypeEqual(result, typeof(DynamicNull)),
Expression.Assign(result,
Expression.Constant(false, typeof(object))
)
),
Expression.Return(blockReturnLabel, result),
Expression.Label(blockReturnLabel, Expression.Constant(-2, typeof(object)))
);

View File

@@ -64,6 +64,7 @@
<Compile Include="RazorDynamicNode\DynamicMediaList.cs" />
<Compile Include="RazorDynamicNode\DynamicNodeList.cs" />
<Compile Include="RazorDynamicNode\DynamicNodeWalker.cs" />
<Compile Include="RazorDynamicNode\DynamicNull.cs" />
<Compile Include="RazorDynamicNode\DynamicQueryable.cs" />
<Compile Include="RazorDynamicNode\DynamicXml.cs" />
<Compile Include="RazorDynamicNode\ExtensionMethodFinder.cs" />

View File

@@ -22,7 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StandardConfig", "StandardC
config templates\umbraco.config = config templates\umbraco.config
config templates\config\umbracoSettings.config = config templates\config\umbracoSettings.config
config templates\config\UrlRewriting.config = config templates\config\UrlRewriting.config
config templates\web.config = config templates\web.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Packages", "Packages", "{5BB61485-B480-4A03-A8DD-1636A5AF575C}"

View File

@@ -29,6 +29,7 @@ namespace umbraco.interfaces
List<IProperty> PropertiesAsList { get; }
List<INode> ChildrenAsList { get; }
IProperty GetProperty(string Alias);
IProperty GetProperty(string Alias, out bool propertyExists);
DataTable ChildrenAsTable();
DataTable ChildrenAsTable(string nodeTypeAliasFilter);
}

View File

@@ -1922,6 +1922,7 @@
<Content Include="umbraco\xslt\templates\Schema2\RSSFeed.xslt" />
<Content Include="umbraco\xslt\templates\Schema2\Sitemap.xslt" />
<Content Include="umbraco\xslt\templates\Schema2\TablePrototype.xslt" />
<Content Include="web.config.ssaolap01.xslt" />
<Content Include="web.config.UMBRACOELISE.xslt">
<SubType>Designer</SubType>
</Content>

View File

@@ -61,6 +61,9 @@ namespace umbraco.presentation.create
string abPath = IO.IOHelper.MapPath(path);
list.Items.Clear();
// always add the option of an empty one
list.Items.Add(new ListItem("Empty template", ""));
if (System.IO.Directory.Exists(abPath))
{
string extension = "." + scriptType;
@@ -72,10 +75,6 @@ namespace umbraco.presentation.create
list.Items.Add(new ListItem(helper.SpaceCamelCasing(filename.Replace(extension, "")), scriptType + "/" + filename));
}
}
else
{
list.Items.Add(new ListItem("Empty template", ""));
}
}
}
}

View File

@@ -314,6 +314,20 @@ namespace umbraco.NodeFactory
return null;
}
public IProperty GetProperty(string Alias, out bool propertyExists)
{
foreach (Property p in Properties)
{
if (p.Alias == Alias)
{
propertyExists = true;
return p;
}
}
propertyExists = false;
return null;
}
public static Node GetNodeByXpath(string xpath)
{
XPathNodeIterator xpathNode = library.GetXmlNodeByXPath(xpath);

View File

@@ -39,8 +39,8 @@
<Examine configSource="config\ExamineSettings.config" />
<ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
<appSettings>
<add key="umbracoDbDSN" value="server=ssaolap01;database=umbracodev;integrated security=false;user id=dev;pwd=dev" />
<add key="umbracoConfigurationStatus" value="4.6.1" />
<add key="umbracoDbDSN" value="server=.\sqlexpress;database=v46;user id=umbracouser;password=farmer" />
<add key="umbracoConfigurationStatus" value="" />
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
<add key="umbracoContentXML" value="~/App_Data/umbraco.config" />

View File

@@ -8,7 +8,7 @@
</xsl:template>
<xsl:template match="/configuration/appSettings/add[@key='umbracoConfigurationStatus']/@value">
<xsl:attribute name="value">4.6.1</xsl:attribute>
<xsl:attribute name="value">4.7.0.beta</xsl:attribute>
</xsl:template>
<!-- Default templates to match anything else -->