Skip to content

Commit

Permalink
Templates 13.1 Messages for upgrade command (#68)
Browse files Browse the repository at this point in the history
* Added templates for 13.1

* Fixed typo in the upgrade warning message. Added message for "rebuild" after a succesful upgrade

* FIxed reference for Telerik.Sitefinity and Telerik.Sitefinity.Services.Events in the .csproj template
  • Loading branch information
RuzmanovDev authored Sep 8, 2020
1 parent 068c44f commit 5ea80a0
Show file tree
Hide file tree
Showing 192 changed files with 31,427 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sitefinity CLI/Commands/UpgradeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private async Task ExecuteUpgrade()

this.SyncProjectReferencesWithPackages(sitefinityProjectFilePaths, Path.GetDirectoryName(this.SolutionPath));

this.logger.LogInformation(string.Format("Successfully updated '{0}' to version '{1}'", this.SolutionPath, this.Version));
this.logger.LogInformation(string.Format(Constants.UpgradeSuccessMessage, this.SolutionPath, this.Version));
}

private IEnumerable<string> GetNugetPackageSources()
Expand Down
3 changes: 2 additions & 1 deletion Sitefinity CLI/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public class Constants
public const string SolutionNotReadable = "Unable to read solution";
public const string NoProjectsFoundToUpgradeWarningMessage = "No projects with Sitefinity references found to upgrade.";
public const string AcceptLicenseNotification = "Do you accept the terms and conditions";
public const string UpgradeWarning = "Make sure to have your project under source controll. Currently there is no revert mechanism in the upgrade tool. The upgrade will launch visual studio instanse in order to execute nuget upgrade. DO NOT CLOSE the opened visual studio. This will stop the upgrade. Do you want to continue?";
public const string UpgradeWarning = "Make sure to have your project under source control. Currently there is no revert mechanism in the upgrade tool. The upgrade will launch visual studio instanse in order to execute nuget upgrade. DO NOT CLOSE the opened visual studio. This will stop the upgrade. Do you want to continue?";
public const string UpgradeSuccessMessage = "Successfully updated '{0}' to version '{1}'. Make sure to REBUILD your solution before starting up the site!";

// Success messages
public const string ConfigFileCreatedMessage = "Configuration file created successfully! Path: \"{0}\"";
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.12</AssemblyVersion>
<AssemblyVersion>1.1.0.13</AssemblyVersion>
<Version>1.1.0</Version>
<FileVersion>1.1.0.12</FileVersion>
<FileVersion>1.1.0.13</FileVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
</PropertyGroup>
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/13.1/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/13.1/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/13.1/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 Telerik.WebTestRunner.Server.Attributes;

// 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 © 2020")]
[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: IntegrationTests]
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* {{> sign}} */

using MbUnit.Framework;
using System;

namespace {{pascalCaseName}}
{
/// <summary>
/// Represents sample integration tests class to demonstrate the usage of some attributes.
/// For more information on creating and running integration tests with Sitefinity CMS web test runner see the Sitefinity documentation: https://www.progress.com/documentation/sitefinity-cms/tutorial-create-integration-tests-with-sitefinity-web-test-runner
/// For sample integration tests see this project in the Sitefinity GitHub repo: https://github.com/Sitefinity/Telerik.Sitefinity.Samples.IntegrationTests
/// For more information on the integration tests infrastructure and framework see the MbUnit documentation: http://www.gallio.org/doku-id-mbunit-documentation/
/// </summary>
[TestFixture]
[Description("Integration tests project")]
[Author(TestAuthors.SitefinityCLI)]
public class DemoTests
{
/// <summary>
/// This method is invoked once prior to executing any tests in the fixture.
/// </summary>
[FixtureSetUp]
public void FixtureSetUp()
{
throw new NotImplementedException();
}

/// <summary>
/// This method is invoked once after all tests in the fixture have been executed.
/// </summary>
[FixtureTearDown]
public void FixtureTearDown()
{
throw new NotImplementedException();
}

/// <summary>
/// This method is invoked just before each test method is executed.
/// </summary>
[SetUp]
public void SetUp()
{
throw new NotImplementedException();
}

/// <summary>
/// This method is invoked after each test method.
/// </summary>
public void TearDown()
{
throw new NotImplementedException();
}

/// <summary>
/// Write your integration test
/// </summary>
[Test]
[Category(TestCategories.Demo)]
[Description("Write your integration test")]
[Author(TestAuthors.SitefinityCLI)]
public void Test()
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* {{> sign}} */

namespace {{pascalCaseName}}
{
internal class TestAuthors
{
public const string SitefinityCLI = "Sitefinity CLI";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* {{> sign}} */

using MbUnit.Framework;

namespace {{pascalCaseName}}
{
public class TestCategories
{
public const string Demo = "Demo";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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.7.2</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="Gallio, Version=3.4.0.0, Culture=neutral, PublicKeyToken=eb9cfa67ee6ab36e, processorArchitecture=MSIL">
<HintPath>..\packages\Sitefinity.Gallio_MbUnit.3.4.11.0\lib\net40\Gallio.dll</HintPath>
</Reference>
<Reference Include="MbUnit, Version=3.4.0.0, Culture=neutral, PublicKeyToken=eb9cfa67ee6ab36e, processorArchitecture=MSIL">
<HintPath>..\packages\Sitefinity.Gallio_MbUnit.3.4.11.0\lib\net40\MbUnit.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.WebTestRunner.Server, Version=2.0.0.1, Culture=neutral, PublicKeyToken=b28c218413bdf563, processorArchitecture=MSIL">
<HintPath>..\packages\Telerik.Sitefinity.WebTestRunner.Server.2.0.0.1\lib\net40\Telerik.WebTestRunner.Server.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Sitefinity.Gallio_MbUnit" version="3.4.11.0" targetFramework="net472" />
<package id="Telerik.Sitefinity.WebTestRunner.Server" version="2.0.0.1" targetFramework="net472" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"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": "TestAuthors.cs",
"TemplatePath": "TestAuthors.Template"
},
{
"FilePath": "TestCategories.cs",
"TemplatePath": "TestCategories.Template"
}
]
37 changes: 37 additions & 0 deletions Sitefinity CLI/Templates/13.1/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 © 2020")]
[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 5ea80a0

Please sign in to comment.