123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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; }
- /// <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; }
- protected override void Init()
- {
- base.Init();
- Slug = "";
- Template = "";
- Visible = false;
- RootURL = false;
- }
- public override string ToString()
- {
- return RootURL ? $"{DataModel}/{Slug}" : $"v1/{DataModel}/{Slug}";
- }
- }
- }
|