Compare commits

..

10 Commits

Author SHA1 Message Date
a6228f3704 Moduleinstall: finalized 2025-05-30 16:22:15 +02:00
572f2f6be1 Add Module 2025-05-30 16:20:08 +02:00
db63447052 Install 2025-05-30 16:18:51 +02:00
37c418a869 Publish directory 2025-05-30 16:15:48 +02:00
Konstantin Hintermayer
b3b39f583a Merge mirror with local history. 2025-05-30 11:51:43 +02:00
Konstantin Hintermayer
92c554e854 New: Register Component that Renders a Link (secondary) to the register URL including the redirect property. 2025-05-30 11:45:26 +02:00
391827222e Update README.md 2025-03-15 18:08:36 +00:00
c1721bd1a1 Update README.md 2025-03-15 18:08:00 +00:00
f6630ae241 Update README.md 2025-03-15 18:07:14 +00:00
424cab64a8 NEW: Docker builds 2025-03-15 18:59:18 +01:00
1486 changed files with 123909 additions and 5462 deletions

View File

@@ -0,0 +1,25 @@
name: build-docker-imge
on:
- push
jobs:
build:
name: Build the docker container
runs-on: ubuntu-latest
steps:
- name: "Git clone"
run: git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git .
- name: "Git checkout"
run: git checkout "${{ gitea.sha }}"
- uses: aevea/action-kaniko@master
name: Run Kaniko to build our api docker container.
with:
image: kocoded/oqtane.framework
tag: ${{ git.workflow_sha }}
tag_with_latest: github.ref == 'refs/heads/master'
registry: git.kocoder.xyz
username: ${{ secrets.CI_RUNNER_USER }}
password: ${{ secrets.CI_RUNNER_TOKEN }}
build_file: Dockerfile
target: deploy

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /source
COPY --link . .
RUN dotnet restore /source/Oqtane.sln
RUN dotnet build "/source/Oqtane.sln" -c Release -o /source/build/
# Publish
FROM build AS publish
RUN dotnet publish "Oqtane.Server/Oqtane.Server.csproj" -c Release -o /source/publish/
# Deploy
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS deploy
WORKDIR /app
COPY --from=publish /source/publish/ /app/
ENTRYPOINT ["dotnet", "Oqtane.Server.dll"]

View File

@@ -1,19 +0,0 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Shaun Walker",
"classifications": [
"Web",
"ASP.NET",
"Blazor",
"Oqtane"
],
"tags": {
"language": "C#",
"type": "project"
},
"identity": "Oqtane.Application.Template",
"name": "Oqtane Application Solution For Blazor",
"shortName": "oqtane-app",
"sourceName": "Oqtane.Application",
"preferNameDirectory": true
}

View File

@@ -1,47 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Version>6.1.5</Version>
<AssemblyName>Oqtane.Application.AppHost</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.8" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.8" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
<PackageReference Include="HtmlAgilityPack" Version="1.12.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
<PackageReference Include="MailKit" Version="4.13.0" />
</ItemGroup>
<ItemGroup>
<!-- MySQL Database Provider Dependencies -->
<PackageReference Include="MySql.Data" Version="9.4.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.3.efcore.9.0.0" />
<!-- PostgreSQL Database Provider Dependencies -->
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.8" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<!-- SQLite Database Provider Dependencies -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.8" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.8" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.1" />
<!-- SQL Server Database Provider Dependencies -->
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.8" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Oqtane.Client" Version="6.1.5" />
<PackageReference Include="Oqtane.Server" Version="6.1.5" />
<PackageReference Include="Oqtane.Shared" Version="6.1.5" />
</ItemGroup>
</Project>

View File

@@ -1,43 +0,0 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore;
using Microsoft.Extensions.DependencyInjection;
using Oqtane.Infrastructure;
using Microsoft.Extensions.Logging;
namespace Oqtane.Application.AppHost
{
public class Program
{
public static void Main(string[] args)
{
var host = BuildWebHost(args);
var databaseManager = host.Services.GetService<IDatabaseManager>();
var install = databaseManager.Install();
if (!string.IsNullOrEmpty(install.Message))
{
var filelogger = host.Services.GetRequiredService<ILogger<Program>>();
if (filelogger != null)
{
filelogger.LogError($"[Oqtane.Application.AppHost.Program.Main] {install.Message}");
}
}
else
{
host.Run();
}
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseConfiguration(new ConfigurationBuilder()
.AddCommandLine(args)
.AddEnvironmentVariables()
.Build())
.UseStartup<Oqtane.Startup>()
.ConfigureLocalizationSettings()
.Build();
}
}

View File

@@ -1,29 +0,0 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:44358/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Oqtane.AppHost": {
"commandName": "Project",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:44358/"
}
}
}

View File

@@ -1,7 +0,0 @@
# Oqtane Application Template
![Oqtane](https://github.com/oqtane/framework/blob/master/oqtane.png?raw=true "Oqtane")
Oqtane is an open source CMS and Application Framework that provides advanced functionality for developing web, mobile, and desktop applications on .NET. It leverages Blazor to compose a fully dynamic digital experience which can be hosted on Static Blazor, Blazor Server, Blazor WebAssembly, or Blazor Hybrid (via .NET MAUI).
More information about Oqtane can be found at: [https://www.oqtane.org](https://www.oqtane.org)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

View File

@@ -1,11 +0,0 @@
@echo off
set TargetFramework=%1
set ProjectName=%2
XCOPY "..\Client\bin\Debug\%TargetFramework%\%ProjectName%.Client.Oqtane.dll" "..\AppHost\bin\Debug\%TargetFramework%\" /Y
XCOPY "..\Client\bin\Debug\%TargetFramework%\%ProjectName%.Client.Oqtane.pdb" "..\AppHost\bin\Debug\%TargetFramework%\" /Y
XCOPY "..\Server\bin\Debug\%TargetFramework%\%ProjectName%.Server.Oqtane.dll" "..\AppHost\bin\Debug\%TargetFramework%\" /Y
XCOPY "..\Server\bin\Debug\%TargetFramework%\%ProjectName%.Server.Oqtane.pdb" "..\AppHost\bin\Debug\%TargetFramework%\" /Y
XCOPY "..\Shared\bin\Debug\%TargetFramework%\%ProjectName%.Shared.Oqtane.dll" "..\AppHost\bin\Debug\%TargetFramework%\" /Y
XCOPY "..\Shared\bin\Debug\%TargetFramework%\%ProjectName%.Shared.Oqtane.pdb" "..\AppHost\bin\Debug\%TargetFramework%\" /Y
XCOPY "..\Server\wwwroot\*" "..\AppHost\wwwroot\" /Y /S /I

View File

@@ -1,12 +0,0 @@
#!/bin/bash
TargetFramework=$1
ProjectName=$2
cp -f "../Client/bin/Debug/$TargetFramework/$ProjectName$.Client.Oqtane.dll" "../AppHost/bin/Debug/$TargetFramework/"
cp -f "../Client/bin/Debug/$TargetFramework/$ProjectName$.Client.Oqtane.pdb" "../AppHost/bin/Debug/$TargetFramework/"
cp -f "../Server/bin/Debug/$TargetFramework/$ProjectName$.Server.Oqtane.dll" "../AppHost/bin/Debug/$TargetFramework/"
cp -f "../Server/bin/Debug/$TargetFramework/$ProjectName$.Server.Oqtane.pdb" "../AppHost/bin/Debug/$TargetFramework/"
cp -f "../Shared/bin/Debug/$TargetFramework/$ProjectName$.Shared.Oqtane.dll" "../AppHost/bin/Debug/$TargetFramework/"
cp -f "../Shared/bin/Debug/$TargetFramework/$ProjectName$.Shared.Oqtane.pdb" "../AppHost/bin/Debug/$TargetFramework/"
cp -rf "../Server/wwwroot/"* "../AppHost/wwwroot/"

Binary file not shown.

View File

@@ -1,2 +0,0 @@
del "*.nupkg"
"nuget.exe" pack Oqtane.Application.nuspec -Properties projectname=Oqtane.Application

View File

@@ -1 +0,0 @@
"nuget.exe" pack Oqtane.Application.nuspec -Properties projectname=Oqtane.Application

View File

@@ -1,3 +0,0 @@
using Microsoft.Extensions.Localization;
[assembly: RootNamespace("Oqtane.Application.Client")]

View File

@@ -1,19 +0,0 @@
using Oqtane.Models;
using Oqtane.Modules;
namespace Oqtane.Application.MyModule
{
public class ModuleInfo : IModule
{
public ModuleDefinition ModuleDefinition => new ModuleDefinition
{
Name = "MyModule",
Description = "Example module",
Version = "1.0.0",
ServerManagerType = "Oqtane.Application.Manager.MyModuleManager, Oqtane.Application.Server.Oqtane",
ReleaseVersions = "1.0.0",
Dependencies = "Oqtane.Application.Shared.Oqtane",
PackageName = "Oqtane.Application"
};
}
}

View File

@@ -1,141 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Name.Text" xml:space="preserve">
<value>Name: </value>
</data>
<data name="Name.HelpText" xml:space="preserve">
<value>Enter the name</value>
</data>
<data name="Save" xml:space="preserve">
<value>Save</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Message.SaveValidation" xml:space="preserve">
<value>Please Provide All Required Information</value>
</data>
<data name="Message.SaveError" xml:space="preserve">
<value>Error Saving MyModule</value>
</data>
<data name="Message.LoadError" xml:space="preserve">
<value>Error Loading MyModule</value>
</data>
</root>

View File

@@ -1,147 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="Add.Text" xml:space="preserve">
<value>Add MyModule</value>
</data>
<data name="Edit.Text" xml:space="preserve">
<value>Edit</value>
</data>
<data name="Delete.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="Delete.Header" xml:space="preserve">
<value>Delete MyModule</value>
</data>
<data name="Delete.Message" xml:space="preserve">
<value>Are You Sure You Wish To Delete This MyModule?</value>
</data>
<data name="Message.DisplayNone" xml:space="preserve">
<value>No MyModules To Display</value>
</data>
<data name="Message.LoadError" xml:space="preserve">
<value>Error Loading MyModule</value>
</data>
<data name="Message.DeleteError" xml:space="preserve">
<value>Error Deleting MyModule</value>
</data>
</root>

View File

@@ -1,55 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Oqtane.Services;
using Oqtane.Shared;
namespace Oqtane.Application.Services
{
public interface IMyModuleService
{
Task<List<Models.MyModule>> GetMyModulesAsync(int ModuleId);
Task<Models.MyModule> GetMyModuleAsync(int MyModuleId, int ModuleId);
Task<Models.MyModule> AddMyModuleAsync(Models.MyModule MyModule);
Task<Models.MyModule> UpdateMyModuleAsync(Models.MyModule MyModule);
Task DeleteMyModuleAsync(int MyModuleId, int ModuleId);
}
public class MyModuleService : ServiceBase, IMyModuleService
{
public MyModuleService(HttpClient http, SiteState siteState) : base(http, siteState) { }
private string Apiurl => CreateApiUrl("MyModule");
public async Task<List<Models.MyModule>> GetMyModulesAsync(int ModuleId)
{
List<Models.MyModule> Tasks = await GetJsonAsync<List<Models.MyModule>>(CreateAuthorizationPolicyUrl($"{Apiurl}?moduleid={ModuleId}", EntityNames.Module, ModuleId), Enumerable.Empty<Models.MyModule>().ToList());
return Tasks.OrderBy(item => item.Name).ToList();
}
public async Task<Models.MyModule> GetMyModuleAsync(int MyModuleId, int ModuleId)
{
return await GetJsonAsync<Models.MyModule>(CreateAuthorizationPolicyUrl($"{Apiurl}/{MyModuleId}/{ModuleId}", EntityNames.Module, ModuleId));
}
public async Task<Models.MyModule> AddMyModuleAsync(Models.MyModule MyModule)
{
return await PostJsonAsync<Models.MyModule>(CreateAuthorizationPolicyUrl($"{Apiurl}", EntityNames.Module, MyModule.ModuleId), MyModule);
}
public async Task<Models.MyModule> UpdateMyModuleAsync(Models.MyModule MyModule)
{
return await PutJsonAsync<Models.MyModule>(CreateAuthorizationPolicyUrl($"{Apiurl}/{MyModule.MyModuleId}", EntityNames.Module, MyModule.ModuleId), MyModule);
}
public async Task DeleteMyModuleAsync(int MyModuleId, int ModuleId)
{
await DeleteAsync(CreateAuthorizationPolicyUrl($"{Apiurl}/{MyModuleId}/{ModuleId}", EntityNames.Module, ModuleId));
}
}
}

View File

@@ -1,25 +0,0 @@
using System.Collections.Generic;
using Oqtane.Models;
using Oqtane.Themes;
using Oqtane.Shared;
namespace Oqtane.Application.MyTheme
{
public class ThemeInfo : ITheme
{
public Oqtane.Models.Theme Theme => new Oqtane.Models.Theme
{
Name = "MyTheme",
Version = "1.0.0",
PackageName = "Oqtane.Application",
ThemeSettingsType = "Oqtane.Application.MyTheme.ThemeSettings, Oqtane.Application.Client.Oqtane",
ContainerSettingsType = "Oqtane.Application.MyTheme.ContainerSettings, Oqtane.Application.Client.Oqtane",
Resources = new List<Resource>()
{
new Script(Constants.BootstrapStylesheetUrl, Constants.BootstrapStylesheetIntegrity, "anonymous"),
new Resource { ResourceType = ResourceType.Stylesheet, Url = "~/Theme.css" },
new Script(Constants.BootstrapScriptUrl, Constants.BootstrapScriptIntegrity, "anonymous")
}
};
}
}

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Oqtane.Application.Template</id>
<version>6.1.5</version>
<title>Oqtane Application Solution For Blazor</title>
<authors>Shaun Walker</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
<icon>Build/icon.png</icon>
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
<description>Oqtane is an open source CMS and Application Framework that provides advanced functionality for developing web, mobile, and desktop applications on .NET. It leverages Blazor to compose a fully dynamic digital experience which can be hosted on Static Blazor, Blazor Server, Blazor WebAssembly, or Blazor Hybrid (via .NET MAUI).</description>
<language>en-US</language>
<tags>Web ASP.NET Blazor Oqtane Modular Multi-Tenant "Open Source" "SQL Server" MySQL PostgreSQL SQLite</tags>
<readme>AppHost/README.md</readme>
<packageTypes>
<packageType name="Template" />
</packageTypes>
</metadata>
</package>

View File

@@ -1,20 +0,0 @@
# Oqtane Application Template
This folder contains content files for a Visual Studio Project Template designed for Oqtane development projects. The template relies on the native templating capabilities of the .NET Command Line Interface (CLI):
```
dotnet new install Oqtane.Application.Template
dotnet new oqtane-app -o MyCompany.MyProject
```
When using this approach you do not need to have a local copy of the oqtane.framework source code - you simply utilize Oqtane as a standard application dependency.
The solution contains an AppHost project which must be identified as the Startup project. It is responsible for loading the development environment and launching the Oqtane framework.
The solution also contains Build, Client, Server, and Shared folders which is where you you would implement your custom functionality. An example module and theme are included for reference, and you can add additional modules and themes within the same projects by following the standard Oqtane folder/namespace conventions.
*Known Issues*
- do not use the term "Oqtane" in your output name or else you will experience namespace conflicts
- the application's Build project is missing the *.nuspec file as Nuget is excluding it from the template - not sure why
- when calling "dotnet new" the PostBuild section in the Oqtane.Application.Build.csproj is being modified incorrectly - not sure why

View File

@@ -1,3 +0,0 @@
using Microsoft.Extensions.Localization;
[assembly: RootNamespace("Oqtane.Application.Server")]

View File

@@ -1,87 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Oqtane.Modules;
using Oqtane.Models;
using Oqtane.Infrastructure;
using Oqtane.Interfaces;
using Oqtane.Enums;
using Oqtane.Repository;
using Oqtane.Application.Repository;
using System.Threading.Tasks;
namespace Oqtane.Application.Manager
{
public class MyModuleManager : MigratableModuleBase, IInstallable, IPortable, ISearchable
{
private readonly IMyModuleRepository _MyModuleRepository;
private readonly IDBContextDependencies _DBContextDependencies;
public MyModuleManager(IMyModuleRepository MyModuleRepository, IDBContextDependencies DBContextDependencies)
{
_MyModuleRepository = MyModuleRepository;
_DBContextDependencies = DBContextDependencies;
}
public bool Install(Tenant tenant, string version)
{
return Migrate(new Context(_DBContextDependencies), tenant, MigrationType.Up);
}
public bool Uninstall(Tenant tenant)
{
return Migrate(new Context(_DBContextDependencies), tenant, MigrationType.Down);
}
public string ExportModule(Module module)
{
string content = "";
List<Models.MyModule> MyModules = _MyModuleRepository.GetMyModules(module.ModuleId).ToList();
if (MyModules != null)
{
content = JsonSerializer.Serialize(MyModules);
}
return content;
}
public void ImportModule(Module module, string content, string version)
{
List<Models.MyModule> MyModules = null;
if (!string.IsNullOrEmpty(content))
{
MyModules = JsonSerializer.Deserialize<List<Models.MyModule>>(content);
}
if (MyModules != null)
{
foreach(var Task in MyModules)
{
_MyModuleRepository.AddMyModule(new Models.MyModule { ModuleId = module.ModuleId, Name = Task.Name });
}
}
}
public Task<List<SearchContent>> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn)
{
var searchContentList = new List<SearchContent>();
foreach (var MyModule in _MyModuleRepository.GetMyModules(pageModule.ModuleId))
{
if (MyModule.ModifiedOn >= lastIndexedOn)
{
searchContentList.Add(new SearchContent
{
EntityName = "MyModule",
EntityId = MyModule.MyModuleId.ToString(),
Title = MyModule.Name,
Body = MyModule.Name,
ContentModifiedBy = MyModule.ModifiedBy,
ContentModifiedOn = MyModule.ModifiedOn
});
}
}
return Task.FromResult(searchContentList);
}
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Oqtane.Modules;
using Oqtane.Repository;
using Oqtane.Repository.Databases.Interfaces;
namespace Oqtane.Application.Repository
{
public class Context : DBContextBase, ITransientService, IMultiDatabase
{
public virtual DbSet<Models.MyModule> MyModule { get; set; }
public Context(IDBContextDependencies DBContextDependencies) : base(DBContextDependencies)
{
// ContextBase handles multi-tenant database connections
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.Entity<Models.MyModule>().ToTable(ActiveDatabase.RewriteName("MyModule"));
}
}
}

View File

@@ -1,75 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Collections.Generic;
using Oqtane.Modules;
namespace Oqtane.Application.Repository
{
public interface IMyModuleRepository
{
IEnumerable<Models.MyModule> GetMyModules(int ModuleId);
Models.MyModule GetMyModule(int MyModuleId);
Models.MyModule GetMyModule(int MyModuleId, bool tracking);
Models.MyModule AddMyModule(Models.MyModule MyModule);
Models.MyModule UpdateMyModule(Models.MyModule MyModule);
void DeleteMyModule(int MyModuleId);
}
public class MyModuleRepository : IMyModuleRepository, ITransientService
{
private readonly IDbContextFactory<Context> _factory;
public MyModuleRepository(IDbContextFactory<Context> factory)
{
_factory = factory;
}
public IEnumerable<Models.MyModule> GetMyModules(int ModuleId)
{
using var db = _factory.CreateDbContext();
return db.MyModule.Where(item => item.ModuleId == ModuleId).ToList();
}
public Models.MyModule GetMyModule(int MyModuleId)
{
return GetMyModule(MyModuleId, true);
}
public Models.MyModule GetMyModule(int MyModuleId, bool tracking)
{
using var db = _factory.CreateDbContext();
if (tracking)
{
return db.MyModule.Find(MyModuleId);
}
else
{
return db.MyModule.AsNoTracking().FirstOrDefault(item => item.MyModuleId == MyModuleId);
}
}
public Models.MyModule AddMyModule(Models.MyModule MyModule)
{
using var db = _factory.CreateDbContext();
db.MyModule.Add(MyModule);
db.SaveChanges();
return MyModule;
}
public Models.MyModule UpdateMyModule(Models.MyModule MyModule)
{
using var db = _factory.CreateDbContext();
db.Entry(MyModule).State = EntityState.Modified;
db.SaveChanges();
return MyModule;
}
public void DeleteMyModule(int MyModuleId)
{
using var db = _factory.CreateDbContext();
Models.MyModule MyModule = db.MyModule.Find(MyModuleId);
db.MyModule.Remove(MyModule);
db.SaveChanges();
}
}
}

View File

@@ -1,5 +0,0 @@
/* Module Script */
var App = App || {};
App.MyModule = {
};

View File

@@ -53,8 +53,8 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddScoped<ISyncService, SyncService>();
services.AddScoped<ILocalizationCookieService, LocalizationCookieService>();
services.AddScoped<ICookieConsentService, CookieConsentService>();
services.AddScoped<ITimeZoneService, TimeZoneService>();
services.AddScoped<IOutputCacheService, OutputCacheService>();
services.AddScoped<ITimeZoneService, TimeZoneService>();
// providers
services.AddScoped<ITextEditor, Oqtane.Modules.Controls.QuillJSTextEditor>();

View File

@@ -56,7 +56,7 @@
<input id="starting" type="date" class="form-control" @bind="@_startDate" />
</div>
<div class="col">
<input id="starting" type="time" class="form-control" @bind="@_startTime" placeholder="hh:mm" required="@(_startDate.HasValue)" />
<input id="starting" type="time" class="form-control" placeholder="hh:mm" @bind="@_startTime" />
</div>
</div>
</div>
@@ -69,7 +69,7 @@
<input id="ending" type="date" class="form-control" @bind="@_endDate" />
</div>
<div class="col">
<input id="ending" type="time" class="form-control" placeholder="hh:mm" @bind="@_endTime" required="@(_endDate.HasValue)" />
<input id="ending" type="time" class="form-control" placeholder="hh:mm" @bind="@_endTime" />
</div>
</div>
</div>
@@ -82,7 +82,7 @@
<input id="next" type="date" class="form-control" @bind="@_nextDate" />
</div>
<div class="col">
<input id="next" type="time" class="form-control" placeholder="hh:mm" @bind="@_nextTime" required="@(_nextDate.HasValue)" />
<input id="next" type="time" class="form-control" placeholder="hh:mm" @bind="@_nextTime" />
</div>
</div>
</div>
@@ -176,18 +176,10 @@
{
job.Interval = int.Parse(_interval);
}
job.StartDate = _startDate.HasValue && _startTime.HasValue
? LocalToUtc(_startDate.GetValueOrDefault().Date.Add(_startTime.GetValueOrDefault().TimeOfDay))
: null;
job.EndDate = _endDate.HasValue && _endTime.HasValue
? LocalToUtc(_endDate.GetValueOrDefault().Date.Add(_endTime.GetValueOrDefault().TimeOfDay))
: null;
job.NextExecution = _nextDate.HasValue && _nextTime.HasValue
? LocalToUtc(_nextDate.GetValueOrDefault().Date.Add(_nextTime.GetValueOrDefault().TimeOfDay))
: null;
job.StartDate = LocalToUtc(_startDate.Value.Date.Add(_startTime.Value.TimeOfDay));
job.EndDate = LocalToUtc(_endDate.Value.Date.Add(_endTime.Value.TimeOfDay));
job.RetentionHistory = int.Parse(_retentionHistory);
job.NextExecution = LocalToUtc(_nextDate.Value.Date.Add(_nextTime.Value.TimeOfDay));
try
{
@@ -206,4 +198,5 @@
AddModuleMessage(Localizer["Message.Required.JobInfo"], MessageType.Warning);
}
}
}

View File

@@ -21,7 +21,9 @@ else
@if (_allowexternallogin)
{
<button type="button" class="btn btn-primary" @onclick="ExternalLogin">@Localizer["Use"] @PageState.Site.Settings["ExternalLogin:ProviderName"]</button>
<br /><br />
<br />
<br />
}
@if (_allowsitelogin)
{
@@ -47,11 +49,15 @@ else
</div>
<button type="button" class="btn btn-primary" @onclick="Login">@SharedLocalizer["Login"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
<br /><br />
<br />
<br />
<button type="button" class="btn btn-secondary" @onclick="Forgot">@Localizer["ForgotPassword"]</button>
@if (PageState.Site.AllowRegistration)
{
<br /><br />
<br />
<br />
<NavLink href="@NavigateUrl("register")">@Localizer["Register"]</NavLink>
}
}

View File

@@ -17,8 +17,8 @@ else
<div class="row mb-3 align-items-center">
<div class="col-sm-6">
<ActionLink Action="Add" Text="Install Module" ResourceKey="InstallModule" />
<ActionLink Action="Create" Text="Create Module" ResourceKey="CreateModule" Class="btn btn-secondary ms-1" />
<button type="button" class="btn btn-secondary ms-1" @onclick="@Synchronize">@Localizer["Synchronize"]</button>
<ActionLink Action="Create" Text="Create Module" ResourceKey="CreateModule" Class="btn btn-secondary ps-2" />
<button type="button" class="btn btn-secondary pw-2" @onclick="@Synchronize">@Localizer["Synchronize"]</button>
</div>
<div class="col-sm-6">
<select class="form-select" @onchange="(e => CategoryChanged(e))">

View File

@@ -3,10 +3,10 @@
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject ITimeZoneService TimeZoneService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@inject ISettingService SettingService
@inject ITimeZoneService TimeZoneService
@if (_initialized)
{
@@ -115,7 +115,7 @@
{
_passwordrequirements = await UserService.GetPasswordRequirementsAsync(PageState.Site.SiteId);
_allowsitelogin = bool.Parse(SettingService.GetSetting(PageState.Site.Settings, "LoginOptions:AllowSiteLogin", "true"));
_timezones = TimeZoneService.GetTimeZones();
_timezones = await TimeZoneService.GetTimeZonesAsync();
_timezoneid = PageState.Site.TimeZoneId;
_initialized = true;
}

View File

@@ -46,7 +46,7 @@
<Row>
<div class="search-item mb-2">
<h4 class="mb-1"><a href="@context.Url">@context.Title</a></h4>
<p class="mb-0 text-body-secondary">@((MarkupString)context.Snippet)</p>
<p class="mb-0 text-muted">@((MarkupString)context.Snippet)</p>
</div>
</Row>
</Pager>

View File

@@ -193,17 +193,6 @@
</Section>
<Section Name="SMTP" Heading="SMTP Settings" ResourceKey="SMTPSettings">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="smtpenabled" HelpText="Specify if SMTP is enabled for this site" ResourceKey="SmtpEnabled">Enabled? </Label>
<div class="col-sm-9">
<select id="smtpenabled" class="form-select" value="@_smtpenabled" @onchange="(e => SMTPEnabledChanged(e))">
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
@if (_smtpenabled == "True" && UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
<div class="row mb-1 align-items-center">
<div class="col-sm-3">
</div>
@@ -224,7 +213,7 @@
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="smtpssl" HelpText="Specify if SSL is required for your SMTP server" ResourceKey="SmtpSSL">SSL Required: </Label>
<Label Class="col-sm-3" For="smtpssl" HelpText="Specify if SSL is required for your SMTP server" ResourceKey="UseSsl">SSL Enabled: </Label>
<div class="col-sm-9">
<select id="smtpssl" class="form-select" @bind="@_smtpssl" >
<option value="True">@SharedLocalizer["Yes"]</option>
@@ -232,34 +221,29 @@
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="smtpauthentication" HelpText="Specify the SMTP authentication type" ResourceKey="SMTPAuthentication">Authentication: </Label>
<div class="col-sm-9">
<select id="smtpauthentication" class="form-select" value="@_smtpauthentication" @onchange="(e => SMTPAuthenticationChanged(e))">
<option value="Basic">@Localizer["Basic"]</option>
<option value="OAuth2">@Localizer["OAuth2"]</option>
</select>
</div>
</div>
@if (_smtpauthentication == "Basic")
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="username" HelpText="Enter the username for your SMTP account" ResourceKey="SmtpUsername">Username: </Label>
<div class="col-sm-9">
<input id="username" class="form-control" @bind="@_smtpusername" autocomplete="off" />
<input id="username" class="form-control" @bind="@_smtpusername" autocomplete="off"/>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="password" HelpText="Enter the password for your SMTP account" ResourceKey="SmtpPassword">Password: </Label>
<div class="col-sm-9">
<div class="input-group">
<input id="password" type="@_smtppasswordtype" class="form-control" @bind="@_smtppassword" autocomplete="off" />
<input id="password" type="@_smtppasswordtype" class="form-control" @bind="@_smtppassword" autocomplete="off"/>
<button type="button" class="btn btn-secondary" @onclick="@ToggleSMTPPassword" tabindex="-1">@_togglesmtppassword</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="relay" HelpText="Only specify this option if you have properly configured an SMTP Relay Service to route your outgoing mail. This option will send notifications from the user's email rather than from the Email Sender specified below." ResourceKey="SmtpRelay">Relay Configured? </Label>
<Label Class="col-sm-3" For="sender" HelpText="Enter the email which emails will be sent from. Please note that this email address may need to be authorized with the SMTP server." ResourceKey="SmtpSender">Email Sender: </Label>
<div class="col-sm-9">
<input id="sender" class="form-control" @bind="@_smtpsender" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="relay" HelpText="Only specify this option if you have properly configured an SMTP Relay Service to route your outgoing mail. This option will send notifications from the user's email rather than from the Email Sender specified above." ResourceKey="SmtpRelay">Relay Configured? </Label>
<div class="col-sm-9">
<select id="relay" class="form-select" @bind="@_smtprelay" required>
<option value="True">@SharedLocalizer["Yes"]</option>
@@ -267,41 +251,13 @@
</select>
</div>
</div>
}
else
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="smtpauthority" HelpText="The Authority Url for the SMTP provider" ResourceKey="SmtpAuthority">Authority Url:</Label>
<Label Class="col-sm-3" For="smtpenabled" HelpText="Specify if SMTP is enabled for this site" ResourceKey="SMTPEnabled">Enabled? </Label>
<div class="col-sm-9">
<input id="smtpauthority" class="form-control" @bind="@_smtpauthority" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="smtpclientid" HelpText="The Client ID for the SMTP provider" ResourceKey="SmtpClientID">Client ID:</Label>
<div class="col-sm-9">
<input id="smtpclientid" class="form-control" @bind="@_smtpclientid" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="smtpclientsecret" HelpText="The Client Secret for the SMTP provider" ResourceKey="SmtpClientSecret">Client Secret:</Label>
<div class="col-sm-9">
<div class="input-group">
<input type="@_smtpclientsecrettype" id="smtpclientsecret" class="form-control" @bind="@_smtpclientsecret" />
<button type="button" class="btn btn-secondary" @onclick="@ToggleSmtpClientSecret">@_togglesmtpclientsecret</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="smtpscopes" HelpText="A list of Scopes for the SMTP provider (separated by commas)" ResourceKey="SmtpScopes">Scopes:</Label>
<div class="col-sm-9">
<input id="smtpscopes" class="form-control" @bind="@_smtpscopes" />
</div>
</div>
}
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="sender" HelpText="Enter the email address which emails will be sent from. Please note that this email address usually needs to be authorized with the SMTP provider." ResourceKey="SmtpSender">Email Sender: </Label>
<div class="col-sm-9">
<input id="sender" class="form-control" @bind="@_smtpsender" />
<select id="smtpenabled" class="form-select" @bind="@_smtpenabled">
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
@@ -312,7 +268,6 @@
</div>
<button type="button" class="btn btn-secondary" @onclick="SendEmail">@Localizer["Smtp.TestConfig"]</button>
<br /><br />
}
</div>
</Section>
<Section Name="PWA" Heading="Progressive Web Application Settings" ResourceKey="PWASettings">
@@ -500,23 +455,16 @@
private string _headcontent = string.Empty;
private string _bodycontent = string.Empty;
private string _smtpenabled = "False";
private string _smtpauthentication = "Basic";
private string _smtphost = string.Empty;
private string _smtpport = string.Empty;
private string _smtpssl = "True";
private string _smtpssl = "False";
private string _smtpusername = string.Empty;
private string _smtppassword = string.Empty;
private string _smtppasswordtype = "password";
private string _togglesmtppassword = string.Empty;
private string _smtpauthority = string.Empty;
private string _smtpclientid = string.Empty;
private string _smtpclientsecret = string.Empty;
private string _smtpclientsecrettype = "password";
private string _togglesmtpclientsecret = string.Empty;
private string _smtpscopes = string.Empty;
private string _smtpsender = string.Empty;
private string _smtprelay = "False";
private string _smtpenabled = "True";
private int _retention = 30;
private string _pwaisenabled;
@@ -560,7 +508,7 @@
Site site = await SiteService.GetSiteAsync(PageState.Site.SiteId);
if (site != null)
{
_timezones = TimeZoneService.GetTimeZones();
_timezones = await TimeZoneService.GetTimeZonesAsync();
var settings = await SettingService.GetSiteSettingsAsync(site.SiteId);
_pages = await PageService.GetPagesAsync(PageState.Site.SiteId);
@@ -608,25 +556,16 @@
_bodycontent = site.BodyContent;
// SMTP
_smtpenabled = SettingService.GetSetting(settings, "SMTPEnabled", "False");
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
_smtphost = SettingService.GetSetting(settings, "SMTPHost", string.Empty);
_smtpport = SettingService.GetSetting(settings, "SMTPPort", string.Empty);
_smtpssl = SettingService.GetSetting(settings, "SMTPSSL", "False");
_smtpauthentication = SettingService.GetSetting(settings, "SMTPAuthentication", "Basic");
_smtpusername = SettingService.GetSetting(settings, "SMTPUsername", string.Empty);
_smtppassword = SettingService.GetSetting(settings, "SMTPPassword", string.Empty);
_togglesmtppassword = SharedLocalizer["ShowPassword"];
_smtpauthority = SettingService.GetSetting(settings, "SMTPAuthority", string.Empty);
_smtpclientid = SettingService.GetSetting(settings, "SMTPClientId", string.Empty);
_smtpclientsecret = SettingService.GetSetting(settings, "SMTPClientSecret", string.Empty);
_togglesmtpclientsecret = SharedLocalizer["ShowPassword"];
_smtpscopes = SettingService.GetSetting(settings, "SMTPScopes", string.Empty);
_smtpsender = SettingService.GetSetting(settings, "SMTPSender", string.Empty);
_smtprelay = SettingService.GetSetting(settings, "SMTPRelay", "False");
_smtpenabled = SettingService.GetSetting(settings, "SMTPEnabled", "True");
_retention = int.Parse(SettingService.GetSetting(settings, "NotificationRetention", "30"));
}
// PWA
_pwaisenabled = site.PwaIsEnabled.ToString();
@@ -803,23 +742,16 @@
// SMTP
var settings = await SettingService.GetSiteSettingsAsync(site.SiteId);
settings = SettingService.SetSetting(settings, "SMTPEnabled", _smtpenabled, true);
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
settings = SettingService.SetSetting(settings, "SMTPHost", _smtphost, true);
settings = SettingService.SetSetting(settings, "SMTPPort", _smtpport, true);
settings = SettingService.SetSetting(settings, "SMTPSSL", _smtpssl, true);
settings = SettingService.SetSetting(settings, "SMTPAuthentication", _smtpauthentication, true);
settings = SettingService.SetSetting(settings, "SMTPUsername", _smtpusername, true);
settings = SettingService.SetSetting(settings, "SMTPPassword", _smtppassword, true);
settings = SettingService.SetSetting(settings, "SMTPAuthority", _smtpauthority, true);
settings = SettingService.SetSetting(settings, "SMTPClientId", _smtpclientid, true);
settings = SettingService.SetSetting(settings, "SMTPClientSecret", _smtpclientsecret, true);
settings = SettingService.SetSetting(settings, "SMTPScopes", _smtpscopes, true);
settings = SettingService.SetSetting(settings, "SMTPSender", _smtpsender, true);
settings = SettingService.SetSetting(settings, "SMTPRelay", _smtprelay, true);
settings = SettingService.SetSetting(settings, "SMTPEnabled", _smtpenabled, true);
settings = SettingService.SetSetting(settings, "SiteGuid", _siteguid, true);
settings = SettingService.SetSetting(settings, "NotificationRetention", _retention.ToString(), true);
}
//cookie consent
settings = SettingService.SetSetting(settings, "CookieConsent", _cookieconsent);
@@ -827,7 +759,6 @@
// functionality
settings = SettingService.SetSetting(settings, "TextEditor", _textEditor);
settings = SettingService.SetSetting(settings, "SiteGuid", _siteguid, true);
await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId);
await logger.LogInformation("Site Settings Saved {Site}", site);
@@ -882,46 +813,6 @@
}
}
private void SMTPAuthenticationChanged(ChangeEventArgs e)
{
_smtpauthentication = (string)e.Value;
StateHasChanged();
}
private void SMTPEnabledChanged(ChangeEventArgs e)
{
_smtpenabled = (string)e.Value;
StateHasChanged();
}
private void ToggleSMTPPassword()
{
if (_smtppasswordtype == "password")
{
_smtppasswordtype = "text";
_togglesmtppassword = SharedLocalizer["HidePassword"];
}
else
{
_smtppasswordtype = "password";
_togglesmtppassword = SharedLocalizer["ShowPassword"];
}
}
private void ToggleSmtpClientSecret()
{
if (_smtpclientsecrettype == "password")
{
_smtpclientsecrettype = "text";
_togglesmtpclientsecret = SharedLocalizer["HidePassword"];
}
else
{
_smtpclientsecrettype = "password";
_togglesmtpclientsecret = SharedLocalizer["ShowPassword"];
}
}
private async Task SendEmail()
{
if (_smtphost != "" && _smtpport != "" && _smtpsender != "")
@@ -932,13 +823,8 @@
settings = SettingService.SetSetting(settings, "SMTPHost", _smtphost, true);
settings = SettingService.SetSetting(settings, "SMTPPort", _smtpport, true);
settings = SettingService.SetSetting(settings, "SMTPSSL", _smtpssl, true);
settings = SettingService.SetSetting(settings, "SMTPAuthentication", _smtpauthentication, true);
settings = SettingService.SetSetting(settings, "SMTPUsername", _smtpusername, true);
settings = SettingService.SetSetting(settings, "SMTPPassword", _smtppassword, true);
settings = SettingService.SetSetting(settings, "SMTPAuthority", _smtpauthority, true);
settings = SettingService.SetSetting(settings, "SMTPClientId", _smtpclientid, true);
settings = SettingService.SetSetting(settings, "SMTPClientSecret", _smtpclientsecret, true);
settings = SettingService.SetSetting(settings, "SMTPScopes", _smtpscopes, true);
settings = SettingService.SetSetting(settings, "SMTPSender", _smtpsender, true);
await SettingService.UpdateSiteSettingsAsync(settings, PageState.Site.SiteId);
await logger.LogInformation("Site SMTP Settings Saved");
@@ -959,6 +845,20 @@
}
}
private void ToggleSMTPPassword()
{
if (_smtppasswordtype == "password")
{
_smtppasswordtype = "text";
_togglesmtppassword = SharedLocalizer["HidePassword"];
}
else
{
_smtppasswordtype = "password";
_togglesmtppassword = SharedLocalizer["ShowPassword"];
}
}
private async Task GetAliases()
{
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))

View File

@@ -390,8 +390,6 @@ else
config.DatabaseType = tenant.DBType;
config.ConnectionString = tenant.DBConnectionString;
config.IsNewTenant = false;
config.HostEmail = PageState.User.Email;
config.HostName = PageState.User.DisplayName;
}
}
@@ -405,7 +403,6 @@ else
config.SiteTemplate = _sitetemplatetype;
config.RenderMode = _rendermode;
config.Runtime = _runtime;
config.Register = false;
ShowProgressIndicator();

View File

@@ -15,11 +15,12 @@
else
{
<ActionLink Action="Add" Text="Install Theme" ResourceKey="InstallTheme" />
<ActionLink Action="Create" Text="Create Theme" ResourceKey="CreateTheme" Class="btn btn-secondary ms-1" />
<button type="button" class="btn btn-secondary ms-1" @onclick="@Synchronize">@Localizer["Synchronize"]</button>
<ActionLink Action="Create" Text="Create Theme" ResourceKey="CreateTheme" Class="btn btn-secondary ps-2" />
<button type="button" class="btn btn-secondary pw-2" @onclick="@Synchronize">@Localizer["Synchronize"]</button>
<Pager Items="@_themes">
<Header>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
@@ -37,6 +38,7 @@ else
<ActionDialog Header="Delete Theme" Message="@string.Format(Localizer["Confirm.Theme.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTheme(context))" ResourceKey="DeleteTheme" />
}
</td>
<td><NavLink class="btn btn-secondary" href="@NavigateUrl("admin/site")">@Localizer["Assign"]</NavLink></td>
<td>@context.Name</td>
<td>@context.Version</td>
<td>

View File

@@ -367,6 +367,7 @@
}
@code {
private List<Models.TimeZone> _timezones;
private bool _initialized = false;
private string _passwordrequirements;
private string _username = string.Empty;
@@ -380,7 +381,6 @@
private string _displayname = string.Empty;
private FileManager _filemanager;
private int _folderid = -1;
private List<Models.TimeZone> _timezones;
private string _timezoneid = string.Empty;
private int _photofileid = -1;
private File _photo = null;
@@ -404,7 +404,7 @@
_togglepassword = SharedLocalizer["ShowPassword"];
_allowtwofactor = (SettingService.GetSetting(PageState.Site.Settings, "LoginOptions:TwoFactor", "false") == "true");
_profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId);
_timezones = TimeZoneService.GetTimeZones();
_timezones = await TimeZoneService.GetTimeZonesAsync();
if (PageState.User != null)
{
@@ -414,6 +414,11 @@
_displayname = PageState.User.DisplayName;
_timezoneid = PageState.User.TimeZoneId;
if (string.IsNullOrEmpty(_email))
{
AddModuleMessage(Localizer["Message.User.NoEmail"], MessageType.Warning);
}
// get user folder
var folder = await FolderService.GetFolderAsync(ModuleState.SiteId, PageState.User.FolderPath);
if (folder != null)

View File

@@ -28,15 +28,6 @@
<input id="email" class="form-control" @bind="@_email" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="confirmed" HelpText="Indicates if the user's email is verified" ResourceKey="Confirmed">Verified?</Label>
<div class="col-sm-9">
<select id="confirmed" class="form-select" @bind="@_confirmed">
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="displayname" HelpText="The full name of the user" ResourceKey="DisplayName"></Label>
<div class="col-sm-9">
@@ -129,7 +120,6 @@
private bool _initialized = false;
private string _username = string.Empty;
private string _email = string.Empty;
private string _confirmed = "True";
private string _displayname = string.Empty;
private string _timezoneid = string.Empty;
private string _notify = "True";
@@ -143,7 +133,7 @@
{
try
{
_timezones = TimeZoneService.GetTimeZones();
_timezones = await TimeZoneService.GetTimeZonesAsync();
_profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId);
_settings = new Dictionary<string, string>();
_timezoneid = PageState.Site.TimeZoneId;
@@ -179,7 +169,6 @@
user.Username = _username;
user.Password = ""; // will be auto generated
user.Email = _email;
user.EmailConfirmed = bool.Parse(_confirmed);
user.DisplayName = string.IsNullOrWhiteSpace(_displayname) ? _username : _displayname;
user.TimeZoneId = _timezoneid;
user.PhotoFileId = null;

View File

@@ -48,7 +48,7 @@
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="confirmed" HelpText="Indicates if the user's email is verified" ResourceKey="Confirmed">Verified?</Label>
<Label Class="col-sm-3" For="confirmed" HelpText="Indicates if the user's email is verified" ResourceKey="Confirmed">Confirmed?</Label>
<div class="col-sm-9">
<select id="confirmed" class="form-select" @bind="@_confirmed">
<option value="True">@SharedLocalizer["Yes"]</option>
@@ -153,13 +153,13 @@
<br />
<button type="button" class="btn btn-success" @onclick="SaveUser">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
@if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin) && PageState.Runtime != Shared.Runtime.Hybrid && !_ishost && _isdeleted != "True")
@if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin) && PageState.Runtime != Shared.Runtime.Hybrid && !_ishost)
{
<button type="button" class="btn btn-primary ms-1" @onclick="ImpersonateUser">@Localizer["Impersonate"]</button>
}
@if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host) && _isdeleted == "True")
{
<ActionDialog Header="Delete User" Message="Are You Sure You Wish To Permanently Delete This User?" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger ms-1" OnClick="@(async () => await DeleteUser())" ResourceKey="DeleteUser" />
<ActionDialog Header="Delete User" Message="Are You Sure You Wish To Permanently Delete This User?" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteUser())" ResourceKey="DeleteUser" />
}
<br /><br />
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo>
@@ -204,7 +204,7 @@
_passwordrequirements = await UserService.GetPasswordRequirementsAsync(PageState.Site.SiteId);
_togglepassword = SharedLocalizer["ShowPassword"];
_profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId);
_timezones = TimeZoneService.GetTimeZones();
_timezones = await TimeZoneService.GetTimeZonesAsync();
if (PageState.QueryString.ContainsKey("id") && int.TryParse(PageState.QueryString["id"], out int UserId))
{

View File

@@ -17,21 +17,8 @@ else
{
<TabStrip>
<TabPanel Name="Users" Heading="Users" ResourceKey="Users">
<div class="container">
<div class="row mb-1 align-items-center">
<div class="col-sm-6">
<ActionLink Action="Add" Text="Add User" Security="SecurityAccessLevel.Edit" ResourceKey="AddUser" />&nbsp;
<ActionLink Text="Import Users" Class="btn btn-secondary ms-2" Action="Users" Security="SecurityAccessLevel.Admin" ResourceKey="ImportUsers" />
</div>
<div class="col-sm-6">
<select id="deleted" class="form-select custom-select" value="@_deleted" @onchange="(e => DeletedChanged(e))">
<option value="false">@Localizer["Active Users"]</option>
<option value="true">@Localizer["Deleted Users"]</option>
</select>
</div>
</div>
</div>
<br />
<ActionLink Text="Import Users" Class="btn btn-secondary ms-2" Action="Users" Security="SecurityAccessLevel.Admin" ResourceKey="ImportUsers"/>
<Pager Items="@users" RowClass="align-middle" SearchProperties="User.Username,User.Email,User.DisplayName">
<Header>
@@ -87,19 +74,10 @@ else
<input id="profileurl" class="form-control" @bind="@_profileurl" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="requireconfirmedemail" HelpText="Do you want to require registered users to verify their email address before they are allowed to log in?" ResourceKey="RequireConfirmedEmail">Require Verified Email?</Label>
<div class="col-sm-9">
<select id="requireconfirmedemail" class="form-select" @bind="@_requireconfirmedemail">
<option value="true">@SharedLocalizer["Yes"]</option>
<option value="false">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
@if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="twofactor" HelpText="Do you want users to use two factor authentication? Note that you should use the Disabled option until you have successfully verified that the Notification Job in Scheduled Jobs is enabled and your SMTP options in Site Settings are configured or else you will lock yourself out." ResourceKey="TwoFactor">Two Factor Authentication?</Label>
<Label Class="col-sm-3" For="twofactor" HelpText="Do you want users to use two factor authentication? Note that you should use the Disabled option until you have successfully verified that the Notification Job in Scheduled Jobs is enabled and your SMTP options in Site Settings are configured or else you will lock yourself out." ResourceKey="TwoFactor">Two Factor?</Label>
<div class="col-sm-9">
<select id="twofactor" class="form-select" @bind="@_twofactor">
<option value="false">@Localizer["Disabled"]</option>
@@ -508,12 +486,10 @@ else
@code {
private List<UserRole> users;
private string _deleted = "false";
private string _allowregistration;
private string _registerurl;
private string _profileurl;
private string _requireconfirmedemail;
private string _twofactor;
private string _cookiename;
private string _cookieexpiration;
@@ -578,13 +554,12 @@ else
protected override async Task OnInitializedAsync()
{
await LoadUsersAsync();
await LoadUsersAsync(true);
var settings = await SettingService.GetSiteSettingsAsync(PageState.Site.SiteId);
_allowregistration = PageState.Site.AllowRegistration.ToString().ToLower();
_registerurl = SettingService.GetSetting(settings, "LoginOptions:RegisterUrl", "");
_profileurl = SettingService.GetSetting(settings, "LoginOptions:ProfileUrl", "");
_requireconfirmedemail = SettingService.GetSetting(settings, "LoginOptions:RequireConfirmedEmail", "true");
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
@@ -650,7 +625,9 @@ else
_allowsitelogin = SettingService.GetSetting(settings, "LoginOptions:AllowSiteLogin", "true");
}
private async Task LoadUsersAsync()
private async Task LoadUsersAsync(bool load)
{
if (load)
{
users = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId, RoleNames.Registered);
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
@@ -659,20 +636,6 @@ else
users.AddRange(hosts);
users = users.OrderBy(u => u.User.DisplayName).ToList();
}
users = users.Where(item => item.User.IsDeleted == bool.Parse(_deleted)).ToList();
}
private async void DeletedChanged(ChangeEventArgs e)
{
try
{
_deleted = e.Value.ToString();
await LoadUsersAsync();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On DeletedChanged");
}
}
@@ -698,7 +661,7 @@ else
await logger.LogInformation("User {Username} Expired From Role {Role}", userrole.User.Username, userrole.Role.Name);
}
AddModuleMessage(Localizer["Success.DeleteUser"], MessageType.Success);
await LoadUsersAsync();
await LoadUsersAsync(true);
StateHasChanged();
}
catch (Exception ex)
@@ -722,7 +685,6 @@ else
{
settings = SettingService.SetSetting(settings, "LoginOptions:RegisterUrl", _registerurl, false);
settings = SettingService.SetSetting(settings, "LoginOptions:ProfileUrl", _profileurl, false);
settings = SettingService.SetSetting(settings, "LoginOptions:RequireConfirmedEmail", _requireconfirmedemail, false);
settings = SettingService.SetSetting(settings, "LoginOptions:TwoFactor", _twofactor, false);
settings = SettingService.SetSetting(settings, "LoginOptions:CookieName", _cookiename, true);
settings = SettingService.SetSetting(settings, "LoginOptions:CookieExpiration", _cookieexpiration, true);

View File

@@ -52,7 +52,7 @@
if (CreatedOn != null)
{
_text += $" {Localizer["On"]} <b>{UtcToLocal(CreatedOn).Value.ToString(DateTimeFormat)}</b>";
_text += $" {Localizer["On"]} <b>{UtcToLocal(CreatedOn).Value.ToString(DateTimeFormat)}</ b >";
}
_text += "</p>";
@@ -69,7 +69,7 @@
if (ModifiedOn != null)
{
_text += $" {Localizer["On"]} <b>{UtcToLocal(ModifiedOn).Value.ToString(DateTimeFormat)}</b>";
_text += $" {Localizer["On"]} <b>{UtcToLocal(ModifiedOn).Value.ToString(DateTimeFormat)}</ b >";
}
_text += "</p>";
@@ -86,7 +86,7 @@
if (DeletedOn != null)
{
_text += $" {Localizer["On"]} <b>{UtcToLocal(DeletedOn).Value.ToString(DateTimeFormat)}</b>";
_text += $" {Localizer["On"]} <b>{UtcToLocal(DeletedOn).Value.ToString(DateTimeFormat)}</ b >";
}
_text += "</p>";

View File

@@ -107,7 +107,7 @@
@code {
private bool _initialized = false;
private List<Folder> _folders = new List<Folder>();
private List<Folder> _folders;
private List<File> _files = new List<File>();
private string _fileinputid = string.Empty;
private string _progressinfoid = string.Empty;
@@ -157,9 +157,6 @@
[Parameter]
public bool UploadMultiple { get; set; } = false; // optional - enable multiple file uploads - default false
[Parameter]
public bool AnonymizeUploadFilenames { get; set; } = false; // optional - indicate if file names should be anonymized on upload - default false
[Parameter]
public int ChunkSize { get; set; } = 1; // optional - size of file chunks to upload in MB
@@ -198,10 +195,8 @@
Filter = "nupkg";
ShowSuccess = true;
}
else
{
// folder path specified rather than folderid
if (!string.IsNullOrEmpty(Folder))
if (!string.IsNullOrEmpty(Folder) && Folder != Constants.PackagesFolder)
{
Folder folder = await FolderService.GetFolderAsync(ModuleState.SiteId, Folder);
if (folder != null)
@@ -215,7 +210,6 @@
_messagetype = MessageType.Error;
}
}
}
if (ShowFolders)
{
@@ -248,24 +242,25 @@
}
}
await SetImage();
if (!string.IsNullOrEmpty(Filter))
{
_filter = "." + Filter.Replace(",", ",.");
}
GetFolderPermission();
await SetImage();
await GetFiles();
_initialized = true;
}
private void GetFolderPermission()
private async Task GetFiles()
{
_haseditpermission = false;
if (Folder == Constants.PackagesFolder)
{
_haseditpermission = UserSecurity.IsAuthorized(PageState.User, RoleNames.Host);
_files = new List<File>();
}
else
{
@@ -273,44 +268,6 @@
if (folder != null)
{
_haseditpermission = UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, folder.PermissionList);
}
else
{
_haseditpermission = false;
}
}
}
private async Task SetImage()
{
_image = string.Empty;
_file = null;
if (FileId != -1)
{
_file = await FileService.GetFileAsync(FileId);
if (_file != null && ShowImage && _file.ImageHeight != 0 && _file.ImageWidth != 0)
{
var maxwidth = 200;
var maxheight = 200;
var ratioX = (double)maxwidth / (double)_file.ImageWidth;
var ratioY = (double)maxheight / (double)_file.ImageHeight;
var ratio = ratioX < ratioY ? ratioX : ratioY;
_image = "<img src=\"" + _file.Url + "\" alt=\"" + _file.Name +
"\" width=\"" + Convert.ToInt32(_file.ImageWidth * ratio).ToString() +
"\" height=\"" + Convert.ToInt32(_file.ImageHeight * ratio).ToString() + "\" />";
}
}
}
private async Task GetFiles()
{
if (ShowFiles)
{
Folder folder = _folders.FirstOrDefault(item => item.FolderId == FolderId);
if (folder != null)
{
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Browse, folder.PermissionList))
{
_files = await FileService.GetFilesAsync(FolderId);
@@ -322,6 +279,7 @@
}
else
{
_haseditpermission = false;
_files = new List<File>();
}
if (_filter != "*")
@@ -345,11 +303,12 @@
try
{
FolderId = int.Parse((string)e.Value);
await OnSelectFolder.InvokeAsync(FolderId);
FileId = -1;
GetFolderPermission();
await SetImage();
await GetFiles();
FileId = -1;
_file = null;
_image = string.Empty;
await OnSelectFolder.InvokeAsync(FolderId);
StateHasChanged();
}
catch (Exception ex)
@@ -364,14 +323,37 @@
{
_message = string.Empty;
FileId = int.Parse((string)e.Value);
await SetImage();
#pragma warning disable CS0618
await OnSelect.InvokeAsync(FileId);
#pragma warning restore CS0618
await OnSelectFile.InvokeAsync(FileId);
await SetImage();
StateHasChanged();
}
private async Task SetImage()
{
_image = string.Empty;
_file = null;
if (FileId != -1)
{
_file = await FileService.GetFileAsync(FileId);
if (_file != null && ShowImage && _file.ImageHeight != 0 && _file.ImageWidth != 0)
{
var maxwidth = 200;
var maxheight = 200;
var ratioX = (double)maxwidth / (double)_file.ImageWidth;
var ratioY = (double)maxheight / (double)_file.ImageHeight;
var ratio = ratioX < ratioY ? ratioX : ratioY;
_image = "<img src=\"" + _file.Url + "\" alt=\"" + _file.Name +
"\" width=\"" + Convert.ToInt32(_file.ImageWidth * ratio).ToString() +
"\" height=\"" + Convert.ToInt32(_file.ImageHeight * ratio).ToString() + "\" />";
}
}
}
private async Task UploadFiles()
{
_message = string.Empty;
@@ -426,7 +408,7 @@
}
// upload files
var success = await interop.UploadFiles(posturl, folder, _guid, SiteState.AntiForgeryToken, jwt, chunksize, AnonymizeUploadFilenames, tokenSource.Token);
var success = await interop.UploadFiles(posturl, folder, _guid, SiteState.AntiForgeryToken, jwt, chunksize, tokenSource.Token);
// reset progress indicators
if (ShowProgress)
@@ -448,27 +430,6 @@
_message = Localizer["Success.File.Upload"];
_messagetype = MessageType.Success;
}
FileId = -1;
if (Folder != Constants.PackagesFolder && !AnonymizeUploadFilenames)
{
// set FileId to first file in upload collection
var file = await FileService.GetFileAsync(int.Parse(folder), uploads[0].Split(":")[0]);
if (file != null)
{
FileId = file.FileId;
}
}
await OnUpload.InvokeAsync(FileId);
#pragma warning disable CS0618
await OnSelect.InvokeAsync(FileId);
#pragma warning restore CS0618
await OnSelectFile.InvokeAsync(FileId);
await SetImage();
await GetFiles();
StateHasChanged();
}
else
{
@@ -476,6 +437,28 @@
_message = Localizer["Error.File.Upload"];
_messagetype = MessageType.Error;
}
if (Folder == Constants.PackagesFolder)
{
await OnUpload.InvokeAsync(-1);
}
else
{
// set FileId to first file in upload collection
var file = await FileService.GetFileAsync(int.Parse(folder), uploads[0].Split(":")[0]);
if (file != null)
{
FileId = file.FileId;
await SetImage();
#pragma warning disable CS0618
await OnSelect.InvokeAsync(FileId);
#pragma warning restore CS0618
await OnSelectFile.InvokeAsync(FileId);
await OnUpload.InvokeAsync(FileId);
}
await GetFiles();
StateHasChanged();
}
}
catch (Exception ex)
{
@@ -488,6 +471,7 @@
finally {
tokenSource.Dispose();
}
}
else
{
@@ -517,14 +501,13 @@
_messagetype = MessageType.Success;
}
await GetFiles();
FileId = -1;
await SetImage();
#pragma warning disable CS0618
await OnSelect.InvokeAsync(FileId);
#pragma warning restore CS0618
await OnSelectFile.InvokeAsync(FileId);
await SetImage();
await GetFiles();
StateHasChanged();
}
catch (Exception ex)
@@ -550,16 +533,15 @@
public async Task Refresh(int fileId)
{
await GetFiles();
FileId = -1;
if (fileId != -1)
{
var file = _files.Where(item => item.FileId == fileId).FirstOrDefault();
if (file != null)
{
FileId = file.FileId;
}
}
await SetImage();
}
}
StateHasChanged();
}
}

View File

@@ -9,7 +9,7 @@
@if (_permissions != null)
{
<div class="container">
<div class="container">
<div class="row">
<div class="col">
<table class="table table-borderless">
@@ -28,7 +28,7 @@
@foreach (var permissionname in _permissionnames)
{
<td style="text-align: center;">
<TriStateCheckBox Value="@GetPermissionValue(permissionname, role.Name, -1)" Disabled="@GetPermissionDisabled(permissionname, role.Name)" OnChange="@(e => PermissionChanged(e, permissionname, role.Name, -1))" />
<TriStateCheckBox Value=@GetPermissionValue(permissionname, role.Name, -1) Disabled="@GetPermissionDisabled(permissionname, role.Name)" OnChange="@(e => PermissionChanged(e, permissionname, role.Name, -1))" />
</td>
}
</tr>
@@ -64,7 +64,7 @@
@foreach (var permissionname in _permissionnames)
{
<td style="text-align: center; width: 1px;">
<TriStateCheckBox Value="@GetPermissionValue(permissionname, "", user.UserId)" Disabled="@GetPermissionDisabled(permissionname, "")" OnChange="@(e => PermissionChanged(e, permissionname, "", user.UserId))" />
<TriStateCheckBox Value=@GetPermissionValue(permissionname, "", user.UserId) Disabled="@GetPermissionDisabled(permissionname, "")" OnChange="@(e => PermissionChanged(e, permissionname, "", user.UserId))" />
</td>
}
</tr>
@@ -88,7 +88,7 @@
<ModuleMessage Type="MessageType.Warning" Message="@_message" />
</div>
</div>
</div>
</div>
}
@code {
@@ -119,7 +119,10 @@
}
_roles = await RoleService.GetRolesAsync(ModuleState.SiteId, true);
_roles.RemoveAll(item => item.Name == RoleNames.Host); // remove host role
if (!UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
_roles.RemoveAll(item => item.Name == RoleNames.Host);
}
// get permission names
if (string.IsNullOrEmpty(PermissionNames))
@@ -219,24 +222,24 @@
private bool GetPermissionDisabled(string permissionName, string roleName)
{
var disabled = false;
// administrator role permissions can only be changed by a host
if (roleName == RoleNames.Admin && !UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
disabled = true;
return true;
}
// API permissions can only be changed by an administrator
else
{
if (GetEntityName(permissionName) != EntityName && !UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
{
disabled = true;
return true;
}
else
{
return false;
}
}
}
return disabled;
}
private bool? PermissionChanged(bool? value, string permissionName, string roleName, int userId)
private void PermissionChanged(bool? value, string permissionName, string roleName, int userId)
{
if (roleName != "")
{
@@ -245,14 +248,6 @@
{
_permissions.Remove(permission);
}
// system roles cannot be denied - only custom roles can be denied
var role = _roles.FirstOrDefault(item => item.Name == roleName);
if (value != null && !value.Value && role.IsSystem)
{
value = null;
}
if (value != null)
{
_permissions.Add(new Permission(ModuleState.SiteId, GetEntityName(permissionName), GetPermissionName(permissionName), roleName, null, value.Value));
@@ -270,7 +265,6 @@
_permissions.Add(new Permission(ModuleState.SiteId, GetEntityName(permissionName), GetPermissionName(permissionName), null, userId, value.Value));
}
}
return value;
}
private async Task<Dictionary<string, string>> GetUsers(string filter)
@@ -311,20 +305,29 @@
private void ValidatePermissions()
{
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
// remove host role permissions
var permissions = _permissions.Where(item => item.RoleName == RoleNames.Host).ToList();
// remove deny all users, unauthenticated, and registered users
var permissions = _permissions.Where(item => !item.IsAuthorized &&
(item.RoleName == RoleNames.Everyone || item.RoleName == RoleNames.Unauthenticated || item.RoleName == RoleNames.Registered)).ToList();
foreach (var permission in permissions)
{
_permissions.Remove(permission);
}
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
// remove deny administrators and host users
permissions = _permissions.Where(item => !item.IsAuthorized &&
(item.RoleName == RoleNames.Admin || item.RoleName == RoleNames.Host)).ToList();
foreach (var permission in permissions)
{
_permissions.Remove(permission);
}
// add host role permissions if administrator role is not assigned (to prevent lockout)
foreach (var permissionname in _permissionnames)
{
if (!_permissions.Any(item => item.EntityName == GetEntityName(permissionname) && item.PermissionName == GetPermissionName(permissionname) && item.RoleName == RoleNames.Admin))
// add administrators role if neither host or administrator is assigned
if (!_permissions.Any(item => item.EntityName == GetEntityName(permissionname) && item.PermissionName == GetPermissionName(permissionname) &&
(item.RoleName == RoleNames.Admin || item.RoleName == RoleNames.Host)))
{
_permissions.Add(new Permission(ModuleState.SiteId, GetEntityName(permissionname), GetPermissionName(permissionname), RoleNames.Host, null, true));
_permissions.Add(new Permission(ModuleState.SiteId, GetEntityName(permissionname), GetPermissionName(permissionname), RoleNames.Admin, null, true));
}
}
}

View File

@@ -16,7 +16,7 @@
public bool Disabled { get; set; }
[Parameter]
public Func<bool?, bool?> OnChange { get; set; }
public Action<bool?> OnChange { get; set; }
protected override void OnInitialized()
{
@@ -41,14 +41,12 @@
break;
}
_value = OnChange(_value);
SetImage();
OnChange(_value);
}
}
private void SetImage()
{
if (!Disabled)
{
switch (_value)
{
@@ -65,12 +63,6 @@
_title = string.Empty;
break;
}
}
else
{
_src = "images/disabled.png";
_title = Localizer["PermissionDisabled"];
}
StateHasChanged();
}

View File

@@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using Oqtane.Enums;
using Oqtane.Models;
using Oqtane.Security;
using Oqtane.Services;
using Oqtane.Shared;
using Oqtane.UI;
@@ -148,7 +147,6 @@ namespace Oqtane.Modules
}
// fingerprint hash code for static assets
public string Fingerprint
{
get
@@ -157,18 +155,6 @@ namespace Oqtane.Modules
}
}
// authorization methods
public bool IsAuthorizedRole(string roleName)
{
return UserSecurity.IsAuthorized(PageState.User, roleName);
}
public bool IsAuthorizedPermission(string permissionName)
{
return UserSecurity.IsAuthorized(PageState.User, permissionName, ModuleState.PermissionList);
}
// url methods
// navigate url
@@ -431,9 +417,6 @@ namespace Oqtane.Modules
await interop.ScrollTo(0, 0, "smooth");
}
// token replace methods
public string ReplaceTokens(string content)
{
return ReplaceTokens(content, null);
@@ -517,46 +500,33 @@ namespace Oqtane.Modules
};
}
// date conversion methods
// date methods
public DateTime? UtcToLocal(DateTime? datetime)
{
// Early return if input is null
if (datetime == null || datetime.Value == DateTime.MinValue || datetime.Value == DateTime.MaxValue)
return datetime;
string timezoneId = null;
TimeZoneInfo timezone = null;
if (PageState.User != null && !string.IsNullOrEmpty(PageState.User.TimeZoneId))
{
timezoneId = PageState.User.TimeZoneId;
timezone = TimeZoneInfo.FindSystemTimeZoneById(PageState.User.TimeZoneId);
}
else if (!string.IsNullOrEmpty(PageState.Site.TimeZoneId))
{
timezoneId = PageState.Site.TimeZoneId;
timezone = TimeZoneInfo.FindSystemTimeZoneById(PageState.Site.TimeZoneId);
}
return Utilities.UtcAsLocalDateTime(datetime, timezoneId);
return Utilities.UtcAsLocalDateTime(datetime, timezone);
}
public DateTime? LocalToUtc(DateTime? datetime)
{
// Early return if input is null
if (datetime == null || datetime.Value == DateTime.MinValue || datetime.Value == DateTime.MaxValue)
return datetime;
string timezoneId = null;
TimeZoneInfo timezone = null;
if (PageState.User != null && !string.IsNullOrEmpty(PageState.User.TimeZoneId))
{
timezoneId = PageState.User.TimeZoneId;
timezone = TimeZoneInfo.FindSystemTimeZoneById(PageState.User.TimeZoneId);
}
else if (!string.IsNullOrEmpty(PageState.Site.TimeZoneId))
{
timezoneId = PageState.Site.TimeZoneId;
timezone = TimeZoneInfo.FindSystemTimeZoneById(PageState.Site.TimeZoneId);
}
return Utilities.LocalDateAndTimeAsUtc(datetime, timezoneId);
return Utilities.LocalDateAndTimeAsUtc(datetime, timezone);
}
// logging methods

View File

@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
<Configurations>Debug;Release</Configurations>
<Version>6.1.5</Version>
<Version>6.1.3</Version>
<Product>Oqtane</Product>
<Authors>Shaun Walker</Authors>
<Company>.NET Foundation</Company>
@@ -12,7 +12,7 @@
<Copyright>.NET Foundation</Copyright>
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.3</PackageReleaseNotes>
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<RootNamespace>Oqtane</RootNamespace>
@@ -22,10 +22,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.5" />
</ItemGroup>
<ItemGroup>

View File

@@ -133,7 +133,7 @@
<value>External Login Could Not Be Linked. Please Contact Your Administrator For Further Instructions.</value>
</data>
<data name="Error.Login.Fail" xml:space="preserve">
<value>Login Failed. Please Remember That Passwords Are Case Sensitive. If You Have Attempted To Sign In Multiple Times Unsuccessfully, Your Account Will Be Locked Out For A Period Of Time. Note That New User Accounts Often Require Email Address Verification So You May Wish To Check Your Email For A Notification Containing Further Instructions.</value>
<value>Login Failed. Please Remember That Passwords Are Case Sensitive. If You Have Attempted To Sign In Multiple Times Unsuccessfully, Your Account Will Be Locked Out For A Period Of Time. Note That User Accounts Often Require Email Address Verification So You May Wish To Check Your Email For A Notification.</value>
</data>
<data name="Message.Required.UserInfo" xml:space="preserve">
<value>Please Provide All Required Fields</value>

View File

@@ -192,7 +192,7 @@
<data name="Port.HelpText" xml:space="preserve">
<value>Enter the port number for the SMTP server. Please note this field is required if you provide a host name.</value>
</data>
<data name="SmtpSSL.HelpText" xml:space="preserve">
<data name="UseSsl.HelpText" xml:space="preserve">
<value>Specify if SSL is required for your SMTP server</value>
</data>
<data name="SmtpUsername.HelpText" xml:space="preserve">
@@ -202,7 +202,7 @@
<value>Enter the password for your SMTP account</value>
</data>
<data name="SmtpSender.HelpText" xml:space="preserve">
<value>Enter the email address which emails will be sent from. Please note that this email address usually needs to be authorized with the SMTP server.</value>
<value>Enter the email which emails will be sent from. Please note that this email address may need to be authorized with the SMTP server.</value>
</data>
<data name="EnablePWA.HelpText" xml:space="preserve">
<value>Select whether you would like this site to be available as a Progressive Web Application (PWA)</value>
@@ -240,8 +240,8 @@
<data name="Port.Text" xml:space="preserve">
<value>Port: </value>
</data>
<data name="SmtpSSL.Text" xml:space="preserve">
<value>SSL Required: </value>
<data name="UseSsl.Text" xml:space="preserve">
<value>SSL Enabled: </value>
</data>
<data name="SmtpUsername.Text" xml:space="preserve">
<value>Username: </value>
@@ -372,10 +372,10 @@
<data name="PageContent.Heading" xml:space="preserve">
<value>Page Content</value>
</data>
<data name="SmtpEnabled.HelpText" xml:space="preserve">
<data name="SMTPEnabled.HelpText" xml:space="preserve">
<value>Specify if SMTP is enabled for this site</value>
</data>
<data name="SmtpEnabled.Text" xml:space="preserve">
<data name="SMTPEnabled.Text" xml:space="preserve">
<value>Enabled?</value>
</data>
<data name="Version.HelpText" xml:space="preserve">
@@ -453,40 +453,4 @@
<data name="TimeZone.HelpText" xml:space="preserve">
<value>The default time zone for the site</value>
</data>
<data name="Basic" xml:space="preserve">
<value>Basic</value>
</data>
<data name="OAuth2" xml:space="preserve">
<value>OAuth 2.0 (OAuth2)</value>
</data>
<data name="SmtpAuthentication.Text" xml:space="preserve">
<value>Authentication:</value>
</data>
<data name="SmtpAuthentication.HelpText" xml:space="preserve">
<value>Specify the SMTP authentication type</value>
</data>
<data name="SmtpClientID.Text" xml:space="preserve">
<value>Client ID:</value>
</data>
<data name="SmtpClientID.HelpText" xml:space="preserve">
<value>The Client ID for the SMTP provider</value>
</data>
<data name="SmtpClientSecret.Text" xml:space="preserve">
<value>Client Secret:</value>
</data>
<data name="SmtpClientSecret.HelpText" xml:space="preserve">
<value>The Client Secret for the SMTP provider</value>
</data>
<data name="SmtpScopes.Text" xml:space="preserve">
<value>Scopes:</value>
</data>
<data name="SmtpScopes.HelpText" xml:space="preserve">
<value>A list of Scopes for the SMTP provider (separated by commas)</value>
</data>
<data name="SmtpAuthority.Text" xml:space="preserve">
<value>Authority Url:</value>
</data>
<data name="SmtpAuthority.HelpText" xml:space="preserve">
<value>The Authority Url for the SMTP provider</value>
</data>
</root>

View File

@@ -156,6 +156,9 @@
<data name="Enabled" xml:space="preserve">
<value>Enabled?</value>
</data>
<data name="Assign" xml:space="preserve">
<value>Assign</value>
</data>
<data name="Synchronize" xml:space="preserve">
<value>Check For Updates</value>
</data>

View File

@@ -147,6 +147,9 @@
<data name="Message.User.NoLogIn" xml:space="preserve">
<value>Current User Is Not Logged In</value>
</data>
<data name="Message.User.NoEmail" xml:space="preserve">
<value>You Must Provide An Email Address For Your User Account</value>
</data>
<data name="Error.Profile.Load" xml:space="preserve">
<value>Error Loading User Profile</value>
</data>

View File

@@ -162,10 +162,4 @@
<data name="TimeZone.HelpText" xml:space="preserve">
<value>The user's time zone</value>
</data>
<data name="Confirmed.Text" xml:space="preserve">
<value>Verified?</value>
</data>
<data name="Confirmed.HelpText" xml:space="preserve">
<value>Indicates if the user's email is verified</value>
</data>
</root>

View File

@@ -217,7 +217,7 @@
<value>The user's time zone</value>
</data>
<data name="Confirmed.Text" xml:space="preserve">
<value>Verified?</value>
<value>Confirmed?</value>
</data>
<data name="Confirmed.HelpText" xml:space="preserve">
<value>Indicates if the user's email is verified</value>

View File

@@ -370,13 +370,7 @@
<value>Do you want users to use two factor authentication? Note that you should use the Disabled option until you have successfully verified that the Notification Job in Scheduled Jobs is enabled and your SMTP options in Site Settings are configured or else you will lock yourself out.</value>
</data>
<data name="TwoFactor.Text" xml:space="preserve">
<value>Two Factor Authentication?</value>
</data>
<data name="RequireConfirmedEmail.HelpText" xml:space="preserve">
<value>Do you want to require registered users to verify their email address before they are allowed to log in?</value>
</data>
<data name="RequireConfirmedEmail.Text" xml:space="preserve">
<value>Require Verified Email?</value>
<value>Two Factor?</value>
</data>
<data name="Disabled" xml:space="preserve">
<value>Disabled</value>
@@ -508,7 +502,7 @@
<value>Info</value>
</data>
<data name="OAuth2" xml:space="preserve">
<value>OAuth 2.0 (OAuth2)</value>
<value>OAuth 2.0</value>
</data>
<data name="OIDC" xml:space="preserve">
<value>OpenID Connect (OIDC)</value>
@@ -537,10 +531,4 @@
<data name="AllowHostRole.HelpText" xml:space="preserve">
<value>Indicate if host roles are supported from the identity provider. Please use caution with this option as it allows the host user to administrate every site within your installation.</value>
</data>
<data name="Active Users" xml:space="preserve">
<value>Active Users</value>
</data>
<data name="Deleted Users" xml:space="preserve">
<value>Deleted Users</value>
</data>
</root>

View File

@@ -123,7 +123,4 @@
<data name="PermissionDenied" xml:space="preserve">
<value>Permission Denied</value>
</data>
<data name="PermissionDisabled" xml:space="preserve">
<value>Permission Disabled</value>
</data>
</root>

View File

@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -8,46 +8,6 @@ using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve and store <see cref="Alias"/> information.
/// </summary>
public interface IAliasService
{
/// <summary>
/// Get all aliases in the system
/// </summary>
/// <returns></returns>
Task<List<Alias>> GetAliasesAsync();
/// <summary>
/// Get a single alias
/// </summary>
/// <param name="aliasId">The <see cref="Oqtane.Models.Alias"/> ID, not to be confused with a <see cref="Oqtane.Models.Site"/> ID</param>
/// <returns></returns>
Task<Alias> GetAliasAsync(int aliasId);
/// <summary>
/// Save another <see cref="Oqtane.Models.Alias"/> in the DB. It must already contain all the information incl. <see cref="Oqtane.Models.Tenant"/> it belongs to.
/// </summary>
/// <param name="alias">An <see cref="Oqtane.Models.Alias"/> to add.</param>
/// <returns></returns>
Task<Alias> AddAliasAsync(Alias alias);
/// <summary>
/// Update an <see cref="Oqtane.Models.Alias"/> in the DB. Make sure the object is correctly filled, as it must update an existing record.
/// </summary>
/// <param name="alias">The <see cref="Oqtane.Models.Alias"/> to update.</param>
/// <returns></returns>
Task<Alias> UpdateAliasAsync(Alias alias);
/// <summary>
/// Remove an <see cref="Oqtane.Models.Alias"/> from the DB.
/// </summary>
/// <param name="aliasId">The Alias ID, not to be confused with a Site ID.</param>
/// <returns></returns>
Task DeleteAliasAsync(int aliasId);
}
/// <inheritdoc cref="IAliasService" />
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class AliasService : ServiceBase, IAliasService

View File

@@ -1,46 +1,13 @@
using Oqtane.Models;
using System.Threading.Tasks;
using System.Net.Http;
using System;
using Oqtane.Documentation;
using Oqtane.Shared;
using System.Globalization;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve cookie consent information.
/// </summary>
public interface ICookieConsentService
{
/// <summary>
/// Get cookie consent bar actioned status
/// </summary>
/// <returns></returns>
Task<bool> IsActionedAsync();
/// <summary>
/// Get cookie consent status
/// </summary>
/// <returns></returns>
Task<bool> CanTrackAsync(bool optOut);
/// <summary>
/// create actioned cookie
/// </summary>
/// <returns></returns>
Task<string> CreateActionedCookieAsync();
/// <summary>
/// create consent cookie
/// </summary>
/// <returns></returns>
Task<string> CreateConsentCookieAsync();
/// <summary>
/// widhdraw consent cookie
/// </summary>
/// <returns></returns>
Task<string> WithdrawConsentCookieAsync();
}
/// <inheritdoc cref="ICookieConsentService" />
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class CookieConsentService : ServiceBase, ICookieConsentService

View File

@@ -8,18 +8,6 @@ using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve <see cref="Database"/> information.
/// </summary>
public interface IDatabaseService
{
/// <summary>
/// Returns a list of databases
/// </summary>
/// <returns></returns>
Task<List<Database>> GetDatabasesAsync();
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class DatabaseService : ServiceBase, IDatabaseService
{

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@@ -9,103 +10,6 @@ using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to get / create / upload / download files.
/// </summary>
public interface IFileService
{
/// <summary>
/// Get all <see cref="File"/>s in the specified Folder
/// </summary>
/// <param name="folderId">The folder ID</param>
/// <returns></returns>
Task<List<File>> GetFilesAsync(int folderId);
/// <summary>
/// Get all <see cref="File"/>s in the specified folder.
/// </summary>
/// <param name="folder">
/// The folder path relative to where the files are stored.
/// TODO: todoc verify exactly from where the folder path must start
/// </param>
/// <returns></returns>
Task<List<File>> GetFilesAsync(string folder);
/// <summary>
/// Get one <see cref="File"/>
/// </summary>
/// <param name="fileId"></param>
/// <returns></returns>
Task<File> GetFileAsync(int fileId);
/// <summary>
/// Get a <see cref="File"/> based on the <see cref="Folder"/> and file name.
/// </summary>
/// <param name="folderId">Reference to the <see cref="Folder"/></param>
/// <param name="name">name of the file
/// </param>
/// <returns></returns>
Task<File> GetFileAsync(int folderId, string name);
/// <summary>
/// Add / store a <see cref="File"/> record.
/// This does not contain the file contents.
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
Task<File> AddFileAsync(File file);
/// <summary>
/// Update a <see cref="File"/> record.
/// Use this for rename a file or change some attributes.
/// This does not contain the file contents.
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
Task<File> UpdateFileAsync(File file);
/// <summary>
/// Delete a <see cref="File"/>
/// </summary>
/// <param name="fileId"></param>
/// <returns></returns>
Task DeleteFileAsync(int fileId);
/// <summary>
/// Upload a file from a URL to a <see cref="Folder"/>
/// </summary>
/// <param name="url"></param>
/// <param name="folderId"></param>
/// <param name="name"></param>
/// <returns></returns>
Task<File> UploadFileAsync(string url, int folderId, string name);
/// <summary>
/// Get / download a file (the body).
/// </summary>
/// <param name="fileId">Reference to a <see cref="File"/></param>
/// <returns>The bytes of the file</returns>
Task<byte[]> DownloadFileAsync(int fileId);
/// <summary>
/// Retrieve a list of files from a <see cref="Site"/> and <see cref="Folder"/>
/// </summary>
/// <param name="siteId">Reference to the <see cref="Site"/></param>
/// <param name="folderPath">Path of the folder
/// TODO: todoc verify exactly from where the folder path must start
/// </param>
/// <returns></returns>
Task<List<File>> GetFilesAsync(int siteId, string folderPath);
/// <summary>
/// Unzips the contents of a zip file
/// </summary>
/// <param name="fileId">Reference to the <see cref="File"/></param>
/// </param>
/// <returns></returns>
Task UnzipFileAsync(int fileId);
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class FileService : ServiceBase, IFileService
{

View File

@@ -9,58 +9,6 @@ using Oqtane.Documentation;
namespace Oqtane.Services
{
/// <summary>
/// Service to get / create / modify <see cref="Folder"/> objects.
/// </summary>
public interface IFolderService
{
/// <summary>
/// Retrieve root folders of a <see cref="Site"/>
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<Folder>> GetFoldersAsync(int siteId);
/// <summary>
/// Retrieve the information of one <see cref="Folder"/>
/// </summary>
/// <param name="folderId"></param>
/// <returns></returns>
Task<Folder> GetFolderAsync(int folderId);
/// <summary>
/// Create one Folder using a <see cref="Folder"/> object.
/// </summary>
/// <param name="folder"></param>
/// <returns></returns>
Task<Folder> AddFolderAsync(Folder folder);
/// <summary>
/// Update the information about a <see cref="Folder"/>
/// Use this to rename the folder etc.
/// </summary>
/// <param name="folder"></param>
/// <returns></returns>
Task<Folder> UpdateFolderAsync(Folder folder);
/// <summary>
/// Delete a <see cref="Folder"/>
/// </summary>
/// <param name="folderId">Reference to a <see cref="Folder"/></param>
/// <returns></returns>
Task DeleteFolderAsync(int folderId);
/// <summary>
/// Get a <see cref="Folder"/> of a <see cref="Site"/> based on the path.
/// </summary>
/// <param name="siteId">Reference to the <see cref="Site"/></param>
/// <param name="folderPath">Path of the folder
/// TODO: todoc verify exactly from where the folder path must start
/// </param>
/// <returns></returns>
Task<Folder> GetFolderAsync(int siteId, [NotNull] string folderPath);
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class FolderService : ServiceBase, IFolderService
{

View File

@@ -10,38 +10,6 @@ using System.Linq;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage (install master database / upgrade version / etc.) the installation
/// </summary>
public interface IInstallationService
{
/// <summary>
/// Returns a status/message object with the current installation state
/// </summary>
/// <returns></returns>
Task<Installation> IsInstalled();
/// <summary>
/// Starts the installation process
/// </summary>
/// <param name="config">connectionString, database type, alias etc.</param>
/// <returns>internal status/message object</returns>
Task<Installation> Install(InstallConfig config);
/// <summary>
/// Starts the upgrade process
/// </summary>
/// <param name="backup">indicates if files should be backed up during upgrade</param>
/// <returns>internal status/message object</returns>
Task<Installation> Upgrade(bool backup);
/// <summary>
/// Restarts the installation
/// </summary>
/// <returns>internal status/message object</returns>
Task RestartAsync();
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class InstallationService : ServiceBase, IInstallationService
{

View File

@@ -0,0 +1,47 @@
using Oqtane.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve and store <see cref="Alias"/> information.
/// </summary>
public interface IAliasService
{
/// <summary>
/// Get all aliases in the system
/// </summary>
/// <returns></returns>
Task<List<Alias>> GetAliasesAsync();
/// <summary>
/// Get a single alias
/// </summary>
/// <param name="aliasId">The <see cref="Oqtane.Models.Alias"/> ID, not to be confused with a <see cref="Oqtane.Models.Site"/> ID</param>
/// <returns></returns>
Task<Alias> GetAliasAsync(int aliasId);
/// <summary>
/// Save another <see cref="Oqtane.Models.Alias"/> in the DB. It must already contain all the information incl. <see cref="Oqtane.Models.Tenant"/> it belongs to.
/// </summary>
/// <param name="alias">An <see cref="Oqtane.Models.Alias"/> to add.</param>
/// <returns></returns>
Task<Alias> AddAliasAsync(Alias alias);
/// <summary>
/// Update an <see cref="Oqtane.Models.Alias"/> in the DB. Make sure the object is correctly filled, as it must update an existing record.
/// </summary>
/// <param name="alias">The <see cref="Oqtane.Models.Alias"/> to update.</param>
/// <returns></returns>
Task<Alias> UpdateAliasAsync(Alias alias);
/// <summary>
/// Remove an <see cref="Oqtane.Models.Alias"/> from the DB.
/// </summary>
/// <param name="aliasId">The Alias ID, not to be confused with a Site ID.</param>
/// <returns></returns>
Task DeleteAliasAsync(int aliasId);
}
}

View File

@@ -0,0 +1,42 @@
using Oqtane.Models;
using System;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve cookie consent information.
/// </summary>
public interface ICookieConsentService
{
/// <summary>
/// Get cookie consent bar actioned status
/// </summary>
/// <returns></returns>
Task<bool> IsActionedAsync();
/// <summary>
/// Get cookie consent status
/// </summary>
/// <returns></returns>
Task<bool> CanTrackAsync(bool optOut);
/// <summary>
/// create actioned cookie
/// </summary>
/// <returns></returns>
Task<string> CreateActionedCookieAsync();
/// <summary>
/// create consent cookie
/// </summary>
/// <returns></returns>
Task<string> CreateConsentCookieAsync();
/// <summary>
/// widhdraw consent cookie
/// </summary>
/// <returns></returns>
Task<string> WithdrawConsentCookieAsync();
}
}

View File

@@ -0,0 +1,18 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve <see cref="Database"/> information.
/// </summary>
public interface IDatabaseService
{
/// <summary>
/// Returns a list of databases
/// </summary>
/// <returns></returns>
Task<List<Database>> GetDatabasesAsync();
}
}

View File

@@ -0,0 +1,104 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to get / create / upload / download files.
/// </summary>
public interface IFileService
{
/// <summary>
/// Get all <see cref="File"/>s in the specified Folder
/// </summary>
/// <param name="folderId">The folder ID</param>
/// <returns></returns>
Task<List<File>> GetFilesAsync(int folderId);
/// <summary>
/// Get all <see cref="File"/>s in the specified folder.
/// </summary>
/// <param name="folder">
/// The folder path relative to where the files are stored.
/// TODO: todoc verify exactly from where the folder path must start
/// </param>
/// <returns></returns>
Task<List<File>> GetFilesAsync(string folder);
/// <summary>
/// Get one <see cref="File"/>
/// </summary>
/// <param name="fileId"></param>
/// <returns></returns>
Task<File> GetFileAsync(int fileId);
/// <summary>
/// Get a <see cref="File"/> based on the <see cref="Folder"/> and file name.
/// </summary>
/// <param name="folderId">Reference to the <see cref="Folder"/></param>
/// <param name="name">name of the file
/// </param>
/// <returns></returns>
Task<File> GetFileAsync(int folderId, string name);
/// <summary>
/// Add / store a <see cref="File"/> record.
/// This does not contain the file contents.
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
Task<File> AddFileAsync(File file);
/// <summary>
/// Update a <see cref="File"/> record.
/// Use this for rename a file or change some attributes.
/// This does not contain the file contents.
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
Task<File> UpdateFileAsync(File file);
/// <summary>
/// Delete a <see cref="File"/>
/// </summary>
/// <param name="fileId"></param>
/// <returns></returns>
Task DeleteFileAsync(int fileId);
/// <summary>
/// Upload a file from a URL to a <see cref="Folder"/>
/// </summary>
/// <param name="url"></param>
/// <param name="folderId"></param>
/// <param name="name"></param>
/// <returns></returns>
Task<File> UploadFileAsync(string url, int folderId, string name);
/// <summary>
/// Get / download a file (the body).
/// </summary>
/// <param name="fileId">Reference to a <see cref="File"/></param>
/// <returns>The bytes of the file</returns>
Task<byte[]> DownloadFileAsync(int fileId);
/// <summary>
/// Retrieve a list of files from a <see cref="Site"/> and <see cref="Folder"/>
/// </summary>
/// <param name="siteId">Reference to the <see cref="Site"/></param>
/// <param name="folderPath">Path of the folder
/// TODO: todoc verify exactly from where the folder path must start
/// </param>
/// <returns></returns>
Task<List<File>> GetFilesAsync(int siteId, string folderPath);
/// <summary>
/// Unzips the contents of a zip file
/// </summary>
/// <param name="fileId">Reference to the <see cref="File"/></param>
/// </param>
/// <returns></returns>
Task UnzipFileAsync(int fileId);
}
}

View File

@@ -0,0 +1,59 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to get / create / modify <see cref="Folder"/> objects.
/// </summary>
public interface IFolderService
{
/// <summary>
/// Retrieve root folders of a <see cref="Site"/>
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<Folder>> GetFoldersAsync(int siteId);
/// <summary>
/// Retrieve the information of one <see cref="Folder"/>
/// </summary>
/// <param name="folderId"></param>
/// <returns></returns>
Task<Folder> GetFolderAsync(int folderId);
/// <summary>
/// Create one Folder using a <see cref="Folder"/> object.
/// </summary>
/// <param name="folder"></param>
/// <returns></returns>
Task<Folder> AddFolderAsync(Folder folder);
/// <summary>
/// Update the information about a <see cref="Folder"/>
/// Use this to rename the folder etc.
/// </summary>
/// <param name="folder"></param>
/// <returns></returns>
Task<Folder> UpdateFolderAsync(Folder folder);
/// <summary>
/// Delete a <see cref="Folder"/>
/// </summary>
/// <param name="folderId">Reference to a <see cref="Folder"/></param>
/// <returns></returns>
Task DeleteFolderAsync(int folderId);
/// <summary>
/// Get a <see cref="Folder"/> of a <see cref="Site"/> based on the path.
/// </summary>
/// <param name="siteId">Reference to the <see cref="Site"/></param>
/// <param name="folderPath">Path of the folder
/// TODO: todoc verify exactly from where the folder path must start
/// </param>
/// <returns></returns>
Task<Folder> GetFolderAsync(int siteId, [NotNull]string folderPath);
}
}

View File

@@ -0,0 +1,39 @@
using Oqtane.Models;
using System.Threading.Tasks;
using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage (install master database / upgrade version / etc.) the installation
/// </summary>
public interface IInstallationService
{
/// <summary>
/// Returns a status/message object with the current installation state
/// </summary>
/// <returns></returns>
Task<Installation> IsInstalled();
/// <summary>
/// Starts the installation process
/// </summary>
/// <param name="config">connectionString, database type, alias etc.</param>
/// <returns>internal status/message object</returns>
Task<Installation> Install(InstallConfig config);
/// <summary>
/// Starts the upgrade process
/// </summary>
/// <param name="backup">indicates if files should be backed up during upgrade</param>
/// <returns>internal status/message object</returns>
Task<Installation> Upgrade(bool backup);
/// <summary>
/// Restarts the installation
/// </summary>
/// <returns>internal status/message object</returns>
Task RestartAsync();
}
}

View File

@@ -0,0 +1,26 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to read the job schedule log
/// </summary>
public interface IJobLogService
{
/// <summary>
/// Return a list of <see cref="JobLog"/> entries
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task<List<JobLog>> GetJobLogsAsync(int jobId);
/// <summary>
/// Return a <see cref="JobLog"/> entry for the given Id
/// </summary>
/// <param name="jobLogId"></param>
/// <returns></returns>
Task<JobLog> GetJobLogAsync(int jobLogId);
}
}

View File

@@ -0,0 +1,61 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage jobs (<see cref="Job"/>)
/// </summary>
public interface IJobService
{
/// <summary>
/// Returns a list of all jobs
/// </summary>
/// <returns></returns>
Task<List<Job>> GetJobsAsync();
/// <summary>
/// Return a specific job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task<Job> GetJobAsync(int jobId);
/// <summary>
/// Adds a new job
/// </summary>
/// <param name="job"></param>
/// <returns></returns>
Task<Job> AddJobAsync(Job job);
/// <summary>
/// Updates an existing job
/// </summary>
/// <param name="job"></param>
/// <returns></returns>
Task<Job> UpdateJobAsync(Job job);
/// <summary>
/// Delete an existing job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task DeleteJobAsync(int jobId);
/// <summary>
/// Starts the given job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task StartJobAsync(int jobId);
/// <summary>
/// Stops the given job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task StopJobAsync(int jobId);
}
}

View File

@@ -0,0 +1,56 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Oqtane.Models;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="Language"/> entries
/// </summary>
public interface ILanguageService
{
/// <summary>
/// Returns a list of all available languages for the given <see cref="Site"/>
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<Language>> GetLanguagesAsync(int siteId);
/// <summary>
/// Returns a list of all available languages for the given <see cref="Site" /> and package
/// </summary>
/// <param name="siteId"></param>
/// <param name="packageName"></param>
/// <returns></returns>
Task<List<Language>> GetLanguagesAsync(int siteId, string packageName);
/// <summary>
/// Returns the given language
/// </summary>
/// <param name="languageId"></param>
/// <returns></returns>
Task<Language> GetLanguageAsync(int languageId);
/// <summary>
/// Adds the given language
/// </summary>
/// <param name="language"></param>
/// <returns></returns>
Task<Language> AddLanguageAsync(Language language);
/// <summary>
/// Edits the given language
/// </summary>
/// <param name="language"></param>
/// <returns></returns>
Task EditLanguageAsync(Language language);
/// <summary>
/// Deletes the given language
/// </summary>
/// <param name="languageId"></param>
/// <returns></returns>
Task DeleteLanguageAsync(int languageId);
}
}

View File

@@ -0,0 +1,17 @@
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to set localization cookie
/// </summary>
public interface ILocalizationCookieService
{
/// <summary>
/// Set the localization cookie
/// </summary>
/// <param name="culture"></param>
/// <returns></returns>
Task SetLocalizationCookieAsync(string culture);
}
}

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Oqtane.Models;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve localizations (<see cref="Culture"/>)
/// </summary>
public interface ILocalizationService
{
/// <summary>
/// Returns a collection of supported cultures
/// </summary>
/// <returns></returns>
Task<IEnumerable<Culture>> GetCulturesAsync(bool installed);
}
}

View File

@@ -0,0 +1,72 @@
using Oqtane.Models;
using Oqtane.Shared;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oqtane.Enums;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve and store <see cref="Log"/> entries
/// </summary>
public interface ILogService
{
/// <summary>
/// Returns a list of log entires for the given params
/// </summary>
/// <param name="siteId"></param>
/// <param name="level"></param>
/// <param name="function"></param>
/// <param name="rows"></param>
/// <returns></returns>
Task<List<Log>> GetLogsAsync(int siteId, string level, string function, int rows);
/// <summary>
/// Returns a specific log entry for the given id
/// </summary>
/// <param name="logId"></param>
/// <returns></returns>
Task<Log> GetLogAsync(int logId);
/// <summary>
/// Clear the entire logs of the given site.
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task DeleteLogsAsync(int siteId);
/// <summary>
/// Creates a new log entry
/// </summary>
/// <param name="pageId"></param>
/// <param name="moduleId"></param>
/// <param name="userId"></param>
/// <param name="category"></param>
/// <param name="feature"></param>
/// <param name="function"></param>
/// <param name="level"></param>
/// <param name="exception"></param>
/// <param name="message"></param>
/// <param name="args"></param>
/// <returns></returns>
Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args);
/// <summary>
/// Creates a new log entry
/// </summary>
/// <param name="alias"></param>
/// <param name="pageId"></param>
/// <param name="moduleId"></param>
/// <param name="userId"></param>
/// <param name="category"></param>
/// <param name="feature"></param>
/// <param name="function"></param>
/// <param name="level"></param>
/// <param name="exception"></param>
/// <param name="message"></param>
/// <param name="args"></param>
/// <returns></returns>
Task Log(Alias alias, int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args);
}
}

View File

@@ -0,0 +1,56 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage a <see cref="ModuleDefinition"/>
/// </summary>
public interface IModuleDefinitionService
{
/// <summary>
/// Returns a list of module definitions for the given site
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<ModuleDefinition>> GetModuleDefinitionsAsync(int siteId);
/// <summary>
/// Returns a specific module definition
/// </summary>
/// <param name="moduleDefinitionId"></param>
/// <param name="siteId"></param>
/// <returns></returns>
Task<ModuleDefinition> GetModuleDefinitionAsync(int moduleDefinitionId, int siteId);
/// <summary>
/// Updates a existing module definition
/// </summary>
/// <param name="moduleDefinition"></param>
/// <returns></returns>
Task UpdateModuleDefinitionAsync(ModuleDefinition moduleDefinition);
/// <summary>
/// Deletes a module definition
/// </summary>
/// <param name="moduleDefinitionId"></param>
/// <param name="siteId"></param>
/// <returns></returns>
Task DeleteModuleDefinitionAsync(int moduleDefinitionId, int siteId);
/// <summary>
/// Creates a new module definition
/// </summary>
/// <param name="moduleDefinition"></param>
/// <returns></returns>
Task<ModuleDefinition> CreateModuleDefinitionAsync(ModuleDefinition moduleDefinition);
/// <summary>
/// Returns a list of module definition templates
/// </summary>
/// <returns></returns>
Task<List<Template>> GetModuleDefinitionTemplatesAsync();
}
}

View File

@@ -0,0 +1,73 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve and store modules (<see cref="Module"/>)
/// </summary>
public interface IModuleService
{
/// <summary>
/// Returns a list of modules for the given site
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<Module>> GetModulesAsync(int siteId);
/// <summary>
/// Returns a specific module
/// </summary>
/// <param name="moduleId"></param>
/// <returns></returns>
Task<Module> GetModuleAsync(int moduleId);
/// <summary>
/// Adds a new module
/// </summary>
/// <param name="module"></param>
/// <returns></returns>
Task<Module> AddModuleAsync(Module module);
/// <summary>
/// Updates an existing module
/// </summary>
/// <param name="module"></param>
/// <returns></returns>
Task<Module> UpdateModuleAsync(Module module);
/// <summary>
/// Deletes a module
/// </summary>
/// <param name="moduleId"></param>
/// <returns></returns>
Task DeleteModuleAsync(int moduleId);
/// <summary>
/// Imports a module
/// </summary>
/// <param name="moduleId"></param>
/// <param name="content">module in JSON format</param>
/// <returns></returns>
Task<bool> ImportModuleAsync(int moduleId, int pageId, string content);
/// <summary>
/// Exports a given module
/// </summary>
/// <param name="moduleId"></param>
/// <param name="pageId"></param>
/// <returns>module content in JSON format</returns>
Task<string> ExportModuleAsync(int moduleId, int pageId);
/// <summary>
/// Exports a given module
/// </summary>
/// <param name="moduleId"></param>
/// <param name="pageId"></param>
/// <param name="folderId"></param>
/// <param name="filename"></param>
/// <returns>file id</returns>
Task<int> ExportModuleAsync(int moduleId, int pageId, int folderId, string filename);
}
}

View File

@@ -0,0 +1,70 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to store and retrieve notifications (<see cref="Notification"/>)
/// </summary>
public interface INotificationService
{
/// <summary>
/// Return a list of notifications
/// </summary>
/// <param name="siteId"></param>
/// <param name="direction"></param>
/// <param name="userId"></param>
/// <returns></returns>
Task<List<Notification>> GetNotificationsAsync(int siteId, string direction, int userId);
/// <summary>
///
/// </summary>
/// <param name="siteId"></param>
/// <param name="direction"></param>
/// <param name="userId"></param>
/// <param name="count"></param>
/// <param name="isRead"></param>
/// <returns></returns>
Task<List<Notification>> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead);
/// <summary>
///
/// </summary>
/// <param name="siteId"></param>
/// <param name="direction"></param>
/// <param name="userId"></param>
/// <param name="isRead"></param>
/// <returns></returns>
Task<int> GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead);
/// <summary>
/// Returns a specific notifications
/// </summary>
/// <param name="notificationId"></param>
/// <returns></returns>
Task<Notification> GetNotificationAsync(int notificationId);
/// <summary>
/// Creates a new notification
/// </summary>
/// <param name="notification"></param>
/// <returns></returns>
Task<Notification> AddNotificationAsync(Notification notification);
/// <summary>
/// Updates a existing notification
/// </summary>
/// <param name="notification"></param>
/// <returns></returns>
Task<Notification> UpdateNotificationAsync(Notification notification);
/// <summary>
/// Deletes a notification
/// </summary>
/// <param name="notificationId"></param>
/// <returns></returns>
Task DeleteNotificationAsync(int notificationId);
}
}

View File

@@ -0,0 +1,18 @@
using System.Threading;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage cache
/// </summary>
public interface IOutputCacheService
{
/// <summary>
/// Evicts the output cache for a specific tag
/// </summary>
/// <param name="tag"></param>
/// <returns></returns>
Task EvictByTag(string tag);
}
}

View File

@@ -0,0 +1,70 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage packages (<see cref="Package"/>)
/// </summary>
public interface IPackageService
{
/// <summary>
/// Returns a list of packages matching the given parameters
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
Task<List<Package>> GetPackagesAsync(string type);
/// <summary>
/// Returns a list of packages matching the given parameters
/// </summary>
/// <param name="type"></param>
/// <param name="search"></param>
/// <param name="price"></param>
/// <param name="package"></param>
/// <returns></returns>
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package);
/// <summary>
/// Returns a list of packages matching the given parameters
/// </summary>
/// <param name="type"></param>
/// <param name="search"></param>
/// <param name="price"></param>
/// <param name="package"></param>
/// <param name="sort"></param>
/// <returns></returns>
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package, string sort);
/// <summary>
/// Returns a list of packages based on installationid
/// </summary>
/// <returns></returns>
Task<List<Package>> GetPackageUpdatesAsync(string type);
/// <summary>
/// Returns a specific package
/// </summary>
/// <param name="packageId"></param>
/// <param name="version"></param>
/// <returns></returns>
Task<Package> GetPackageAsync(string packageId, string version, bool download);
/// <summary>
/// Downloads a specific package as .nupkg file
/// </summary>
/// <param name="packageId"></param>
/// <param name="version"></param>
/// <param name="folder"></param>
/// <returns></returns>
Task DownloadPackageAsync(string packageId, string version);
/// <summary>
/// Installs all packages located in //TODO: 2dm where?
/// </summary>
/// <returns></returns>
Task InstallPackagesAsync();
}
}

View File

@@ -0,0 +1,56 @@
using Oqtane.Models;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to store and retrieve a <see cref="PageModule"/>
/// </summary>
public interface IPageModuleService
{
/// <summary>
/// Returns a specific page module
/// </summary>
/// <param name="pageModuleId"></param>
/// <returns></returns>
Task<PageModule> GetPageModuleAsync(int pageModuleId);
/// <summary>
/// Return a specific page module
/// </summary>
/// <param name="pageId"></param>
/// <param name="moduleId"></param>
/// <returns></returns>
Task<PageModule> GetPageModuleAsync(int pageId, int moduleId);
/// <summary>
/// Creates a new page module
/// </summary>
/// <param name="pageModule"></param>
/// <returns></returns>
Task<PageModule> AddPageModuleAsync(PageModule pageModule);
/// <summary>
/// Updates a existing page module
/// </summary>
/// <param name="pageModule"></param>
/// <returns></returns>
Task<PageModule> UpdatePageModuleAsync(PageModule pageModule);
/// <summary>
/// Updates order of all page modules in the given pane
/// </summary>
/// <param name="pageId"></param>
/// <param name="pane"></param>
/// <returns></returns>
Task UpdatePageModuleOrderAsync(int pageId, string pane);
/// <summary>
/// Deletes a page module
/// </summary>
/// <param name="pageModuleId"></param>
/// <returns></returns>
Task DeletePageModuleAsync(int pageModuleId);
}
}

View File

@@ -0,0 +1,71 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Services to store and retrieve a <see cref="Page"/>
/// </summary>
public interface IPageService
{
/// <summary>
/// Returns a list of pages
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<Page>> GetPagesAsync(int siteId);
/// <summary>
/// Returns a specific page
/// </summary>
/// <param name="pageId"></param>
/// <returns></returns>
Task<Page> GetPageAsync(int pageId);
/// <summary>
/// Returns a specific page by its defined path
/// </summary>
/// <param name="path"></param>
/// <param name="siteId"></param>
/// <returns></returns>
Task<Page> GetPageAsync(string path, int siteId);
/// <summary>
/// Adds a new page
/// </summary>
/// <param name="page"></param>
/// <returns></returns>
Task<Page> AddPageAsync(Page page);
/// <summary>
/// Adds a new page
/// </summary>
/// <param name="page"></param>
/// <returns></returns>
Task<Page> AddPageAsync(int pageId, int userId);
/// <summary>
/// Updates a existing page
/// </summary>
/// <param name="page"></param>
/// <returns></returns>
Task<Page> UpdatePageAsync(Page page);
/// <summary>
/// Updates order of all page modules in the given parent
/// </summary>
/// <param name="siteId"></param>
/// <param name="pageId"></param>
/// <param name="parentId"></param>
/// <returns></returns>
Task UpdatePageOrderAsync(int siteId, int pageId, int? parentId);
/// <summary>
/// Deletes a page
/// </summary>
/// <param name="pageId"></param>
/// <returns></returns>
Task DeletePageAsync(int pageId);
}
}

View File

@@ -0,0 +1,48 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to store and retrieve <see cref="Profile"/> entries
/// </summary>
public interface IProfileService
{
/// <summary>
/// Returns a list of profile entries
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<Profile>> GetProfilesAsync(int siteId);
/// <summary>
/// Returns a specific profile entry
/// </summary>
/// <param name="profileId"></param>
/// <returns></returns>
Task<Profile> GetProfileAsync(int profileId);
/// <summary>
/// Creates a new profile entry
/// </summary>
/// <param name="profile"></param>
/// <returns></returns>
Task<Profile> AddProfileAsync(Profile profile);
/// <summary>
/// Updates an existing profile entry
/// </summary>
/// <param name="profile"></param>
/// <returns></returns>
Task<Profile> UpdateProfileAsync(Profile profile);
/// <summary>
/// Deletes a profile entry
/// </summary>
/// <param name="profileId"></param>
/// <returns></returns>
Task DeleteProfileAsync(int profileId);
}
}

View File

@@ -0,0 +1,57 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="Role"/>s on a <see cref="Site"/>
/// </summary>
public interface IRoleService
{
/// <summary>
/// Get all <see cref="Role"/>s of this <see cref="Site"/>.
///
/// Will exclude global roles which are for all sites. To get those as well, use the overload <see cref="GetRolesAsync(int, bool)"/>
/// </summary>
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
/// <returns></returns>
Task<List<Role>> GetRolesAsync(int siteId);
/// <summary>
/// Get roles of the <see cref="Site"/> and optionally include global Roles.
/// </summary>
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
/// <param name="includeGlobalRoles">True if it should also include global roles. False will return the same data as just calling <see cref="GetRolesAsync(int)"/></param>
/// <returns></returns>
Task<List<Role>> GetRolesAsync(int siteId, bool includeGlobalRoles);
/// <summary>
/// Get one specific <see cref="Role"/>
/// </summary>
/// <param name="roleId">ID-reference of a <see cref="Role"/></param>
/// <returns></returns>
Task<Role> GetRoleAsync(int roleId);
/// <summary>
/// Add / save a new <see cref="Role"/> to the database.
/// </summary>
/// <param name="role"></param>
/// <returns></returns>
Task<Role> AddRoleAsync(Role role);
/// <summary>
/// Update a <see cref="Role"/> in the database.
/// </summary>
/// <param name="role"></param>
/// <returns></returns>
Task<Role> UpdateRoleAsync(Role role);
/// <summary>
/// Delete / mark-as-deleted a <see cref="Role"/> in the database.
/// </summary>
/// <param name="roleId">ID-reference of a <see cref="Role"/></param>
/// <returns></returns>
Task DeleteRoleAsync(int roleId);
}
}

View File

@@ -0,0 +1,13 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Oqtane.Documentation;
using Oqtane.Models;
namespace Oqtane.Services
{
[PrivateApi("Mark SearchResults classes as private, since it's not very useful in the public docs")]
public interface ISearchResultsService
{
Task<SearchResults> GetSearchResultsAsync(SearchQuery searchQuery);
}
}

View File

@@ -0,0 +1,269 @@
using Oqtane.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="Setting"/>s
/// </summary>
public interface ISettingService
{
/// <summary>
/// Returns a key-value dictionary of all tenant settings
/// </summary>
/// <returns></returns>
Task<Dictionary<string, string>> GetTenantSettingsAsync();
/// <summary>
/// Updates a tenant setting
/// </summary>
/// <param name="tenantSettings"></param>
/// <returns></returns>
Task UpdateTenantSettingsAsync(Dictionary<string, string> tenantSettings);
/// <summary>
/// Returns a key-value dictionary of all site settings for the given site
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetSiteSettingsAsync(int siteId);
/// <summary>
/// Updates a site setting
/// </summary>
/// <param name="siteSettings"></param>
/// <param name="siteId"></param>
/// <returns></returns>
Task UpdateSiteSettingsAsync(Dictionary<string, string> siteSettings, int siteId);
/// <summary>
/// Clears site option cache
/// </summary>
/// <returns></returns>
Task ClearSiteSettingsCacheAsync();
/// <summary>
/// Returns a key-value dictionary of all page settings for the given page
/// </summary>
/// <param name="pageId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetPageSettingsAsync(int pageId);
/// <summary>
/// Updates a page setting
/// </summary>
/// <param name="pageSettings"></param>
/// <param name="pageId"></param>
/// <returns></returns>
Task UpdatePageSettingsAsync(Dictionary<string, string> pageSettings, int pageId);
/// <summary>
/// Returns a key-value dictionary of all page module settings for the given page module
/// </summary>
/// <param name="pageModuleId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetPageModuleSettingsAsync(int pageModuleId);
/// <summary>
/// Updates a page module setting
/// </summary>
/// <param name="pageModuleSettings"></param>
/// <param name="pageModuleId"></param>
/// <returns></returns>
Task UpdatePageModuleSettingsAsync(Dictionary<string, string> pageModuleSettings, int pageModuleId);
/// <summary>
/// Returns a key-value dictionary of all module settings for the given module
/// </summary>
/// <param name="moduleId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetModuleSettingsAsync(int moduleId);
/// <summary>
/// Updates a module setting
/// </summary>
/// <param name="moduleSettings"></param>
/// <param name="moduleId"></param>
/// <returns></returns>
Task UpdateModuleSettingsAsync(Dictionary<string, string> moduleSettings, int moduleId);
/// <summary>
/// Returns a key-value dictionary of all module settings for the given module
/// </summary>
/// <param name="moduleDefinitionId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetModuleDefinitionSettingsAsync(int moduleDefinitionId);
/// <summary>
/// Updates a module setting
/// </summary>
/// <param name="moduleDefinitionSettings"></param>
/// <param name="moduleDefinitionId"></param>
/// <returns></returns>
Task UpdateModuleDefinitionSettingsAsync(Dictionary<string, string> moduleDefinitionSettings, int moduleDefinitionId);
/// <summary>
/// Returns a key-value dictionary of all user settings for the given user
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetUserSettingsAsync(int userId);
/// <summary>
/// Updates a user setting
/// </summary>
/// <param name="userSettings"></param>
/// <param name="userId"></param>
/// <returns></returns>
Task UpdateUserSettingsAsync(Dictionary<string, string> userSettings, int userId);
/// <summary>
/// Returns a key-value dictionary of all folder settings for the given folder
/// </summary>
/// <param name="folderId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetFolderSettingsAsync(int folderId);
/// <summary>
/// Updates a folder setting
/// </summary>
/// <param name="folderSettings"></param>
/// <param name="folderId"></param>
/// <returns></returns>
Task UpdateFolderSettingsAsync(Dictionary<string, string> folderSettings, int folderId);
/// <summary>
/// Returns a key-value dictionary of all tenant settings
/// </summary>
/// <returns></returns>
Task<Dictionary<string, string>> GetHostSettingsAsync();
/// <summary>
/// Updates a host setting
/// </summary>
/// <param name="hostSettings"></param>
/// <returns></returns>
Task UpdateHostSettingsAsync(Dictionary<string, string> hostSettings);
/// <summary>
/// Returns a key-value dictionary of all settings for the given visitor
/// </summary>
/// <param name="visitorId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetVisitorSettingsAsync(int visitorId);
/// <summary>
/// Updates a visitor setting
/// </summary>
/// <param name="visitorSettings"></param>
/// <param name="visitorId"></param>
/// <returns></returns>
Task UpdateVisitorSettingsAsync(Dictionary<string, string> visitorSettings, int visitorId);
/// <summary>
/// Returns a key-value dictionary of all settings for the given entityName
/// </summary>
/// <param name="pageId"></param>
/// <returns></returns>
Task<Dictionary<string, string>> GetSettingsAsync(string entityName, int entityId);
/// <summary>
/// Updates settings for a given entityName and Id
/// </summary>
/// <param name="settings"></param>
/// <param name="entityName"></param>
/// <param name="entityId"></param>
/// <returns></returns>
Task UpdateSettingsAsync(Dictionary<string, string> settings, string entityName, int entityId);
/// <summary>
/// Updates setting for a given entityName and Id
/// </summary>
/// <param name="entityName"></param>
/// <param name="entityId"></param>
/// <param name="settingName"></param>
/// <param name="settingValue"></param>
/// <param name="isPrivate"></param>
/// <returns></returns>
Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate);
/// <summary>
/// Returns a specific setting
/// </summary>
/// <param name="entityName"></param>
/// <param name="entityId"></param>
/// <param name="settingName"></param>
/// <returns></returns>
Task DeleteSettingAsync(string entityName, int entityId, string settingName);
/// <summary>
/// Returns a specific setting
/// </summary>
/// <param name="entityName"></param>
/// <param name="entityId"></param>
/// <param name="settingName"></param>
/// <returns></returns>
Task<List<Setting>> GetSettingsAsync(string entityName, int entityId, string settingName);
/// <summary>
/// Returns a specific setting
/// </summary>
/// <param name="settingId"></param>
/// <returns></returns>
Task<Setting> GetSettingAsync(string entityName, int settingId);
/// <summary>
/// Creates a new setting
/// </summary>
/// <param name="setting"></param>
/// <returns></returns>
Task<Setting> AddSettingAsync(Setting setting);
/// <summary>
/// Updates a existing setting
/// </summary>
/// <param name="setting"></param>
/// <returns></returns>
Task<Setting> UpdateSettingAsync(Setting setting);
/// <summary>
/// Deletes a setting
/// </summary>
/// <param name="settingId"></param>
/// <returns></returns>
Task DeleteSettingAsync(string entityName, int settingId);
/// <summary>
/// Gets the value of the given settingName (key) from the given key-value dictionary
/// </summary>
/// <param name="settings"></param>
/// <param name="settingName"></param>
/// <param name="defaultValue"></param>
/// <returns></returns>
string GetSetting(Dictionary<string, string> settings, string settingName, string defaultValue);
/// <summary>
/// Sets the value of the given settingName (key) in the given key-value dictionary
/// </summary>
/// <param name="settings"></param>
/// <param name="settingName"></param>
/// <param name="defaultValue"></param>
/// <returns></returns>
Dictionary<string, string> SetSetting(Dictionary<string, string> settings, string settingName, string settingValue);
Dictionary<string, string> SetSetting(Dictionary<string, string> settings, string settingName, string settingValue, bool isPrivate);
Dictionary<string, string> MergeSettings(Dictionary<string, string> settings1, Dictionary<string, string> settings2);
[Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)]
Task<Setting> GetSettingAsync(int settingId);
[Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)]
Task DeleteSettingAsync(int settingId);
}
}

View File

@@ -0,0 +1,61 @@
using Oqtane.Documentation;
using Oqtane.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to store and retrieve <see cref="Site"/> entries
/// </summary>
public interface ISiteService
{
/// <summary>
/// Returns a list of sites
/// </summary>
/// <returns></returns>
Task<List<Site>> GetSitesAsync();
/// <summary>
/// Returns a specific site
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<Site> GetSiteAsync(int siteId);
/// <summary>
/// Creates a new site
/// </summary>
/// <param name="site"></param>
/// <returns></returns>
Task<Site> AddSiteAsync(Site site);
/// <summary>
/// Updates an existing site
/// </summary>
/// <param name="site"></param>
/// <returns></returns>
Task<Site> UpdateSiteAsync(Site site);
/// <summary>
/// Deletes a site
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task DeleteSiteAsync(int siteId);
/// <summary>
/// Returns a list of modules
/// </summary>
/// <param name="siteId"></param>
/// <param name="pageId"></param>
/// <returns></returns>
Task<List<Module>> GetModulesAsync(int siteId, int pageId);
[PrivateApi]
[Obsolete("This method is deprecated.", false)]
void SetAlias(Alias alias);
}
}

View File

@@ -0,0 +1,18 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve <see cref="SiteTemplate"/> entries
/// </summary>
public interface ISiteTemplateService
{
/// <summary>
/// Returns a list of site templates
/// </summary>
/// <returns></returns>
Task<List<SiteTemplate>> GetSiteTemplatesAsync();
}
}

View File

@@ -0,0 +1,18 @@
using Oqtane.Models;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to execute a <see cref="SqlQuery"/> against the backend database
/// </summary>
public interface ISqlService
{
/// <summary>
/// Executes a sql query and returns its result
/// </summary>
/// <param name="sqlquery"></param>
/// <returns></returns>
Task<SqlQuery> ExecuteQueryAsync(SqlQuery sqlquery);
}
}

View File

@@ -0,0 +1,19 @@
using Oqtane.Models;
using System;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve <see cref="Sync"/> information.
/// </summary>
public interface ISyncService
{
/// <summary>
/// Get sync events
/// </summary>
/// <param name="lastSyncDate"></param>
/// <returns></returns>
Task<Sync> GetSyncEventsAsync(DateTime lastSyncDate);
}
}

View File

@@ -0,0 +1,42 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve and update system information.
/// </summary>
public interface ISystemService
{
/// <summary>
/// returns a key-value dictionary with the current system configuration information
/// </summary>
/// <returns></returns>
Task<Dictionary<string, object>> GetSystemInfoAsync();
/// <summary>
/// returns a key-value dictionary with the current system information - "environment" or "configuration"
/// </summary>
/// <returns></returns>
Task<Dictionary<string, object>> GetSystemInfoAsync(string type);
/// <summary>
/// returns a config value
/// </summary>
/// <returns></returns>
Task<object> GetSystemInfoAsync(string settingKey, object defaultValue);
/// <summary>
/// Updates system information
/// </summary>
/// <param name="settings"></param>
/// <returns></returns>
Task UpdateSystemInfoAsync(Dictionary<string, object> settings);
/// <summary>
/// returns a key-value dictionary with default system icons
/// </summary>
/// <returns></returns>
Task<Dictionary<string, string>> GetIconsAsync();
}
}

View File

@@ -0,0 +1,25 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="Tenant"/>s on the Oqtane installation.
/// </summary>
public interface ITenantService
{
/// <summary>
/// Get all <see cref="Tenant"/>s
/// </summary>
/// <returns></returns>
Task<List<Tenant>> GetTenantsAsync();
/// <summary>
/// Get one specific <see cref="Tenant"/>
/// </summary>
/// <param name="tenantId">ID-reference of the <see cref="Tenant"/></param>
/// <returns></returns>
Task<Tenant> GetTenantAsync(int tenantId);
}
}

View File

@@ -0,0 +1,94 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="Theme"/> entries
/// </summary>
public interface IThemeService
{
/// <summary>
/// Returns a list of available themes
/// </summary>
/// <returns></returns>
Task<List<Theme>> GetThemesAsync();
/// <summary>
/// Returns a specific theme
/// </summary>
/// <param name="themeId"></param>
/// <param name="siteId"></param>
/// <returns></returns>
Task<Theme> GetThemeAsync(int themeId, int siteId);
/// <summary>
/// Returns a theme <see cref="ThemeControl"/>s containing a specific theme control type
/// </summary>
/// <param name="themes"></param>
/// <param name="themeControlType"></param>
/// <returns></returns>
Theme GetTheme(List<Theme> themes, string themeControlType);
/// <summary>
/// Returns a list of <see cref="ThemeControl"/>s from the given themes
/// </summary>
/// <param name="themes"></param>
/// <returns></returns>
List<ThemeControl> GetThemeControls(List<Theme> themes);
/// <summary>
/// Returns a list of <see cref="ThemeControl"/>s for a theme containing a specific theme control type
/// </summary>
/// <param name="themes"></param>
/// <param name="themeControlType"></param>
/// <returns></returns>
List<ThemeControl> GetThemeControls(List<Theme> themes, string themeControlType);
/// <summary>
/// Returns a list of containers (<see cref="ThemeControl"/>) for a theme containing a specific theme control type
/// </summary>
/// <param name="themes"></param>
/// <param name="themeControlType"></param>
/// <returns></returns>
List<ThemeControl> GetContainerControls(List<Theme> themes, string themeControlType);
/// <summary>
/// Updates a existing theme
/// </summary>
/// <param name="theme"></param>
/// <returns></returns>
Task UpdateThemeAsync(Theme theme);
/// <summary>
/// Deletes a theme
/// </summary>
/// <param name="themeName"></param>
/// <returns></returns>
Task DeleteThemeAsync(string themeName);
/// <summary>
/// Creates a new theme
/// </summary>
/// <param name="theme"></param>
/// <returns></returns>
Task<Theme> CreateThemeAsync(Theme theme);
/// <summary>
/// Returns a list of theme templates (<see cref="Template"/>)
/// </summary>
/// <returns></returns>
Task<List<Template>> GetThemeTemplatesAsync();
/// <summary>
/// Returns a list of layouts (<see cref="ThemeControl"/>) from the given themes with a matching theme name
/// </summary>
/// <param name="themes"></param>
/// <param name="themeName"></param>
/// <returns></returns>
List<ThemeControl> GetLayoutControls(List<Theme> themes, string themeName);
}
}

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Oqtane.Models;
namespace Oqtane.Services
{
/// <summary>
/// Service to store and retrieve <see cref="TimeZone"/> entries
/// </summary>
public interface ITimeZoneService
{
/// <summary>
/// Get the list of time zones
/// </summary>
/// <returns></returns>
Task<List<TimeZone>> GetTimeZonesAsync();
}
}

View File

@@ -0,0 +1,56 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="UrlMapping"/>s on a <see cref="Site"/>
/// </summary>
public interface IUrlMappingService
{
/// <summary>
/// Get all <see cref="UrlMapping"/>s of this <see cref="Site"/>.
///
/// </summary>
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
/// <returns></returns>
Task<List<UrlMapping>> GetUrlMappingsAsync(int siteId, bool isMapped);
/// <summary>
/// Get one specific <see cref="UrlMapping"/>
/// </summary>
/// <param name="urlMappingId">ID-reference of a <see cref="UrlMapping"/></param>
/// <returns></returns>
Task<UrlMapping> GetUrlMappingAsync(int urlMappingId);
/// <summary>
/// Get one specific <see cref="UrlMapping"/>
/// </summary>
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
/// <param name="url">A url</param>
/// <returns></returns>
Task<UrlMapping> GetUrlMappingAsync(int siteId, string url);
/// <summary>
/// Add / save a new <see cref="UrlMapping"/> to the database.
/// </summary>
/// <param name="urlMapping"></param>
/// <returns></returns>
Task<UrlMapping> AddUrlMappingAsync(UrlMapping urlMapping);
/// <summary>
/// Update a <see cref="UrlMapping"/> in the database.
/// </summary>
/// <param name="urlMapping"></param>
/// <returns></returns>
Task<UrlMapping> UpdateUrlMappingAsync(UrlMapping urlMapping);
/// <summary>
/// Delete a <see cref="UrlMapping"/> in the database.
/// </summary>
/// <param name="urlMappingId">ID-reference of a <see cref="UrlMapping"/></param>
/// <returns></returns>
Task DeleteUrlMappingAsync(int urlMappingId);
}
}

View File

@@ -0,0 +1,72 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Manage <see cref="Role"/>s assigned to a specific <see cref="User"/>
/// </summary>
public interface IUserRoleService
{
/// <summary>
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
/// </summary>
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
/// <returns></returns>
Task<List<UserRole>> GetUserRolesAsync(int siteId);
/// <summary>
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
/// </summary>
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
/// <param name="userId">ID-reference to a <see cref="User"/></param>
/// <returns></returns>
Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId);
/// <summary>
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
/// </summary>
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
/// <param name="roleName">Name reference a <see cref="Role"/></param>
/// <returns></returns>
Task<List<UserRole>> GetUserRolesAsync(int siteId, string roleName);
/// <summary>
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
/// </summary>
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
/// <param name="userId">ID-reference to a <see cref="User"/></param>
/// <param name="roleName">Name reference a <see cref="Role"/></param>
/// <returns></returns>
Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId, string roleName);
/// <summary>
/// Get one specific <see cref="UserRole"/>
/// </summary>
/// <param name="userRoleId">ID-reference to a <see cref="UserRole"/></param>
/// <returns></returns>
Task<UserRole> GetUserRoleAsync(int userRoleId);
/// <summary>
/// Save a new <see cref="UserRole"/>
/// </summary>
/// <param name="userRole"></param>
/// <returns></returns>
Task<UserRole> AddUserRoleAsync(UserRole userRole);
/// <summary>
/// Update a <see cref="UserRole"/> in the database
/// </summary>
/// <param name="userRole"></param>
/// <returns></returns>
Task<UserRole> UpdateUserRoleAsync(UserRole userRole);
/// <summary>
/// Delete a <see cref="UserRole"/> in the database
/// </summary>
/// <param name="userRoleId"></param>
/// <returns></returns>
Task DeleteUserRoleAsync(int userRoleId);
}
}

View File

@@ -0,0 +1,171 @@
using Oqtane.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Manage (get / update) user information
/// </summary>
public interface IUserService
{
/// <summary>
/// Get a <see cref="User"/> of a specific site
/// </summary>
/// <param name="userId">ID of a <see cref="User"/></param>
/// <param name="siteId">ID of a <see cref="Site"/></param>
/// <returns></returns>
Task<User> GetUserAsync(int userId, int siteId);
/// <summary>
/// Get a <see cref="User"/> of a specific site
/// </summary>
/// <param name="username">Username / login of a <see cref="User"/></param>
/// <param name="siteId">ID of a <see cref="Site"/></param>
/// <returns></returns>
Task<User> GetUserAsync(string username, int siteId);
/// <summary>
/// Get a <see cref="User"/> of a specific site
/// </summary>
/// <param name="username">Username / login of a <see cref="User"/></param>
/// <param name="email">email address of a <see cref="User"/></param>
/// <param name="siteId">ID of a <see cref="Site"/></param>
/// <returns></returns>
Task<User> GetUserAsync(string username, string email, int siteId);
/// <summary>
/// Save a user to the Database.
/// The <see cref="User"/> object contains all the information incl. what <see cref="Site"/> it belongs to.
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
Task<User> AddUserAsync(User user);
/// <summary>
/// Update an existing user in the database.
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
Task<User> UpdateUserAsync(User user);
/// <summary>
/// Delete / remove a user in the database
/// </summary>
/// <param name="userId">ID-reference to the <see cref="User"/></param>
/// <param name="siteId">ID-reference to the <see cref="Site"/></param>
/// <returns></returns>
Task DeleteUserAsync(int userId, int siteId);
/// <summary>
/// Will login the specified <see cref="User"/>.
///
/// Note that this will probably not be a real User, but a user object where the `Username` and `Password` have been filled.
/// </summary>
/// <param name="user">A <see cref="User"/> object which should have at least the <see cref="User.Username"/> and <see cref="User.Password"/> set.</param>
/// <param name="setCookie">Determines if the login cookie should be set (only relevant for Hybrid scenarios)</param>
/// <param name="isPersistent">Determines if the login cookie should be persisted for a long time.</param>
/// <returns></returns>
Task<User> LoginUserAsync(User user, bool setCookie, bool isPersistent);
/// <summary>
/// Logout a <see cref="User"/>
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
Task LogoutUserAsync(User user);
/// <summary>
/// Logout a <see cref="User"/>
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
Task LogoutUserEverywhereAsync(User user);
/// <summary>
/// Update e-mail verification status of a user.
/// </summary>
/// <param name="user">The <see cref="User"/> we're verifying</param>
/// <param name="token">A Hash value in the URL which verifies this user got the e-mail (containing this token)</param>
/// <returns></returns>
Task<User> VerifyEmailAsync(User user, string token);
/// <summary>
/// Trigger a forgot-password e-mail for this <see cref="User"/>.
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
Task ForgotPasswordAsync(User user);
/// <summary>
/// Reset the password of this <see cref="User"/>
/// </summary>
/// <param name="user"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<User> ResetPasswordAsync(User user, string token);
/// <summary>
/// Verify the two factor verification code <see cref="User"/>
/// </summary>
/// <param name="user"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<User> VerifyTwoFactorAsync(User user, string token);
/// <summary>
/// Validate identity user info.
/// </summary>
/// <param name="username"></param>
/// <param name="email"></param>
/// <param name="password"></param>
/// <returns></returns>
Task<UserValidateResult> ValidateUserAsync(string username, string email, string password);
/// <summary>
/// Validate a users password against the password policy
/// </summary>
/// <param name="password"></param>
/// <returns></returns>
Task<bool> ValidatePasswordAsync(string password);
/// <summary>
/// Get token for current user
/// </summary>
/// <returns></returns>
Task<string> GetTokenAsync();
/// <summary>
/// Get personal access token for current user (administrators only)
/// </summary>
/// <returns></returns>
Task<string> GetPersonalAccessTokenAsync();
/// <summary>
/// Link an external login with a local user account
/// </summary>
/// <param name="user">The <see cref="User"/> we're verifying</param>
/// <param name="token">A Hash value in the URL which verifies this user got the e-mail (containing this token)</param>
/// <param name="type">External Login provider type</param>
/// <param name="key">External Login provider key</param>
/// <param name="name">External Login provider display name</param>
/// <returns></returns>
Task<User> LinkUserAsync(User user, string token, string type, string key, string name);
/// <summary>
/// Get password requirements for site
/// </summary>
/// <param name="siteId">ID of a <see cref="Site"/></param>
/// <returns></returns>
Task<string> GetPasswordRequirementsAsync(int siteId);
/// <summary>
/// Bulk import of users
/// </summary>
/// <param name="siteId">ID of a <see cref="Site"/></param>
/// <param name="fileId">ID of a <see cref="File"/></param>
/// <param name="notify">Indicates if new users should be notified by email</param>
/// <returns></returns>
Task<Dictionary<string, string>> ImportUsersAsync(int siteId, int fileId, bool notify);
}
}

View File

@@ -0,0 +1,29 @@
using Oqtane.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="Visitor"/>s on a <see cref="Site"/>
/// </summary>
public interface IVisitorService
{
/// <summary>
/// Get all <see cref="Visitor"/>s of this <see cref="Site"/>.
///
/// </summary>
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
/// <returns></returns>
Task<List<Visitor>> GetVisitorsAsync(int siteId, DateTime fromDate);
/// <summary>
/// Get a specific <see cref="Visitor"/> of this <see cref="Site"/>.
///
/// </summary>
/// <param name="visitorId">ID-reference of a <see cref="Visitor"/></param>
/// <returns></returns>
Task<Visitor> GetVisitorAsync(int visitorId);
}
}

View File

@@ -1,32 +1,13 @@
using Oqtane.Models;
using System.Threading.Tasks;
using System.Net.Http;
using System.Linq;
using System.Collections.Generic;
using Oqtane.Documentation;
using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to read the job schedule log
/// </summary>
public interface IJobLogService
{
/// <summary>
/// Return a list of <see cref="JobLog"/> entries
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task<List<JobLog>> GetJobLogsAsync(int jobId);
/// <summary>
/// Return a <see cref="JobLog"/> entry for the given Id
/// </summary>
/// <param name="jobLogId"></param>
/// <returns></returns>
Task<JobLog> GetJobLogAsync(int jobLogId);
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class JobLogService : ServiceBase, IJobLogService
{

View File

@@ -8,60 +8,6 @@ using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage jobs (<see cref="Job"/>)
/// </summary>
public interface IJobService
{
/// <summary>
/// Returns a list of all jobs
/// </summary>
/// <returns></returns>
Task<List<Job>> GetJobsAsync();
/// <summary>
/// Return a specific job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task<Job> GetJobAsync(int jobId);
/// <summary>
/// Adds a new job
/// </summary>
/// <param name="job"></param>
/// <returns></returns>
Task<Job> AddJobAsync(Job job);
/// <summary>
/// Updates an existing job
/// </summary>
/// <param name="job"></param>
/// <returns></returns>
Task<Job> UpdateJobAsync(Job job);
/// <summary>
/// Delete an existing job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task DeleteJobAsync(int jobId);
/// <summary>
/// Starts the given job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task StartJobAsync(int jobId);
/// <summary>
/// Stops the given job
/// </summary>
/// <param name="jobId"></param>
/// <returns></returns>
Task StopJobAsync(int jobId);
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class JobService : ServiceBase, IJobService
{

View File

@@ -7,55 +7,6 @@ using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to manage <see cref="Language"/> entries
/// </summary>
public interface ILanguageService
{
/// <summary>
/// Returns a list of all available languages for the given <see cref="Site"/>
/// </summary>
/// <param name="siteId"></param>
/// <returns></returns>
Task<List<Language>> GetLanguagesAsync(int siteId);
/// <summary>
/// Returns a list of all available languages for the given <see cref="Site" /> and package
/// </summary>
/// <param name="siteId"></param>
/// <param name="packageName"></param>
/// <returns></returns>
Task<List<Language>> GetLanguagesAsync(int siteId, string packageName);
/// <summary>
/// Returns the given language
/// </summary>
/// <param name="languageId"></param>
/// <returns></returns>
Task<Language> GetLanguageAsync(int languageId);
/// <summary>
/// Adds the given language
/// </summary>
/// <param name="language"></param>
/// <returns></returns>
Task<Language> AddLanguageAsync(Language language);
/// <summary>
/// Edits the given language
/// </summary>
/// <param name="language"></param>
/// <returns></returns>
Task EditLanguageAsync(Language language);
/// <summary>
/// Deletes the given language
/// </summary>
/// <param name="languageId"></param>
/// <returns></returns>
Task DeleteLanguageAsync(int languageId);
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class LanguageService : ServiceBase, ILanguageService
{

View File

@@ -5,19 +5,6 @@ using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to set localization cookie
/// </summary>
public interface ILocalizationCookieService
{
/// <summary>
/// Set the localization cookie
/// </summary>
/// <param name="culture"></param>
/// <returns></returns>
Task SetLocalizationCookieAsync(string culture);
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class LocalizationCookieService : ServiceBase, ILocalizationCookieService
{

View File

@@ -7,18 +7,6 @@ using Oqtane.Shared;
namespace Oqtane.Services
{
/// <summary>
/// Service to retrieve localizations (<see cref="Culture"/>)
/// </summary>
public interface ILocalizationService
{
/// <summary>
/// Returns a collection of supported cultures
/// </summary>
/// <returns></returns>
Task<IEnumerable<Culture>> GetCulturesAsync(bool installed);
}
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class LocalizationService : ServiceBase, ILocalizationService
{

Some files were not shown because too many files have changed in this diff Show More