improved file upload, enhanced module installation from Nuget to support upgrades, added ability to upgrade the framework from Nuget, completed isolated multitenancy and site alias management, created IPortable interface for importing data into modules, added default content to initial installation
This commit is contained in:
46
Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs
Normal file
46
Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Modules.HtmlText.Models;
|
||||
using Oqtane.Modules.HtmlText.Repository;
|
||||
using System.Net;
|
||||
|
||||
namespace Oqtane.Modules.HtmlText.Manager
|
||||
{
|
||||
public class HtmlTextManager : IPortable
|
||||
{
|
||||
private IHtmlTextRepository htmltexts;
|
||||
|
||||
public HtmlTextManager(IHtmlTextRepository htmltexts)
|
||||
{
|
||||
this.htmltexts = htmltexts;
|
||||
}
|
||||
|
||||
public string ExportModule(Module Module)
|
||||
{
|
||||
string content = "";
|
||||
HtmlTextInfo htmltext = htmltexts.GetHtmlText(Module.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
content = WebUtility.HtmlEncode(htmltext.Content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
public void ImportModule(Module Module, string Content, string Version)
|
||||
{
|
||||
Content = WebUtility.HtmlDecode(Content);
|
||||
HtmlTextInfo htmltext = htmltexts.GetHtmlText(Module.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
htmltext.Content = Content;
|
||||
htmltexts.UpdateHtmlText(htmltext);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = new HtmlTextInfo();
|
||||
htmltext.ModuleId = Module.ModuleId;
|
||||
htmltext.Content = Content;
|
||||
htmltexts.AddHtmlText(htmltext);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
13
Oqtane.Server/Modules/IPortable.cs
Normal file
13
Oqtane.Server/Modules/IPortable.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Modules
|
||||
{
|
||||
public interface IPortable
|
||||
{
|
||||
// You Must Set The "ServerAssemblyName" In Your IModule Interface
|
||||
|
||||
string ExportModule(Module Module);
|
||||
|
||||
void ImportModule(Module Module, string Content, string Version);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user