Пример #1
0
 public RelatedPagesNotQuery(
     IContentQueryHelper queryHelper,
     IContentRepository contentRepository,
     SearchProvidersManager searchProvidersManager,
     LanguageSelectorFactory languageSelectorFactory)
     : base(ServiceLocator.Current.GetInstance<IContentRepository>(),queryHelper)
 {
     _contentRepository = contentRepository;
     _searchProvidersManager = searchProvidersManager;
     _languageSelectorFactory = languageSelectorFactory;
 }
Пример #2
0
 public InstagramQuery(
     IContentQueryHelper queryHelper,
     IContentRepository contentRepository,
     SearchProvidersManager searchProvidersManager,
     LanguageSelectorFactory languageSelectorFactory)
     : base(contentRepository, queryHelper)
 {
     _contentRepository = contentRepository;
     _searchProvidersManager = searchProvidersManager;
     _languageSelectorFactory = languageSelectorFactory;
 }
Пример #3
0
 private static string PageUrl(this UrlHelper urlHelper, PageReference pageLink, object routeValues, IContentLoader contentQueryable, IPermanentLinkMapper permanentLinkMapper, LanguageSelectorFactory languageSelectorFactory)
 {
     RouteValueDictionary routeValueDictionary = new RouteValueDictionary(routeValues);
     if (!routeValueDictionary.ContainsKey(RoutingConstants.LanguageKey))
         routeValueDictionary[RoutingConstants.LanguageKey] = (object)ContentLanguage.PreferredCulture.Name;
     if (!routeValueDictionary.ContainsKey(RoutingConstants.ActionKey))
         routeValueDictionary[RoutingConstants.ActionKey] = (object)"index";
     routeValueDictionary[RoutingConstants.NodeKey] = (object)pageLink;
     UrlExtensions.SetAdditionalContextValuesForContent(urlHelper, pageLink, routeValueDictionary, contentQueryable, permanentLinkMapper, languageSelectorFactory);
     return urlHelper.Action(null, routeValueDictionary);
 }
Пример #4
0
 private static void SetAdditionalContextValuesForContent(this UrlHelper urlHelper, PageReference pageLink, RouteValueDictionary values, IContentLoader contentQueryable, IPermanentLinkMapper permanentLinkMapper, LanguageSelectorFactory languageSelectorFactory)
 {
     bool IdKeep = HttpContext.Current.Request.QueryString["idkeep"] != null;
     contentQueryable = contentQueryable ?? ServiceLocator.Current.GetInstance<IContentLoader>();
     permanentLinkMapper = permanentLinkMapper ?? ServiceLocator.Current.GetInstance<IPermanentLinkMapper>();
     languageSelectorFactory = languageSelectorFactory ?? ServiceLocator.Current.GetInstance<LanguageSelectorFactory>();
     IContent content = contentQueryable.Get<IContent>(pageLink, languageSelectorFactory.Fallback(values[RoutingConstants.LanguageKey] as string ?? ContentLanguage.PreferredCulture.Name, true));
     if (content == null)
         return;
     if (IdKeep)
         values["id"] = (object)content.ContentLink.ToString();
     UrlExtensions.SetAdditionalContextValuesForPage(values, IdKeep, content);
 }