private IEnumerable <SiteLocalizationData> GetChildPublicationDetails(Publication master, string siteId, bool masterAdded) { List <SiteLocalizationData> pubs = new List <SiteLocalizationData>(); UsingItemsFilter filter = new UsingItemsFilter(Session) { ItemTypes = new List <ItemType> { ItemType.Publication } }; foreach (XmlElement item in master.GetListUsingItems(filter).ChildNodes) { string id = item.GetAttribute("ID"); Publication child = (Publication)Engine.GetObject(id); string childSiteId = GetSiteIdFromPublication(child); if (childSiteId == siteId) { Logger.Debug(String.Format("Found valid descendent {0} with site ID {1} ", child.Title, childSiteId)); bool isMaster = !masterAdded && IsMasterWebPublication(child); pubs.Add(GetPublicationDetails(child, isMaster)); masterAdded = masterAdded || isMaster; } else { Logger.Debug(String.Format("Descendent {0} has invalid site ID {1} - ignoring ", child.Title, childSiteId)); } } return(pubs); }
private IEnumerable<PublicationDetails> GetChildPublicationDetails(Publication master, string siteId, bool masterAdded) { List<PublicationDetails> pubs = new List<PublicationDetails>(); UsingItemsFilter filter = new UsingItemsFilter(Engine.GetSession()) { ItemTypes = new List<ItemType> { ItemType.Publication } }; foreach (XmlElement item in master.GetListUsingItems(filter).ChildNodes) { string id = item.GetAttribute("ID"); Publication child = (Publication)Engine.GetObject(id); string childSiteId = GetSiteIdFromPublication(child); if (childSiteId == siteId) { Logger.Debug(String.Format("Found valid descendent {0} with site ID {1} ", child.Title, childSiteId)); bool isMaster = !masterAdded && IsMasterWebPublication(child); pubs.Add(GetPublicationDetails(child, isMaster)); masterAdded = masterAdded || isMaster; } else { Logger.Debug(String.Format("Descendent {0} has invalid site ID {1} - ignoring ",child.Title,childSiteId)); } } return pubs; }