mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 17:47:54 +08:00
First rough cut at an Orchard.Core assembly. This is intended to act as a carrier of certain built-in packages. The enlistment, activation, content files, etc. within ~/Core/X are intended to have exactly the same overall effect as if they were in a ~/Packages/X standalone project.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041143
This commit is contained in:
58
src/Orchard.Core.Tests/Orchard.Core.Tests.csproj
Normal file
58
src/Orchard.Core.Tests/Orchard.Core.Tests.csproj
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Orchard.Core.Tests</RootNamespace>
|
||||
<AssemblyName>Orchard.Core.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
36
src/Orchard.Core.Tests/Properties/AssemblyInfo.cs
Normal file
36
src/Orchard.Core.Tests/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Orchard.Core.Tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft IT")]
|
||||
[assembly: AssemblyProduct("Orchard.Core.Tests")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft IT 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("883a3424-7500-43a5-8207-6552e580229f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -109,6 +109,10 @@
|
||||
<Project>{ABC826D4-2FA1-4F2F-87DE-E6095F653810}</Project>
|
||||
<Name>Orchard.Tests</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Web\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Web\Packages\Orchard.CmsPages\Orchard.CmsPages.csproj">
|
||||
<Project>{1ECC1131-0D0C-4822-AD90-E979868C63F3}</Project>
|
||||
<Name>Orchard.CmsPages</Name>
|
||||
@@ -121,10 +125,6 @@
|
||||
<Project>{79AED36E-ABD0-4747-93D3-8722B042454B}</Project>
|
||||
<Name>Orchard.Users</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Web\Packages\Orchard.XmlRpc\Orchard.XmlRpc.csproj">
|
||||
<Project>{0DC6B598-6D03-4923-A6C2-274D09854117}</Project>
|
||||
<Name>Orchard.XmlRpc</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard\Orchard.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard</Name>
|
||||
|
@@ -2,10 +2,10 @@
|
||||
using Autofac.Builder;
|
||||
using Autofac.Modules;
|
||||
using NUnit.Framework;
|
||||
using Orchard.XmlRpc;
|
||||
using Orchard.XmlRpc.Controllers;
|
||||
using Orchard.XmlRpc.Models;
|
||||
using Orchard.XmlRpc.Services;
|
||||
using Orchard.Core.XmlRpc;
|
||||
using Orchard.Core.XmlRpc.Controllers;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Core.XmlRpc.Services;
|
||||
|
||||
namespace Orchard.Tests.Packages.XmlRpc.Controllers {
|
||||
[TestFixture]
|
||||
|
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Xml.Linq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.XmlRpc.Models;
|
||||
using Orchard.XmlRpc.Services;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Core.XmlRpc.Services;
|
||||
|
||||
namespace Orchard.Tests.Packages.XmlRpc.Services {
|
||||
[TestFixture]
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using System.Xml.Linq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.XmlRpc.Models;
|
||||
using Orchard.XmlRpc.Services;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Core.XmlRpc.Services;
|
||||
|
||||
namespace Orchard.Tests.Packages.XmlRpc.Services {
|
||||
[TestFixture]
|
||||
|
@@ -63,7 +63,7 @@ namespace Orchard.Tests.Packages {
|
||||
public void PackageTxtShouldBeParsedAndReturnedAsYamlDocument() {
|
||||
var folders = new PackageFolders(new[] { _tempFolderName });
|
||||
var sample1 = folders.ParseManifest("Sample1");
|
||||
var mapping = (Mapping)sample1.Root;
|
||||
var mapping = (Mapping)sample1.YamlDocument.Root;
|
||||
var entities = mapping.Entities
|
||||
.Where(x=>x.Key is Scalar)
|
||||
.ToDictionary(x => ((Scalar)x.Key).Text, x => x.Value);
|
||||
|
@@ -37,15 +37,22 @@ namespace Orchard.Tests.Packages {
|
||||
return Manifests.Keys;
|
||||
}
|
||||
|
||||
public YamlDocument ParseManifest(string name) {
|
||||
public ParseResult ParseManifest(string name) {
|
||||
var parser = new YamlParser();
|
||||
bool success;
|
||||
var stream = parser.ParseYamlStream(new TextInput(Manifests[name]), out success);
|
||||
return success ? stream.Documents.Single() : null;
|
||||
if (success) {
|
||||
return new ParseResult {
|
||||
Location = "~/InMemory",
|
||||
Name = name,
|
||||
YamlDocument = stream.Documents.Single()
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void AvailablePackagesShouldFollowCatalogLocations() {
|
||||
_folders.Manifests.Add("foo", "name: Foo");
|
||||
|
@@ -4,13 +4,14 @@
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0DC6B598-6D03-4923-A6C2-274D09854117}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<ProjectGuid>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</ProjectGuid>
|
||||
<ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Orchard.XmlRpc</RootNamespace>
|
||||
<AssemblyName>Orchard.XmlRpc</AssemblyName>
|
||||
<RootNamespace>Orchard.Core</RootNamespace>
|
||||
<AssemblyName>Orchard.Core</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -32,27 +33,27 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Abstractions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Extensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\\Assemblies\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
@@ -60,50 +61,63 @@
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Package.txt" />
|
||||
<Content Include="Views\Home\Index.aspx" />
|
||||
<Content Include="Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Controllers\LiveWriterController.cs" />
|
||||
<Compile Include="IXmlRpcHandler.cs" />
|
||||
<Compile Include="Models\ModelBinderProvider.cs" />
|
||||
<Compile Include="Models\XRpcArray.cs" />
|
||||
<Compile Include="Models\XRpcMethodCall.cs" />
|
||||
<Compile Include="Models\XRpcMethodResponse.cs" />
|
||||
<Compile Include="Models\XRpcStruct.cs" />
|
||||
<Compile Include="Models\XRpcData.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\XmlRpcReader.cs" />
|
||||
<Compile Include="Services\XmlRpcWriter.cs" />
|
||||
<Compile Include="XmlRpcContext.cs" />
|
||||
<Compile Include="XmlRpc\Controllers\HomeController.cs" />
|
||||
<Compile Include="XmlRpc\Controllers\LiveWriterController.cs" />
|
||||
<Compile Include="XmlRpc\IXmlRpcHandler.cs" />
|
||||
<Compile Include="XmlRpc\Models\ModelBinderProvider.cs" />
|
||||
<Compile Include="XmlRpc\Models\XRpcArray.cs" />
|
||||
<Compile Include="XmlRpc\Models\XRpcData.cs" />
|
||||
<Compile Include="XmlRpc\Models\XRpcMethodCall.cs" />
|
||||
<Compile Include="XmlRpc\Models\XRpcMethodResponse.cs" />
|
||||
<Compile Include="XmlRpc\Models\XRpcStruct.cs" />
|
||||
<Compile Include="XmlRpc\Services\XmlRpcReader.cs" />
|
||||
<Compile Include="XmlRpc\Services\XmlRpcWriter.cs" />
|
||||
<Compile Include="XmlRpc\XmlRpcContext.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Orchard\Orchard.csproj">
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="XmlRpc\Package.txt" />
|
||||
<Content Include="XmlRpc\Views\Home\Index.aspx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Orchard\Orchard.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
</Target> -->
|
||||
<!-- To enable MVC area subproject support, uncomment the following two lines:
|
||||
<UsingTask TaskName="Microsoft.Web.Mvc.Build.CreateAreaManifest" AssemblyName="Microsoft.Web.Mvc.Build, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<UsingTask TaskName="Microsoft.Web.Mvc.Build.CopyAreaManifests" AssemblyName="Microsoft.Web.Mvc.Build, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
-->
|
||||
<Target Name="AfterBuild" DependsOnTargets="AfterBuildCompiler">
|
||||
<PropertyGroup>
|
||||
<AreasManifestDir>$(ProjectDir)\..\Manifests</AreasManifestDir>
|
||||
</PropertyGroup>
|
||||
<!-- If this is an area child project, uncomment the following line:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Child" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
-->
|
||||
<!-- If this is an area parent project, uncomment the following lines:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Parent" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
<CopyAreaManifests ManifestPath="$(AreasManifestDir)" CrossCopy="false" RenameViews="true" />
|
||||
-->
|
||||
</Target>
|
||||
<Target Name="AfterBuildCompiler" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>65267</DevelopmentServerPort>
|
||||
<DevelopmentServerPort>52289</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>
|
||||
</IISUrl>
|
@@ -5,10 +5,12 @@ using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Orchard.XmlRpc")]
|
||||
[assembly: AssemblyTitle("Orchard.Core")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Orchard.XmlRpc")]
|
||||
[assembly: AssemblyCompany("Microsoft IT")]
|
||||
[assembly: AssemblyProduct("Orchard.Core")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft IT 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -18,7 +20,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
|
||||
[assembly: Guid("ed6d019b-39e6-4978-87ae-78655a99a5c8")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
153
src/Orchard.Web/Core/Web.config
Normal file
153
src/Orchard.Web/Core/Web.config
Normal file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Note: As an alternative to hand editing this file you can use the
|
||||
web admin tool to configure settings for your application. Use
|
||||
the Website->Asp.Net Configuration option in Visual Studio.
|
||||
A full list of settings and comments can be found in
|
||||
machine.config.comments usually located in
|
||||
\Windows\Microsoft.Net\Framework\v2.x\Config
|
||||
-->
|
||||
<configuration>
|
||||
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
|
||||
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
|
||||
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
|
||||
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
|
||||
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
|
||||
</sectionGroup>
|
||||
</sectionGroup>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
|
||||
<system.web>
|
||||
|
||||
<!--
|
||||
Set compilation debug="true" to insert debugging
|
||||
symbols into the compiled page. Because this
|
||||
affects performance, set this value to true only
|
||||
during development.
|
||||
-->
|
||||
<compilation debug="true">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
The <customErrors> section enables configuration
|
||||
of what to do if/when an unhandled error occurs
|
||||
during the execution of a request. Specifically,
|
||||
it enables developers to configure html error pages
|
||||
to be displayed in place of a error stack trace.
|
||||
|
||||
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
|
||||
<error statusCode="403" redirect="NoAccess.htm" />
|
||||
<error statusCode="404" redirect="FileNotFound.htm" />
|
||||
</customErrors>
|
||||
-->
|
||||
|
||||
<pages>
|
||||
<controls>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
</controls>
|
||||
|
||||
<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="System.Linq"/>
|
||||
<add namespace="System.Collections.Generic"/>
|
||||
</namespaces>
|
||||
</pages>
|
||||
|
||||
<httpHandlers>
|
||||
<remove verb="*" path="*.asmx"/>
|
||||
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
|
||||
<add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
</httpHandlers>
|
||||
|
||||
<httpModules>
|
||||
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</httpModules>
|
||||
|
||||
</system.web>
|
||||
|
||||
<system.codedom>
|
||||
<compilers>
|
||||
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
|
||||
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<providerOption name="CompilerVersion" value="v3.5"/>
|
||||
<providerOption name="WarnAsError" value="false"/>
|
||||
</compiler>
|
||||
|
||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
|
||||
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<providerOption name="CompilerVersion" value="v3.5"/>
|
||||
<providerOption name="OptionInfer" value="true"/>
|
||||
<providerOption name="WarnAsError" value="false"/>
|
||||
</compiler>
|
||||
</compilers>
|
||||
</system.codedom>
|
||||
|
||||
<system.web.extensions/>
|
||||
|
||||
<!--
|
||||
The system.webServer section is required for running ASP.NET AJAX under Internet
|
||||
Information Services 7.0. It is not necessary for previous version of IIS.
|
||||
-->
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
|
||||
<modules runAllManagedModulesForAllRequests="true">
|
||||
<remove name="ScriptModule" />
|
||||
<remove name="UrlRoutingModule" />
|
||||
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</modules>
|
||||
|
||||
<handlers>
|
||||
<remove name="WebServiceHandlerFactory-Integrated"/>
|
||||
<remove name="ScriptHandlerFactory" />
|
||||
<remove name="ScriptHandlerFactoryAppServices" />
|
||||
<remove name="ScriptResource" />
|
||||
<remove name="MvcHttpHandler" />
|
||||
<remove name="UrlRoutingHandler" />
|
||||
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
|
||||
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
|
||||
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
</configuration>
|
@@ -4,11 +4,10 @@ using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Logging;
|
||||
using Orchard.XmlRpc.Models;
|
||||
|
||||
namespace Orchard.XmlRpc.Controllers {
|
||||
|
||||
namespace Orchard.Core.XmlRpc.Controllers {
|
||||
public class HomeController : Controller {
|
||||
private readonly IMapper<XRpcMethodResponse, XElement> _writer;
|
||||
private readonly IEnumerable<IXmlRpcHandler> _xmlRpcHandlers;
|
||||
@@ -47,4 +46,4 @@ namespace Orchard.XmlRpc.Controllers {
|
||||
return context.Response;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,7 +6,7 @@ using System.Web.Mvc;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace Orchard.XmlRpc.Controllers {
|
||||
namespace Orchard.Core.XmlRpc.Controllers {
|
||||
public class LiveWriterController : Controller {
|
||||
private const string ManifestUri = "http://schemas.microsoft.com/wlw/manifest/weblog";
|
||||
|
||||
@@ -26,11 +26,11 @@ namespace Orchard.XmlRpc.Controllers {
|
||||
new XElement(XName.Get("supportsSlug", ManifestUri), "Yes"));
|
||||
|
||||
var doc = new XDocument(new XElement(
|
||||
XName.Get("manifest", ManifestUri),
|
||||
options));
|
||||
XName.Get("manifest", ManifestUri),
|
||||
options));
|
||||
|
||||
Response.Cache.SetCacheability(HttpCacheability.NoCache);
|
||||
return Content(doc.ToString(), "text/xml");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5
src/Orchard.Web/Core/XmlRpc/IXmlRpcHandler.cs
Normal file
5
src/Orchard.Web/Core/XmlRpc/IXmlRpcHandler.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Orchard.Core.XmlRpc {
|
||||
public interface IXmlRpcHandler : IDependency {
|
||||
void Process(XmlRpcContext context);
|
||||
}
|
||||
}
|
@@ -7,7 +7,7 @@ using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Mvc.ModelBinders;
|
||||
|
||||
namespace Orchard.XmlRpc.Models {
|
||||
namespace Orchard.Core.XmlRpc.Models {
|
||||
public class ModelBinderProvider : IModelBinderProvider, IModelBinder {
|
||||
private readonly IMapper<XElement, XRpcMethodCall> _mapper;
|
||||
|
||||
@@ -33,4 +33,4 @@ namespace Orchard.XmlRpc.Models {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.XmlRpc.Models {
|
||||
namespace Orchard.Core.XmlRpc.Models {
|
||||
public class XRpcArray {
|
||||
public XRpcArray() {
|
||||
Data = new List<XRpcData>();
|
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Orchard.XmlRpc.Models {
|
||||
namespace Orchard.Core.XmlRpc.Models {
|
||||
public class XRpcData {
|
||||
private object _value;
|
||||
public object Value {
|
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.XmlRpc.Models {
|
||||
namespace Orchard.Core.XmlRpc.Models {
|
||||
public class XRpcMethodCall {
|
||||
public XRpcMethodCall() { Params = new List<XRpcData>(); }
|
||||
|
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.XmlRpc.Models {
|
||||
namespace Orchard.Core.XmlRpc.Models {
|
||||
public class XRpcMethodResponse {
|
||||
public XRpcMethodResponse() { Params = new List<XRpcData>(); }
|
||||
|
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.XmlRpc.Models {
|
||||
namespace Orchard.Core.XmlRpc.Models {
|
||||
public class XRpcStruct {
|
||||
public XRpcStruct() {
|
||||
Members = new Dictionary<string, XRpcData>();
|
1
src/Orchard.Web/Core/XmlRpc/Package.txt
Normal file
1
src/Orchard.Web/Core/XmlRpc/Package.txt
Normal file
@@ -0,0 +1 @@
|
||||
Name: XmlRpc
|
@@ -3,9 +3,9 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.XmlRpc.Models;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
|
||||
namespace Orchard.XmlRpc.Services {
|
||||
namespace Orchard.Core.XmlRpc.Services {
|
||||
public class XmlRpcReader :
|
||||
IMapper<XElement, XRpcMethodCall>,
|
||||
IMapper<XElement, XRpcData>,
|
@@ -2,9 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.XmlRpc.Models;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
|
||||
namespace Orchard.XmlRpc.Services {
|
||||
namespace Orchard.Core.XmlRpc.Services {
|
||||
public class XmlRpcWriter :
|
||||
IMapper<XRpcMethodResponse, XElement>,
|
||||
IMapper<XRpcStruct, XElement>,
|
||||
@@ -66,5 +66,5 @@ namespace Orchard.XmlRpc.Services {
|
||||
return new XElement("value", _dispatch[data.Type](data));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
using System.Web;
|
||||
using Orchard.XmlRpc.Models;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
|
||||
namespace Orchard.XmlRpc {
|
||||
namespace Orchard.Core.XmlRpc {
|
||||
public class XmlRpcContext {
|
||||
public HttpContextBase HttpContext { get; set; }
|
||||
public XRpcMethodCall Request { get; set; }
|
@@ -26,8 +26,17 @@ namespace Orchard.Web {
|
||||
);
|
||||
}
|
||||
|
||||
static string[] Replace(IEnumerable<string> source, string find, string replace) {
|
||||
return source.Select(format => format.Replace(find, replace)).ToArray();
|
||||
static IEnumerable<string> OrchardLocationFormats() {
|
||||
return new[] {
|
||||
"~/Packages/{2}/Views/{1}/{0}.aspx",
|
||||
"~/Packages/{2}/Views/{1}/{0}.ascx",
|
||||
"~/Packages/{2}/Views/Shared/{0}.aspx",
|
||||
"~/Packages/{2}/Views/Shared/{0}.ascx",
|
||||
"~/Core/{2}/Views/{1}/{0}.aspx",
|
||||
"~/Core/{2}/Views/{1}/{0}.ascx",
|
||||
"~/Core/{2}/Views/Shared/{0}.aspx",
|
||||
"~/Core/{2}/Views/Shared/{0}.ascx",
|
||||
};
|
||||
}
|
||||
|
||||
protected void Application_Start() {
|
||||
@@ -35,8 +44,9 @@ namespace Orchard.Web {
|
||||
|
||||
//TEMP: Modules should be able to register their stuff
|
||||
var viewEngine = ViewEngines.Engines.OfType<VirtualPathProviderViewEngine>().Single();
|
||||
viewEngine.AreaViewLocationFormats = Replace(viewEngine.AreaViewLocationFormats, "~/Areas/{2}", "~/Packages/{2}/");
|
||||
viewEngine.AreaPartialViewLocationFormats = Replace(viewEngine.AreaPartialViewLocationFormats, "~/Areas/{2}", "~/Packages/{2}/");
|
||||
viewEngine.AreaViewLocationFormats = OrchardLocationFormats().Concat(viewEngine.AreaViewLocationFormats).ToArray();
|
||||
viewEngine.AreaPartialViewLocationFormats = OrchardLocationFormats().Concat(viewEngine.AreaPartialViewLocationFormats).ToArray();
|
||||
|
||||
|
||||
_host = OrchardStarter.CreateHost(MvcSingletons);
|
||||
_host.Initialize();
|
||||
|
@@ -116,6 +116,10 @@
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Packages\Orchard.CmsPages\Orchard.CmsPages.csproj">
|
||||
<Project>{1ECC1131-0D0C-4822-AD90-E979868C63F3}</Project>
|
||||
<Name>Orchard.CmsPages</Name>
|
||||
|
@@ -111,9 +111,9 @@
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.XmlRpc\Orchard.XmlRpc.csproj">
|
||||
<Project>{0DC6B598-6D03-4923-A6C2-274D09854117}</Project>
|
||||
<Name>Orchard.XmlRpc</Name>
|
||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@@ -5,9 +5,9 @@ using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Hosting;
|
||||
using Orchard.CmsPages.ViewModels;
|
||||
using Orchard.Core.XmlRpc;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Logging;
|
||||
using Orchard.XmlRpc;
|
||||
using Orchard.XmlRpc.Models;
|
||||
|
||||
namespace Orchard.CmsPages.Services {
|
||||
public class XmlRpcHandler : IXmlRpcHandler {
|
||||
|
@@ -104,9 +104,9 @@
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.XmlRpc\Orchard.XmlRpc.csproj">
|
||||
<Project>{0DC6B598-6D03-4923-A6C2-274D09854117}</Project>
|
||||
<Name>Orchard.XmlRpc</Name>
|
||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Orchard.Core.XmlRpc;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Security;
|
||||
using Orchard.XmlRpc;
|
||||
using Orchard.XmlRpc.Models;
|
||||
|
||||
namespace Orchard.Media.Services {
|
||||
public class XmlRpcHandler : IXmlRpcHandler {
|
||||
|
@@ -1,10 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Orchard.XmlRpc {
|
||||
public interface IXmlRpcHandler : IDependency {
|
||||
void Process(XmlRpcContext context);
|
||||
}
|
||||
}
|
@@ -1 +0,0 @@
|
||||
name: XmlRpc
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
|
||||
|
||||
</configuration>
|
@@ -17,8 +17,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMce", "Orchard.Web\Pack
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Media", "Orchard.Web\Packages\Orchard.Media\Orchard.Media.csproj", "{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.XmlRpc", "Orchard.Web\Packages\Orchard.XmlRpc\Orchard.XmlRpc.csproj", "{0DC6B598-6D03-4923-A6C2-274D09854117}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Users", "Orchard.Web\Packages\Orchard.Users\Orchard.Users.csproj", "{79AED36E-ABD0-4747-93D3-8722B042454B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tests.Packages", "Orchard.Tests.Packages\Orchard.Tests.Packages.csproj", "{6CB3EB30-F725-45C0-9742-42599BA8E8D2}"
|
||||
@@ -27,6 +25,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Roles", "Orchard.We
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Wiki", "Orchard.Web\Packages\Orchard.Wiki\Orchard.Wiki.csproj", "{17C44253-65A2-4597-98C7-16EE576824B6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core", "Orchard.Web\Core\Orchard.Core.csproj", "{9916839C-39FC-4CEB-A5AF-89CA7E87119F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core.Tests", "Orchard.Core.Tests\Orchard.Core.Tests.csproj", "{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{74E681ED-FECC-4034-B9BD-01B0BB1BDECA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -61,10 +65,6 @@ Global
|
||||
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0DC6B598-6D03-4923-A6C2-274D09854117}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0DC6B598-6D03-4923-A6C2-274D09854117}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0DC6B598-6D03-4923-A6C2-274D09854117}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0DC6B598-6D03-4923-A6C2-274D09854117}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{79AED36E-ABD0-4747-93D3-8722B042454B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{79AED36E-ABD0-4747-93D3-8722B042454B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{79AED36E-ABD0-4747-93D3-8722B042454B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@@ -81,6 +81,14 @@ Global
|
||||
{17C44253-65A2-4597-98C7-16EE576824B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{17C44253-65A2-4597-98C7-16EE576824B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{17C44253-65A2-4597-98C7-16EE576824B6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -89,9 +97,12 @@ Global
|
||||
{1ECC1131-0D0C-4822-AD90-E979868C63F3} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{954CA994-D204-468B-9D69-51F6AD3E1C29} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{0DC6B598-6D03-4923-A6C2-274D09854117} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{79AED36E-ABD0-4747-93D3-8722B042454B} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{D10AD48F-407D-4DB5-A328-173EC7CB010F} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{17C44253-65A2-4597-98C7-16EE576824B6} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -31,22 +31,16 @@ namespace Orchard.Environment {
|
||||
}
|
||||
|
||||
public IEnumerable<Type> GetModuleTypes() {
|
||||
var assemblies = GetAssemblies();
|
||||
var notFromAutofac = assemblies.Where(a => !IsAutofacAssembly(a));
|
||||
var types = notFromAutofac.SelectMany(a => a.GetExportedTypes());
|
||||
var types = _packageManager.ActivePackages().SelectMany(x => x.ExportedTypes);
|
||||
types = types.Concat(typeof (IOrchardHost).Assembly.GetExportedTypes());
|
||||
var nonAbstractClasses = types.Where(t => t.IsClass && !t.IsAbstract);
|
||||
var modules = nonAbstractClasses.Where(t => typeof(IModule).IsAssignableFrom(t));
|
||||
return modules;
|
||||
}
|
||||
|
||||
private static bool IsAutofacAssembly(Assembly assembly) {
|
||||
return assembly == typeof(Autofac.IModule).Assembly ||
|
||||
assembly == typeof(Autofac.Integration.Web.IContainerProvider).Assembly;
|
||||
}
|
||||
|
||||
public IEnumerable<Type> GetDependencyTypes() {
|
||||
var assemblies = GetAssemblies();
|
||||
var types = assemblies.SelectMany(a => a.GetExportedTypes());
|
||||
var types = _packageManager.ActivePackages().SelectMany(x => x.ExportedTypes);
|
||||
types = types.Concat(typeof(IOrchardHost).Assembly.GetExportedTypes());
|
||||
var nonAbstractClasses = types.Where(t => t.IsClass && !t.IsAbstract);
|
||||
var modules = nonAbstractClasses.Where(t => typeof(IDependency).IsAssignableFrom(t));
|
||||
return modules;
|
||||
|
@@ -37,7 +37,7 @@ namespace Orchard.Environment {
|
||||
// .WithExtendedProperty("paths", new[] { "~/Packages" })
|
||||
// .SingletonScoped();
|
||||
builder.Register<PackageFolders>().As<IPackageFolders>()
|
||||
.WithArguments(new NamedParameter("paths", new[] { "~/Packages" }))
|
||||
.WithArguments(new NamedParameter("paths", new[] { "~/Core", "~/Packages" }))
|
||||
.SingletonScoped();
|
||||
|
||||
registrations(builder);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Autofac;
|
||||
using Autofac.Integration.Web.Mvc;
|
||||
|
||||
@@ -11,9 +12,19 @@ namespace Orchard.Mvc {
|
||||
}
|
||||
|
||||
public Service ServiceForControllerType(Type controllerType) {
|
||||
var controllerNamespace = controllerType.Namespace;
|
||||
var assemblySimpleName = controllerType.Assembly.GetName().Name;
|
||||
string areaName;
|
||||
if (assemblySimpleName == "Orchard.Core" &&
|
||||
controllerNamespace.StartsWith("Orchard.Core.")) {
|
||||
|
||||
areaName = controllerNamespace.Split('.').Skip(2).FirstOrDefault();
|
||||
}
|
||||
else {
|
||||
areaName = assemblySimpleName;
|
||||
}
|
||||
var controllerName = controllerType.Name.Replace("Controller", "");
|
||||
return new NamedService(("controller." + assemblySimpleName + "." + controllerName).ToLowerInvariant());
|
||||
return new NamedService(("controller." + areaName + "." + controllerName).ToLowerInvariant());
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,9 +2,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Yaml.Grammar;
|
||||
|
||||
namespace Orchard.Packages {
|
||||
public class PackageDescriptor {
|
||||
public string Location { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
|
@@ -8,5 +8,6 @@ namespace Orchard.Packages {
|
||||
public class PackageEntry {
|
||||
public PackageDescriptor Descriptor { get; set; }
|
||||
public Assembly Assembly { get; set; }
|
||||
public IEnumerable<Type> ExportedTypes { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,13 @@ using Yaml.Grammar;
|
||||
namespace Orchard.Packages {
|
||||
public interface IPackageFolders {
|
||||
IEnumerable<string> ListNames();
|
||||
YamlDocument ParseManifest(string name);
|
||||
ParseResult ParseManifest(string name);
|
||||
}
|
||||
|
||||
public class ParseResult {
|
||||
public string Location { get; set; }
|
||||
public string Name { get; set; }
|
||||
public YamlDocument YamlDocument { get; set; }
|
||||
}
|
||||
|
||||
public class PackageFolders : IPackageFolders {
|
||||
@@ -19,36 +25,39 @@ namespace Orchard.Packages {
|
||||
_paths = paths;
|
||||
}
|
||||
|
||||
private IEnumerable<string> GetPhysicalPaths() {
|
||||
foreach(var path in _paths) {
|
||||
if (path.StartsWith("~") && HostingEnvironment.IsHosted) {
|
||||
yield return HostingEnvironment.MapPath(path);
|
||||
}
|
||||
else {
|
||||
yield return path;
|
||||
}
|
||||
static string GetPhysicalPath(string path) {
|
||||
if (path.StartsWith("~") && HostingEnvironment.IsHosted) {
|
||||
return HostingEnvironment.MapPath(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IEnumerable<string> ListNames() {
|
||||
foreach (var path in GetPhysicalPaths()) {
|
||||
foreach (var directoryName in Directory.GetDirectories(path)) {
|
||||
foreach (var path in _paths) {
|
||||
foreach (var directoryName in Directory.GetDirectories(GetPhysicalPath(path))) {
|
||||
if (File.Exists(Path.Combine(directoryName, "Package.txt")))
|
||||
yield return Path.GetFileName(directoryName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public YamlDocument ParseManifest(string name) {
|
||||
foreach (var path in GetPhysicalPaths()) {
|
||||
var packageDirectoryPath = Path.Combine(path, name);
|
||||
public ParseResult ParseManifest(string name) {
|
||||
foreach (var path in _paths) {
|
||||
var packageDirectoryPath = Path.Combine(GetPhysicalPath(path), name);
|
||||
var packageManifestPath = Path.Combine(packageDirectoryPath, "Package.txt");
|
||||
if (!File.Exists(packageManifestPath)) {
|
||||
continue;
|
||||
}
|
||||
var yamlStream = YamlParser.Load(packageManifestPath);
|
||||
return yamlStream.Documents.Single();
|
||||
return new ParseResult {
|
||||
Location = path,
|
||||
Name = name,
|
||||
YamlDocument = yamlStream.Documents.Single()
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@@ -22,14 +22,15 @@ namespace Orchard.Packages {
|
||||
public IEnumerable<PackageDescriptor> AvailablePackages() {
|
||||
var names = _folders.ListNames();
|
||||
foreach (var name in names) {
|
||||
var document = _folders.ParseManifest(name);
|
||||
var mapping = (Mapping)document.Root;
|
||||
var parseResult = _folders.ParseManifest(name);
|
||||
var mapping = (Mapping)parseResult.YamlDocument.Root;
|
||||
var fields = mapping.Entities
|
||||
.Where(x => x.Key is Scalar)
|
||||
.ToDictionary(x => ((Scalar)x.Key).Text, x => x.Value);
|
||||
|
||||
|
||||
yield return new PackageDescriptor {
|
||||
Location = parseResult.Location,
|
||||
Name = name,
|
||||
DisplayName = GetValue(fields, "name"),
|
||||
Description = GetValue(fields, "description"),
|
||||
@@ -54,11 +55,27 @@ namespace Orchard.Packages {
|
||||
}
|
||||
|
||||
private static PackageEntry BuildEntry(PackageDescriptor descriptor) {
|
||||
var entry = new PackageEntry {
|
||||
Descriptor = descriptor,
|
||||
Assembly = Assembly.Load(descriptor.Name)
|
||||
};
|
||||
return entry;
|
||||
if (descriptor.Location == "~/Core") {
|
||||
|
||||
var assembly = Assembly.Load("Orchard.Core");
|
||||
return new PackageEntry {
|
||||
Descriptor = descriptor,
|
||||
Assembly = assembly,
|
||||
ExportedTypes = assembly.GetExportedTypes().Where(x => IsTypeFromPackage(x, descriptor))
|
||||
};
|
||||
}
|
||||
else {
|
||||
var assembly = Assembly.Load(descriptor.Name);
|
||||
return new PackageEntry {
|
||||
Descriptor = descriptor,
|
||||
Assembly = assembly,
|
||||
ExportedTypes = assembly.GetExportedTypes()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsTypeFromPackage(Type type, PackageDescriptor descriptor) {
|
||||
return (type.Namespace + ".").StartsWith("Orchard.Core." + descriptor.Name + ".");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user