public void TestDetail(SdmxStructureEnumType sdmxStructure, StructureReferenceDetailEnumType detail)
        {
            var agency = new ComplexTextReferenceCore(null, TextSearch.GetFromEnum(TextSearchEnumType.Equal), "TEST");
            var id = new ComplexTextReferenceCore(null, TextSearch.GetFromEnum(TextSearchEnumType.Equal), "TEST");
            IComplexVersionReference versionRef = new ComplexVersionReferenceCore(TertiaryBool.ParseBoolean(false), "1.0", null, null);
            var complexStructureReferenceCore = new ComplexStructureReferenceCore(agency, id, versionRef, SdmxStructureType.GetFromEnum(sdmxStructure), null, null, null, null);
            var complexStructureQueryMetadataCore = new ComplexStructureQueryMetadataCore(
                true,
                ComplexStructureQueryDetail.GetFromEnum(ComplexStructureQueryDetailEnumType.Full),
                ComplexMaintainableQueryDetail.GetFromEnum(ComplexMaintainableQueryDetailEnumType.Full),
                StructureReferenceDetail.GetFromEnum(detail),
                new [] { SdmxStructureType.GetFromEnum(sdmxStructure) });
            IComplexStructureQuery complexStructureQuery = new ComplexStructureQueryCore(complexStructureReferenceCore, complexStructureQueryMetadataCore);

            var builder = new ComplexStructureQueryBuilderV21();
            var structureQuery = builder.BuildComplexStructureQuery(complexStructureQuery);
            var fileName = string.Format("test-ComplexStructureQueryBuilderV21-{0}-{1}.xml", sdmxStructure.ToString(), detail.ToString());
            structureQuery.Save(fileName);
            using (var readable = new FileReadableDataLocation(fileName))
            {
                XMLParser.ValidateXml(readable, SdmxSchemaEnumType.VersionTwoPointOne);
            }
        }
예제 #2
0
        /// <summary>
        /// Retrieves all available dataflows.
        /// </summary>
        private IComplexStructureQuery RetrieveDataflows()
        {
            var dataflowRefBean = new StructureReferenceImpl(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Dataflow));
            IRestStructureQuery structureQueryDataflow = new RESTStructureQueryCore(dataflowRefBean);

            IBuilder<IComplexStructureQuery, IRestStructureQuery> transformerDataFlow = new StructureQuery2ComplexQueryBuilder();

            IComplexStructureQuery complexStructureQueryDataflow = transformerDataFlow.Build(structureQueryDataflow);

            IList<SdmxStructureType> specificObjects = new List<SdmxStructureType>();
            specificObjects.Add(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Dsd));

            IComplexStructureQueryMetadata complexStructureQueryMetadataWithDsd =
                    new ComplexStructureQueryMetadataCore(false,
                    ComplexStructureQueryDetail.GetFromEnum(ComplexStructureQueryDetailEnumType.Full),
                    ComplexMaintainableQueryDetail.GetFromEnum(ComplexMaintainableQueryDetailEnumType.Full),
                    StructureReferenceDetail.GetFromEnum(StructureReferenceDetailEnumType.Specific),
                    specificObjects);

            IComplexStructureQuery complexStructureQueryTempDataflow = new ComplexStructureQueryCore(
                    complexStructureQueryDataflow.StructureReference, complexStructureQueryMetadataWithDsd);

            return complexStructureQueryTempDataflow;
        }