--HG--
branch : nuget
This commit is contained in:
Sebastien Ros
2010-11-11 13:50:53 -08:00
74 changed files with 1995 additions and 1607 deletions

View File

@@ -209,7 +209,7 @@
<ItemGroup> <ItemGroup>
<!--<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.xml" />--> <!--<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.xml" />-->
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml" /> <MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml" />
<MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml"/> <MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml;$(LibFolder)\msdeploy\*.sql"/>
</ItemGroup> </ItemGroup>
<Copy SourceFiles="@(MsDeploy-Folder-Input)" <Copy SourceFiles="@(MsDeploy-Folder-Input)"

File diff suppressed because it is too large Load Diff

45
lib/msdeploy/install.sql Normal file
View File

@@ -0,0 +1,45 @@
/**********************************************************************/
/* Install.SQL */
/* Creates a login and makes the user a member of db roles */
/* */
/**********************************************************************/
-- Declare variables for database name, username and password
DECLARE @dbName sysname,
@dbUser sysname,
@dbPwd nvarchar(max);
-- Set variables for database name, username and password
SET @dbName = 'PlaceHolderForDb';
SET @dbUser = 'PlaceHolderForUser';
SET @dbPwd = 'PlaceHolderForPassword';
DECLARE @cmd nvarchar(max)
-- Create login
IF( SUSER_SID(@dbUser) is null )
BEGIN
print '-- Creating login '
SET @cmd = N'CREATE LOGIN ' + quotename(@dbUser) + N' WITH PASSWORD ='''+ replace(@dbPwd, '''', '''''') + N''''
EXEC(@cmd)
END
-- Create database user and map to login
-- and add user to the datareader, datawriter, ddladmin and securityadmin roles
--
SET @cmd = N'USE ' + quotename(@DBName) + N';
IF( NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = ''' + replace(@dbUser, '''', '''''') + N'''))
BEGIN
print ''-- Creating user'';
CREATE USER ' + quotename(@dbUser) + N' FOR LOGIN ' + quotename(@dbUser) + N';
print ''-- Adding user'';
EXEC sp_addrolemember ''db_ddladmin'', ''' + replace(@dbUser, '''', '''''') + N''';
print ''-- Adding user'';
EXEC sp_addrolemember ''db_securityadmin'', ''' + replace(@dbUser, '''', '''''') + N''';
print ''-- Adding user'';
EXEC sp_addrolemember ''db_datareader'', ''' + replace(@dbUser, '''', '''''') + N''';
print ''-- Adding user'';
EXEC sp_addrolemember ''db_datawriter'', ''' + replace(@dbUser, '''', '''''') + N''';
END'
EXEC(@cmd)
GO

View File

@@ -2,4 +2,7 @@
<iisapp path="Orchard" managedRuntimeVersion="v4.0" /> <iisapp path="Orchard" managedRuntimeVersion="v4.0" />
<setAcl path="Orchard/App_Data" setAclAccess="Modify" /> <setAcl path="Orchard/App_Data" setAclAccess="Modify" />
<setAcl path="Orchard/Media" setAclAccess="Modify" /> <setAcl path="Orchard/Media" setAclAccess="Modify" />
<setAcl path="Orchard/Modules" setAclAccess="Modify" />
<setAcl path="Orchard/Themes" setAclAccess="Modify" />
<dbFullSql path="install.sql" />
</MSDeploy.iisApp> </MSDeploy.iisApp>

View File

@@ -1,15 +1,77 @@
<parameters> <parameters>
<!-- Prompts where to copy the content files and takes a web site path (such as "contoso.com/app") -->
<parameter name="Application Path" description="Full site path where you would like to install your application (i.e., Default Web Site/orchard)" defaultValue="Default Web Site/orchard" tags="iisapp"> <parameter name="Application Path" description="Full site path where you would like to install your application (i.e., Default Web Site/orchard)" defaultValue="Default Web Site/orchard" tags="iisapp">
<parameterEntry type="ProviderPath" scope="iisapp" match="Orchard" /> <parameterEntry type="ProviderPath" scope="iisapp" match="Orchard" />
</parameter> </parameter>
<parameter name="SetAclParameter1" description="Hidden - automatically sets write access for the app" defaultValue="{Application Path}/App_Data" tags="Hidden, NoDatabase"> <!-- This is the parameter that is used to set ACLs, it's set to the application path filled in by the user -->
<parameter name="SetAclParameter1" description="Hidden - automatically sets write access for the app" defaultValue="{Application Path}/App_Data" tags="Hidden">
<parameterEntry type="ProviderPath" scope="setAcl" match="Orchard/App_Data" /> <parameterEntry type="ProviderPath" scope="setAcl" match="Orchard/App_Data" />
</parameter> </parameter>
<parameter name="SetAclParameter2" description="Hidden - automatically sets write access for the app" defaultValue="{Application Path}/Media" tags="Hidden, NoDatabase"> <parameter name="SetAclParameter2" description="Hidden - automatically sets write access for the app" defaultValue="{Application Path}/Media" tags="Hidden">
<parameterEntry type="ProviderPath" scope="setAcl" match="Orchard/Media" /> <parameterEntry type="ProviderPath" scope="setAcl" match="Orchard/Media" />
</parameter> </parameter>
</parameters> <parameter name="SetAclParameter3" description="Hidden - automatically sets write access for the app" defaultValue="{Application Path}/Modules" tags="Hidden">
<parameterEntry type="ProviderPath" scope="setAcl" match="Orchard/Modules" />
</parameter>
<parameter name="SetAclParameter4" description="Hidden - automatically sets write access for the app" defaultValue="{Application Path}/Themes" tags="Hidden">
<parameterEntry type="ProviderPath" scope="setAcl" match="Orchard/Themes" />
</parameter>
<!-- Prompts for database server name, this is used in the connection string parameter later -->
<parameter name="Database Server" description="Location of your database server (i.e. server name, IP address, or server\instance)" defaultValue=".\SQLEXPRESS" tags="SQL, dbServer">
</parameter>
<!-- Prompts for the database name and fills it into the database scripts -->
<parameter name="Database Name" description="Name of the database for Orchard." defaultValue="orchard" tags="SQL, dbName">
<parameterEntry type="TextFile" scope="install.sql" match="PlaceHolderForDb" />
</parameter>
<!-- Prompts for the database username and fills it into the database scripts.
The SQL tag indicates it is a parameter required for SQL, the DbUsername tag indicates this is a Db username -->
<parameter name="Database Username" description="User name to access you application database." defaultValue="orcharduser" tags="SQL, DbUsername">
<parameterEntry type="TextFile" scope="install.sql" match="PlaceHolderForUser" />
</parameter>
<!-- Prompts for the database password and fills it into the database scripts.
The SQL tag indicates it is a parameter required for SQL, the DbUserPassword tag indicates this is a Db password -->
<parameter name="Database Password" description="Password for the Database Username." tags="New, Password, SQL, DbUserPassword">
<parameterEntry type="TextFile" scope="install.sql" match="PlaceHolderForPassword" />
</parameter>
<!-- Prompts for the admin creds and uses it for the administrator connection string. This is used to create a login and assign permissions.
The SQL tag indicates it is a parameter required for SQL. The DbAdminUsername tag indicates it should be used when the user is creating a new database.
If they're not, it can be filled in with the DbUsername value. -->
<parameter name="Database Administrator" description="Administrator user name for your database This is used to create the database and user if the don't already exist." defaultValue="sa" tags="SQL, dbAdminUsername">
</parameter>
<!-- Prompts for the admin password and uses it for the administrator connection string.
This is use to create a login and assign permissions. The SQL tag indicates it is a parameter required for SQL.
The DbAdminPassword tag indicates it should be used when the user is creating a new database. If they're not, it can be filled in with the DbUserPassword value. -->
<parameter name="Database Administrator Password" description="Password for the database administrator account." tags="New, Password, SQL, dbAdminPassword">
</parameter>
<!-- This is the hidden admin connection string used to run the database scripts -->
<parameter name="Connection String" description="Automatically sets the connection string for the connection request." defaultValue="Server={Database Server};Database={Database Name};uid={Database Administrator};Pwd={Database Administrator Password};" tags="Hidden, SQL">
<parameterEntry type="ProviderPath" scope="dbfullsql" match="install.sql" />
</parameter>
<parameter name="Settings Data Provider for SQL" description="Orchard SQL Data Provider Setting" defaultValue="DataProvider: SqlServer" tags="Hidden, SQL">
<parameterEntry kind="TextFile" scope="\\Settings\.txt$" match="DataProvider\s*:[^\r\n]*" />
</parameter>
<parameter name="Settings Data Connection String for SQL" description="Orchard SQL Data Connection String Setting" defaultValue="DataConnectionString: Server={Database Server};Database={Database Name};uid={Database Administrator};Pwd={Database Administrator Password};" tags="Hidden, SQL">
<parameterEntry kind="TextFile" scope="\\Settings\.txt$" match="DataConnectionString\s*:[^\r\n]*" />
</parameter>
<parameter name="Settings Data Provider for SQLCE" description="Orchard SQLCE Data Provider Setting" defaultValue="DataProvider: SqlCe" tags="Hidden, SQLCE, NoStore">
<parameterEntry kind="TextFile" scope="\\Settings\.txt$" match="DataProvider\s*:[^\r\n]*" />
</parameter>
<parameter name="Settings Data Connection String for SQLCE" description="Orchard SQLCE Data Connection String Setting" defaultValue="DataConnectionString: " tags="Hidden, SQLCE, NoStore">
<parameterEntry kind="TextFile" scope="\\Settings\.txt$" match="DataConnectionString\s*:[^\r\n]*" />
</parameter>
</parameters>

View File

@@ -41,7 +41,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

View File

@@ -42,7 +42,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -41,7 +41,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

View File

@@ -41,7 +41,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

View File

@@ -41,7 +41,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

View File

@@ -41,7 +41,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

View File

@@ -7,6 +7,7 @@ using Orchard.Core.Common.Models;
using Orchard.Core.Routable.Models; using Orchard.Core.Routable.Models;
using Orchard.DisplayManagement; using Orchard.DisplayManagement;
using Orchard.Themes; using Orchard.Themes;
using Orchard.UI.Navigation;
namespace Orchard.Core.Containers.Controllers { namespace Orchard.Core.Containers.Controllers {
public class ItemController : Controller { public class ItemController : Controller {
@@ -22,7 +23,7 @@ namespace Orchard.Core.Containers.Controllers {
dynamic New { get; set; } dynamic New { get; set; }
[Themed] [Themed]
public ActionResult Display(string path, int? page) { public ActionResult Display(string path, Pager pager) {
var matchedPath = _containersPathConstraint.FindPath(path); var matchedPath = _containersPathConstraint.FindPath(path);
if (string.IsNullOrEmpty(matchedPath)) { if (string.IsNullOrEmpty(matchedPath)) {
throw new ApplicationException("404 - should not have passed path constraint"); throw new ApplicationException("404 - should not have passed path constraint");

View File

@@ -1,7 +1,9 @@
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers; using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.Handlers; using Orchard.ContentManagement.Handlers;
using Orchard.Core.Common.Models;
using Orchard.Core.Containers.Models; using Orchard.Core.Containers.Models;
using Orchard.Core.Containers.Settings;
using Orchard.Data; using Orchard.Data;
namespace Orchard.Core.Containers.Drivers { namespace Orchard.Core.Containers.Drivers {
@@ -25,8 +27,14 @@ namespace Orchard.Core.Containers.Drivers {
public ContainerPartHandler(IRepository<ContainerPartRecord> repository, IOrchardServices orchardServices) { public ContainerPartHandler(IRepository<ContainerPartRecord> repository, IOrchardServices orchardServices) {
Filters.Add(StorageFilter.For(repository)); Filters.Add(StorageFilter.For(repository));
OnInitializing<ContainerPart>((context, part) => { OnInitializing<ContainerPart>((context, part) => {
var containerSiteSettings = orchardServices.WorkContext.CurrentSite.As<ContainerSettingsPart>().Record; part.Record.PageSize = part.Settings.GetModel<ContainerTypePartSettings>().PageSizeDefault
part.Record.PageSize = containerSiteSettings.DefaultPageSize; ?? part.PartDefinition.Settings.GetModel<ContainerPartSettings>().PageSizeDefault;
part.Record.Paginated = part.Settings.GetModel<ContainerTypePartSettings>().PaginatedDefault
?? part.PartDefinition.Settings.GetModel<ContainerPartSettings>().PaginatedDefault;
//hard-coded defaults for ordering
part.Record.OrderByProperty = part.Is<CommonPart>() ? "CommonPart.PublishedUtc" : "";
part.Record.OrderByDirection = (int)OrderByDirection.Descending;
}); });
} }
} }

View File

@@ -1,35 +0,0 @@
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.Handlers;
using Orchard.Core.Containers.Models;
using Orchard.Data;
using Orchard.Localization;
namespace Orchard.Core.Containers.Drivers {
public class ContainerSettingsPartDriver : ContentPartDriver<ContainerSettingsPart> {
public ContainerSettingsPartDriver() {
T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
protected override string Prefix { get { return "ContainerSettings"; } }
protected override DriverResult Editor(ContainerSettingsPart part, dynamic shapeHelper) {
return ContentShape("Parts_Container_SiteSettings",
() => shapeHelper.EditorTemplate(TemplateName: "Container.SiteSettings", Model: part.Record, Prefix: Prefix));
}
protected override DriverResult Editor(ContainerSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
updater.TryUpdateModel(part.Record, Prefix, null, null);
return Editor(part, shapeHelper);
}
}
public class ContainerSettingsPartHandler : ContentHandler {
public ContainerSettingsPartHandler(IRepository<ContainerSettingsPartRecord> repository) {
Filters.Add(new ActivatingFilter<ContainerSettingsPart>("Site"));
Filters.Add(StorageFilter.For(repository));
}
}
}

View File

@@ -13,11 +13,6 @@ namespace Orchard.Core.Containers {
.Column<string>("OrderByProperty") .Column<string>("OrderByProperty")
.Column<int>("OrderByDirection")); .Column<int>("OrderByDirection"));
SchemaBuilder.CreateTable("ContainerSettingsPartRecord", table => table
.ContentPartRecord()
.Column<int>("DefaultPageSize", column => column.WithDefault(10))
);
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder.Attachable()); ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder.Attachable()); ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder.Attachable());

View File

@@ -6,7 +6,7 @@ namespace Orchard.Core.Containers.Models {
} }
public class ContainerPartRecord : ContentPartRecord { public class ContainerPartRecord : ContentPartRecord {
public virtual int Paginated { get; set; } public virtual bool Paginated { get; set; }
public virtual int PageSize { get; set; } public virtual int PageSize { get; set; }
public virtual string OrderByProperty { get; set; } public virtual string OrderByProperty { get; set; }
public virtual int OrderByDirection { get; set; } public virtual int OrderByDirection { get; set; }

View File

@@ -1,6 +1,15 @@
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.ContentManagement.Records;
namespace Orchard.Core.Containers.Models { namespace Orchard.Core.Containers.Models {
public class ContainerSettingsPart : ContentPart<ContainerSettingsPartRecord> { public class ContainerSettingsPart : ContentPart<ContainerSettingsPartRecord> {
} }
public class ContainerSettingsPartRecord : ContentPartRecord {
private int _defaultPageSize = 10;
public virtual int DefaultPageSize {
get { return _defaultPageSize; }
set { _defaultPageSize = value; }
}
}
} }

View File

@@ -1,11 +0,0 @@
using Orchard.ContentManagement.Records;
namespace Orchard.Core.Containers.Models {
public class ContainerSettingsPartRecord : ContentPartRecord {
private int _defaultPageSize = 10;
public virtual int DefaultPageSize {
get { return _defaultPageSize; }
set { _defaultPageSize = value; }
}
}
}

View File

@@ -4,9 +4,9 @@ Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 0.8.0 Version: 0.8.0
OrchardVersion: 0.8.0 OrchardVersion: 0.8.0
Description: The common module introduces container and containable behaviors for content items Description: The containers module introduces container and containable behaviors for content items.
Features: Features:
Containers: Containers:
Description: Container content parts. Description: Container and containable parts to enable parent-child relationships between content items.
Dependencies: Contents, Routable Dependencies: Contents, Routable
Category: Content Category: Content

View File

@@ -0,0 +1,88 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.ContentManagement.MetaData.Models;
using Orchard.ContentManagement.ViewModels;
namespace Orchard.Core.Containers.Settings {
public class ContainerPartSettings {
public const int PageSizeDefaultDefault = 10;
public const bool PaginatedDefaultDefault = true;
private int? _pageSizeDefault;
private bool? _paginiatedDefault;
public int PageSizeDefault {
get {
return _pageSizeDefault != null
? (int)_pageSizeDefault
: PageSizeDefaultDefault;
}
set { _pageSizeDefault = value; }
}
public bool PaginatedDefault {
get {
return _paginiatedDefault != null
? (bool)_paginiatedDefault
: PaginatedDefaultDefault;
}
set { _paginiatedDefault = value; }
}
}
public class ContainerTypePartSettings {
public int? PageSizeDefault { get; set; }
public bool? PaginatedDefault { get; set; }
}
public class ContainerSettingsHooks : ContentDefinitionEditorEventsBase {
public override IEnumerable<TemplateViewModel> TypePartEditor(ContentTypePartDefinition definition) {
if (definition.PartDefinition.Name != "ContainerPart")
yield break;
var model = definition.Settings.GetModel<ContainerTypePartSettings>();
var partModel = definition.PartDefinition.Settings.GetModel<ContainerPartSettings>();
if (model.PageSizeDefault == null)
model.PageSizeDefault = partModel.PageSizeDefault;
if (model.PaginatedDefault == null)
model.PaginatedDefault = partModel.PaginatedDefault;
yield return DefinitionTemplate(model);
}
public override IEnumerable<TemplateViewModel> PartEditor(ContentPartDefinition definition) {
if (definition.Name != "ContainerPart")
yield break;
var model = definition.Settings.GetModel<ContainerPartSettings>();
yield return DefinitionTemplate(model);
}
public override IEnumerable<TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) {
if (builder.Name != "ContainerPart")
yield break;
var model = new ContainerTypePartSettings();
updateModel.TryUpdateModel(model, "ContainerTypePartSettings", null, null);
builder.WithSetting("ContainerTypePartSettings.PageSizeDefault", model.PageSizeDefault.ToString());
builder.WithSetting("ContainerTypePartSettings.PaginatedDefault", model.PaginatedDefault.ToString());
yield return DefinitionTemplate(model);
}
public override IEnumerable<TemplateViewModel> PartEditorUpdate(ContentPartDefinitionBuilder builder, IUpdateModel updateModel) {
if (builder.Name != "ContainerPart")
yield break;
var model = new ContainerPartSettings();
updateModel.TryUpdateModel(model, "ContainerPartSettings", null, null);
builder.WithSetting("ContainerPartSettings.PageSizeDefault", model.PageSizeDefault.ToString());
builder.WithSetting("ContainerPartSettings.PaginatedDefault", model.PaginatedDefault.ToString());
yield return DefinitionTemplate(model);
}
}
}

View File

@@ -0,0 +1,6 @@
namespace Orchard.Core.Common.Settings {
public class LocationSettings {
public string Zone { get; set; }
public string Position { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
@model Orchard.Core.Containers.Settings.ContainerPartSettings
<fieldset>
<label for="@Html.FieldIdFor(m => m.PageSizeDefault)">@T("Default Page Size")</label>
@Html.EditorFor(m => m.PageSizeDefault)
</fieldset>
<fieldset>
@Html.EditorFor(m => m.PaginatedDefault)
<label for="@Html.FieldIdFor( m => m.PaginatedDefault)" class="forcheckbox">@T("Show paging controls")</label>
</fieldset>

View File

@@ -0,0 +1,9 @@
@model Orchard.Core.Containers.Settings.ContainerTypePartSettings
<fieldset>
<label for="@Html.FieldIdFor(m => m.PageSizeDefault)">@T("Default Page Size")</label>
@Html.EditorFor(m => m.PageSizeDefault)
</fieldset>
<fieldset>
<label for="@Html.FieldIdFor( m => m.PaginatedDefault)">@T("Show paging controls")</label>
@Html.EditorFor(m => m.PaginatedDefault)
</fieldset>

View File

@@ -1,11 +0,0 @@
@model Orchard.Core.Containers.Models.ContainerSettingsPartRecord
@using Orchard.Core.Containers.Models;
<fieldset>
<legend>@T("Content Container")</legend>
<div>
<label for="@ViewData.TemplateInfo.GetFullHtmlFieldId("DefaultPageSize")">@T("Default page size")</label>
@Html.EditorFor(m => m.DefaultPageSize)
@Html.ValidationMessageFor(m => m.DefaultPageSize)
</div>
</fieldset>

View File

@@ -1,21 +1,21 @@
@model Orchard.Core.Containers.Models.ContainerPart @model Orchard.Core.Containers.Models.ContainerPart
@using Orchard.Core.Containers.Models;
<fieldset> <fieldset class="with-checkbox">
@Html.LabelFor(m => m.Record.PageSize, T("Page Size")) <span>
@Html.TextBoxFor(m => m.Record.PageSize) @Html.LabelFor(m => m.Record.PageSize, T("Page Size"))
@Html.EditorFor(m => m.Record.PageSize)
</span>
<span class="checkbox-and-label">
@Html.CheckBoxFor(m => m.Record.Paginated)
<label for="@Html.FieldIdFor( m => m.Record.Paginated)" class="forcheckbox">@T("Show paging controls")</label>
</span>
</fieldset> </fieldset>
<fieldset> <fieldset>
@Html.LabelFor(m => m.Record.Paginated, T("Paginated")) @Html.LabelFor(m => m.Record.OrderByProperty, T("Order By"))
@Html.TextBoxFor(m => m.Record.Paginated) @Html.TextBoxFor(m => m.Record.OrderByProperty, new { @class = "textMedium" })
</fieldset> <select id="@Html.FieldIdFor( m => m.Record.OrderByDirection)" name="@Html.FieldIdFor( m => m.Record.OrderByDirection)">
@Html.SelectOption(Model.Record.OrderByDirection, (int)OrderByDirection.Ascending, T("Ascending").Text)
<fieldset> @Html.SelectOption(Model.Record.OrderByDirection, (int)OrderByDirection.Descending, T("Descending").Text)
@Html.LabelFor(m => m.Record.OrderByProperty, T("OrderByProperty")) </select>
@Html.TextBoxFor(m => m.Record.OrderByProperty) <span class="hint">Currently, only ordering by a content part property is supported (e.g. CommonPart.PublishedUtc).</span>
</fieldset> </fieldset>
<fieldset>
@Html.LabelFor(m => m.Record.OrderByDirection, T("OrderByDirection"))
@Html.TextBoxFor(m => m.Record.OrderByDirection)
</fieldset>

View File

@@ -24,17 +24,19 @@ namespace Orchard.Core.Contents {
builder.Add(T("Content"), "2", builder.Add(T("Content"), "2",
menu => menu.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new {area = "Contents", id = ""}))); menu => menu.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new {area = "Contents", id = ""})));
builder.Add(T("New"), "-1", menu => { var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
menu.Add(T("Content Item"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" })); if (contentTypes.Count() > 0) {
foreach (var contentTypeDefinition in contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName)) { builder.Add(T("New"), "-1", menu => {
var ci = _contentManager.New(contentTypeDefinition.Name); foreach (var contentTypeDefinition in contentTypes) {
var cim = _contentManager.GetItemMetadata(ci); var ci = _contentManager.New(contentTypeDefinition.Name);
var createRouteValues = cim.CreateRouteValues; var cim = _contentManager.GetItemMetadata(ci);
// review: the display name should be a LocalizedString var createRouteValues = cim.CreateRouteValues;
if (createRouteValues.Any()) // review: the display name should be a LocalizedString
menu.Add(T(contentTypeDefinition.DisplayName), "5", item => item.Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues)); if (createRouteValues.Any())
} menu.Add(T(contentTypeDefinition.DisplayName), "5", item => item.Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues));
}); }
});
}
} }
} }
} }

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@@ -79,15 +79,14 @@
<Compile Include="Common\Drivers\TextFieldDriver.cs" /> <Compile Include="Common\Drivers\TextFieldDriver.cs" />
<Compile Include="Containers\ContainersPathConstraint.cs" /> <Compile Include="Containers\ContainersPathConstraint.cs" />
<Compile Include="Containers\Migrations.cs" /> <Compile Include="Containers\Migrations.cs" />
<Compile Include="Containers\Drivers\ContainerSettingsPartDriver.cs" />
<Compile Include="Containers\Models\ContainerSettingsPart.cs" /> <Compile Include="Containers\Models\ContainerSettingsPart.cs" />
<Compile Include="Containers\Models\ContainerSettingsPartRecord.cs" />
<Compile Include="Containers\Models\ContainablePart.cs" /> <Compile Include="Containers\Models\ContainablePart.cs" />
<Compile Include="Containers\Models\ContainerPart.cs" /> <Compile Include="Containers\Models\ContainerPart.cs" />
<Compile Include="Common\Shapes.cs" /> <Compile Include="Common\Shapes.cs" />
<Compile Include="Common\Fields\TextField.cs" /> <Compile Include="Common\Fields\TextField.cs" />
<Compile Include="Containers\Routes.cs" /> <Compile Include="Containers\Routes.cs" />
<Compile Include="Containers\Services\ContainersPathConstraintUpdater.cs" /> <Compile Include="Containers\Services\ContainersPathConstraintUpdater.cs" />
<Compile Include="Containers\Settings\ContainerSettings.cs" />
<Compile Include="Containers\ViewModels\ContainableViewModel.cs" /> <Compile Include="Containers\ViewModels\ContainableViewModel.cs" />
<Compile Include="Contents\Security\AuthorizationEventHandler.cs" /> <Compile Include="Contents\Security\AuthorizationEventHandler.cs" />
<Compile Include="Common\Services\BbcodeFilter.cs" /> <Compile Include="Common\Services\BbcodeFilter.cs" />
@@ -402,7 +401,8 @@
<Content Include="Containers\Views\EditorTemplates\Containable.cshtml" /> <Content Include="Containers\Views\EditorTemplates\Containable.cshtml" />
<Content Include="Containers\Views\EditorTemplates\Container.cshtml" /> <Content Include="Containers\Views\EditorTemplates\Container.cshtml" />
<Content Include="Containers\Views\Item\Display.cshtml" /> <Content Include="Containers\Views\Item\Display.cshtml" />
<Content Include="Containers\Views\EditorTemplates\Container.SiteSettings.cshtml" /> <Content Include="Containers\Views\DefinitionTemplates\ContainerPartSettings.cshtml" />
<Content Include="Containers\Views\DefinitionTemplates\ContainerTypePartSettings.cshtml" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -9,10 +9,10 @@ Features:
Orchard.Blogs: Orchard.Blogs:
Name: Blogs Name: Blogs
Description: A simple web log. Description: A simple web log.
Dependencies: Feeds Dependencies: Shapes, Common, Routable, Feeds, Orchard.Widgets, Orchard.jQuery
Category: Content Category: Content
Orchard.Blogs.RemotePublishing: Orchard.Blogs.RemotePublishing:
Name: Remote Blog Publishing Name: Remote Blog Publishing
Description: Blog easier using a dedicated MetaWeblogAPI-compatible publishing tool. Description: Blog easier using a dedicated MetaWeblogAPI-compatible publishing tool.
Dependencies: XmlRpc Dependencies: XmlRpc, Orchard.Blogs
Category: Content Publishing Category: Content Publishing

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -1,14 +1,16 @@
/** archives **/ /** archives **/
$(function() { (function ($) {
$('.archives ul.years li.previous').each(function() { $(function() {
$(this).click(function(ev) { $('.archives ul.years li.previous').each(function() {
if (!ev || $(ev.target).not("a").size()) { $(this).click(function(ev) {
$(this).toggleClass("open"); if (!ev || $(ev.target).not("a").size()) {
$(this).find("h4>span").toggle(); $(this).toggleClass("open");
$(this).children("ul").toggle(); $(this).find("h4>span").toggle();
} $(this).children("ul").toggle();
}); }
});
//$(this).hoverClassIfy(); //$(this).hoverClassIfy();
});
}); });
}); })(jQuery);

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -86,7 +86,11 @@ namespace Orchard.ContentTypes.Controllers {
if (typeViewModel == null) if (typeViewModel == null)
return HttpNotFound(); return HttpNotFound();
if (!TryUpdateModel(typeViewModel)) var edited = new EditTypeViewModel();
TryUpdateModel(edited);
typeViewModel.DisplayName = edited.DisplayName;
if (!ModelState.IsValid)
return View(typeViewModel); return View(typeViewModel);
_contentDefinitionService.AlterType(typeViewModel, this); _contentDefinitionService.AlterType(typeViewModel, this);

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -1,8 +1,4 @@
using System; using Orchard.ContentManagement.MetaData;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions; using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration; using Orchard.Data.Migration;
@@ -17,12 +13,12 @@ namespace Orchard.Lists {
.WithPart("MenuPart") .WithPart("MenuPart")
.Creatable()); .Creatable());
//ContentDefinitionManager.AlterTypeDefinition("ListWidget", ContentDefinitionManager.AlterTypeDefinition("ListWidget",
// cfg => cfg cfg => cfg
// .WithPart("CommonPart") .WithPart("CommonPart")
// .WithPart("WidgetPart") .WithPart("WidgetPart")
// .WithPart("ListWidgetPart") .WithPart("ContainerPart")
// .WithSetting("Stereotype", "Widget")); .WithSetting("Stereotype", "Widget"));
return 1; return 1;
} }

View File

@@ -4,9 +4,9 @@ Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 0.8.0 Version: 0.8.0
OrchardVersion: 0.8.0 OrchardVersion: 0.8.0
Description: Description for the module Description: Introduces a preconfigured container-enabled content type.
Features: Features:
Orchard.Lists: Orchard.Lists:
Description: Description for feature Orchard.Lists. Description: A basic container-enabled content type.
Dependencies: Contents, Containers Dependencies: Contents, Containers
Category: Content Category: Content

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@@ -65,9 +65,6 @@
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Web.config" />
<Content Include="Scripts\Web.config" />
<Content Include="Styles\Web.config" />
<Content Include="Properties\AssemblyInfo.cs" /> <Content Include="Properties\AssemblyInfo.cs" />
<Content Include="Module.txt" /> <Content Include="Module.txt" />
</ItemGroup> </ItemGroup>
@@ -84,10 +81,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="Migrations.cs" /> <Compile Include="Migrations.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<Folder Include="Controllers\" />
<Folder Include="Models\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.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.

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
</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=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
</handlers>
</system.webServer>
</configuration>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -8,12 +8,12 @@ Copyright: 2010, Orchard. All Rights Reserved
/* Color Palette /* Color Palette
************************************************************** **************************************************************
Background: Background: #2d2f25
Borders: Borders:
Text: Text: #333333
Secondary Text: Secondary Text:
Main Accent: Main Accent:
Links: Links: 1e5d7d
*/ */
@@ -28,7 +28,7 @@ del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td { table, caption, tbody, tfoot, thead, tr, th, td, button, submit {
margin: 0; margin: 0;
padding: 0; padding: 0;
border: 0; border: 0;
@@ -79,6 +79,11 @@ header, footer, aside, nav, article { display: block; }
The font-size 81.3% sets the base font to 13px The font-size 81.3% sets the base font to 13px
Pixels EMs Percent Points Pixels EMs Percent Points
1px 0.077em 7.7% 1pt
2px 0.154em 15.4% 2pt
3px 0.231em 23.1% 3pt
4px 0.308em 30.8% 3pt
5px 0.385em 38.5% 4pt
6px 0.462em 46.2% 5pt 6px 0.462em 46.2% 5pt
7px 0.538em 53.8% 5pt 7px 0.538em 53.8% 5pt
8px 0.615em 61.5% 6pt 8px 0.615em 61.5% 6pt
@@ -564,9 +569,8 @@ button.remove:focus::-moz-focus-inner, .remove.button:focus::-moz-focus-inner {
.delete.button { .delete.button {
float:right; float:right;
} }
input[type="submit"], input[type="reset"], input[type="button"], button, .button, .button:link, .button:visited input[type="submit"], input[type="reset"], input[type="button"], button, submit, .button, .button:link, .button:visited
{ {
font-size: 107.7%; /*14px*/
color:#333; color:#333;
background:#F5F5F5; background:#F5F5F5;
border:1px solid #999; border:1px solid #999;
@@ -731,7 +735,6 @@ table.items th, table.items td {
padding:0; padding:0;
} }
.contentItems li { .contentItems li {
border-bottom:1px solid #eaeaea;
margin:0; margin:0;
overflow:hidden; overflow:hidden;
padding:0 1.4em .8em; padding:0 1.4em .8em;
@@ -830,7 +833,11 @@ table.items th, table.items td {
border-color:#666d51; border-color:#666d51;
border-style:solid; border-style:solid;
} }
.permalink .checkbox-and-label { /* Routable and Containers (Core) */
.with-checkbox .checkbox-and-label { /* todo: (heskew) routable should be changed to use this too */
margin-left:10px;
}
.checkbox-and-label {
white-space:nowrap; white-space:nowrap;
} }
/* Settings */ /* Settings */

View File

@@ -27,7 +27,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -2,14 +2,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Linq.Expressions;
using System.Reflection; using System.Reflection;
using System.Reflection.Emit; using System.Reflection.Emit;
using FluentNHibernate.Automapping; using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations; using FluentNHibernate.Automapping.Alterations;
using JetBrains.Annotations; using JetBrains.Annotations;
using Orchard.Environment.Descriptor;
using Orchard.Environment.Descriptor.Models;
using Orchard.Environment.ShellBuilders.Models; using Orchard.Environment.ShellBuilders.Models;
namespace Orchard.ContentManagement.Records { namespace Orchard.ContentManagement.Records {
@@ -59,20 +56,7 @@ namespace Orchard.ContentManagement.Records {
class Alteration<TItemRecord, TPartRecord> : IAlteration<TItemRecord> { class Alteration<TItemRecord, TPartRecord> : IAlteration<TItemRecord> {
public void Override(AutoMapping<TItemRecord> mapping) { public void Override(AutoMapping<TItemRecord> mapping) {
// public TPartRecord TPartRecord {get;set;} mapping.References<TPartRecord>(typeof(TItemRecord), typeof(TPartRecord).Name)
var name = typeof(TPartRecord).Name;
var dynamicMethod = new DynamicMethod(name, typeof(TPartRecord), null, typeof(TItemRecord));
var syntheticMethod = new SyntheticMethodInfo(dynamicMethod, typeof(TItemRecord));
var syntheticProperty = new SyntheticPropertyInfo(syntheticMethod);
// record => record.TPartRecord
var parameter = Expression.Parameter(typeof(TItemRecord), "record");
var syntheticExpression = (Expression<Func<TItemRecord, TPartRecord>>)Expression.Lambda(
typeof(Func<TItemRecord, TPartRecord>),
Expression.Property(parameter, syntheticProperty),
parameter);
mapping.References(syntheticExpression)
.Access.NoOp() .Access.NoOp()
.Column("Id") .Column("Id")
.ForeignKey("none") // prevent foreign key constraint from ContentItem(Version)Record to TPartRecord .ForeignKey("none") // prevent foreign key constraint from ContentItem(Version)Record to TPartRecord
@@ -82,151 +66,5 @@ namespace Orchard.ContentManagement.Records {
.Cascade.All(); .Cascade.All();
} }
} }
/// <summary>
/// Synthetic method around a dynamic method. We need this so that we can
/// override the "static" method attributes, and also return a valid "DeclaringType".
/// </summary>
private class SyntheticMethodInfo : MethodInfo {
private readonly DynamicMethod _dynamicMethod;
private readonly Type _declaringType;
public SyntheticMethodInfo(DynamicMethod dynamicMethod, Type declaringType) {
_dynamicMethod = dynamicMethod;
_declaringType = declaringType;
}
public override object[] GetCustomAttributes(bool inherit) {
return _dynamicMethod.GetCustomAttributes(inherit);
}
public override bool IsDefined(Type attributeType, bool inherit) {
return IsDefined(attributeType, inherit);
}
public override ParameterInfo[] GetParameters() {
return _dynamicMethod.GetParameters();
}
public override MethodImplAttributes GetMethodImplementationFlags() {
return _dynamicMethod.GetMethodImplementationFlags();
}
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) {
return _dynamicMethod.Invoke(obj, invokeAttr, binder, parameters, culture);
}
public override MethodInfo GetBaseDefinition() {
return _dynamicMethod.GetBaseDefinition();
}
public override ICustomAttributeProvider ReturnTypeCustomAttributes {
get { return ReturnTypeCustomAttributes; }
}
public override string Name {
get { return _dynamicMethod.Name; }
}
public override Type DeclaringType {
get { return _declaringType; }
}
public override Type ReflectedType {
get { return _dynamicMethod.ReflectedType; }
}
public override RuntimeMethodHandle MethodHandle {
get { return _dynamicMethod.MethodHandle; }
}
public override MethodAttributes Attributes {
get { return _dynamicMethod.Attributes & ~MethodAttributes.Static; }
}
public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
return _dynamicMethod.GetCustomAttributes(attributeType, inherit);
}
public override Type ReturnType {
get { return _dynamicMethod.ReturnType; }
}
}
/// <summary>
/// Synthetic property around a method info (the "getter" method).
/// This is a minimal implementation enabling support for AutoMapping.References.
/// </summary>
private class SyntheticPropertyInfo : PropertyInfo {
private readonly MethodInfo _getMethod;
public SyntheticPropertyInfo(MethodInfo getMethod) {
_getMethod = getMethod;
}
public override object[] GetCustomAttributes(bool inherit) {
throw new NotImplementedException();
}
public override bool IsDefined(Type attributeType, bool inherit) {
throw new NotImplementedException();
}
public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
throw new NotImplementedException();
}
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
throw new NotImplementedException();
}
public override MethodInfo[] GetAccessors(bool nonPublic) {
throw new NotImplementedException();
}
public override MethodInfo GetGetMethod(bool nonPublic) {
return _getMethod;
}
public override MethodInfo GetSetMethod(bool nonPublic) {
throw new NotImplementedException();
}
public override ParameterInfo[] GetIndexParameters() {
throw new NotImplementedException();
}
public override string Name {
get { return _getMethod.Name; }
}
public override Type DeclaringType {
get { return _getMethod.DeclaringType; }
}
public override Type ReflectedType {
get { return _getMethod.ReflectedType; }
}
public override Type PropertyType {
get { return _getMethod.ReturnType; }
}
public override PropertyAttributes Attributes {
get { throw new NotImplementedException(); }
}
public override bool CanRead {
get { return true; }
}
public override bool CanWrite {
get { throw new NotImplementedException(); }
}
public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
throw new NotImplementedException();
}
}
} }
} }

View File

@@ -36,10 +36,10 @@ namespace Orchard.Mvc {
var serviceKey = (areaName + "/" + controllerName).ToLowerInvariant(); var serviceKey = (areaName + "/" + controllerName).ToLowerInvariant();
// Now that the request container is known - try to resolve the controller information // Now that the request container is known - try to resolve the controller information
Lazy<IController, IControllerType> info; Lazy<Meta<IController>> info;
var workContext = requestContext.GetWorkContext(); var workContext = requestContext.GetWorkContext();
if (TryResolve(workContext, serviceKey, out info)) { if (TryResolve(workContext, serviceKey, out info)) {
return info.Metadata.ControllerType; return (Type) info.Value.Metadata["ControllerType"];
} }
return null; return null;

View File

@@ -41,7 +41,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Orchard Security Rules" Description="This rule set contains all Microsoft security rules. Include this rule set to maximize the number of potential security issues that are reported." ToolsVersion="10.0">
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA2100" Action="Warning" />
<Rule Id="CA2102" Action="Warning" />
<Rule Id="CA2103" Action="Warning" />
<Rule Id="CA2104" Action="Warning" />
<Rule Id="CA2105" Action="Warning" />
<Rule Id="CA2106" Action="Warning" />
<Rule Id="CA2107" Action="Warning" />
<Rule Id="CA2108" Action="Warning" />
<Rule Id="CA2109" Action="Warning" />
<Rule Id="CA2111" Action="Warning" />
<Rule Id="CA2112" Action="Warning" />
<Rule Id="CA2114" Action="Warning" />
<Rule Id="CA2115" Action="Warning" />
<Rule Id="CA2116" Action="Warning" />
<Rule Id="CA2117" Action="Warning" />
<Rule Id="CA2118" Action="Warning" />
<Rule Id="CA2119" Action="Warning" />
<Rule Id="CA2120" Action="Warning" />
<Rule Id="CA2121" Action="Warning" />
<Rule Id="CA2122" Action="Warning" />
<Rule Id="CA2123" Action="Warning" />
<Rule Id="CA2124" Action="Warning" />
<Rule Id="CA2126" Action="Warning" />
<Rule Id="CA2130" Action="Warning" />
<Rule Id="CA2131" Action="Warning" />
<Rule Id="CA2132" Action="Warning" />
<Rule Id="CA2133" Action="Warning" />
<Rule Id="CA2134" Action="Warning" />
<Rule Id="CA2135" Action="Warning" />
<Rule Id="CA2136" Action="Warning" />
<Rule Id="CA2137" Action="Warning" />
<Rule Id="CA2138" Action="Warning" />
<Rule Id="CA2139" Action="Warning" />
<Rule Id="CA2140" Action="Warning" />
<Rule Id="CA2141" Action="Warning" />
<Rule Id="CA2142" Action="Warning" />
<Rule Id="CA2143" Action="Warning" />
<Rule Id="CA2144" Action="Warning" />
<Rule Id="CA2145" Action="Warning" />
<Rule Id="CA2146" Action="Warning" />
<Rule Id="CA2147" Action="Warning" />
<Rule Id="CA2149" Action="Warning" />
</Rules>
</RuleSet>

View File

@@ -42,7 +42,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -41,7 +41,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -42,7 +42,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -43,7 +43,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<UseVSHostingProcess>true</UseVSHostingProcess> <UseVSHostingProcess>true</UseVSHostingProcess>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\OrchardSecurity.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>