using InABox.Core; namespace Comal.Classes { /* A WebTemplate represents the html template used for building web pages. */ public class WebTemplate : Entity, IRemotable, IPersistent, ILicense, IExportable, IImportable, ISecure { [TextBoxEditor] [EditorSequence(1)] public string DataModel { get; set; } [TextBoxEditor] [EditorSequence(2)] public string Slug { get; set; } = ""; [TextBoxEditor] [EditorSequence(3)] public string Description { get; set; } [ScriptEditor(SyntaxLanguage.HTML)] [EditorSequence(4)] public string Template { get; set; } = ""; [CheckBoxEditor] [EditorSequence(5)] public bool Visible { get; set; } = false; /// /// Determines whether the URL endpoint is prefixed with "v1/" - this should be the default, to allow us, PRS, to add endpoints to the Web Engine.
/// A client who sets this to does so at their own risk.
/// However, to minimise conflict, I propose that we only create internal endpoints that begin with a lower case letter, /// thus allowing all upper-case letters to be used by clients. ///
[CheckBoxEditor(Visible = InABox.Core.Visible.Optional)] [EditorSequence(5)] public bool RootURL { get; set; } = false; public override string ToString() { return RootURL ? $"{DataModel}/{Slug}" : $"v1/{DataModel}/{Slug}"; } } }