Ejemplo n.º 1
0
 public override void ValidateLinks(LinksValidationResult result)
 {
     foreach (var link in Links)
     {
         if (link.LinkType == "internal")
         {
             if (link.TargetItem != null || !string.IsNullOrEmpty(link.Url))
             {
                 Item targetItem = link.TargetItem;
                 if (targetItem != null)
                 {
                     result.AddValidLink(targetItem, link.InternalPath);
                 }
                 else
                 {
                     result.AddBrokenLink(link.InternalPath);
                 }
             }
         }
         else if (link.LinkType == "media" && (link.TargetItem != null || !string.IsNullOrEmpty(link.MediaPath)))
         {
             var targetItem2 = link.TargetItem;
             if (targetItem2 != null)
             {
                 result.AddValidLink(targetItem2, link.MediaPath);
             }
             else
             {
                 result.AddBrokenLink(link.MediaPath);
             }
         }
     }
 }
        public override void ValidateLinks(LinksValidationResult result)
        {
            Database database = this.GetDatabase();
            if (database != null)
            {
                string[] items = base.Items;
                for (int i = 0; i < (int)items.Length; i++)
                {
                    string str = items[i];
                    if (ID.IsID(str))
                    {
                        ID d = ID.Parse(str);
                        if (!ItemUtil.IsNull(d) && !d.IsNull)
                        {
                            Item item = database.GetItem(d);
                            if (item == null)
                            {
                                result.AddBrokenLink(str);
                            }
                            else
                            {
                                result.AddValidLink(item, item.Paths.FullPath);
                            }
                        }
                    }
                }

            }
        }
Ejemplo n.º 3
0
 public override void ValidateLinks(LinksValidationResult result)
 {
     foreach (string targetPath in CampaignIds)
     {
         CampaignItem campaignItem = null;
         ID           result1;
         if (ID.TryParse(targetPath, out result1))
         {
             campaignItem = Analytics.Tracker.DefinitionItems.Campaigns[result1];
         }
         if (campaignItem == null)
         {
             result.AddBrokenLink(targetPath);
         }
         else
         {
             result.AddValidLink(campaignItem.InnerItem, campaignItem.InnerItem.Paths.Path);
         }
     }
     foreach (PageEventData pageEventData in Events)
     {
         PageEventItem pageEventItem = null;
         if (pageEventData.PageEventDefinitionId != Guid.Empty)
         {
             pageEventItem = Analytics.Tracker.DefinitionItems.Goals[pageEventData.PageEventDefinitionId] ?? Analytics.Tracker.DefinitionItems.PageEvents[pageEventData.PageEventDefinitionId];
         }
         if (pageEventItem == null && pageEventData.Name != null)
         {
             pageEventItem = Analytics.Tracker.DefinitionItems.Goals[pageEventData.Name] ?? Analytics.Tracker.DefinitionItems.PageEvents[pageEventData.Name];
         }
         if (pageEventItem == null)
         {
             result.AddBrokenLink(FileUtil.MakePath(Analytics.Tracker.DefinitionItems.Goals.Path, pageEventData.Name, '/'));
         }
         else
         {
             result.AddValidLink(pageEventItem.InnerItem, pageEventItem.InnerItem.Paths.Path);
         }
     }
     foreach (ContentProfile contentProfile in Profiles.Where(p => p.SaveToField))
     {
         result.AddValidLink(contentProfile.Definition.InnerItem, contentProfile.Definition.InnerItem.Paths.Path);
     }
 }
Ejemplo n.º 4
0
 /// <summary>Validates the links.</summary>
 /// <param name="result">The result.</param>
 /// <contract>
 ///   <requires name="result" condition="not null" />
 /// </contract>
 public override void ValidateLinks(LinksValidationResult result)
 {
     Assert.ArgumentNotNull((object)result, "result");
     if (this.MediaItem != null)
     {
         result.AddValidLink(this.MediaItem, this.MediaItem.Paths.FullPath);
     }
     else
     {
         if (this.MediaID.IsNull)
         {
             return;
         }
         result.AddBrokenLink(this.MediaID.ToString());
     }
 }
Ejemplo n.º 5
0
        public override void ValidateLinks(LinksValidationResult result)
        {
            if (!this.IsInternal)
            {
                return;
            }

            if (this.TargetID.IsNull && string.IsNullOrEmpty(this.InternalPath))
            {
                return;
            }

            Item targetItem = this.TargetItem;

            if (targetItem != null)
            {
                result.AddValidLink(targetItem, this.InternalPath);
            }
            else
            {
                result.AddBrokenLink(this.InternalPath);
            }
        }