Added the codegeneration module.

--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-09-29 15:56:18 -07:00
parent 420baa7289
commit d0d60f2c1f
16 changed files with 839 additions and 17 deletions

View File

@@ -228,10 +228,6 @@
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.DevTools\Orchard.DevTools.csproj">
<Project>{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}</Project>
<Name>Orchard.DevTools</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Roles\Orchard.Roles.csproj">
<Project>{D10AD48F-407D-4DB5-A328-173EC7CB010F}</Project>
<Name>Orchard.Roles</Name>

View File

@@ -106,6 +106,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CodeGeneration\Commands\CodeGenerationCommandsTests.cs" />
<Compile Include="DatabaseEnabledTestsBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Roles\Controllers\AdminControllerTests.cs" />
@@ -127,6 +128,10 @@
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.CodeGeneration\Orchard.CodeGeneration.csproj">
<Project>{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}</Project>
<Name>Orchard.CodeGeneration</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Roles\Orchard.Roles.csproj">
<Project>{D10AD48F-407D-4DB5-A328-173EC7CB010F}</Project>
<Name>Orchard.Roles</Name>

View File

@@ -0,0 +1,16 @@
using System.Web.Mvc;
using Orchard.Localization;
using Orchard;
namespace $$ModuleName$$.Controllers {
public class $$ControllerName$$ : Controller {
public IOrchardServices Services { get; set; }
public $$ControllerName$$(IOrchardServices services) {
Services = services;
T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
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;
namespace $$FeatureName$$.DataMigrations {
public class $$ClassName$$DataMigration : DataMigrationImpl {
public int Create() {
$$Commands$$
return 1;
}
}
}

View File

@@ -0,0 +1,34 @@
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("$$ModuleName$$")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")]
[assembly: AssemblyCopyright("")]
[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("$$ModuleTypeLibGuid$$")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" 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>{$$ModuleProjectGuid$$}</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>$$ModuleName$$</RootNamespace>
<AssemblyName>$$ModuleName$$</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.ComponentModel.DataAnnotations">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web.Mobile" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Module.txt" />
<Content Include="Web.config" />
<Content Include="Views\Web.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
<Folder Include="Models\" />
<Folder Include="Scripts\" />
<Folder Include="Content\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
<Name>Orchard.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
<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>45979</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>True</UseCustomServer>
<CustomServerUrl>http://orchard.codeplex.com</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -0,0 +1,10 @@
name: $$ModuleName$$
antiforgery: enabled
author: The Orchard Team
website: http://orchardproject.net
version: 0.5.0
orchardversion: 0.5.0
description: Description for the module
features:
$$ModuleName$$:
Description: Description for feature $$ModuleName$$.

View File

@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<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"/>
<add namespace="Orchard.Mvc.Html"/>
</namespaces>
</pages>
</system.web>
<system.web.extensions/>
</configuration>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</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>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers>
</system.webServer>
</configuration>

View File

@@ -0,0 +1,228 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web.Hosting;
using Orchard.Commands;
using Orchard.Data.Migration.Generator;
using Orchard.CodeGeneration.Services;
using Orchard.Data.Migration.Schema;
using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
namespace Orchard.CodeGeneration.Commands {
[OrchardFeature("Generate")]
public class CodeGenerationCommands : DefaultOrchardCommandHandler {
private readonly IExtensionManager _extensionManager;
private readonly ISchemaCommandGenerator _schemaCommandGenerator;
private const string ModuleName = "CodeGeneration";
public CodeGenerationCommands(
IExtensionManager extensionManager,
ISchemaCommandGenerator schemaCommandGenerator) {
_extensionManager = extensionManager;
_schemaCommandGenerator = schemaCommandGenerator;
}
[OrchardSwitch]
public bool IncludeInSolution { get; set; }
[CommandHelp("generate create datamigration <feature-name> \r\n\t" + "Create a new Data Migration class")]
[CommandName("generate create datamigration")]
public void CreateDataMigration(string featureName) {
Context.Output.WriteLine(T("Creating Data Migration for {0}", featureName));
ExtensionDescriptor extensionDescriptor = _extensionManager.AvailableExtensions().FirstOrDefault(extension => extension.ExtensionType == "Module" &&
extension.Features.Any(feature => String.Equals(feature.Name, featureName, StringComparison.OrdinalIgnoreCase)));
if (extensionDescriptor == null) {
Context.Output.WriteLine(T("Creating data migration failed: target Feature {0} could not be found.", featureName));
return;
}
string dataMigrationsPath = HostingEnvironment.MapPath("~/Modules/" + extensionDescriptor.Name + "/DataMigrations/");
string dataMigrationPath = dataMigrationsPath + extensionDescriptor.DisplayName + "DataMigration.cs";
string templatesPath = HostingEnvironment.MapPath("~/Modules/Orchard." + ModuleName + "/CodeGenerationTemplates/");
string moduleCsProjPath = HostingEnvironment.MapPath(string.Format("~/Modules/{0}/{0}.csproj", extensionDescriptor.Name));
if (!Directory.Exists(dataMigrationsPath)) {
Directory.CreateDirectory(dataMigrationsPath);
}
if (File.Exists(dataMigrationPath)) {
Context.Output.WriteLine(T("Data migration already exists in target Module {0}.", extensionDescriptor.Name));
return;
}
List<SchemaCommand> commands = _schemaCommandGenerator.GetCreateFeatureCommands(featureName, false).ToList();
var stringWriter = new StringWriter();
var interpreter = new CodeGenerationCommandInterpreter(stringWriter);
foreach (var command in commands) {
interpreter.Visit(command);
stringWriter.WriteLine();
}
string dataMigrationText = File.ReadAllText(templatesPath + "DataMigration.txt");
dataMigrationText = dataMigrationText.Replace("$$FeatureName$$", featureName);
dataMigrationText = dataMigrationText.Replace("$$ClassName$$", extensionDescriptor.DisplayName);
dataMigrationText = dataMigrationText.Replace("$$Commands$$", stringWriter.ToString());
File.WriteAllText(dataMigrationPath, dataMigrationText);
string projectFileText = File.ReadAllText(moduleCsProjPath);
// The string searches in solution/project files can be made aware of comment lines.
if ( projectFileText.Contains("<Compile Include") ) {
string compileReference = string.Format("<Compile Include=\"{0}\" />\r\n ", "DataMigrations\\" + extensionDescriptor.DisplayName + "DataMigration.cs");
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("<Compile Include"), compileReference);
}
else {
string itemGroupReference = string.Format("</ItemGroup>\r\n <ItemGroup>\r\n <Compile Include=\"{0}\" />\r\n ", "DataMigrations\\" + extensionDescriptor.DisplayName + "DataMigration.cs");
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("</ItemGroup>"), itemGroupReference);
}
File.WriteAllText(moduleCsProjPath, projectFileText);
TouchSolution();
Context.Output.WriteLine(T("Data migration created successfully in Module {0}", extensionDescriptor.Name));
}
[CommandHelp("generate create module <module-name> [/IncludeInSolution:true|false]\r\n\t" + "Create a new Orchard module")]
[CommandName("generate create module")]
[OrchardSwitches("IncludeInSolution")]
public void CreateModule(string moduleName) {
Context.Output.WriteLine(T("Creating Module {0}", moduleName));
if ( _extensionManager.AvailableExtensions().Any(extension => extension.ExtensionType == "Module" && String.Equals(moduleName, extension.DisplayName, StringComparison.OrdinalIgnoreCase)) ) {
Context.Output.WriteLine(T("Creating Module {0} failed: a module of the same name already exists", moduleName));
return;
}
IntegrateModule(moduleName);
Context.Output.WriteLine(T("Module {0} created successfully", moduleName));
}
[CommandHelp("generate create controller <module-name> <controller-name>\r\n\t" + "Create a new Orchard controller in a module")]
[CommandName("generate create controller")]
public void CreateController(string moduleName, string controllerName) {
Context.Output.WriteLine(T("Creating Controller {0} in Module {1}", controllerName, moduleName));
ExtensionDescriptor extensionDescriptor = _extensionManager.AvailableExtensions().FirstOrDefault(extension => extension.ExtensionType == "Module" &&
string.Equals(moduleName, extension.DisplayName, StringComparison.OrdinalIgnoreCase));
if (extensionDescriptor == null) {
Context.Output.WriteLine(T("Creating Controller {0} failed: target Module {1} could not be found.", controllerName, moduleName));
return;
}
string moduleControllersPath = HostingEnvironment.MapPath("~/Modules/" + extensionDescriptor.Name + "/Controllers/");
string controllerPath = moduleControllersPath + controllerName + ".cs";
string moduleCsProjPath = HostingEnvironment.MapPath(string.Format("~/Modules/{0}/{0}.csproj", extensionDescriptor.Name));
string templatesPath = HostingEnvironment.MapPath("~/Modules/Orchard." + ModuleName + "/CodeGenerationTemplates/");
if (!Directory.Exists(moduleControllersPath)) {
Directory.CreateDirectory(moduleControllersPath);
}
if (File.Exists(controllerPath)) {
Context.Output.WriteLine(T("Controller {0} already exists in target Module {1}.", controllerName, moduleName));
return;
}
string controllerText = File.ReadAllText(templatesPath + "Controller.txt");
controllerText = controllerText.Replace("$$ModuleName$$", moduleName);
controllerText = controllerText.Replace("$$ControllerName$$", controllerName);
File.WriteAllText(controllerPath, controllerText);
string projectFileText = File.ReadAllText(moduleCsProjPath);
// The string searches in solution/project files can be made aware of comment lines.
if (projectFileText.Contains("<Compile Include")) {
string compileReference = string.Format("<Compile Include=\"{0}\" />\r\n ", "Controllers\\" + controllerName + ".cs");
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("<Compile Include"), compileReference);
}
else {
string itemGroupReference = string.Format("</ItemGroup>\r\n <ItemGroup>\r\n <Compile Include=\"{0}\" />\r\n ", "Controllers\\" + controllerName + ".cs");
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("</ItemGroup>"), itemGroupReference);
}
File.WriteAllText(moduleCsProjPath, projectFileText);
Context.Output.WriteLine(T("Controller {0} created successfully in Module {1}", controllerName, moduleName));
TouchSolution();
}
private void IntegrateModule(string moduleName) {
string rootWebProjectPath = HostingEnvironment.MapPath("~/Orchard.Web.csproj");
string projectGuid = Guid.NewGuid().ToString().ToUpper();
CreateFilesFromTemplates(moduleName, projectGuid);
// The string searches in solution/project files can be made aware of comment lines.
if (IncludeInSolution) {
// Add project to Orchard.sln
string solutionPath = Directory.GetParent(rootWebProjectPath).Parent.FullName + "\\Orchard.sln";
if (File.Exists(solutionPath)) {
string projectReference = string.Format(
"EndProject\r\nProject(\"{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}\") = \"{0}\", \"Orchard.Web\\Modules\\{0}\\{0}.csproj\", \"{{{1}}}\"\r\n",
moduleName, projectGuid);
string projectConfiguationPlatforms = string.Format(
"GlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{{{0}}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{{{0}}}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{{{0}}}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{{{0}}}.Release|Any CPU.Build.0 = Release|Any CPU\r\n",
projectGuid);
string solutionText = File.ReadAllText(solutionPath);
solutionText = solutionText.Insert(solutionText.LastIndexOf("EndProject\r\n"), projectReference);
solutionText = solutionText.Replace("GlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n", projectConfiguationPlatforms);
solutionText = solutionText.Insert(solutionText.LastIndexOf("EndGlobalSection"), "\t{" + projectGuid + "} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}\r\n\t");
File.WriteAllText(solutionPath, solutionText);
TouchSolution();
}
else {
Context.Output.WriteLine(T("Warning: Solution file could not be found at {0}", solutionPath));
}
}
}
private static void CreateFilesFromTemplates(string moduleName, string projectGuid) {
string modulePath = HostingEnvironment.MapPath("~/Modules/" + moduleName + "/");
string propertiesPath = modulePath + "Properties";
string templatesPath = HostingEnvironment.MapPath("~/Modules/Orchard." + ModuleName + "/CodeGenerationTemplates/");
Directory.CreateDirectory(modulePath);
Directory.CreateDirectory(propertiesPath);
Directory.CreateDirectory(modulePath + "Controllers");
Directory.CreateDirectory(modulePath + "Views");
File.WriteAllText(modulePath + "\\Views\\Web.config", File.ReadAllText(templatesPath + "ViewsWebConfig.txt"));
Directory.CreateDirectory(modulePath + "Models");
Directory.CreateDirectory(modulePath + "Scripts");
string templateText = File.ReadAllText(templatesPath + "ModuleAssemblyInfo.txt");
templateText = templateText.Replace("$$ModuleName$$", moduleName);
templateText = templateText.Replace("$$ModuleTypeLibGuid$$", Guid.NewGuid().ToString());
File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText);
File.WriteAllText(modulePath + "\\Web.config", File.ReadAllText(templatesPath + "ModuleWebConfig.txt"));
templateText = File.ReadAllText(templatesPath + "ModuleManifest.txt");
templateText = templateText.Replace("$$ModuleName$$", moduleName);
File.WriteAllText(modulePath + "\\Module.txt", templateText);
templateText = File.ReadAllText(templatesPath + "\\ModuleCsProj.txt");
templateText = templateText.Replace("$$ModuleName$$", moduleName);
templateText = templateText.Replace("$$ModuleProjectGuid$$", projectGuid);
File.WriteAllText(modulePath + "\\" + moduleName + ".csproj", templateText);
}
private void TouchSolution() {
string rootWebProjectPath = HostingEnvironment.MapPath("~/Orchard.Web.csproj");
string solutionPath = Directory.GetParent(rootWebProjectPath).Parent.FullName + "\\Orchard.sln";
if (!File.Exists(solutionPath)) {
Context.Output.WriteLine(T("Warning: Solution file could not be found at {0}", solutionPath));
return;
}
try {
File.SetLastWriteTime(solutionPath, DateTime.Now);
}
catch {
Context.Output.WriteLine(T("An unexpected error occured while trying to refresh the Visual Studio solution. Please reload it."));
}
}
}
}

View File

@@ -0,0 +1,11 @@
Name: Code generation module
antiforgery: enabled
author: The Orchard Team
website: http://orchardproject.net
version: 0.1.0
orchardversion: 0.6.0
description:
features:
Generate:
Description: Tools to create Orchard components.
Category: Developer

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}</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.CodeGeneration</RootNamespace>
<AssemblyName>Orchard.CodeGeneration</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</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\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="HibernatingRhinos.Profiler.Appender">
<HintPath>..\..\..\..\lib\nhprof\HibernatingRhinos.Profiler.Appender.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<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.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\CodeGenerationCommands.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\CodeGenerationCommandInterpreter.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Module.txt" />
<Content Include="CodeGenerationTemplates\Controller.txt" />
<Content Include="CodeGenerationTemplates\DataMigration.txt" />
<Content Include="CodeGenerationTemplates\ModuleAssemblyInfo.txt" />
<Content Include="CodeGenerationTemplates\ModuleCsProj.txt" />
<Content Include="CodeGenerationTemplates\ModuleManifest.txt" />
<Content Include="CodeGenerationTemplates\ModuleWebConfig.txt" />
<Content Include="CodeGenerationTemplates\ViewsWebConfig.txt" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
<Name>Orchard.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>53274</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -0,0 +1,33 @@
using System.Reflection;
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.CodeGeneration")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")]
[assembly: AssemblyCopyright("Copyright © CodePlex Foundation 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("a5ae5869-1454-4fe8-a998-a3f2e79c91a3")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.5.0")]
[assembly: AssemblyFileVersion("0.5.0")]

View File

@@ -0,0 +1,111 @@
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using Orchard.Data.Migration.Interpreters;
using Orchard.Data.Migration.Schema;
namespace Orchard.CodeGeneration.Services {
public class CodeGenerationCommandInterpreter : AbstractDataMigrationInterpreter {
private readonly TextWriter _output;
public CodeGenerationCommandInterpreter(TextWriter output) {
_output = output;
}
public override void Visit(CreateTableCommand command) {
_output.WriteLine("\t\t\t// Creating table {0}", command.Name);
_output.WriteLine("\t\t\tSchemaBuilder.CreateTable(\"{0}\", table => table", command.Name);
var matchContentPartRecord = command.TableCommands.OfType<CreateColumnCommand>().Any(
c =>
c.IsPrimaryKey
&& c.ColumnName == "Id"
&& !c.IsIdentity
&& c.DbType == DbType.Int32);
var matchContentPartVersionRecord = matchContentPartRecord && command.TableCommands.OfType<CreateColumnCommand>().Any(
c =>
c.ColumnName == "ContentItemRecord_id"
&& c.DbType == DbType.Int32);
if ( matchContentPartVersionRecord ) {
_output.WriteLine("\t\t\t\t.ContentPartVersionRecord()");
}
else if ( matchContentPartRecord ) {
_output.WriteLine("\t\t\t\t.ContentPartRecord()");
}
foreach ( var createColumn in command.TableCommands.OfType<CreateColumnCommand>() ) {
if(createColumn.ColumnName == "Id" && matchContentPartRecord) {
continue;
}
if(createColumn.ColumnName == "ContentItemRecord_id" && matchContentPartVersionRecord) {
continue;
}
var type = createColumn.DbType.ToString();
var field = createColumn.ColumnName;
var options = new List<string>();
if ( createColumn.IsPrimaryKey ) {
options.Add("PrimaryKey()");
}
if ( createColumn.IsIdentity ) {
options.Add("Identity()");
}
if ( createColumn.IsUnique ) {
options.Add("Unique()");
}
if ( createColumn.IsNotNull ) {
options.Add("NotNull()");
}
if ( createColumn.Length.HasValue ) {
if ( createColumn.Length == 10000 ) {
options.Add("Unlimited()");
}
else {
options.Add(string.Format("WithLength({0})", createColumn.Length));
}
}
if ( createColumn.Precision > 0 ) {
options.Add(string.Format("WithPrecision({0})", createColumn.Precision));
options.Add(string.Format("WithScale({0})", createColumn.Scale));
}
_output.WriteLine("\t\t\t\t.Column(\"{0}\", DbType.{1}{2})", field, type, options.Any() ? ", column => column." + string.Join(".", options) : string.Empty);
}
_output.WriteLine("\t\t\t);");
}
public override void Visit(AlterTableCommand command) {
_output.WriteLine("// Altering table {0}", command.Name);
}
public override void Visit(DropTableCommand command) {
_output.WriteLine("// Dropping table {0}", command.Name);
_output.WriteLine("\t\t\tSchemaBuilder.DropTable(\"{0}\", command.Name);");
}
public override void Visit(SqlStatementCommand command) {
_output.WriteLine("// Executing sql statement\n\n {0}", command.Sql);
}
public override void Visit(CreateForeignKeyCommand command) {
_output.WriteLine("// Creating foreign key {0}", command.Name);
}
public override void Visit(DropForeignKeyCommand command) {
_output.WriteLine("// Dropping foreign key {0}", command.Name);
}
}
}

View File

@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<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"/>
<add namespace="Orchard.Mvc.Html"/>
</namespaces>
</pages>
</system.web>
<system.web.extensions/>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -27,8 +27,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core", "Orchard.Web
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core.Tests", "Orchard.Core.Tests\Orchard.Core.Tests.csproj", "{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.DevTools", "Orchard.Web\Modules\Orchard.DevTools\Orchard.DevTools.csproj", "{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Setup", "Orchard.Web\Modules\Orchard.Setup\Orchard.Setup.csproj", "{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSBuild.Orchard.Tasks", "Tools\MSBuild.Orchard.Tasks\MSBuild.Orchard.Tasks.csproj", "{5E5E7A21-C7B2-44D8-8593-2F9541AE041D}"
@@ -84,6 +82,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Futures.Widgets", "Orchard.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene", "Orchard.Web\Modules\Lucene\Lucene.csproj", "{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Experimental", "Orchard.Web\Modules\Orchard.Experimental\Orchard.Experimental.csproj", "{AB3C207C-0126-4143-8D62-1119DF80D366}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.CodeGeneration", "Orchard.Web\Modules\Orchard.CodeGeneration\Orchard.CodeGeneration.csproj", "{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CodeCoverage|Any CPU = CodeCoverage|Any CPU
@@ -183,16 +185,6 @@ Global
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63}.FxCop|Any CPU.Build.0 = Release|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
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.Coverage|Any CPU.Build.0 = Release|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.Debug|Any CPU.Build.0 = Debug|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.FxCop|Any CPU.Build.0 = Release|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.Release|Any CPU.ActiveCfg = Release|Any CPU
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}.Release|Any CPU.Build.0 = Release|Any CPU
{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
@@ -443,6 +435,26 @@ Global
{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.FxCop|Any CPU.Build.0 = Release|Any CPU
{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Release|Any CPU.Build.0 = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.Coverage|Any CPU.Build.0 = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.FxCop|Any CPU.Build.0 = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB3C207C-0126-4143-8D62-1119DF80D366}.Release|Any CPU.Build.0 = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Coverage|Any CPU.Build.0 = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.FxCop|Any CPU.Build.0 = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -450,7 +462,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{79AED36E-ABD0-4747-93D3-8722B042454B} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{D10AD48F-407D-4DB5-A328-173EC7CB010F} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{CDE24A24-01D3-403C-84B9-37722E18DFB7} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{17F86780-9A1F-4AA1-86F1-875EEC2730C7} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
@@ -468,6 +479,8 @@ Global
{EA2B9121-EF54-40A6-A53E-6593C86EE696} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{4BE4EB01-AC56-4048-924E-2CA77F509ABA} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{AB3C207C-0126-4143-8D62-1119DF80D366} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}