Пример #1
0
        private static WebDataManager_v1 <int, TelechargerMagazine_PostDetail_v1> CreateWebDataManager(XElement xe)
        {
            WebDataManager_v1 <int, TelechargerMagazine_PostDetail_v1> detailWebDataManager = new WebDataManager_v1 <int, TelechargerMagazine_PostDetail_v1>();

            detailWebDataManager.WebLoadDataManager = new WebLoadDataManager <TelechargerMagazine_PostDetail_v1>();

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectoryFunction = httpRequest => (GetPostDetailKey(httpRequest) / 1000 * 1000).ToString();
                detailWebDataManager.WebLoadDataManager.UrlCache = urlCache;
            }

            //detailWebDataManager.WebLoadDataManager.InitLoadFromWeb = EbookdzLogin.InitLoadFromWeb;
            detailWebDataManager.WebLoadDataManager.GetHttpRequestParameters = TelechargerMagazine_v1.GetHttpRequestParameters;
            detailWebDataManager.WebLoadDataManager.GetData = GetData;
            detailWebDataManager.GetKeyFromHttpRequest      = GetPostDetailKey;
            detailWebDataManager.LoadImages = DownloadPrint_v1.LoadImages;

            //documentStore.GetDataKey = headerPage => headerPage.GetKey();
            //documentStore.Deserialize = document => (IEnumDataPages_new<int, IHeaderData_new>)BsonSerializer.Deserialize<Vosbooks_HeaderPage>(document);
            __detailMongoDocumentStore = MongoDocumentStore_v4 <int, TelechargerMagazine_PostDetail_v1> .Create(xe);

            detailWebDataManager.DocumentStore = __detailMongoDocumentStore;

            return(detailWebDataManager);
        }
Пример #2
0
        private static WebDataManager_v1 <string, OnisepInstitution_Detail> CreateWebDataManager(XElement xe)
        {
            WebDataManager_v1 <string, OnisepInstitution_Detail> detailWebDataManager = new WebDataManager_v1 <string, OnisepInstitution_Detail>();

            detailWebDataManager.WebLoadDataManager = new WebLoadDataManager <OnisepInstitution_Detail>();

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                //urlCache.GetUrlSubDirectoryFunction = httpRequest => (GetKey(httpRequest) / 1000 * 1000).ToString();
                urlCache.GetUrlSubDirectory = httpRequest => GetGroup(httpRequest);
                detailWebDataManager.WebLoadDataManager.UrlCache = urlCache;
            }

            //detailWebDataManager.WebLoadDataManager.InitLoadFromWeb = EbookdzLogin.InitLoadFromWeb;
            detailWebDataManager.WebLoadDataManager.GetHttpRequestParameters = OnisepInstitution.GetHttpRequestParameters;
            detailWebDataManager.WebLoadDataManager.GetData = GetData;
            detailWebDataManager.GetKeyFromHttpRequest      = GetKey;
            //detailWebDataManager.LoadImages = DownloadPrint.LoadImages;

            //documentStore.GetDataKey = headerPage => headerPage.GetKey();
            //documentStore.Deserialize = document => (IEnumDataPages_new<int, IHeaderData_new>)BsonSerializer.Deserialize<Handeco_HeaderPage>(document);
            detailWebDataManager.DocumentStore = MongoDocumentStore_v4 <string, OnisepInstitution_Detail> .Create(xe);

            return(detailWebDataManager);
        }
Пример #3
0
        //private static Regex __badCharacters = new Regex("(\xA0|\t|\r|\n)+", RegexOptions.Compiled);
        //private static Regex __lastUpdateRegex = new Regex("[0-9]{2}-[0-9]{2}-[0-9]{4}", RegexOptions.Compiled);  // Dernière mise à jour le 18-01-2013
        //private static Regex __email1Regex = new Regex("email1\\s*=\\s*\"([^\"]+)\"", RegexOptions.Compiled | RegexOptions.IgnoreCase);  // email1 = "jeu-ser"
        //private static Regex __email2Regex = new Regex("email2\\s*=\\s*\"([^\"]+)\"", RegexOptions.Compiled | RegexOptions.IgnoreCase);  // email2 = "wanadoo.fr"

        static OnisepInstitution_DetailManager()
        {
            __detailWebDataManager = CreateWebDataManager(XmlConfig.CurrentConfig.GetElement("OnisepInstitution/Detail"));

            __webHeaderDetailManager = new WebHeaderDetailManager_v1 <int, OnisepInstitution_HeaderPage, OnisepInstitution_Header, string, OnisepInstitution_Detail>();
            __webHeaderDetailManager.HeaderDataPageManager = OnisepInstitution_HeaderManager.HeaderWebDataPageManager;
            __webHeaderDetailManager.DetailDataManager     = __detailWebDataManager;
        }
Пример #4
0
        static ExtremeDown_DetailManager_v2()
        {
            __detailWebDataManager = CreateWebDataManager(XmlConfig.CurrentConfig.GetElement("ExtremeDown/Detail"));

            __webHeaderDetailManager = new WebHeaderDetailManager_v1 <int, ExtremeDown_HeaderPage_v2, ExtremeDown_PostHeader_v2, int, ExtremeDown_PostDetail_v2>();
            __webHeaderDetailManager.HeaderDataPageManager = ExtremeDown_HeaderManager_v2.HeaderWebDataPageManager;
            __webHeaderDetailManager.DetailDataManager     = __detailWebDataManager;
        }
Пример #5
0
        static Cdefi_DetailManager()
        {
            __detailWebDataManager = CreateWebDataManager(XmlConfig.CurrentConfig.GetElement("Cdefi/Detail"));

            __webHeaderDetailManager = new WebHeaderDetailManager_v1 <int, Cdefi_HeaderPage, Cdefi_Header, int, Cdefi_Detail>();
            __webHeaderDetailManager.HeaderDataPageManager = Cdefi_HeaderManager.HeaderWebDataPageManager;
            __webHeaderDetailManager.DetailDataManager     = __detailWebDataManager;
        }
Пример #6
0
        //private static Date? __lastPostDate = null;

        static TelechargerMagazine_DetailManager_v1()
        {
            __detailWebDataManager = CreateWebDataManager(XmlConfig.CurrentConfig.GetElement("TelechargerMagazine/Detail"));

            __webHeaderDetailManager = new WebHeaderDetailManager_v1 <int, TelechargerMagazine_HeaderPage_v1, TelechargerMagazine_PostHeader_v1, int, TelechargerMagazine_PostDetail_v1>();
            __webHeaderDetailManager.HeaderDataPageManager = TelechargerMagazine_HeaderManager_v1.HeaderWebDataPageManager;
            __webHeaderDetailManager.DetailDataManager     = __detailWebDataManager;
        }
Пример #7
0
        static Vosbooks_DetailManager_v1()
        {
            __detailWebDataManager = CreateWebDataManager(XmlConfig.CurrentConfig.GetElement("Vosbooks/Detail"));

            __webHeaderDetailManager = new WebHeaderDetailManager_v1 <int, Vosbooks_HeaderPage_v1, Vosbooks_PostHeader_v1, int, Vosbooks_PostDetail_v1>();
            __webHeaderDetailManager.HeaderDataPageManager = Vosbooks_HeaderManager_v1.HeaderWebDataPageManager;
            __webHeaderDetailManager.DetailDataManager     = __detailWebDataManager;
        }
Пример #8
0
        private static Regex __email2Regex     = new Regex("email2\\s*=\\s*\"([^\"]+)\"", RegexOptions.Compiled | RegexOptions.IgnoreCase); // email2 = "wanadoo.fr"

        static Handeco_DetailManager()
        {
            __detailWebDataManager = CreateWebDataManager(XmlConfig.CurrentConfig.GetElement("Handeco/Detail"));

            __webHeaderDetailManager = new WebHeaderDetailManager_v1 <int, Handeco_HeaderPage, Handeco_Header, int, Handeco_Detail>();
            __webHeaderDetailManager.HeaderDataPageManager = Handeco_HeaderManager.HeaderWebDataPageManager;
            __webHeaderDetailManager.DetailDataManager     = __detailWebDataManager;
        }
Пример #9
0
        static Ebookdz_DetailManager_v1()
        {
            __detailWebDataManager = CreateWebDataManager(XmlConfig.CurrentConfig.GetElement("Ebookdz/Detail"));

            __webHeaderDetailManager = new WebHeaderDetailManager_v1 <int, Ebookdz_HeaderPage_v1, Ebookdz_PostHeader, int, Ebookdz_PostDetail_v1>();
            __webHeaderDetailManager.HeaderDataPageManager = Ebookdz_HeaderManager_v1.HeaderWebDataPageManager;
            __webHeaderDetailManager.DetailDataManager     = __detailWebDataManager;

            __webForumHeaderDetailManager = new WebHeaderDetailManager_v1 <int, Ebookdz_HeaderPage_v1, Ebookdz_PostHeader, int, Ebookdz_PostDetail_v1>();
            __webForumHeaderDetailManager.HeaderDataPageManager = Ebookdz_ForumHeaderManager_v1.CurrentForumHeaderManager;
            __webForumHeaderDetailManager.DetailDataManager     = __detailWebDataManager;
        }
Пример #10
0
        public static void ViewDocuments <TKey, TData>(WebDataManager_v1 <TKey, TData> webDataManager, string query = null, string sort = null, int limit = 10, bool loadImage = false)
        {
            //RunSource.CurrentRunSource.View(webDataManager.FindDocuments(query, sort: sort, limit: limit, loadImage: loadImage).Select(
            //    data =>
            //        {
            //            IPost post = data as IPost;
            //            return new
            //            {
            //                id = post.GetKey(),
            //                loadFromWebDate = post.GetLoadFromWebDate(),
            //                creationDate = post.GetPostCreationDate(),
            //                printType = post.GetPrintType().ToString(),
            //                //category = post.category,
            //                title = post.GetTitle(),
            //                url = post.GetDataHttpRequest().Url,
            //                images = (from image in post.GetImages() select image.Image).ToArray(),
            //                downloadLinks = post.GetDownloadLinks()
            //            };
            //        }
            //    ));

            //webDataManager.FindDocuments(query, sort: sort, limit: limit, loadImage: loadImage).Select(
            //    data =>
            //    {
            //        IPost post = data as IPost;
            //        return new
            //        {
            //            id = post.GetKey(),
            //            loadFromWebDate = post.GetLoadFromWebDate(),
            //            creationDate = post.GetPostCreationDate(),
            //            printType = post.GetPrintType().ToString(),
            //            //category = post.category,
            //            title = post.GetTitle(),
            //            url = post.GetDataHttpRequest().Url,
            //            images = (from image in post.GetImages() select image.Image).ToArray(),
            //            downloadLinks = post.GetDownloadLinks()
            //        };
            //    }
            //    ).zView();

            webDataManager.FindDocuments(query, sort: sort, limit: limit, loadImage: loadImage).Select(data => CompactPost.Create(data as IPost)).zView();
        }
Пример #11
0
        private static WebDataManager_v1 <int, ExtremeDown_PostDetail_v2> CreateWebDataManager(XElement xe)
        {
            WebDataManager_v1 <int, ExtremeDown_PostDetail_v2> detailWebDataManager = new WebDataManager_v1 <int, ExtremeDown_PostDetail_v2>();

            detailWebDataManager.WebLoadDataManager = new WebLoadDataManager <ExtremeDown_PostDetail_v2>();

            //if (xe.zXPathValue("UseUrlCache").zTryParseAs(false))
            //{
            //    UrlCache urlCache = new UrlCache(xe.zXPathValue("CacheDirectory"));
            //    urlCache.UrlFileNameType = zurl.GetUrlFileNameType(xe.zXPathValue("CacheUrlFileNameType"));
            //    urlCache.GetUrlSubDirectoryFunction = httpRequest => (GetPostDetailKey(httpRequest) / 1000 * 1000).ToString();
            //    detailWebDataManager.WebLoadDataManager.UrlCache = urlCache;
            //}
            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectoryFunction = httpRequest => (GetPostDetailKey(httpRequest) / 1000 * 1000).ToString();
                detailWebDataManager.WebLoadDataManager.UrlCache = urlCache;
            }

            //detailWebDataManager.WebLoadDataManager.InitLoadFromWeb = EbookdzLogin.InitLoadFromWeb;
            detailWebDataManager.WebLoadDataManager.GetHttpRequestParameters = ExtremeDown_v2.GetHttpRequestParameters;
            detailWebDataManager.WebLoadDataManager.GetData = GetData;
            detailWebDataManager.GetKeyFromHttpRequest      = GetPostDetailKey;
            detailWebDataManager.LoadImages = DownloadPrint_v1.LoadImages;

            //if (xe.zXPathValue("UseMongo").zTryParseAs(false))
            //{
            //    MongoDocumentStore<int, Vosbooks_PostDetail> documentStore = new MongoDocumentStore<int, Vosbooks_PostDetail>(xe.zXPathValue("MongoServer"), xe.zXPathValue("MongoDatabase"), xe.zXPathValue("MongoCollection"), xe.zXPathValue("MongoDocumentItemName"));
            //    documentStore.DefaultSort = xe.zXPathValue("MongoDefaultSort");
            //    detailWebDataManager.DocumentStore = documentStore;
            //}

            //documentStore.GetDataKey = headerPage => headerPage.GetKey();
            //documentStore.Deserialize = document => (IEnumDataPages_new<int, IHeaderData_new>)BsonSerializer.Deserialize<Vosbooks_HeaderPage>(document);
            detailWebDataManager.DocumentStore = MongoDocumentStore_v4 <int, ExtremeDown_PostDetail_v2> .Create(xe);

            return(detailWebDataManager);
        }