public int Syndicate(ManagedSecurityContext sec) { GetACL().Check(sec, DataOperation.Update); AccountFeed feed = GetSyndicatedFeed(); if (feed == null) { feed = new AccountFeed(); feed.Account = mInstance.Account; feed.Created = feed.Updated = DateTime.UtcNow; feed.UpdateFrequency = 12; feed.PublishImgs = true; feed.Publish = true; feed.Hidden = true; feed.FeedUrl = FeedUrl; feed.LinkUrl = LinkUrl; feed.FeedType = ManagedFeedType.GetDefaultFeedType(Session); } else { feed.Updated = DateTime.UtcNow; } feed.Name = mInstance.Name; feed.Description = mInstance.Description; Session.Save(feed); return(feed.Id); }
public override AccountFeed GetInstance(ISession session, ManagedSecurityContext sec) { AccountFeed instance = base.GetInstance(session, sec); if (Id == 0) { instance.Account = GetOwner(session, AccountId, sec); } instance.Name = this.Name; instance.Description = this.Description; instance.LastError = this.LastError; instance.Username = this.Username; instance.Password = this.Password; instance.UpdateFrequency = this.UpdateFrequency; instance.FeedUrl = this.FeedUrl; instance.LinkUrl = this.LinkUrl; instance.Publish = this.Publish; instance.PublishImgs = this.PublishImgs; instance.PublishMedia = this.PublishMedia; instance.Hidden = this.Hidden; if (!string.IsNullOrEmpty(this.FeedType)) { instance.FeedType = ManagedFeedType.Find(session, this.FeedType); } return(instance); }