--HG--
branch : mvc3p1
This commit is contained in:
Louis DeJardin
2010-08-23 13:10:51 -07:00
7 changed files with 33 additions and 19 deletions

View File

@@ -50,7 +50,6 @@ namespace Orchard.Tests.DataMigration {
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(session)).As<ISessionLocator>(); builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(session)).As<ISessionLocator>();
builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty<RecordBlueprint>() }).As<ShellBlueprint>(); builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty<RecordBlueprint>() }).As<ShellBlueprint>();
builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST_" }).As<ShellSettings>(); builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST_" }).As<ShellSettings>();
builder.RegisterType<SqlCeCommandInterpreter>().As<ICommandInterpreter>();
builder.RegisterModule(new DataModule()); builder.RegisterModule(new DataModule());
_container = builder.Build(); _container = builder.Build();
@@ -153,8 +152,8 @@ namespace Orchard.Tests.DataMigration {
.Column("City", DbType.String) .Column("City", DbType.String)
.Column("ZIP", DbType.Int32, column => column.Unique()) .Column("ZIP", DbType.Int32, column => column.Unique())
.Column("UserId", DbType.Int32, column => column.NotNull())) .Column("UserId", DbType.Int32, column => column.NotNull()))
.CreateForeignKey("User_Address", "User", new[] { "UserId" }, "User", new[] { "Id" }) .CreateForeignKey("FK_User", "Address", new[] { "UserId" }, "User", new[] { "Id" })
.DropForeignKey("User", "User_Address"); .DropForeignKey("Address", "FK_User");
} }
} }

View File

@@ -6,6 +6,7 @@ using System.Xml.Linq;
using JetBrains.Annotations; using JetBrains.Annotations;
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.Core.Feeds.Models; using Orchard.Core.Feeds.Models;
using Orchard.Utility.Extensions;
namespace Orchard.Core.Feeds.StandardBuilders { namespace Orchard.Core.Feeds.StandardBuilders {
[UsedImplicitly] [UsedImplicitly]
@@ -35,16 +36,26 @@ namespace Orchard.Core.Feeds.StandardBuilders {
var guid = new XElement("guid", new XAttribute("isPermaLink", "true")); var guid = new XElement("guid", new XAttribute("isPermaLink", "true"));
context.Response.Contextualize(requestContext => { context.Response.Contextualize(requestContext => {
var urlHelper = new UrlHelper(requestContext, _routes); var urlHelper = new UrlHelper(requestContext, _routes);
link.Add(urlHelper.RouteUrl(inspector.Link)); var uriBuilder = new UriBuilder(urlHelper.RequestContext.HttpContext.Request.ToRootUrlString()) { Path = urlHelper.RouteUrl(inspector.Link) };
guid.Add(urlHelper.RouteUrl(inspector.Link)); link.Add(uriBuilder.Uri.OriginalString);
guid.Add(uriBuilder.Uri.OriginalString);
}); });
feedItem.Element.SetElementValue("title", inspector.Title); feedItem.Element.SetElementValue("title", inspector.Title);
feedItem.Element.Add(link); feedItem.Element.Add(link);
feedItem.Element.SetElementValue("description", inspector.Description); feedItem.Element.SetElementValue("description", inspector.Description);
if (inspector.PublishedUtc != null)
feedItem.Element.SetElementValue("pubDate", inspector.PublishedUtc);//TODO: format if ( inspector.PublishedUtc != null ) {
// RFC833
// The "R" or "r" standard format specifier represents a custom date and time format string that is defined by
// the DateTimeFormatInfo.RFC1123Pattern property. The pattern reflects a defined standard, and the property
// is read-only. Therefore, it is always the same, regardless of the culture used or the format provider supplied.
// The custom format string is "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'". When this standard format specifier is used,
// the formatting or parsing operation always uses the invariant culture.
feedItem.Element.SetElementValue("pubDate", inspector.PublishedUtc.Value.ToString("r"));
}
feedItem.Element.Add(guid); feedItem.Element.Add(guid);
} }
else { else {

View File

@@ -140,9 +140,8 @@
<IISUrl> <IISUrl>
</IISUrl> </IISUrl>
<NTLMAuthentication>False</NTLMAuthentication> <NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer> <UseCustomServer>True</UseCustomServer>
<CustomServerUrl> <CustomServerUrl>http://orchard.codeplex.com</CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties> </WebProjectProperties>
</FlavorProperties> </FlavorProperties>

View File

@@ -1,4 +1,9 @@
using System.Data; using System;
using System.Collections.Generic;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration; using Orchard.Data.Migration;
namespace $$FeatureName$$.DataMigrations { namespace $$FeatureName$$.DataMigrations {

View File

@@ -186,7 +186,7 @@ namespace Orchard.Data.Migration.Interpreters {
builder.AppendFormat("alter table {0} alter column {1} ", builder.AppendFormat("alter table {0} alter column {1} ",
_dialect.QuoteForTableName(PrefixTableName(command.TableName)), _dialect.QuoteForTableName(PrefixTableName(command.TableName)),
_dialect.QuoteForColumnName(command.TableName)); _dialect.QuoteForColumnName(command.ColumnName));
// type // type
if (command.DbType != DbType.Object) { if (command.DbType != DbType.Object) {
@@ -195,7 +195,7 @@ namespace Orchard.Data.Migration.Interpreters {
// [default value] // [default value]
if (!string.IsNullOrEmpty(command.Default)) { if (!string.IsNullOrEmpty(command.Default)) {
builder.Append(" default ").Append(command.Default).Append(Space); builder.Append(" set default ").Append(command.Default).Append(Space);
} }
_sqlStatements.Add(builder.ToString()); _sqlStatements.Add(builder.ToString());
} }
@@ -250,7 +250,7 @@ namespace Orchard.Data.Migration.Interpreters {
builder.Append(_dialect.GetAddForeignKeyConstraintString(command.Name, builder.Append(_dialect.GetAddForeignKeyConstraintString(command.Name,
command.SrcColumns, command.SrcColumns,
command.DestTable, _dialect.QuoteForTableName(PrefixTableName(command.DestTable)),
command.DestColumns, command.DestColumns,
false)); false));
@@ -266,7 +266,7 @@ namespace Orchard.Data.Migration.Interpreters {
var builder = new StringBuilder(); var builder = new StringBuilder();
builder.AppendFormat("alter table {0} drop constraint {1}", command.SrcTable, command.Name); builder.AppendFormat("alter table {0} drop constraint {1}", _dialect.QuoteForTableName(PrefixTableName(command.SrcTable)), command.Name);
_sqlStatements.Add(builder.ToString()); _sqlStatements.Add(builder.ToString());
RunPendingStatements(); RunPendingStatements();

View File

@@ -1,7 +1,7 @@
using Orchard.Data.Migration.Schema; using Orchard.Data.Migration.Schema;
namespace Orchard.Data.Migration.Interpreters { namespace Orchard.Data.Migration.Interpreters {
public class SqlCeCommandInterpreter : public class SQLiteCommandInterpreter :
ICommandInterpreter<DropColumnCommand>, ICommandInterpreter<DropColumnCommand>,
ICommandInterpreter<AlterColumnCommand>, ICommandInterpreter<AlterColumnCommand>,
ICommandInterpreter<CreateForeignKeyCommand>, ICommandInterpreter<CreateForeignKeyCommand>,
@@ -34,7 +34,7 @@ namespace Orchard.Data.Migration.Interpreters {
} }
public string DataProvider { public string DataProvider {
get { return "SqlCe"; } get { return "SQLite"; }
} }
} }
} }

View File

@@ -390,7 +390,7 @@
<Compile Include="Data\Migration\Interpreters\ICommandInterpreter.cs" /> <Compile Include="Data\Migration\Interpreters\ICommandInterpreter.cs" />
<Compile Include="Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs" /> <Compile Include="Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs" />
<Compile Include="Data\Migration\Interpreters\IDataMigrationInterpreter.cs" /> <Compile Include="Data\Migration\Interpreters\IDataMigrationInterpreter.cs" />
<Compile Include="Data\Migration\Interpreters\SqlCeCommandInterpreter.cs" /> <Compile Include="Data\Migration\Interpreters\SQLiteCommandInterpreter.cs" />
<Compile Include="Data\Migration\Interpreters\StringCommandInterpreter.cs" /> <Compile Include="Data\Migration\Interpreters\StringCommandInterpreter.cs" />
<Compile Include="Data\Migration\Schema\AddColumnCommand.cs" /> <Compile Include="Data\Migration\Schema\AddColumnCommand.cs" />
<Compile Include="Data\Migration\Schema\ISchemaBuilderCommand.cs" /> <Compile Include="Data\Migration\Schema\ISchemaBuilderCommand.cs" />