コード例 #1
0
 public ProductApiService(IMongoDBContext mongoDBContext, IProductService productService, ICategoryService categoryService, IManufacturerService manufacturerService,
                          IPictureService pictureService, ISpecificationAttributeService specificationAttributeService, IUrlRecordService urlRecordService,
                          IBackInStockSubscriptionService backInStockSubscriptionService, ICustomerActivityService customerActivityService, ILocalizationService localizationService,
                          ILanguageService languageService, SeoSettings seoSettings)
 {
     _mongoDBContext                 = mongoDBContext;
     _productService                 = productService;
     _categoryService                = categoryService;
     _manufacturerService            = manufacturerService;
     _pictureService                 = pictureService;
     _specificationAttributeService  = specificationAttributeService;
     _urlRecordService               = urlRecordService;
     _backInStockSubscriptionService = backInStockSubscriptionService;
     _customerActivityService        = customerActivityService;
     _localizationService            = localizationService;
     _languageService                = languageService;
     _product     = _mongoDBContext.Database().GetCollection <ProductDto>(typeof(Core.Domain.Catalog.Product).Name);
     _seoSettings = seoSettings;
 }
コード例 #2
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="seoSettings">SEO settings</param>
        /// <param name="hostingEnvironment">Hosting environment</param>
        /// <param name="cacheManager">Cache manager</param>
        public PageHeadBuilder(SeoSettings seoSettings,
                               IHostingEnvironment hostingEnvironment,
                               IStaticCacheManager cacheManager)
        {
            this._seoSettings        = seoSettings;
            this._hostingEnvironment = hostingEnvironment;
            this._cacheManager       = cacheManager;
            this._processor          = new BundleFileProcessor();

            this._titleParts           = new List <string>();
            this._metaDescriptionParts = new List <string>();
            this._metaKeywordParts     = new List <string>();
            this._scriptParts          = new Dictionary <ResourceLocation, List <ScriptReferenceMeta> >();
            this._inlineScriptParts    = new Dictionary <ResourceLocation, List <string> >();
            this._cssParts             = new Dictionary <ResourceLocation, List <CssReferenceMeta> >();
            this._canonicalUrlParts    = new List <string>();
            this._headCustomParts      = new List <string>();
            this._pageCssClassParts    = new List <string>();
        }
コード例 #3
0
 public VendorViewModelService(IDiscountService discountService, IVendorService vendorService, ICustomerService customerService, ITranslationService translationService,
                               IDateTimeService dateTimeService, ICountryService countryService, IStoreService storeService, ISlugService slugService,
                               IPictureService pictureService, IMediator mediator, VendorSettings vendorSettings, ILanguageService languageService,
                               SeoSettings seoSettings)
 {
     _discountService    = discountService;
     _vendorService      = vendorService;
     _customerService    = customerService;
     _translationService = translationService;
     _dateTimeService    = dateTimeService;
     _countryService     = countryService;
     _storeService       = storeService;
     _slugService        = slugService;
     _pictureService     = pictureService;
     _mediator           = mediator;
     _languageService    = languageService;
     _vendorSettings     = vendorSettings;
     _seoSettings        = seoSettings;
 }
コード例 #4
0
        private string ValidateSeName <TEntity>(TEntity entity, string name)
            where TEntity : BaseEntity, ISlugSupported
        {
            var seoSettings = new SeoSettings {
                LoadAllUrlAliasesOnStartup = false
            };

            if (_urlRecordService == null)
            {
                _urlRecordService = new UrlRecordService(
                    NullCache.Instance,
                    new EfRepository <UrlRecord>(_ctx)
                {
                    AutoCommitEnabled = false
                },
                    seoSettings);
            }

            return(entity.ValidateSeName <TEntity>("", name, true, _urlRecordService, seoSettings));
        }
コード例 #5
0
 public BlogViewModelService(IBlogService blogService, IDateTimeHelper dateTimeHelper, IStoreService storeService, IUrlRecordService urlRecordService,
                             IPictureService pictureService, ICustomerService customerService, ILocalizationService localizationService, IProductService productService,
                             ICategoryService categoryService, IManufacturerService manufacturerService, IVendorService vendorService,
                             ILanguageService languageService, IWorkContext workContext, SeoSettings seoSettings)
 {
     _blogService         = blogService;
     _dateTimeHelper      = dateTimeHelper;
     _storeService        = storeService;
     _urlRecordService    = urlRecordService;
     _pictureService      = pictureService;
     _customerService     = customerService;
     _localizationService = localizationService;
     _productService      = productService;
     _categoryService     = categoryService;
     _manufacturerService = manufacturerService;
     _vendorService       = vendorService;
     _languageService     = languageService;
     _workContext         = workContext;
     _seoSettings         = seoSettings;
 }
コード例 #6
0
 public VendorViewModelService(IDiscountService discountService, IVendorService vendorService, ICustomerService customerService, ILocalizationService localizationService,
                               IDateTimeHelper dateTimeHelper, ICountryService countryService, IStateProvinceService stateProvinceService, IStoreService storeService, IUrlRecordService urlRecordService,
                               IPictureService pictureService, IMediator mediator, VendorSettings vendorSettings, ILanguageService languageService,
                               SeoSettings seoSettings)
 {
     _discountService      = discountService;
     _vendorService        = vendorService;
     _customerService      = customerService;
     _localizationService  = localizationService;
     _dateTimeHelper       = dateTimeHelper;
     _countryService       = countryService;
     _stateProvinceService = stateProvinceService;
     _storeService         = storeService;
     _urlRecordService     = urlRecordService;
     _pictureService       = pictureService;
     _mediator             = mediator;
     _languageService      = languageService;
     _vendorSettings       = vendorSettings;
     _seoSettings          = seoSettings;
 }
コード例 #7
0
 public CourseViewModelService(ICourseService courseService, ICourseLevelService courseLevelService, ICourseLessonService courseLessonService,
                               ICourseSubjectService courseSubjectService,
                               ISlugService slugService, IPictureService pictureService, ILanguageService languageService,
                               ITranslationService translationService, ICustomerActivityService customerActivityService, IProductCourseService productCourseService,
                               IServiceProvider serviceProvider,
                               SeoSettings seoSettings)
 {
     _courseService           = courseService;
     _courseLevelService      = courseLevelService;
     _courseLessonService     = courseLessonService;
     _courseSubjectService    = courseSubjectService;
     _slugService             = slugService;
     _pictureService          = pictureService;
     _languageService         = languageService;
     _translationService      = translationService;
     _customerActivityService = customerActivityService;
     _productCourseService    = productCourseService;
     _serviceProvider         = serviceProvider;
     _seoSettings             = seoSettings;
 }
コード例 #8
0
 public PageAssetsBuilder(
     SeoSettings seoSettings,
     ThemeSettings themeSettings,
     HttpContextBase httpContext,
     IStoreContext storeContext,
     IBundleBuilder bundleBuilder)
 {
     this._httpContext          = httpContext; // codehint: sm-add
     this._seoSettings          = seoSettings;
     this._themeSettings        = themeSettings;
     this._titleParts           = new List <string>();
     this._metaDescriptionParts = new List <string>();
     this._metaKeywordParts     = new List <string>();
     this._scriptParts          = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._cssParts             = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._canonicalUrlParts    = new List <string>();
     this._bodyCssClasses       = new List <string>(); // codehint: sm-add (MC)
     this._storeContext         = storeContext;        // codehint: sm-add
     this._bundleBuilder        = bundleBuilder;
 }
コード例 #9
0
 public ProductAttributeController(IProductService productService,
                                   IProductAttributeService productAttributeService,
                                   ILanguageService languageService,
                                   ITranslationService translationService,
                                   ICustomerActivityService customerActivityService,
                                   IStoreService storeService,
                                   IWorkContext workContext,
                                   IGroupService groupService,
                                   SeoSettings seoSettings)
 {
     _productService          = productService;
     _productAttributeService = productAttributeService;
     _languageService         = languageService;
     _translationService      = translationService;
     _customerActivityService = customerActivityService;
     _storeService            = storeService;
     _workContext             = workContext;
     _groupService            = groupService;
     _seoSettings             = seoSettings;
 }
コード例 #10
0
 public CourseViewModelService(ICourseService courseService, ICourseLevelService courseLevelService, ICourseLessonService courseLessonService,
                               ICourseSubjectService courseSubjectService,
                               IUrlRecordService urlRecordService, IPictureService pictureService, ILanguageService languageService,
                               ILocalizationService localizationService, ICustomerActivityService customerActivityService, IProductCourseService productCourseService,
                               IServiceProvider serviceProvider,
                               SeoSettings seoSettings)
 {
     _courseService           = courseService;
     _courseLevelService      = courseLevelService;
     _courseLessonService     = courseLessonService;
     _courseSubjectService    = courseSubjectService;
     _urlRecordService        = urlRecordService;
     _pictureService          = pictureService;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _customerActivityService = customerActivityService;
     _productCourseService    = productCourseService;
     _serviceProvider         = serviceProvider;
     _seoSettings             = seoSettings;
 }
コード例 #11
0
        public BlogController(IBlogService blogService,
                              IWorkContext workContext,
                              IStoreContext storeContext,
                              IPictureService pictureService,
                              ILocalizationService localizationService,
                              ICustomerContentService customerContentService,
                              IDateTimeHelper dateTimeHelper,
                              IWorkflowMessageService workflowMessageService,
                              IWebHelper webHelper,
                              ICacheManager cacheManager,
                              ICustomerActivityService customerActivityService,
                              IStoreMappingService storeMappingService,
                              ILanguageService languageService,
                              MediaSettings mediaSettings,
                              BlogSettings blogSettings,
                              LocalizationSettings localizationSettings,
                              CustomerSettings customerSettings,
                              CaptchaSettings captchaSettings,
                              SeoSettings seoSettings)
        {
            this._blogService            = blogService;
            this._workContext            = workContext;
            this._storeContext           = storeContext;
            this._pictureService         = pictureService;
            this._localizationService    = localizationService;
            this._customerContentService = customerContentService;
            this._dateTimeHelper         = dateTimeHelper;
            this._workflowMessageService = workflowMessageService;
            this._webHelper               = webHelper;
            this._cacheManager            = cacheManager;
            this._customerActivityService = customerActivityService;
            this._storeMappingService     = storeMappingService;
            this._languageService         = languageService;

            this._mediaSettings        = mediaSettings;
            this._blogSettings         = blogSettings;
            this._localizationSettings = localizationSettings;
            this._customerSettings     = customerSettings;
            this._captchaSettings      = captchaSettings;
            this._seoSettings          = seoSettings;
        }
コード例 #12
0
        public BlogController(IBlogService blogService,
                              IWorkContext workContext,
                              IStoreContext storeContext,
                              IPictureService pictureService,
                              ILocalizationService localizationService,
                              ICustomerContentService customerContentService,
                              IDateTimeHelper dateTimeHelper,
                              IWebHelper webHelper,
                              ICacheManager cacheManager,
                              ICustomerActivityService customerActivityService,
                              IStoreMappingService storeMappingService,
                              ILanguageService languageService,
                              IGenericAttributeService genericAttributeService,
                              MediaSettings mediaSettings,
                              BlogSettings blogSettings,
                              LocalizationSettings localizationSettings,
                              CustomerSettings customerSettings,
                              CaptchaSettings captchaSettings,
                              SeoSettings seoSettings)
        {
            _blogService            = blogService;
            _workContext            = workContext;
            _storeContext           = storeContext;
            _pictureService         = pictureService;
            _localizationService    = localizationService;
            _customerContentService = customerContentService;
            _dateTimeHelper         = dateTimeHelper;
            _webHelper               = webHelper;
            _cacheManager            = cacheManager;
            _customerActivityService = customerActivityService;
            _storeMappingService     = storeMappingService;
            _languageService         = languageService;
            _genericAttributeService = genericAttributeService;

            _mediaSettings        = mediaSettings;
            _blogSettings         = blogSettings;
            _localizationSettings = localizationSettings;
            _customerSettings     = customerSettings;
            _captchaSettings      = captchaSettings;
            _seoSettings          = seoSettings;
        }
コード例 #13
0
        public void TestInitialize()
        {
            Mongodb.IgnoreExtraElements();
            Mapper.Run();
            var mongo = Mongodb.MongoDbClient();

            _mongoDBContext = new MongoDBContext(mongo.client, mongo.database);

            InitCategoryRepo();

            var categoryService = new Mock <ICategoryService>();

            _categoryService = categoryService.Object;


            var urlRecordService = new Mock <IUrlRecordService>();

            _urlRecordService = urlRecordService.Object;

            var pictureService = new Mock <IPictureService>();

            _pictureService = pictureService.Object;

            var localizationService = new Mock <ILocalizationService>();

            _localizationService = localizationService.Object;

            var customerActivityService = new Mock <ICustomerActivityService>();

            _customerActivityService = customerActivityService.Object;

            var languageService = new Mock <ILanguageService>();

            _languageService = languageService.Object;

            var seoSettings = new Mock <SeoSettings>();

            _seoSettings = seoSettings.Object;

            _categoryApiService = new CategoryApiService(_mongoDBContext, _categoryService, _urlRecordService, _languageService, _pictureService, _customerActivityService, _localizationService, _seoSettings);
        }
コード例 #14
0
 public BlogController(
     IBlogService blogService,
     IBlogViewModelService blogViewModelService,
     ILanguageService languageService,
     ITranslationService translationService,
     IStoreService storeService,
     IWorkContext workContext,
     IGroupService groupService,
     IDateTimeService dateTimeService,
     SeoSettings seoSettings)
 {
     _blogService          = blogService;
     _blogViewModelService = blogViewModelService;
     _languageService      = languageService;
     _translationService   = translationService;
     _storeService         = storeService;
     _workContext          = workContext;
     _groupService         = groupService;
     _dateTimeService      = dateTimeService;
     _seoSettings          = seoSettings;
 }
コード例 #15
0
 public UpdateProductCommandHandler(
     IProductService productService,
     ISlugService slugService,
     ICustomerActivityService customerActivityService,
     ITranslationService translationService,
     ILanguageService languageService,
     IOutOfStockSubscriptionService outOfStockSubscriptionService,
     IStockQuantityService stockQuantityService,
     IMediator mediator,
     SeoSettings seoSettings)
 {
     _productService                = productService;
     _slugService                   = slugService;
     _customerActivityService       = customerActivityService;
     _translationService            = translationService;
     _languageService               = languageService;
     _outOfStockSubscriptionService = outOfStockSubscriptionService;
     _stockQuantityService          = stockQuantityService;
     _mediator    = mediator;
     _seoSettings = seoSettings;
 }
コード例 #16
0
        public void Seed(SmartObjectContext context)
        {
            context.MigrateLocaleResources(MigrateLocaleResources);

            var permissionMigrator  = new PermissionMigrator(context);
            var activityLogMigrator = new ActivityLogTypeMigrator(context);

            permissionMigrator.AddPermission(new PermissionRecord
            {
                Name       = "Admin area. Manage Imports",
                SystemName = "ManageImports",
                Category   = "Configuration"
            }, new string[] { SystemCustomerRoleNames.Administrators });

            activityLogMigrator.AddActivityLogType("DeleteOrder", "Delete order", "Auftrag gel�scht");

            context.MigrateSettings(x =>
            {
                var seoSettings = new SeoSettings();
                x.Add("seosettings.seonamecharconversion", seoSettings.SeoNameCharConversion);
            });
        }
コード例 #17
0
ファイル: PageAssetsBuilder.cs プロジェクト: yuyu2you/Caf.CMS
 public PageAssetsBuilder(
     SeoSettings seoSettings,
     ThemeSettings themeSettings,
     HttpContextBase httpContext,
     ISiteContext storeContext,
     IBundleBuilder bundleBuilder)
 {
     this._httpContext          = httpContext;
     this._seoSettings          = seoSettings;
     this._themeSettings        = themeSettings;
     this._titleParts           = new List <string>();
     this._metaDescriptionParts = new List <string>();
     this._metaKeywordParts     = new List <string>();
     this._scriptParts          = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._cssParts             = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._canonicalUrlParts    = new List <string>();
     this._customHeadParts      = new List <string>();
     this._bodyCssClasses       = new List <string>();
     this._linkParts            = new List <RouteValueDictionary>();
     this._storeContext         = storeContext;
     this._bundleBuilder        = bundleBuilder;
 }
コード例 #18
0
 public YandexMarketProductController(IYandexMarketProductService yandexMarketProductService,
                                      IProductService productService,
                                      IUrlRecordService urlRecordService,
                                      ICategoryService categoryService,
                                      IPictureService pictureService,
                                      ISpecificationAttributeService2 specificationAttributeService,
                                      IYandexMarketCategoryService yandexMarketCategoryService,
                                      ILogger logger,
                                      SeoSettings seoSettings,
                                      IPriceManagerService priceManagerService)
 {
     _yandexMarketProductService    = yandexMarketProductService;
     _productService                = productService;
     _urlRecordService              = urlRecordService;
     _categoryService               = categoryService;
     _pictureService                = pictureService;
     _specificationAttributeService = specificationAttributeService;
     _yandexMarketCategoryService   = yandexMarketCategoryService;
     _logger              = logger;
     _seoSettings         = seoSettings;
     _priceManagerService = priceManagerService;
 }
コード例 #19
0
        /// <summary>
        /// Constuctor
        /// </summary>
        /// <param name="seoSettings">SEO settings</param>
        /// <param name="hostingEnvironment">Hosting environment</param>
        public PageHeadBuilder(SeoSettings seoSettings, IWebHostEnvironment hostingEnvironment, IActionContextAccessor actionContextAccessor)
        {
            _seoSettings           = seoSettings;
            _hostingEnvironment    = hostingEnvironment;
            _actionContextAccessor = actionContextAccessor;

            _processor = new BundleFileProcessor();

            _titleParts           = new List <string>();
            _metaDescriptionParts = new List <string>();
            _metaKeywordParts     = new List <string>();
            _scriptParts          = new Dictionary <ResourceLocation, List <ScriptReferenceMeta> >();
            _cssParts             = new Dictionary <ResourceLocation, List <CssReferenceMeta> >();
            _canonicalUrlParts    = new List <string>();
            _headCustomParts      = new List <string>();
            _pageCssClassParts    = new List <string>();

            if (!string.IsNullOrEmpty(seoSettings.CustomHeadTags))
            {
                AppendHeadCustomParts(seoSettings.CustomHeadTags);
            }
        }
コード例 #20
0
        //[LoadSetting(IsRootedModel = true)]
        public ActionResult GeneralCommon(int storeScope,
                                          StoreInformationSettings storeInformationSettings,
                                          SeoSettings seoSettings,
                                          DateTimeSettings dateTimeSettings,
                                          SecuritySettings securitySettings,
                                          CaptchaSettings captchaSettings,
                                          PdfSettings pdfSettings,
                                          LocalizationSettings localizationSettings,
                                          CompanyInformationSettings companySettings,
                                          ContactDataSettings contactDataSettings,
                                          BankConnectionSettings bankConnectionSettings,
                                          SocialSettings socialSettings,
                                          HomePageSettings homePageSettings)
        {
            // TODO: (mh) (core)
            // Set page timeout to 5 minutes.
            //Server.ScriptTimeout = 300;

            var model = new GeneralCommonSettingsModel();

            return(View(model));
        }
コード例 #21
0
 public CategoryViewModelService(ICategoryService categoryService, ICategoryTemplateService categoryTemplateService, IDiscountService discountService,
                                 ILocalizationService localizationService, IStoreService storeService, ICustomerService customerService, IPictureService pictureService,
                                 IUrlRecordService urlRecordService, ICustomerActivityService customerActivityService, IProductService productService, IManufacturerService manufacturerService,
                                 IVendorService vendorService, IDateTimeHelper dateTimeHelper, ILanguageService languageService, CatalogSettings catalogSettings, SeoSettings seoSettings)
 {
     _categoryService         = categoryService;
     _categoryTemplateService = categoryTemplateService;
     _discountService         = discountService;
     _localizationService     = localizationService;
     _storeService            = storeService;
     _customerService         = customerService;
     _urlRecordService        = urlRecordService;
     _customerActivityService = customerActivityService;
     _productService          = productService;
     _pictureService          = pictureService;
     _manufacturerService     = manufacturerService;
     _vendorService           = vendorService;
     _languageService         = languageService;
     _catalogSettings         = catalogSettings;
     _dateTimeHelper          = dateTimeHelper;
     _seoSettings             = seoSettings;
 }
コード例 #22
0
        public ProductImporter(
            IRepository <ProductPicture> productPictureRepository,
            IRepository <ProductManufacturer> productManufacturerRepository,
            IRepository <ProductCategory> productCategoryRepository,
            IRepository <UrlRecord> urlRecordRepository,
            IRepository <Product> productRepository,
            ICommonServices services,
            ILocalizedEntityService localizedEntityService,
            IPictureService pictureService,
            IManufacturerService manufacturerService,
            ICategoryService categoryService,
            IProductService productService,
            IUrlRecordService urlRecordService,
            IProductTemplateService productTemplateService,
            IStoreMappingService storeMappingService,
            FileDownloadManager fileDownloadManager,
            SeoSettings seoSettings,
            DataExchangeSettings dataExchangeSettings)
        {
            _productPictureRepository      = productPictureRepository;
            _productManufacturerRepository = productManufacturerRepository;
            _productCategoryRepository     = productCategoryRepository;
            _urlRecordRepository           = urlRecordRepository;
            _productRepository             = productRepository;
            _services = services;
            _localizedEntityService = localizedEntityService;
            _pictureService         = pictureService;
            _manufacturerService    = manufacturerService;
            _categoryService        = categoryService;
            _productService         = productService;
            _urlRecordService       = urlRecordService;
            _productTemplateService = productTemplateService;
            _storeMappingService    = storeMappingService;
            _fileDownloadManager    = fileDownloadManager;

            _seoSettings          = seoSettings;
            _dataExchangeSettings = dataExchangeSettings;
        }
コード例 #23
0
        public BlogController(
            ICommonServices services,
            IBlogService blogService,
            IMediaService mediaService,
            ICustomerContentService customerContentService,
            IDateTimeHelper dateTimeHelper,
            IWebHelper webHelper,
            ICacheManager cacheManager,
            ICustomerActivityService customerActivityService,
            IStoreMappingService storeMappingService,
            IGenericAttributeService genericAttributeService,
            IPageAssetsBuilder pageAssetsBuilder,
            MediaSettings mediaSettings,
            BlogSettings blogSettings,
            LocalizationSettings localizationSettings,
            CustomerSettings customerSettings,
            CaptchaSettings captchaSettings,
            SeoSettings seoSettings)
        {
            _services                = services;
            _blogService             = blogService;
            _mediaService            = mediaService;
            _customerContentService  = customerContentService;
            _dateTimeHelper          = dateTimeHelper;
            _webHelper               = webHelper;
            _cacheManager            = cacheManager;
            _customerActivityService = customerActivityService;
            _storeMappingService     = storeMappingService;
            _genericAttributeService = genericAttributeService;
            _pageAssetsBuilder       = pageAssetsBuilder;

            _mediaSettings        = mediaSettings;
            _blogSettings         = blogSettings;
            _localizationSettings = localizationSettings;
            _customerSettings     = customerSettings;
            _captchaSettings      = captchaSettings;
            _seoSettings          = seoSettings;
        }
コード例 #24
0
 public CategoryViewModelService(ICategoryService categoryService, IProductCategoryService productCategoryService, ICategoryLayoutService categoryLayoutService, IDiscountService discountService,
                                 ITranslationService translationService, IStoreService storeService, ICustomerService customerService, IGroupService groupService, IPictureService pictureService,
                                 ISlugService slugService, ICustomerActivityService customerActivityService, IProductService productService,
                                 IVendorService vendorService, IDateTimeService dateTimeService, ILanguageService languageService, CatalogSettings catalogSettings, SeoSettings seoSettings)
 {
     _categoryService         = categoryService;
     _productCategoryService  = productCategoryService;
     _categoryLayoutService   = categoryLayoutService;
     _discountService         = discountService;
     _translationService      = translationService;
     _storeService            = storeService;
     _customerService         = customerService;
     _groupService            = groupService;
     _slugService             = slugService;
     _customerActivityService = customerActivityService;
     _productService          = productService;
     _pictureService          = pictureService;
     _vendorService           = vendorService;
     _languageService         = languageService;
     _catalogSettings         = catalogSettings;
     _dateTimeService         = dateTimeService;
     _seoSettings             = seoSettings;
 }
コード例 #25
0
        public ConfigModel()
        {
            /// all the objects in the class have been initialized with an empty object to avoid
            /// throwing Object reference error even in all circumstances.
            /// these objects SHOULD be initialized with some default values - possibly from web.config for worst case scenarios.

            ConfigSettings    = new List <ConfigSettingModel>();
            BasketSettings    = new BasketSettings();
            B2BSettings       = new B2BSettings();
            CatalogSettings   = new CatalogSettings();
            DomainSettings    = new DomainSettings();
            OrderSettings     = new OrderSettings();
            SearchSettings    = new SearchSettings();
            SeoSettings       = new SeoSettings();
            ShippingSettings  = new ShippingSettings();
            SocialSettings    = new SocialSettings();
            Currencies        = new List <CurrencyModel>();
            ShippingCountries = new List <CountryModel>();
            BillingCountries  = new List <CountryModel>();
            Languages         = new List <LanguageModel>();
            RegionalSettings  = new RegionalSettings();
            ReviewSettings    = new List <ProductReviewSection>();
            GeoLocators       = new List <GeoLocatorModel>();
        }
コード例 #26
0
ファイル: SeoExtensions.cs プロジェクト: Nagabhushana/nag
        public static string ValidateSeName <T>(this T entity,
                                                string seName,
                                                string name,
                                                bool ensureNotEmpty,
                                                IUrlRecordService urlRecordService,
                                                SeoSettings seoSettings,
                                                int?languageId = null,
                                                Func <string, UrlRecord> extraSlugLookup = null)
            where T : BaseEntity, ISlugSupported
        {
            Guard.NotNull(urlRecordService, nameof(urlRecordService));
            Guard.NotNull(seoSettings, nameof(seoSettings));
            Guard.NotNull(entity, nameof(entity));

            // use name if sename is not specified
            if (String.IsNullOrWhiteSpace(seName) && !String.IsNullOrWhiteSpace(name))
            {
                seName = name;
            }

            // validation
            seName = GetSeName(seName, seoSettings);

            // max length
            seName = seName.Truncate(400);

            if (String.IsNullOrWhiteSpace(seName))
            {
                if (ensureNotEmpty)
                {
                    // use entity identifier as sename if empty
                    seName = entity.Id.ToString();
                }
                else
                {
                    // return. no need for further processing
                    return(seName);
                }
            }

            // validate and alter SeName if it could be interpreted as SEO code
            if (LocalizationHelper.IsValidCultureCode(seName))
            {
                if (seName.Length == 2)
                {
                    seName = seName + "-0";
                }
            }

            // ensure this sename is not reserved yet
            string entityName = entity.GetEntityName();
            int    i          = 2;
            var    tempSeName = seName;

            while (true)
            {
                // check whether such slug already exists (and that it's not the current entity)
                var urlRecord = urlRecordService.GetBySlug(tempSeName) ?? extraSlugLookup?.Invoke(tempSeName);
                var reserved1 = urlRecord != null && !(urlRecord.EntityId == entity.Id && urlRecord.EntityName.Equals(entityName, StringComparison.InvariantCultureIgnoreCase));

                if (!reserved1 && urlRecord != null && languageId.HasValue)
                {
                    reserved1 = (urlRecord.LanguageId != languageId.Value);
                }

                // and it's not in the list of reserved slugs
                var reserved2 = seoSettings.ReservedUrlRecordSlugs.Contains(tempSeName, StringComparer.InvariantCultureIgnoreCase);
                if (!reserved1 && !reserved2)
                {
                    break;
                }

                tempSeName = string.Format("{0}-{1}", seName, i);
                i++;
            }
            seName = tempSeName;

            return(seName);
        }
コード例 #27
0
        public MVPController(ICategoryService categoryService,
                             IManufacturerService manufacturerService,
                             IProductService productService,
                             IVendorService vendorService,
                             IProductTemplateService productTemplateService,
                             IProductAttributeService productAttributeService,
                             IWorkContext workContext,
                             IStoreContext storeContext,
                             ITaxService taxService,
                             ICurrencyService currencyService,
                             IPictureService pictureService,
                             ILocalizationService localizationService,
                             IMeasureService measureService,
                             IPriceCalculationService priceCalculationService,
                             IPriceFormatter priceFormatter,
                             IWebHelper webHelper,
                             ISpecificationAttributeService specificationAttributeService,
                             IDateTimeHelper dateTimeHelper,
                             IRecentlyViewedProductsService recentlyViewedProductsService,
                             ICompareProductsService compareProductsService,
                             IWorkflowMessageService workflowMessageService,
                             IProductTagService productTagService,
                             IOrderReportService orderReportService,
                             IAclService aclService,
                             IStoreMappingService storeMappingService,
                             IPermissionService permissionService,
                             IDownloadService downloadService,
                             ICustomerActivityService customerActivityService,
                             IProductAttributeParser productAttributeParser,
                             IShippingService shippingService,
                             IEventPublisher eventPublisher,
                             MediaSettings mediaSettings,
                             CatalogSettings catalogSettings,
                             VendorSettings vendorSettings,
                             ShoppingCartSettings shoppingCartSettings,
                             LocalizationSettings localizationSettings,
                             CustomerSettings customerSettings,
                             CaptchaSettings captchaSettings,
                             SeoSettings seoSettings,
                             ICacheManager cacheManager,
                             IStoreService storeService,
                             ISettingService settingService,
                             IProductReportService productReportService,
                             IMVPService mvpService

                             )
        {
            this._categoryService         = categoryService;
            this._manufacturerService     = manufacturerService;
            this._productService          = productService;
            this._vendorService           = vendorService;
            this._productTemplateService  = productTemplateService;
            this._productAttributeService = productAttributeService;
            this._workContext             = workContext;
            this._storeContext            = storeContext;
            this._taxService              = taxService;
            this._currencyService         = currencyService;
            this._pictureService          = pictureService;
            this._localizationService     = localizationService;
            this._measureService          = measureService;
            this._priceCalculationService = priceCalculationService;
            this._priceFormatter          = priceFormatter;
            this._webHelper = webHelper;
            this._specificationAttributeService = specificationAttributeService;
            this._dateTimeHelper = dateTimeHelper;
            this._recentlyViewedProductsService = recentlyViewedProductsService;
            this._compareProductsService        = compareProductsService;
            this._workflowMessageService        = workflowMessageService;
            this._productTagService             = productTagService;
            this._orderReportService            = orderReportService;
            this._aclService              = aclService;
            this._storeMappingService     = storeMappingService;
            this._permissionService       = permissionService;
            this._downloadService         = downloadService;
            this._customerActivityService = customerActivityService;
            this._productAttributeParser  = productAttributeParser;
            this._shippingService         = shippingService;
            this._eventPublisher          = eventPublisher;
            this._mediaSettings           = mediaSettings;
            this._catalogSettings         = catalogSettings;
            this._vendorSettings          = vendorSettings;
            this._shoppingCartSettings    = shoppingCartSettings;
            this._localizationSettings    = localizationSettings;
            this._customerSettings        = customerSettings;
            this._captchaSettings         = captchaSettings;
            this._seoSettings             = seoSettings;
            this._cacheManager            = cacheManager;
            this._storeService            = storeService;
            this._settingService          = settingService;
            this._productReportService    = productReportService;
            this._mvpService              = mvpService;
        }
コード例 #28
0
 public TopicViewModelService(ITopicTemplateService topicTemplateService, ITopicService topicService, IUrlRecordService urlRecordService, ILocalizationService localizationService,
                              ICustomerActivityService customerActivityService, IStoreService storeService, ILanguageService languageService, IDateTimeHelper dateTimeHelper, SeoSettings seoSettings)
 {
     _topicTemplateService    = topicTemplateService;
     _topicService            = topicService;
     _urlRecordService        = urlRecordService;
     _localizationService     = localizationService;
     _customerActivityService = customerActivityService;
     _storeService            = storeService;
     _languageService         = languageService;
     _dateTimeHelper          = dateTimeHelper;
     _seoSettings             = seoSettings;
 }
コード例 #29
0
 public ProductTagsController(IProductTagService productTagService, IProductService productService, ILanguageService languageService, SeoSettings seoSettings)
 {
     this._productTagService = productTagService;
     this._productService    = productService;
     this._languageService   = languageService;
     this._seoSettings       = seoSettings;
 }
コード例 #30
0
        public static async Task <List <LocalizedProperty> > ToLocalizedProperty <T, E>(this IList <T> list, E entity, Expression <Func <T, string> > keySelector,
                                                                                        SeoSettings _seoSettings, IUrlRecordService _urlRecordService, ILanguageService _languageService) where T : ILocalizedModelLocal where E : BaseEntity, ISlugSupported
        {
            var local = new List <LocalizedProperty>();

            foreach (var item in list)
            {
                Type[]         interfaces = item.GetType().GetInterfaces();
                PropertyInfo[] props      = item.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
                foreach (var prop in props)
                {
                    bool insert = true;

                    foreach (var i in interfaces)
                    {
                        if (i.HasProperty(prop.Name) && typeof(ILocalizedModelLocal).IsAssignableFrom(i))
                        {
                            insert = false;
                        }
                        if (i.HasProperty(prop.Name) && typeof(ISlugModelLocal).IsAssignableFrom(i))
                        {
                            var member = keySelector.Body as MemberExpression;
                            if (member == null)
                            {
                                throw new ArgumentException(string.Format(
                                                                "Expression '{0}' refers to a method, not a property.",
                                                                keySelector));
                            }
                            var propInfo = member.Member as PropertyInfo;
                            if (propInfo == null)
                            {
                                throw new ArgumentException(string.Format(
                                                                "Expression '{0}' refers to a field, not a property.",
                                                                keySelector));
                            }
                            var value = item.GetType().GetProperty(propInfo.Name).GetValue(item, null);
                            if (value != null)
                            {
                                var name      = value.ToString();
                                var itemvalue = prop.GetValue(item) ?? "";
                                var seName    = await entity.ValidateSeName(itemvalue.ToString(), name, false, _seoSettings, _urlRecordService, _languageService);

                                prop.SetValue(item, seName);
                                await _urlRecordService.SaveSlug(entity, seName, item.LanguageId);
                            }
                            else
                            {
                                var itemvalue = prop.GetValue(item) ?? "";
                                if (itemvalue != null && !string.IsNullOrEmpty(itemvalue.ToString()))
                                {
                                    var seName = await entity.ValidateSeName(itemvalue.ToString(), "", false, _seoSettings, _urlRecordService, _languageService);

                                    prop.SetValue(item, seName);
                                    await _urlRecordService.SaveSlug(entity, seName, item.LanguageId);
                                }
                                else
                                {
                                    insert = false;
                                }
                            }
                        }
                    }

                    if (insert && prop.GetValue(item) != null)
                    {
                        local.Add(new LocalizedProperty()
                        {
                            LanguageId  = item.LanguageId,
                            LocaleKey   = prop.Name,
                            LocaleValue = prop.GetValue(item).ToString(),
                        });
                    }
                }
            }
            return(local);
        }
コード例 #31
0
        public SettingController(ISettingService settingService,
            ICountryService countryService, IStateProvinceService stateProvinceService,
            IAddressService addressService, ITaxCategoryService taxCategoryService,
            ICurrencyService currencyService, IPictureService pictureService,
            ILocalizationService localizationService, IDateTimeHelper dateTimeHelper,
            IOrderService orderService, IEncryptionService encryptionService,
            IThemeProvider themeProvider, ICustomerService customerService,
            ICustomerActivityService customerActivityService, IPermissionService permissionService,
            IWebHelper webHelper, IFulltextService fulltextService,
            BlogSettings blogSettings,
            ForumSettings forumSettings, NewsSettings newsSettings,
            ShippingSettings shippingSettings, TaxSettings taxSettings,
            CatalogSettings catalogSettings, RewardPointsSettings rewardPointsSettings,
            CurrencySettings currencySettings, OrderSettings orderSettings,
            ShoppingCartSettings shoppingCartSettings, MediaSettings mediaSettings,
            CustomerSettings customerSettings, AddressSettings addressSettings,
            DateTimeSettings dateTimeSettings, StoreInformationSettings storeInformationSettings,
            SeoSettings seoSettings,SecuritySettings securitySettings, PdfSettings pdfSettings,
            LocalizationSettings localizationSettings, AdminAreaSettings adminAreaSettings,
            CaptchaSettings captchaSettings, ExternalAuthenticationSettings externalAuthenticationSettings,
            CommonSettings commonSettings)
        {
            this._settingService = settingService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._addressService = addressService;
            this._taxCategoryService = taxCategoryService;
            this._currencyService = currencyService;
            this._pictureService = pictureService;
            this._localizationService = localizationService;
            this._dateTimeHelper = dateTimeHelper;
            this._orderService = orderService;
            this._encryptionService = encryptionService;
            this._themeProvider = themeProvider;
            this._customerService = customerService;
            this._customerActivityService = customerActivityService;
            this._permissionService = permissionService;
            this._webHelper = webHelper;
            this._fulltextService = fulltextService;

            this._blogSettings = blogSettings;
            this._forumSettings = forumSettings;
            this._newsSettings = newsSettings;
            this._shippingSettings = shippingSettings;
            this._taxSettings = taxSettings;
            this._catalogSettings = catalogSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._currencySettings = currencySettings;
            this._orderSettings = orderSettings;
            this._shoppingCartSettings = shoppingCartSettings;
            this._mediaSettings = mediaSettings;
            this._customerSettings = customerSettings;
            this._addressSettings = addressSettings;
            this._dateTimeSettings = dateTimeSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._seoSettings = seoSettings;
            this._securitySettings = securitySettings;
            this._pdfSettings = pdfSettings;
            this._localizationSettings = localizationSettings;
            this._adminAreaSettings = adminAreaSettings;
            this._captchaSettings = captchaSettings;
            this._externalAuthenticationSettings = externalAuthenticationSettings;
            this._commonSettings = commonSettings;
        }
コード例 #32
0
        //I think this is the method that uses dependancy injection to create the repos - as opposed to manual
        //see:http://alexwolfthoughts.com/creating-a-generic-repository-with-entity-framework-and-mvc
        public AUPublicController(IRepository<AUConsignorRecord> consignorRepo,
                                        IRepository<AUConsignmentRecord> consignmentRepo,
                                        IRepository<AUConsignorConsignmentRecord> consignorconsignmentRepo,
                                        IRepository<AUConsignorList> consignorlistRepo,
                                        IRepository<AUSaleRecord> saleRepo,
                                        IRepository<AUSessionRecord> sessionRepo,
                                        IRepository<AUIncrementRecord> incrementRepo,
                                        IRepository<AUAddressRecord> addressRepo,
                                        IRepository<AUCombAddress> combAddressRepo,
                                        IRepository<AULotList> lotlistRepo,
                                        IRepository<AUFeesRecord> feesRepo,
                                        IRepository<AUBidHistoryRecord> bidhistoryRepo,

                                        ICacheManager cacheManager,
                                        IPictureService pictureService,
                                        IConsignmentService consignmentservice,
                                        ILotService lotService,
                                        IForumService forumservice,

                                        IConsignorService consignorservice,
                                        IDateTimeHelper dateTimeHelper,
                                        IAuthenticationService authenticationService,
                                        ILocalizationService localizationService,
                                        ICountryService countryService,
                                        IStateProvinceService stateProvinceService, 
                                        IWorkContext workContext,                                        
                                        ICollectibleImportService collectibleimportService, 
                                        //IRepository<AUCombConsignorConsignment> combinedRepo,
                                        ICategoryService categoryService,
                                        IStoreService storeService,
                                        IShippingService shippingService,
                                        IPermissionService permissionService,
                                        IEventPublisher eventPublisher,
                                        ISettingService settings,
                                        IProductService productService,
                                        IDbContext dbContext,
                                        IPhilatelicPdfService philatelicpdfService,
                                        ICollectibleExportService collectibleexportService,
                                        IAUSaleService ausaleService,
                                        IAclService aclService,
                                        IStoreMappingService storeMappingService,
                                        CatalogSettings catalogSettings,
                                        IWebHelper webHelper,
                                        IPriceFormatter priceFormatter,
                                        ICurrencyService currencyService,
                                        IStoreContext storeContext,
                                        MediaSettings mediaSettings,
                                        IPriceCalculationService priceCalculationService,
                                        ISpecificationAttributeService specificationAttributeService,
                                        ITaxService taxService,
                                        ICategoryTemplateService categoryTemplateService,
                                        ICustomerActivityService customerActivityService,
                                        ShoppingCartSettings shoppingCartSettings,
                                        IAUCatalogService AUcatalogService,     
                                        IForumService forumService,             
                                        ICustomerService customerService,      
                                        ForumSettings forumSettings,          
                                        ILogger logger,
                                        IRecentlyViewedProductsService recentlyViewedProductsService,
                                        SeoSettings seoSettings,
                                        IVendorService vendorService,
                                        VendorSettings vendorSettings,
                                        IProductTagService productTagService,
                                        IProductTemplateService productTemplateService,
                                        IProductAttributeParser productAttributeParser,
                                        IManufacturerService manufacturerService,
                                        IMeasureService measureService,
                                        IProductAttributeService productAttributeService,
                                        CustomerSettings customerSettings,
                                        IGenericAttributeService genericAttributeService,
                                        ISearchTermService searchTermService,
                                        IShoppingCartService shoppingCartService,
                                        IProductAttributeFormatter productAttributeFormatter)                         
        {
            _cacheManager = cacheManager;
            _pictureService = pictureService;
            _lotService = lotService;
            _forumservice = forumservice;

            _consignorRepo = consignorRepo;
            _consignmentRepo = consignmentRepo;
            _consignorconsignmentRepo = consignorconsignmentRepo;
            _consignorService = consignorservice;
            _consignmentService = consignmentservice;
            _consignorlistRepo = consignorlistRepo;
            _saleRepo = saleRepo;
            _sessionRepo = sessionRepo;
            _incrementRepo = incrementRepo;
            _addressRepo = addressRepo;
            _combAddressRepo = combAddressRepo;
            _lotlistRepo = lotlistRepo;
            _feesRepo = feesRepo;
            _bidhistoryRepo = bidhistoryRepo;
            _dateTimeHelper = dateTimeHelper;
            _authenticationService = authenticationService;
            _localizationService = localizationService;
            _countryService = countryService;
            _stateProvinceService = stateProvinceService;
            _workContext = workContext;
            _collectibleimportService = collectibleimportService;
            _categoryService = categoryService;
            _storeService = storeService;
            _shippingService = shippingService;
            _permissionService = permissionService;
            _eventPublisher = eventPublisher;
            _settings = settings;
            _productService = productService;
            _dbContext = dbContext;
            _philatelicpdfService = philatelicpdfService;
            _collectibleexportService = collectibleexportService;
            _ausaleService = ausaleService;
            _aclService = aclService;
            _storeMappingService = storeMappingService;
            _catalogSettings = catalogSettings;
            _webHelper = webHelper;
            _priceFormatter = priceFormatter;
            _currencyService = currencyService;
            _storeContext = storeContext;
            _mediaSettings = mediaSettings;
            _priceCalculationService = priceCalculationService;
            _specificationAttributeService = specificationAttributeService;
            _taxService = taxService;
            _categoryTemplateService = categoryTemplateService;
            _customerActivityService = customerActivityService;
            _shoppingCartSettings = shoppingCartSettings;
            _AUcatalogService = AUcatalogService;      
            _forumService = forumService;              
            _customerService = customerService;       
            _forumSettings = forumSettings;            
            _logger = logger;
            _recentlyViewedProductsService = recentlyViewedProductsService;          
            _seoSettings = seoSettings;
            _vendorService = vendorService;
            _vendorSettings = vendorSettings;
            _productTemplateService = productTemplateService;
            _productTagService = productTagService;
            _productAttributeParser = productAttributeParser;
            _manufacturerService = manufacturerService;
            _measureService = measureService;
            _productAttributeService = productAttributeService;
            _customerSettings = customerSettings;
            _genericAttributeService = genericAttributeService;
            _searchTermService = searchTermService;
            _shoppingCartService = shoppingCartService;
            _productAttributeFormatter = productAttributeFormatter;
        }