Пример #1
0
        private ArtefactInfo Generate_MSD_Source()
        {
            ArtefactInfo RetVal;
            SDMXObjectModel.Structure.MetadataStructureType MetadataStructure;
            MetadataTargetType MetadataTarget;
            ReportStructureType ReportStructure;
            string Query;
            DataTable DtMetadataCategory;

            RetVal = null;
            MetadataStructure = null;
            MetadataTarget = null;
            ReportStructure = null;
            Query = string.Empty;
            DtMetadataCategory = null;

            try
            {
                MetadataStructure = new SDMXObjectModel.Structure.MetadataStructureType(Constants.MSD.Source.Id, this.AgencyId, Constants.MSD.Source.Version, Constants.MSD.Source.Name, Constants.MSD.Source.Description, Constants.DefaultLanguage, null);
                MetadataStructure.Item = new MetadataStructureComponentsType();

                #region "--Forming Metadata Target--"

                ((MetadataStructureComponentsType)MetadataStructure.Item).MetadataTarget = new List<MetadataTargetType>();
                ((MetadataStructureComponentsType)MetadataStructure.Item).MetadataTarget.Add(new MetadataTargetType(Constants.MSD.Source.MetadataTargetId, null));
                MetadataTarget = ((MetadataStructureComponentsType)MetadataStructure.Item).MetadataTarget[0];

                MetadataTarget.Annotations = null;
                MetadataTarget.Items1 = new List<TargetObject>();
                MetadataTarget.Items1.Add(new IdentifiableObjectTargetType(Constants.MSD.Source.IdentifiableObjectTargetId, ObjectTypeCodelistType.Category, null));

                ((IdentifiableObjectTargetType)MetadataTarget.Items1[0]).Annotations = null;
                ((IdentifiableObjectTargetType)MetadataTarget.Items1[0]).LocalRepresentation = new IdentifiableObjectRepresentationType();
                ((IdentifiableObjectRepresentationType)((IdentifiableObjectTargetType)MetadataTarget.Items1[0]).LocalRepresentation).Items = new List<object>();
                ((IdentifiableObjectRepresentationType)((IdentifiableObjectTargetType)MetadataTarget.Items1[0]).LocalRepresentation).Items.Add(new ItemSchemeReferenceType());

                ((ItemSchemeReferenceType)((IdentifiableObjectRepresentationType)((IdentifiableObjectTargetType)MetadataTarget.Items1[0]).LocalRepresentation).Items[0]).Items = new List<object>();
                ((ItemSchemeReferenceType)((IdentifiableObjectRepresentationType)((IdentifiableObjectTargetType)MetadataTarget.Items1[0]).LocalRepresentation).Items[0]).Items.Add(new ItemSchemeRefType(Constants.CategoryScheme.Source.Id, this.AgencyId, Constants.CategoryScheme.Source.Version, PackageTypeCodelistType.categoryscheme, true, ObjectTypeCodelistType.CategoryScheme, true, false, true));

                #endregion "--Forming Metadata Target--"

                #region "--Forming Report Structure--"

                ((MetadataStructureComponentsType)MetadataStructure.Item).ReportStructure = new List<ReportStructureType>();
                ((MetadataStructureComponentsType)MetadataStructure.Item).ReportStructure.Add(new ReportStructureType(Constants.MSD.Source.ReportStructureId, null));
                ReportStructure = ((MetadataStructureComponentsType)MetadataStructure.Item).ReportStructure[0];

                ReportStructure.Annotations = null;
                ReportStructure.MetadataTarget = new List<LocalMetadataTargetReferenceType>();
                ReportStructure.MetadataTarget.Add(new LocalMetadataTargetReferenceType());

                ReportStructure.MetadataTarget[0].Items = new List<object>();
                ReportStructure.MetadataTarget[0].Items.Add(new LocalMetadataTargetRefType(Constants.MSD.Source.MetadataTargetId, ObjectTypeCodelistType.MetadataTarget, true, PackageTypeCodelistType.metadatastructure, true, true, true));

                #endregion "--Forming Report Structure--"

                Query = "SELECT * FROM UT_Metadata_Category_" + this.Language + " WHERE CategoryType = 'S' ORDER BY CategoryOrder ASC;";
                DtMetadataCategory = this._diConnection.ExecuteDataTable(Regex.Replace(Query, "UT_", this._diConnection.DIDataSetDefault(), RegexOptions.IgnoreCase));
                this.Fill_ReportStructure(ReportStructure, DtMetadataCategory, MSDTypes.MSD_Source);

                RetVal = this.Prepare_ArtefactInfo_From_MetadataStructure(MetadataStructure, Constants.MSD.Source.FileName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }
        public StructuresType(ProvisionAgreementType provisionAgreement, ConstraintType constraint, ProcessType process, 
                              ReportingTaxonomyType reportingTaxonomoy, StructureSetType structureSet, DataStructureType dataStructure, 
                              MetadataStructureType metadataStructure, ConceptSchemeType conceptScheme, 
                              HierarchicalCodelistType hierarchicalCodelist, CodelistType codelist, CategorisationType categorisation, 
                              CategorySchemeType categoryScheme, MetadataflowType metadataFlow, DataflowType dataFlow, 
                              OrganisationSchemeType organisationScheme)
        {
            if (provisionAgreement != null)
            {
                this.provisionAgreementsField = new List<ProvisionAgreementType>();
                this.provisionAgreementsField.Add(provisionAgreement);
            }

            if (constraint != null)
            {
                this.constraintsField = new List<ConstraintType>();
                this.constraintsField.Add(constraint);
            }

            if (process != null)
            {
                this.processesField = new List<ProcessType>();
                this.processesField.Add(process);
            }

            if (reportingTaxonomoy != null)
            {
                this.reportingTaxonomiesField = new List<ReportingTaxonomyType>();
                this.reportingTaxonomiesField.Add(reportingTaxonomoy);
            }

            if (structureSet != null)
            {
                this.structureSetsField = new List<StructureSetType>();
                this.structureSetsField.Add(structureSet);
            }

            if (dataStructure != null)
            {
                this.dataStructuresField = new List<DataStructureType>();
                this.dataStructuresField.Add(dataStructure);
            }

            if (metadataStructure != null)
            {
                this.metadataStructuresField = new List<MetadataStructureType>();
                this.metadataStructuresField.Add(metadataStructure);
            }

            if (conceptScheme != null)
            {
                this.conceptsField = new List<ConceptSchemeType>();
                this.conceptsField.Add(conceptScheme);
            }

            if (hierarchicalCodelist != null)
            {
                this.hierarchicalCodelistsField = new List<HierarchicalCodelistType>();
                this.hierarchicalCodelistsField.Add(hierarchicalCodelist);
            }

            if (codelist != null)
            {
                this.codelistsField = new List<CodelistType>();
                this.codelistsField.Add(codelist);
            }

            if (categorisation != null)
            {
                this.categorisationsField = new List<CategorisationType>();
                this.categorisationsField.Add(categorisation);
            }

            if (categoryScheme != null)
            {
                this.categorySchemesField = new List<CategorySchemeType>();
                this.categorySchemesField.Add(categoryScheme);
            }

            if (metadataFlow != null)
            {
                this.metadataflowsField = new List<MetadataflowType>();
                this.metadataflowsField.Add(metadataFlow);
            }

            if (dataFlow != null)
            {
                this.dataflowsField = new List<DataflowType>();
                this.dataflowsField.Add(dataFlow);
            }

            if (organisationScheme != null)
            {
                this.organisationSchemesField = new List<OrganisationSchemeType>();
                this.organisationSchemesField.Add(organisationScheme);
            }
        }