예제 #1
0
        public override List<ArtefactInfo> Generate_Artefact()
        {
            List<ArtefactInfo> RetVal;
            ArtefactInfo Artefact;
            SDMXObjectModel.Structure.ProvisionAgreementType ProvisionAgreement;
            string PAId, FileName;

            RetVal = null;
            PAId = string.Empty;
            FileName = string.Empty;

            try
            {
                PAId = this._providerId.Replace(Constants.DataProviderScheme.Prefix, Constants.PA.Prefix) + Constants.Underscore + this._dfdMfdId;
                ProvisionAgreement = new ProvisionAgreementType(PAId, this.AgencyId, Constants.PA.Version, Constants.PA.Name, Constants.PA.Description, Constants.DefaultLanguage, null);

                ProvisionAgreement.StructureUsage = new StructureUsageReferenceType();
                ProvisionAgreement.StructureUsage.Items.Add(new StructureUsageRefType(this._dfdMfdId, this.AgencyId, Constants.DFD.Version));

                ((StructureUsageRefType)ProvisionAgreement.StructureUsage.Items[0]).packageSpecified = true;
                ((StructureUsageRefType)ProvisionAgreement.StructureUsage.Items[0]).classSpecified = true;

                if (this._dfdMfdFlag == true)
                {
                    ((StructureUsageRefType)ProvisionAgreement.StructureUsage.Items[0]).package = PackageTypeCodelistType.datastructure;
                    ((StructureUsageRefType)ProvisionAgreement.StructureUsage.Items[0]).@class = ObjectTypeCodelistType.Dataflow;
                }
                else
                {
                    ((StructureUsageRefType)ProvisionAgreement.StructureUsage.Items[0]).package = PackageTypeCodelistType.metadatastructure;
                    ((StructureUsageRefType)ProvisionAgreement.StructureUsage.Items[0]).@class = ObjectTypeCodelistType.Metadataflow;
                }

                ProvisionAgreement.DataProvider = new DataProviderReferenceType();
                ProvisionAgreement.DataProvider.Items.Add(new DataProviderRefType(this._providerId, Constants.DataProviderScheme.AgencyId, Constants.DataProviderScheme.Id, Constants.DataProviderScheme.Version));

                FileName = PAId + Constants.XmlExtension;

                // Preparing Artefact and saving
                Artefact = this.Prepare_ArtefactInfo_From_PA(ProvisionAgreement, FileName);
                this.Add_ArtefactInfo_To_List(ref RetVal, Artefact);
            }
            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);
            }
        }