DO NOT DOWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB

More fixes that are unrelated to any testing from cg09 :|

[TFS Changeset #55266]
This commit is contained in:
slace
2009-06-22 11:53:13 +00:00
parent 8f6415abee
commit b53832e80e
5 changed files with 85 additions and 15 deletions

View File

@@ -64,9 +64,13 @@ namespace umbraco.Linq.Core
{ {
var attr = ReflectionAssistance.GetumbracoInfoAttribute(p); var attr = ReflectionAssistance.GetumbracoInfoAttribute(p);
var data = xml.Elements("data").Single(x => (string)x.Attribute("alias") == attr.Alias); var data = xml.Elements("data").Single(x => (string)x.Attribute("alias") == attr.Alias).Value;
if (p.PropertyType == typeof(int) && string.IsNullOrEmpty(data))
{
data = "-1";
}
// TODO: Address how Convert.ChangeType works in globalisation // TODO: Address how Convert.ChangeType works in globalisation
p.SetValue(this, Convert.ChangeType(data.Value, p.PropertyType), null); p.SetValue(this, Convert.ChangeType(data, p.PropertyType), null);
} }
} }

View File

@@ -85,7 +85,7 @@ namespace umbraco.Linq.Core.Node
/// Initializes a new instance of the <see cref="NodeDataProvider"/> class using umbraco settings as XML path /// Initializes a new instance of the <see cref="NodeDataProvider"/> class using umbraco settings as XML path
/// </summary> /// </summary>
public NodeDataProvider() public NodeDataProvider()
: this(System.Web.HttpContext.Current.Server.MapPath(umbraco.GlobalSettings.Path)) : this(umbraco.presentation.UmbracoContext.Current.Server.MapPath(umbraco.presentation.UmbracoContext.Current.Server.ContentXmlPath))
{ {
} }

View File

@@ -16,12 +16,13 @@
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath> <SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider> <SccProvider>SAK</SccProvider>
<umbracoPresentationPath>..\..\..\..\..\umbraco\presentation\bin</umbracoPresentationPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>..\..\..\..\umbraco\presentation\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@@ -55,6 +56,11 @@
<RequiredTargetFramework>3.0</RequiredTargetFramework> <RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\foreign dlls\System.Web.Abstractions.dll</HintPath>
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.XML" /> <Reference Include="System.XML" />
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -91,13 +97,16 @@
<Project>{E469A9CE-1BEC-423F-AC44-713CD72457EA}</Project> <Project>{E469A9CE-1BEC-423F-AC44-713CD72457EA}</Project>
<Name>umbraco.businesslogic</Name> <Name>umbraco.businesslogic</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\..\..\umbraco\presentation\umbraco.presentation.csproj">
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
<Name>umbraco.presentation</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>-->
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
-->
</Project> </Project>

View File

@@ -3,14 +3,51 @@ using System.Web;
using umbraco.presentation.LiveEditing; using umbraco.presentation.LiveEditing;
using umbraco.BasePages; using umbraco.BasePages;
using umbraco.cms.businesslogic.web; using umbraco.cms.businesslogic.web;
using System.Xml.Linq;
namespace umbraco.presentation namespace umbraco.presentation
{ {
public class UmbracoServerUtility : HttpServerUtilityWrapper
{
private HttpServerUtility m_Server;
public UmbracoServerUtility(HttpServerUtility server) : base(server)
{
m_Server = server;
}
public string UmbracoPath
{
get
{
return GlobalSettings.Path;
}
}
public string ContentXmlPath
{
get
{
return GlobalSettings.ContentXML;
}
}
public XDocument ContentXml
{
get
{
return XDocument.Load(this.ContentXmlPath);
}
}
}
/// <summary> /// <summary>
/// Class that encapsulates Umbraco information of a specific HTTP request. /// Class that encapsulates Umbraco information of a specific HTTP request.
/// </summary> /// </summary>
public class UmbracoContext public class UmbracoContext
{ {
private UmbracoServerUtility m_Server;
private UmbracoRequest m_Request;
private UmbracoResponse m_Response;
private HttpContext m_HttpContext; private HttpContext m_HttpContext;
/// <summary> /// <summary>
@@ -104,7 +141,11 @@ namespace umbraco.presentation
{ {
get get
{ {
return new UmbracoResponse(this.m_HttpContext.Response); if (m_Response == null)
{
m_Response = new UmbracoResponse(this.m_HttpContext.Response);
}
return m_Response;
} }
} }
@@ -116,7 +157,11 @@ namespace umbraco.presentation
{ {
get get
{ {
return new UmbracoRequest(this.m_HttpContext.Request); if (m_Request == null)
{
m_Request = new UmbracoRequest(this.m_HttpContext.Request);
}
return m_Request;
} }
} }
@@ -128,5 +173,17 @@ namespace umbraco.presentation
{ {
return this.Request.Url.GetLeftPart(UriPartial.Authority); return this.Request.Url.GetLeftPart(UriPartial.Authority);
} }
public virtual UmbracoServerUtility Server
{
get
{
if (m_Server == null)
{
m_Server = new UmbracoServerUtility(this.m_HttpContext.Server);
}
return m_Server;
}
}
} }
} }

View File

@@ -1,6 +1,6 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup> <PropertyGroup>
<ProductVersion>9.0.21022</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{651E1350-91B6-44B7-BD60-7207006D7003}</ProjectGuid> <ProjectGuid>{651E1350-91B6-44B7-BD60-7207006D7003}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
@@ -354,8 +354,8 @@
<DependentUpon>editContent.aspx</DependentUpon> <DependentUpon>editContent.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="umbraco\actions\preview.aspx.cs"> <Compile Include="umbraco\actions\preview.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>preview.aspx</DependentUpon> <DependentUpon>preview.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="umbraco\actions\preview.aspx.designer.cs"> <Compile Include="umbraco\actions\preview.aspx.designer.cs">
<DependentUpon>preview.aspx</DependentUpon> <DependentUpon>preview.aspx</DependentUpon>
@@ -667,8 +667,8 @@
<DependentUpon>Boost.aspx</DependentUpon> <DependentUpon>Boost.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="umbraco\developer\Packages\BrowseRepository.aspx.cs"> <Compile Include="umbraco\developer\Packages\BrowseRepository.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>BrowseRepository.aspx</DependentUpon> <DependentUpon>BrowseRepository.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="umbraco\developer\Packages\BrowseRepository.aspx.designer.cs"> <Compile Include="umbraco\developer\Packages\BrowseRepository.aspx.designer.cs">
<DependentUpon>BrowseRepository.aspx</DependentUpon> <DependentUpon>BrowseRepository.aspx</DependentUpon>
@@ -689,8 +689,8 @@
<DependentUpon>editPackage.aspx</DependentUpon> <DependentUpon>editPackage.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="umbraco\developer\Packages\installedPackage.aspx.cs"> <Compile Include="umbraco\developer\Packages\installedPackage.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>installedPackage.aspx</DependentUpon> <DependentUpon>installedPackage.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="umbraco\developer\Packages\installedPackage.aspx.designer.cs"> <Compile Include="umbraco\developer\Packages\installedPackage.aspx.designer.cs">
<DependentUpon>installedPackage.aspx</DependentUpon> <DependentUpon>installedPackage.aspx</DependentUpon>
@@ -710,8 +710,8 @@
<DependentUpon>SubmitPackage.aspx</DependentUpon> <DependentUpon>SubmitPackage.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="umbraco\developer\Python\editPython.aspx.cs"> <Compile Include="umbraco\developer\Python\editPython.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>editPython.aspx</DependentUpon> <DependentUpon>editPython.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="umbraco\developer\Python\editPython.aspx.designer.cs"> <Compile Include="umbraco\developer\Python\editPython.aspx.designer.cs">
<DependentUpon>editPython.aspx</DependentUpon> <DependentUpon>editPython.aspx</DependentUpon>
@@ -798,8 +798,8 @@
<DependentUpon>editMacro.aspx</DependentUpon> <DependentUpon>editMacro.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="umbraco\dialogs\emptyTrashcan.aspx.cs"> <Compile Include="umbraco\dialogs\emptyTrashcan.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>emptyTrashcan.aspx</DependentUpon> <DependentUpon>emptyTrashcan.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="umbraco\dialogs\emptyTrashcan.aspx.designer.cs"> <Compile Include="umbraco\dialogs\emptyTrashcan.aspx.designer.cs">
<DependentUpon>emptyTrashcan.aspx</DependentUpon> <DependentUpon>emptyTrashcan.aspx</DependentUpon>
@@ -1199,8 +1199,8 @@
<DependentUpon>publishStatus.aspx</DependentUpon> <DependentUpon>publishStatus.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="umbraco\reindex.aspx.cs"> <Compile Include="umbraco\reindex.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>reindex.aspx</DependentUpon> <DependentUpon>reindex.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="umbraco\reindex.aspx.designer.cs"> <Compile Include="umbraco\reindex.aspx.designer.cs">
<DependentUpon>reindex.aspx</DependentUpon> <DependentUpon>reindex.aspx</DependentUpon>