public void Set(IAppProvider plugin, string key, string value) { Plugin pl = sys.InstalledPlugins.First(p => Object.ReferenceEquals(p.PluginObj, plugin)); using (var session = sys.GetDBSession()) { Configuration.Plugin pConf = session.Load<Configuration.Plugin>(pl.DbId); pConf.Settings[key] = value; session.SaveChanges(); } }
public string Get(IAppProvider plugin, string key) { Plugin pl = sys.InstalledPlugins.First(p => Object.ReferenceEquals(p.PluginObj, plugin)); using (var session = sys.GetDBSession()) { Configuration.Plugin pConf = session.Load<Configuration.Plugin>(pl.DbId); if (!pConf.Settings.ContainsKey(key)) return null; return pConf.Settings[key]; } }
internal Server(IAppProvider appProvider, IAuthorizer authorizer, IListener listener, ISerializer serializer) { // todo1[ak] check args _lock = new object(); if (appProvider == null) { throw new ArgumentNullException("appProvider"); } _appProvider = appProvider; _authorizer = authorizer; _listener = listener; _serializer = serializer; _channels = new List<IChannel>(); }
public ContentEnricher(IEnumerable <IContentEnricherStep> steps, IAppProvider appProvider) { this.steps = steps; this.appProvider = appProvider; }
public AppResolver(IAppProvider appProvider) { Guard.NotNull(appProvider, nameof(appProvider)); this.appProvider = appProvider; }
public LocalCopy(IAppProvider source, ITransferTarget target, ISteamApplication app) : base(source, target, app) { }
public static Task <IEnumerable <ValidationError> > ValidateAsync(Guid appId, RuleTrigger action, IAppProvider appProvider) { Guard.NotNull(action); Guard.NotNull(appProvider); var visitor = new RuleTriggerValidator(x => appProvider.GetSchemaAsync(appId, x)); return(action.Accept(visitor)); }
public static Task CanCreate(CreateSchema command, IAppProvider appProvider) { Guard.NotNull(command, nameof(command)); return(Validate.It(() => "Cannot create schema.", async e => { if (!command.Name.IsSlug()) { e(Not.ValidSlug("Name"), nameof(command.Name)); } else if (await appProvider.GetSchemaAsync(command.AppId.Id, command.Name) != null) { e("A schema with the same name already exists."); } if (command.Fields?.Count > 0) { var fieldIndex = 0; var fieldPrefix = string.Empty; foreach (var field in command.Fields) { fieldIndex++; fieldPrefix = $"Fields[{fieldIndex}]"; if (!field.Partitioning.IsValidPartitioning()) { e(Not.Valid("Partitioning"), $"{fieldPrefix}.{nameof(field.Partitioning)}"); } ValidateField(e, fieldPrefix, field); if (field.Nested?.Count > 0) { if (field.Properties is ArrayFieldProperties) { var nestedIndex = 0; var nestedPrefix = string.Empty; foreach (var nestedField in field.Nested) { nestedIndex++; nestedPrefix = $"{fieldPrefix}.Nested[{nestedIndex}]"; if (nestedField.Properties is ArrayFieldProperties) { e("Nested field cannot be array fields.", $"{nestedPrefix}.{nameof(nestedField.Properties)}"); } ValidateField(e, nestedPrefix, nestedField); } } else if (field.Nested.Count > 0) { e("Only array fields can have nested fields.", $"{fieldPrefix}.{nameof(field.Partitioning)}"); } if (field.Nested.Select(x => x.Name).Distinct().Count() != field.Nested.Count) { e("Fields cannot have duplicate names.", $"{fieldPrefix}.Nested"); } } } if (command.Fields.Select(x => x.Name).Distinct().Count() != command.Fields.Count) { e("Fields cannot have duplicate names.", nameof(command.Fields)); } } })); }
public MongoContentCollection(IMongoDatabase database, IJsonSerializer serializer, IAppProvider appProvider) : base(database) { this.appProvider = appProvider; this.serializer = serializer; }
public QueryAsStream(DataConverter converter, IAppProvider appProvider) : base(converter) { this.appProvider = appProvider; }
public static async Task <ResolvedComponents> GetComponentsAsync(this IAppProvider appProvider, ISchemaEntity schema, CancellationToken ct = default) { Dictionary <DomainId, Schema>?result = null; var appId = schema.AppId.Id; async Task ResolveWithIdsAsync(IField field, ReadonlyList <DomainId>?schemaIds) { if (schemaIds == null) { return; } foreach (var schemaId in schemaIds) { if (schemaId == schema.Id) { result ??= new Dictionary <DomainId, Schema>(); result[schemaId] = schema.SchemaDef; } else if (result == null || !result.TryGetValue(schemaId, out _)) { var resolvedEntity = await appProvider.GetSchemaAsync(appId, schemaId, false, ct); if (resolvedEntity != null) { result ??= new Dictionary <DomainId, Schema>(); result[schemaId] = resolvedEntity.SchemaDef; await ResolveSchemaAsync(resolvedEntity); } } } } async Task ResolveArrayAsync(IArrayField arrayField) { foreach (var nestedField in arrayField.Fields) { await ResolveFieldAsync(nestedField); } } async Task ResolveFieldAsync(IField field) { switch (field) { case IField <ComponentFieldProperties> component: await ResolveWithIdsAsync(field, component.Properties.SchemaIds); break; case IField <ComponentsFieldProperties> components: await ResolveWithIdsAsync(field, components.Properties.SchemaIds); break; case IArrayField arrayField: await ResolveArrayAsync(arrayField); break; } } async Task ResolveSchemaAsync(ISchemaEntity schema) { foreach (var field in schema.SchemaDef.Fields) { await ResolveFieldAsync(field); } } await ResolveSchemaAsync(schema); if (result == null) { return(ResolvedComponents.Empty); } return(new ResolvedComponents(result)); }
public void Set(IAppProvider plugin, string key, object value) { Set(plugin, key, value.ToString()); }
public AppModuleScriptCreator(IAppProvider appProvider) { AppProvider = appProvider; }
public AppClientsController(ICommandBus commandBus, IAppProvider appProvider) : base(commandBus) { this.appProvider = appProvider; }
public MongoContentPublishedCollection(IMongoDatabase database, IJsonSerializer serializer, IAppProvider appProvider) : base(database, serializer, appProvider, "State_Content_Published") { }
public DynamicContentWorkflow(IScriptEngine scriptEngine, IAppProvider appProvider) { this.scriptEngine = scriptEngine; this.appProvider = appProvider; }
/// <summary> /// Initializes a new instance of the <see cref="HomeController"/> class. /// </summary> /// <param name="appProvider">The app provider.</param> public HomeController(IAppProvider appProvider) { this.AppProvider = appProvider; }
public static Task <IEnumerable <ValidationError> > ValidateAsync(DomainId appId, RuleTrigger trigger, IAppProvider appProvider) { Guard.NotNull(trigger, nameof(trigger)); Guard.NotNull(appProvider, nameof(appProvider)); var visitor = new RuleTriggerValidator(x => appProvider.GetSchemaAsync(appId, x)); return(trigger.Accept(visitor)); }
public AppResolver(IAppProvider appProvider) { this.appProvider = appProvider; }
public AppApiController(IAppProvider appProvider) { AppProvider = appProvider; }
public EnrichWithSchemaIdCommandMiddleware(IAppProvider appProvider, IActionContextAccessor actionContextAccessor) { this.appProvider = appProvider; this.actionContextAccessor = actionContextAccessor; }
public AppLanguagesController(ICommandBus commandBus, IAppProvider appProvider) : base(commandBus) { this.appProvider = appProvider; }
public DefaultWorkflowsValidator(IAppProvider appProvider) { Guard.NotNull(appProvider, nameof(appProvider)); this.appProvider = appProvider; }
public QueryByQuery(IAppProvider appProvider) { this.appProvider = appProvider; }
public QueryContentsByIds(IJsonSerializer serializer, IAppProvider appProvider) { this.serializer = serializer; this.appProvider = appProvider; }
public QueryContentsByIds(DataConverter converter, IAppProvider appProvider) { this.converter = converter; this.appProvider = appProvider; }
public DefaultWorkflowsValidator(IAppProvider appProvider) { this.appProvider = appProvider; }
public QueryByQuery(DataConverter dataConverter, IAppProvider appProvider) : base(dataConverter) { this.appProvider = appProvider; }
public AppApiFilter(IAppProvider appProvider) { this.appProvider = appProvider; }
public RolePermissionsProvider(IAppProvider appProvider) { Guard.NotNull(appProvider, nameof(appProvider)); this.appProvider = appProvider; }
public ReferenceTag(IContentQueryService contentQueryService, IAppProvider appProvider) { this.contentQueryService = contentQueryService; this.appProvider = appProvider; }
public SchemasSearchSource(IAppProvider appProvider, IUrlGenerator urlGenerator) { this.appProvider = appProvider; this.urlGenerator = urlGenerator; }
public SchemasController(ICommandBus commandBus, IAppProvider appProvider) : base(commandBus) { this.appProvider = appProvider; }
public ContentOperationContext(IAppProvider appProvider, IEnumerable <IValidatorsFactory> factories, IScriptEngine scriptEngine) { this.appProvider = appProvider; this.factories = factories; this.scriptEngine = scriptEngine; }
public static IServer CreateServer(IAppProvider appProvider, IAuthorizer authorizer, IListener listener, ISerializer serializer) { Server srv = new Server(appProvider, authorizer, listener, serializer); return srv; }
public RemoteSteamApp(ISteamApplication receivedData, IAppProvider provider) { _appInfo = receivedData; _provider = provider; }