Exemplo n.º 1
0
 public EnginesController(IAuthorizationService authService, IEngineRepository engines,
                          IEngineService engineService)
 {
     _authService   = authService;
     _engines       = engines;
     _engineService = engineService;
 }
Exemplo n.º 2
0
 public BuildsController(IBuildRepository buildRepo, IEngineRepository engineRepo, EngineService engineService,
                         IOptions <EngineOptions> options)
 {
     _buildRepo     = buildRepo;
     _engineService = engineService;
     _options       = options;
 }
Exemplo n.º 3
0
        public TItem TryLocateItem(IEngineRepository <TItem> navRepository, object findValue)
        {
            TValue convertedValue = ConversionUtility.ConvertValue <TValue>(findValue);
            var    predicate      = IdentifierExpressionHelpers.GetIdentifierPredicate(_getLocatorValueExpression, convertedValue);

            return(navRepository.GetAllItems().Where(predicate).SingleOrDefault());
        }
Exemplo n.º 4
0
 public FlatFileWriter(IUnitOfWork uow, IEngineRepository enginRepo, ILogger <EngineElement> logger, IMessageService messageService) : base(uow, enginRepo, logger, messageService)
 {
     // Register element properties
     RegisterInputProperties("TargetFilePath", "", DataType.VirtualPath, true);
     RegisterInputProperties("ColumnDelimiter", "", DataType.Char, true);
     RegisterInputProperties("Table", "", DataType.Table, true);
 }
Exemplo n.º 5
0
        public CreatableItem(IEngineRepository <TItem> navRepository)
            : base(null, navRepository)
        {
            _navRepository = navRepository;

            Query = Enumerable.Empty <TItem>().SingleDefferred();
        }
Exemplo n.º 6
0
        public FullEngineContext(IDataTransaction transaction, IEngineRepository <TItem> repository, [NotNull] IEngineSubContext <TItem> subContext)
        {
            Transaction = transaction;
            Repository  = repository;

            _subContext = subContext;
        }
Exemplo n.º 7
0
 public SqlTableWriter(IUnitOfWork uow, IEngineRepository enginRepo, ILogger <EngineElement> logger, IMessageService messageService) : base(uow, enginRepo, logger, messageService)
 {
     // Register element properties
     RegisterInputProperties("ConnectionString", "Sql Server Connection String", DataType.String, true);
     RegisterInputProperties("SqlTable", "Sql destination table", DataType.String, true);
     RegisterInputProperties("ColumnsMapping", "Columns Mapping", DataType.Collection);
     RegisterInputProperties("SourceTable", "Source TableValue", DataType.Table, true);
 }
Exemplo n.º 8
0
 public FirstController(RoleManager <IdentityRole> roleManager,
                        UserManager <IdentityUser> userManager,
                        IEngineRepository engineRepository)
 {
     this.roleManager      = roleManager;
     this.userManager      = userManager;
     this.engineRepository = engineRepository;
 }
Exemplo n.º 9
0
 public BuildsController(IAuthorizationService authService, IBuildRepository builds,
                         IEngineRepository engines, IEngineService engineService, IOptions <EngineOptions> engineOptions)
 {
     _authService   = authService;
     _builds        = builds;
     _engines       = engines;
     _engineService = engineService;
     _engineOptions = engineOptions;
 }
Exemplo n.º 10
0
        public SqlQueryReader(IUnitOfWork uow, IEngineRepository enginRepo, ILogger <EngineElement> logger, IMessageService messageService, ISqlValidationService sqlValidationService) : base(uow, enginRepo, logger, messageService)
        {
            this.sqlValidationService = sqlValidationService;

            // Register element properties
            RegisterInputProperties("ConnectionString", "Sql Server Connection String", DataType.String, true);
            RegisterInputProperties("SqlQuery", "SqL Query", DataType.String, true);

            RegisterOutputProperties("Table", "Rows imported from Sql Query", DataType.Table, true);
        }
Exemplo n.º 11
0
 public PlanEngineAppService(IPlanEngineQuery planEngineQuery,
     IAirlinesRepository airlinesRepository, IEngineRepository engineRepository,
     IEngineTypeRepository engineTypeRepository, IPlanEngineRepository planEngineRepository)
 {
     _planEngineQuery = planEngineQuery;
     _airlinesRepository = airlinesRepository;
     _engineRepository = engineRepository;
     _engineTypeRepository = engineTypeRepository;
     _planEngineRepository = planEngineRepository;
 }
Exemplo n.º 12
0
 public AdminEnginesService(
     IEngineRepository engineRepository,
     IAdminCommonDeleteService adminDeleteService,
     IAdminCommonEditService adminEditService,
     IAdminCommonCreateService adminCreateService)
 {
     this.engineRepository   = engineRepository;
     this.adminDeleteService = adminDeleteService;
     this.adminEditService   = adminEditService;
     this.adminCreateService = adminCreateService;
 }
Exemplo n.º 13
0
 public EnginesController(
     IAdminEnginesService enginesService,
     ICookiesService cookiesService,
     IEngineRepository engineRepository,
     IAdminTransmissionsService adminTransmissionsService)
 {
     this.enginesService            = enginesService;
     this.cookiesService            = cookiesService;
     this.engineRepository          = engineRepository;
     this.adminTransmissionsService = adminTransmissionsService;
 }
Exemplo n.º 14
0
        public FlatFileReader(IUnitOfWork uow, IEngineRepository enginRepo, ILogger <EngineElement> logger, IMessageService messageService) : base(uow, enginRepo, logger, messageService)
        {
            //RegisterInputProperties("SourceFilePath", "Source file path", DataType.String, true);
            RegisterInputProperties("SourceFilePath", "Source file path", DataType.VirtualPath, true);
            RegisterInputProperties("SkipStartingDataRows", "Starting row to skip", DataType.Int);
            RegisterInputProperties("FirstRowHasHeader", "Using first row as header", DataType.Bool, true);
            RegisterInputProperties("ColumnDelimiter", "Column char delimiter", DataType.Char, true);
            RegisterInputProperties("LimitToRows", "Limit result rows", DataType.Int);

            RegisterOutputProperties("Table", "Rows imported from flat file", DataType.Table, true);
        }
Exemplo n.º 15
0
 public EngineAppService(IEngineQuery engineQuery, IActionCategoryRepository actionCategoryRepository,
     IAirlinesRepository airlinesRepository, IEngineRepository engineRepository,
     IEngineTypeRepository engineTypeRepository, ISupplierRepository supplierRepository)
 {
     _engineQuery = engineQuery;
     _actionCategoryRepository = actionCategoryRepository;
     _airlinesRepository = airlinesRepository;
     _engineRepository = engineRepository;
     _engineTypeRepository = engineTypeRepository;
     _supplierRepository = supplierRepository;
 }
            public TItem TryLocateItem(IEngineRepository <TItem> navRepository, object findValue)
            {
                throw new NotImplementedException("Not got this far yet.");

                // Not sure what to do here. Stem method can't accept a repository.

                object loadedParentItem = null;
                var    ret = _instanceMethod.DynamicInvoke(findValue, loadedParentItem);

                return((TItem)ret);
            }
Exemplo n.º 17
0
        public IdentifiedItem(string identifier, IEngineRepository <TItem> repository, IIdentifierInfo <TItem> identifierInfo)
            : base(identifier, repository)
        {
            _repository     = repository;
            _identifierInfo = identifierInfo;

            IQueryable <TItem> items = _repository.GetAllItems();
            Expression <Func <TItem, bool> > identifierPredicate = _identifierInfo.GetPredicate(identifier);

            Query = items.SingleDefferred(identifierPredicate);
        }
Exemplo n.º 18
0
 public EngineModule(
     ILogger logger,
     IMessageService messageService,
     IUnitOfWork uow,
     IEngineRepository engineRepository) : base(logger, messageService)
 {
     this.uow = uow;
     this.engineRepository = engineRepository;
     inputProperties       = new List <IEngineElementProperty>();
     outputProperties      = new List <IEngineElementProperty>();
 }
Exemplo n.º 19
0
        public void TryWrapEvents([CanBeNull] IDataChangeEvents <TItem> events)
        {
            if (events == null || !events.HasAnyEvent)
            {
                return;
            }

            var wrappedRepo = new EventWrappedRepository <TItem>(Repository, events);

            Repository  = wrappedRepo;
            Transaction = new EventWrappedTransaction(Transaction, wrappedRepo);
        }
Exemplo n.º 20
0
 public EngineUIService(
     ILogger <EngineUIService> logger,
     IUnitOfWork uow,
     IEngine engine,
     IEngineRepository engineRepository,
     IEngineUIServiceConfig configuration) : base(logger)
 {
     this.uow              = uow;
     this.engine           = engine;
     this.engineRepository = engineRepository;
     this.configuration    = configuration;
 }
Exemplo n.º 21
0
 public EngineService(IOptions <EngineOptions> options, IEngineRepository engineRepo, IBuildRepository buildRepo,
                      IRepository <Project> projectRepo, Func <string, Owned <EngineRunner> > engineRunnerFactory)
 {
     _options             = options;
     _engineRepo          = engineRepo;
     _buildRepo           = buildRepo;
     _projectRepo         = projectRepo;
     _engineRunnerFactory = engineRunnerFactory;
     _runners             = new ConcurrentDictionary <string, Owned <EngineRunner> >();
     _lock        = new AsyncReaderWriterLock();
     _commitTimer = new AsyncTimer(EngineCommitAsync);
 }
Exemplo n.º 22
0
 public EngineJob(
     IUnitOfWork uow,
     IEngineRepository enginRepo,
     ILogger <EngineJob> logger,
     IMessageService messageService,
     IServiceProvider serviceProvider,
     IEngine engine) : base(logger, messageService)
 {
     this.uow = uow;
     this.engineRepository = enginRepo;
     this.serviceProvider  = serviceProvider;
     this.engine           = engine;
 }
Exemplo n.º 23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EngineTask"/> class.
 /// </summary>
 /// <param name="uow">The uow.</param>
 /// <param name="engineRepository">The engine repository.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="messageService">The message service.</param>
 /// <param name="engine">The engine.</param>
 /// <param name="serviceProvider">The service provider.</param>
 public EngineTask(
     IUnitOfWork uow,
     IEngineRepository engineRepository,
     ILogger <EngineTask> logger,
     IMessageService messageService,
     IEngine engine,
     IServiceProvider serviceProvider) : base(logger, messageService)
 {
     this.uow = uow;
     this.engineRepository = engineRepository;
     this.engine           = engine;
     this.serviceProvider  = serviceProvider;
 }
Exemplo n.º 24
0
        /// <summary>
        /// Attempts to locate the item to modify using the modification request data.
        /// </summary>
        internal async Task <DeferredItemBase <TNav> > LocateOrCreateItemAsync(IEngineRepository <TNav> navRepository, RestItemData itemData, Func <Task> loadParentAsync)
        {
            var locatedItem = LocateItem(navRepository, itemData);

            if (locatedItem != null)
            {
                return(locatedItem);
            }

            await loadParentAsync();

            return(new CreatableItem <TNav>(navRepository));
        }
Exemplo n.º 25
0
 public EngineService(IOptions <EngineOptions> engineOptions, IEngineRepository engines,
                      IBuildRepository builds, IProjectRepository projects,
                      Func <string, Owned <EngineRuntime> > engineRuntimeFactory)
 {
     _engineOptions       = engineOptions;
     _engines             = engines;
     _builds              = builds;
     _projects            = projects;
     _engineRunnerFactory = engineRuntimeFactory;
     _runtimes            = new ConcurrentDictionary <string, Owned <EngineRuntime> >();
     _lock        = new AsyncReaderWriterLock();
     _commitTimer = new AsyncTimer(EngineCommitAsync);
 }
Exemplo n.º 26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EngineElement"/> class.
        /// </summary>
        /// <param name="uow">The uow.</param>
        /// <param name="enginRepo">The engin repo.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="messageService">The message service.</param>
        public EngineElement(
            IUnitOfWork uow,
            IEngineRepository enginRepo,
            ILogger <EngineElement> logger,
            IMessageService messageService) : base(logger, messageService)
        {
            this.uow = uow;
            this.engineRepository = enginRepo;
            inputProperties       = new List <IEngineElementProperty>();
            outputProperties      = new List <IEngineElementProperty>();

            // Create the instance ID for this element
            instance = engineRepository.CreateNewInstance();
        }
Exemplo n.º 27
0
 public StatisticController(IMapper mapper,
                            IManufacturerRepository manufacturerRepository,
                            IModelRepository modelRepository,
                            IInventoryRepository inventoryRepository,
                            IEngineTypeRepository engineTypeRepository,
                            IEngineRepository engineRepository)
 {
     _mapper        = mapper;
     _manufacturers = manufacturerRepository;
     _models        = modelRepository;
     _inventory     = inventoryRepository;
     _engines       = engineRepository;
     _engineTypes   = engineTypeRepository;
 }
Exemplo n.º 28
0
 public AdministrationController(RoleManager <IdentityRole> roleManager,
                                 UserManager <IdentityUser> userManager,
                                 ISearchRepository searchRepository,
                                 IEngineRepository engineRepository,
                                 IResultRepository resultRepository,
                                 IHistoryRepository historyRepository
                                 )
 {
     this.roleManager       = roleManager;
     this.userManager       = userManager;
     this.searchRepository  = searchRepository;
     this.engineRepository  = engineRepository;
     this.resultRepository  = resultRepository;
     this.historyRepository = historyRepository;
 }
Exemplo n.º 29
0
        public IRestCollection GetRestCollection()
        {
            IDataTransaction transaction = _dataSource.CreateTransaction();
            // TODO setup disposing of transaction

            IEngineRepository <TItem> repository = _dataSource.GetRepository <TItem>(transaction);

            var wrapper = new DataEventWrapper <TItem>(transaction, repository);

            wrapper.TryWrapEvents(_events);

            IEngineContext <TItem> context = new FullEngineContext <TItem>(wrapper.Transaction, wrapper.Repository, _subContext);

            return(new EngineRestCollection <TItem>(context));
        }
        public IRestCollection GetRestCollection(Stem <TItem> stem)
        {
            IDataTransaction transaction = _dataSource.CreateTransaction();

            stem.OnDispose += delegate { transaction.Dispose(); };

            IEngineRepository <TItem> repository = _dataSource.GetRepository <TItem>(transaction);

            var wrapper = new DataEventWrapper <TItem>(transaction, repository);

            wrapper.TryWrapEvents(new StemDataChangeEvents <TItem>(stem));

            var subContext = new StemsEngineSubContext <TItem>(stem);
            var context    = new FullEngineContext <TItem>(wrapper.Transaction, wrapper.Repository, subContext);

            return(new EngineRestCollection <TItem>(context));
        }
Exemplo n.º 31
0
        public static async Task <Engine> GetByLocatorAsync(this IEngineRepository engineRepo,
                                                            EngineLocatorType locatorType, string locator, CancellationToken ct = default(CancellationToken))
        {
            switch (locatorType)
            {
            case EngineLocatorType.Id:
                return(await engineRepo.GetAsync(locator, ct));

            case EngineLocatorType.LanguageTag:
                int    index             = locator.IndexOf("_", StringComparison.OrdinalIgnoreCase);
                string sourceLanguageTag = locator.Substring(0, index);
                string targetLanguageTag = locator.Substring(index + 1);
                return(await engineRepo.GetByLanguageTagAsync(sourceLanguageTag, targetLanguageTag, ct));

            case EngineLocatorType.Project:
                return(await engineRepo.GetByProjectIdAsync(locator, ct));
            }
            return(null);
        }
Exemplo n.º 32
0
        /// <summary>
        /// Attempts to locate the item to modify using the modification request data.
        /// </summary>
        internal DeferredItemBase <TNav> LocateItem(IEngineRepository <TNav> navRepository, RestItemData itemData)
        {
            foreach (string fieldName in itemData.Keys)
            {
                // TODO implicit & explicit location option e.g. { "*id": 123 }

                IItemLocator <TNav> locator = _subContext.Fields.GetLocator(fieldName);
                if (locator != null)
                {
                    object findValue = itemData[fieldName];

                    TNav locatedItem = locator.TryLocateItem(navRepository, findValue);
                    if (locatedItem != null)
                    {
                        itemData.Remove(fieldName); // remove so we don't write to this value later.
                        return(new LoadedItem <TNav>(locatedItem));
                    }
                }
            }

            return(null);
        }