/// <summary> /// Retrieve the <paramref name="queries"/> and populate the <paramref name="mutableObjects"/> /// </summary> /// <param name="retrievalManager"> /// The retrieval manager. /// </param> /// <param name="mutableObjects"> /// The mutable objects. /// </param> /// <param name="queries"> /// The structure queries /// </param> /// <param name="returnLatest"> /// Set to <c>true</c> to retrieve the latest; otherwise set to <c>false</c> to retrieve all versions /// </param> /// <param name="returnStub"> /// Set to <c>true</c> to retrieve artefacts as stubs; otherwise set to <c>false</c> to retrieve full artefacts. /// </param> /// <param name="allowedDataflows"> /// The allowed dataflows. /// </param> /// <param name="crossReferenceMutableRetrievalManager"> /// The cross-reference manager /// </param> protected override void PopulateMutables(IAuthAdvancedSdmxMutableObjectRetrievalManager retrievalManager, IMutableObjects mutableObjects, IList<IStructureReference> queries, bool returnLatest, StructureQueryDetailEnumType returnStub, IList<IMaintainableRefObject> allowedDataflows, IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager) { var dataflowLessQueries = new List<IStructureReference>(); var dataflowQueries = new List<IStructureReference>(); foreach (var query in queries) { if (query.MaintainableStructureEnumType.EnumType == SdmxStructureEnumType.Dataflow) { dataflowQueries.Add(query); } else { dataflowLessQueries.Add(query); } } base.PopulateMutables(retrievalManager, mutableObjects, dataflowLessQueries, returnLatest, returnStub, allowedDataflows, crossReferenceMutableRetrievalManager); // get the latest for dataflows to emulate the intermediate SR behavior. base.PopulateMutables(retrievalManager, mutableObjects, dataflowQueries, true, returnStub, allowedDataflows, crossReferenceMutableRetrievalManager); if (queries.NeedsCategorisation()) { _log.Info("SDMX v2.0 structure search manager used. Trying to retrieve categorisations all dataflows and categorisations."); IMutableObjects objects = new MutableObjectsImpl(mutableObjects.Dataflows); objects.AddIdentifiables(mutableObjects.CategorySchemes); // get categorisations IResolverFactory factory = new ResolverFactory(); var resolver = factory.GetResolver(StructureReferenceDetail.GetFromEnum(StructureReferenceDetailEnumType.Parents), crossReferenceMutableRetrievalManager); resolver.ResolveReferences(objects, returnStub == StructureQueryDetailEnumType.AllStubs, allowedDataflows); // add them to mutable objects mutableObjects.AddIdentifiables(objects.Categorisations); } }