private static Tuple<string, List<Category>, List<MediaContent>> getBinaryFileTuple(BinaryFile binaryFile)
 {
     List<MediaContent> mediaContents = new List<MediaContent>();
     if(binaryFile.Data != null)
         mediaContents.Add(binaryFile.Data);
     return new Tuple<string, List<Category>, List<MediaContent>>(binaryFile.RelativeLocation, binaryFile.Categories != null ?
         binaryFile.Categories.CollectionContent : new List<Category>(), mediaContents);
 }
Example #2
0
 private static CloudBlob processBinaryContent(BinaryFile binary, string targetContentRootLocation, Dictionary<string, string> categoryMap, CategoryCollection targetCategoryCollection, string processID)
 {
     var owner = InformationContext.CurrentOwner;
     var sourceCategories = binary.Categories;
     var targetItemCategories = GetTargetItemCategories(sourceCategories, targetCategoryCollection, categoryMap);
     binary.Categories = targetItemCategories;
     binary.RelativeLocation = StorageSupport.GetOwnerContentLocation(owner,
                                                                           string.Format("{0}AaltoGlobalImpact.OIP/BinaryFile/{1}", targetContentRootLocation, binary.ID));
     binary.GeneratedByProcessID = processID;
     if (binary.Data != null)
     {
         binary.Data.FixCurrentOwnerLocation();
     }
     var storedBlob = binary.StoreInformationMasterFirst(owner, true, overwriteIfExists: true);
     return storedBlob;
 }