Updated for consistant delimiter presence with source

This commit is contained in:
Sean Long 2020-04-18 12:53:41 -04:00
parent 70502cd881
commit ce118096b7
7 changed files with 17 additions and 13 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, " ").TrimEnd(' ');
return Path.Combine(_environment.ContentRootPath, "Content", "Tenants", _tenants.GetTenant().TenantId.ToString(), "Sites", folder.SiteId.ToString(), folder.Path);
}
private string GetFolderPath(string folder)
{
return Path.Combine(_environment.WebRootPath, folder, " ").TrimEnd(' ');
return Path.Combine(_environment.WebRootPath, folder);
}
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);
path = Path.Combine(path, folder," ").TrimEnd(' ');
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);
folder.Path = Path.Combine(parent.Path, folder.Name," ").TrimEnd(' ');
}
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);
folder.Path = Path.Combine(parent.Path, folder.Name, " ").TrimEnd(' ');
}
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 = rootFolder.FullName;
rootPath = Path.Combine(rootFolder.FullName," ").TrimEnd(' ');
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");
rootPath = Path.Combine(rootFolder.Parent.FullName , moduleDefinition.Owner + "." + moduleDefinition.Name + "s.Module", " ").TrimEnd(' ');
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,6 +13,7 @@ using System.Net;
using Oqtane.Enums;
using Oqtane.Infrastructure;
using Oqtane.Repository;
using System.IO;
namespace Oqtane.Controllers
{
@ -150,7 +151,8 @@ namespace Oqtane.Controllers
}
// add folder for user
Folder folder = _folders.GetFolder(user.SiteId, "Users");
string usersPath = Path.Combine("Users"," ").TrimEnd(' ');
Folder folder = _folders.GetFolder(user.SiteId, usersPath);
if (folder != null)
{
_folders.AddFolder(new Folder
@ -158,7 +160,7 @@ namespace Oqtane.Controllers
SiteId = folder.SiteId,
ParentId = folder.FolderId,
Name = "My Folder",
Path = System.IO.Path.Combine(folder.Path, newUser.UserId.ToString()),
Path = Path.Combine(folder.Path, newUser.UserId.ToString(), " ").TrimEnd(' '),
Order = 1,
IsSystem = true,
Permissions = "[{\"PermissionName\":\"Browse\",\"Permissions\":\"[" + newUser.UserId.ToString() + "]\"},{\"PermissionName\":\"View\",\"Permissions\":\"All Users\"},{\"PermissionName\":\"Edit\",\"Permissions\":\"[" +

View File

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

View File

@ -103,7 +103,8 @@ namespace Oqtane.Infrastructure
case ".svg":
case ".js":
case ".css":
filename = Path.Combine(sourceFolder, entry.FullName.Replace("wwwroot", name));
string entryPath = Path.Combine(entry.FullName.Replace("wwwroot", name).Split("/"));
filename = Path.Combine(sourceFolder, entryPath);
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());
string folderpath = Path.Combine(_environment.ContentRootPath, "Content", "Tenants", site.TenantId.ToString(), "Sites", site.SiteId.ToString()," ").TrimEnd();
System.IO.Directory.CreateDirectory(folderpath);
if (!System.IO.File.Exists(Path.Combine(folderpath, "logo.png")))
{