Change Skin -> Theme
To better align with commonly used terminology in industry renamed all references from Skin -> Theme.
This commit is contained in:
@ -6,20 +6,20 @@ using Oqtane.Models;
|
||||
namespace Oqtane.Controllers
|
||||
{
|
||||
[Route("{site}/api/[controller]")]
|
||||
public class SkinController : Controller
|
||||
public class ThemeController : Controller
|
||||
{
|
||||
private readonly ISkinRepository skins;
|
||||
private readonly IThemeRepository themes;
|
||||
|
||||
public SkinController(ISkinRepository Skins)
|
||||
public ThemeController(IThemeRepository Themes)
|
||||
{
|
||||
skins = Skins;
|
||||
themes = Themes;
|
||||
}
|
||||
|
||||
// GET: api/<controller>
|
||||
[HttpGet]
|
||||
public IEnumerable<Skin> Get()
|
||||
public IEnumerable<Theme> Get()
|
||||
{
|
||||
return skins.GetSkins();
|
||||
return themes.GetThemes();
|
||||
}
|
||||
}
|
||||
}
|
@ -3,8 +3,8 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISkinRepository
|
||||
public interface IThemeRepository
|
||||
{
|
||||
IEnumerable<Skin> GetSkins();
|
||||
IEnumerable<Theme> GetThemes();
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Oqtane.Models;
|
||||
using System.Reflection;
|
||||
using System;
|
||||
using Oqtane.Skins;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public class SkinRepository : ISkinRepository
|
||||
{
|
||||
private readonly List<Skin> skins;
|
||||
|
||||
public SkinRepository()
|
||||
{
|
||||
skins = LoadSkins();
|
||||
}
|
||||
|
||||
private List<Skin> LoadSkins()
|
||||
{
|
||||
List<Skin> skins = new List<Skin>();
|
||||
|
||||
// iterate through Oqtane skin assemblies
|
||||
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
if (assembly.FullName.StartsWith("Oqtane.Client") || assembly.FullName.StartsWith("Oqtane.Skin."))
|
||||
{
|
||||
skins = LoadSkinsFromAssembly(skins, assembly);
|
||||
}
|
||||
}
|
||||
|
||||
return skins;
|
||||
}
|
||||
|
||||
private List<Skin> LoadSkinsFromAssembly(List<Skin> skins, Assembly assembly)
|
||||
{
|
||||
Skin skin;
|
||||
Type[] skincontroltypes = assembly.GetTypes().Where(item => item.GetInterfaces().Contains(typeof(ISkinControl))).ToArray();
|
||||
foreach (Type skincontroltype in skincontroltypes)
|
||||
{
|
||||
if (skincontroltype.Name != "SkinBase")
|
||||
{
|
||||
string[] typename = skincontroltype.AssemblyQualifiedName.Split(',').Select(item => item.Trim()).ToList().ToArray();
|
||||
string[] segments = typename[0].Split('.');
|
||||
Array.Resize(ref segments, segments.Length - 1);
|
||||
string Namespace = string.Join(".", segments);
|
||||
|
||||
int index = skins.FindIndex(item => item.SkinName == Namespace);
|
||||
if (index == -1)
|
||||
{
|
||||
/// determine if this skin implements ISkin
|
||||
Type skintype = assembly.GetTypes()
|
||||
.Where(item => item.Namespace.StartsWith(Namespace))
|
||||
.Where(item => item.GetInterfaces().Contains(typeof(ISkin))).FirstOrDefault();
|
||||
if (skintype != null)
|
||||
{
|
||||
var skinobject = Activator.CreateInstance(skintype);
|
||||
skin = new Skin
|
||||
{
|
||||
SkinName = Namespace,
|
||||
Name = (string)skintype.GetProperty("Name").GetValue(skinobject),
|
||||
Version = (string)skintype.GetProperty("Version").GetValue(skinobject),
|
||||
Owner = (string)skintype.GetProperty("Owner").GetValue(skinobject),
|
||||
Url = (string)skintype.GetProperty("Url").GetValue(skinobject),
|
||||
Contact = (string)skintype.GetProperty("Contact").GetValue(skinobject),
|
||||
License = (string)skintype.GetProperty("License").GetValue(skinobject),
|
||||
Dependencies = (string)skintype.GetProperty("Dependencies").GetValue(skinobject),
|
||||
SkinControls = "",
|
||||
PaneLayouts = "",
|
||||
ContainerControls = "",
|
||||
AssemblyName = assembly.FullName.Split(",")[0]
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
skin = new Skin
|
||||
{
|
||||
SkinName = Namespace,
|
||||
Name = skincontroltype.Name,
|
||||
Version = new Version(1, 0, 0).ToString(),
|
||||
Owner = "",
|
||||
Url = "",
|
||||
Contact = "",
|
||||
License = "",
|
||||
Dependencies = "",
|
||||
SkinControls = "",
|
||||
PaneLayouts = "",
|
||||
ContainerControls = "",
|
||||
AssemblyName = assembly.FullName.Split(",")[0]
|
||||
};
|
||||
}
|
||||
skins.Add(skin);
|
||||
index = skins.FindIndex(item => item.SkinName == Namespace);
|
||||
}
|
||||
skin = skins[index];
|
||||
// layouts and skins
|
||||
if (skincontroltype.FullName.EndsWith("Layout"))
|
||||
{
|
||||
skin.PaneLayouts += (skincontroltype.FullName + ", " + typename[1] + ";");
|
||||
}
|
||||
else
|
||||
{
|
||||
skin.SkinControls += (skincontroltype.FullName + ", " + typename[1] + ";");
|
||||
}
|
||||
// containers
|
||||
Type[] containertypes = assembly.GetTypes().Where(item => item.Namespace.StartsWith(Namespace)).Where(item => item.GetInterfaces().Contains(typeof(IContainerControl))).ToArray();
|
||||
foreach (Type containertype in containertypes)
|
||||
{
|
||||
skin.ContainerControls += (containertype.FullName + ", " + typename[1] + ";");
|
||||
}
|
||||
skins[index] = skin;
|
||||
}
|
||||
}
|
||||
return skins;
|
||||
}
|
||||
|
||||
public IEnumerable<Skin> GetSkins()
|
||||
{
|
||||
return skins;
|
||||
}
|
||||
}
|
||||
}
|
124
Oqtane.Server/Repository/ThemeRepository.cs
Normal file
124
Oqtane.Server/Repository/ThemeRepository.cs
Normal file
@ -0,0 +1,124 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Oqtane.Models;
|
||||
using System.Reflection;
|
||||
using System;
|
||||
using Oqtane.Themes;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public class ThemeRepository : IThemeRepository
|
||||
{
|
||||
private readonly List<Theme> themes;
|
||||
|
||||
public ThemeRepository()
|
||||
{
|
||||
themes = LoadThemes();
|
||||
}
|
||||
|
||||
private List<Theme> LoadThemes()
|
||||
{
|
||||
List<Theme> themes = new List<Theme>();
|
||||
|
||||
// iterate through Oqtane theme assemblies
|
||||
// TODO: Remove restriction on assembly
|
||||
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
if (assembly.FullName.StartsWith("Oqtane.Client") || assembly.FullName.StartsWith("Oqtane.Theme."))
|
||||
{
|
||||
themes = LoadThemesFromAssembly(themes, assembly);
|
||||
}
|
||||
}
|
||||
|
||||
return themes;
|
||||
}
|
||||
|
||||
private List<Theme> LoadThemesFromAssembly(List<Theme> themes, Assembly assembly)
|
||||
{
|
||||
Theme theme;
|
||||
Type[] themeControlTypes = assembly.GetTypes().Where(item => item.GetInterfaces().Contains(typeof(IThemeControl))).ToArray();
|
||||
foreach (Type themeControlType in themeControlTypes)
|
||||
{
|
||||
if (themeControlType.Name != "ThemeBase")
|
||||
{
|
||||
string[] typename = themeControlType.AssemblyQualifiedName.Split(',').Select(item => item.Trim()).ToList().ToArray();
|
||||
string[] segments = typename[0].Split('.');
|
||||
Array.Resize(ref segments, segments.Length - 1);
|
||||
string Namespace = string.Join(".", segments);
|
||||
|
||||
int index = themes.FindIndex(item => item.ThemeName == Namespace);
|
||||
if (index == -1)
|
||||
{
|
||||
/// determine if this theme implements ITheme
|
||||
Type themeType = assembly.GetTypes()
|
||||
.Where(item => item.Namespace.StartsWith(Namespace))
|
||||
.Where(item => item.GetInterfaces().Contains(typeof(ITheme))).FirstOrDefault();
|
||||
if (themeType != null)
|
||||
{
|
||||
var themeObject = Activator.CreateInstance(themeType);
|
||||
theme = new Theme
|
||||
{
|
||||
ThemeName = Namespace,
|
||||
Name = (string)themeType.GetProperty("Name").GetValue(themeObject),
|
||||
Version = (string)themeType.GetProperty("Version").GetValue(themeObject),
|
||||
Owner = (string)themeType.GetProperty("Owner").GetValue(themeObject),
|
||||
Url = (string)themeType.GetProperty("Url").GetValue(themeObject),
|
||||
Contact = (string)themeType.GetProperty("Contact").GetValue(themeObject),
|
||||
License = (string)themeType.GetProperty("License").GetValue(themeObject),
|
||||
Dependencies = (string)themeType.GetProperty("Dependencies").GetValue(themeObject),
|
||||
ThemeControls = "",
|
||||
PaneLayouts = "",
|
||||
ContainerControls = "",
|
||||
AssemblyName = assembly.FullName.Split(",")[0]
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
theme = new Theme
|
||||
{
|
||||
ThemeName = Namespace,
|
||||
Name = themeControlType.Name,
|
||||
Version = new Version(1, 0, 0).ToString(),
|
||||
Owner = "",
|
||||
Url = "",
|
||||
Contact = "",
|
||||
License = "",
|
||||
Dependencies = "",
|
||||
ThemeControls = "",
|
||||
PaneLayouts = "",
|
||||
ContainerControls = "",
|
||||
AssemblyName = assembly.FullName.Split(",")[0]
|
||||
};
|
||||
}
|
||||
themes.Add(theme);
|
||||
index = themes.FindIndex(item => item.ThemeName == Namespace);
|
||||
}
|
||||
theme = themes[index];
|
||||
// layouts and themes
|
||||
if (themeControlType.FullName.EndsWith("Layout"))
|
||||
{
|
||||
theme.PaneLayouts += (themeControlType.FullName + ", " + typename[1] + ";");
|
||||
}
|
||||
else
|
||||
{
|
||||
theme.ThemeControls += (themeControlType.FullName + ", " + typename[1] + ";");
|
||||
}
|
||||
// containers
|
||||
Type[] containertypes = assembly.GetTypes().Where(item => item.Namespace.StartsWith(Namespace)).Where(item => item.GetInterfaces().Contains(typeof(IContainerControl))).ToArray();
|
||||
foreach (Type containertype in containertypes)
|
||||
{
|
||||
theme.ContainerControls += (containertype.FullName + ", " + typename[1] + ";");
|
||||
}
|
||||
themes[index] = theme;
|
||||
}
|
||||
}
|
||||
return themes;
|
||||
}
|
||||
|
||||
public IEnumerable<Theme> GetThemes()
|
||||
{
|
||||
return themes;
|
||||
}
|
||||
}
|
||||
}
|
@ -32,7 +32,7 @@ CREATE TABLE [dbo].[Page](
|
||||
[SiteId] [int] NOT NULL,
|
||||
[Path] [nvarchar](50) NOT NULL,
|
||||
[Name] [nvarchar](50) NOT NULL,
|
||||
[SkinType] [nvarchar](200) NULL,
|
||||
[ThemeType] [nvarchar](200) NULL,
|
||||
[Icon] [nvarchar](50) NOT NULL,
|
||||
[Panes] [nvarchar](50) NOT NULL,
|
||||
[ViewPermissions] [nvarchar](500) NOT NULL,
|
||||
@ -167,38 +167,38 @@ GO
|
||||
|
||||
SET IDENTITY_INSERT [dbo].[Page] ON
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (1, 1, N'Page1', N'', N'Oqtane.Client.Skins.Skin1.Skin1, Oqtane.Client', N'oi-home', N'Left;Right', N'All Users', N'Administrators', NULL, 1, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (1, 1, N'Page1', N'', N'Oqtane.Client.Themes.Theme1.Theme1, Oqtane.Client', N'oi-home', N'Left;Right', N'All Users', N'Administrators', NULL, 1, 1, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (2, 1, N'Page2', N'page2', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'oi-plus', N'Top;Bottom', N'Administrators;Editors;', N'Administrators', NULL, 3, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (2, 1, N'Page2', N'page2', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'oi-plus', N'Top;Bottom', N'Administrators;Editors;', N'Administrators', NULL, 3, 1, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (3, 1, N'Page3', N'page3', N'Oqtane.Client.Skins.Skin3.Skin3, Oqtane.Client', N'oi-list-rich', N'Left;Right', N'All Users', N'Administrators', NULL, 3, 1, N'Oqtane.Client.Skins.Skin3.HorizontalLayout, Oqtane.Client')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (3, 1, N'Page3', N'page3', N'Oqtane.Client.Themes.Theme3.Theme3, Oqtane.Client', N'oi-list-rich', N'Left;Right', N'All Users', N'Administrators', NULL, 3, 1, N'Oqtane.Client.Themes.Theme3.HorizontalLayout, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (4, 1, N'Admin', N'admin', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'oi-home', N'Top;Bottom', N'Administrators', N'Administrators', NULL, 7, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (4, 1, N'Admin', N'admin', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'oi-home', N'Top;Bottom', N'Administrators', N'Administrators', NULL, 7, 1, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (5, 1, N'Page Management', N'admin/pages', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 1, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (5, 1, N'Page Management', N'admin/pages', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 1, 1, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (6, 1, N'Login', N'login', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (6, 1, N'Login', N'login', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (7, 1, N'Register', N'register', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (7, 1, N'Register', N'register', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (8, 1, N'Site Management', N'admin/sites', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 0, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (8, 1, N'Site Management', N'admin/sites', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 0, 1, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (9, 1, N'User Management', N'admin/users', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 2, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (9, 1, N'User Management', N'admin/users', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 2, 1, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (10, 1, N'Module Management', N'admin/modules', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 3, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (10, 1, N'Module Management', N'admin/modules', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 3, 1, N'')
|
||||
GO
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (11, 1, N'Skin Management', N'admin/skins', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 4, 1, N'')
|
||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType])
|
||||
VALUES (11, 1, N'Theme Management', N'admin/themes', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 4, 1, N'')
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[Page] OFF
|
||||
GO
|
||||
@ -248,7 +248,7 @@ INSERT [dbo].[Module] ([ModuleId], [SiteId], [ModuleDefinitionName], [ViewPermis
|
||||
VALUES (14, 1, N'Oqtane.Client.Modules.Admin.ModuleDefinitions, Oqtane.Client', N'Administrators', N'Administrators')
|
||||
GO
|
||||
INSERT [dbo].[Module] ([ModuleId], [SiteId], [ModuleDefinitionName], [ViewPermissions], [EditPermissions])
|
||||
VALUES (15, 1, N'Oqtane.Client.Modules.Admin.Skins, Oqtane.Client', N'Administrators', N'Administrators')
|
||||
VALUES (15, 1, N'Oqtane.Client.Modules.Admin.Themes, Oqtane.Client', N'Administrators', N'Administrators')
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[Module] OFF
|
||||
GO
|
||||
@ -256,49 +256,49 @@ GO
|
||||
SET IDENTITY_INSERT [dbo].[PageModule] ON
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (1, 1, 1, N'Weather', N'Right', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
|
||||
VALUES (1, 1, 1, N'Weather', N'Right', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (2, 1, 2, N'Counter', N'Left', 1, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
|
||||
VALUES (2, 1, 2, N'Counter', N'Left', 1, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (3, 1, 3, N'Text', N'Left', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
|
||||
VALUES (3, 1, 3, N'Text', N'Left', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (4, 2, 4, N'Weather', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (4, 2, 4, N'Weather', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (5, 2, 5, N'Text', N'Top', 1, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
|
||||
VALUES (5, 2, 5, N'Text', N'Top', 1, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (6, 3, 6, N'Text', N'Left', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
|
||||
VALUES (6, 3, 6, N'Text', N'Left', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (7, 3, 7, N'Text', N'Right', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
|
||||
VALUES (7, 3, 7, N'Text', N'Right', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (8, 5, 8, N'Page Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (8, 5, 8, N'Page Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (9, 6, 9, N'Login', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (9, 6, 9, N'Login', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (10, 7, 10, N'Register', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (10, 7, 10, N'Register', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (11, 4, 11, N'Administration', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (11, 4, 11, N'Administration', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (12, 8, 12, N'Site Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (12, 8, 12, N'Site Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (13, 9, 13, N'User Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (13, 9, 13, N'User Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (14, 10, 14, N'Module Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (14, 10, 14, N'Module Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType])
|
||||
VALUES (15, 11, 15, N'Skin Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
|
||||
VALUES (15, 11, 15, N'Theme Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[PageModule] OFF
|
||||
GO
|
||||
|
@ -59,7 +59,7 @@ namespace Oqtane.Server
|
||||
|
||||
// register singleton core services
|
||||
services.AddScoped<IModuleDefinitionService, ModuleDefinitionService>();
|
||||
services.AddScoped<ISkinService, SkinService>();
|
||||
services.AddScoped<IThemeService, ThemeService>();
|
||||
|
||||
// register scoped core services
|
||||
services.AddScoped<ITenantService, TenantService>();
|
||||
@ -107,7 +107,7 @@ namespace Oqtane.Server
|
||||
|
||||
// register singleton scoped core services
|
||||
services.AddSingleton<IModuleDefinitionRepository, ModuleDefinitionRepository>();
|
||||
services.AddSingleton<ISkinRepository, SkinRepository>();
|
||||
services.AddSingleton<IThemeRepository, ThemeRepository>();
|
||||
|
||||
// register transient scoped core services
|
||||
services.AddTransient<ITenantRepository, TenantRepository>();
|
||||
@ -207,7 +207,7 @@ namespace Oqtane.Server
|
||||
|
||||
// register singleton scoped core services
|
||||
services.AddSingleton<IModuleDefinitionRepository, ModuleDefinitionRepository>();
|
||||
services.AddSingleton<ISkinRepository, SkinRepository>();
|
||||
services.AddSingleton<IThemeRepository, ThemeRepository>();
|
||||
|
||||
// register transient scoped core services
|
||||
services.AddTransient<ITenantRepository, TenantRepository>();
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Oqtane.mdf;Initial Catalog=Oqtane;Integrated Security=SSPI;"
|
||||
"DefaultConnection": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Oqtane-201905122226.mdf;Initial Catalog=Oqtane-201905122226;Integrated Security=SSPI;"
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user