public Startup( IShellConfiguration configuration, IOptions <ShellOptions> shellOptions, ShellSettings shellSettings, ILogger <Startup> logger) { _configuration = configuration; _shellOptions = shellOptions.Value; _shellSettings = shellSettings; _logger = logger; }
private string GetMediaPath(ShellOptions shellOptions, ShellSettings shellSettings, string assetsPath) { return(PathExtensions.Combine(shellOptions.ShellsApplicationDataPath, shellOptions.ShellsContainerName, shellSettings.Name, assetsPath)); }
private string GetMediaPath(IHostingEnvironment env, ShellOptions shellOptions, ShellSettings shellSettings) { var relativeMediaPath = Path.Combine(shellOptions.ShellsRootContainerName, shellOptions.ShellsContainerName, shellSettings.Name, "Media"); return(env.ContentRootFileProvider.GetFileInfo(relativeMediaPath).PhysicalPath); }
public ShellManager(ShellOptions options) { Options = options; }
private string GetContentRoot(ShellOptions shellOptions, ShellSettings shellSettings) { return(Path.Combine(shellOptions.ShellsApplicationDataPath, shellOptions.ShellsContainerName, shellSettings.Name, AssetsPath)); }
private string GetContentRoot(ShellOptions shellOptions, ShellSettings shellSettings) { return(Path.Combine(shellOptions.ShellsApplicationDataPath, LogsPath)); }
private static int RunShell(ShellOptions opts) { GrammarShell.Repl(); return(0); }
public CodeGenerableResult GenerateCode(string varName = null, int space = 0) { var codeResult = new CodeGenerableResult { DeletingCode = $"versionContext.DeleteData<LetPortal.Portal.Entities.Pages.Page>(\"{Id}\");" }; var stringBuilder = new StringBuilder(); varName ??= Name.Replace("-", "", System.StringComparison.OrdinalIgnoreCase) + "Page"; _ = stringBuilder.AppendLine($"var {varName} = new LetPortal.Portal.Entities.Pages.Page"); _ = stringBuilder.AppendLine($"{{"); _ = stringBuilder.AppendLine($" Id = \"{Id}\","); _ = stringBuilder.AppendLine($" Name = \"{Name}\","); _ = stringBuilder.AppendLine($" DisplayName = \"{DisplayName}\","); _ = stringBuilder.AppendLine($" AppId = \"{AppId}\","); _ = stringBuilder.AppendLine($" UrlPath = \"{UrlPath}\","); if (ShellOptions != null && ShellOptions.Any()) { _ = stringBuilder.AppendLine($" ShellOptions = new System.Collections.Generic.List<LetPortal.Portal.Entities.Pages.ShellOption>"); _ = stringBuilder.AppendLine($" {{"); foreach (var option in ShellOptions) { _ = stringBuilder.AppendLine($" new LetPortal.Portal.Entities.Pages.ShellOption"); _ = stringBuilder.AppendLine($" {{"); _ = stringBuilder.AppendLine($" Key = \"{option.Key}\","); _ = stringBuilder.AppendLine($" Value = \"{option.Value}\","); _ = stringBuilder.AppendLine($" Description = \"{option.Description}\""); _ = stringBuilder.AppendLine($" }},"); } _ = stringBuilder.AppendLine($" }},"); } if (Claims != null && Claims.Any()) { _ = stringBuilder.AppendLine($" Claims = new System.Collections.Generic.List<LetPortal.Core.Security.PortalClaim>"); _ = stringBuilder.AppendLine($" {{"); foreach (var claim in Claims) { _ = stringBuilder.AppendLine($" new LetPortal.Core.Security.PortalClaim"); _ = stringBuilder.AppendLine($" {{"); _ = stringBuilder.AppendLine($" Name = \"{claim.Name}\","); _ = stringBuilder.AppendLine($" DisplayName = \"{claim.DisplayName}\","); var claimType = "LetPortal.Core.Security.ClaimValueType." + Enum.GetName(typeof(ClaimValueType), claim.ClaimValueType); _ = stringBuilder.AppendLine($" ClaimValueType = {claimType}"); _ = stringBuilder.AppendLine($" }},"); } _ = stringBuilder.AppendLine($" }},"); } if (Builder != null) { _ = stringBuilder.AppendLine(Builder.GenerateCode().InsertingCode); } if (PageDatasources != null && PageDatasources.Any()) { _ = stringBuilder.AppendLine($" PageDatasources = new System.Collections.Generic.List<LetPortal.Portal.Entities.Pages.PageDatasource>"); _ = stringBuilder.AppendLine($" {{"); foreach (var pageDatasource in PageDatasources) { _ = stringBuilder.AppendLine($" new LetPortal.Portal.Entities.Pages.PageDatasource"); _ = stringBuilder.AppendLine($" {{"); _ = stringBuilder.AppendLine($" Id = \"{pageDatasource.Id}\","); _ = stringBuilder.AppendLine($" Name = \"{pageDatasource.Name}\","); _ = stringBuilder.AppendLine($" TriggerCondition = \"{pageDatasource.TriggerCondition}\","); _ = stringBuilder.AppendLine($" IsActive = {pageDatasource.IsActive.ToString().ToLower()},"); _ = stringBuilder.AppendLine(pageDatasource.Options.GenerateCode("Options", space = 2).InsertingCode); _ = stringBuilder.AppendLine($" }},"); } _ = stringBuilder.AppendLine($" }},"); } if (Commands != null && Commands.Any()) { _ = stringBuilder.AppendLine($" Commands = new System.Collections.Generic.List<LetPortal.Portal.Entities.Pages.PageButton>"); _ = stringBuilder.AppendLine($" {{"); foreach (var command in Commands) { _ = stringBuilder.AppendLine($" new LetPortal.Portal.Entities.Pages.PageButton"); _ = stringBuilder.AppendLine($" {{"); _ = stringBuilder.AppendLine($" Id = \"{command.Id}\","); _ = stringBuilder.AppendLine($" Name = \"{command.Name}\","); _ = stringBuilder.AppendLine($" Icon = \"{command.Icon}\","); _ = stringBuilder.AppendLine($" Color = \"{command.Color}\","); _ = stringBuilder.AppendLine($" AllowHidden = \"{command.AllowHidden}\","); _ = stringBuilder.AppendLine($" PlaceSectionId = \"{command.PlaceSectionId}\","); _ = stringBuilder.AppendLine($" IsRequiredValidation = {command.IsRequiredValidation.ToString().ToLower()},"); _ = stringBuilder.AppendLine(command.ButtonOptions.GenerateCode(space: 3).InsertingCode); _ = stringBuilder.AppendLine($" }},"); } _ = stringBuilder.AppendLine($" }},"); } _ = stringBuilder.AppendLine($"}};"); _ = stringBuilder.AppendLine($"versionContext.InsertData({varName});"); codeResult.InsertingCode = stringBuilder.ToString(); return(codeResult); }
public ShellRunner(ShellOptions options) { Options = options; }