Providing some default descriptions for out-of-the-box content parts.

--HG--
branch : 1.x
extra : rebase_source : a8e36387800f484de3d5aca800b25a9f89f4982b
This commit is contained in:
Sipke Schoorstra
2013-03-11 12:35:12 +01:00
parent 356f62e032
commit 8416503df6
11 changed files with 176 additions and 24 deletions

View File

@@ -31,10 +31,25 @@ namespace Orchard.Core.Common {
.Column<DateTime>("ModifiedUtc")
);
ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder.Attachable());
SchemaBuilder.CreateTable("IdentityPartRecord",
table => table
.ContentPartRecord()
.Column<string>("Identifier", column => column.Unlimited())
);
return 1;
ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder
.Attachable()
.WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown)."));
ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder
.Attachable()
.WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified."));
ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder
.Attachable()
.WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another."));
return 3;
}
public int UpdateFrom1() {
@@ -47,5 +62,18 @@ namespace Orchard.Core.Common {
return 2;
}
public int UpdateFrom2() {
ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder
.WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown)."));
ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder
.WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified."));
ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder
.WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another."));
return 3;
}
}
}

View File

@@ -46,11 +46,19 @@ namespace Orchard.Core.Containers {
.WithPart("ContainerWidgetPart")
.WithSetting("Stereotype", "Widget"));
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder
.Attachable()
.WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached."));
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder
.Attachable()
.WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached"));
ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", builder => builder
.Attachable()
.WithDescription("Adds 3 custom properties to your content item."));
return 3;
return 4;
}
public int UpdateFrom1() {
@@ -69,5 +77,17 @@ namespace Orchard.Core.Containers {
return 3;
}
public int UpdateFrom3() {
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder
.WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached."));
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder
.WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached"));
ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", builder => builder
.WithDescription("Adds 3 custom properties to your content item."));
return 4;
}
}
}

View File

@@ -15,7 +15,7 @@ namespace Orchard.Core.Contents.Extensions {
return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString());
}
public static ContentPartDefinitionBuilder Description(this ContentPartDefinitionBuilder builder, string description) {
public static ContentPartDefinitionBuilder WithDescription(this ContentPartDefinitionBuilder builder, string description) {
return builder.WithSetting("ContentPartSettings.Description", description);
}
}

View File

@@ -6,8 +6,13 @@ namespace Orchard.Core.Navigation {
public class Migrations : DataMigrationImpl {
public int Create() {
ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder
.Attachable()
.WithDescription("Provides an easy way to create a ContentMenuItem from the content editor."));
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder
.Attachable()
.WithDescription("Allows the management of Content Menu Items associated with a Content Item."));
ContentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg.WithPart("NavigationPart"));
SchemaBuilder.CreateTable("MenuItemPartRecord",
@@ -75,7 +80,9 @@ namespace Orchard.Core.Navigation {
.WithSetting("Stereotype", "MenuItem")
);
ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder
.Attachable()
.WithDescription("Adds a menu item to the Admin menu that links to this content item."));
SchemaBuilder.CreateTable("ContentMenuItemPartRecord",
table => table
@@ -211,5 +218,19 @@ namespace Orchard.Core.Navigation {
return 4;
}
public int UpdateFrom4() {
ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder
.WithDescription("Provides an easy way to create a ContentMenuItem from the content editor."));
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder
.WithDescription("Allows the management of Content Menu Items associated with a Content Item."));
ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder
.Attachable()
.WithDescription("Adds a menu item to the Admin menu that links to this content item."));
return 5;
}
}
}

View File

@@ -12,9 +12,17 @@ namespace Orchard.Core.Title {
.Column<string>("Title", column => column.WithLength(1024))
);
ContentDefinitionManager.AlterPartDefinition("TitlePart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("TitlePart", builder => builder
.Attachable()
.WithDescription("Provides a Title for your content item."));
return 1;
return 2;
}
public int UpdateFrom1() {
ContentDefinitionManager.AlterPartDefinition("TitlePart", builder => builder
.WithDescription("Provides a Title for your content item."));
return 2;
}
}
}