Example #1
0
        protected override void UpdateItemVersionLinks(Item item, ItemLink[] links)
        {
            Assert.ArgumentNotNull((object)item, "item");
            Assert.ArgumentNotNull((object)links, "links");

            foreach (var itemLink in links)
            {
                LinkedDataManager.AddLink(item, itemLink);
            }

            //Now remove removed links
            var oldLinks    = GetReferences(item);
            var removeLinks = new List <ItemLink>();

            foreach (var link in oldLinks)
            {
                if (!links.ToList().Where(x => x.TargetItemID.Guid == link.TargetItemID.Guid).Any())
                {
                    removeLinks.Add(link);
                }
            }

            foreach (var removeLink in removeLinks)
            {
                LinkedDataManager.RemoveLinksForItem(item, removeLink);
            }
        }
Example #2
0
        protected override void UpdateLinks(Item item, ItemLink[] links)
        {
            Assert.ArgumentNotNull((object)item, "item");
            Assert.ArgumentNotNull((object)links, "links");

            foreach (var itemLink in links)
            {
                LinkedDataManager.AddLink(item, itemLink);
            }
        }
Example #3
0
        protected virtual void AddLink(Item item, ItemLink link)
        {
            Assert.ArgumentNotNull((object)item, "item");
            Assert.ArgumentNotNull((object)link, "link");

            lock (this.locks.GetLock((object)"rdflock"))
            {
                LinkedDataManager.AddLink(item, link);
            }
        }