12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using InABox.Core;
- namespace Comal.Classes
- {
- /* A WebTemplate represents the html template used for building web pages. */
- public class WebTemplate : Entity, IRemotable, IPersistent, ILicense<WebAccessLicense>, 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;
- /// <summary>
- /// 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.<br/>
- /// A client who sets this to <see langword="true"/> does so at their own risk.<br/>
- /// 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.
- /// </summary>
- [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}";
- }
- }
- }
|