Example #1
1
		public RepositoryFile(IRepository repository, String path, RepositoryStatus contentsStatus, RepositoryStatus propertiesStatus)
		{
			if (path == null)
				throw new ArgumentNullException("path");
			if (path.Trim().Length == 0)
				throw new ArgumentException("Path must be set to a valid path", "path");
			if (path[path.Length-1] == '/')
				throw new ArgumentException("Path must be set to a file, not a directory", "path");
			if (propertiesStatus == RepositoryStatus.Added ||
				propertiesStatus == RepositoryStatus.Deleted)
			{
				throw new ArgumentException("Properties status cannot be set to Added or Deleted, use Updated", "propertiesStatus");
			}
			
			this.contentsStatus = contentsStatus;
			this.propertiesStatus = propertiesStatus;
			this.repository = repository;
			SetPathRelatedFields(path);

			if (fileName.EndsWith(" "))
				throw new ArgumentException("Filename cannot end with trailing spaces", "path");

			if (fileName.StartsWith(" "))
				throw new ArgumentException("Filename cannot begin with leading spaces", "path");

		}
Example #2
0
        public TaskController(IRepository<Task> tasks)
        {
            if (tasks == null)
                throw new ArgumentNullException("tasks");

            _tasks = tasks;
        }
 public void Initialise()
 {
     _blogRepo = new SimpleRepository<Data.Blog>(new InMemoryRepositoryDataSource<Data.Blog>(new List<Data.Blog> { new Data.Blog { Id = 1, AuthoritiveUrl = "http://blog.test.con" } }));
     _templateRepo =  new SimpleRepository<BlogTemplate>(new InMemoryRepositoryDataSource<BlogTemplate>());
     _mockHttpContext = new Mock<IHttpContextService>();
     _mockHttpContext.Setup(h => h.RequestUrl).Returns(new Uri("http://blog.test.con/blah"));
 }
 public ProjectsService(
     IRepository<SoftwareProject> projectsRepo,
     IRepository<User> usersRepo)
 {
     this.projects = projectsRepo;
     this.users = usersRepo;
 }
Example #5
0
        public BodyPartHandler(IRepository<BodyPartRecord> bodyRepository) {
            Filters.Add(StorageFilter.For(bodyRepository));

            OnIndexing<BodyPart>((context, bodyPart) => context.DocumentIndex
                                                                .Add("body", bodyPart.Record.Text).RemoveTags().Analyze()
                                                                .Add("format", bodyPart.Record.Format).Store());
        }
Example #6
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="cacheManager">Cache manager</param>
 /// <param name="notificationRepository">Notification repository</param>
 /// <param name="eventPublisher">Event published</param>
 public NotificationService(ICacheManager cacheManager,
     IRepository<Notification> notificationRepository,
     ISignals signals) {
     _cacheManager = cacheManager;
     _notificationRepository = notificationRepository;
     _signals = signals;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PredictiveModelService" /> class
 /// </summary>
 /// <param name="trainRepository">trainRepository parameter</param>
 /// <param name="waterdataRepository">waterdataRepository parameter</param>
 /// <param name="predictiveRepository">predictiveRepository parameter</param>
 /// <param name="vesselRepository">vesselRepository parameter</param>
 public PredictiveModelService(IRepository<train> trainRepository, IRepository<water_data> waterdataRepository, IPredictiveModelRepository predictiveRepository, IVesselRepository vesselRepository)
 {
     this.modifiedwaterdataRepository = waterdataRepository;
     this.predictiveRepository = predictiveRepository;
     this.modifiedTrainRepository = trainRepository;
     this.modifiedVesselRepository = vesselRepository;
 }
Example #8
0
 public void Init(string email, IRepository repository)
 {
     if (!string.IsNullOrEmpty(email))
     {
         User = repository.GetUser(email);
     }
 }
 public PackageDataAggregateUpdater(IRepository<PackageDataAggregate> packageDataAggregateRepository,
     IRepository<PublishedPackage> publishedPackageRepository, IRepository<Package> packageRepository)
 {
     _packageDataAggregateRepository = packageDataAggregateRepository;
     _packageRepository = packageRepository;
     _publishedPackageRepository = publishedPackageRepository;
 }
 public ThreadServices(
     IRepository<Thread> threadRepository,
     IRepository<ThreadView> threadViewRepository,
     IRepository<Post> postRepository,
     IRepository<User> userRepository,
     IRepository<ThreadViewStamp> threadViewStampRepository,
     IRepository<Subscription> subscriptionRepository,
     IRepository<Attachment> attachmentRepository,
     PollServices pollServices,
     FileServices fileServices,
     ParseServices parseServices,
     RoleServices roleServices,
     IUnitOfWork unitOfWork)
     : base(unitOfWork)
 {
     _threadRepository = threadRepository;
     _threadViewRepository = threadViewRepository;
     _postRepository = postRepository;
     _userRepository = userRepository;
     _threadViewStampRepository = threadViewStampRepository;
     _subscriptionRepository = subscriptionRepository;
     _attachmentRepository = attachmentRepository;
     _pollServices = pollServices;
     _fileServices = fileServices;
     _parseServices = parseServices;
     _roleServices = roleServices;
 }
        public CompilationsService(IRepositoryFactory repositoryFactory)
        {
            if(repositoryFactory == null)
                throw new ArgumentNullException(nameof(repositoryFactory));

            _compilationRepository = repositoryFactory.CreateCompilationRepository();
        }
Example #12
0
 public Creator(IUnitOfWork unitOfWork, IRepository<Battle> repositoryOfBattle, IRepository<User> repositoryOfUser, IRepository<Team> repositoryOfTeam)
 {
     _unitOfWork = unitOfWork;
     _repositoryOfBattle = repositoryOfBattle;
     _repositoryOfUser = repositoryOfUser;
     _repositoryOfTeam = repositoryOfTeam;
 }
Example #13
0
 public DefaultPageService(IRepository repository, IRedirectService redirectService, IUrlService urlService)
 {
     this.repository = repository;
     this.redirectService = redirectService;
     this.urlService = urlService;
     temporaryPageCache = new Dictionary<string, IPage>();
 }
 public void Before_Each_Test()
 {
     console = MockRepository.GenerateMock<IConsoleFacade>();
     repository = MockRepository.GenerateMock<IRepository<GameObject>>();
     format = new Formatter(console, repository);
     cmd = new DescribeCommand(console, repository, format);
 }
 public PostsController(IRepository<Post> postsRepository, IRepository<User> usersRepository, IRepository<Tag> tagsRepository, IRepository<Comment> commentsRepository)
 {
     this.postsRepository = postsRepository;
     this.usersRepository = usersRepository;
     this.tagsRepository = tagsRepository;
     this.commentsRepository = commentsRepository;
 }
 public SecureLdapAuthenticationProvider(IConfigSectionProvider configSectionProvider, ILocalEducationAgencyContextProvider localEducationAgencyContextProvider, IRepository<LocalEducationAgency> localEducationAgencyRepository, IRepository<LocalEducationAgencyAuthentication> localEducationAgencyAuthenticationRepository)
 {
     this.configSectionProvider = configSectionProvider;
     this.localEducationAgencyContextProvider = localEducationAgencyContextProvider;
     _localEducationAgencyRepository = localEducationAgencyRepository;
     _localEducationAgencyAuthenticationRepository = localEducationAgencyAuthenticationRepository;
 }
 //private readonly ILifetimeScope container;
 public GenericCharacteristicService()
 {
     //this.container = AutofacHostFactory.Container;
     this.genericCharacteristicRepository =
         EngineContext.Current.Resolve<IRepository<GenericCharacteristic>>();
     this.cacheManager = EngineContext.Current.Resolve<ICacheManager>();
 }
Example #18
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="vendorRepository">Vendor repository</param>
 /// <param name="eventPublisher">Event published</param>
 public VendorService(IRepository<Vendor> vendorRepository,
     IEventPublisher eventPublisher, IRepository<Customer> customerRepository)
 {
     this._vendorRepository = vendorRepository;
     this._eventPublisher = eventPublisher;
     this._customerRepository = customerRepository;
 }
Example #19
0
        public PostPartHandler(IRepository<PostPartRecord> repository, 
            IPostService postService, 
            IThreadService threadService, 
            IForumService forumService,
            IClock clock) {
            _postService = postService;
            _threadService = threadService;
            _forumService = forumService;
            _clock = clock;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<PostPart>(SetModelProperties);
            OnGetEditorShape<PostPart>(SetModelProperties);
            OnUpdateEditorShape<PostPart>(SetModelProperties);

            OnCreated<PostPart>((context, part) => UpdateCounters(part));
            OnPublished<PostPart>((context, part) => { 
                UpdateCounters(part);
                UpdateThreadVersioningDates(part);
            });
            OnUnpublished<PostPart>((context, part) => UpdateCounters(part));
            OnVersioned<PostPart>((context, part, newVersionPart) => UpdateCounters(newVersionPart));
            OnRemoved<PostPart>((context, part) => UpdateCounters(part));

            OnRemoved<ThreadPart>((context, b) =>
                _postService.Delete(context.ContentItem.As<ThreadPart>()));

            OnIndexing<PostPart>((context, postPart) => context.DocumentIndex
                                                    .Add("body", postPart.Record.Text).RemoveTags().Analyze()
                                                    .Add("format", postPart.Record.Format).Store());
        }
Example #20
0
        public void SetUp()
        {
            _mockRepository = new MockRepository();
            _tagRepository = _mockRepository.DynamicMock<IRepository<Tag>>();

            _tagService = new TagService(_tagRepository);
        }
Example #21
0
        protected override bool ExecuteWithData(string cmd, IRepository repo, Player player)
        {
            string[] cmdArray = cmd.Split(new[] { ' ' }, 2);

            string name = "";
            if (cmdArray.GetUpperBound(0) >= 1)
                name = cmdArray[1].Trim();

            GameObject target;

            switch (name.ToLower())
            {
                case "here":
                case "":
                    target = player.Location;
                    break;
                default:
                    target = queries.FindNearPlayer(repo, player, name);
                    break;
            }

            if (target == null)
            {
                console.WriteLine(STR_NoSuchObject, name);
                return false;
            }

            formatters.OfType<LookFormatter>().First().Format(target);
            formatters.OfType<InventoryFormatter>().First().Format(target);
            return false;
        }
Example #22
0
 public void Init(IEnumerable<Type> dataMigrations) {
    
     var builder = new ContainerBuilder();
     _folders = new StubFolders();
     var contentDefinitionManager = new Mock<IContentDefinitionManager>().Object;
     
     builder.RegisterInstance(new ShellSettings { DataTablePrefix = "TEST_"});
     
     builder.RegisterType<SqlServerDataServicesProvider>().As<IDataServicesProvider>();
     builder.RegisterType<DataServicesProviderFactory>().As<IDataServicesProviderFactory>();
     builder.RegisterType<NullInterpreter>().As<IDataMigrationInterpreter>();
     builder.RegisterInstance(_folders).As<IExtensionFolders>();
     builder.RegisterInstance(contentDefinitionManager).As<IContentDefinitionManager>();
     builder.RegisterType<ExtensionManager>().As<IExtensionManager>();
     builder.RegisterType<DataMigrationManager>().As<IDataMigrationManager>();
     builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
     builder.RegisterType<StubCacheManager>().As<ICacheManager>();
     builder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();
     builder.RegisterType<StubAsyncTokenProvider>().As<IAsyncTokenProvider>();
     _session = _sessionFactory.OpenSession();
     builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>().As<ITransactionManager>();
     foreach(var type in dataMigrations) {
         builder.RegisterType(type).As<IDataMigration>();
     }
     _container = builder.Build();
     _container.Resolve<IExtensionManager>();
     _dataMigrationManager = _container.Resolve<IDataMigrationManager>();
     _repository = _container.Resolve<IRepository<DataMigrationRecord>>();
     _transactionManager = _container.Resolve<ITransactionManager>();
     InitDb();
 }
Example #23
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="sciRepository">Shopping cart repository</param>
 /// <param name="workContext">Work context</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="productService">Product settings</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="checkoutAttributeService">Checkout attribute service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="eventPublisher">Event publisher</param>
 /// <param name="permissionService">Permission service</param>
 /// <param name="aclService">ACL service</param>
 public ShoppingCartService(IRepository<ShoppingCartItem> sciRepository,
     IWorkContext workContext, ICurrencyService currencyService,
     IProductService productService, ILocalizationService localizationService,
     IProductAttributeParser productAttributeParser,
     ICheckoutAttributeService checkoutAttributeService,
     ICheckoutAttributeParser checkoutAttributeParser,
     IPriceFormatter priceFormatter,
     ICustomerService customerService,
     ShoppingCartSettings shoppingCartSettings,
     IEventPublisher eventPublisher,
     IPermissionService permissionService, 
     IAclService aclService)
 {
     this._sciRepository = sciRepository;
     this._workContext = workContext;
     this._currencyService = currencyService;
     this._productService = productService;
     this._localizationService = localizationService;
     this._productAttributeParser = productAttributeParser;
     this._checkoutAttributeService = checkoutAttributeService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._priceFormatter = priceFormatter;
     this._customerService = customerService;
     this._shoppingCartSettings = shoppingCartSettings;
     this._eventPublisher = eventPublisher;
     this._permissionService = permissionService;
     this._aclService = aclService;
 }
        public TermsPartHandler(
            IContentDefinitionManager contentDefinitionManager,
            IRepository<TermsPartRecord> repository,
            ITaxonomyService taxonomyService,
            IContentManager contentManager,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager) {
            _contentDefinitionManager = contentDefinitionManager;
            _contentManager = contentManager;

            Filters.Add(StorageFilter.For(repository));
            OnPublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
            OnUnpublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
            OnRemoved<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));

            // Tells how to load the field terms on demand, when a content item it loaded or when it has been created
            OnInitialized<TermsPart>((context, part) => InitializerTermsLoader(part));
            OnLoading<TermsPart>((context, part) => InitializerTermsLoader(part));
            OnUpdating<TermsPart>((context, part) => InitializerTermsLoader(part));

            OnIndexing<TermsPart>(
                (context, part) => {

                    foreach (var term in part.Terms) {
                        var termContentItem = context.ContentManager.Get(term.TermRecord.Id);
                        context.DocumentIndex.Add(term.Field, termContentItem.As<TitlePart>().Title).Analyze();
                        context.DocumentIndex.Add(term.Field + "-id", termContentItem.Id).Store();
                        // tag the current content item with all parent terms
                        foreach (var parent in taxonomyService.GetParents(termContentItem.As<TermPart>())) {
                            context.DocumentIndex.Add(term.Field + "-id", parent.Id).Store();
                        }
                    }
                });
        }
 public VendorAddressService(
     IRepository<VendorAddress> vendorAddressRepo,
     IEventPublisher eventPublisher)
 {
     _vendorAddressRepo = vendorAddressRepo;
     _eventPublisher = eventPublisher;
 }
Example #26
0
        public CampaignController(
            ICampaignService campaignService,
            ITShirtCostService tshirtService,
            IProductService productService,
            IPromotionService promotionService,
            IRepository<CurrencyRecord> currencyRepository,
            IWorkContextAccessor wca,
            INotifier notifier,
            IOrchardServices services,
            ICookieCultureService cookieCultureService,
            ICountryService countryService)
        {
            _currencyRepository = currencyRepository;
            Services = services;
            _tshirtService = tshirtService;
            _productService = productService;
            _campaignService = campaignService;
            _promotionService = promotionService;
            _wca = wca;
            _notifier = notifier;
            Logger = NullLogger.Instance;

            _cookieCultureService = cookieCultureService;
            //var culture = _wca.GetContext().CurrentCulture.Trim();
            _cultureUsed = _wca.GetContext().CurrentCulture.Trim();
            //cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
            _countryService = countryService;
        }
Example #27
0
        public FaqHandler(IRepository<FaqPartRecord> repository)
        {
            Filters.Add(StorageFilter.For(repository));
            OnRemoved<FaqPart>((context, part) => repository.Delete(part.Record));

            OnIndexing<FaqPart>((context, contactPart) => context.DocumentIndex.Add("faq_question", contactPart.Question).Analyze().Store());
        }
        public ApplyMaximumsTask(IRepository<AUMaxBidJobControlRecord> maxbidjobcontrolRepo,
                                        IRepository<AUMaxBidRecord> maxbidRepo,
                                        IRepository<AULotLastBidChangeRecord> lotlastbidchangeRepo,

                                        ILogger logger, 
                                        IConsignorService consignorService, 
                                        ICustomerService customerService, 
                                        IQueuedEmailService queuedEmailService,
                                        IEmailAccountService emailAccountService,
                                        EmailAccountSettings emailAccountSettings,
                                        IAUCatalogService AUcatalogService,
                                        ILotService lotService)
        {
            //this._customerService = customerService;
            this._logger = logger;
            this._maxbidjobcontrolRepo = maxbidjobcontrolRepo;
            this._maxbidRepo = maxbidRepo;
            this._lotlastbidchangeRepo = lotlastbidchangeRepo;
            this._consignorService = consignorService;
            this._customerService = customerService;
            this._queuedEmailService = queuedEmailService;
            this._emailAccountService = emailAccountService;
            this._emailAccountSettings = emailAccountSettings;
            this._AUcatalogService = AUcatalogService;
            this._lotService = lotService;
        }
Example #29
0
        public ListsModule(IRepository db)
            : base("/pages/{pageid:guid}/lists")
        {
            this.RequiresAuthentication();

            Post("/", args => {
                return db.CreateList(this.Bind<List>().SetDefaults<List>());
            });

            Get("/{id:guid}", args => {
                return db.ReadList(args.id);
            });

            Put("/{id:guid}", args => {
                return db.UpdateList(this.Bind<List>().SetDefaults<List>());
            });

            Delete("/{id:guid}", args => {
                return db.DeleteList(args.id);
            });

            Put("/updateorder", args => {
                var ordering = this.Bind<Ordering>();
                db.UpdateListDisplayOrder(ordering);
                return true;
            });
        }
 public ApplicationService(IRepository<Application> applicationRepository,
     IEventPublisher eventPublisher, ICacheManager cacheManager)
 {
     _applicationRepository = applicationRepository;
     _eventPublisher = eventPublisher;
     _cacheManager = cacheManager;
 }