Revert "Updated for consistant delimiter presence with source"

This reverts commit ce118096b7df9e133b9011a411e86eba21502be6.
This commit is contained in:
Sean Long 2020-04-18 12:54:12 -04:00
parent ce118096b7
commit c07ebdd41b
7 changed files with 13 additions and 17 deletions

View File

@ -431,12 +431,12 @@ namespace Oqtane.Controllers
private string GetFolderPath(Folder folder)
{
return Path.Combine(_environment.ContentRootPath, "Content", "Tenants", _tenants.GetTenant().TenantId.ToString(), "Sites", folder.SiteId.ToString(), folder.Path);
return Path.Combine(_environment.ContentRootPath, "Content", "Tenants", _tenants.GetTenant().TenantId.ToString(), "Sites", folder.SiteId.ToString(), folder.Path, " ").TrimEnd(' ');
}
private string GetFolderPath(string folder)
{
return Path.Combine(_environment.WebRootPath, folder);
return Path.Combine(_environment.WebRootPath, folder, " ").TrimEnd(' ');
}
private void CreateDirectory(string folderpath)
@ -448,7 +448,7 @@ namespace Oqtane.Controllers
string[] folders = folderpath.Split(separators, StringSplitOptions.RemoveEmptyEntries);
foreach (string folder in folders)
{
path = Path.Combine(path, folder," ").TrimEnd(' ');
path = Path.Combine(path, folder);
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);

View File

@ -110,7 +110,7 @@ namespace Oqtane.Controllers
if (string.IsNullOrEmpty(folder.Path) && folder.ParentId != null)
{
Folder parent = _folders.GetFolder(folder.ParentId.Value);
folder.Path = Path.Combine(parent.Path, folder.Name," ").TrimEnd(' ');
folder.Path = Path.Combine(parent.Path, folder.Name);
}
folder = _folders.AddFolder(folder);
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Folder Added {Folder}", folder);
@ -135,7 +135,7 @@ namespace Oqtane.Controllers
if (string.IsNullOrEmpty(folder.Path) && folder.ParentId != null)
{
Folder parent = _folders.GetFolder(folder.ParentId.Value);
folder.Path = Path.Combine(parent.Path, folder.Name, " ").TrimEnd(' ');
folder.Path = Path.Combine(parent.Path, folder.Name);
}
folder = _folders.UpdateFolder(folder);
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Folder Updated {Folder}", folder);

View File

@ -193,13 +193,13 @@ namespace Oqtane.Controllers
if (moduleDefinition.Template == "internal")
{
rootPath = Path.Combine(rootFolder.FullName," ").TrimEnd(' ');
rootPath = rootFolder.FullName;
moduleDefinition.ModuleDefinitionName = moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Modules, Oqtane.Client";
moduleDefinition.ServerManagerType = moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Manager." + moduleDefinition.Name + "Manager, Oqtane.Server";
}
else
{
rootPath = Path.Combine(rootFolder.Parent.FullName , moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Module", " ").TrimEnd(' ');
rootPath = Path.Combine(rootFolder.Parent.FullName , moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Module");
moduleDefinition.ModuleDefinitionName = moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Modules, " + moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Module.Client";
moduleDefinition.ServerManagerType = moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Manager." + moduleDefinition.Name + "Manager, " + moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Module.Server";
}

View File

@ -13,7 +13,6 @@ using System.Net;
using Oqtane.Enums;
using Oqtane.Infrastructure;
using Oqtane.Repository;
using System.IO;
namespace Oqtane.Controllers
{
@ -151,8 +150,7 @@ namespace Oqtane.Controllers
}
// add folder for user
string usersPath = Path.Combine("Users"," ").TrimEnd(' ');
Folder folder = _folders.GetFolder(user.SiteId, usersPath);
Folder folder = _folders.GetFolder(user.SiteId, "Users");
if (folder != null)
{
_folders.AddFolder(new Folder
@ -160,7 +158,7 @@ namespace Oqtane.Controllers
SiteId = folder.SiteId,
ParentId = folder.FolderId,
Name = "My Folder",
Path = Path.Combine(folder.Path, newUser.UserId.ToString(), " ").TrimEnd(' '),
Path = System.IO.Path.Combine(folder.Path, newUser.UserId.ToString()),
Order = 1,
IsSystem = true,
Permissions = "[{\"PermissionName\":\"Browse\",\"Permissions\":\"[" + newUser.UserId.ToString() + "]\"},{\"PermissionName\":\"View\",\"Permissions\":\"All Users\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"[" +

View File

@ -387,15 +387,14 @@ namespace Oqtane.Infrastructure
}
// add folder for user
string usersPath = Path.Combine("Users", " ").TrimEnd(' ');
var folder = folderRepository.GetFolder(user.SiteId, usersPath);
var folder = folderRepository.GetFolder(user.SiteId, "Users");
if (folder != null)
folderRepository.AddFolder(new Folder
{
SiteId = folder.SiteId,
ParentId = folder.FolderId,
Name = "My Folder",
Path = Path.Combine(folder.Path, newUser.UserId.ToString(), " ").TrimEnd(' '),
Path = Path.Combine(folder.Path, newUser.UserId.ToString()),
Order = 1,
IsSystem = true,
Permissions = new List<Permission>

View File

@ -103,8 +103,7 @@ namespace Oqtane.Infrastructure
case ".svg":
case ".js":
case ".css":
string entryPath = Path.Combine(entry.FullName.Replace("wwwroot", name).Split("/"));
filename = Path.Combine(sourceFolder, entryPath);
filename = Path.Combine(sourceFolder, entry.FullName.Replace("wwwroot", name));
if (!Directory.Exists(Path.GetDirectoryName(filename)))
{
Directory.CreateDirectory(Path.GetDirectoryName(filename));

View File

@ -134,7 +134,7 @@ namespace Oqtane.SiteTemplates
if (System.IO.File.Exists(Path.Combine(_environment.WebRootPath, "images", "logo.png")))
{
string folderpath = Path.Combine(_environment.ContentRootPath, "Content", "Tenants", site.TenantId.ToString(), "Sites", site.SiteId.ToString()," ").TrimEnd();
string folderpath = Path.Combine(_environment.ContentRootPath, "Content", "Tenants", site.TenantId.ToString(), "Sites", site.SiteId.ToString());
System.IO.Directory.CreateDirectory(folderpath);
if (!System.IO.File.Exists(Path.Combine(folderpath, "logo.png")))
{