Пример #1
0
        /// <summary>
        /// Resolve children of the specified <paramref name="mutableObjects"/> using the specified parameters
        /// </summary>
        /// <param name="mutableObjects">
        /// The mutable objects.
        /// </param>
        /// <param name="returnStub">
        /// Set to true to return only stubs.
        /// </param>
        /// <param name="crossReferenceMutableRetrievalManager">
        /// The cross reference mutable retrieval engine
        /// </param>
        /// <param name="allowedDataflows">
        /// The allowed Dataflows.
        /// </param>
        private static void ResolveChildren(
            IMutableObjects mutableObjects, 
            bool returnStub, 
            IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager, 
            IList<IMaintainableRefObject> allowedDataflows)
        {
            Func<IMaintainableMutableObject, IList<IMaintainableMutableObject>> reference =
                maintainableMutableObject => crossReferenceMutableRetrievalManager.GetCrossReferencedStructures(maintainableMutableObject, returnStub, allowedDataflows);

            Resolve(mutableObjects, reference);
        }
 /// <summary>
 /// Retrieve the structures referenced by <paramref name="structureQuery" /> and populate the
 /// <paramref name="mutableObjects" />
 /// </summary>
 /// <param name="retrievalManager">The retrieval manager.</param>
 /// <param name="mutableObjects">The mutable objects.</param>
 /// <param name="structureQuery">The structure query.</param>
 /// <param name="allowedDataflows">The allowed Dataflows.</param>
 /// <param name="crossReferenceMutableRetrievalManager">The cross reference mutable retrieval manager.</param>
 protected virtual void PopulateMutables(
     IAuthAdvancedSdmxMutableObjectRetrievalManager retrievalManager,
     IMutableObjects mutableObjects,
     IComplexStructureQuery structureQuery,
     IList<IMaintainableRefObject> allowedDataflows,
     IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager)
 {
     //// changes here might also apply to AuthMutableStructureSearchManagerBase and/or AuthStructureRetrieverV21 
     var complexStructureQueryDetail = structureQuery.StructureQueryMetadata != null ? structureQuery.StructureQueryMetadata.StructureQueryDetail : ComplexStructureQueryDetail.GetFromEnum(ComplexStructureQueryDetailEnumType.Full);
     mutableObjects.AddIdentifiables(retrievalManager.GetMutableMaintainables(structureQuery.StructureReference, complexStructureQueryDetail, allowedDataflows));
 }
        /// <summary>
        /// Resolve parents of the specified <paramref name="mutableObjects"/> using the specified
        /// </summary>
        /// <param name="mutableObjects">
        /// The mutable objects.
        /// </param>
        /// <param name="returnStub">
        /// The return Stub.
        /// </param>
        /// <param name="crossReferenceMutableRetrievalManager">
        /// The cross Reference Mutable Retrieval Manager.
        /// </param>
        /// <param name="allowedDataflow">
        /// The allowed Dataflow.
        /// </param>
        internal static void ResolveParentsAndSiblings(
            IMutableObjects mutableObjects, 
            bool returnStub, 
            IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager, 
            IList<IMaintainableRefObject> allowedDataflow)
        {
            Func<IMaintainableMutableObject, IList<IMaintainableMutableObject>> reference =
                maintainableMutableObject => GetParentsAndSiblingsReference(returnStub, crossReferenceMutableRetrievalManager, allowedDataflow, maintainableMutableObject);

            Resolve(mutableObjects, reference);
        }
Пример #4
0
        /// <summary>
        /// Resolve parents of the specified <paramref name="mutableObjects"/> using the specified
        /// </summary>
        /// <param name="mutableObjects">
        /// The mutable objects.
        /// </param>
        /// <param name="returnStub">
        /// The return Stub.
        /// </param>
        /// <param name="crossReferenceMutableRetrievalManager">
        /// The cross Reference Mutable Retrieval Manager.
        /// </param>
        /// <param name="allowedDataflow">
        /// The allowed Dataflow.
        /// </param>
        internal static void ResolveParents(
            IMutableObjects mutableObjects, 
            bool returnStub, 
            IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager, 
            IList<IMaintainableRefObject> allowedDataflow)
        {
            Func<IMaintainableMutableObject, IList<IMaintainableMutableObject>> reference =
                maintainableMutableObject => crossReferenceMutableRetrievalManager.GetCrossReferencingStructures(maintainableMutableObject, returnStub, allowedDataflow);

            Resolve(mutableObjects, reference);
        }
        /// <summary>
        /// Handles the Structure top level elements
        ///     This includes Concept Scheme
        /// </summary>
        /// <param name="parent">
        ///     The parent <see cref="IMutableObjects"/>
        /// </param>
        /// <param name="localName">
        ///     The name of the current xml element
        /// </param>
        protected override ElementActions HandleTopLevel(IMutableObjects parent, object localName)
        {
            ElementActions actions = null;
            if (NameTableCache.IsElement(localName, ElementNameTable.ConceptScheme))
            {
                var cs = new ConceptSchemeMutableCore();
                ParseAttributes(cs, this.Attributes);
                parent.AddConceptScheme(cs);
                actions = this.AddNameableAction(cs, this.HandleChildElements);
            }

            return actions;
        }
        /// <summary>
        /// Handles the Structure top level elements
        ///     This includes Codelist
        /// </summary>
        /// <param name="parent">
        /// The parent <see cref="IMutableObjects"/>
        /// </param>
        /// <param name="localName">
        /// The name of the current xml element
        /// </param>
        /// <returns>
        /// The <see cref="StructureReaderBaseV20.ElementActions"/>.
        /// </returns>
        protected override ElementActions HandleTopLevel(IMutableObjects parent, object localName)
        {
            ElementActions actions = null;
            if (NameTableCache.IsElement(localName, ElementNameTable.CodeList))
            {
                ICodelistMutableObject codelist = new CodelistMutableCore();
                ParseAttributes(codelist, this.Attributes);
                parent.AddCodelist(codelist);
                actions = this.AddNameableAction(codelist, this.HandleChildElements);
            }

            return actions;
        }
        /// <summary>
        /// Handle top level elements.
        /// </summary>
        /// <param name="parent">
        /// The parent.
        /// </param>
        /// <param name="localName">
        /// The local name.
        /// </param>
        /// <returns>
        /// The <see cref="StructureReaderBaseV20.ElementActions"/>.
        /// </returns>
        protected override ElementActions HandleTopLevel(IMutableObjects parent, object localName)
        {
            ElementActions actions = null;
            if (NameTableCache.IsElement(localName, ElementNameTable.MetadataStructureDefinition))
            {
                var codelist = new MetadataStructureDefinitionMutableCore();
                ParseAttributes(codelist, this.Attributes);
                parent.AddMetadataStructure(codelist);
                actions = this.AddNameableAction(codelist, this.HandleChildElements);
            }

            return actions;
        }
Пример #8
0
        /// <summary>
        /// Resolve children of the specified <paramref name="mutableObjects"/> using the specified parameters
        /// </summary>
        /// <param name="mutableObjects">
        /// The mutable objects.
        /// </param>
        /// <param name="returnStub">
        /// Set to true to return only stubs.
        /// </param>
        /// <param name="crossReferenceMutableRetrievalManager">
        /// The cross reference mutable retrieval engine
        /// </param>
        /// <param name="allowedDataflows">
        /// The allowed Dataflows.
        /// </param>
        internal static void ResolveAll(
            IMutableObjects mutableObjects, 
            bool returnStub, 
            IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager, 
            IList<IMaintainableRefObject> allowedDataflows)
        {
            Func<IMaintainableMutableObject, IList<IMaintainableMutableObject>> reference = maintainableMutableObject =>
                {
                    var all = new List<IMaintainableMutableObject>();

                    // add descendants
                    all.AddRange(GetDescendantsReference(returnStub, crossReferenceMutableRetrievalManager, allowedDataflows, maintainableMutableObject));

                    // add parents and siblings
                    all.AddRange(GetParentsAndSiblingsReference(returnStub, crossReferenceMutableRetrievalManager, allowedDataflows, maintainableMutableObject));
                    return all;
                };

            Resolve(mutableObjects, reference);
        }
        /// <summary>
        /// Process the <paramref name="current"/> and populate the <paramref name="mutableObjects"/>
        /// </summary>
        /// <param name="av">
        /// The current Structure Retrieval state
        /// </param>
        /// <param name="current">
        /// The <see cref="IMaintainableRefObject"/> codelist request 
        /// </param>
        /// <param name="mutableObjects">The output mutable objects</param>
        /// <returns>
        /// <c>true</c> if the partial codelist is found found is larger than 0. Else <c>false</c> 
        /// </returns>
        private static bool ProcessReference(StructureRetrievalInfo av, IMaintainableRefObject current, IMutableObjects mutableObjects)
        {
            ICodelistMutableObject availableData = _specialRequestManager.RetrieveAvailableData(current, av);
            if (availableData != null)
            {
                mutableObjects.AddCodelist(availableData);
                return true;
            }

            return false;
        }
        /// <summary>
        /// Validates the specific.
        /// </summary>
        /// <param name="mutableObject">
        /// The mutable object.
        /// </param>
        /// <param name="structureType">
        /// Type of the structure.
        /// </param>
        /// <param name="stubs">
        /// if set to <c>true</c> [stubs].
        /// </param>
        /// <param name="specificStructureType">
        /// Type of the specific structure.
        /// </param>
        /// <param name="structureReference">
        /// The structure reference.
        /// </param>
        private static void ValidateSpecific(
            IMutableObjects mutableObject, 
            BaseConstantType<SdmxStructureEnumType> structureType, 
            bool stubs, 
            BaseConstantType<SdmxStructureEnumType> specificStructureType, 
            IStructureReference structureReference)
        {
            switch (structureType.EnumType)
            {
                case SdmxStructureEnumType.Categorisation:
                    switch (specificStructureType.EnumType)
                    {
                        case SdmxStructureEnumType.Categorisation:
                            break;
                        case SdmxStructureEnumType.CategoryScheme:
                            Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CodeList:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.ConceptScheme:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dataflow:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dsd:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.HierarchicalCodelist:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                    }

                    break;
                case SdmxStructureEnumType.CategoryScheme:

                    // if we have stubs then no categorisations can be retrieved. 
                    // as a result we cannot get other structures.
                    if (!stubs)
                    {
                        switch (specificStructureType.EnumType)
                        {
                            case SdmxStructureEnumType.Categorisation:
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                                Assert.IsNotEmpty(mutableObject.Categorisations, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                                break;
                            case SdmxStructureEnumType.CategoryScheme:
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                                break;
                            case SdmxStructureEnumType.CodeList:
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                                Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                                break;
                            case SdmxStructureEnumType.ConceptScheme:
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                                Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                                break;
                            case SdmxStructureEnumType.Dataflow:
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                                Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                                break;
                            case SdmxStructureEnumType.Dsd:
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                                Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                                break;
                            case SdmxStructureEnumType.HierarchicalCodelist:
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                                Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                                break;
                        }
                    }

                    break;
                case SdmxStructureEnumType.CodeList:
                    switch (specificStructureType.EnumType)
                    {
                        case SdmxStructureEnumType.Categorisation:
                            if (!stubs)
                            {
                                Assert.IsNotEmpty(mutableObject.Categorisations, structureReference.ToString());
                            }

                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());

                            break;
                        case SdmxStructureEnumType.CategoryScheme:
                            if (!stubs)
                            {
                                Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            }

                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CodeList:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.ConceptScheme:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dataflow:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dsd:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.HierarchicalCodelist:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());

                            // Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                    }

                    break;
                case SdmxStructureEnumType.ConceptScheme:
                    switch (specificStructureType.EnumType)
                    {
                        case SdmxStructureEnumType.Categorisation:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CategoryScheme:
                            Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CodeList:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.ConceptScheme:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dataflow:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dsd:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.HierarchicalCodelist:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                    }

                    break;
                case SdmxStructureEnumType.Dataflow:
                    switch (specificStructureType.EnumType)
                    {
                        case SdmxStructureEnumType.Categorisation:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CategoryScheme:
                            Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CodeList:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.ConceptScheme:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dataflow:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dsd:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.HierarchicalCodelist:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                    }

                    break;
                case SdmxStructureEnumType.Dsd:
                    switch (specificStructureType.EnumType)
                    {
                        case SdmxStructureEnumType.Categorisation:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CategoryScheme:
                            Assert.IsNotEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CodeList:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.ConceptScheme:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dataflow:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dsd:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.HierarchicalCodelist:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                    }

                    break;
                case SdmxStructureEnumType.HierarchicalCodelist:
                    switch (specificStructureType.EnumType)
                    {
                        case SdmxStructureEnumType.Categorisation:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CategoryScheme:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.CodeList:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.ConceptScheme:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dataflow:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.Dsd:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                        case SdmxStructureEnumType.HierarchicalCodelist:
                            Assert.IsEmpty(mutableObject.CategorySchemes, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Categorisations, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Dataflows, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.DataStructures, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.Codelists, structureReference.ToString());
                            Assert.IsEmpty(mutableObject.ConceptSchemes, structureReference.ToString());
                            Assert.IsNotEmpty(mutableObject.HierarchicalCodelists, structureReference.ToString());
                            break;
                    }

                    break;
            }
        }
        /// <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)
        {
            try
            {
                // try get the codelist reference
                IMaintainableRefObject codelistReference =
                    queries.Where(structureReference => structureReference.TargetReference.EnumType == SdmxStructureEnumType.CodeList)
                        .Select(structureReference => structureReference.MaintainableReference)
                        .FirstOrDefault();

                // try get the dataflow ref
                var dataflowRef = queries.FirstOrDefault(structureReference => structureReference.TargetReference.EnumType == SdmxStructureEnumType.Dataflow) as IConstrainableStructureReference;

                // check if it is special
                if (codelistReference != null && dataflowRef != null && dataflowRef.ConstraintObject != null && queries.Count == 2)
                {
                    // get the dataflow
                    base.PopulateMutables(
                        retrievalManager,
                        mutableObjects,
                        new IStructureReference[] { dataflowRef },
                        returnLatest,
                        returnStub,
                        allowedDataflows,
                        crossReferenceMutableRetrievalManager);

                    // get the partial codelist
                    StructureRetrievalInfo structureRetrievalInfo = _structureRetrievalInfoBuilder.Build(dataflowRef, this._connectionStringSettings, allowedDataflows);
                    if (!ProcessReference(structureRetrievalInfo, codelistReference, mutableObjects))
                    {
                        string message = string.Format(CultureInfo.InvariantCulture, "No codes found for {0}", codelistReference);
                        _logger.Error(message);
                        throw new SdmxNoResultsException(message);
                    }
                }
                else
                {
                    // not special requests
                    base.PopulateMutables(retrievalManager, mutableObjects, queries, returnLatest, returnStub, allowedDataflows, crossReferenceMutableRetrievalManager);
                }
            }
            catch (SdmxException)
            {
                throw;
            }
            catch (StructureRetrieverException e)
            {
                _logger.Error(e.Message, e);
                switch (e.ErrorType)
                {
                    case StructureRetrieverErrorTypes.ParsingError:
                        throw new SdmxSyntaxException(e, ExceptionCode.XmlParseException);
                    case StructureRetrieverErrorTypes.MissingStructure:
                    case StructureRetrieverErrorTypes.MissingStructureRef:
                        throw new SdmxNoResultsException(e.Message);
                    default:
                        throw new SdmxInternalServerException(e.Message);
                }
            }
            catch (DbException e)
            {
                string mesage = "Mapping Store connection error." + e.Message;
                _logger.Error(mesage, e);
                throw new SdmxInternalServerException(mesage);
            }
            catch (Exception e)
            {
                string mesage = e.Message;
                _logger.Error(mesage, e);
                throw new SdmxInternalServerException(mesage);
            }
        }
        /// <summary>
        /// Get component references.
        /// </summary>
        /// <param name="mutableObject">
        /// The mutable object.
        /// </param>
        /// <param name="structureType">
        /// The structure type.
        /// </param>
        /// <returns>
        /// The component reference
        /// </returns>
        private static IEnumerable<IStructureReference> GetComponentReferences(IMutableObjects mutableObject, BaseConstantType<SdmxStructureEnumType> structureType)
        {
            ISet<IStructureReference> structureReferences = new HashSet<IStructureReference>();
            foreach (var dsd in mutableObject.DataStructures)
            {
                structureReferences.UnionWith(_referenceSetBuilder.Build(dsd));
            }

            return
                (from m in structureReferences
                 where m.MaintainableStructureEnumType.EnumType == structureType.EnumType
                 select new StructureReferenceImpl(m.MaintainableReference, m.MaintainableStructureEnumType)).Distinct().ToArray();
        }
Пример #13
0
 /// <summary>
 /// Resolves the references of the specified mutable objects.
 /// </summary>
 /// <param name="mutableObjects">
 /// The mutable objects.
 /// </param>
 /// <param name="returnStub">
 /// if set to <c>true</c> return stub references.
 /// </param>
 /// <param name="allowedDataflows">
 /// The allowed dataflows.
 /// </param>
 public void ResolveReferences(IMutableObjects mutableObjects, bool returnStub, IList<IMaintainableRefObject> allowedDataflows)
 {
     ResolveChildren(mutableObjects, returnStub, this.CrossReferenceManager, allowedDataflows);
 }
        /// <summary>
        /// Get details specified in <paramref name="structureQuery"/> of the specified <paramref name="mutableObjects"/>
        /// </summary>
        /// <param name="structureQuery">
        /// The structure query.
        /// </param>
        /// <param name="mutableObjects">
        /// The mutable objects.
        /// </param>
        /// <param name="crossReferenceMutableRetrievalManager">
        /// The cross Reference Mutable Retrieval Manager.
        /// </param>
        /// <param name="allowedDataflow">
        /// The allowed Dataflow.
        /// </param>
        /// <exception cref="NotImplementedException">
        /// Not implemented value at <see cref="StructureReferenceDetail"/> of <paramref name="structureQuery"/>
        /// </exception>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Invalid value at <see cref="StructureReferenceDetail"/> of <paramref name="structureQuery"/>
        /// </exception>
        private static void GetDetails(
            IRestStructureQuery structureQuery, 
            IMutableObjects mutableObjects, 
            IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager, 
            IList<IMaintainableRefObject> allowedDataflow)
        {
            _log.InfoFormat("Reference detail: {0}", structureQuery.StructureQueryMetadata.StructureReferenceDetail);

            bool returnStub = structureQuery.StructureQueryMetadata.StructureQueryDetail.EnumType != StructureQueryDetailEnumType.Full;
            var resolver = _resolverFactory.GetResolver(
                structureQuery.StructureQueryMetadata.StructureReferenceDetail, 
                crossReferenceMutableRetrievalManager, 
                structureQuery.StructureQueryMetadata.SpecificStructureReference);
            resolver.ResolveReferences(mutableObjects, returnStub, allowedDataflow);
        }
        /// <summary>
        /// The validate parents and siblings.
        /// </summary>
        /// <param name="mutableObject">
        /// The mutable object.
        /// </param>
        /// <param name="structureType">
        /// The structure type.
        /// </param>
        /// <param name="stubs">
        /// The stubs.
        /// </param>
        private static void ValidateParentsAndSiblings(IMutableObjects mutableObject, BaseConstantType<SdmxStructureEnumType> structureType, bool stubs)
        {
            switch (structureType.EnumType)
            {
                case SdmxStructureEnumType.Categorisation:
                    break;
                case SdmxStructureEnumType.CategoryScheme:
                    {
                        if (!stubs)
                        {
                            Assert.IsNotEmpty(mutableObject.Categorisations);
                            Assert.IsNotEmpty(mutableObject.Dataflows);
                            Assert.IsNotEmpty(mutableObject.CategorySchemes);
                            var referencedByParent =
                                (from m in mutableObject.Categorisations select new StructureReferenceImpl(m.CategoryReference.MaintainableReference, m.CategoryReference.MaintainableStructureEnumType))
                                    .Distinct().ToArray();
                            var got = from o in mutableObject.CategorySchemes select _fromMutable.Build(o);
                            if (referencedByParent.Length > 0)
                            {
                                CollectionAssert.IsSubsetOf(referencedByParent, got);
                            }
                        }
                    }

                    break;
                case SdmxStructureEnumType.CodeList:
                    {
                        if (!mutableObject.Codelists.All(o => "MA".Equals(o.AgencyId)))
                        {
                            Assert.IsNotEmpty(mutableObject.Codelists);
                            Assert.IsTrue(mutableObject.DataStructures.Count + mutableObject.HierarchicalCodelists.Count > 0, _fromMutable.Build(mutableObject.Codelists.First()).ToString());
                            if (mutableObject.DataStructures.Count > 0)
                            {
                                Assert.IsNotEmpty(mutableObject.ConceptSchemes);
                            }
                        }

                        if (!stubs)
                        {
                            var referencedByParent = GetComponentReferences(mutableObject, structureType);
                            var got = (from o in mutableObject.Codelists select _fromMutable.Build(o)).Distinct<IStructureReference>().ToArray();

                            CollectionAssert.IsSubsetOf(referencedByParent, got);

                            var hclReferences =
                                (from m in mutableObject.HierarchicalCodelists from codelistRefMutableObject in m.CodelistRef select codelistRefMutableObject.CodelistReference).Distinct().ToArray();

                            CollectionAssert.IsSubsetOf(hclReferences, got);
                        }
                    }

                    break;
                case SdmxStructureEnumType.ConceptScheme:
                    {
                        Assert.IsNotEmpty(mutableObject.ConceptSchemes);
                        Assert.IsNotEmpty(mutableObject.Codelists);
                        Assert.IsNotEmpty(mutableObject.DataStructures);
                        if (!stubs)
                        {
                            var referencedByParent = GetComponentReferences(mutableObject, structureType);
                            var got = from o in mutableObject.ConceptSchemes select _fromMutable.Build(o);

                            CollectionAssert.IsSubsetOf(referencedByParent, got);
                        }
                    }

                    break;
                case SdmxStructureEnumType.Dataflow:
                    {
                        Assert.IsNotEmpty(mutableObject.Categorisations);
                        Assert.IsNotEmpty(mutableObject.Dataflows);
                        Assert.IsNotEmpty(mutableObject.CategorySchemes);
                        if (!stubs)
                        {
                            var referencedByParent = (from m in mutableObject.Categorisations select m.StructureReference).Distinct().ToArray();
                            var got = (from o in mutableObject.Dataflows select _fromMutable.Build(o)).Distinct<IStructureReference>().ToArray();

                            if (referencedByParent.Length > 0)
                            {
                                CollectionAssert.IsSubsetOf(referencedByParent, got);
                            }
                        }
                    }

                    break;
                case SdmxStructureEnumType.Dsd:
                    {
                        Assert.IsNotEmpty(mutableObject.Dataflows);
                        Assert.IsNotEmpty(mutableObject.DataStructures);
                        if (!stubs)
                        {
                            var referencedByParent = (from m in mutableObject.Dataflows select m.DataStructureRef).Distinct().ToArray();
                            var got = from o in mutableObject.DataStructures select _fromMutable.Build(o);

                            CollectionAssert.IsSubsetOf(referencedByParent, got);
                        }
                    }

                    break;
                case SdmxStructureEnumType.HierarchicalCodelist:
                    break;
            }
        }
 /// <summary>
 /// Validates all.
 /// </summary>
 /// <param name="mutableObject">
 /// The mutable object.
 /// </param>
 /// <param name="structureType">
 /// Type of the structure.
 /// </param>
 /// <param name="stubs">
 /// if set to <c>true</c> [stubs].
 /// </param>
 private static void ValidateAll(IMutableObjects mutableObject, BaseConstantType<SdmxStructureEnumType> structureType, bool stubs)
 {
     ValidateParentsAndSiblings(mutableObject, structureType, stubs);
     ValidateDescendants(mutableObject, structureType, stubs);
 }
 /// <summary>
 /// Gets a Dictionary of <see cref="IIdentifiableMutableObject"/> alongside any cross references they declare that could not be found in the set of
 ///     <paramref name="beans"/>
 ///     provided, and the <paramref name="retrievalManager"/> (if given).
 ///     <p/>
 ///     <b>NOTE :</b>An empty Map is returned if all cross references are present.
 /// </summary>
 /// <param name="beans">
 /// - the objects to return the Map of missing references for
 /// </param>
 /// <param name="numberLevelsDeep">
 /// references, an argument of 0 (zero) implies there is no limit, and the resolver engine will continue re-cursing  until it has found every directly and indirectly referenced
 /// </param>
 /// <param name="retrievalManager">
 /// - Used to resolve the structure references. Can be null, if supplied this is used to resolve any references that do not exist in the supplied beans
 /// </param>
 /// <returns>
 /// Map of IIdentifiableMutableObject with a Set of CrossReferences that could not be resolved for the IIdentifiableMutableObject - an empty Map is returned if all cross references are present
 /// </returns>
 public MaintainableReferenceDictionary GetMissingCrossReferences(
     IMutableObjects beans, int numberLevelsDeep, Func<IStructureReference, IMaintainableMutableObject> retrievalManager)
 {
     var missingReferences = new MaintainableReferenceDictionary();
     this.ResolveReferencesInternal(beans, numberLevelsDeep, retrievalManager, missingReferences);
     return missingReferences;
 }
        /// <summary>
        /// The validate children.
        /// </summary>
        /// <param name="mutableObject">The mutable object.</param>
        /// <param name="structureType">The structure type.</param>
        /// <param name="stubs">if set to <c>true</c> [stubs].</param>
        private static void ValidateChildren(IMutableObjects mutableObject, BaseConstantType<SdmxStructureEnumType> structureType, bool stubs)
        {
            switch (structureType.EnumType)
            {
                case SdmxStructureEnumType.Categorisation:

                    Assert.IsNotEmpty(mutableObject.Dataflows);
                    Assert.IsNotEmpty(mutableObject.CategorySchemes);
                    if (!stubs)
                    {
                        var categorySchemeRefs =
                            (from m in mutableObject.Categorisations select new StructureReferenceImpl(m.CategoryReference.MaintainableReference, m.CategoryReference.MaintainableStructureEnumType))
                                .Distinct().ToArray();
                        var got = from o in mutableObject.CategorySchemes select _fromMutable.Build(o);

                        CollectionAssert.AreEquivalent(categorySchemeRefs, got);
                    }

                    if (!stubs)
                    {
                        var dataflows = (from m in mutableObject.Categorisations select m.StructureReference).Distinct();
                        var got = from o in mutableObject.Dataflows select _fromMutable.Build(o);

                        CollectionAssert.AreEquivalent(dataflows, got);
                    }

                    break;
                case SdmxStructureEnumType.CategoryScheme:

                    break;
                case SdmxStructureEnumType.CodeList:

                    break;
                case SdmxStructureEnumType.ConceptScheme:

                    break;
                case SdmxStructureEnumType.Dataflow:
                    {
                        Assert.IsNotEmpty(mutableObject.DataStructures);
                        if (!stubs)
                        {
                            var dataflows = (from m in mutableObject.Dataflows select m.DataStructureRef).Distinct();
                            var got = from o in mutableObject.DataStructures select _fromMutable.Build(o);

                            CollectionAssert.AreEquivalent(dataflows, got);
                        }
                    }

                    break;
                case SdmxStructureEnumType.Dsd:
                    Assert.IsNotEmpty(mutableObject.ConceptSchemes);
                    Assert.IsNotEmpty(mutableObject.Codelists);
                    if (!stubs)
                    {
                        var sdmxStructureType = SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ConceptScheme);
                        ValidateComponentReferences(mutableObject, sdmxStructureType);
                    }

                    if (!stubs)
                    {
                        var sdmxStructureType = SdmxStructureType.GetFromEnum(SdmxStructureEnumType.CodeList);
                        ValidateComponentReferences(mutableObject, sdmxStructureType);
                    }

                    break;
                case SdmxStructureEnumType.HierarchicalCodelist:
                    Assert.IsNotEmpty(mutableObject.Codelists);
                    if (!stubs)
                    {
                        var got = (from o in mutableObject.Codelists select _fromMutable.Build(o)).Distinct<IStructureReference>().ToArray();

                        var hclReferences =
                            (from m in mutableObject.HierarchicalCodelists from codelistRefMutableObject in m.CodelistRef select codelistRefMutableObject.CodelistReference).Distinct().ToArray();

                        CollectionAssert.IsSubsetOf(hclReferences, got);
                    }

                    break;
            }
        }
Пример #19
0
 /// <summary>
 /// Write.the specified <paramref name="structure"/>
 /// </summary>
 /// <param name="structure">
 /// The structure.
 /// </param>
 public void Write(IMutableObjects structure)
 {
     this.WriteConcepts(structure.ConceptSchemes);
 }
Пример #20
0
 /// <summary>
 /// The write.
 /// </summary>
 /// <param name="structure">
 /// The structure.
 /// </param>
 public void Write(IMutableObjects structure)
 {
     this.WriteCodeLists(structure.Codelists);
 }
        /// <summary>
        /// Handles the Structure top level elements
        ///     This includes Codelist
        /// </summary>
        /// <param name="parent">
        /// The parent <see cref="IMutableObjects"/>
        /// </param>
        /// <param name="localName">
        /// The name of the current xml element
        /// </param>
        /// <returns>
        /// The <see cref="StructureReaderBaseV20.ElementActions"/>.
        /// </returns>
        protected override ElementActions HandleTopLevel(IMutableObjects parent, object localName)
        {
            ElementActions actions = null;
            if (NameTableCache.IsElement(localName, ElementNameTable.HierarchicalCodelist))
            {
                var hcl = new HierarchicalCodelistMutableCore();
                ParseAttributes(hcl, this.Attributes);
                parent.AddHierarchicalCodelist(hcl);
                actions = this.AddNameableAction(hcl, this.HandleChildElements);
            }

            return actions;
        }
        /// <summary>
        /// The validate component references.
        /// </summary>
        /// <param name="mutableObject">
        /// The mutable object.
        /// </param>
        /// <param name="sdmxStructureType">
        /// The SDMX structure type.
        /// </param>
        private static void ValidateComponentReferences(IMutableObjects mutableObject, SdmxStructureType sdmxStructureType)
        {
            var expected = GetComponentReferences(mutableObject, sdmxStructureType);
            var got = (from o in mutableObject.GetMaintainables(sdmxStructureType) select _fromMutable.Build(o)).Distinct<IStructureReference>().ToArray();

            CollectionAssert.AreEquivalent(expected, got);
        }
        /// <summary>
        /// Retrieve the structures referenced by <paramref name="queries"/> and populate the
        ///     <paramref name="mutableObjects"/>
        /// </summary>
        /// <param name="mutableObjects">
        ///     The mutable objects.
        /// </param>
        /// <param name="queries">
        ///     The queries.
        /// </param>
        /// <param name="returnLatest">
        ///     The return Latest.
        /// </param>
        /// <param name="returnStub">
        ///     The return Stub.
        /// </param>
        /// <param name="allowedDataflows">
        ///     The allowed Dataflows.
        /// </param>
        protected virtual void PopulateMutables(IMutableObjects mutableObjects, IList<IStructureReference> queries, bool returnLatest, StructureQueryDetailEnumType returnStub, IList<IMaintainableRefObject> allowedDataflows)
        {
            var cachedRetrievalManager = this._advancedMutableRetrievalManagerFactory.GetRetrievalManager(this._retrievalAdvancedManager);

            var crossReferenceMutableRetrievalManager = this._crossReferenceManager.GetCrossRetrievalManager(this._database, cachedRetrievalManager);
            PopulateMutables(cachedRetrievalManager, mutableObjects, queries, returnLatest, returnStub, allowedDataflows, crossReferenceMutableRetrievalManager);
        }
        /// <summary>
        /// Resolves all references and returns a Map containing all the input beans and the objects that are cross referenced,
        ///     the Map's key set contains the Identifiable that is the referencing object and the Map's value collection contains the referenced artifacts.
        /// </summary>
        /// <param name="beans">
        /// - the <see cref="IMutableObjects"/> container, containing all the beans to check references for
        /// </param>
        /// <param name="numberLevelsDeep">
        /// references, an argument of 0 (zero) implies there is no limit, and the resolver engine will continue re-cursing until it has found every directly and indirectly referenced artifact. Note that there is no risk of infinite recursion in calling this.
        /// </param>
        /// <param name="retrievalManager">
        /// - Used to resolve the structure references. Can be null, if supplied this is used to resolve any references that do not exist in the supplied beans
        /// </param>
        /// <returns>
        /// Map of referencing versus  references
        /// </returns>
        /// <exception cref="SdmxReferenceException">
        /// - if any of the references could not be resolved
        /// </exception>
        public MaintainableDictionary<IMaintainableMutableObject> ResolveReferences(
            IMutableObjects beans, int numberLevelsDeep, Func<IStructureReference, IMaintainableMutableObject> retrievalManager)
        {
            var missingReferences = new DictionaryOfSets<IMaintainableMutableObject, IStructureReference>(MaintainableMutableComparer.Instance);
            var returnMap = this.ResolveReferencesInternal(beans, numberLevelsDeep, retrievalManager, missingReferences);
            if (missingReferences.Count > 0)
            {
                var keyValuePair = missingReferences.First();
                throw new SdmxReferenceException(keyValuePair.Key.ImmutableInstance, keyValuePair.Value.FirstOrDefault());
            }

            return returnMap;
        }
 /// <summary>
 /// Retrieve the structures referenced by <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 queries.
 /// </param>
 /// <param name="returnLatest">
 ///     The return Latest.
 /// </param>
 /// <param name="returnStub">
 ///     The return Stub.
 /// </param>
 /// <param name="allowedDataflows">
 ///     The allowed Dataflows.
 /// </param>
 /// <param name="crossReferenceMutableRetrievalManager">
 ///     The cross reference mutable retrieval manager.
 /// </param>
 protected virtual void PopulateMutables(IAuthAdvancedSdmxMutableObjectRetrievalManager retrievalManager, IMutableObjects mutableObjects, IList<IStructureReference> queries, bool returnLatest, StructureQueryDetailEnumType returnStub, IList<IMaintainableRefObject> allowedDataflows, IAuthCrossReferenceMutableRetrievalManager crossReferenceMutableRetrievalManager)
 {
     //// changes here might also apply to AuthAdvancedMutableStructureSearchManagerBase 
     for (int i = 0; i < queries.Count; i++)
     {
         var structureReference = queries[i];
         IRestStructureQuery restStructureQuery = new RESTStructureQueryCore(StructureQueryDetail.GetFromEnum(returnStub), StructureReferenceDetail.GetFromEnum(StructureReferenceDetailEnumType.None), null, structureReference, returnLatest);
         var complexStructureQuery = _complexQueryBuilder.Build(restStructureQuery);
         base.PopulateMutables(retrievalManager, mutableObjects, complexStructureQuery, allowedDataflows, crossReferenceMutableRetrievalManager);
     }
 }
        /// <summary>
        /// Resolve references.
        /// </summary>
        /// <param name="beans">
        /// The beans.
        /// </param>
        /// <param name="numberLevelsDeep">
        /// The number levels deep.
        /// </param>
        /// <param name="retrievalManager">
        /// The retrieval manager.
        /// </param>
        /// <param name="missingReferences">
        /// The missing references.
        /// </param>
        /// <returns>
        /// The <see cref="MaintainableDictionary{IMaintainableMutableObject}"/>.
        /// </returns>
        private MaintainableDictionary<IMaintainableMutableObject> ResolveReferencesInternal(
            IMutableObjects beans, int numberLevelsDeep, Func<IStructureReference, IMaintainableMutableObject> retrievalManager, IDictionaryOfSets<IMaintainableMutableObject, IStructureReference> missingReferences)
        {
            var returnMap = new MaintainableDictionary<IMaintainableMutableObject>();
            var outerLevel = new Queue<IMaintainableMutableObject>();
            foreach (IMaintainableMutableObject artefact in beans.AllMaintainables)
            {
                outerLevel.Enqueue(artefact);
            }

            int count = 0;
            do
            {
                var innerLevel = new Queue<IMaintainableMutableObject>();
                while (outerLevel.Count > 0)
                {
                    IMaintainableMutableObject parent = outerLevel.Dequeue();
                    var structureReferences = GetChildStructureReferences(retrievalManager, parent);

                    foreach (IStructureReference structureReference in structureReferences)
                    {
                        if (structureReference == null)
                        {
                            string message = string.Format(CultureInfo.InvariantCulture, "Null reference for parent artefact : {0}+{1}+{2}", parent.AgencyId, parent.Id, parent.Version);
                            _log.Error(message);
                            throw new MappingStoreException(message);
                        }

                        if (this._structureTypeSet.HasStructure(structureReference.MaintainableStructureEnumType))
                        {
                            IMaintainableMutableObject resolved = this.GetMutableObject(retrievalManager, structureReference);

                            if (resolved != null)
                            {
                                returnMap.AddToSet(parent, resolved);
                                if (numberLevelsDeep == 0 || numberLevelsDeep > count)
                                {
                                    innerLevel.Enqueue(resolved);
                                }
                            }
                            else if (missingReferences != null)
                            {
                                missingReferences.AddToSet(parent, structureReference);
                            }
                        }
                    }
                }

                count++;
                outerLevel = innerLevel;
            }
            while (count < numberLevelsDeep);

            return returnMap;
        }
        /// <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);
            }
        }
        /// <summary>
        /// Validates the descendants.
        /// </summary>
        /// <param name="mutableObject">
        /// The mutable object.
        /// </param>
        /// <param name="structureType">
        /// Type of the structure.
        /// </param>
        /// <param name="stubs">
        /// if set to <c>true</c> [stubs].
        /// </param>
        private static void ValidateDescendants(IMutableObjects mutableObject, BaseConstantType<SdmxStructureEnumType> structureType, bool stubs)
        {
            switch (structureType.EnumType)
            {
                case SdmxStructureEnumType.Categorisation:
                    if (!stubs)
                    {
                        Assert.IsNotEmpty(mutableObject.Dataflows);
                        Assert.IsNotEmpty(mutableObject.CategorySchemes);
                        Assert.IsNotEmpty(mutableObject.DataStructures);
                        Assert.IsNotEmpty(mutableObject.Codelists);
                        Assert.IsNotEmpty(mutableObject.ConceptSchemes);
                    }

                    break;
                case SdmxStructureEnumType.CategoryScheme:
                    break;
                case SdmxStructureEnumType.CodeList:
                    break;
                case SdmxStructureEnumType.ConceptScheme:
                    break;
                case SdmxStructureEnumType.Dataflow:
                    {
                        Assert.IsNotEmpty(mutableObject.Dataflows);
                        Assert.IsNotEmpty(mutableObject.DataStructures);
                        Assert.IsNotEmpty(mutableObject.Codelists);
                        Assert.IsNotEmpty(mutableObject.ConceptSchemes);
                    }

                    break;
                case SdmxStructureEnumType.Dsd:
                    {
                        Assert.IsNotEmpty(mutableObject.DataStructures);
                        Assert.IsNotEmpty(mutableObject.Codelists);
                        Assert.IsNotEmpty(mutableObject.ConceptSchemes);
                    }

                    break;
                case SdmxStructureEnumType.HierarchicalCodelist:
                    Assert.IsNotEmpty(mutableObject.Codelists);
                    break;
            }
        }
 /// <summary>
 /// Write.the specified <paramref name="structure"/>
 /// </summary>
 /// <param name="structure">
 /// The structure.
 /// </param>
 public void Write(IMutableObjects structure)
 {
     this.WriteHierarchicalCodeLists(structure.HierarchicalCodelists);
 }
Пример #30
0
 /// <summary>
 /// The write.
 /// </summary>
 /// <param name="structure">
 /// The structure.
 /// </param>
 public void Write(IMutableObjects structure)
 {
     this.WriteKeyFamilies(structure.DataStructures);
 }