コード例 #1
0
        public override IEnumerable <DynamicNode> GetDynamicNodeCollection(ISiteMapNode node)
        {
            IHeartService categoryService = DependencyResolver.Current.GetService <IHeartService>();
            var           nodes           = new List <DynamicNode>();

            try
            {
                var categories = categoryService.GetHearts(typeof(Category).FullName);
                foreach (var category in categories)
                {
                    DynamicNode dynamicNode = new DynamicNode();
                    // ключ должен быть уникальным для каждой ноды
                    dynamicNode.Key = "category_" + category.HeartId;
                    dynamicNode.RouteValues.Add("relativeUrl", category.RelativeUrl);
                    dynamicNode.Route    = typeof(Category).FullName;
                    dynamicNode.Title    = category.Title;
                    dynamicNode.Protocol = "*";

                    dynamicNode.Attributes.Add("visibility", "MvcSiteMapProvider.Web.Mvc.XmlSiteMapResult");

                    nodes.Add(dynamicNode);
                }
            }
            catch (Exception e)
            {
                // если возникают косяки, не добавляем ничего в сайтмеп
            }

            return(nodes);
        }
コード例 #2
0
 public ShopCategoryService(ISettingsService settingsService, IShopActionService shopActionService, IHeartService heartService)
 {
     InitCache("ShopCategoryService");
     _settingsService   = settingsService;
     _shopActionService = shopActionService;
     _heartService      = heartService;
 }
コード例 #3
0
        public ShopController(ISessionValueProviderService sessionService, IShopService shopService,
                              ISearchService searchService, IShopClientService clientService, IShopActionService shopActionService,
                              IShopCategoryService shopCategoryService, IShopManufacturerService shopManufacturerService,
                              IPrincipalResolver principalResolver, IHeartService heartService, IShopOrderService shopOrderService, IShopPickupPointService pickupPointService)
        {
            _sessionService          = sessionService;
            _shopService             = shopService;
            _searchService           = searchService;
            _clientService           = clientService;
            _shopActionService       = shopActionService;
            _shopCategoryService     = shopCategoryService;
            _shopManufacturerService = shopManufacturerService;
            _principalResolver       = principalResolver;
            _heartService            = heartService;
            _shopOrderService        = shopOrderService;
            _pickupPointService      = pickupPointService;


            var service = DependencyResolver.Current.GetService <IShopSettingsService>();

            try
            {
                var settings = service.GetShopSettings();
                _shopUrl = String.IsNullOrEmpty(settings.ShopUrl) ? "catalog" : settings.ShopUrl;
            }
            catch
            {
                _shopUrl = "catalog";
            }
        }
コード例 #4
0
ファイル: ExportShopService.cs プロジェクト: synweb/rocms
 public ExportShopService(ISettingsService settingsService, ILogService logService, IShopService shopService, IShopCategoryService shopCategoryService, IHeartService heartService)
 {
     _settingsService     = settingsService;
     _logService          = logService;
     _shopService         = shopService;
     _shopCategoryService = shopCategoryService;
     _heartService        = heartService;
 }
コード例 #5
0
ファイル: PageService.cs プロジェクト: synweb/rocms
 public PageService(ISearchService searchService, ILogService logService, IHeartService heartService)
 {
     _searchService = searchService;
     _logService    = logService;
     _heartService  = heartService;
     InitCache("PageServiceMemoryCache");
     CacheExpirationInMinutes = 30;
     //Reindex();
 }
コード例 #6
0
ファイル: RssCrawlingService.cs プロジェクト: synweb/rocms
 public RssCrawlingService(INewsItemService newsItemService, IAlbumService albumService, ISettingsService settingsService, IImageService imageService, ILogService logService, IHeartService heartService)
 {
     _newsItemService = newsItemService;
     _albumService    = albumService;
     _settingsService = settingsService;
     _imageService    = imageService;
     _logService      = logService;
     _heartService    = heartService;
 }
コード例 #7
0
        public NewsItemService(ISearchService searchService, INewsCategoryService categoryService, IBlogService blogService, IHeartService heartService)
        {
            _searchService   = searchService;
            _categoryService = categoryService;
            _blogService     = blogService;
            _heartService    = heartService;

            InitCache("TagMemoryCache");
            CacheExpirationInMinutes = 30;
        }
コード例 #8
0
 public ShopService(ILogService logService, IShopActionService shopActionService, IShopCategoryService shopCategoryService, IShopSpecService shopSpecService, IShopCompatiblesService shopCompatiblesService, IShopPackService shopPackService, IShopManufacturerService shopManufacturerService, IHeartService heartService, IShopGoodsReviewService goodsReviewService, ISearchService searchService)
 {
     _logService              = logService;
     _shopActionService       = shopActionService;
     _shopCategoryService     = shopCategoryService;
     _shopSpecService         = shopSpecService;
     _shopCompatiblesService  = shopCompatiblesService;
     _shopPackService         = shopPackService;
     _shopManufacturerService = shopManufacturerService;
     _heartService            = heartService;
     _goodsReviewService      = goodsReviewService;
     _searchService           = searchService;
     InitCache("ShopService");
     // Reindex();
     // GenerateRelativeUrls();
 }
コード例 #9
0
ファイル: CommentService.cs プロジェクト: synweb/rocms
        public CommentService(IMapperService mapper, ISettingsService settingsService, ISecurityService securityService,
                              ILogService logService, IHeartService heartService) : base(mapper)
        {
            _settingsService = settingsService;
            _securityService = securityService;
            _logService      = logService;
            _heartService    = heartService;

            // TODO: перенесено сюда для того, чтобы транзакции EF и EL не пересекались.
            // Убрать, когда переведём _settingsService на EL
            try
            {
                _premoderation = _settingsService.GetSettings <bool>(CommentsSettingStrings.CommentsPremoderation);
            }
            catch (Exception e)
            {
                _logService.LogError(e);
                _premoderation = true;
            }
        }
コード例 #10
0
 public ShopGoodsReviewService(IHeartService heartService)
 {
     _heartService = heartService;
 }
コード例 #11
0
ファイル: PageApiController.cs プロジェクト: synweb/rocms
 public PageApiController(IPageService pageService, ILogService logService, IHeartService heartService)
 {
     _pageService  = pageService;
     _logService   = logService;
     _heartService = heartService;
 }
コード例 #12
0
ファイル: ShopActionService.cs プロジェクト: synweb/rocms
 public ShopActionService(IShopManufacturerService shopManufacturerService, IHeartService heartService)
 {
     _shopManufacturerService = shopManufacturerService;
     _heartService            = heartService;
 }
コード例 #13
0
 public ShopManufacturerService(IHeartService heartService)
 {
     _heartService = heartService;
 }
コード例 #14
0
 public SearchService(IHeartService heartService)
 {
     _heartService = heartService;
     _rules        = new Dictionary <Type, ICollection <IndexingRule> >();
     InitCache();
 }
コード例 #15
0
 public CommentsEditorController(ICommentService commentService, IHeartService heartService)
 {
     _commentService = commentService;
     _heartService   = heartService;
 }
コード例 #16
0
 public HeartApiController(IHeartService heartService)
 {
     _heartService = heartService;
 }