Skip to content

Commit

Permalink
Release v.12.2.7200.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SFBuild committed Nov 7, 2019
1 parent 1a56afc commit d0d7180
Show file tree
Hide file tree
Showing 68 changed files with 3,609 additions and 1,755 deletions.
Binary file modified AssemblyInfoShare/SharedAssemblyInfo.cs
Binary file not shown.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -3,6 +3,12 @@ The Feather Project

This repository contains the core infrastructure related to [Project Feather](http://projectfeather.sitefinity.com).


| Test | Status |
|----|----|
| Unit | [![Build Status](https://feather-ci.sitefinity.com/buildStatus/icon?job=Master_FeatherUnitTests)](https://feather-ci.sitefinity.com/job/Master_FeatherUnitTests/) |
| Integration | [![Build Status](https://feather-ci.sitefinity.com/buildStatus/icon?job=Master_FeatherIntegrationTests)](https://feather-ci.sitefinity.com/job/Master_FeatherIntegrationTests/) |

# Related Repositories

[feather-widgets](https://github.com/Sitefinity/feather-widgets) - This repository contains custom MVC widgets which are part of the Feather project.
Expand All @@ -13,8 +19,6 @@ This repository contains the core infrastructure related to [Project Feather](ht

# Sitefinity compatibility

Since Sitefinity 10.2.6602.0 this project is included along with the standard Sitefinity distribution.

| Feather version | Sitefinity version |
|----|----|
| v.1.9.800.0 - latest | 10.0.6400.0 to 10.0.9999 |
Expand Down
Expand Up @@ -86,15 +86,15 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Telerik.Sitefinity.Model">
<HintPath>..\packages\Telerik.Sitefinity.Core.12.0.7000\lib\net472\Telerik.Sitefinity.Model.dll</HintPath>
<HintPath>..\packages\Telerik.Sitefinity.Core.12.2.7200\lib\net472\Telerik.Sitefinity.Model.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Sitefinity">
<HintPath>..\packages\Telerik.Sitefinity.Core.12.0.7000\lib\net472\Telerik.Sitefinity.dll</HintPath>
<HintPath>..\packages\Telerik.Sitefinity.Core.12.2.7200\lib\net472\Telerik.Sitefinity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Sitefinity.Utilities">
<HintPath>..\packages\Telerik.Sitefinity.Core.12.0.7000\lib\net472\Telerik.Sitefinity.Utilities.dll</HintPath>
<HintPath>..\packages\Telerik.Sitefinity.Core.12.2.7200\lib\net472\Telerik.Sitefinity.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Telerik.Sitefinity.Frontend.Data/packages.config
Expand Up @@ -2,5 +2,5 @@
<packages>
<package id="Telerik.DataAccess.Core" version="2018.0.1127.1" targetFramework="net471" />
<package id="Telerik.DataAccess.Fluent" version="2018.0.1127.1" targetFramework="net471" developmentDependency="true" />
<package id="Telerik.Sitefinity.Core" version="12.0.7000" targetFramework="net45" />
<package id="Telerik.Sitefinity.Core" version="12.2.7200" targetFramework="net45" />
</packages>
46 changes: 46 additions & 0 deletions Telerik.Sitefinity.Frontend/Designers/DesignerResolver.cs
@@ -1,8 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.Mvc;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Frontend.Mvc.Helpers;
using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers;
using Telerik.Sitefinity.Frontend.Resources;
using Telerik.Sitefinity.Mvc;
using Telerik.Sitefinity.Mvc.Proxy;
using Telerik.Sitefinity.Web.UI.ControlDesign;

namespace Telerik.Sitefinity.Frontend.Designers
Expand Down Expand Up @@ -47,6 +53,44 @@ public string GetUrl(Type widgetType)
return this.packageManager.EnhanceUrl(designerUrl);
}

/// <summary>
/// Checks if there are separate custom desiger views for the particular control type.
/// </summary>
/// <param name="controlType">The type of the control.</param>
/// <returns></returns>
public bool HasCustomDesigners(string controlType)
{
var mvcProxy = new MvcControllerProxy();
mvcProxy.ControllerName = controlType;
var controller = mvcProxy.GetController() as Controller;

if (controller == null)
return true;

var designerNamePattern = "DesignerView.*";
var views = controller.GetViews(null).Where(view => Regex.IsMatch(view, designerNamePattern));

return views.Count() > 0;
}

/// <summary>
/// Gets all view names that match a pattern.
/// </summary>
/// <param name="controlType">The control type.</param>
/// <param name="viewNamePattern">The view name pattern</param>
/// <returns></returns>
public IEnumerable<string> GetViewNames(string controlType, string viewNamePattern)
{
var mvcProxy = new MvcControllerProxy();
mvcProxy.ControllerName = controlType;
var controller = mvcProxy.GetController() as Controller;

if (controller == null)
return new List<string>();

return ViewSelectorHelpers.GetViewNames(null, controller, viewNamePattern);
}

#endregion

#region Private members
Expand Down Expand Up @@ -116,6 +160,8 @@ private string GetDefaultUrl(Type widgetType)
private const string DefaultGridActionUrlTemplate = "~/Telerik.Sitefinity.Frontend/GridDesigner/Master/GridDesigner";
private readonly PackageManager packageManager;

public object ViewSelectorHelper { get; private set; }

#endregion
}
}
65 changes: 64 additions & 1 deletion Telerik.Sitefinity.Frontend/FeatherConfig.cs
Expand Up @@ -21,7 +21,7 @@ public class FeatherConfig : ConfigSection
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Precompilation")]
[ConfigurationProperty("disablePrecompilation")]
[ObjectInfo(typeof(InfrastructureResources), Title = "DisablePrecompilationCaption", Description = "DisablePrecompilationDescription")]
public bool DisablePrecompilation
public bool DisablePrecompilation
{
get
{
Expand Down Expand Up @@ -75,5 +75,68 @@ public bool LogPrecompiledViewUsage
this["logPrecompiledViewUsage"] = value;
}
}

/// <summary>
/// Gets or sets a value indicating whether to require parameter naming in the widget routings.
/// </summary>
/// <value>
/// <c>true</c> if the routes will work only with named params (e.g /tag/london/page/2); otherwise, <c>false</c> when the route will be /london/2.
/// </value>
[ConfigurationProperty("useNamedParametersRouting")]
[ObjectInfo(typeof(InfrastructureResources), Title = "UseNamedParametersRoutingCaption", Description = "UseNamedParametersRoutingDescription")]
public bool UseNamedParametersRouting
{
get
{
return (bool)this["useNamedParametersRouting"];
}

set
{
this["useNamedParametersRouting"] = value;
}
}

/// <summary>
/// Gets or sets a value indicating whether cached controller assemblies to be used
/// </summary>
/// <value>
/// <c>true</c> if the cached controller assemblies are used; otherwise, <c>false</c>
/// </value>
[ConfigurationProperty("useCachedControllerContainerAssemblies", DefaultValue = true)]
[ObjectInfo(typeof(InfrastructureResources), Title = "UseCachedControllerContainerAssembliesTitle", Description = "UseCachedControllerContainerAssembliesDescription")]
public bool UseCachedControllerContainerAssemblies
{
get
{
return (bool)this["useCachedControllerContainerAssemblies"];
}

set
{
this["useCachedControllerContainerAssemblies"] = value;
}
}

/// <summary>
/// Gets or sets a value indicating whether the Ninject kernel should automatically load extensions at startup
/// </summary>
/// <value>
/// <c>true</c> if the Ninject kernel should automatically load extensions at startup; otherwise, <c>false</c>
/// </value>
[ConfigurationProperty("ninjectLoadExtensions", DefaultValue = true)]
[ObjectInfo(typeof(InfrastructureResources), Title = "NinjectLoadExtensionsTitle", Description = "NinjectLoadExtensionsDescription")]
public bool NinjectLoadExtensions
{
get
{
return (bool)this["ninjectLoadExtensions"];
}

set
{
this["ninjectLoadExtensions"] = value;
}
}
}
}
46 changes: 39 additions & 7 deletions Telerik.Sitefinity.Frontend/FilesMonitoring/FileMonitor.cs
Expand Up @@ -33,7 +33,7 @@ public void Start(IList<MonitoredDirectory> directoriesInfo)
{
this.AddRootWatcher();
}

foreach (var directory in directoriesInfo)
{
var direcotryPath = this.MapPath(directory.Path);
Expand Down Expand Up @@ -89,8 +89,9 @@ public void Dispose()
/// </summary>
/// <param name="filePath">The file path.</param>
/// <param name="changeType">Type of the change.</param>
/// <param name="fileData">The file data.</param>
/// <param name="oldFilePath">The old file path.</param>
protected virtual void FileChanged(string filePath, FileChangeType changeType, string oldFilePath = "")
protected virtual void FileChanged(string filePath, FileChangeType changeType, string oldFilePath = "", FileData fileData = null)
{
var virtualFilePath = this.ConvertToVirtualPath(filePath);
var oldFileVirtualPath = this.ConvertToVirtualPath(oldFilePath);
Expand Down Expand Up @@ -122,7 +123,8 @@ protected virtual void FileChanged(string filePath, FileChangeType changeType, s
OldFilePath = oldFileVirtualPath,
PackageName = packageName,
ResourceFolder = resourceFolder,
FileName = fileName
FileName = fileName,
FileData = fileData
});

SystemManager.RunWithElevatedPrivilege(elevDelegate);
Expand Down Expand Up @@ -332,7 +334,28 @@ private string ConvertToVirtualPath(string path)

// converting the file path to a virtual file path
if (!appPhysicalPath.IsNullOrEmpty() && !path.IsNullOrEmpty())
path = path.Substring(appPhysicalPath.Length - 1);
{
if (path.StartsWith(appPhysicalPath))
{
// path within site root
path = path.Substring(appPhysicalPath.Length - 1);
}
else
{
// path within virtual directory
foreach (var monitoredDirectory in this.WatchedFoldersAndPackages)
{
var physicalPath = this.MapPath(monitoredDirectory.Path);
if (path.StartsWith(physicalPath))
{
// path within site root
path = path.Substring(physicalPath.Length).Replace('\\', '/');
path = string.Concat(monitoredDirectory.Path, path);
return path;
}
}
}
}

var virtualFilePath = path.Replace('\\', '/').Insert(0, "~");

Expand All @@ -347,12 +370,19 @@ private void ProcessDirecotryFiles(DirectoryInfo dirInfo)
{
var files = dirInfo.GetFiles("*", SearchOption.AllDirectories);

var fileManager = FileMonitorDataManager.GetManager();
var fileDatasList = fileManager.GetFilesData().ToList();

foreach (var file in files)
{
try
{
var filePath = file.FullName;
this.FileChanged(filePath, FileChangeType.Created);
var virtualFilePath = this.ConvertToVirtualPath(file.FullName);

// Get the file monitoring data for the files that are already monitored. If the file data exist we don't have to create new monitoring for this file.
var fileData = fileDatasList.Where(x => x.FilePath.Equals(virtualFilePath, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();

this.FileChanged(file.FullName, FileChangeType.Created, fileData: fileData);
}
catch (IOException ex)
{
Expand Down Expand Up @@ -506,7 +536,7 @@ private SystemManager.RunWithElevatedPrivilegeDelegate GetFileChangedDelegate(Fi
{
case FileChangeType.Created:
{
resourceFilesManager.FileAdded(args.FileName, args.FilePath, args.PackageName);
resourceFilesManager.FileAdded(args.FileName, args.FilePath, args.FileData, args.PackageName);
break;
}
Expand Down Expand Up @@ -611,6 +641,8 @@ private class FileChangedDelegateArguments
public string ResourceFolder { get; set; }

public string FileName { get; set; }

public FileData FileData { get; set; }
}

#endregion
Expand Down
28 changes: 12 additions & 16 deletions Telerik.Sitefinity.Frontend/FilesMonitoring/GridFileManager.cs
Expand Up @@ -2,20 +2,10 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Hosting;
using System.Web.Mvc;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Configuration;
using Telerik.Sitefinity.Data;
using Telerik.Sitefinity.Frontend.FilesMonitoring.Data;
using Telerik.Sitefinity.Frontend.GridSystem;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Modules.Pages.Configuration;
using Telerik.Sitefinity.Multisite;
using Telerik.Sitefinity.Project.Configuration;
using Telerik.Sitefinity.Services;
using Telerik.Sitefinity.Web.UI;
using Telerik.Sitefinity.Frontend.Resources;

namespace Telerik.Sitefinity.Frontend.FilesMonitoring
{
Expand Down Expand Up @@ -64,13 +54,13 @@ protected virtual GridWidgetRegistrator WidgetRegistrator
/// <summary>
/// Process the file if such is added to the existing folder.
/// </summary>
/// <param name="fileName"></param>
/// <param name="filePath"></param>
/// <param name="fileName">Name of the file.</param>
/// <param name="filePath">The file path.</param>
/// <param name="fileData">The file data.</param>
/// <param name="packageName">Name of the package.</param>
public void FileAdded(string fileName, string filePath, string packageName = "")
public void FileAdded(string fileName, string filePath, FileData fileData, string packageName = "")
{
var fileMonitorDataManager = FileMonitorDataManager.GetManager();
var fileData = fileMonitorDataManager.GetFilesData().Where(file => file.FilePath.Equals(filePath, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();

if (this.AddToToolboxAndFileData(fileMonitorDataManager, fileName, filePath, packageName, fileData))
{
Expand Down Expand Up @@ -156,7 +146,13 @@ private bool IsFileInValidFolder(string filePath, string packageName = "")
if (!string.IsNullOrEmpty(packageName))
expectedGridFolderStructure = expectedGridFolderStructure.Insert(0, packageName + Path.DirectorySeparatorChar);

if (directory.FullName.EndsWith(expectedGridFolderStructure, StringComparison.OrdinalIgnoreCase) && directory.FullName.StartsWith(HostingEnvironment.ApplicationPhysicalPath, StringComparison.OrdinalIgnoreCase))
var resourcePackagesPath = FrontendManager.VirtualPathBuilder.MapPath(string.Concat("~/", PackageManager.PackagesFolder));
if (directory.FullName.EndsWith(expectedGridFolderStructure, StringComparison.OrdinalIgnoreCase) &&
(
directory.FullName.StartsWith(HostingEnvironment.ApplicationPhysicalPath, StringComparison.OrdinalIgnoreCase) ||
directory.FullName.StartsWith(resourcePackagesPath, StringComparison.OrdinalIgnoreCase)
)
)
isFileInValidFolder = true;

return isFileInValidFolder;
Expand Down
7 changes: 5 additions & 2 deletions Telerik.Sitefinity.Frontend/FilesMonitoring/IFileManager.cs
@@ -1,4 +1,6 @@
namespace Telerik.Sitefinity.Frontend.FilesMonitoring
using Telerik.Sitefinity.Frontend.FilesMonitoring.Data;

namespace Telerik.Sitefinity.Frontend.FilesMonitoring
{
/// <summary>
/// Classes that implement this interface should define the Sitefinity's behavior when a file is moved over the application folder structure.
Expand All @@ -10,8 +12,9 @@ internal interface IFileManager
/// </summary>
/// <param name="fileName">Name of the file.</param>
/// <param name="filePath">The file path.</param>
/// <param name="fileData">The file data.</param>
/// <param name="packageName">Name of the package.</param>
void FileAdded(string fileName, string filePath, string packageName = "");
void FileAdded(string fileName, string filePath, FileData fileData, string packageName = "");

/// <summary>
/// Reacts on file deletion.
Expand Down

0 comments on commit d0d7180

Please sign in to comment.