Exemple #1
0
        internal MSDUtility(MSDTypes msdType, string agencyId, string language, Header header, string outputFolder, DIConnection DIConnection, DIQueries DIQueries)
            : base(agencyId, language, header, outputFolder)
        {
            this._msdType = msdType;
            this._diConnection = DIConnection;
            this._diQueries = DIQueries;

            if (string.IsNullOrEmpty(language))
            {
                this.Language = this._diQueries.LanguageCode.Substring(1);
                this._multiLanguageHandlingRequired = true;
            }
            else
            {
                if (this._diConnection.IsValidDILanguage(this._diQueries.DataPrefix, language))
                {
                    this.Language = language;
                    this._multiLanguageHandlingRequired = false;
                }
                else
                {
                    this.Language = this._diQueries.LanguageCode.Substring(1);
                    this._multiLanguageHandlingRequired = false;
                }
            }
        }
Exemple #2
0
 internal MFDUtility(MSDTypes msdType, string agencyId, Header header, string outputFolder)
     : base(agencyId, string.Empty, header, outputFolder)
 {
     this._msdType = msdType;
 }
        public static List<ArtefactInfo> Generate_MSD(SDMXSchemaType schemaType, MSDTypes msdType, string agencyId, string language, Header header, string outputFolder, DIConnection DIConnection, DIQueries DIQueries)
        {
            List<ArtefactInfo> RetVal;
            MSDUtility MSDUtility;

            RetVal = null;
            MSDUtility = null;

            try
            {
                MSDUtility = new MSDUtility(msdType, agencyId, language, header, outputFolder, DIConnection, DIQueries);
                RetVal = MSDUtility.Generate_Artefact();
                MSDUtility.Save_Artefacts(RetVal);
            }
            catch (Exception ex)
            {
                RetVal = null;
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }
        public static List<ArtefactInfo> Generate_MFD(SDMXSchemaType schemaType, MSDTypes msdType, string agencyId, Header header, string outputFolder)
        {
            List<ArtefactInfo> RetVal;
            MFDUtility MFDUtility;

            RetVal = null;
            MFDUtility = null;

            try
            {
                MFDUtility = new MFDUtility(msdType, agencyId, header, outputFolder);
                RetVal = MFDUtility.Generate_Artefact();
                MFDUtility.Save_Artefacts(RetVal);
            }
            catch (Exception ex)
            {
                RetVal = null;
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }
Exemple #5
0
        private void Fill_ReportStructure(ReportStructureType ReportStructure, DataTable DtMetadataCategory, MSDTypes msdType)
        {
            MetadataAttributeType MetadataAttribute;
            DataRow[] ParentRows;
            string CategoryNId, CategoryGId;
            bool IsPresentational;

            ReportStructure.Items = new List<ComponentType>();
            ParentRows = DtMetadataCategory.Select("ParentCategoryNId = -1", "CategoryOrder ASC");

            foreach (DataRow ParentRow in ParentRows)
            {
                CategoryNId = ParentRow["CategoryNId"].ToString();
                CategoryGId = ParentRow["CategoryGId"].ToString();
                IsPresentational = Convert.ToBoolean(ParentRow["IsPresentational"].ToString());

                MetadataAttribute = new MetadataAttributeType(CategoryGId, IsPresentational, null);
                this.Add_Children_Attributes(MetadataAttribute, CategoryNId, DtMetadataCategory, msdType);
                this.Fill_MetadataAttribute(MetadataAttribute, CategoryGId, msdType);

                ReportStructure.Items.Add(MetadataAttribute);
            }
        }
Exemple #6
0
        private void Fill_MetadataAttribute(MetadataAttributeType MetadataAttribute, string CategoryGId, MSDTypes msdType)
        {
            MetadataAttribute.Annotations = null;
            MetadataAttribute.ConceptIdentity = new ConceptReferenceType();
            MetadataAttribute.ConceptIdentity.Items = new List<object>();

            switch (msdType)
            {
                case MSDTypes.MSD_Area:
                    MetadataAttribute.ConceptIdentity.Items.Add(new ConceptRefType(CategoryGId, this.AgencyId, Constants.ConceptScheme.MSD_Area.Id, Constants.ConceptScheme.MSD_Area.Version));
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).local = false;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).localSpecified = true;

                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).@class = ObjectTypeCodelistType.Concept;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).classSpecified = true;

                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).package = PackageTypeCodelistType.conceptscheme;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).packageSpecified = true;
                    break;
                case MSDTypes.MSD_Indicator:
                    MetadataAttribute.ConceptIdentity.Items.Add(new ConceptRefType(CategoryGId, this.AgencyId, Constants.ConceptScheme.MSD_Indicator.Id, Constants.ConceptScheme.MSD_Indicator.Version));
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).local = false;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).localSpecified = true;

                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).@class = ObjectTypeCodelistType.Concept;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).classSpecified = true;

                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).package = PackageTypeCodelistType.conceptscheme;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).packageSpecified = true;
                    break;
                case MSDTypes.MSD_Source:
                    MetadataAttribute.ConceptIdentity.Items.Add(new ConceptRefType(CategoryGId, this.AgencyId, Constants.ConceptScheme.MSD_Source.Id, Constants.ConceptScheme.MSD_Source.Version));
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).local = false;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).localSpecified = true;

                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).@class = ObjectTypeCodelistType.Concept;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).classSpecified = true;

                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).package = PackageTypeCodelistType.conceptscheme;
                    ((ConceptRefType)MetadataAttribute.ConceptIdentity.Items[0]).packageSpecified = true;
                    break;
            }

            MetadataAttribute.LocalRepresentation = new MetadataAttributeRepresentationType();
            MetadataAttribute.LocalRepresentation.Items = new List<object>();
            MetadataAttribute.LocalRepresentation.Items.Add(new BasicComponentTextFormatType());
            ((BasicComponentTextFormatType)MetadataAttribute.LocalRepresentation.Items[0]).textType = SDMXObjectModel.Common.DataType.String;
        }
Exemple #7
0
        private void Add_Children_Attributes(MetadataAttributeType MetadataAttribute, string CategoryNId, DataTable DtMetadataCategory, MSDTypes msdType)
        {
            MetadataAttributeType ChildMetadataAttribute;
            DataRow[] ChildRows;
            string ChildCategoryNId, ChildCategoryGId;
            bool ChildIsPresentational;

            ChildRows = DtMetadataCategory.Select("ParentCategoryNId = " + CategoryNId, "CategoryOrder ASC");

            if (ChildRows.Length > 0)
            {
                MetadataAttribute.MetadataAttribute = new List<MetadataAttributeType>();

                foreach (DataRow ChildRow in ChildRows)
                {
                    ChildCategoryNId = ChildRow["CategoryNId"].ToString();
                    ChildCategoryGId = ChildRow["CategoryGId"].ToString();
                    ChildIsPresentational = Convert.ToBoolean(ChildRow["IsPresentational"].ToString());

                    ChildMetadataAttribute = new MetadataAttributeType(ChildCategoryGId, ChildIsPresentational, null);
                    this.Add_Children_Attributes(ChildMetadataAttribute, ChildCategoryNId, DtMetadataCategory, msdType);
                    this.Fill_MetadataAttribute(ChildMetadataAttribute, ChildCategoryGId, msdType);

                    MetadataAttribute.MetadataAttribute.Add(ChildMetadataAttribute);
                }
            }
            else
            {
                MetadataAttribute.MetadataAttribute = null;
            }
        }