Пример #1
0
        /// <summary>
        /// Uses the OCR for the page to look up any names that weren't previously identified by SciLINC
        /// </summary>
        /// <param name="itemID"></param>
        /// <param name="sequenceOrder"></param>
        private void PopulatePageNames(int pageID)
        {
            BHLProvider provider = new BHLProvider();
            Page        page     = provider.PageSelectAuto(pageID);
            bool        doLookup = false;

            // Look up the page names if we never have for this page, or if it's been longer
            // than the maximum page name age since we've looked them up
            if (page.LastPageNameLookupDate == null)
            {
                doLookup = true;
            }
            else
            {
                TimeSpan ts = DateTime.Now.Subtract((DateTime)page.LastPageNameLookupDate);
                if (ts.Days > Convert.ToInt32(ConfigurationManager.AppSettings["MaximumPageNameAge"]))
                {
                    doLookup = true;
                }
            }

            if (doLookup)
            {
                FindItItem[] items = new PageSummaryService().GetUBioNames(pageID);
                provider.PageNameUpdateList(pageID, items);
                provider.PageUpdateLastPageNameLookupDate(page.PageID);
            }
        }
Пример #2
0
        private string FetchPageUrl(HttpContext context, int pageID)
        {
            PageSummaryService pss = new PageSummaryService();

            string[] sa = pss.FetchPageUrl(pageID);

            JavaScriptSerializer js = new JavaScriptSerializer();

            return(js.Serialize(sa));
        }
        /// <summary>
        /// Uses the OCR for the page to look up any names that weren't previously identified by SciLINC
        /// </summary>
        /// <param name="itemID"></param>
        /// <param name="sequenceOrder"></param>
        private void PopulatePageNames(int pageID)
        {
            BHLProvider provider = new BHLProvider();
            Page page = provider.PageSelectAuto(pageID);
            bool doLookup = false;

            // Look up the page names if we never have for this page, or if it's been longer
            // than the maximum page name age since we've looked them up
            if (page.LastPageNameLookupDate == null)
            {
                doLookup = true;
            }
            else
            {
                TimeSpan ts = DateTime.Now.Subtract((DateTime)page.LastPageNameLookupDate);
                if (ts.Days > Convert.ToInt32(ConfigurationManager.AppSettings["MaximumPageNameAge"]))
                    doLookup = true;
            }

            if (doLookup)
            {
                FindItItem[] items = new PageSummaryService().GetUBioNames(pageID);
                provider.PageNameUpdateList(pageID, items);
                provider.PageUpdateLastPageNameLookupDate(page.PageID);
            }
        }
        private string FetchPageUrl(HttpContext context, int pageID)
        {
            PageSummaryService pss = new PageSummaryService();
            string[] sa = pss.FetchPageUrl(pageID);

            JavaScriptSerializer js = new JavaScriptSerializer();
            return js.Serialize(sa);
        }