Exemplo n.º 1
0
 public AdViewModel(
     ISiteRootContext siteRootContext,
     ITextTranslator textTranslator)
 {
     SiteRootContext = siteRootContext;
     TextTranslator  = textTranslator;
 }
 public SiteNewsletterTypesContext(
     ISiteRootContext siteRootContext,
     ISiteNewsletterTypesFactory siteNewsletterTypesFactory)
 {
     SiteRootContext            = siteRootContext;
     SiteNewsletterTypesFactory = siteNewsletterTypesFactory;
 }
Exemplo n.º 3
0
 public EmailFriendController(
     ITextTranslator textTranslator,
     ISiteRootContext siteRootContext,
     IEmailFactory emailFactory,
     IEmailSender emailSender,
     IHtmlEmailTemplateFactory htmlEmailTemplateFactory,
     ISiteSettings siteSettings,
     ILog logger,
     IGlobalSitecoreService globalService,
     IArticleSearch articleSearch,
     IArticleService articleService,
     IRecaptchaService recaptchaService)
 {
     EmailSender = emailSender;
     HtmlEmailTemplateFactory = htmlEmailTemplateFactory;
     TextTranslator           = textTranslator;
     SiteRootContext          = siteRootContext;
     EmailFactory             = emailFactory;
     SiteSettings             = siteSettings;
     _logger          = logger;
     GlobalService    = globalService;
     ArticleSearch    = articleSearch;
     ArticleService   = articleService;
     RecaptchaService = recaptchaService;
 }
Exemplo n.º 4
0
 public SiteDebuggingAllowedConfiguration(
     IIpAddressFactory ipAddressFactory,
     ISiteRootContext siteRootContext)
 {
     IpAddressFactory = ipAddressFactory;
     SiteRootContext  = siteRootContext;
 }
Exemplo n.º 5
0
 public SitePublicationNameContext(
     ISiteRootContext siteRootContext,
     ISitePublicationNameFactory sitePublicationNameFactory)
 {
     SiteRootContext            = siteRootContext;
     SitePublicationNameFactory = sitePublicationNameFactory;
 }
Exemplo n.º 6
0
 public SalesforceUserOrder(
     ISalesforceServiceContext service,
     ISiteRootContext siteRoot)
 {
     Service  = service;
     SiteRoot = siteRoot;
 }
Exemplo n.º 7
0
 public SendRecoveryPassword(IEmailSender emailSender,
                             ISiteRootContext siteRootContext,
                             ISitecoreService sitecoreService)
 {
     _emailSender     = emailSender;
     _siteRootContext = siteRootContext;
     _sitecoreService = sitecoreService;
 }
 public WebRegisterUserEmailFactory(
     ISiteRootContext siteRootContext,
     IBaseHtmlEmailFactory emailFactory,
     ISiteSettings siteSettings)
 {
     SiteRootContext = siteRootContext;
     EmailFactory    = emailFactory;
     SiteSettings    = siteSettings;
 }
Exemplo n.º 9
0
 public SiteMainNavigationContext(
     ISiteRootContext siteRootContext,
     IItemNavigationTreeFactory itemNavigationTreeFactory,
     IGlobalSitecoreService globalService)
 {
     SiteRootContext           = siteRootContext;
     ItemNavigationTreeFactory = itemNavigationTreeFactory;
     GlobalService             = globalService;
 }
Exemplo n.º 10
0
        public SiteMaintenanceContext(
            ISiteRootContext siteRootContext,
            ITextTranslator textTranslator,
            ICacheProvider cacheProvider)
        {
            SiteRootContext = siteRootContext;
            TextTranslator  = textTranslator;
            CacheProvider   = cacheProvider;

            Info = GetSiteMaintenanceInfo();
        }
Exemplo n.º 11
0
 public RegisterPopOutViewModel(
     ITextTranslator textTranslator,
     ISiteRootContext siteRootContext,
     IReturnUrlContext returnUrlContext,
     IHttpContextProvider httpContextProvider)
 {
     TextTranslator      = textTranslator;
     SiteRootContext     = siteRootContext;
     ReturnUrlContext    = returnUrlContext;
     HttpContextProvider = httpContextProvider;
 }
Exemplo n.º 12
0
 public GlobalService(
     ISitecoreService sitecoreService,
     ICacheProvider cacheProvider,
     IItemReferences itemReferences,
     ISiteRootContext siteRootContext
     )
 {
     SitecoreService = sitecoreService;
     CacheProvider   = cacheProvider;
     ItemReferences  = itemReferences;
     SiteRootContext = siteRootContext;
 }
Exemplo n.º 13
0
 public AsktheAnalystPopOutViewModel(
     ISiteRootContext siteRootContext,
     ITextTranslator textTranslator,
     IRenderingItemContext articleRenderingContext,
     IAuthenticatedUserContext userContext)
 {
     SiteRootContext         = siteRootContext;
     TextTranslator          = textTranslator;
     ArticleRenderingContext = articleRenderingContext;
     UserContext             = userContext;
     Article = ArticleRenderingContext.Get <IArticle>();
 }
Exemplo n.º 14
0
 public HeaderViewModel(
     IAuthenticatedUserContext authenticatedUserContext,
     IUserCompanyNameContext companyNameContext,
     ITextTranslator textTranslator,
     ISiteRootContext siteRootContext,
     IUserProfileContext profileContext,
     IGlobalSitecoreService globalService)
 {
     AuthenticatedUserContext = authenticatedUserContext;
     CompanyNameContext       = companyNameContext;
     TextTranslator           = textTranslator;
     ProfileContext           = profileContext;
     GlobalService            = globalService;
     SiteRootContext          = siteRootContext;
 }
 public CompanyRegisterMessageViewModel(
     ITextTranslator textTranslator,
     ISiteRootContext siteRootContext,
     IUserCompanyContext userCompanyContext,
     IAllowCompanyRegisterUserContext allowCompanyRegisterUser,
     ISitecoreContext sitecoreContext,
     ICompanyEntitlementsContext companyEnt)
 {
     TextTranslator           = textTranslator;
     SiteRootContext          = siteRootContext;
     UserCompanyContext       = userCompanyContext;
     AllowCompanyRegisterUser = allowCompanyRegisterUser;
     SitecoreContext          = sitecoreContext;
     CompanyEntitlements      = companyEnt;
 }
Exemplo n.º 16
0
 public NewsletterSignUpModel(
     IAuthenticatedUserContext userContext,
     ITextTranslator textTranslator,
     ISiteRootContext siteRootContext,
     IGlobalSitecoreService globalService,
     ISiteNewsletterUserOptedInContext newsletterOptedInContext,
     IReturnUrlContext returnURLContext)
 {
     UserContext              = userContext;
     TextTranslator           = textTranslator;
     SiteRootContext          = siteRootContext;
     GlobalService            = globalService;
     NewsletterOptedInContext = newsletterOptedInContext;
     ReturnURLContext         = returnURLContext;
 }
Exemplo n.º 17
0
 public CallToActionViewModel(
     ITextTranslator textTranslator,
     ISignInViewModel signInViewModel,
     IRegisterPopOutViewModel registerPopOutViewModel,
     ISiteRootContext siteRootContext,
     IAuthenticatedUserContext authenticatedUserContext,
     ISitecoreContext sitecoreContext)
 {
     TextTranslator           = textTranslator;
     SignInViewModel          = signInViewModel;
     RegisterPopOutViewModel  = registerPopOutViewModel;
     SiteRootContext          = siteRootContext;
     AuthenticatedUserContext = authenticatedUserContext;
     CurrentItem = sitecoreContext.GetCurrentItem <IArticle>();
 }
Exemplo n.º 18
0
        public ArticlePrologueBookmarkViewModel(
            ITextTranslator textTranslator,
            IRenderingItemContext articleRenderingContext,
            IAuthenticatedUserContext authenticatedUserContext,
            IIsSavedDocumentContext isSavedDocuementContext,
            ISiteRootContext siteRootContext,
            IArticleService articleService)
        {
            TextTranslator  = textTranslator;
            SiteRootContext = siteRootContext;
            ArticleService  = articleService;

            Article             = articleRenderingContext.Get <IArticle>();
            IsUserAuthenticated = authenticatedUserContext.IsAuthenticated;
            IsArticleBookmarked = IsUserAuthenticated && isSavedDocuementContext.IsSaved(Article._Id);
            BookmarkPublication = ArticleService.GetArticlePublicationName(Article);
            BookmarkTitle       = Article?.Title;
        }
        public RegisterUserOptInsViewModel(
            IUserCompanyContext userCompanyContext,
            ITextTranslator textTranslator,
            IReturnUrlContext returnUrlContext,
            IGlobalSitecoreService globalService,
            ISiteRootContext siteRootContext,
            IPublicationsNewsletterUserOptInContext publicationNewsletterUserOptInContext)
        {
            UserCompanyContext = userCompanyContext;
            TextTranslator     = textTranslator;
            ReturnUrlContext   = returnUrlContext;
            GlobalService      = globalService;
            SiteRootContext    = siteRootContext;
            PublicationNewsletterUserOptInContext = publicationNewsletterUserOptInContext;

            PublicationNewsletterOptIns = PublicationNewsletterUserOptInContext.OptIns.ToList();
            PublicationNewsletterOptIns.Where(w => w.Publication.Code == SiteRootContext.Item.Publication_Code).FirstOrDefault().OptIn = true;
        }
Exemplo n.º 20
0
        public FooterViewModel(
            ISiteRootContext siteRootContext,
            IPageLinksFactory pageLinksFactory,
            IAuthenticatedUserContext authenticatedUserContext,
            IUserSubscribedContext userSubscriptionContext,
            ITextTranslator textTranslator,
            ISitecoreService sitecoreService,
            IFooterNavigationMenuViewModel footerNavViewModel)
        {
            SiteRootContext          = siteRootContext;
            PageLinksFactory         = pageLinksFactory;
            AuthenticatedUserContext = authenticatedUserContext;
            UserSubscriptionContext  = userSubscriptionContext;
            TextTranslator           = textTranslator;
            _footerNavViewModel      = footerNavViewModel;

            List <IPageLink> lstLocalLinks = new List <IPageLink>();

            foreach (var item in siteRootContext.Item.Local_Footer_Links)
            {
                if (item._TemplateId == new System.Guid(Constants.NavigationItemTemplateID))
                {
                    var navItem = Sitecore.Context.Database.GetItem(new ID(item._Id));
                    if (navItem != null)
                    {
                        var nav = sitecoreService.GetItem <Informa.Models.Informa.Models.sitecore.templates.User_Defined.Objects.Navigation.INavigation_Link>(navItem.ID.Guid);
                        if (nav != null && nav.Navigation_Link != null && string.IsNullOrEmpty(nav.Navigation_Link.Url) == false && string.IsNullOrEmpty(nav.Navigation_Text) == false)
                        {
                            lstLocalLinks.Add(new PageLink {
                                Text = nav.Navigation_Text, Url = nav.Navigation_Link.Url
                            });
                        }
                    }
                }
                else
                {
                    lstLocalLinks.Add(new PageLink {
                        Text = item._Name, Url = item._Url
                    });
                }
            }

            LocalLinks = lstLocalLinks;
        }
Exemplo n.º 21
0
 public AnalyticsViewModel(
     IItemReferences itemReferences,
     IIsEntitledProducItemContext isEntitledProductItemContext,
     IArticleSearch articleSearch,
     ISiteSettings siteSettings,
     IAuthenticatedUserContext authenticatedUserContext,
     IUserCompanyContext userCompanyContext,
     IUserProfileContext userProfileContext,
     IUserSubscriptionsContext userSubscriptionsContext,
     IWebAuthenticateUser webAuthenticateUser,
     IUserEntitlementsContext userEntitlementsContext,
     IUserIpAddressContext userIpAddressContext,
     ISiteRootContext siteRootContext,
     IHttpContextProvider httpContextProvider,
     IDCDReader dcdReader,
     ITaxonomyService taxonomyService, IGlobalSitecoreService globalService, IRecaptchaService recaptchaSettings)
 {
     ItemReferences = itemReferences;
     IsEntitledProductItemContext = isEntitledProductItemContext;
     ArticleSearch            = articleSearch;
     SiteSettings             = siteSettings;
     AuthenticatedUserContext = authenticatedUserContext;
     UserCompanyContext       = userCompanyContext;
     UserProfileContext       = userProfileContext;
     UserSubscriptionsContext = userSubscriptionsContext;
     WebAuthenticateUser      = webAuthenticateUser;
     UserEntitlementsContext  = userEntitlementsContext;
     UserIpAddressContext     = userIpAddressContext;
     SiteRootContext          = siteRootContext;
     HttpContextProvider      = httpContextProvider;
     DcdReader              = dcdReader;
     EntitlementType        = GetEntitlementType(UserCompanyContext);
     UserEntitlements       = GetUserEntitlements();
     SubscribedProducts     = GetSubscribedProducts();
     OpportunityLineItemIds = GetOpportunityLineItemIds();
     OpportunityIds         = GetOpportunityIds();
     TaxonomyService        = taxonomyService;
     GlobalService          = globalService;
     RecaptchaSettings      = recaptchaSettings;
 }
Exemplo n.º 22
0
        public IndividualRenewalMessageViewModel(
            ITextTranslator textTranslator,
            IIndividualSubscriptionRenewalMessageContext context,
            IAuthenticatedUserContext userContext,
            ISiteRootContext siteRootContext,
            IUserSubscriptionsContext userSubscriptionsContext,
            IUserProfileContext profileContext)
        {
            Context                  = context;
            SiteRootContext          = siteRootContext;
            UserSubscriptionsContext = userSubscriptionsContext;
            ProfileContext           = profileContext;

            ISubscription record = userContext.IsAuthenticated ? GetLatestExpiringRecord() : null;

            DismissText  = textTranslator.Translate("Subscriptions.Renewals.Dismiss");
            Display      = DisplayMessage(record);
            Message      = Display ? GetMessage(record, profileContext?.Profile?.FirstName ?? string.Empty) : string.Empty;
            Id           = context.ID;
            RenewURL     = context.RenewalLinkURL;
            RenewURLText = context.RenewalLinkText;
        }
Exemplo n.º 23
0
 public IndividualSubscriptionRenewalMessageContext(ITextTranslator textTranslator, ISiteRootContext siteRootContext, IAuthenticatedUserContext userContext)
 {
     _textTranslator  = textTranslator;
     _siteRootContext = siteRootContext;
     _userContext     = userContext;
 }
Exemplo n.º 24
0
 public RelatedDealsService(ISiteRootContext siteRootContext, IDCDReader reader)
 {
     _reader         = reader;
     SiteRootContext = siteRootContext;
 }
Exemplo n.º 25
0
        public LatestNewsViewModel(IGlassBase datasource,
                                   IRenderingContextService renderingParametersService,
                                   IArticleSearch articleSearch,
                                   IItemManuallyCuratedContent itemManuallyCuratedContent,
                                   IArticleListItemModelFactory articleListableFactory,
                                   ISiteRootContext rootContext,
                                   ITextTranslator textTranslator,
                                   IAuthorService authorService,
                                   IDCDReader dcdReader)
        {
            Datasource    = datasource;
            ArticleSearch = articleSearch;
            ItemManuallyCuratedContent = itemManuallyCuratedContent;
            ArticleListableFactory     = articleListableFactory;
            TextTranslator             = textTranslator;
            AuthorService = authorService;
            DcdReader     = dcdReader;

            Stopwatch sw = Stopwatch.StartNew();

            StringExtensions.WriteSitecoreLogs("Reading rendering parameters at:", sw, "Latest News");

            Authors    = new List <string>();
            Parameters = renderingParametersService.GetCurrentRenderingParameters <ILatest_News_Options>();

            StringExtensions.WriteSitecoreLogs("Reading rendering parameters ends at:", sw, "Latest News");

            if (Parameters == null)
            {
                return;
            }

            DisplayTitle   = Parameters.Display_Title;
            ItemsToDisplay = Parameters.Number_To_Display?.Value ?? 6;
            SeeAllLink     = Parameters.Show_See_All ? new Link
            {
                Text = TextTranslator.Translate("Article.LatestFrom.SeeAllLink")
            } : null;

            StringExtensions.WriteSitecoreLogs("Reading publicationNames at:", sw, "Latest News");

            var publicationNames = Parameters.Publications.Any()
                ? Parameters.Publications.Select(p => p.Publication_Name)
                : new[] { rootContext.Item.Publication_Name };

            StringExtensions.WriteSitecoreLogs("Reading publicationNames ends at:", sw, "Latest News");

            StringExtensions.WriteSitecoreLogs("Reading Authers at:", sw, "Latest News");

            Authors = Parameters.Authors?.Select(p => RemoveSpecialCharactersFromGuid(p._Id.ToString())).ToArray();
            CompanyRecordNumbers = string.IsNullOrEmpty(Parameters.CompanyID)
                ? (IList <string>) new List <string>()
                : Parameters.CompanyID.Split(',');

            StringExtensions.WriteSitecoreLogs("Reading Authers ends at:", sw, "Latest News");

            if (IsAuthorPage)
            {
                Author_Page();
                if (!Parameters.Publications.Any()) // authors page shouldn't filter on the current publication
                {
                    publicationNames = Enumerable.Empty <string>();
                }
            }
            else if (datasource._TemplateId.ToString() == ICompany_PageConstants.TemplateIdString)
            {
                Company_Page();
                if (!Parameters.Publications.Any()) // authors page shouldn't filter on the current publication
                {
                    publicationNames = Enumerable.Empty <string>();
                }
            }
            else
            {
                Other_Page();
            }

            News = GetLatestNews(datasource._Id, Parameters.Subjects.Select(s => s._Id), publicationNames, Authors, CompanyRecordNumbers, ItemsToDisplay);
        }