@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" />