Ejemplo n.º 1
0
        protected virtual void CreateHeaderWebDataPageManager(XElement xe)
        {
            _headerWebDataPageManager = new WebDataPageManager <THeaderData>();

            _headerWebDataPageManager.WebLoadDataManager = new WebLoadDataManager <IEnumDataPages <THeaderData> >();
            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory = GetHeaderPageCacheUrlSubDirectory;
                _headerWebDataPageManager.WebLoadDataManager.UrlCache = urlCache;
            }

            _headerWebDataPageManager.WebLoadDataManager.InitLoadFromWeb          = InitLoadFromWeb;
            _headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = GetHttpRequestParameters;
            _headerWebDataPageManager.WebLoadDataManager.GetData = GetHeaderPageData;
            _headerWebDataPageManager.GetKeyFromHttpRequest      = GetHeaderKey;

            _headerWebDataPageManager.DocumentStore = MongoDocumentStore <IEnumDataPages <THeaderData> > .Create(xe);

            if (_headerWebDataPageManager.DocumentStore != null)
            {
                _headerWebDataPageManager.DocumentStore.NominalType = _headerPageNominalType;
            }

            _headerWebDataPageManager.GetHttpRequestPageFunction = GetHttpRequestPage;
        }
Ejemplo n.º 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);
        }
        //TDetailData Vosbooks_PostDetail_v2
        public WebDataManager <TDetailData> CreateDetailWebDataManager(XElement xe)
        {
            WebDataManager <TDetailData> detailWebDataManager = new WebDataManager <TDetailData>();

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

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectoryFunction = _detailCacheGetUrlSubDirectory;
                detailWebDataManager.WebLoadDataManager.UrlCache = urlCache;
            }

            detailWebDataManager.WebLoadDataManager.InitLoadFromWeb          = _initLoadFromWeb;
            detailWebDataManager.WebLoadDataManager.GetHttpRequestParameters = _getHttpRequestParameters;
            detailWebDataManager.WebLoadDataManager.GetData = _getDetailData;
            detailWebDataManager.GetKeyFromHttpRequest      = _getDetailKeyFromHttpRequest;
            detailWebDataManager.LoadImages = _loadDetailImages;

            detailWebDataManager.DocumentStore = MongoDocumentStore <TDetailData> .Create(xe);

            _detailWebDataManager = detailWebDataManager;

            return(detailWebDataManager);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        protected virtual void Create(XElement xe)
        {
            _webLoadDataManager = new WebLoadDataManager <IEnumDataPages <TData> >();
            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory  = GetCacheUrlSubDirectory;
                _webLoadDataManager.UrlCache = urlCache;
            }

            _webLoadDataManager.InitLoadFromWeb          = InitLoadFromWeb;
            _webLoadDataManager.GetHttpRequestParameters = GetHttpRequestParameters;
            _webLoadDataManager.GetData = GetDataPage;
            _getKeyFromHttpRequest      = GetKey;

            _documentStore = MongoDocumentStore <IEnumDataPages <TData> > .Create(xe);

            if (_documentStore != null)
            {
                _documentStore.NominalType = _dataPageNominalType;
            }

            _getHttpRequestPageFunction = GetHttpRequestPage;
        }
Ejemplo n.º 6
0
        private static WebDataPageManager_v1 <int, Ebookdz_HeaderPage_v1, Ebookdz_PostHeader> CreateWebDataPageManager(XElement xe)
        {
            WebDataPageManager_v1 <int, Ebookdz_HeaderPage_v1, Ebookdz_PostHeader> headerWebDataPageManager = new WebDataPageManager_v1 <int, Ebookdz_HeaderPage_v1, Ebookdz_PostHeader>();

            headerWebDataPageManager.WebLoadDataManager = new WebLoadDataManager <Ebookdz_HeaderPage_v1>();

            //if (xe.zXPathValue("UseUrlCache").zTryParseAs(false))
            //{
            //    UrlCache urlCache = new UrlCache(xe.zXPathValue("CacheDirectory"));
            //    urlCache.UrlFileNameType = zurl.GetUrlFileNameType(xe.zXPathValue("CacheUrlFileNameType"));
            //    headerWebDataPageManager.WebLoadDataManager.UrlCache = urlCache;
            //}
            headerWebDataPageManager.WebLoadDataManager.UrlCache = UrlCache.Create(xe);

            headerWebDataPageManager.WebLoadDataManager.InitLoadFromWeb          = EbookdzLogin_v1.InitLoadFromWeb;
            headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = EbookdzLogin_v1.GetHttpRequestParameters;
            headerWebDataPageManager.WebLoadDataManager.GetData = GetData;
            //detailWebDataManager.GetKeyFromHttpRequest = GetPostDetailKey;
            //detailWebDataManager.LoadImages = DownloadPrint.LoadImages; // IPost

            //if (xe.zXPathValue("UseMongo").zTryParseAs(false))
            //{
            //    MongoDocumentStore<int, Ebookdz_HeaderPage> documentStore = new MongoDocumentStore<int, Ebookdz_HeaderPage>(xe.zXPathValue("MongoServer"), xe.zXPathValue("MongoDatabase"), xe.zXPathValue("MongoCollection"), xe.zXPathValue("MongoDocumentItemName"));
            //    documentStore.DefaultSort = xe.zXPathValue("MongoDefaultSort");
            //    headerWebDataPageManager.DocumentStore = documentStore;
            //}
            //documentStore.GetDataKey = headerPage => headerPage.GetKey();
            //documentStore.Deserialize = document => (IEnumDataPages_new<int, IHeaderData_new>)BsonSerializer.Deserialize<Ebookdz_HeaderPage>(document);
            headerWebDataPageManager.DocumentStore = MongoDocumentStore_v4 <int, Ebookdz_HeaderPage_v1> .Create(xe);

            headerWebDataPageManager.GetHttpRequestPage = GetHttpRequestPage;
            return(headerWebDataPageManager);
        }
Ejemplo n.º 7
0
        //private static WebDataManager<int, Ebookdz_PostDetail> CreateWebDataManager(XElement xe)
        private static WebDataManager <Ebookdz_PostDetail_v2> CreateWebDataManager(XElement xe)
        {
            //WebDataManager<int, Ebookdz_PostDetail> detailWebDataManager = new WebDataManager<int, Ebookdz_PostDetail>();
            WebDataManager <Ebookdz_PostDetail_v2> detailWebDataManager = new WebDataManager <Ebookdz_PostDetail_v2>();

            //detailWebDataManager.WebLoadDataManager = new WebLoadDataManager<Ebookdz_PostDetail>();
            detailWebDataManager.WebLoadDataManager = new WebLoadDataManager <Ebookdz_PostDetail_v2>();

            UrlCache urlCache = UrlCache.Create(xe);

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

            detailWebDataManager.WebLoadDataManager.InitLoadFromWeb          = EbookdzLogin_v2.InitLoadFromWeb;
            detailWebDataManager.WebLoadDataManager.GetHttpRequestParameters = EbookdzLogin_v2.GetHttpRequestParameters;
            detailWebDataManager.WebLoadDataManager.GetData = GetData;
            detailWebDataManager.GetKeyFromHttpRequest      = GetPostDetailKey;
            //detailWebDataManager.LoadImages = DownloadPrint.LoadImages; // IPost
            detailWebDataManager.LoadImages = data => { data.LoadImages(); };

            //detailWebDataManager.DocumentStore = MongoDocumentStore<int, Ebookdz_PostDetail>.Create(xe);
            detailWebDataManager.DocumentStore = MongoDocumentStore <Ebookdz_PostDetail_v2> .Create(xe);

            return(detailWebDataManager);
        }
Ejemplo n.º 8
0
        //private static Ebookdz_MainForumManager_v2 CreateMainForumManager(XElement xe)
        private static WebDataPageManager <IHeaderData> CreateMainForumManager(XElement xe)
        {
            //Ebookdz_MainForumManager_v2 mainForumManager = new Ebookdz_MainForumManager_v2();
            WebDataPageManager <IHeaderData> webDataPageManager = new WebDataPageManager <IHeaderData>();

            //mainForumManager.WebLoadDataManager = new WebLoadDataManager<Ebookdz_ForumPage>();
            //if (xe.zXPathValue("UseUrlCache").zTryParseAs(false))
            //{
            //    UrlCache urlCache = new UrlCache(xe.zXPathValue("CacheDirectory"));
            //    urlCache.UrlFileNameType = zurl.GetUrlFileNameType(xe.zXPathValue("CacheUrlFileNameType"));
            //    mainForumManager.WebLoadDataManager.UrlCache = urlCache;
            //}
            webDataPageManager.WebLoadDataManager                          = new WebLoadDataManager <IEnumDataPages <IHeaderData> >();
            webDataPageManager.WebLoadDataManager.UrlCache                 = UrlCache.Create(xe);
            webDataPageManager.WebLoadDataManager.InitLoadFromWeb          = EbookdzLogin_v2.InitLoadFromWeb;
            webDataPageManager.WebLoadDataManager.GetHttpRequestParameters = EbookdzLogin_v2.GetHttpRequestParameters;
            webDataPageManager.WebLoadDataManager.GetData                  = GetData;

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

            if (webDataPageManager.DocumentStore != null)
            {
                webDataPageManager.DocumentStore.NominalType = typeof(Ebookdz_ForumPage_v2);
            }

            webDataPageManager.GetHttpRequestPageFunction = GetHttpRequestPage;
            return(webDataPageManager);
        }
Ejemplo n.º 9
0
 protected void Create(XElement xe = null)
 {
     _urlCache = UrlCache.Create(xe);
     if (_urlCache != null)
     {
         //_urlCache.GetUrlSubDirectory = httpRequest => zurl.GetDomain(httpRequest.Url);
         _urlCache.GetUrlSubDirectory = GetUrlSubDirectory;
     }
 }
Ejemplo n.º 10
0
        protected virtual void CreateDetailWebDataManager(XElement xe)
        {
            _detailDataManager         = new WebDataManager <TDetailData>();
            _detailDataManager.Version = xe.zXPathValue("Version").zTryParseAs(1);

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory = GetDetailCacheUrlSubDirectory;
            }

            //if (_detailDataManager.Version <= 3)
            //{
            _detailDataManager.WebLoadDataManager                          = new WebLoadDataManager <TDetailData>();
            _detailDataManager.WebLoadDataManager.UrlCache                 = urlCache;
            _detailDataManager.WebLoadDataManager.InitLoadFromWeb          = InitLoadFromWeb;
            _detailDataManager.WebLoadDataManager.GetHttpRequestParameters = GetHttpRequestParameters;
            _detailDataManager.WebLoadDataManager.GetData                  = GetDetailData;
            //}
            //else
            //{
            //    _detailDataManager.WebLoadDataManager_v2 = new WebLoadDataManager_v2<TDetailData>();
            //    _detailDataManager.WebLoadDataManager_v2.TraceException = true;
            //    _detailDataManager.WebLoadDataManager_v2.UrlCache = urlCache;
            //    _detailDataManager.WebLoadDataManager_v2.InitLoadFromWeb = InitLoadFromWeb;
            //    _detailDataManager.WebLoadDataManager_v2.GetData = GetDetailData_v2;
            //    SetHttpRequestParameters(_detailDataManager.WebLoadDataManager_v2.RequestParameters);
            //}

            _detailDataManager.GetKeyFromHttpRequest = GetDetailKey;
            //_detailDataManager.LoadImages = LoadDetailImages;

            //if (_detailDataManager.Version < 3)
            //{
            _detailDataManager.DocumentStore = MongoDocumentStore <TDetailData> .Create(xe);

            //}
            //else
            //{
            //    _detailDataManager.DataStore = MongoDataStore.Create(xe);
            //    MongoDataSerializer<TDetailData> dataSerializer = new MongoDataSerializer<TDetailData>();
            //    dataSerializer.ItemName = xe.zXPathValue("MongoDocumentItemName");
            //    _detailDataManager.DataSerializer = dataSerializer;
            //}

            //UrlCache imageUrlCache = UrlCache.Create(xe.zXPathElement("Image"));
            //if (imageUrlCache != null)
            //{
            //    //imageUrlCache.GetUrlSubDirectory = GetDetailImageCacheUrlSubDirectory;
            //    //_detailDataManager.WebImageCacheManager = new WebImageCacheManager_v2(imageUrlCache);
            //    _detailDataManager.WebImageCacheManager = new WebImageCacheManager_v3(imageUrlCache);
            //    _detailDataManager.WebImageCacheManager.TraceException = true;
            //    _detailDataManager.GetImageSubDirectory = GetDetailImageCacheUrlSubDirectory;
            //}
        }
Ejemplo n.º 11
0
        private static void InitImage(XElement xe)
        {
            UrlCache urlCache = UrlCache.Create(xe);

            //if (xe.zXPathValue("UseUrlCache").zTryParseAs(false))
            if (urlCache != null)
            {
                // xe.zXPathValue("CacheDirectory")
                _imageCacheManager = new WebImageMongoCacheManager(xe.zXPathValue("MongoServer"), xe.zXPathValue("MongoDatabase"), xe.zXPathValue("MongoCollection"), urlCache);
            }
            _imageFilterMinHeight = xe.zXPathValue("ImageFilterMinHeight").zParseAs <int>();
        }
Ejemplo n.º 12
0
        private static WebDataPageManager_v1 <int, TelechargerMagazine_HeaderPage_v1, TelechargerMagazine_PostHeader_v1> CreateWebDataPageManager(XElement xe)
        {
            WebDataPageManager_v1 <int, TelechargerMagazine_HeaderPage_v1, TelechargerMagazine_PostHeader_v1> headerWebDataPageManager = new WebDataPageManager_v1 <int, TelechargerMagazine_HeaderPage_v1, TelechargerMagazine_PostHeader_v1>();

            headerWebDataPageManager.WebLoadDataManager          = new WebLoadDataManager <TelechargerMagazine_HeaderPage_v1>();
            headerWebDataPageManager.WebLoadDataManager.UrlCache = UrlCache.Create(xe);

            //headerWebDataPageManager.WebLoadDataManager.InitLoadFromWeb = EbookdzLogin.InitLoadFromWeb;
            headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = TelechargerMagazine_v1.GetHttpRequestParameters;
            headerWebDataPageManager.WebLoadDataManager.GetData = GetData;
            headerWebDataPageManager.DocumentStore = MongoDocumentStore_v4 <int, TelechargerMagazine_HeaderPage_v1> .Create(xe);

            headerWebDataPageManager.GetHttpRequestPage = GetHttpRequestPage;
            return(headerWebDataPageManager);
        }
Ejemplo n.º 13
0
        private static WebDataPageManager_v1 <int, Handeco_HeaderPage, Handeco_Header> CreateWebDataPageManager(XElement xe)
        {
            WebDataPageManager_v1 <int, Handeco_HeaderPage, Handeco_Header> headerWebDataPageManager = new WebDataPageManager_v1 <int, Handeco_HeaderPage, Handeco_Header>();

            headerWebDataPageManager.WebLoadDataManager = new WebLoadDataManager <Handeco_HeaderPage>();

            headerWebDataPageManager.WebLoadDataManager.UrlCache = UrlCache.Create(xe);

            //headerWebDataPageManager.WebLoadDataManager.InitLoadFromWeb = EbookdzLogin.InitLoadFromWeb;
            headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = Handeco.GetHttpRequestParameters;
            headerWebDataPageManager.WebLoadDataManager.GetData = GetData;

            headerWebDataPageManager.DocumentStore = MongoDocumentStore_v4 <int, Handeco_HeaderPage> .Create(xe);

            headerWebDataPageManager.GetHttpRequestPage = GetHttpRequestPage;
            return(headerWebDataPageManager);
        }
        protected virtual void CreateHeaderWebDataPageManager(XElement xe)
        {
            _headerDataPageManager = new WebDataPageManager_v4 <THeaderData>();

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory = GetHeaderPageCacheUrlSubDirectory;
            }
            //Trace.WriteLine($"WebHeaderDetailMongoManagerBase_v2<THeaderData, TDetailData>.CreateHeaderWebDataPageManager() : {(urlCache != null ? "urlCache created" : "no urlCache")}");

            _headerDataPageManager.WebLoadDataManager = new WebLoadDataManager_v2 <IEnumDataPages <THeaderData> >();
            _headerDataPageManager.WebLoadDataManager.TraceException  = true;
            _headerDataPageManager.WebLoadDataManager.UrlCache        = urlCache;
            _headerDataPageManager.WebLoadDataManager.InitLoadFromWeb = InitLoadFromWeb;
            _headerDataPageManager.WebLoadDataManager.GetData         = GetHeaderPageData;
            //_headerDataPageManager.WebLoadDataManager.GetHttpRequestParameters = GetHttpRequestParameters;
            SetHttpRequestParameters(_headerDataPageManager.WebLoadDataManager.RequestParameters);
            _headerDataPageManager.GetKeyFromHttpRequest = GetHeaderKey;

            //_headerDataPageManager.DocumentStore = MongoDocumentStore<IEnumDataPages<THeaderData>>.Create(xe);
            //if (_headerDataPageManager.DocumentStore != null)
            //    _headerDataPageManager.DocumentStore.NominalType = _headerPageNominalType;

            _headerDataPageManager.DataStore = MongoDataStore.Create(xe);
            MongoDataSerializer <IEnumDataPages <THeaderData> > dataSerializer = new MongoDataSerializer <IEnumDataPages <THeaderData> >();

            dataSerializer.ItemName               = xe.zXPathValue("MongoDocumentItemName");
            dataSerializer.NominalType            = _headerPageNominalType;
            _headerDataPageManager.DataSerializer = dataSerializer;

            UrlCache imageUrlCache = UrlCache.Create(xe.zXPathElement("Image"));

            _headerDataPageManager.WebLoadImageManager = new WebLoadImageManager_v2 <IEnumDataPages <THeaderData> >();
            if (imageUrlCache != null)
            {
                _headerDataPageManager.WebLoadImageManager.WebImageCacheManager = new WebImageCacheManager_v3(imageUrlCache);
                _headerDataPageManager.WebLoadImageManager.WebImageCacheManager.TraceException = true;
                //_headerDataPageManager.WebLoadImageManager.GetImageSubDirectory = GetHeaderImageCacheUrlSubDirectory;
                _headerDataPageManager.GetImageSubDirectory = GetHeaderImageCacheUrlSubDirectory;
            }

            _headerDataPageManager.GetHttpRequestPageFunction = GetHttpRequestPage;
        }
Ejemplo n.º 15
0
        public static WebImageMongoCacheManager Create(XElement xe = null)
        {
            //if (xe != null && xe.zXPathValue("UseUrlCache").zTryParseAs(false))
            //    return new WebImageMongoCacheManager(xe.zXPathValue("MongoServer"), xe.zXPathValue("MongoDatabase"), xe.zXPathValue("MongoCollection"), xe.zXPathValue("CacheDirectory"));
            //else
            //    return null;
            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory = httpRequest => zurl.GetDomain(httpRequest.Url);
                return(new WebImageMongoCacheManager(xe.zXPathExplicitValue("MongoServer"), xe.zXPathExplicitValue("MongoDatabase"), xe.zXPathExplicitValue("MongoCollection"), urlCache));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 16
0
        private static WebDataPageManager <int, MagazinesGratuits_HeaderPage_v1, MagazinesGratuits_PostHeader_v1> CreateWebDataPageManager(XElement xe)
        {
            WebDataPageManager <int, MagazinesGratuits_HeaderPage_v1, MagazinesGratuits_PostHeader_v1> headerWebDataPageManager = new WebDataPageManager <int, MagazinesGratuits_HeaderPage_v1, MagazinesGratuits_PostHeader_v1>();

            headerWebDataPageManager.WebLoadDataManager          = new WebLoadDataManager <MagazinesGratuits_HeaderPage_v1>();
            headerWebDataPageManager.WebLoadDataManager.UrlCache = UrlCache.Create(xe);

            //headerWebDataPageManager.WebLoadDataManager.InitLoadFromWeb = EbookdzLogin.InitLoadFromWeb;
            headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = MagazinesGratuits.GetHttpRequestParameters;
            headerWebDataPageManager.WebLoadDataManager.GetData = GetData;
            //detailWebDataManager.GetKeyFromHttpRequest = GetPostDetailKey;
            //detailWebDataManager.LoadImages = DownloadPrint.LoadImages; // IPost

            headerWebDataPageManager.DocumentStore = MongoDocumentStore <int, MagazinesGratuits_HeaderPage_v1> .Create(xe);

            headerWebDataPageManager.GetHttpRequestPage = GetHttpRequestPage;
            return(headerWebDataPageManager);
        }
Ejemplo n.º 17
0
        private static WebDataManager <MagazinesGratuits_PostDetail_v2> CreateWebDataManager(XElement xe)
        {
            WebDataManager <MagazinesGratuits_PostDetail_v2> detailWebDataManager = new WebDataManager <MagazinesGratuits_PostDetail_v2>();

            detailWebDataManager.WebLoadDataManager = new WebLoadDataManager <MagazinesGratuits_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 = GetSubDirectoryKey;
                detailWebDataManager.WebLoadDataManager.UrlCache = urlCache;
            }

            //detailWebDataManager.WebLoadDataManager.InitLoadFromWeb = EbookdzLogin.InitLoadFromWeb;
            detailWebDataManager.WebLoadDataManager.GetHttpRequestParameters = MagazinesGratuits_v2.GetHttpRequestParameters;
            detailWebDataManager.WebLoadDataManager.GetData = GetData;
            detailWebDataManager.GetKeyFromHttpRequest      = GetPostDetailKey;
            //detailWebDataManager.LoadImages = DownloadPrint.LoadImages;
            detailWebDataManager.LoadImages = data => { data.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<int, Vosbooks_PostDetail>.Create(xe);
            detailWebDataManager.DocumentStore = MongoDocumentStore <MagazinesGratuits_PostDetail_v2> .Create(xe);

            return(detailWebDataManager);
        }
Ejemplo n.º 18
0
        protected virtual void CreateDetailWebDataManager(XElement xe)
        {
            _detailWebDataManager = new WebDataManager <TDetailData>();

            _detailWebDataManager.WebLoadDataManager = new WebLoadDataManager <TDetailData>();

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectoryFunction = GetDetailCacheUrlSubDirectory;
                _detailWebDataManager.WebLoadDataManager.UrlCache = urlCache;
            }

            _detailWebDataManager.WebLoadDataManager.InitLoadFromWeb          = InitLoadFromWeb;
            _detailWebDataManager.WebLoadDataManager.GetHttpRequestParameters = GetHttpRequestParameters;
            _detailWebDataManager.WebLoadDataManager.GetData = GetDetailData;
            _detailWebDataManager.GetKeyFromHttpRequest      = GetDetailKey;
            _detailWebDataManager.LoadImages = LoadDetailImages;

            _detailWebDataManager.DocumentStore = MongoDocumentStore <TDetailData> .Create(xe);
        }
        protected virtual void CreateDetailWebDataManager(XElement xe, IEnumerable <NamedGetData <TDetailData> > namedGetDatas)
        {
            _detailDataManager = new WebDataManager_v5 <THeaderData, TDetailData>();

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory = GetDetailCacheUrlSubDirectory;
            }

            _detailDataManager.HttpManager = new HttpManager_v2();
            _detailDataManager.HttpManager.TraceException  = true;
            _detailDataManager.HttpManager.UrlCache        = urlCache;
            _detailDataManager.HttpManager.InitLoadFromWeb = InitLoadFromWeb;
            //_detailDataManager.WebLoadDataManager.GetData = GetDetailData;
            _detailDataManager.CreateData = CreateDetailData;
            _detailDataManager.AddNamedGetDatas(namedGetDatas);
            SetHttpRequestParameters(_detailDataManager.HttpManager.RequestParameters);

            //_detailDataManager.GetKeyFromHttpRequest = GetDetailKey;

            _detailDataManager.Store = MongoDataStore.Create(xe);
            MongoDataSerializer <TDetailData> dataSerializer = new MongoDataSerializer <TDetailData>();

            dataSerializer.ItemName           = xe.zXPathValue("MongoDocumentItemName");
            _detailDataManager.DataSerializer = dataSerializer;

            UrlCache imageUrlCache = UrlCache.Create(xe.zXPathElement("Image"));

            _detailDataManager.WebLoadImageManager = new WebLoadImageManager_v2 <TDetailData>();
            if (imageUrlCache != null)
            {
                _detailDataManager.WebLoadImageManager.WebImageCacheManager = new WebImageCacheManager_v3(imageUrlCache);
                _detailDataManager.WebLoadImageManager.WebImageCacheManager.TraceException = true;
                _detailDataManager.GetImageSubDirectory = GetDetailImageCacheUrlSubDirectory;
            }
        }
Ejemplo n.º 20
0
        private static WebDataPageManager <IHeaderData> CreateWebDataPageManager(XElement xe)
        {
            WebDataPageManager <IHeaderData> headerWebDataPageManager = new WebDataPageManager <IHeaderData>();

            //headerWebDataPageManager.WebLoadDataManager = new WebLoadDataManager<Vosbooks_HeaderPage>();
            headerWebDataPageManager.WebLoadDataManager          = new WebLoadDataManager <IEnumDataPages <IHeaderData> >();
            headerWebDataPageManager.WebLoadDataManager.UrlCache = UrlCache.Create(xe);

            headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = Vosbooks_v2.GetHttpRequestParameters;
            headerWebDataPageManager.WebLoadDataManager.GetData = GetData;

            //documentStore.Deserialize = document => (IEnumDataPages_new<int, IHeaderData_new>)BsonSerializer.Deserialize<Ebookdz_HeaderPage>(document);
            // Vosbooks_HeaderPage
            headerWebDataPageManager.DocumentStore = MongoDocumentStore <IEnumDataPages <IHeaderData> > .Create(xe);

            if (headerWebDataPageManager.DocumentStore != null)
            {
                headerWebDataPageManager.DocumentStore.NominalType = typeof(Vosbooks_HeaderPage_v2);
            }

            headerWebDataPageManager.GetHttpRequestPageFunction = GetHttpRequestPage;
            return(headerWebDataPageManager);
        }
Ejemplo n.º 21
0
        private static WebDataPageManager <IHeaderData> CreateWebDataPageManager(XElement xe)
        {
            //WebDataPageManager<int, Ebookdz_HeaderPage, Ebookdz_PostHeader> headerWebDataPageManager = new WebDataPageManager<int, Ebookdz_HeaderPage, Ebookdz_PostHeader>();
            WebDataPageManager <IHeaderData> headerWebDataPageManager = new WebDataPageManager <IHeaderData>();

            //headerWebDataPageManager.WebLoadDataManager = new WebLoadDataManager<Ebookdz_HeaderPage>();
            headerWebDataPageManager.WebLoadDataManager          = new WebLoadDataManager <IEnumDataPages <IHeaderData> >();
            headerWebDataPageManager.WebLoadDataManager.UrlCache = UrlCache.Create(xe);

            headerWebDataPageManager.WebLoadDataManager.InitLoadFromWeb          = EbookdzLogin_v2.InitLoadFromWeb;
            headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = EbookdzLogin_v2.GetHttpRequestParameters;
            headerWebDataPageManager.WebLoadDataManager.GetData = GetData;

            //headerWebDataPageManager.DocumentStore = MongoDocumentStore<int, Ebookdz_HeaderPage>.Create(xe);
            headerWebDataPageManager.DocumentStore = MongoDocumentStore <IEnumDataPages <IHeaderData> > .Create(xe);

            if (headerWebDataPageManager.DocumentStore != null)
            {
                headerWebDataPageManager.DocumentStore.NominalType = typeof(Ebookdz_HeaderPage_v2);
            }

            headerWebDataPageManager.GetHttpRequestPageFunction = GetHttpRequestPage;
            return(headerWebDataPageManager);
        }
        public WebDataPageManager <IHeaderData> CreateHeaderWebDataPageManager(XElement xe)
        {
            WebDataPageManager <IHeaderData> headerWebDataPageManager = new WebDataPageManager <IHeaderData>();

            headerWebDataPageManager.WebLoadDataManager          = new WebLoadDataManager <IEnumDataPages <IHeaderData> >();
            headerWebDataPageManager.WebLoadDataManager.UrlCache = UrlCache.Create(xe);

            headerWebDataPageManager.WebLoadDataManager.InitLoadFromWeb          = _initLoadFromWeb;
            headerWebDataPageManager.WebLoadDataManager.GetHttpRequestParameters = _getHttpRequestParameters;
            headerWebDataPageManager.WebLoadDataManager.GetData = _getHeaderPageData;

            headerWebDataPageManager.DocumentStore = MongoDocumentStore <IEnumDataPages <IHeaderData> > .Create(xe);

            if (headerWebDataPageManager.DocumentStore != null)
            {
                headerWebDataPageManager.DocumentStore.NominalType = _headerPageNominalType;
            }

            headerWebDataPageManager.GetHttpRequestPageFunction = _getHttpRequestPage;

            _headerWebDataPageManager = headerWebDataPageManager;

            return(headerWebDataPageManager);
        }