Skip to content

Commit

Permalink
Templates for Sitefinity 14.3 (#202)
Browse files Browse the repository at this point in the history
* Added templates folder for 14.3. Update Integration tests templates for MSTest v2 framework.

* bootstrap 4 and 5 templates updated

* changed default password

* Bump version to 1.1.0.31

* Fixed integration tests docuemntation for 14.3

Co-authored-by: Stoyan Dimitrov <[email protected]>
  • Loading branch information
RuzmanovDev and sdimitrov89 authored Nov 9, 2022
1 parent 2abd0c3 commit b5c6d47
Show file tree
Hide file tree
Showing 335 changed files with 55,219 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Sitefinity CLI/Commands/AddToSolutionCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ protected override int CreateFileFromTemplate(string filePath, string templatePa
dictionary["binFolder"] = this.BinFolder;
dictionary["projectGuid"] = this.ProjectGuid.ToString();
dictionary["sitefinityVersion"] = this.SitefinityVersion;
dictionary["sitefinityNugetVersion"] = this.SitefinityVersion.EndsWith(".0") ? this.SitefinityVersion.Remove(this.SitefinityVersion.LastIndexOf("."), 2) : this.SitefinityVersion;
}
else
{
Expand Down Expand Up @@ -125,7 +126,7 @@ public override int OnExecute(CommandLineApplication config)

Utils.WriteLine(string.Format(Constants.AddFilesToSolutionSuccessMessage, project), ConsoleColor.Green);
}
catch(Exception ex)
catch (Exception ex)
{
Utils.WriteLine(ex.Message, ConsoleColor.Yellow);
}
Expand Down
4 changes: 2 additions & 2 deletions Sitefinity CLI/Sitefinity CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyName>sf</AssemblyName>
<RootNamespace>Sitefinity_CLI</RootNamespace>
<AssemblyVersion>1.1.0.30</AssemblyVersion>
<AssemblyVersion>1.1.0.31</AssemblyVersion>
<Version>1.1.0</Version>
<FileVersion>1.1.0.30</FileVersion>
<FileVersion>1.1.0.31</FileVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* {{> sign}} */

using {{projectDefaultNamespace}}.Mvc.Models;
using System.Web.Mvc;
using Telerik.Sitefinity.Mvc;
using Telerik.Sitefinity.Personalization;

namespace {{projectDefaultNamespace}}.Mvc.Controllers
{
[ControllerToolboxItem(Name = "{{pascalCaseName}}_MVC", Title = "{{name}}", SectionName = "CustomWidgets")]
public class {{pascalCaseName}}Controller : Controller, IPersonalizable
{
// GET: {{name}}
public ActionResult Index()
{
var model = new {{pascalCaseName}}Model();
model.Message = this.Message;
return View(model);
}

protected override void HandleUnknownAction(string actionName)
{
this.ActionInvoker.InvokeAction(this.ControllerContext, "Index");
}

public string Message { get; set; }
}
}
12 changes: 12 additions & 0 deletions Sitefinity CLI/Templates/14.3/CustomWidget/Default/Model.Template
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* {{> sign}} */

using System.Web.Mvc;
using Telerik.Sitefinity.Mvc;

namespace {{projectDefaultNamespace}}.Mvc.Models
{
public class {{pascalCaseName}}Model
{
public string Message { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@* {{> sign}} *@

@model {{projectDefaultNamespace}}.Mvc.Models.{{pascalCaseName}}Model
<div>
@Model.Message
</div>
14 changes: 14 additions & 0 deletions Sitefinity CLI/Templates/14.3/CustomWidget/Default/templates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"FilePath": "Controllers\\{0}Controller.cs",
"TemplatePath": "Controller.Template"
},
{
"FilePath": "Models\\{0}Model.cs",
"TemplatePath": "Model.Template"
},
{
"FilePath": "Views\\{0}\\Index.cshtml",
"TemplatePath": "View.Template"
}
]
8 changes: 8 additions & 0 deletions Sitefinity CLI/Templates/14.3/GridWidget/grid-6+6.Template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- {{> sign}} -->

<div class="row" data-sf-element="Row">
<div class="sf_colsIn col-lg-6" data-sf-element="Column 1" data-placeholder-label="Column 1">
</div>
<div class="sf_colsIn col-lg-6" data-sf-element="Column 2" data-placeholder-label="Column 2">
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.TestTools.UnitTesting;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("{{pascalCaseName}}")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SitefinityWebApp.Tests.Integration")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("{{projectGuid}}")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ClassCleanupExecution(ClassCleanupBehavior.EndOfClass)]
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* {{> sign}} */

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Telerik.Sitefinity.TestIntegration.Framework.MSTest;

namespace {{pascalCaseName}}
{
/// <summary>
/// Represents sample integration tests class to demonstrate the usage of some attributes.
/// For sample integration tests see this project in the Sitefinity GitHub repo: https://github.com/Sitefinity/Telerik.Sitefinity.Samples.IntegrationTests
/// </summary>
[TestClass]
public class DemoTests : SitefinityIntegrationTestsBase
{
/// <summary>
/// This method is invoked once prior to executing any tests in the test class.
/// </summary>
public override void ClassInitialize()
{
base.ClassInitialize();
}

/// <summary>
/// This method is invoked once after all tests in the test class have been executed.
/// </summary>
public override void ClassCleanup()
{
base.ClassCleanup();
}

/// <summary>
/// This method is invoked just before each test method is executed.
/// </summary>
public override void TestInitialize()
{
base.TestInitialize();
}

/// <summary>
/// This method is invoked after each test method.
/// </summary>
public override void TestCleanup()
{
base.TestCleanup();
}

/// <summary>
/// Write your integration test
/// </summary>
[SitefinityIntegrationTest]
[TestCategory("Demo")]
[Owner("Sitefinity CLI")]
[Description("Write your integration test")]
public void Test()
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"SitefinityUrl": "http://localhost",
"SitefinityClientId": "sftestrunner",
"SitefinityClientSecret": "secret",
"Username": "[email protected]",
"Password": "admin!23",
"TestExecutionTimeout": "00:05:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ {{~projectGuid~}} }</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>{{pascalCaseName}}</RootNamespace>
<AssemblyName>{{pascalCaseName}}</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>{{binFolder}}</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>{{binFolder}}</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="IdentityModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b28c218413bdf563, processorArchitecture=MSIL">
<HintPath>..\packages\Progress.Sitefinity.IdentityModel.1.3.0\lib\net45\IdentityModel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Http, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Http.1.0.0.0\lib\Microsoft.Http.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Http.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Http.Extensions.1.0.0.0\lib\net40\Microsoft.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Telerik.Sitefinity.HttpClientCore, Version=3.0.1.0, Culture=neutral, PublicKeyToken=b28c218413bdf563, processorArchitecture=MSIL">
<HintPath>..\packages\Telerik.Sitefinity.HttpClientCore.3.0.1\lib\net45\Telerik.Sitefinity.HttpClientCore.dll</HintPath>
</Reference>
<Reference Include="Telerik.Sitefinity.TestIntegration.Framework, Version={{sitefinityVersion}}, Culture=neutral, PublicKeyToken=b28c218413bdf563, processorArchitecture=MSIL">
<HintPath>..\packages\Progress.Sitefinity.TestIntegration.Framework.{{sitefinityNugetVersion}}\lib\net48\Telerik.Sitefinity.TestIntegration.Framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="IntegrationTestsSettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Http" version="1.0.0.0" targetFramework="net48" />
<package id="Microsoft.Http.Extensions" version="1.0.0.0" targetFramework="net48" />
<package id="MSTest.TestAdapter" version="2.2.10" targetFramework="net48" />
<package id="MSTest.TestFramework" version="2.2.10" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="Progress.Sitefinity.IdentityModel" version="1.3.0" targetFramework="net48" />
<package id="Progress.Sitefinity.TestIntegration.Framework" version="{{sitefinityNugetVersion}}" targetFramework="net48" />
<package id="Telerik.Sitefinity.HttpClientCore" version="3.0.1" targetFramework="net48" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"FilePath": "Properties\\AssemblyInfo.cs",
"TemplatePath": "AssemblyInfo.Template"
},
{
"FilePath": "{0}.csproj",
"TemplatePath": "csproj.Template"
},
{
"FilePath": "DemoTests.cs",
"TemplatePath": "DemoTests.Template"
},
{
"FilePath": "packages.config",
"TemplatePath": "packages.config.Template"
},
{
"FilePath": "IntegrationTestsSettings.json",
"TemplatePath": "IntegrationTestsSettings.json.Template"
}
]
37 changes: 37 additions & 0 deletions Sitefinity CLI/Templates/14.3/Module/Default/AssemblyInfo.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using {{pascalCaseName}};
using System.Reflection;
using System.Runtime.InteropServices;
using Telerik.Sitefinity.Services;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("{{pascalCaseName}}")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("{{pascalCaseName}}")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("{{projectGuid}}")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit b5c6d47

Please sign in to comment.