public string Rebase(string value, string fromAppPath, string toAppPath)
        {
            //The value being passed in is the raw JSON value stored for the property
            //We need to identify all links that need to be rebased
            LinkItemCollection coll = LinkItemCollection.Empty;

            if (LinkItemCollection.TryParse(value, out coll))
            {
                foreach (LinkItemBase item in coll)
                {
                    item.RebaseLinkItem(fromAppPath, toAppPath);
                }
            }

            return(coll.ToJSONString());
        }
Exemplo n.º 2
0
        public override IList <ContentDetail> FindLinks(string html)
        {
            //Looks like when a page is SAVED, this gets called - database records are deleted to track links
            //These records are scanned when a page is being deleted to detect conflicts
            //Obviously a more effecient way of doing things as opposed to scanning the whole site for dependencies at once!
            List <ContentDetail> links = base.FindLinks(html).ToList();

            if (links.Count == 0)
            {
                //No links found - might be dealing with a LinkItemCollection in which case we have a JSON string
                if (LinkItemCollection.TryParse(html, out LinkItemCollection linkCollection))
                {
                    links = links.Concat(linkCollection.OfType <LinkItem>().Select(x => ContentDetail.Multi(LinkDetailName, false, 0, null, null, x.Url))).ToList();
                }
            }

            return(links);
        }