public static WeightedTagList AddUserStoryTags(string tagString, User user, int storyID, int hostID) { WeightedTagList tags = GetOrInsertTags(tagString, user.IsAdministrator); StoryUserHostTagCollection storyUserHostTags = new StoryUserHostTagCollection(); foreach (WeightedTag tag in tags) { StoryUserHostTag storyUserHostTag = new StoryUserHostTag(); //TODO: GJ: move to WeightedTag.ToStoryUserHostTag() storyUserHostTag.StoryID = storyID; storyUserHostTag.HostID = hostID; storyUserHostTag.UserID = user.UserID; storyUserHostTag.TagID = tag.TagID; storyUserHostTags.Add(storyUserHostTag); StoryCache.ClearUserTaggedStories(tag.TagName, user.UserID, storyID); } storyUserHostTags.BatchSave(); UserAction.RecordTag(hostID, user, Story.FetchByID(storyID), tags); //when a user adds a tag, we need to mark the story as updated //so update the index during the incremental crawl Story story = Story.FetchByID(storyID); story.UpdatedOn = DateTime.Now; story.Save(); return(tags); }
public StoryUserHostTagCollection FetchAll() { StoryUserHostTagCollection coll = new StoryUserHostTagCollection(); Query qry = new Query(StoryUserHostTag.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public static WeightedTagList AddUserStoryTags(string tagString, User user, int storyID, int hostID) { WeightedTagList tags = GetOrInsertTags(tagString, user.IsAdministrator); StoryUserHostTagCollection storyUserHostTags = new StoryUserHostTagCollection(); foreach (WeightedTag tag in tags) { StoryUserHostTag storyUserHostTag = new StoryUserHostTag(); //TODO: GJ: move to WeightedTag.ToStoryUserHostTag() storyUserHostTag.StoryID = storyID; storyUserHostTag.HostID = hostID; storyUserHostTag.UserID = user.UserID; storyUserHostTag.TagID = tag.TagID; storyUserHostTags.Add(storyUserHostTag); StoryCache.ClearUserTaggedStories(tag.TagName, user.UserID, storyID); } storyUserHostTags.BatchSave(); UserAction.RecordTag(hostID, user, Story.FetchByID(storyID), tags); //when a user adds a tag, we need to mark the story as updated //so update the index during the incremental crawl Story story = Story.FetchByID(storyID); story.UpdatedOn = DateTime.Now; story.Save(); return tags; }
public StoryUserHostTagCollection FetchByQuery(Query qry) { StoryUserHostTagCollection coll = new StoryUserHostTagCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public StoryUserHostTagCollection FetchByID(object StoryUserHostTagID) { StoryUserHostTagCollection coll = new StoryUserHostTagCollection().Where("StoryUserHostTagID", StoryUserHostTagID).Load(); return coll; }