コード例 #1
0
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;

            bool result = DBEvents.UpdateCalendarEvent(
                this.itemID,
                this.moduleID,
                this.title,
                this.description,
                this.imageName,
                this.eventDate,
                this.startTime,
                this.endTime,
                this.location,
                this.requiresTicket,
                this.ticketPrice,
                this.lastModUtc,
                this.lastModUserGuid);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #2
0
        public override void ContentChangedHandler(
            object sender,
            ContentChangedEventArgs e)
        {
            if (WebConfigSettings.DisableSearchIndex) { return; }

            SharedFile sharedFile = (SharedFile)sender;
            if (e.IsDeleted)
            {
                // get list of pages where this module is published
                List<PageModule> pageModules
                    = PageModule.GetPageModulesByModule(sharedFile.ModuleId);

                foreach (PageModule pageModule in pageModules)
                {
                    mojoPortal.SearchIndex.IndexHelper.RemoveIndexItem(
                        pageModule.PageId,
                        sharedFile.ModuleId,
                        sharedFile.ItemId);
                }
            }
            else
            {
                IndexItem(sharedFile);
            }
        }
コード例 #3
0
ファイル: Links.cs プロジェクト: wqshabib/mojoportal
        private bool Create()
        {
            int newID = -1;

            this.itemGuid = Guid.NewGuid();

            newID = DBLinks.AddLink(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.url,
                this.viewOrder,
                this.description,
                this.createdDate,
                this.createdByUser,
                this.target,
                this.userGuid);

            this.itemID = newID;

            bool result = (newID > 0);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #4
0
        public bool Delete()
        {
            bool result = false;

            if (itemID == -1)
            {
                return(result);
            }

            SharedFile sharedFile = new SharedFile(moduleID, itemID);

            DBSharedFiles.DeleteHistoryByItemID(itemID);

            // this just deletes the entry from the db
            result = DBSharedFiles.DeleteSharedFile(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #5
0
ファイル: Links.cs プロジェクト: wqshabib/mojoportal
 protected void OnContentChanged(ContentChangedEventArgs e)
 {
     if (ContentChanged != null)
     {
         ContentChanged(this, e);
     }
 }
コード例 #6
0
ファイル: HtmlContent.cs プロジェクト: wqshabib/mojoportal
        /// <summary>
        /// Creates this instance.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = -1;

            this.itemGuid = Guid.NewGuid();

            newID = DBHtmlContent.AddHtmlContent(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.excerpt,
                this.body,
                this.moreLink,
                this.sortOrder,
                this.beginDate,
                this.endDate,
                this.createdDate,
                this.createdBy,
                this.userGuid,
                this.excludeFromRecentContent);

            this.itemID = newID;

            bool result = (newID > -1);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #7
0
        private bool Update()
        {
            bool result = DBSharedFiles.UpdateSharedFile(
                itemID,
                moduleID,
                uploadUserID,
                friendlyName,
                originalFileName,
                serverFileName,
                sizeInKB,
                uploadDate,
                folderID,
                folderGuid,
                userGuid,
                description,
                viewRoles
                );

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #8
0
ファイル: HtmlContent.cs プロジェクト: wqshabib/mojoportal
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;

            bool result = DBHtmlContent.UpdateHtmlContent(
                this.itemID,
                this.moduleID,
                this.title,
                this.excerpt,
                this.body,
                this.moreLink,
                this.sortOrder,
                this.beginDate,
                this.endDate,
                this.lastModUtc,
                this.lastModUserGuid,
                this.excludeFromRecentContent);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #9
0
        private bool Update()
        {
            bool result = DBSharedFiles.UpdateSharedFile(
                this.itemID,
                this.moduleID,
                this.uploadUserID,
                this.friendlyName,
                this.originalFileName,
                this.serverFileName,
                this.sizeInKB,
                this.uploadDate,
                this.folderID,
                this.folderGuid,
                this.userGuid,
                this.description);

            //IndexHelper.IndexItem(this);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #10
0
ファイル: HtmlRepository.cs プロジェクト: wqshabib/mojoportal
        public bool Save(HtmlContent content)
        {
            bool result = false;

            if (content == null)
            {
                return(result);
            }

            content.LastModUtc = DateTime.UtcNow;

            if (content.ItemId > -1)
            {
                result = DBHtmlContent.UpdateHtmlContent(
                    content.ItemId,
                    content.ModuleId,
                    content.Title,
                    content.Excerpt,
                    content.Body,
                    content.MoreLink,
                    content.SortOrder,
                    content.BeginDate,
                    content.EndDate,
                    content.LastModUtc,
                    content.LastModUserGuid,
                    content.ExcludeFromRecentContent);
            }
            else
            {
                content.ItemGuid = Guid.NewGuid();

                int newId = DBHtmlContent.AddHtmlContent(
                    content.ItemGuid,
                    content.ModuleGuid,
                    content.ModuleId,
                    content.Title,
                    content.Excerpt,
                    content.Body,
                    content.MoreLink,
                    content.SortOrder,
                    content.BeginDate,
                    content.EndDate,
                    content.CreatedDate,
                    content.CreatedBy,
                    content.UserGuid,
                    content.ExcludeFromRecentContent);

                content.ItemId = newId;

                result = (newId > -1);
            }

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                content.OnContentChanged(e);
            }

            return(result);
        }
コード例 #11
0
        public bool DeletePost(int postId)
        {
            bool deleted = DBForums.ForumPostDelete(postId);

            if (deleted)
            {
                Forum.DecrementPostCount(this.forumID);
                if (this.totalReplies > 0)
                {
                    DBForums.ForumThreadDecrementReplyStats(this.threadID);
                }
                Forum forum = new Forum(this.forumID);

                this.moduleID = forum.ModuleId;
                this.postID   = postId;

                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);

                int threadPostCount = ForumThread.GetPostCount(this.threadID);
                if (threadPostCount == 0)
                {
                    ForumThread.Delete(this.threadID);
                    Forum.DecrementThreadCount(this.forumID);
                }

                ResetThreadSequences();
            }


            return(deleted);
        }
コード例 #12
0
ファイル: HtmlContent.cs プロジェクト: wqshabib/mojoportal
 public void OnContentChanged(ContentChangedEventArgs e)
 {
     if (ContentChanged != null)
     {
         ContentChanged(this, e);
     }
 }
コード例 #13
0
        private bool Create()
        {
            int newID = -1;

            this.itemGuid = Guid.NewGuid();

            newID = DBGallery.AddGalleryImage(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.displayOrder,
                this.caption,
                this.description,
                this.metaDataXml,
                this.imageFile,
                this.webImageFile,
                this.thumbnailFile,
                this.uploadDate,
                this.uploadUser,
                this.userGuid);

            this.itemID = newID;

            bool result = (newID > -1);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            //IndexHelper.IndexItem(this);

            return(result);
        }
コード例 #14
0
        public override void ContentChangedHandler(
            object sender,
            ContentChangedEventArgs e)
        {
            if (WebConfigSettings.DisableSearchIndex) { return; }
            GalleryImage galleryImage = (GalleryImage)sender;
            if (e.IsDeleted)
            {
                SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
                if (siteSettings == null) return;
                // get list of pages where this module is published
                List<PageModule> pageModules
                    = PageModule.GetPageModulesByModule(galleryImage.ModuleId);

                foreach (PageModule pageModule in pageModules)
                {
                    RemoveGalleryImageIndexItem(
                        siteSettings.SiteId,
                        pageModule.PageId,
                        galleryImage.ModuleId,
                        galleryImage.ItemId);
                }

            }
            else
            {
                IndexItem(galleryImage);
            }
        }
コード例 #15
0
ファイル: Edit.aspx.cs プロジェクト: joedavis01/mojoportal
 void linkItem_ContentChanged(object sender, ContentChangedEventArgs e)
 {
     IndexBuilderProvider indexBuilder = IndexBuilderManager.Providers["LinksIndexBuilderProvider"];
     if (indexBuilder != null)
     {
         indexBuilder.ContentChangedHandler(sender, e);
     }
 }
コード例 #16
0
ファイル: HtmlContent.cs プロジェクト: wqshabib/mojoportal
        public bool Delete()
        {
            bool result = DBHtmlContent.DeleteHtmlContent(this.itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #17
0
        public bool Delete()
        {
            //IndexHelper.RemoveIndexItem(moduleID, itemID);
            bool result = DBEvents.DeleteCalendarEvent(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #18
0
ファイル: Links.cs プロジェクト: wqshabib/mojoportal
        public bool Delete()
        {
            bool result = DBLinks.DeleteLink(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }


            return(result);
        }
コード例 #19
0
        public bool Delete()
        {
            bool result = false;

            result = DBGallery.DeleteGalleryImage(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #20
0
        public bool Delete(HtmlContent content)
        {
            if (content == null) { return false; }

            bool result = DBHtmlContent.DeleteHtmlContent(content.ItemId);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                content.OnContentChanged(e);
            }

            return result;
        }
コード例 #21
0
ファイル: HtmlRepository.cs プロジェクト: wqshabib/mojoportal
        public bool Delete(HtmlContent content)
        {
            if (content == null)
            {
                return(false);
            }

            bool result = DBHtmlContent.DeleteHtmlContent(content.ItemId);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                content.OnContentChanged(e);
            }

            return(result);
        }
コード例 #22
0
        public override void ContentChangedHandler(
            object sender,
            ContentChangedEventArgs e)
        {
            if (WebConfigSettings.DisableSearchIndex) { return; }
            if (sender == null) return;
            if (!(sender is Product)) return;

            Product product = sender as Product;

            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
            product.SiteId = siteSettings.SiteId;
            product.SearchIndexPath = mojoPortal.SearchIndex.IndexHelper.GetSearchIndexPath(siteSettings.SiteId);

            if (e.IsDeleted)
            {
                Store store = new Store(product.StoreGuid);
                // get list of pages where this module is published
                List<PageModule> pageModules
                    = PageModule.GetPageModulesByModule(store.ModuleId);

                foreach (PageModule pageModule in pageModules)
                {
                    mojoPortal.SearchIndex.IndexHelper.RemoveIndexItem(
                        pageModule.PageId,
                        store.ModuleId,
                        product.Guid.ToString());
                }
            }
            else
            {
                if (ThreadPool.QueueUserWorkItem(new WaitCallback(IndexItem), product))
                {
                    if (debugLog) log.Debug("ProductSearchIndexBuilder.IndexItem queued");
                }
                else
                {
                    log.Error("Failed to queue a thread for ProductSearchIndexBuilder.IndexItem");
                }

            }
        }
コード例 #23
0
        public override void ContentChangedHandler(
            object sender,
            ContentChangedEventArgs e)
        {
            bool disableSearchIndex = ConfigHelper.GetBoolProperty("DisableSearchIndex", false);
            if (disableSearchIndex) { return; }

            if (sender == null) return;
            if (!(sender is HtmlContent)) return;

            HtmlContent content = (HtmlContent)sender;
            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
            content.SiteId = siteSettings.SiteId;
            content.SearchIndexPath = IndexHelper.GetSearchIndexPath(siteSettings.SiteId);

            if (e.IsDeleted)
            {
                // get list of pages where this module is published
                List<PageModule> pageModules
                    = PageModule.GetPageModulesByModule(content.ModuleId);

                foreach (PageModule pageModule in pageModules)
                {
                    IndexHelper.RemoveIndexItem(
                        pageModule.PageId,
                        content.ModuleId,
                        content.ItemId);
                }
            }
            else
            {
                if (ThreadPool.QueueUserWorkItem(new WaitCallback(IndexItem), content))
                {
                    if (debugLog) log.Debug("HtmlContentIndexBuilderProvider.IndexItem queued");
                }
                else
                {
                    if (log.IsErrorEnabled) log.Error("Failed to queue a thread for HtmlContentIndexBuilderProvider.IndexItem");
                }
                //IndexItem(content);
            }
        }
コード例 #24
0
        private bool Create()
        {
            int newID = 0;

            if (serverFileName.Length == 0)
            {
                serverFileName = Guid.NewGuid().ToString() + ".config";
            }

            itemGuid = Guid.NewGuid();

            newID = DBSharedFiles.AddSharedFile(
                itemGuid,
                moduleGuid,
                userGuid,
                folderGuid,
                moduleID,
                uploadUserID,
                friendlyName,
                originalFileName,
                serverFileName,
                sizeInKB,
                uploadDate,
                folderID,
                description,
                viewRoles
                );

            itemID = newID;

            bool result = (newID > 0);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #25
0
        public override void ContentChangedHandler(
            object sender,
            ContentChangedEventArgs e)
        {
            if (WebConfigSettings.DisableSearchIndex) { return; }
            if (sender == null) return;
            if (!(sender is CalendarEvent)) return;

            CalendarEvent calendarEvent = (CalendarEvent)sender;
            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
            calendarEvent.SiteId = siteSettings.SiteId;
            calendarEvent.SearchIndexPath = mojoPortal.SearchIndex.IndexHelper.GetSearchIndexPath(siteSettings.SiteId);

            if (e.IsDeleted)
            {
                // get list of pages where this module is published
                List<PageModule> pageModules
                    = PageModule.GetPageModulesByModule(calendarEvent.ModuleId);

                foreach (PageModule pageModule in pageModules)
                {
                    mojoPortal.SearchIndex.IndexHelper.RemoveIndexItem(
                        pageModule.PageId,
                        calendarEvent.ModuleId,
                        calendarEvent.ItemId);
                }
            }
            else
            {
                if (ThreadPool.QueueUserWorkItem(new WaitCallback(IndexItem), calendarEvent))
                {
                    if (debugLog) log.Debug("CalendarEventIndexBuilderProvider.IndexItem queued");
                }
                else
                {
                    log.Error("Failed to queue a thread for CalendarEventIndexBuilderProvider.IndexItem");
                }
                //IndexItem(calendarEvent);
            }
        }
コード例 #26
0
        private bool Create()
        {
            int newID = 0;

            if (this.serverFileName.Length == 0)
            {
                this.serverFileName = System.Guid.NewGuid().ToString() + ".config";
            }

            this.itemGuid = Guid.NewGuid();

            newID = DBSharedFiles.AddSharedFile(
                this.itemGuid,
                this.moduleGuid,
                this.userGuid,
                this.folderGuid,
                this.moduleID,
                this.uploadUserID,
                this.friendlyName,
                this.originalFileName,
                this.serverFileName,
                this.sizeInKB,
                this.uploadDate,
                this.folderID,
                this.description);

            this.itemID = newID;

            bool result = (newID > 0);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #27
0
        public int Post()
        {
            bool newThread = (this.threadID < 0);

            if (newThread)
            {
                this.CreateThread();
            }

            if (this.postID > -1)
            {
                this.UpdatePost();
            }
            else
            {
                this.CreatePost();
                if (!newThread)
                {
                    this.IncrementReplyStats();
                }
            }

            if (this.subscribeUserToThread)
            {
                if (!DBForums.ForumSubscriptionExists(this.forumID, this.postUserID))
                {
                    DBForums.ForumThreadAddSubscriber(this.threadID, this.postUserID, Guid.NewGuid());
                }
            }

            if (this.postID > -1)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }


            return(this.postID);
        }
コード例 #28
0
ファイル: Links.cs プロジェクト: wqshabib/mojoportal
        private bool Update()
        {
            bool result = DBLinks.UpdateLink(
                this.itemID,
                this.moduleID,
                this.title,
                this.url,
                this.viewOrder,
                this.description,
                this.createdDate,
                this.target,
                this.createdByUser);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #29
0
ファイル: CalendarEvent.cs プロジェクト: wang2245/mojoportal
        private bool Create()
        {
            int newID;

            this.itemGuid    = Guid.NewGuid();
            this.createdDate = DateTime.UtcNow;

            newID = DBEvents.AddCalendarEvent(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.description,
                this.imageName,
                this.eventDate,
                this.startTime,
                this.endTime,
                this.userID,
                this.userGuid,
                this.location,
                this.requiresTicket,
                this.ticketPrice,
                this.createdDate,
                this.showMap);

            this.itemID = newID;

            bool result = (newID > -1);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #30
0
        private bool Update()
        {
            bool result = DBGallery.UpdateGalleryImage(
                this.itemID,
                this.moduleID,
                this.displayOrder,
                this.caption,
                this.description,
                this.metaDataXml,
                this.imageFile,
                this.webImageFile,
                this.thumbnailFile,
                this.uploadDate,
                this.uploadUser);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #31
0
ファイル: Blog.cs プロジェクト: saiesh86/TravelBlog
 protected void OnContentChanged(ContentChangedEventArgs e)
 {
     if (ContentChanged != null)
     {
         ContentChanged(this, e);
     }
 }
コード例 #32
0
ファイル: Product.cs プロジェクト: joedavis01/mojoportal
        private bool Create()
        {
            this.guid = Guid.NewGuid();

            int rowsAffected = DBProduct.Add(
                this.guid,
                this.storeGuid,
                this.taxClassGuid,
                this.modelNumber,
                this.status,
                this.fulfillmentType,
                this.weight,
                this.quantityOnHand,
                this.imageFileName,
                this.imageFileBytes,
                this.created,
                this.createdBy,
                this.lastModified,
                this.lastModifedBy,
                this.url,
                this.name,
                this.description,
                this.teaser,
                this.showInProductList,
                this.enableRating,
                this.metaDescription,
                this.metaKeywords,
                this.sortRank1,
                this.sortRank2,
                this.teaserFile,
                this.teaserFileLink,
                this.compiledMeta,
                this.shippingAmount);

            bool result = (rowsAffected > 0);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #33
0
ファイル: Blog.cs プロジェクト: saiesh86/TravelBlog
        public bool Delete()
        {
            DBBlog.DeleteItemCategories(itemID);
            DBBlog.DeleteAllCommentsForBlog(itemID);
            DBBlog.UpdateCommentStats(this.moduleID);
            bool result = DBBlog.DeleteBlog(this.itemID);
            DBBlog.UpdateEntryStats(this.moduleID);

            ContentChangedEventArgs e = new ContentChangedEventArgs();
            e.IsDeleted = true;
            OnContentChanged(e);

            return result;
        }
コード例 #34
0
ファイル: Edit.aspx.cs プロジェクト: joedavis01/mojoportal
        //previous implementation with NeatUpload
        //private void btnUpload_Click(object sender, EventArgs e)
        //{
        //    SiteUser siteUser = SiteUtils.GetCurrentSiteUser();
        //    if (siteUser == null) return;
        //    SharedFile sharedFile = new SharedFile(this.moduleId, this.itemId);
        //    sharedFile.ContentChanged += new ContentChangedEventHandler(sharedFile_ContentChanged);
        //    if((sharedFile.ItemId > 0)&&(sharedFile.ModuleId == this.moduleId))
        //    {
        //            if (file1.HasFile && file1.FileName != null && file1.FileName.Trim().Length > 0)
        //            {
        //                if (config.EnableVersioning)
        //                {
        //                    bool historyCreated = SharedFilesHelper.CreateHistory(sharedFile, fileSystem, virtualSourcePath, virtualHistoryPath);
        //                    if (historyCreated)
        //                    {
        //                        sharedFile.ServerFileName = System.Guid.NewGuid().ToString() + ".config";
        //                    }
        //                }
        //                sharedFile.ModuleId = this.moduleId;
        //                if (sharedFile.ModuleGuid == Guid.Empty)
        //                {
        //                    Module m = GetModule(moduleId, SharedFile.FeatureGuid);
        //                    sharedFile.ModuleGuid = m.ModuleGuid;
        //                }
        //                sharedFile.OriginalFileName = file1.FileName;
        //                sharedFile.FriendlyName = Path.GetFileName(file1.FileName);
        //                sharedFile.SizeInKB = (int)(file1.ContentLength/1024);
        //                sharedFile.UploadUserId = siteUser.UserId;
        //                sharedFile.UploadDate = DateTime.UtcNow;
        //                if(sharedFile.Save())
        //                {
        //                    string destPath = virtualSourcePath + sharedFile.ServerFileName;
        //                    using (file1)
        //                    {
        //                        using (file1.FileContent)
        //                        {
        //                            fileSystem.SaveFile(destPath, file1.FileContent, file1.ContentType, true);
        //                        }
        //                    }
        //                }
        //            }
        //            CurrentPage.UpdateLastModifiedTime();
        //            CacheHelper.ClearModuleCache(moduleId);
        //            SiteUtils.QueueIndexing();
        //            WebUtils.SetupRedirect(this, Request.RawUrl);
        //    }
        //}
        void sharedFile_ContentChanged(object sender, ContentChangedEventArgs e)
        {
            IndexBuilderProvider indexBuilder = IndexBuilderManager.Providers["SharedFilesIndexBuilderProvider"];
            if (indexBuilder != null)
            {
                indexBuilder.ContentChangedHandler(sender, e);

                SiteUtils.QueueIndexing();
            }
        }
コード例 #35
0
        public bool Save(HtmlContent content)
        {
            bool result = false;
            if (content == null) { return result; }

            content.LastModUtc = DateTime.UtcNow;

            if (content.ItemId > -1)
            {
                result = DBHtmlContent.UpdateHtmlContent(
                content.ItemId,
                content.ModuleId,
                content.Title,
                content.Excerpt,
                content.Body,
                content.MoreLink,
                content.SortOrder,
                content.BeginDate,
                content.EndDate,
                content.LastModUtc,
                content.LastModUserGuid,
                content.ExcludeFromRecentContent);

            }
            else
            {
                content.ItemGuid = Guid.NewGuid();

                int newId = DBHtmlContent.AddHtmlContent(
                    content.ItemGuid,
                    content.ModuleGuid,
                    content.ModuleId,
                    content.Title,
                    content.Excerpt,
                    content.Body,
                    content.MoreLink,
                    content.SortOrder,
                    content.BeginDate,
                    content.EndDate,
                    content.CreatedDate,
                    content.CreatedBy,
                    content.UserGuid,
                    content.ExcludeFromRecentContent);

                content.ItemId = newId;

                result = (newId > -1);

            }

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                content.OnContentChanged(e);
            }

            return result;
        }
コード例 #36
0
ファイル: HtmlContent.cs プロジェクト: joedavis01/mojoportal
        public bool Delete()
        {
            bool result = DBHtmlContent.DeleteHtmlContent(this.itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return result;
        }
コード例 #37
0
ファイル: HtmlContent.cs プロジェクト: joedavis01/mojoportal
        /// <summary>
        /// Creates this instance.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = -1;
            this.itemGuid = Guid.NewGuid();

            newID = DBHtmlContent.AddHtmlContent(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.excerpt,
                this.body,
                this.moreLink,
                this.sortOrder,
                this.beginDate,
                this.endDate,
                this.createdDate,
                this.createdBy,
                this.userGuid,
                this.excludeFromRecentContent);

            this.itemID = newID;

            bool result = (newID > -1);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #38
0
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;

            bool result = DBEvents.UpdateCalendarEvent(
                this.itemID,
                this.moduleID,
                this.title,
                this.description,
                this.imageName,
                this.eventDate,
                this.startTime,
                this.endTime,
                this.location,
                this.requiresTicket,
                this.ticketPrice,
                this.lastModUtc,
                this.lastModUserGuid);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #39
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (offerGuid != Guid.Empty)
            {
                if (config.IndexOffersInSearch)
                {
                    Offer offer = new Offer(offerGuid);

                    if (WebConfigSettings.LogIpAddressForContentDeletions)
                    {
                        log.Info("user deleted offer " + offer.Name + " from ip address " + SiteUtils.GetIP4Address());

                    }

                    ContentChangedEventArgs args = new ContentChangedEventArgs();
                    args.IsDeleted = true;
                    offer_ContentChanged(offer, args);
                }

                FriendlyUrl.DeleteByPageGuid(offerGuid);

                Offer.Delete(
                    offerGuid,
                    siteUser.UserGuid,
                    SiteUtils.GetIP4Address());

                SiteUtils.QueueIndexing();
                WebUtils.SetupRedirect(this, GetReturnUrl());
            }
        }
コード例 #40
0
ファイル: SharedFile.cs プロジェクト: saiesh86/TravelBlog
        public bool Delete()
        {
            bool result = false;

            if (itemID == -1) { return result; }
            SharedFile sharedFile = new SharedFile(moduleID, itemID);

            DBSharedFiles.DeleteHistoryByItemID(itemID);
            // this just deletes the entry from the db
            result =  DBSharedFiles.DeleteSharedFile(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return result;
        }
コード例 #41
0
 void html_ContentChanged(object sender, ContentChangedEventArgs e)
 {
     IndexBuilderProvider indexBuilder = IndexBuilderManager.Providers["HtmlContentIndexBuilderProvider"];
     if (indexBuilder != null)
     {
         indexBuilder.ContentChangedHandler(sender, e);
     }
 }
コード例 #42
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            Product p = new Product(productGuid);

            if (WebConfigSettings.LogIpAddressForContentDeletions)
            {
                log.Info("user deleted product " + p.Name + " from ip address " + SiteUtils.GetIP4Address());

            }

            FriendlyUrl.DeleteByPageGuid(p.Guid);

            ContentChangedEventArgs args = new ContentChangedEventArgs();
            args.IsDeleted = true;
            product_ContentChanged(p, args);

            Product.Delete(
                productGuid,
                siteUser.UserGuid,
                SiteUtils.GetIP4Address());

            SiteUtils.QueueIndexing();
            WebUtils.SetupRedirect(this, GetReturnUrl());
        }
コード例 #43
0
ファイル: SharedFile.cs プロジェクト: saiesh86/TravelBlog
        private bool Create()
        {
            int newID = 0;
            if(this.serverFileName.Length == 0)
            {
                this.serverFileName = System.Guid.NewGuid().ToString() + ".config";
            }

            this.itemGuid = Guid.NewGuid();

            newID = DBSharedFiles.AddSharedFile(
                this.itemGuid,
                this.moduleGuid,
                this.userGuid,
                this.folderGuid,
                this.moduleID,
                this.uploadUserID,
                this.friendlyName,
                this.originalFileName,
                this.serverFileName,
                this.sizeInKB,
                this.uploadDate,
                this.folderID,
                this.description);

            this.itemID = newID;

            bool result = (newID > 0);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #44
0
        private bool Create()
        {
            int newID;

            this.itemGuid = Guid.NewGuid();
            this.createdDate = DateTime.UtcNow;

            newID = DBEvents.AddCalendarEvent(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.description,
                this.imageName,
                this.eventDate,
                this.startTime,
                this.endTime,
                this.userID,
                this.userGuid,
                this.location,
                this.requiresTicket,
                this.ticketPrice,
                this.createdDate);

            this.itemID = newID;

            bool result = (newID > -1);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #45
0
ファイル: Blog.cs プロジェクト: saiesh86/TravelBlog
        /// <summary>
        /// Updates this instance.
        /// </summary>
        /// <returns></returns>
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;
            if ((approved)&&(approvedDate == DateTime.MaxValue)) { approvedDate = DateTime.UtcNow; }

            bool result = DBBlog.UpdateBlog(
                this.moduleID,
                this.itemID,
                this.userName,
                this.title,
                this.excerpt,
                this.description,
                this.startDate,
                this.isInNewsletter,
                this.includeInFeed,
                this.allowCommentsForDays,
                this.location,
                this.lastModUserGuid,
                this.lastModUtc,
                this.itemUrl,
                this.metaKeywords,
                this.metaDescription,
                this.compiledMeta,
                this.isPublished,
                this.subTitle,
                this.endDate,
                this.approved,
                this.approvedBy,
                this.approvedDate,
                this.showAuthorName,
                this.showAuthorAvatar,
                this.showAuthorBio,
                this.includeInSearch,
                this.useBingMap,
                this.mapHeight,
                this.MapWidth,
                this.showMapOptions,
                this.showZoomTool,
                this.showLocationInfo,
                this.useDrivingDirections,
                this.mapType,
                this.mapZoom,
                this.showDownloadLink,
                this.includeInSiteMap,
                this.excludeFromRecentContent,
                this.includeInNews,
                this.pubName,
                this.pubLanguage,
                this.pubAccess,
                this.pubGenres,
                this.pubKeyWords,
                this.pubGeoLocations,
                this.pubStockTickers,
                this.headlineImageUrl,
                this.includeImageInExcerpt);

            //IndexHelper.IndexItem(this);
            ContentChangedEventArgs e = new ContentChangedEventArgs();
            OnContentChanged(e);

            return result;
        }
コード例 #46
0
        public override void ContentChangedHandler(
            object sender,
            ContentChangedEventArgs e)
        {
            if (WebConfigSettings.DisableSearchIndex) { return; }
            if (sender == null) return;
            if (!(sender is ForumThread)) return;

            ForumThread forumThread = (ForumThread)sender;
            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
            forumThread.SiteId = siteSettings.SiteId;
            forumThread.SearchIndexPath = mojoPortal.SearchIndex.IndexHelper.GetSearchIndexPath(siteSettings.SiteId);

            if (e.IsDeleted)
            {
                if (ThreadPool.QueueUserWorkItem(new WaitCallback(RemoveForumIndexItem), forumThread))
                {
                    if (debugLog) log.Debug("ForumThreadIndexBuilderProvider.RemoveForumIndexItem queued");
                }
                else
                {
                    log.Error("Failed to queue a thread for ForumThreadIndexBuilderProvider.RemoveForumIndexItem");
                }

                //RemoveForumIndexItem(forumThread);
            }
            else
            {
                if (ThreadPool.QueueUserWorkItem(new WaitCallback(IndexItem), forumThread))
                {
                    if (debugLog) log.Debug("ForumThreadIndexBuilderProvider.IndexItem queued");
                }
                else
                {
                    log.Error("Failed to queue a thread for ForumThreadIndexBuilderProvider.IndexItem");
                }

                //IndexItem(forumThread);
            }
        }
コード例 #47
0
 public override void ContentChangedHandler(
     object sender,
     ContentChangedEventArgs e)
 {
     // Do nothing
 }
コード例 #48
0
ファイル: Product.cs プロジェクト: joedavis01/mojoportal
        private bool Update()
        {
            Product product = new Product(this.guid);
            DBProduct.AddHistory(
                Guid.NewGuid(),
                product.Guid,
                product.StoreGuid,
                product.TaxClassGuid,
                string.Empty,
                ConvertProductStatusToByte(product.Status),
                ConvertFulfillmentTypeToByte(product.FulfillmentType),
                product.Weight,
                product.QuantityOnHand,
                product.ImageFileName,
                product.ImageFileBytes,
                product.Created,
                product.CreatedBy,
                product.LastModified,
                product.LastModifedBy,
                DateTime.UtcNow,
                product.shippingAmount);

            bool result = DBProduct.Update(
                this.guid,
                this.taxClassGuid,
                this.modelNumber,
                this.status,
                this.fulfillmentType,
                this.weight,
                this.quantityOnHand,
                this.imageFileName,
                this.imageFileBytes,
                this.lastModified,
                this.lastModifedBy,
                this.url,
                this.name,
                this.description,
                this.teaser,
                this.showInProductList,
                this.enableRating,
                this.metaDescription,
                this.metaKeywords,
                this.sortRank1,
                this.sortRank2,
                this.teaserFile,
                this.teaserFileLink,
                this.compiledMeta,
                this.shippingAmount);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #49
0
ファイル: HtmlContent.cs プロジェクト: joedavis01/mojoportal
 public void OnContentChanged(ContentChangedEventArgs e)
 {
     if (ContentChanged != null)
     {
         ContentChanged(this, e);
     }
 }
コード例 #50
0
ファイル: EditPost.aspx.cs プロジェクト: saiesh86/TravelBlog
 void thread_ContentChanged(object sender, ContentChangedEventArgs e)
 {
     IndexBuilderProvider indexBuilder = IndexBuilderManager.Providers["ForumThreadIndexBuilderProvider"];
     if (indexBuilder != null)
     {
         indexBuilder.ContentChangedHandler(sender, e);
     }
 }
コード例 #51
0
ファイル: HtmlContent.cs プロジェクト: joedavis01/mojoportal
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;

            bool result = DBHtmlContent.UpdateHtmlContent(
                this.itemID,
                this.moduleID,
                this.title,
                this.excerpt,
                this.body,
                this.moreLink,
                this.sortOrder,
                this.beginDate,
                this.endDate,
                this.lastModUtc,
                this.lastModUserGuid,
                this.excludeFromRecentContent);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #52
0
ファイル: SharedFile.cs プロジェクト: saiesh86/TravelBlog
        private bool Update()
        {
            bool result = DBSharedFiles.UpdateSharedFile(
                this.itemID,
                this.moduleID,
                this.uploadUserID,
                this.friendlyName,
                this.originalFileName,
                this.serverFileName,
                this.sizeInKB,
                this.uploadDate,
                this.folderID,
                this.folderGuid,
                this.userGuid,
                this.description);

            //IndexHelper.IndexItem(this);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return result;
        }
コード例 #53
0
 void product_ContentChanged(object sender, ContentChangedEventArgs e)
 {
     IndexBuilderProvider indexBuilder = IndexBuilderManager.Providers["WebStoreProductIndexBuilderProvider"];
     if (indexBuilder != null)
     {
         indexBuilder.ContentChangedHandler(sender, e);
     }
 }
コード例 #54
0
 protected void OnContentChanged(ContentChangedEventArgs e)
 {
     ContentChanged?.Invoke(this, e);
 }