diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f66694..2d34da2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,8 @@ jobs: runs-on: windows-latest env: buildConfiguration: release - versionSuffix: ci-${{ github.RUN_NUMBER }} + versionSuffix: ${{ github.ref == 'refs/heads/develop' && 'pre-' || 'ci-' }}${{github.RUN_NUMBER }} + DOTNET_NOLOGO: 1 steps: - uses: actions/checkout@v2 - name: Restore @@ -34,11 +35,27 @@ jobs: name: Publish needs: build_test_pack runs-on: windows-latest + env: + nugetSource: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json + DOTNET_NOLOGO: 1 steps: - name: Download artifacts uses: actions/download-artifact@v2 with: name: packages - - name: Publish packages - # run: dotnet nuget push *.nupkg --source 'nuget.example.com' - run: echo 'Packages are not published at the moment, they can however be downloaded from the artifacts' + - name: Publish to Github Packages + run: dotnet nuget push *.nupkg --source $env:nugetSource --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} + + cleanup: + name: Cleanup + needs: build_test_pack + runs-on: ubuntu-latest + steps: + - name: Cleanup old Packages + uses: actions/delete-package-versions@v3 + with: + package-name: 'EPiServer.Templates' + min-versions-to-keep: 10 + # 1-in-1-out + num-old-versions-to-delete: 1 + delete-only-pre-release-versions: "true" diff --git a/README.md b/README.md index 6116b64..8c8fa95 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,59 @@ -# Optimizely Templates +# Optimizely Templates for .NET [![Continuous integration](https://github.com/episerver/content-templates/actions/workflows/ci.yml/badge.svg)](https://github.com/episerver/content-templates/actions/workflows/ci.yml) -## Available templates -- epi-alloy-mvc -- epi-cms-empty -- epi-commerce-empty +This repository contains templates for Optimizely Digital Experience Cloud to be used with `dotnet new` and Visual Studio 2022. + +The templates in this repository are distributed as a NuGet package available from [NuGet.org](https://www.nuget.org/packages/EPiServer.Templates/) and can be installed using the `dotnet new` command. + +```bash +$ dotnet new -i EPiServer.Templates +``` + +Once installed, these templates will also be available in Visual Studio 2022. +Note that Visual Studio currently only supports *Project Templates* and not *Item Templates*. + +To generate code based on the template simply execute the following. -## Installation ```bash -$ dotnet new -i EPiServer.Templates --force +$ dotnet new epi-alloy-mvc ``` -It's also possible to download the source code or clone this repository and then run each template as a regular project. -## Update +Replace `epi-alloy-mvc` with the name of the template you want to use. + +See below for a list of available templates and details on each individual template. For direct access to documentation on each template, execute: + ```bash -$ dotnet new --update-apply +$ dotnet new epi-alloy-mvc --help ``` + +For further documentation on how to work with `dotnet new` see https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new. + +## Available templates + +The following templates are included in this repository and available through the `EPiServer.Templates` package. + +### Project Templates + +- epi-alloy-mvc +- epi-cms-empty +- epi-commerce-empty + + +### Item Templates + +- epi-cms-contentcomponent +- epi-cms-contenttype +- epi-cms-initializationmodule +- epi-cms-job +- epi-cms-pagecontroller +- epi-cms-razorpage + +## Contributing + +We would love community contributions here. The easiest way to contribute is to join in with the discussions on Github issues or create new issues with questions, suggestions or any other feedback. +If you want to contribute code or documentation, you are more than welcome to create pull-requests, but make sure that you read the [contribution page](CONTRIBUTING.md) first. + +## License + +This project is licensed with the [Apache license](LICENSE.md) diff --git a/build/version.props b/build/version.props index df04de0..fa0d67a 100644 --- a/build/version.props +++ b/build/version.props @@ -1,7 +1,7 @@ - 1.0.0 + 1.1.0 devbuild diff --git a/content-templates.sln b/content-templates.sln index 1c29c08..a31f23a 100644 --- a/content-templates.sln +++ b/content-templates.sln @@ -1,17 +1,17 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30114.105 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32210.238 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EPiServer.Templates", "templates\EPiServer.Templates.csproj", "{8B343E37-F699-461C-8755-8D371CC82EAC}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{350B8822-08B0-47CE-9295-9D379C42A718}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Alloy.Mvc", "templates\Alloy.Mvc\Alloy.Mvc.csproj", "{D26A321A-ED45-42C4-9792-1C64A969C70B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Alloy.Mvc", "templates\Alloy.Mvc\Alloy.1.csproj", "{D26A321A-ED45-42C4-9792-1C64A969C70B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cms.Empty", "templates\Cms.Empty\Cms.Empty.csproj", "{A64C6372-EC36-4F19-B2AD-8A2185AAC015}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cms.Empty", "templates\Cms.Empty\Cms.1.csproj", "{A64C6372-EC36-4F19-B2AD-8A2185AAC015}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commerce.Empty", "templates\Commerce.Empty\Commerce.Empty.csproj", "{9B5A3754-D23E-4032-A09D-5568F935F34F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commerce.Empty", "templates\Commerce.Empty\Commerce.1.csproj", "{9B5A3754-D23E-4032-A09D-5568F935F34F}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8F2A1A07-7B50-4060-89B0-B53021C3F593}" ProjectSection(SolutionItems) = preProject @@ -36,6 +36,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ .github\workflows\release.yml = .github\workflows\release.yml EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cms.Item", "templates\Cms.Item\Cms.Item.csproj", "{08ACA24C-AC25-4391-BDBA-D309EED6C80E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -94,15 +96,28 @@ Global {9B5A3754-D23E-4032-A09D-5568F935F34F}.Release|x64.Build.0 = Release|Any CPU {9B5A3754-D23E-4032-A09D-5568F935F34F}.Release|x86.ActiveCfg = Release|Any CPU {9B5A3754-D23E-4032-A09D-5568F935F34F}.Release|x86.Build.0 = Release|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x64.ActiveCfg = Debug|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x64.Build.0 = Debug|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x86.ActiveCfg = Debug|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x86.Build.0 = Debug|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|Any CPU.Build.0 = Release|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x64.ActiveCfg = Release|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x64.Build.0 = Release|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x86.ActiveCfg = Release|Any CPU + {08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {D26A321A-ED45-42C4-9792-1C64A969C70B} = {350B8822-08B0-47CE-9295-9D379C42A718} - {0FC00D98-1708-47C9-A126-B4AC4C4C5260} = {8F2A1A07-7B50-4060-89B0-B53021C3F593} {A64C6372-EC36-4F19-B2AD-8A2185AAC015} = {350B8822-08B0-47CE-9295-9D379C42A718} {9B5A3754-D23E-4032-A09D-5568F935F34F} = {350B8822-08B0-47CE-9295-9D379C42A718} + {0FC00D98-1708-47C9-A126-B4AC4C4C5260} = {8F2A1A07-7B50-4060-89B0-B53021C3F593} + {08ACA24C-AC25-4391-BDBA-D309EED6C80E} = {350B8822-08B0-47CE-9295-9D379C42A718} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6F4B71A0-BE63-44F5-856C-3831FB1C0943} diff --git a/nuget.config b/nuget.config index 287e902..79187e1 100644 --- a/nuget.config +++ b/nuget.config @@ -3,6 +3,6 @@ - + diff --git a/templates/Alloy.Mvc/.template.config/dotnetcli.host.json b/templates/Alloy.Mvc/.template.config/dotnetcli.host.json index 4718119..a53ef73 100644 --- a/templates/Alloy.Mvc/.template.config/dotnetcli.host.json +++ b/templates/Alloy.Mvc/.template.config/dotnetcli.host.json @@ -1,6 +1,6 @@ { "symbolInfo": { - "enablelDocker": { + "enableDocker": { "longName": "enable-docker", "shortName": "" }, diff --git a/templates/Alloy.Mvc/.template.config/template.json b/templates/Alloy.Mvc/.template.config/template.json index 79a1bfa..d6a2aa4 100644 --- a/templates/Alloy.Mvc/.template.config/template.json +++ b/templates/Alloy.Mvc/.template.config/template.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/template", "author": "Episerver AB", - "sourceName": "Alloy.Mvc", + "sourceName": "Alloy.1", "classifications": [ "Web" ], "identity": "EPiServer.Templates.Alloy.Mvc", "name": "Optimizely Alloy MVC", @@ -15,7 +15,7 @@ { "modifiers": [ { - "condition": "(!enablelDocker)", + "condition": "(!enableDocker)", "exclude": [ "Directory.Build.props", "docker-compose.yml", @@ -26,7 +26,7 @@ } ], "symbols": { - "enablelDocker": { + "enableDocker": { "type": "parameter", "datatype": "bool", "defaultValue": "false", diff --git a/templates/Alloy.Mvc/Alloy.Mvc.csproj b/templates/Alloy.Mvc/Alloy.1.csproj similarity index 85% rename from templates/Alloy.Mvc/Alloy.Mvc.csproj rename to templates/Alloy.Mvc/Alloy.1.csproj index e2f943b..1b9489a 100644 --- a/templates/Alloy.Mvc/Alloy.Mvc.csproj +++ b/templates/Alloy.Mvc/Alloy.1.csproj @@ -5,7 +5,7 @@ - + diff --git a/templates/Alloy.Mvc/App_Data/Alloy.Mvc.mdf b/templates/Alloy.Mvc/App_Data/Alloy.1.mdf similarity index 100% rename from templates/Alloy.Mvc/App_Data/Alloy.Mvc.mdf rename to templates/Alloy.Mvc/App_Data/Alloy.1.mdf diff --git a/templates/Alloy.Mvc/App_Data/DefaultSiteContent.episerverdata b/templates/Alloy.Mvc/App_Data/DefaultSiteContent.episerverdata index e3becd1..14c68cb 100644 Binary files a/templates/Alloy.Mvc/App_Data/DefaultSiteContent.episerverdata and b/templates/Alloy.Mvc/App_Data/DefaultSiteContent.episerverdata differ diff --git a/templates/Alloy.Mvc/Business/Channels/DisplayResolutionBase.cs b/templates/Alloy.Mvc/Business/Channels/DisplayResolutionBase.cs index 9bf2d10..0af3107 100644 --- a/templates/Alloy.Mvc/Business/Channels/DisplayResolutionBase.cs +++ b/templates/Alloy.Mvc/Business/Channels/DisplayResolutionBase.cs @@ -1,7 +1,7 @@ using EPiServer.Framework.Localization; using EPiServer.Web; -namespace Alloy.Mvc.Business.Channels +namespace Alloy._1.Business.Channels { /// /// Base class for all resolution definitions diff --git a/templates/Alloy.Mvc/Business/Channels/DisplayResolutions.cs b/templates/Alloy.Mvc/Business/Channels/DisplayResolutions.cs index 3473c7d..10c72a6 100644 --- a/templates/Alloy.Mvc/Business/Channels/DisplayResolutions.cs +++ b/templates/Alloy.Mvc/Business/Channels/DisplayResolutions.cs @@ -1,6 +1,6 @@ using EPiServer.Framework.Localization; -namespace Alloy.Mvc.Business.Channels +namespace Alloy._1.Business.Channels { /// /// Defines resolution for desktop displays diff --git a/templates/Alloy.Mvc/Business/Channels/MobileChannel.cs b/templates/Alloy.Mvc/Business/Channels/MobileChannel.cs index 73f7328..30a7c89 100644 --- a/templates/Alloy.Mvc/Business/Channels/MobileChannel.cs +++ b/templates/Alloy.Mvc/Business/Channels/MobileChannel.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using Wangkanai.Detection; -namespace Alloy.Mvc.Business.Channels +namespace Alloy._1.Business.Channels { // // Defines the 'Mobile' content channel diff --git a/templates/Alloy.Mvc/Business/Channels/WebChannel.cs b/templates/Alloy.Mvc/Business/Channels/WebChannel.cs index 36217be..1ff2453 100644 --- a/templates/Alloy.Mvc/Business/Channels/WebChannel.cs +++ b/templates/Alloy.Mvc/Business/Channels/WebChannel.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using Wangkanai.Detection; -namespace Alloy.Mvc.Business.Channels +namespace Alloy._1.Business.Channels { /// /// Defines the 'Web' content channel diff --git a/templates/Alloy.Mvc/Business/ContentExtensions.cs b/templates/Alloy.Mvc/Business/ContentExtensions.cs index 673f1df..a5bd678 100644 --- a/templates/Alloy.Mvc/Business/ContentExtensions.cs +++ b/templates/Alloy.Mvc/Business/ContentExtensions.cs @@ -5,7 +5,7 @@ using EPiServer.Framework.Web; using EPiServer.ServiceLocation; -namespace Alloy.Mvc.Business +namespace Alloy._1.Business { /// /// Extension methods for content diff --git a/templates/Alloy.Mvc/Business/ContentLocator.cs b/templates/Alloy.Mvc/Business/ContentLocator.cs index 32593c4..1a9c5e3 100644 --- a/templates/Alloy.Mvc/Business/ContentLocator.cs +++ b/templates/Alloy.Mvc/Business/ContentLocator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; -using Alloy.Mvc.Models.Pages; +using Alloy._1.Models.Pages; using EPiServer; using EPiServer.Core; using EPiServer.Filters; @@ -10,7 +10,7 @@ using EPiServer.Shell.Configuration; using EPiServer.Web; -namespace Alloy.Mvc.Business +namespace Alloy._1.Business { [ServiceConfiguration(Lifecycle = ServiceInstanceScope.Singleton)] public class ContentLocator diff --git a/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelectionFactory.cs b/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelectionFactory.cs index 2f78e68..49dfb55 100644 --- a/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelectionFactory.cs +++ b/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelectionFactory.cs @@ -3,7 +3,7 @@ using EPiServer.ServiceLocation; using EPiServer.Shell.ObjectEditing; -namespace Alloy.Mvc.Business.EditorDescriptors +namespace Alloy._1.Business.EditorDescriptors { /// /// Provides a list of options corresponding to ContactPage pages on the site diff --git a/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelector.cs b/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelector.cs index 9b9cde5..931753d 100644 --- a/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelector.cs +++ b/templates/Alloy.Mvc/Business/EditorDescriptors/ContactPageSelector.cs @@ -4,7 +4,7 @@ using EPiServer.Shell.ObjectEditing; using EPiServer.Shell.ObjectEditing.EditorDescriptors; -namespace Alloy.Mvc.Business.EditorDescriptors +namespace Alloy._1.Business.EditorDescriptors { /// /// Registers an editor to select a ContactPage for a PageReference property using a dropdown diff --git a/templates/Alloy.Mvc/Business/IModifyLayout.cs b/templates/Alloy.Mvc/Business/IModifyLayout.cs index 1abe21d..afbc684 100644 --- a/templates/Alloy.Mvc/Business/IModifyLayout.cs +++ b/templates/Alloy.Mvc/Business/IModifyLayout.cs @@ -1,6 +1,6 @@ -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.ViewModels; -namespace Alloy.Mvc.Business +namespace Alloy._1.Business { /// /// Defines a method which may be invoked by PageContextActionFilter allowing controllers diff --git a/templates/Alloy.Mvc/Business/Initialization/CustomizedRenderingInitialization.cs b/templates/Alloy.Mvc/Business/Initialization/CustomizedRenderingInitialization.cs index de72458..1ed5907 100644 --- a/templates/Alloy.Mvc/Business/Initialization/CustomizedRenderingInitialization.cs +++ b/templates/Alloy.Mvc/Business/Initialization/CustomizedRenderingInitialization.cs @@ -1,4 +1,4 @@ -using Alloy.Mvc.Business.Rendering; +using Alloy._1.Business.Rendering; using EPiServer.Framework; using EPiServer.Framework.Initialization; using EPiServer.ServiceLocation; @@ -7,7 +7,7 @@ using EPiServer.Web.Mvc.Html; using Microsoft.Extensions.DependencyInjection; -namespace Alloy.Mvc.Business.Initialization +namespace Alloy._1.Business.Initialization { /// /// Module for customizing templates and rendering. diff --git a/templates/Alloy.Mvc/Business/PageContextActionFilter.cs b/templates/Alloy.Mvc/Business/PageContextActionFilter.cs index 2046587..b5d22df 100644 --- a/templates/Alloy.Mvc/Business/PageContextActionFilter.cs +++ b/templates/Alloy.Mvc/Business/PageContextActionFilter.cs @@ -1,10 +1,10 @@ -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using EPiServer.Web.Routing; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; -namespace Alloy.Mvc.Business +namespace Alloy._1.Business { /// /// Intercepts actions with view models of type IPageViewModel and populates the view models diff --git a/templates/Alloy.Mvc/Business/PageTypeExtensions.cs b/templates/Alloy.Mvc/Business/PageTypeExtensions.cs index f799832..2420023 100644 --- a/templates/Alloy.Mvc/Business/PageTypeExtensions.cs +++ b/templates/Alloy.Mvc/Business/PageTypeExtensions.cs @@ -2,7 +2,7 @@ using EPiServer.DataAbstraction; using EPiServer.ServiceLocation; -namespace Alloy.Mvc.Business +namespace Alloy._1.Business { /// /// Provides extension methods for types intended to be used when working with page types diff --git a/templates/Alloy.Mvc/Business/PageViewContextFactory.cs b/templates/Alloy.Mvc/Business/PageViewContextFactory.cs index 40ae084..e6ce196 100644 --- a/templates/Alloy.Mvc/Business/PageViewContextFactory.cs +++ b/templates/Alloy.Mvc/Business/PageViewContextFactory.cs @@ -1,6 +1,6 @@ using System.Linq; -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using EPiServer; using EPiServer.Core; using EPiServer.Data; @@ -13,7 +13,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Options; -namespace Alloy.Mvc.Business +namespace Alloy._1.Business { [ServiceConfiguration] public class PageViewContextFactory @@ -23,7 +23,11 @@ public class PageViewContextFactory private readonly IDatabaseMode _databaseMode; private readonly CookieAuthenticationOptions _cookieAuthenticationOptions; - public PageViewContextFactory(IContentLoader contentLoader, UrlResolver urlResolver, IDatabaseMode databaseMode, IOptionsMonitor optionMonitor) + public PageViewContextFactory( + IContentLoader contentLoader, + UrlResolver urlResolver, + IDatabaseMode databaseMode, + IOptionsMonitor optionMonitor) { _contentLoader = contentLoader; _urlResolver = urlResolver; @@ -67,14 +71,20 @@ private string GetLoginUrl(ContentReference returnToContentLink) public virtual IContent GetSection(ContentReference contentLink) { var currentContent = _contentLoader.Get(contentLink); - if (currentContent.ParentLink != null && currentContent.ParentLink.CompareToIgnoreWorkID(SiteDefinition.Current.StartPage)) + + static bool isSectionRoot(ContentReference contentReference) => + ContentReference.IsNullOrEmpty(contentReference) || + contentReference.Equals(SiteDefinition.Current.StartPage) || + contentReference.Equals(SiteDefinition.Current.RootPage); + + if (isSectionRoot(currentContent.ParentLink)) { return currentContent; } return _contentLoader.GetAncestors(contentLink) .OfType() - .SkipWhile(x => x.ParentLink == null || !x.ParentLink.CompareToIgnoreWorkID(SiteDefinition.Current.StartPage)) + .SkipWhile(x => !isSectionRoot(x.ParentLink)) .FirstOrDefault(); } } diff --git a/templates/Alloy.Mvc/Business/Rendering/AlloyContentAreaRenderer.cs b/templates/Alloy.Mvc/Business/Rendering/AlloyContentAreaRenderer.cs index b9ad4cb..632d70d 100644 --- a/templates/Alloy.Mvc/Business/Rendering/AlloyContentAreaRenderer.cs +++ b/templates/Alloy.Mvc/Business/Rendering/AlloyContentAreaRenderer.cs @@ -3,9 +3,9 @@ using EPiServer.Core.Html.StringParsing; using EPiServer.Web.Mvc.Html; using Microsoft.AspNetCore.Mvc.Rendering; -using static Alloy.Mvc.Globals; +using static Alloy._1.Globals; -namespace Alloy.Mvc.Business.Rendering +namespace Alloy._1.Business.Rendering { /// /// Extends the default to apply custom CSS classes to each . diff --git a/templates/Alloy.Mvc/Business/Rendering/ErrorHandlingContentRenderer.cs b/templates/Alloy.Mvc/Business/Rendering/ErrorHandlingContentRenderer.cs index 8e2ede7..af5cef3 100644 --- a/templates/Alloy.Mvc/Business/Rendering/ErrorHandlingContentRenderer.cs +++ b/templates/Alloy.Mvc/Business/Rendering/ErrorHandlingContentRenderer.cs @@ -2,14 +2,14 @@ using System.Diagnostics; using System.IO; using System.Threading.Tasks; -using Alloy.Mvc.Helpers; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Helpers; +using Alloy._1.Models.ViewModels; using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.Web.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; -namespace Alloy.Mvc.Business.Rendering +namespace Alloy._1.Business.Rendering { /// /// Wraps an MvcContentRenderer and adds error handling to ensure that blocks and other content diff --git a/templates/Alloy.Mvc/Business/Rendering/IContainerPage.cs b/templates/Alloy.Mvc/Business/Rendering/IContainerPage.cs index 7087ba2..d2100e7 100644 --- a/templates/Alloy.Mvc/Business/Rendering/IContainerPage.cs +++ b/templates/Alloy.Mvc/Business/Rendering/IContainerPage.cs @@ -1,4 +1,4 @@ -namespace Alloy.Mvc.Business.Rendering +namespace Alloy._1.Business.Rendering { /// /// Marker interface for content types which should not be handled by DefaultPageController. diff --git a/templates/Alloy.Mvc/Business/Rendering/ICustomCssInContentArea.cs b/templates/Alloy.Mvc/Business/Rendering/ICustomCssInContentArea.cs index 14c7110..481dfb3 100644 --- a/templates/Alloy.Mvc/Business/Rendering/ICustomCssInContentArea.cs +++ b/templates/Alloy.Mvc/Business/Rendering/ICustomCssInContentArea.cs @@ -1,4 +1,4 @@ -namespace Alloy.Mvc.Business.Rendering +namespace Alloy._1.Business.Rendering { /// /// Defines a property for CSS class(es) which will be added to the class diff --git a/templates/Alloy.Mvc/Business/Rendering/SiteViewEngineLocationExpander.cs b/templates/Alloy.Mvc/Business/Rendering/SiteViewEngineLocationExpander.cs index 3be3d9b..6ea7825 100644 --- a/templates/Alloy.Mvc/Business/Rendering/SiteViewEngineLocationExpander.cs +++ b/templates/Alloy.Mvc/Business/Rendering/SiteViewEngineLocationExpander.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc.Razor; using System.Collections.Generic; -namespace Alloy.Mvc.Business.Rendering +namespace Alloy._1.Business.Rendering { public class SiteViewEngineLocationExpander : IViewLocationExpander { diff --git a/templates/Alloy.Mvc/Business/Rendering/TemplateCoordinator.cs b/templates/Alloy.Mvc/Business/Rendering/TemplateCoordinator.cs index e70042b..ebab8fa 100644 --- a/templates/Alloy.Mvc/Business/Rendering/TemplateCoordinator.cs +++ b/templates/Alloy.Mvc/Business/Rendering/TemplateCoordinator.cs @@ -1,13 +1,13 @@ using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.ServiceLocation; -using Alloy.Mvc.Controllers; -using Alloy.Mvc.Models.Blocks; -using Alloy.Mvc.Models.Pages; +using Alloy._1.Controllers; +using Alloy._1.Models.Blocks; +using Alloy._1.Models.Pages; using EPiServer.Web; using EPiServer.Web.Mvc; -namespace Alloy.Mvc.Business.Rendering +namespace Alloy._1.Business.Rendering { [ServiceConfiguration(typeof(IViewTemplateModelRegistrator))] public class TemplateCoordinator : IViewTemplateModelRegistrator diff --git a/templates/Alloy.Mvc/Business/UIDescriptors/ContainerPageUIDescriptor.cs b/templates/Alloy.Mvc/Business/UIDescriptors/ContainerPageUIDescriptor.cs index 4355634..d4623a1 100644 --- a/templates/Alloy.Mvc/Business/UIDescriptors/ContainerPageUIDescriptor.cs +++ b/templates/Alloy.Mvc/Business/UIDescriptors/ContainerPageUIDescriptor.cs @@ -1,7 +1,7 @@ using EPiServer.Shell; -using Alloy.Mvc.Models.Pages; +using Alloy._1.Models.Pages; -namespace Alloy.Mvc.Business.UIDescriptors +namespace Alloy._1.Business.UIDescriptors { /// /// Describes how the UI should appear for content. diff --git a/templates/Alloy.Mvc/Components/ContactBlockViewComponent.cs b/templates/Alloy.Mvc/Components/ContactBlockViewComponent.cs index cee98a8..9ae2c1d 100644 --- a/templates/Alloy.Mvc/Components/ContactBlockViewComponent.cs +++ b/templates/Alloy.Mvc/Components/ContactBlockViewComponent.cs @@ -1,7 +1,7 @@ -using Alloy.Mvc.Helpers; -using Alloy.Mvc.Models.Blocks; -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Helpers; +using Alloy._1.Models.Blocks; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using EPiServer; using EPiServer.Core; using EPiServer.Web; @@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Html; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Components +namespace Alloy._1.Components { public class ContactBlockViewComponent : BlockComponent { diff --git a/templates/Alloy.Mvc/Components/ImageFileViewComponent.cs b/templates/Alloy.Mvc/Components/ImageFileViewComponent.cs index eaea1f7..b4ca65f 100644 --- a/templates/Alloy.Mvc/Components/ImageFileViewComponent.cs +++ b/templates/Alloy.Mvc/Components/ImageFileViewComponent.cs @@ -1,10 +1,10 @@ -using Alloy.Mvc.Models.Media; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.Media; +using Alloy._1.Models.ViewModels; using EPiServer.Web.Mvc; using EPiServer.Web.Routing; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Components +namespace Alloy._1.Components { /// /// Controller for the image file. diff --git a/templates/Alloy.Mvc/Components/PageListBlockViewComponent.cs b/templates/Alloy.Mvc/Components/PageListBlockViewComponent.cs index d57849a..3dbb28b 100644 --- a/templates/Alloy.Mvc/Components/PageListBlockViewComponent.cs +++ b/templates/Alloy.Mvc/Components/PageListBlockViewComponent.cs @@ -1,15 +1,15 @@ using System.Collections.Generic; using System.Linq; -using Alloy.Mvc.Business; -using Alloy.Mvc.Models.Blocks; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Business; +using Alloy._1.Models.Blocks; +using Alloy._1.Models.ViewModels; using EPiServer; using EPiServer.Core; using EPiServer.Filters; using EPiServer.Web.Mvc; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Components +namespace Alloy._1.Components { public class PageListBlockViewComponent : BlockComponent { diff --git a/templates/Alloy.Mvc/Components/VideoFileViewComponent.cs b/templates/Alloy.Mvc/Components/VideoFileViewComponent.cs index 8a95d09..c9455f4 100644 --- a/templates/Alloy.Mvc/Components/VideoFileViewComponent.cs +++ b/templates/Alloy.Mvc/Components/VideoFileViewComponent.cs @@ -1,11 +1,11 @@ -using Alloy.Mvc.Models.Media; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.Media; +using Alloy._1.Models.ViewModels; using EPiServer.Core; using EPiServer.Web.Mvc; using EPiServer.Web.Routing; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Components +namespace Alloy._1.Components { /// /// Controller for the video file. diff --git a/templates/Alloy.Mvc/Controllers/DefaultPageController.cs b/templates/Alloy.Mvc/Controllers/DefaultPageController.cs index 17e7aaa..927ad6c 100644 --- a/templates/Alloy.Mvc/Controllers/DefaultPageController.cs +++ b/templates/Alloy.Mvc/Controllers/DefaultPageController.cs @@ -1,11 +1,11 @@ using System; using EPiServer; using EPiServer.Framework.DataAnnotations; -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Controllers +namespace Alloy._1.Controllers { /// /// Concrete controller that handles all page types that don't have their own specific controllers. diff --git a/templates/Alloy.Mvc/Controllers/PageControllerBase.cs b/templates/Alloy.Mvc/Controllers/PageControllerBase.cs index 8dd6d38..b6c4db6 100644 --- a/templates/Alloy.Mvc/Controllers/PageControllerBase.cs +++ b/templates/Alloy.Mvc/Controllers/PageControllerBase.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using Alloy.Mvc.Business; -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Business; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using EPiServer.ServiceLocation; using EPiServer.Shell.Security; using EPiServer.Web.Mvc; @@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; -namespace Alloy.Mvc.Controllers +namespace Alloy._1.Controllers { /// /// All controllers that renders pages should inherit from this class so that we can diff --git a/templates/Alloy.Mvc/Controllers/PreviewController.cs b/templates/Alloy.Mvc/Controllers/PreviewController.cs index 44554b8..25f8296 100644 --- a/templates/Alloy.Mvc/Controllers/PreviewController.cs +++ b/templates/Alloy.Mvc/Controllers/PreviewController.cs @@ -1,7 +1,7 @@ using System.Linq; -using Alloy.Mvc.Business; -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Business; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using EPiServer; using EPiServer.Core; using EPiServer.Framework.DataAnnotations; @@ -11,7 +11,7 @@ using EPiServer.Web.Mvc; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Controllers +namespace Alloy._1.Controllers { // Note: as the content area rendering on Alloy is customized we create ContentArea instances // which we render in the preview view in order to provide editors with a preview which is as diff --git a/templates/Alloy.Mvc/Controllers/SearchPageController.cs b/templates/Alloy.Mvc/Controllers/SearchPageController.cs index 5565668..063c6ec 100644 --- a/templates/Alloy.Mvc/Controllers/SearchPageController.cs +++ b/templates/Alloy.Mvc/Controllers/SearchPageController.cs @@ -1,9 +1,9 @@ using System.Linq; -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Controllers +namespace Alloy._1.Controllers { public class SearchPageController : PageControllerBase { diff --git a/templates/Alloy.Mvc/Controllers/StartPageController.cs b/templates/Alloy.Mvc/Controllers/StartPageController.cs index e734620..de32760 100644 --- a/templates/Alloy.Mvc/Controllers/StartPageController.cs +++ b/templates/Alloy.Mvc/Controllers/StartPageController.cs @@ -1,10 +1,10 @@ -using Alloy.Mvc.Models.Pages; -using Alloy.Mvc.Models.ViewModels; +using Alloy._1.Models.Pages; +using Alloy._1.Models.ViewModels; using EPiServer.Web; using EPiServer.Web.Mvc; using Microsoft.AspNetCore.Mvc; -namespace Alloy.Mvc.Controllers +namespace Alloy._1.Controllers { public class StartPageController : PageControllerBase { diff --git a/templates/Alloy.Mvc/Docker/create-db.sh b/templates/Alloy.Mvc/Docker/create-db.sh index 3203ede..c3f11cc 100644 --- a/templates/Alloy.Mvc/Docker/create-db.sh +++ b/templates/Alloy.Mvc/Docker/create-db.sh @@ -1,6 +1,6 @@ #!/bin/bash -for i in {1..50}; do +for i in {1..100}; do /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '${DB_NAME}') CREATE DATABASE ${DB_NAME} ON (NAME=${DB_NAME}_data, FILENAME='/var/opt/mssql/host_data/${DB_NAME}.mdf') LOG ON (NAME=${DB_NAME}_log, FILENAME='/var/opt/mssql/host_data/${DB_NAME}.ldf')" if [ $? -eq 0 ]; then echo "Creating database completed" diff --git a/templates/Alloy.Mvc/Docker/web.dockerfile b/templates/Alloy.Mvc/Docker/web.dockerfile index f9ff868..db21fea 100644 --- a/templates/Alloy.Mvc/Docker/web.dockerfile +++ b/templates/Alloy.Mvc/Docker/web.dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/dotnet/sdk:5.0 WORKDIR /src #Restore NuGet packages so they are cached when we start the container -COPY ./Alloy.Mvc.csproj . +COPY ./Alloy.1.csproj . COPY ./Directory.Build.props . COPY ./nuget.config . diff --git a/templates/Alloy.Mvc/Extensions/ServiceCollectionExtensions.cs b/templates/Alloy.Mvc/Extensions/ServiceCollectionExtensions.cs index b60fffa..de21fe7 100644 --- a/templates/Alloy.Mvc/Extensions/ServiceCollectionExtensions.cs +++ b/templates/Alloy.Mvc/Extensions/ServiceCollectionExtensions.cs @@ -1,12 +1,12 @@ -using Alloy.Mvc.Business; -using Alloy.Mvc.Business.Channels; -using Alloy.Mvc.Business.Rendering; +using Alloy._1.Business; +using Alloy._1.Business.Channels; +using Alloy._1.Business.Rendering; using EPiServer.Web; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.Extensions.DependencyInjection; -namespace Alloy.Mvc.Extensions +namespace Alloy._1.Extensions { public static class ServiceCollectionExtensions { diff --git a/templates/Alloy.Mvc/Extensions/ViewContextExtension.cs b/templates/Alloy.Mvc/Extensions/ViewContextExtension.cs index 57c6440..d011d29 100644 --- a/templates/Alloy.Mvc/Extensions/ViewContextExtension.cs +++ b/templates/Alloy.Mvc/Extensions/ViewContextExtension.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.DependencyInjection; -namespace Alloy.Mvc.Helpers +namespace Alloy._1.Helpers { /// /// Extension methods on request Context such as et/Set Node, Lang, Controller diff --git a/templates/Alloy.Mvc/Globals.cs b/templates/Alloy.Mvc/Globals.cs index d2b5211..052dafc 100644 --- a/templates/Alloy.Mvc/Globals.cs +++ b/templates/Alloy.Mvc/Globals.cs @@ -1,7 +1,7 @@ using EPiServer.DataAnnotations; using System.ComponentModel.DataAnnotations; -namespace Alloy.Mvc +namespace Alloy._1 { public class Globals { diff --git a/templates/Alloy.Mvc/Helpers/CategorizableExtensions.cs b/templates/Alloy.Mvc/Helpers/CategorizableExtensions.cs index 048dd87..c8d2cac 100644 --- a/templates/Alloy.Mvc/Helpers/CategorizableExtensions.cs +++ b/templates/Alloy.Mvc/Helpers/CategorizableExtensions.cs @@ -5,7 +5,7 @@ using EPiServer.DataAbstraction; using EPiServer.ServiceLocation; -namespace Alloy.Mvc.Helpers +namespace Alloy._1.Helpers { /// /// Provides extension methods for categorizable content diff --git a/templates/Alloy.Mvc/Helpers/HtmlHelpers.cs b/templates/Alloy.Mvc/Helpers/HtmlHelpers.cs index 0f88507..c0be7f2 100644 --- a/templates/Alloy.Mvc/Helpers/HtmlHelpers.cs +++ b/templates/Alloy.Mvc/Helpers/HtmlHelpers.cs @@ -5,7 +5,7 @@ using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; -using Alloy.Mvc.Business; +using Alloy._1.Business; using EPiServer; using EPiServer.Core; using EPiServer.ServiceLocation; @@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Mvc.Rendering; -namespace Alloy.Mvc.Helpers +namespace Alloy._1.Helpers { public static class HtmlHelpers { diff --git a/templates/Alloy.Mvc/Helpers/UrlHelpers.cs b/templates/Alloy.Mvc/Helpers/UrlHelpers.cs index 8922172..60d2db7 100644 --- a/templates/Alloy.Mvc/Helpers/UrlHelpers.cs +++ b/templates/Alloy.Mvc/Helpers/UrlHelpers.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; -namespace Alloy.Mvc.Helpers +namespace Alloy._1.Helpers { public static class UrlHelpers { diff --git a/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs b/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs index ed950f4..e37b0a4 100644 --- a/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs @@ -2,7 +2,7 @@ using EPiServer; using EPiServer.DataAbstraction; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Used to insert a link which is styled as a button diff --git a/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs b/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs index 198c0d2..bbb3709 100644 --- a/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs @@ -5,7 +5,7 @@ using EPiServer.DataAnnotations; using EPiServer.Web; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Used to present contact information with a call-to-action link diff --git a/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs b/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs index a592f63..4c29e22 100644 --- a/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs @@ -3,7 +3,7 @@ using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Used to insert editorial content edited using a rich-text editor diff --git a/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs b/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs index e2f4ea6..a8aee9d 100644 --- a/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs @@ -5,7 +5,7 @@ using EPiServer.DataAnnotations; using EPiServer.Web; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Used for a primary message on a page, commonly used on start pages and landing pages diff --git a/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs b/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs index 8e36acd..98dea4f 100644 --- a/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs @@ -5,7 +5,7 @@ using EPiServer.DataAnnotations; using EPiServer.Filters; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Used to insert a list of pages, for example a news list diff --git a/templates/Alloy.Mvc/Models/Blocks/SiteBlockData.cs b/templates/Alloy.Mvc/Models/Blocks/SiteBlockData.cs index 20447b4..dabe50e 100644 --- a/templates/Alloy.Mvc/Models/Blocks/SiteBlockData.cs +++ b/templates/Alloy.Mvc/Models/Blocks/SiteBlockData.cs @@ -1,6 +1,6 @@ using EPiServer.Core; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Base class for all block types on the site diff --git a/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs b/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs index faf6adb..be37e2f 100644 --- a/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs @@ -5,7 +5,7 @@ using EPiServer.Shell.ObjectEditing; using EPiServer.Web; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Used to provide a composite property on the start page to set site logotype settings diff --git a/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs b/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs index d60de4b..e061abb 100644 --- a/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs @@ -4,7 +4,7 @@ using EPiServer.DataAnnotations; using EPiServer.Web; -namespace Alloy.Mvc.Models.Blocks +namespace Alloy._1.Models.Blocks { /// /// Used to provide a stylized entry point to a page on the site diff --git a/templates/Alloy.Mvc/Models/LoginViewModel.cs b/templates/Alloy.Mvc/Models/LoginViewModel.cs index 0c0e751..40f6c33 100644 --- a/templates/Alloy.Mvc/Models/LoginViewModel.cs +++ b/templates/Alloy.Mvc/Models/LoginViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Alloy.Mvc.Models +namespace Alloy._1.Models { public class LoginViewModel { diff --git a/templates/Alloy.Mvc/Models/Media/GenericMedia.cs b/templates/Alloy.Mvc/Models/Media/GenericMedia.cs index 166c712..62a8060 100644 --- a/templates/Alloy.Mvc/Models/Media/GenericMedia.cs +++ b/templates/Alloy.Mvc/Models/Media/GenericMedia.cs @@ -1,7 +1,7 @@ using EPiServer.Core; using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models.Media +namespace Alloy._1.Models.Media { [ContentType(GUID = "EE3BD195-7CB0-4756-AB5F-E5E223CD9820")] public class GenericMedia : MediaData diff --git a/templates/Alloy.Mvc/Models/Media/ImageFile.cs b/templates/Alloy.Mvc/Models/Media/ImageFile.cs index 97e8461..ee6ee00 100644 --- a/templates/Alloy.Mvc/Models/Media/ImageFile.cs +++ b/templates/Alloy.Mvc/Models/Media/ImageFile.cs @@ -2,7 +2,7 @@ using EPiServer.DataAnnotations; using EPiServer.Framework.DataAnnotations; -namespace Alloy.Mvc.Models.Media +namespace Alloy._1.Models.Media { [ContentType(GUID = "0A89E464-56D4-449F-AEA8-2BF774AB8730")] [MediaDescriptor(ExtensionString = "jpg,jpeg,jpe,ico,gif,bmp,png")] diff --git a/templates/Alloy.Mvc/Models/Media/VectorImageFile.cs b/templates/Alloy.Mvc/Models/Media/VectorImageFile.cs index 7f0eed6..977c5da 100644 --- a/templates/Alloy.Mvc/Models/Media/VectorImageFile.cs +++ b/templates/Alloy.Mvc/Models/Media/VectorImageFile.cs @@ -3,7 +3,7 @@ using EPiServer.Framework.Blobs; using EPiServer.Framework.DataAnnotations; -namespace Alloy.Mvc.Models.Media +namespace Alloy._1.Models.Media { [ContentType(GUID = "F522B459-EB27-462C-B216-989FC7FF9448")] [MediaDescriptor(ExtensionString = "svg")] diff --git a/templates/Alloy.Mvc/Models/Media/VideoFile.cs b/templates/Alloy.Mvc/Models/Media/VideoFile.cs index 8f84929..8a7f23f 100644 --- a/templates/Alloy.Mvc/Models/Media/VideoFile.cs +++ b/templates/Alloy.Mvc/Models/Media/VideoFile.cs @@ -4,7 +4,7 @@ using EPiServer.Framework.DataAnnotations; using EPiServer.Web; -namespace Alloy.Mvc.Models.Media +namespace Alloy._1.Models.Media { [ContentType(GUID = "85468104-E06F-47E5-A317-FC9B83D3CBA6")] [MediaDescriptor(ExtensionString = "flv,mp4,webm")] diff --git a/templates/Alloy.Mvc/Models/Pages/AllPropertiesTestPage.cs b/templates/Alloy.Mvc/Models/Pages/AllPropertiesTestPage.cs index f48067e..f3ac9cc 100644 --- a/templates/Alloy.Mvc/Models/Pages/AllPropertiesTestPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/AllPropertiesTestPage.cs @@ -14,7 +14,7 @@ using EPiServer.SpecializedProperties; using EPiServer.Web; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { [ContentType( GUID = "A7D46007-43E5-4401-9204-127040E79E09", diff --git a/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs b/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs index b28ee4c..40a7d9d 100644 --- a/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs @@ -1,6 +1,6 @@ using EPiServer.DataAbstraction; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Used primarily for publishing news articles on the website diff --git a/templates/Alloy.Mvc/Models/Pages/ContactPage.cs b/templates/Alloy.Mvc/Models/Pages/ContactPage.cs index 0876764..257c296 100644 --- a/templates/Alloy.Mvc/Models/Pages/ContactPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ContactPage.cs @@ -1,9 +1,9 @@ using System.ComponentModel.DataAnnotations; -using Alloy.Mvc.Business.Rendering; +using Alloy._1.Business.Rendering; using EPiServer.Core; using EPiServer.Web; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Represents contact details for a contact person diff --git a/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs b/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs index 7006e08..6e65696 100644 --- a/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs @@ -1,6 +1,6 @@ -using Alloy.Mvc.Business.Rendering; +using Alloy._1.Business.Rendering; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Used to logically group pages in the page tree diff --git a/templates/Alloy.Mvc/Models/Pages/IHasRelatedContent.cs b/templates/Alloy.Mvc/Models/Pages/IHasRelatedContent.cs index 861ac43..1e6fa35 100644 --- a/templates/Alloy.Mvc/Models/Pages/IHasRelatedContent.cs +++ b/templates/Alloy.Mvc/Models/Pages/IHasRelatedContent.cs @@ -1,6 +1,6 @@ using EPiServer.Core; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { public interface IHasRelatedContent { diff --git a/templates/Alloy.Mvc/Models/Pages/ISearchPage.cs b/templates/Alloy.Mvc/Models/Pages/ISearchPage.cs index 5f98f02..cd3ec44 100644 --- a/templates/Alloy.Mvc/Models/Pages/ISearchPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ISearchPage.cs @@ -1,4 +1,4 @@ -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Marker interface for search implementation diff --git a/templates/Alloy.Mvc/Models/Pages/LandingPage.cs b/templates/Alloy.Mvc/Models/Pages/LandingPage.cs index 46035d1..25bce9f 100644 --- a/templates/Alloy.Mvc/Models/Pages/LandingPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/LandingPage.cs @@ -3,7 +3,7 @@ using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Used for campaign or landing pages, commonly used for pages linked in online advertising such as AdWords diff --git a/templates/Alloy.Mvc/Models/Pages/NewsPage.cs b/templates/Alloy.Mvc/Models/Pages/NewsPage.cs index 71f8e86..7c4797e 100644 --- a/templates/Alloy.Mvc/Models/Pages/NewsPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/NewsPage.cs @@ -1,12 +1,12 @@ using System.ComponentModel.DataAnnotations; -using Alloy.Mvc.Business; -using Alloy.Mvc.Models.Blocks; +using Alloy._1.Business; +using Alloy._1.Models.Blocks; using EPiServer.DataAbstraction; using EPiServer.Filters; using EPiServer.Framework.Localization; using EPiServer.ServiceLocation; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Presents a news section including a list of the most recent articles on the site diff --git a/templates/Alloy.Mvc/Models/Pages/ProductPage.cs b/templates/Alloy.Mvc/Models/Pages/ProductPage.cs index c4670ea..3ac9ecb 100644 --- a/templates/Alloy.Mvc/Models/Pages/ProductPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ProductPage.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Alloy.Mvc.Models.Blocks; +using Alloy._1.Models.Blocks; using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Used to present a single product diff --git a/templates/Alloy.Mvc/Models/Pages/SearchPage.cs b/templates/Alloy.Mvc/Models/Pages/SearchPage.cs index 183738d..51899b0 100644 --- a/templates/Alloy.Mvc/Models/Pages/SearchPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/SearchPage.cs @@ -1,10 +1,10 @@ using System.ComponentModel.DataAnnotations; -using Alloy.Mvc.Models.Blocks; +using Alloy._1.Models.Blocks; using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Used to provide on-site search diff --git a/templates/Alloy.Mvc/Models/Pages/SitePageData.cs b/templates/Alloy.Mvc/Models/Pages/SitePageData.cs index fd04eb2..2d1dc1e 100644 --- a/templates/Alloy.Mvc/Models/Pages/SitePageData.cs +++ b/templates/Alloy.Mvc/Models/Pages/SitePageData.cs @@ -1,13 +1,13 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Alloy.Mvc.Business.Rendering; +using Alloy._1.Business.Rendering; using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; using EPiServer.SpecializedProperties; using EPiServer.Web; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Base class for all page types diff --git a/templates/Alloy.Mvc/Models/Pages/StandardPage.cs b/templates/Alloy.Mvc/Models/Pages/StandardPage.cs index 38d33c6..cac5b68 100644 --- a/templates/Alloy.Mvc/Models/Pages/StandardPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/StandardPage.cs @@ -3,7 +3,7 @@ using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Used for the pages mainly consisting of manually created content such as text, images, and blocks diff --git a/templates/Alloy.Mvc/Models/Pages/StartPage.cs b/templates/Alloy.Mvc/Models/Pages/StartPage.cs index 75969bd..f56b8bf 100644 --- a/templates/Alloy.Mvc/Models/Pages/StartPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/StartPage.cs @@ -1,11 +1,11 @@ using System.ComponentModel.DataAnnotations; -using Alloy.Mvc.Models.Blocks; +using Alloy._1.Models.Blocks; using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; using EPiServer.SpecializedProperties; -namespace Alloy.Mvc.Models.Pages +namespace Alloy._1.Models.Pages { /// /// Used for the site's start page and also acts as a container for site settings diff --git a/templates/Alloy.Mvc/Models/SiteContentType.cs b/templates/Alloy.Mvc/Models/SiteContentType.cs index b94a025..d6e9a75 100644 --- a/templates/Alloy.Mvc/Models/SiteContentType.cs +++ b/templates/Alloy.Mvc/Models/SiteContentType.cs @@ -1,6 +1,6 @@ using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models +namespace Alloy._1.Models { /// /// Attribute used for site content types to set default attribute values diff --git a/templates/Alloy.Mvc/Models/SiteImageUrl.cs b/templates/Alloy.Mvc/Models/SiteImageUrl.cs index 153387c..5090bfb 100644 --- a/templates/Alloy.Mvc/Models/SiteImageUrl.cs +++ b/templates/Alloy.Mvc/Models/SiteImageUrl.cs @@ -1,6 +1,6 @@ using EPiServer.DataAnnotations; -namespace Alloy.Mvc.Models +namespace Alloy._1.Models { /// /// Attribute to set the default thumbnail for site page and block types diff --git a/templates/Alloy.Mvc/Models/ViewModels/ContactBlockModel.cs b/templates/Alloy.Mvc/Models/ViewModels/ContactBlockModel.cs index d1f96cb..ebcf326 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/ContactBlockModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/ContactBlockModel.cs @@ -1,10 +1,10 @@ using System.ComponentModel.DataAnnotations; -using Alloy.Mvc.Models.Pages; +using Alloy._1.Models.Pages; using EPiServer.Core; using EPiServer.Web; using Microsoft.AspNetCore.Html; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { public class ContactBlockModel { diff --git a/templates/Alloy.Mvc/Models/ViewModels/ContentRenderingErrorModel.cs b/templates/Alloy.Mvc/Models/ViewModels/ContentRenderingErrorModel.cs index c6e92e6..87de5a2 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/ContentRenderingErrorModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/ContentRenderingErrorModel.cs @@ -2,7 +2,7 @@ using EPiServer; using EPiServer.Core; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { public class ContentRenderingErrorModel { diff --git a/templates/Alloy.Mvc/Models/ViewModels/IPageViewModel.cs b/templates/Alloy.Mvc/Models/ViewModels/IPageViewModel.cs index 7ab233f..a851c2f 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/IPageViewModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/IPageViewModel.cs @@ -1,7 +1,7 @@ -using Alloy.Mvc.Models.Pages; +using Alloy._1.Models.Pages; using EPiServer.Core; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { /// /// Defines common characteristics for view models for pages, including properties used by layout files. diff --git a/templates/Alloy.Mvc/Models/ViewModels/ImageViewModel.cs b/templates/Alloy.Mvc/Models/ViewModels/ImageViewModel.cs index bdca57a..68be2e7 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/ImageViewModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/ImageViewModel.cs @@ -1,4 +1,4 @@ -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { /// /// View model for the image file diff --git a/templates/Alloy.Mvc/Models/ViewModels/LayoutModel.cs b/templates/Alloy.Mvc/Models/ViewModels/LayoutModel.cs index 781f1bf..acf88b1 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/LayoutModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/LayoutModel.cs @@ -1,8 +1,8 @@ -using Alloy.Mvc.Models.Blocks; +using Alloy._1.Models.Blocks; using EPiServer.SpecializedProperties; using Microsoft.AspNetCore.Html; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { public class LayoutModel { diff --git a/templates/Alloy.Mvc/Models/ViewModels/PageListModel.cs b/templates/Alloy.Mvc/Models/ViewModels/PageListModel.cs index e67c83a..de02fad 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/PageListModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/PageListModel.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using Alloy.Mvc.Models.Blocks; +using Alloy._1.Models.Blocks; using EPiServer.Core; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { public class PageListModel { diff --git a/templates/Alloy.Mvc/Models/ViewModels/PageViewModel.cs b/templates/Alloy.Mvc/Models/ViewModels/PageViewModel.cs index 16a1cf9..24a27d1 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/PageViewModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/PageViewModel.cs @@ -1,7 +1,7 @@ -using Alloy.Mvc.Models.Pages; +using Alloy._1.Models.Pages; using EPiServer.Core; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { public class PageViewModel : IPageViewModel where T : SitePageData { diff --git a/templates/Alloy.Mvc/Models/ViewModels/PreviewModel.cs b/templates/Alloy.Mvc/Models/ViewModels/PreviewModel.cs index 4d5d19f..ba876a8 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/PreviewModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/PreviewModel.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using Alloy.Mvc.Models.Pages; +using Alloy._1.Models.Pages; using EPiServer.Core; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { public class PreviewModel : PageViewModel { diff --git a/templates/Alloy.Mvc/Models/ViewModels/SearchContentModel.cs b/templates/Alloy.Mvc/Models/ViewModels/SearchContentModel.cs index fbb547c..bc16bf2 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/SearchContentModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/SearchContentModel.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using Alloy.Mvc.Models.Pages; +using Alloy._1.Models.Pages; -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { public class SearchContentModel : PageViewModel { diff --git a/templates/Alloy.Mvc/Models/ViewModels/VideoViewModel.cs b/templates/Alloy.Mvc/Models/ViewModels/VideoViewModel.cs index add0626..95f638d 100644 --- a/templates/Alloy.Mvc/Models/ViewModels/VideoViewModel.cs +++ b/templates/Alloy.Mvc/Models/ViewModels/VideoViewModel.cs @@ -1,4 +1,4 @@ -namespace Alloy.Mvc.Models.ViewModels +namespace Alloy._1.Models.ViewModels { /// /// View model for the video file @@ -13,6 +13,6 @@ public class VideoViewModel /// /// Gets or sets the URL to a preview image for the video. /// - public string? PreviewImageUrl { get; set; } + public string PreviewImageUrl { get; set; } } } diff --git a/templates/Alloy.Mvc/Program.cs b/templates/Alloy.Mvc/Program.cs index 9b0d1d8..3faca92 100644 --- a/templates/Alloy.Mvc/Program.cs +++ b/templates/Alloy.Mvc/Program.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; -namespace Alloy.Mvc +namespace Alloy._1 { public class Program { diff --git a/templates/Alloy.Mvc/Properties/launchSettings.json b/templates/Alloy.Mvc/Properties/launchSettings.json index 604e240..fc29bf3 100644 --- a/templates/Alloy.Mvc/Properties/launchSettings.json +++ b/templates/Alloy.Mvc/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "Alloy.Mvc": { + "Alloy.1": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:5000/", diff --git a/templates/Alloy.Mvc/Startup.cs b/templates/Alloy.Mvc/Startup.cs index de09d43..d11ed48 100644 --- a/templates/Alloy.Mvc/Startup.cs +++ b/templates/Alloy.Mvc/Startup.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using Alloy.Mvc.Extensions; +using Alloy._1.Extensions; using EPiServer.Cms.Shell; using EPiServer.Cms.UI.AspNetIdentity; using EPiServer.Scheduler; @@ -11,7 +11,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -namespace Alloy.Mvc +namespace Alloy._1 { public class Startup { diff --git a/templates/Alloy.Mvc/Views/StartPage/Index.cshtml b/templates/Alloy.Mvc/Views/StartPage/Index.cshtml index 9f76c7e..2fc598e 100644 --- a/templates/Alloy.Mvc/Views/StartPage/Index.cshtml +++ b/templates/Alloy.Mvc/Views/StartPage/Index.cshtml @@ -1,4 +1,4 @@ -@model PageViewModel +@model PageViewModel
@Html.PropertyFor(x => x.CurrentPage.MainContentArea, new { CssClass = "row" }) diff --git a/templates/Alloy.Mvc/Views/_ViewImports.cshtml b/templates/Alloy.Mvc/Views/_ViewImports.cshtml index 058e366..ce7257f 100644 --- a/templates/Alloy.Mvc/Views/_ViewImports.cshtml +++ b/templates/Alloy.Mvc/Views/_ViewImports.cshtml @@ -1,10 +1,10 @@ -@using Alloy.Mvc -@using Alloy.Mvc.Extensions -@using Alloy.Mvc.Helpers -@using Alloy.Mvc.Models.Blocks -@using Alloy.Mvc.Models.Media -@using Alloy.Mvc.Models.Pages -@using Alloy.Mvc.Models.ViewModels +@using Alloy._1 +@using Alloy._1.Extensions +@using Alloy._1.Helpers +@using Alloy._1.Models.Blocks +@using Alloy._1.Models.Media +@using Alloy._1.Models.Pages +@using Alloy._1.Models.ViewModels @using EPiServer.Framework.Localization @using EPiServer.Web.Mvc.Html @using EPiServer.Shell.Web.Mvc.Html diff --git a/templates/Alloy.Mvc/appsettings.Development.json b/templates/Alloy.Mvc/appsettings.Development.json index 7cdf464..2bb4e04 100644 --- a/templates/Alloy.Mvc/appsettings.Development.json +++ b/templates/Alloy.Mvc/appsettings.Development.json @@ -8,7 +8,7 @@ } }, "ConnectionStrings": { - "EPiServerDB": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Alloy.Mvc.mdf;Initial Catalog=Alloy.Mvc;Integrated Security=True;Connect Timeout=30" + "EPiServerDB": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Alloy.1.mdf;Initial Catalog=Alloy.1;Integrated Security=True;Connect Timeout=30" }, "EPiServer": { "Cms": { diff --git a/templates/Alloy.Mvc/docker-compose.yml b/templates/Alloy.Mvc/docker-compose.yml index 5993eca..ac71b2e 100644 --- a/templates/Alloy.Mvc/docker-compose.yml +++ b/templates/Alloy.Mvc/docker-compose.yml @@ -12,7 +12,7 @@ services: - 6000:1433 volumes: - ./App_Data:/var/opt/mssql/host_data - image: Alloy.Mvc/db + image: Alloy.1/db web: depends_on: - db @@ -27,4 +27,5 @@ services: - 5000:80 volumes: - .:/src - image: Alloy.Mvc/web + image: Alloy.1/web + restart: on-failure diff --git a/templates/Alloy.Mvc/nuget.config b/templates/Alloy.Mvc/nuget.config index 287e902..79187e1 100644 --- a/templates/Alloy.Mvc/nuget.config +++ b/templates/Alloy.Mvc/nuget.config @@ -3,6 +3,6 @@ - + diff --git a/templates/Cms.Empty/.template.config/dotnetcli.host.json b/templates/Cms.Empty/.template.config/dotnetcli.host.json index 4718119..a53ef73 100644 --- a/templates/Cms.Empty/.template.config/dotnetcli.host.json +++ b/templates/Cms.Empty/.template.config/dotnetcli.host.json @@ -1,6 +1,6 @@ { "symbolInfo": { - "enablelDocker": { + "enableDocker": { "longName": "enable-docker", "shortName": "" }, diff --git a/templates/Cms.Empty/.template.config/template.json b/templates/Cms.Empty/.template.config/template.json index 4dcb28a..95acb3a 100644 --- a/templates/Cms.Empty/.template.config/template.json +++ b/templates/Cms.Empty/.template.config/template.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/template", "author": "Episerver AB", - "sourceName": "Cms.Empty", + "sourceName": "Cms.1", "classifications": [ "Web" ], "identity": "EPiServer.Templates.Cms.Empty", "name": "Optimizely CMS empty", @@ -15,7 +15,7 @@ { "modifiers": [ { - "condition": "(!enablelDocker)", + "condition": "(!enableDocker)", "exclude": [ "Directory.Build.props", "docker-compose.yml", @@ -26,7 +26,7 @@ } ], "symbols": { - "enablelDocker": { + "enableDocker": { "type": "parameter", "datatype": "bool", "defaultValue": "false", diff --git a/templates/Cms.Empty/App_Data/Cms.Empty.mdf b/templates/Cms.Empty/App_Data/Cms.1.mdf similarity index 100% rename from templates/Cms.Empty/App_Data/Cms.Empty.mdf rename to templates/Cms.Empty/App_Data/Cms.1.mdf diff --git a/templates/Cms.Empty/Cms.Empty.csproj b/templates/Cms.Empty/Cms.1.csproj similarity index 82% rename from templates/Cms.Empty/Cms.Empty.csproj rename to templates/Cms.Empty/Cms.1.csproj index fb5c064..d555722 100644 --- a/templates/Cms.Empty/Cms.Empty.csproj +++ b/templates/Cms.Empty/Cms.1.csproj @@ -5,7 +5,7 @@ - + diff --git a/templates/Cms.Empty/Docker/create-db.sh b/templates/Cms.Empty/Docker/create-db.sh index 3203ede..c3f11cc 100644 --- a/templates/Cms.Empty/Docker/create-db.sh +++ b/templates/Cms.Empty/Docker/create-db.sh @@ -1,6 +1,6 @@ #!/bin/bash -for i in {1..50}; do +for i in {1..100}; do /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '${DB_NAME}') CREATE DATABASE ${DB_NAME} ON (NAME=${DB_NAME}_data, FILENAME='/var/opt/mssql/host_data/${DB_NAME}.mdf') LOG ON (NAME=${DB_NAME}_log, FILENAME='/var/opt/mssql/host_data/${DB_NAME}.ldf')" if [ $? -eq 0 ]; then echo "Creating database completed" diff --git a/templates/Cms.Empty/Docker/web.dockerfile b/templates/Cms.Empty/Docker/web.dockerfile index d074dd4..93d22dd 100644 --- a/templates/Cms.Empty/Docker/web.dockerfile +++ b/templates/Cms.Empty/Docker/web.dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/dotnet/sdk:5.0 WORKDIR /src #Restore NuGet packages so they are cached when we start the container -COPY ./Cms.Empty.csproj . +COPY ./Cms.1.csproj . COPY ./Directory.Build.props . COPY ./nuget.config . diff --git a/templates/Cms.Empty/Program.cs b/templates/Cms.Empty/Program.cs index 2592335..94eb307 100644 --- a/templates/Cms.Empty/Program.cs +++ b/templates/Cms.Empty/Program.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; -namespace Cms.Empty +namespace Cms._1 { public class Program { diff --git a/templates/Cms.Empty/Properties/launchSettings.json b/templates/Cms.Empty/Properties/launchSettings.json index 1ba0f09..781e357 100644 --- a/templates/Cms.Empty/Properties/launchSettings.json +++ b/templates/Cms.Empty/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "Cms.Empty": { + "Cms.1": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:5000/", diff --git a/templates/Cms.Empty/Startup.cs b/templates/Cms.Empty/Startup.cs index 10730d0..3c5bbd3 100644 --- a/templates/Cms.Empty/Startup.cs +++ b/templates/Cms.Empty/Startup.cs @@ -10,7 +10,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -namespace Cms.Empty +namespace Cms._1 { public class Startup { diff --git a/templates/Cms.Empty/appsettings.Development.json b/templates/Cms.Empty/appsettings.Development.json index bbd2504..684b8a3 100644 --- a/templates/Cms.Empty/appsettings.Development.json +++ b/templates/Cms.Empty/appsettings.Development.json @@ -8,7 +8,7 @@ } }, "ConnectionStrings": { - "EPiServerDB": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Cms.Empty.mdf;Initial Catalog=Cms.Empty;Integrated Security=True;Connect Timeout=30" + "EPiServerDB": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Cms.1.mdf;Initial Catalog=Cms.1;Integrated Security=True;Connect Timeout=30" }, "EPiServer": { "Cms": { diff --git a/templates/Cms.Empty/docker-compose.yml b/templates/Cms.Empty/docker-compose.yml index e51d542..85ba85a 100644 --- a/templates/Cms.Empty/docker-compose.yml +++ b/templates/Cms.Empty/docker-compose.yml @@ -12,7 +12,7 @@ services: - 6000:1433 volumes: - ./App_Data:/var/opt/mssql/host_data - image: Cms.Empty/db + image: Cms.1/db web: depends_on: - db @@ -27,4 +27,5 @@ services: - 5000:80 volumes: - .:/src - image: Cms.Empty/web + image: Cms.1/web + restart: on-failure diff --git a/templates/Cms.Empty/nuget.config b/templates/Cms.Empty/nuget.config index 287e902..79187e1 100644 --- a/templates/Cms.Empty/nuget.config +++ b/templates/Cms.Empty/nuget.config @@ -3,6 +3,6 @@ - + diff --git a/templates/Cms.Item/Cms.Item.csproj b/templates/Cms.Item/Cms.Item.csproj new file mode 100644 index 0000000..3b8b0f3 --- /dev/null +++ b/templates/Cms.Item/Cms.Item.csproj @@ -0,0 +1,12 @@ + + + net5.0 + MyApp.Namespace + warnings + + + + + + + diff --git a/templates/Cms.Item/ContentComponent/.template.config/Icon.png b/templates/Cms.Item/ContentComponent/.template.config/Icon.png new file mode 100644 index 0000000..2d4fe7e Binary files /dev/null and b/templates/Cms.Item/ContentComponent/.template.config/Icon.png differ diff --git a/templates/Cms.Item/ContentComponent/.template.config/dotnetcli.host.json b/templates/Cms.Item/ContentComponent/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..1fbc8a9 --- /dev/null +++ b/templates/Cms.Item/ContentComponent/.template.config/dotnetcli.host.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "namespace": { + "longName": "namespace", + "shortName": "na" + }, + "contentType": { + "longName": "contentType", + "shortName": "ct" + } + } +} diff --git a/templates/Cms.Item/ContentComponent/.template.config/template.json b/templates/Cms.Item/ContentComponent/.template.config/template.json new file mode 100644 index 0000000..5facaed --- /dev/null +++ b/templates/Cms.Item/ContentComponent/.template.config/template.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Episerver AB", + "sourceName": "MyContentComponent", + "classifications": [ "Web" ], + "identity": "EPiServer.Templates.Cms.Item.ContentComponent", + "name": "Optimizely CMS Content Component", + "shortName": "epi-cms-contentcomponent", + "description": "Optimizely CMS Content Component", + "tags": { + "language": "C#", + "type": "item" + }, + "primaryOutputs": [ + { "path": "MyContentComponent.cs" } + ], + "symbols": { + "namespace": { + "type": "parameter", + "datatype": "string", + "defaultValue": "MyAppNamespace", + "displayName": "Namespace", + "description": "Namespace for the generated code.", + "replaces": "MyAppNamespace" + }, + "contentType": { + "type": "parameter", + "datatype": "string", + "defaultValue": "BlockData", + "replaces": "MyBlockData", + "displayName": "Content Type Model", + "description": "The Content Type model that the Content Component should handle." + } + } +} diff --git a/templates/Cms.Item/ContentComponent/MyContentComponent.cs b/templates/Cms.Item/ContentComponent/MyContentComponent.cs new file mode 100644 index 0000000..b6fdd4b --- /dev/null +++ b/templates/Cms.Item/ContentComponent/MyContentComponent.cs @@ -0,0 +1,14 @@ +using System; +using EPiServer.Web.Mvc; +using Microsoft.AspNetCore.Mvc; + +namespace MyAppNamespace +{ + public class MyContentComponent : PartialContentComponent + { + protected override IViewComponentResult InvokeComponent(MyBlockData currentContent) + { + return View(currentContent); + } + } +} diff --git a/templates/Cms.Item/ContentType/.template.config/Icon.png b/templates/Cms.Item/ContentType/.template.config/Icon.png new file mode 100644 index 0000000..87b10e9 Binary files /dev/null and b/templates/Cms.Item/ContentType/.template.config/Icon.png differ diff --git a/templates/Cms.Item/ContentType/.template.config/dotnetcli.host.json b/templates/Cms.Item/ContentType/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..fa7366b --- /dev/null +++ b/templates/Cms.Item/ContentType/.template.config/dotnetcli.host.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "namespace": { + "longName": "namespace", + "shortName": "na" + }, + "baseType": { + "longName": "basetype", + "shortName": "b" + } + } +} diff --git a/templates/Cms.Item/ContentType/.template.config/template.json b/templates/Cms.Item/ContentType/.template.config/template.json new file mode 100644 index 0000000..3e2a55c --- /dev/null +++ b/templates/Cms.Item/ContentType/.template.config/template.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Episerver AB", + "sourceName": "MyContentData", + "classifications": [ "Web" ], + "identity": "EPiServer.Templates.Cms.Item.ContentType", + "name": "Optimizely CMS Content Type Model", + "shortName": "epi-cms-contenttype", + "description": "Optimizely CMS Content Type model class", + "tags": { + "language": "C#", + "type": "item" + }, + "guids": [ + "CA56CED4-2CA9-4C5E-9EDE-2A5A6F1F06EF" + ], + "primaryOutputs": [ + { "path": "MyContentData.cs" } + ], + "symbols": { + "namespace": { + "type": "parameter", + "datatype": "string", + "defaultValue": "MyAppNamespace", + "displayName": "Namespace", + "description": "Namespace for the generated code.", + "replaces": "MyAppNamespace" + }, + "baseType": { + "type": "parameter", + "datatype": "string", + "defaultValue": "PageData", + "replaces": "PageData", + "displayName": "Base type", + "description": "The base type that the Content Type should inherit from. Can be PageData, BlockData or any other ContentData type." + } + } +} diff --git a/templates/Cms.Item/ContentType/MyContentData.cs b/templates/Cms.Item/ContentType/MyContentData.cs new file mode 100644 index 0000000..5440880 --- /dev/null +++ b/templates/Cms.Item/ContentType/MyContentData.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EPiServer.Core; +using EPiServer.DataAbstraction; +using EPiServer.DataAnnotations; + +namespace MyAppNamespace +{ + [ContentType( + DisplayName = "MyContentData", + GUID = "CA56CED4-2CA9-4C5E-9EDE-2A5A6F1F06EF", + Description = "")] + public class MyContentData : PageData + { + [CultureSpecific] + [Display( + Name = "MyProperty", + Description = "My property description", + GroupName = SystemTabNames.Content, + Order = 10)] + public virtual string MyProperty { get; set; } + } +} diff --git a/templates/Cms.Item/InitializationModule/.template.config/Icon.png b/templates/Cms.Item/InitializationModule/.template.config/Icon.png new file mode 100644 index 0000000..2d4fe7e Binary files /dev/null and b/templates/Cms.Item/InitializationModule/.template.config/Icon.png differ diff --git a/templates/Cms.Item/InitializationModule/.template.config/dotnetcli.host.json b/templates/Cms.Item/InitializationModule/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..27ca6bf --- /dev/null +++ b/templates/Cms.Item/InitializationModule/.template.config/dotnetcli.host.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "namespace": { + "longName": "namespace", + "shortName": "na" + }, + "configurable": { + "longName": "configurable", + "shortName": "c" + } + } +} diff --git a/templates/Cms.Item/InitializationModule/.template.config/template.json b/templates/Cms.Item/InitializationModule/.template.config/template.json new file mode 100644 index 0000000..e930723 --- /dev/null +++ b/templates/Cms.Item/InitializationModule/.template.config/template.json @@ -0,0 +1,34 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Episerver AB", + "sourceName": "MyInitializationModule", + "classifications": [ "Web" ], + "identity": "EPiServer.Templates.Cms.Item.InitializationModule", + "name": "Optimizely CMS Initialization Module", + "shortName": "epi-cms-initializationmodule", + "description": "Optimizely CMS Initialization Module", + "tags": { + "language": "C#", + "type": "item" + }, + "primaryOutputs": [ + { "path": "MyInitializationModule.cs" } + ], + "symbols": { + "namespace": { + "type": "parameter", + "datatype": "string", + "defaultValue": "MyAppNamespace", + "displayName": "Namespace", + "description": "Namespace for the generated code.", + "replaces": "MyAppNamespace" + }, + "configurable": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "displayName": "Configure services in module", + "description": "Indicates if the module should include a method for configuring services." + } + } +} diff --git a/templates/Cms.Item/InitializationModule/MyInitializationModule.cs b/templates/Cms.Item/InitializationModule/MyInitializationModule.cs new file mode 100644 index 0000000..811dae7 --- /dev/null +++ b/templates/Cms.Item/InitializationModule/MyInitializationModule.cs @@ -0,0 +1,35 @@ +using System; +using EPiServer.Framework; +using EPiServer.Framework.Initialization; +#if (configurable) +using EPiServer.ServiceLocation; +using Microsoft.Extensions.DependencyInjection; +#endif + +namespace MyAppNamespace +{ + [InitializableModule] + [ModuleDependency(typeof(EPiServer.Web.InitializationModule))] +#if (configurable) + public class MyInitializationModule : IConfigurableModule + { + public void ConfigureContainer(ServiceConfigurationContext context) + { + // Add services configurations to context.Services + } + +#else + public class MyInitializationModule : IInitializableModule + { +#endif + public void Initialize(InitializationEngine context) + { + // Add initialization logic, this method is called once after CMS has been initialized + } + + public void Uninitialize(InitializationEngine context) + { + // Add uninitialization logic + } + } +} diff --git a/templates/Cms.Item/Models.cs b/templates/Cms.Item/Models.cs new file mode 100644 index 0000000..48f1910 --- /dev/null +++ b/templates/Cms.Item/Models.cs @@ -0,0 +1,9 @@ +using EPiServer.Core; + +namespace MyAppNamespace +{ + // Classes used to represent PageData models that can be used + // to simplify replacement in templates + public class MyPageData : PageData { } + public class MyBlockData : BlockData { } +} diff --git a/templates/Cms.Item/PageController/.template.config/Icon.png b/templates/Cms.Item/PageController/.template.config/Icon.png new file mode 100644 index 0000000..2d4fe7e Binary files /dev/null and b/templates/Cms.Item/PageController/.template.config/Icon.png differ diff --git a/templates/Cms.Item/PageController/.template.config/dotnetcli.host.json b/templates/Cms.Item/PageController/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..1fbc8a9 --- /dev/null +++ b/templates/Cms.Item/PageController/.template.config/dotnetcli.host.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "namespace": { + "longName": "namespace", + "shortName": "na" + }, + "contentType": { + "longName": "contentType", + "shortName": "ct" + } + } +} diff --git a/templates/Cms.Item/PageController/.template.config/template.json b/templates/Cms.Item/PageController/.template.config/template.json new file mode 100644 index 0000000..6419eab --- /dev/null +++ b/templates/Cms.Item/PageController/.template.config/template.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Episerver AB", + "sourceName": "MyPageController", + "classifications": [ "Web" ], + "identity": "EPiServer.Templates.Cms.Item.PageController", + "name": "Optimizely CMS Page Controller", + "shortName": "epi-cms-pagecontroller", + "description": "Optimizely CMS Page Controller", + "tags": { + "language": "C#", + "type": "item" + }, + "primaryOutputs": [ + { "path": "MyPageController.cs" } + ], + "symbols": { + "namespace": { + "type": "parameter", + "datatype": "string", + "defaultValue": "MyAppNamespace", + "displayName": "Namespace", + "description": "Namespace for the generated code.", + "replaces": "MyAppNamespace" + }, + "contentType": { + "type": "parameter", + "datatype": "string", + "defaultValue": "PageData", + "replaces": "MyPageData", + "displayName": "Content Type Model", + "description": "The Content Type model that the Controller should handle." + } + } +} diff --git a/templates/Cms.Item/PageController/MyPageController.cs b/templates/Cms.Item/PageController/MyPageController.cs new file mode 100644 index 0000000..ccef8da --- /dev/null +++ b/templates/Cms.Item/PageController/MyPageController.cs @@ -0,0 +1,20 @@ +using System; +using EPiServer.Core; +using EPiServer.Framework.DataAnnotations; +using EPiServer.Web.Mvc; +using Microsoft.AspNetCore.Mvc; + +namespace MyAppNamespace +{ + [TemplateDescriptor(Inherited = true)] + public class MyPageController : PageController + { + public ActionResult Index(MyPageData currentPage) + { + // Implementation of action. You can create your own view model class that you pass to the view or + // you can pass the page type model directly for simpler templates + + return View(currentPage); + } + } +} diff --git a/templates/Cms.Item/Program.cs b/templates/Cms.Item/Program.cs new file mode 100644 index 0000000..3c97107 --- /dev/null +++ b/templates/Cms.Item/Program.cs @@ -0,0 +1,7 @@ +namespace MyAppNamespace +{ + public class Program + { + public static void Main() { } + } +} diff --git a/templates/Cms.Item/RazorPage/.template.config/Icon.png b/templates/Cms.Item/RazorPage/.template.config/Icon.png new file mode 100644 index 0000000..2d4fe7e Binary files /dev/null and b/templates/Cms.Item/RazorPage/.template.config/Icon.png differ diff --git a/templates/Cms.Item/RazorPage/.template.config/dotnetcli.host.json b/templates/Cms.Item/RazorPage/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..1fbc8a9 --- /dev/null +++ b/templates/Cms.Item/RazorPage/.template.config/dotnetcli.host.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "namespace": { + "longName": "namespace", + "shortName": "na" + }, + "contentType": { + "longName": "contentType", + "shortName": "ct" + } + } +} diff --git a/templates/Cms.Item/RazorPage/.template.config/template.json b/templates/Cms.Item/RazorPage/.template.config/template.json new file mode 100644 index 0000000..248cf8b --- /dev/null +++ b/templates/Cms.Item/RazorPage/.template.config/template.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Episerver AB", + "sourceName": "MyRazorPage", + "classifications": [ "Web" ], + "identity": "EPiServer.Templates.Cms.Item.RazorPage", + "name": "Optimizely CMS Razor Page", + "shortName": "epi-cms-razorpage", + "description": "Optimizely CMS Razor Page", + "tags": { + "language": "C#", + "type": "item" + }, + "primaryOutputs": [ + { "path": "MyRazorPage.cshtml" }, + { "path": "MyRazorPage.cshtml.cs" } + ], + "symbols": { + "namespace": { + "type": "parameter", + "datatype": "string", + "defaultValue": "MyAppNamespace", + "displayName": "Namespace", + "description": "Namespace for the generated code.", + "replaces": "MyAppNamespace" + }, + "contentType": { + "type": "parameter", + "datatype": "string", + "defaultValue": "PageData", + "replaces": "MyPageData", + "displayName": "Content Type Model", + "description": "The Content Type model that the Razor Page should handle." + } + } +} diff --git a/templates/Cms.Item/RazorPage/MyRazorPage.cshtml b/templates/Cms.Item/RazorPage/MyRazorPage.cshtml new file mode 100644 index 0000000..a3f8c6f --- /dev/null +++ b/templates/Cms.Item/RazorPage/MyRazorPage.cshtml @@ -0,0 +1,11 @@ +@page +@model MyAppNamespace.MyRazorPageModel +@using EPiServer.Web.Mvc.Html +@{ +} + +@{/* +
+ @Html.PropertyFor(m => m.CurrentContent.MainBody) +
+*/} diff --git a/templates/Cms.Item/RazorPage/MyRazorPage.cshtml.cs b/templates/Cms.Item/RazorPage/MyRazorPage.cshtml.cs new file mode 100644 index 0000000..4d3ef88 --- /dev/null +++ b/templates/Cms.Item/RazorPage/MyRazorPage.cshtml.cs @@ -0,0 +1,13 @@ +using System; +using EPiServer.Core; +using EPiServer.Web.Mvc; + +namespace MyAppNamespace +{ + public class MyRazorPageModel : RazorPageModel + { + public void OnGet() + { + } + } +} diff --git a/templates/Cms.Item/ScheduledJob/.template.config/Icon.png b/templates/Cms.Item/ScheduledJob/.template.config/Icon.png new file mode 100644 index 0000000..2d4fe7e Binary files /dev/null and b/templates/Cms.Item/ScheduledJob/.template.config/Icon.png differ diff --git a/templates/Cms.Item/ScheduledJob/.template.config/dotnetcli.host.json b/templates/Cms.Item/ScheduledJob/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..d9b0d37 --- /dev/null +++ b/templates/Cms.Item/ScheduledJob/.template.config/dotnetcli.host.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "namespace": { + "longName": "namespace", + "shortName": "na" + } + } +} diff --git a/templates/Cms.Item/ScheduledJob/.template.config/template.json b/templates/Cms.Item/ScheduledJob/.template.config/template.json new file mode 100644 index 0000000..c17bd2a --- /dev/null +++ b/templates/Cms.Item/ScheduledJob/.template.config/template.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Episerver AB", + "sourceName": "MyScheduledJob", + "classifications": [ "Web" ], + "identity": "EPiServer.Templates.Cms.Item.ScheduledJob", + "name": "Optimizely CMS Scheduled Job", + "shortName": "epi-cms-job", + "description": "Optimizely CMS Scheduled Job", + "tags": { + "language": "C#", + "type": "item" + }, + "guids": [ + "3F7881B2-2451-4941-BB7C-5FAB9A6A799F" + ], + "primaryOutputs": [ + { "path": "MyScheduledJob.cs" } + ], + "symbols": { + "namespace": { + "type": "parameter", + "datatype": "string", + "defaultValue": "MyAppNamespace", + "displayName": "Namespace", + "description": "Namespace for the generated code.", + "replaces": "MyAppNamespace" + } + } +} diff --git a/templates/Cms.Item/ScheduledJob/MyScheduledJob.cs b/templates/Cms.Item/ScheduledJob/MyScheduledJob.cs new file mode 100644 index 0000000..5806da0 --- /dev/null +++ b/templates/Cms.Item/ScheduledJob/MyScheduledJob.cs @@ -0,0 +1,53 @@ +using System; +using EPiServer.DataAbstraction; +using EPiServer.PlugIn; +using EPiServer.Scheduler; + +namespace MyAppNamespace +{ + [ScheduledPlugIn( + DisplayName = "MyScheduledJob", + Description = "", + GUID = "3F7881B2-2451-4941-BB7C-5FAB9A6A799F", + IntervalType = ScheduledIntervalType.Hours, + IntervalLength = 12, + DefaultEnabled = true, + Restartable = true)] + public class MyScheduledJob : ScheduledJobBase + { + private bool _stopSignaled; + + public MyScheduledJob() + { + IsStoppable = true; + } + + /// + /// Called when a scheduled job executes + /// + /// A status message to be stored in the database log and visible from admin mode + public override string Execute() + { + //Call OnStatusChanged to periodically notify progress of job for manually started jobs + OnStatusChanged(String.Format("Starting execution of {0}", this.GetType())); + + //Add implementation + + //For long running jobs periodically check if stop is signaled and if so stop execution + if (_stopSignaled) + { + return "Stop of job was called"; + } + + return "Change to message that describes outcome of execution"; + } + + /// + /// Called when a user clicks on Stop for a manually started job, or when ASP.NET shuts down. + /// + public override void Stop() + { + _stopSignaled = true; + } + } +} diff --git a/templates/Commerce.Empty/.template.config/dotnetcli.host.json b/templates/Commerce.Empty/.template.config/dotnetcli.host.json index 4718119..a53ef73 100644 --- a/templates/Commerce.Empty/.template.config/dotnetcli.host.json +++ b/templates/Commerce.Empty/.template.config/dotnetcli.host.json @@ -1,6 +1,6 @@ { "symbolInfo": { - "enablelDocker": { + "enableDocker": { "longName": "enable-docker", "shortName": "" }, diff --git a/templates/Commerce.Empty/.template.config/template.json b/templates/Commerce.Empty/.template.config/template.json index 210d198..c24d0ff 100644 --- a/templates/Commerce.Empty/.template.config/template.json +++ b/templates/Commerce.Empty/.template.config/template.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/template", "author": "Episerver AB", - "sourceName": "Commerce.Empty", + "sourceName": "Commerce.1", "classifications": [ "Web" ], "identity": "EPiServer.Templates.Commerce.Empty", "name": "Optimizely Commerce empty", @@ -15,7 +15,7 @@ { "modifiers": [ { - "condition": "(!enablelDocker)", + "condition": "(!enableDocker)", "exclude": [ "Directory.Build.props", "docker-compose.yml", @@ -26,7 +26,7 @@ } ], "symbols": { - "enablelDocker": { + "enableDocker": { "type": "parameter", "datatype": "bool", "defaultValue": "false", diff --git a/templates/Commerce.Empty/App_Data/Commerce.Empty.Commerce.mdf b/templates/Commerce.Empty/App_Data/Commerce.1.Commerce.mdf similarity index 100% rename from templates/Commerce.Empty/App_Data/Commerce.Empty.Commerce.mdf rename to templates/Commerce.Empty/App_Data/Commerce.1.Commerce.mdf diff --git a/templates/Commerce.Empty/App_Data/Commerce.Empty.mdf b/templates/Commerce.Empty/App_Data/Commerce.1.mdf similarity index 100% rename from templates/Commerce.Empty/App_Data/Commerce.Empty.mdf rename to templates/Commerce.Empty/App_Data/Commerce.1.mdf diff --git a/templates/Commerce.Empty/Commerce.Empty.csproj b/templates/Commerce.Empty/Commerce.1.csproj similarity index 87% rename from templates/Commerce.Empty/Commerce.Empty.csproj rename to templates/Commerce.Empty/Commerce.1.csproj index ec99935..44233b4 100644 --- a/templates/Commerce.Empty/Commerce.Empty.csproj +++ b/templates/Commerce.Empty/Commerce.1.csproj @@ -5,7 +5,7 @@ - + diff --git a/templates/Commerce.Empty/Docker/create-db.sh b/templates/Commerce.Empty/Docker/create-db.sh index 1f6a72a..689b775 100644 --- a/templates/Commerce.Empty/Docker/create-db.sh +++ b/templates/Commerce.Empty/Docker/create-db.sh @@ -1,6 +1,6 @@ #!/bin/bash -for i in {1..50}; do +for i in {1..100}; do /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '${DB_NAME}') CREATE DATABASE ${DB_NAME} ON (NAME=${DB_NAME}_data, FILENAME='/var/opt/mssql/host_data/${DB_NAME}.mdf') LOG ON (NAME=${DB_NAME}_log, FILENAME='/var/opt/mssql/host_data/${DB_NAME}.ldf')" /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '${DB_NAME_COMMERCE}') CREATE DATABASE ${DB_NAME_COMMERCE} ON (NAME=${DB_NAME_COMMERCE}_data, FILENAME='/var/opt/mssql/host_data/${DB_NAME_COMMERCE}.mdf') LOG ON (NAME=${DB_NAME_COMMERCE}_log, FILENAME='/var/opt/mssql/host_data/${DB_NAME_COMMERCE}.ldf')" if [ $? -eq 0 ]; then diff --git a/templates/Commerce.Empty/Docker/web.dockerfile b/templates/Commerce.Empty/Docker/web.dockerfile index 3fb9f47..0f7ac3e 100644 --- a/templates/Commerce.Empty/Docker/web.dockerfile +++ b/templates/Commerce.Empty/Docker/web.dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/dotnet/sdk:5.0 WORKDIR /src #Restore NuGet packages so they are cached when we start the container -COPY ./Commerce.Empty.csproj . +COPY ./Commerce.1.csproj . COPY ./Directory.Build.props . COPY ./nuget.config . diff --git a/templates/Commerce.Empty/Program.cs b/templates/Commerce.Empty/Program.cs index b127a16..d06cecd 100644 --- a/templates/Commerce.Empty/Program.cs +++ b/templates/Commerce.Empty/Program.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; -namespace Commerce.Empty +namespace Commerce._1 { public class Program { diff --git a/templates/Commerce.Empty/Properties/launchSettings.json b/templates/Commerce.Empty/Properties/launchSettings.json index dc0cdfd..05599fb 100644 --- a/templates/Commerce.Empty/Properties/launchSettings.json +++ b/templates/Commerce.Empty/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "Commerce.Empty": { + "Commerce.1": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:5000/", diff --git a/templates/Commerce.Empty/Startup.cs b/templates/Commerce.Empty/Startup.cs index c6af7a5..9c214f2 100644 --- a/templates/Commerce.Empty/Startup.cs +++ b/templates/Commerce.Empty/Startup.cs @@ -11,7 +11,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -namespace Commerce.Empty +namespace Commerce._1 { public class Startup { diff --git a/templates/Commerce.Empty/appsettings.Development.json b/templates/Commerce.Empty/appsettings.Development.json index 7b1f572..1991df1 100644 --- a/templates/Commerce.Empty/appsettings.Development.json +++ b/templates/Commerce.Empty/appsettings.Development.json @@ -8,8 +8,8 @@ } }, "ConnectionStrings": { - "EcfSqlConnection": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Commerce.Empty.Commerce.mdf;Initial Catalog=Commerce.Empty.Commerce;Integrated Security=True;Connect Timeout=30", - "EPiServerDB": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Commerce.Empty.mdf;Initial Catalog=Commerce.Empty;Integrated Security=True;Connect Timeout=30" + "EcfSqlConnection": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Commerce.1.Commerce.mdf;Initial Catalog=Commerce.1.Commerce;Integrated Security=True;Connect Timeout=30", + "EPiServerDB": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Commerce.1.mdf;Initial Catalog=Commerce.1;Integrated Security=True;Connect Timeout=30" }, "EPiServer": { "Cms": { @@ -27,10 +27,13 @@ "CatalogManagers": { "MappedRoles": [ "WebAdmins" ] }, + "CustomerServiceRepresentatives": { + "MappedRoles": [ "WebAdmins" ] + }, "MarketingManagers": { "MappedRoles": [ "WebAdmins" ] }, - "CustomerServiceRepresentatives": { + "OrderManagers": { "MappedRoles": [ "WebAdmins" ] }, "ReportManagers": { diff --git a/templates/Commerce.Empty/docker-compose.yml b/templates/Commerce.Empty/docker-compose.yml index 4475447..40de906 100644 --- a/templates/Commerce.Empty/docker-compose.yml +++ b/templates/Commerce.Empty/docker-compose.yml @@ -13,7 +13,7 @@ services: - 6000:1433 volumes: - ./App_Data:/var/opt/mssql/host_data - image: Commerce.Empty/db + image: Commerce.1/db web: depends_on: - db @@ -29,4 +29,5 @@ services: - 5000:80 volumes: - .:/src - image: Commerce.Empty/web + image: Commerce.1/web + restart: on-failure diff --git a/templates/Commerce.Empty/nuget.config b/templates/Commerce.Empty/nuget.config index 287e902..79187e1 100644 --- a/templates/Commerce.Empty/nuget.config +++ b/templates/Commerce.Empty/nuget.config @@ -3,6 +3,6 @@ - + diff --git a/templates/EPiServer.Templates.csproj b/templates/EPiServer.Templates.csproj index d2de7b4..ef46ef2 100644 --- a/templates/EPiServer.Templates.csproj +++ b/templates/EPiServer.Templates.csproj @@ -15,8 +15,11 @@ EPiServer.Templates icon.png Template + Apache-2.0 $(PackageTags);dotnet-new;templates;Episerver;Optimizely https://github.com/episerver/content-templates + $(PackageProjectUrl).git + git Optimizely Digital Experience Platform Templates for the Optimizely Digital Experience Cloud Episerver AB @@ -26,6 +29,7 @@ + @@ -44,6 +48,6 @@ + Exclude="EPiServer.Templates.csproj;Cms.Item\*.*;**\bin\**;**\obj\**;**\modules\**;**\*.user" />