private static Tuple<string, List<Category>, List<MediaContent>> getLinkToContentTuple(LinkToContent linkTo) { List<MediaContent> mediaContents = new List<MediaContent>(); if(linkTo.ImageData != null) mediaContents.Add(linkTo.ImageData); return new Tuple<string, List<Category>, List<MediaContent>>(linkTo.RelativeLocation, linkTo.Categories != null ? linkTo.Categories.CollectionContent : new List<Category>(), mediaContents); }
internal static void Update_LinkToContent_Locations(LinkToContent linkToContent, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { // TODO: Remove objects, that are no longer available in master }
internal static RenderedNode getNodeFromLinkToContent(LinkToContent linkToContent) { RenderedNode node = RenderedNode.CreateDefault(); node.TechnicalSource = NodeSourceTypeLinkToContent; node.Title = linkToContent.Title; node.Excerpt = linkToContent.Description; if (linkToContent.ImageData != null) { node.ImageBaseUrl = linkToContent.ImageData.ContentUrlBase; node.ImageExt = linkToContent.ImageData.AdditionalFormatFileExt; } node.ActualContentUrl = linkToContent.URL; if (linkToContent.Categories != null) { node.Categories.CollectionContent.AddRange(getCategoryCollectionTexts(linkToContent.Categories, getTitleOrNameFromCategory)); node.CategoryNames.CollectionContent.AddRange(getCategoryCollectionTexts(linkToContent.Categories, cat => cat.CategoryName)); node.CategoryIDList = linkToContent.Categories.SelectedIDCommaSeparated; } if (linkToContent.Locations != null) node.Locations.CollectionContent.AddRange(getLocationCollectionTexts(linkToContent.Locations)); return node; }
internal static void Update_LinkToContent_Categories(LinkToContent linkToContent, CategoryCollection localCollection, CategoryCollection masterCollection) { // TODO: Remove objects, that are no longer available in master }
private static CloudBlob processLinkToContent(LinkToContent linkToContent, string targetContentRootLocation, Dictionary<string, string> categoryMap, CategoryCollection targetCategoryCollection, string processID) { var owner = InformationContext.CurrentOwner; var sourceCategories = linkToContent.Categories; var targetItemCategories = GetTargetItemCategories(sourceCategories, targetCategoryCollection, categoryMap); linkToContent.Categories = targetItemCategories; linkToContent.RelativeLocation = StorageSupport.GetOwnerContentLocation(owner, string.Format("{0}AaltoGlobalImpact.OIP/LinkToContent/{1}", targetContentRootLocation, linkToContent.ID)); linkToContent.GeneratedByProcessID = processID; if (linkToContent.ImageData != null) { linkToContent.ImageData.FixCurrentOwnerLocation(); } if (linkToContent.Locations != null) linkToContent.Locations.CollectionContent.ForEach(location => location.FixCurrentOwnerLocation()); var storedBlob = linkToContent.StoreInformationMasterFirst(owner, true, overwriteIfExists: true); return storedBlob; }