예제 #1
0
        /// <summary>
        /// Get mail content in HTML format.
        /// </summary>
        /// <param name="pageRef">Pagelink to mailpage</param>
        /// <returns>HTML</returns>
        public virtual string GetPageHtml(PageReference pageRef)
        {
            if (_log.IsDebugEnabled())
            {
                _log.Debug("Beginning to generate Page Html for {0}.", pageRef.ToString());
            }

            PageData pageData = GetPage(pageRef);

            return(GetPageHtml(pageData));
        }
예제 #2
0
        protected PageData GetPage(PageReference pageRef)
        {
            IContentRepository contentRepository = ServiceLocator.Current.GetInstance <IContentRepository>();

            ContentReference contentLink = pageRef.ToReferenceWithoutVersion();
            PageData         pageData    = contentRepository.Get <PageData>(contentLink);

            if (pageData == null)
            {
                throw new NullReferenceException("Cannot Load Page: " + pageRef.ToString());
            }

            return(pageData);
        }
예제 #3
0
        protected PageData GetPageWithChecks(PageReference pagelink)
        {
            if (pagelink == PageReference.EmptyReference)
            {
                throw new ArgumentException("PageReference to mailpage is empty, no content to send.", "pagelink");
            }

            // Load page
            PageData mailPage = null;

            if (ContentRepository.Service.TryGet <PageData>(pagelink, out mailPage) == false)
            {
                throw new NullReferenceException("Cannot load newsletter page (" + pagelink.ToString() + ")");
            }

            return(mailPage);
        }
예제 #4
0
        protected PageData GetPageWithChecks(PageReference pagelink)
        {
            if (pagelink == PageReference.EmptyReference)
                throw new ArgumentException("PageReference to mailpage is empty, no content to send.", "pagelink");

            // Load page
            PageData mailPage = null;
            if (ContentRepository.Service.TryGet<PageData>(pagelink, out mailPage) == false)
                throw new NullReferenceException("Cannot load newsletter page (" + pagelink.ToString() + ")");

            return mailPage;
        }
예제 #5
0
        protected PageData GetPage(PageReference pageRef)
        {
            IContentRepository contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();

            ContentReference contentLink = pageRef.ToReferenceWithoutVersion();
            PageData pageData = contentRepository.Get<PageData>(contentLink);
            if (pageData == null)
            {
                throw new NullReferenceException("Cannot Load Page: " + pageRef.ToString());
            }

            return pageData;
        }
예제 #6
0
        /// <summary>
        /// Get mail content in HTML format.
        /// </summary>
        /// <param name="pageRef">Pagelink to mailpage</param>
        /// <returns>HTML</returns>
        public virtual string GetPageHtml(PageReference pageRef)
        {
            if (_log.IsDebugEnabled())
                _log.Debug("Beginning to generate Page Html for {0}.", pageRef.ToString());

            PageData pageData = GetPage(pageRef);
            return GetPageHtml(pageData);
        }