mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Basic pieces for recipes infrastructure.
--HG-- branch : recipe
This commit is contained in:
@@ -52,6 +52,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Services\RecipeManager.cs" />
|
||||||
|
<Compile Include="Services\RecipeParser.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
||||||
@@ -59,6 +61,7 @@
|
|||||||
<Name>Orchard.Framework</Name>
|
<Name>Orchard.Framework</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</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" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
|
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Orchard.Localization;
|
||||||
|
using Orchard.Recipes.Models;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Services {
|
||||||
|
public class RecipeManager : IRecipeManager {
|
||||||
|
private readonly IRecipeParser _recipeParser;
|
||||||
|
private readonly IEnumerable<IRecipeHandler> _recipeHandlers;
|
||||||
|
|
||||||
|
public RecipeManager(IRecipeParser recipeParser, IEnumerable<IRecipeHandler> recipeHandlers) {
|
||||||
|
_recipeParser = recipeParser;
|
||||||
|
_recipeHandlers = recipeHandlers;
|
||||||
|
|
||||||
|
T = NullLocalizer.Instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Localizer T { get; set; }
|
||||||
|
|
||||||
|
public void Execute(Recipe recipe) {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Recipe> DiscoverRecipes(string extensionName) {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using Orchard.Localization;
|
||||||
|
using Orchard.Recipes.Models;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Services {
|
||||||
|
public class RecipeParser : IRecipeParser {
|
||||||
|
public RecipeParser() {
|
||||||
|
T = NullLocalizer.Instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Localizer T { get; set; }
|
||||||
|
|
||||||
|
public Recipe ParseRecipe(string recipeText) {
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -191,7 +191,12 @@
|
|||||||
<Compile Include="Mvc\ShapeResult.cs" />
|
<Compile Include="Mvc\ShapeResult.cs" />
|
||||||
<Compile Include="Mvc\Spooling\HtmlStringWriter.cs" />
|
<Compile Include="Mvc\Spooling\HtmlStringWriter.cs" />
|
||||||
<Compile Include="Mvc\ViewEngines\Razor\IRazorCompilationEvents.cs" />
|
<Compile Include="Mvc\ViewEngines\Razor\IRazorCompilationEvents.cs" />
|
||||||
<Compile Include="Recipes\IRecipeManager.cs" />
|
<Compile Include="Recipes\Models\Recipe.cs" />
|
||||||
|
<Compile Include="Recipes\Models\RecipeContext.cs" />
|
||||||
|
<Compile Include="Recipes\Models\RecipeStep.cs" />
|
||||||
|
<Compile Include="Recipes\Services\IRecipeHandler.cs" />
|
||||||
|
<Compile Include="Recipes\Services\IRecipeManager.cs" />
|
||||||
|
<Compile Include="Recipes\Services\IRecipeParser.cs" />
|
||||||
<Compile Include="Security\IEncryptionService.cs" />
|
<Compile Include="Security\IEncryptionService.cs" />
|
||||||
<Compile Include="Security\CurrentUserWorkContext.cs" />
|
<Compile Include="Security\CurrentUserWorkContext.cs" />
|
||||||
<Compile Include="Security\Providers\DefaultEncryptionService.cs" />
|
<Compile Include="Security\Providers\DefaultEncryptionService.cs" />
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
namespace Orchard.Recipes {
|
|
||||||
interface IRecipeManager {
|
|
||||||
}
|
|
||||||
}
|
|
9
src/Orchard/Recipes/Models/Recipe.cs
Normal file
9
src/Orchard/Recipes/Models/Recipe.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Models {
|
||||||
|
public class Recipe {
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public IEnumerable<RecipeStep> RecipeSteps { get; set; }
|
||||||
|
}
|
||||||
|
}
|
7
src/Orchard/Recipes/Models/RecipeContext.cs
Normal file
7
src/Orchard/Recipes/Models/RecipeContext.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Orchard.Recipes.Models {
|
||||||
|
public class RecipeContext {
|
||||||
|
public Recipe Recipe { get; set; }
|
||||||
|
public RecipeStep RecipeStep { get; set; }
|
||||||
|
public bool Executed { get; set; }
|
||||||
|
}
|
||||||
|
}
|
8
src/Orchard/Recipes/Models/RecipeStep.cs
Normal file
8
src/Orchard/Recipes/Models/RecipeStep.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Models {
|
||||||
|
public class RecipeStep {
|
||||||
|
public string Name { get; set; }
|
||||||
|
public XElement Step { get; set; }
|
||||||
|
}
|
||||||
|
}
|
7
src/Orchard/Recipes/Services/IRecipeHandler.cs
Normal file
7
src/Orchard/Recipes/Services/IRecipeHandler.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
using Orchard.Recipes.Models;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Services {
|
||||||
|
public interface IRecipeHandler : IDependency {
|
||||||
|
void ExecuteRecipeStep(RecipeContext recipeContext);
|
||||||
|
}
|
||||||
|
}
|
9
src/Orchard/Recipes/Services/IRecipeManager.cs
Normal file
9
src/Orchard/Recipes/Services/IRecipeManager.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Orchard.Recipes.Models;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Services {
|
||||||
|
public interface IRecipeManager : IDependency {
|
||||||
|
void Execute(Recipe recipe);
|
||||||
|
IEnumerable<Recipe> DiscoverRecipes(string extensionName);
|
||||||
|
}
|
||||||
|
}
|
7
src/Orchard/Recipes/Services/IRecipeParser.cs
Normal file
7
src/Orchard/Recipes/Services/IRecipeParser.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
using Orchard.Recipes.Models;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Services {
|
||||||
|
public interface IRecipeParser : IDependency {
|
||||||
|
Recipe ParseRecipe(string recipeText);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user