using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; namespace Oqtane.Models { /// /// Describes a Site in a in an Oqtane installation. /// Sites can have multiple es. /// public class Site : ModelBase, IDeletable { /// /// The ID of the Site /// public int SiteId { get; set; } /// /// Reference to the the Site is in /// public int TenantId { get; set; } /// /// The site Name /// public string Name { get; set; } /// /// Reference to a which has the Logo for this site. /// Should be an image. /// The theme can then use this where needed. /// public int? LogoFileId { get; set; } /// /// Reference to a which has the FavIcon for this site. /// Should be an image. /// The theme can then use this where needed. /// public int? FaviconFileId { get; set; } /// /// Default theme for the site /// public string DefaultThemeType { get; set; } /// /// Default container for the site /// public string DefaultContainerType { get; set; } /// /// Default admin container /// public string AdminContainerType { get; set; } /// /// Indicates if the site is a progressive web application (PWA) /// public bool PwaIsEnabled { get; set; } /// /// The app icon for the progressive web application (PWA) /// public int? PwaAppIconFileId { get; set; } /// /// The splash icon for the progressive web application (PWA) /// public int? PwaSplashIconFileId { get; set; } /// /// Determines if visitors may register / create user accounts /// public bool AllowRegistration { get; set; } /// /// Determines if site visitors will be recorded /// public bool VisitorTracking { get; set; } /// /// Determines if broken urls (404s) will be captured automatically /// public bool CaptureBrokenUrls { get; set; } /// /// Unique GUID to identify the Site. /// public string SiteGuid { get; set; } /// /// The default render mode for the site ie. Static,Interactive,Headless /// public string RenderMode { get; set; } /// /// The render mode for UI components which require interactivity ie. Server,WebAssembly,Auto /// public string Runtime { get; set; } /// /// If the site supports prerendering (only applies to Interactive rendermode) /// public bool Prerender { get; set; } /// /// Indicates if a site can be integrated with an external .NET MAUI hybrid application /// public bool Hybrid { get; set; } /// /// Keeps track of site configuration changes and is used by the ISiteMigration interface /// public string Version { get; set; } /// /// The home page of the site - the "/" path will be used by default if no home page is specified /// public int? HomePageId { get; set; } /// /// Content to be included in the head of the page /// public string HeadContent { get; set; } /// /// Content to be included in the body of the page /// public string BodyContent { get; set; } /// /// Indicates if site is deleted /// public bool IsDeleted { get; set; } /// /// The user who deleted site /// public string DeletedBy { get; set; } /// /// Date site was deleted /// public DateTime? DeletedOn { get; set; } /// /// The allowable iamge file extensions /// [NotMapped] public string ImageFiles { get; set; } /// /// The allowable file extensions which can be uploaded /// [NotMapped] public string UploadableFiles { get; set; } /// /// Used when provisioning a site from a site template /// [NotMapped] public string SiteTemplateType { get; set; } /// /// The settings for the site /// [NotMapped] public Dictionary Settings { get; set; } /// /// List of pages for the site /// [NotMapped] public List Pages { get; set; } /// /// List of languages for the site /// [NotMapped] public List Languages { get; set; } /// /// List of themes for the site /// [NotMapped] public List Themes { get; set; } public Site Clone(Site site) { return new Site { SiteId = site.SiteId, TenantId = site.TenantId, Name = site.Name, LogoFileId = site.LogoFileId, FaviconFileId = site.FaviconFileId, DefaultThemeType = site.DefaultThemeType, DefaultContainerType = site.DefaultContainerType, AdminContainerType = site.AdminContainerType, PwaIsEnabled = site.PwaIsEnabled, PwaAppIconFileId = site.PwaAppIconFileId, PwaSplashIconFileId = site.PwaSplashIconFileId, AllowRegistration = site.AllowRegistration, VisitorTracking = site.VisitorTracking, CaptureBrokenUrls = site.CaptureBrokenUrls, SiteGuid = site.SiteGuid, RenderMode = site.RenderMode, Runtime = site.Runtime, Prerender = site.Prerender, Hybrid = site.Hybrid, Version = site.Version, HomePageId = site.HomePageId, HeadContent = site.HeadContent, BodyContent = site.BodyContent, IsDeleted = site.IsDeleted, DeletedBy = site.DeletedBy, DeletedOn = site.DeletedOn, ImageFiles = site.ImageFiles, UploadableFiles = site.UploadableFiles, SiteTemplateType = site.SiteTemplateType, CreatedBy = site.CreatedBy, CreatedOn = site.CreatedOn, ModifiedBy = site.ModifiedBy, ModifiedOn = site.ModifiedOn, Settings = site.Settings.ToDictionary(), Pages = site.Pages.ToList(), Languages = site.Languages.ToList(), Themes = site.Themes.ToList() }; } #region Obsolete properties [NotMapped] [Obsolete("This property is deprecated.", false)] public string DefaultLayoutType { get; set; } #endregion } }