Ejemplo n.º 1
0
 public StructuresQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.StructuresQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 2
0
 public SubmitRegistrationsRequestType()
 {
     this.submitRegistrationsRequestField = new List<RegistrationRequestType>();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 3
0
        public new SDMXObjectModel.Message.BasicHeaderType Get_Appropriate_Header()
        {
            SDMXObjectModel.Message.BasicHeaderType RetVal;
            SenderType Sender;
            PartyType Receiver;

            if (this.Header == null)
            {
                Sender = new SenderType(Constants.Header.SenderId, Constants.Header.SenderName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Sender, Constants.Header.SenderDepartment, Constants.Header.SenderRole, Constants.DefaultLanguage));
                Sender.Contact[0].Items = new string[] { Constants.Header.SenderTelephone, Constants.Header.SenderEmail, Constants.Header.SenderFax };
                Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                Receiver = new PartyType(Constants.Header.ReceiverId, Constants.Header.ReceiverName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Receiver, Constants.Header.ReceiverDepartment, Constants.Header.ReceiverRole, Constants.DefaultLanguage));
                Receiver.Contact[0].Items = new string[] { Constants.Header.ReceiverTelephone, Constants.Header.ReceiverEmail, Constants.Header.ReceiverFax };
                Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                RetVal = new BasicHeaderType(Constants.Header.Id, true, DateTime.Now, Sender, Receiver);
            }
            else
            {
                Sender = new SenderType(this.Header.Sender.ID, this.Header.Sender.Name, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(this.Header.Sender.Contact.Name, this.Header.Sender.Contact.Department, this.Header.Sender.Contact.Role, Constants.DefaultLanguage));
                Sender.Contact[0].Items = new string[] { this.Header.Sender.Contact.Telephone, this.Header.Sender.Contact.Email, this.Header.Sender.Contact.Fax };
                Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                Receiver = new PartyType(this.Header.Receiver.ID, this.Header.Receiver.Name, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(this.Header.Receiver.Contact.Name, this.Header.Receiver.Contact.Department, this.Header.Receiver.Contact.Role, Constants.DefaultLanguage));
                Receiver.Contact[0].Items = new string[] { this.Header.Receiver.Contact.Telephone, this.Header.Receiver.Contact.Email, this.Header.Receiver.Contact.Fax };
                Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                RetVal = new BasicHeaderType(this.Header.ID, true, DateTime.Now, Sender, Receiver);
            }

            return RetVal;
        }
Ejemplo n.º 4
0
 public HierarchicalCodelistQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.HierarchicalCodelistQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 5
0
 public ConceptSchemeQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.ConceptSchemeQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 6
0
 public DataSchemaQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.DataSchemaQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 7
0
 public QuerySubscriptionRequestType()
 {
     this.querySubscriptionRequestField = new SDMXObjectModel.Registry.QuerySubscriptionRequestType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 8
0
        public SubmitStructureResponseType(BasicHeaderType basicHeader, SubmissionResultType submissionResult, FooterMessageType footerMessage)
        {
            this.headerField = basicHeader;

            if (submissionResult != null)
            {
                this.submitStructureResponseField = new List<SubmissionResultType>();
                this.submitStructureResponseField.Add(submissionResult);
            }

            if (footerMessage != null)
            {
                this.footerField = new List<FooterMessageType>();
                this.footerField.Add(footerMessage);
            }
        }
Ejemplo n.º 9
0
 public ProcessQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.ProcessQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 10
0
 public ProvisionAgreementQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.ProvisionAgreementQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 11
0
 public OrganisationSchemeQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.OrganisationSchemeQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 12
0
 public NotifyRegistryEventType()
 {
     this.notifyRegistryEventField = new SDMXObjectModel.Registry.NotifyRegistryEventType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 13
0
 public MetadataStructureQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.MetadataStructureQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 14
0
 public SubmitStructureRequestType()
 {
     this.submitStructureRequestField = new SDMXObjectModel.Registry.SubmitStructureRequestType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 15
0
 public QuerySubscriptionResponseType()
 {
     this.footerField = new List<FooterMessageType>();
     this.querySubscriptionResponseField = new SDMXObjectModel.Registry.QuerySubscriptionResponseType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 16
0
 public SubmitStructureResponseType()
     : this(null, null, null)
 {
     this.footerField = new List<FooterMessageType>();
     this.submitStructureResponseField = new List<SubmissionResultType>();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 17
0
 public RegistryInterfaceType()
 {
     this.footerField = new List<FooterMessageType>();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 18
0
 public SubmitSubscriptionsResponseType()
 {
     this.footerField = new List<FooterMessageType>();
     this.submitSubscriptionsResponseField = new List<SubscriptionStatusType>();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 19
0
 public ReportingTaxonomyQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.ReportingTaxonomyQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 20
0
 public ConstraintQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.ConstraintQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 21
0
 public CategorisationQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.CategorisationQueryType();
     this.headerField = new BasicHeaderType();
 }
Ejemplo n.º 22
0
    public static SDMXObjectModel.Message.BasicHeaderType Get_Appropriate_Header()
    {
        SDMXObjectModel.Message.BasicHeaderType RetVal;
        SenderType Sender;
        PartyType Receiver;

        Sender = new SenderType(DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderId, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderName, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(DevInfo.Lib.DI_LibSDMX.Constants.Header.Sender, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderDepartment, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderRole, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage));
        Sender.Contact[0].Items = new string[] { DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderTelephone, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderEmail, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderFax };
        Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

        Receiver = new PartyType(DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverId, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverName, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(DevInfo.Lib.DI_LibSDMX.Constants.Header.Receiver, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverDepartment, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverRole, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage));
        Receiver.Contact[0].Items = new string[] { DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverTelephone, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverEmail, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverFax };
        Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

        RetVal = new BasicHeaderType(DevInfo.Lib.DI_LibSDMX.Constants.Header.Id, true, DateTime.Now, Sender, Receiver);

        return RetVal;
    }
Ejemplo n.º 23
0
 public StructureSpecificTimeSeriesDataQueryType()
 {
     this.queryField = new TimeSeriesDataQueryType();
     this.headerField = new BasicHeaderType();
 }
    private bool UpdateNonMAForUploadedDBWithHeader(string DbNId, string UserNId, string DataBaseNId)
    {
        bool RetVal;
        SDMXObjectModel.Message.RegistryInterfaceType Registrations;
        SDMXObjectModel.Message.GenericMetadataType MetadataFiles;
        //SDMXObjectModel.Message.GenericDataType DataFiles;
        SDMXObjectModel.Message.StructureSpecificTimeSeriesDataType DataFiles;

        SDMXObjectModel.Message.RegistryInterfaceType Subscriptions;
        RetVal = true;
        string UploadedHeaderFileWPath = string.Empty;
        string UploadedHeaderFolderPath = Server.MapPath("../../stock/data");
        string UploadedHeaderName = string.Empty;
        string SubscriptionsFolderPath = string.Empty;
        string MetadataFolderPath = string.Empty;
        string RegistrationsFolderPath = string.Empty;
        string SDMXMLFolderPath = string.Empty;
        string MappingFolderPath = string.Empty;
        XmlDocument UploadedHeaderXml = new XmlDocument();
        FileInfo[] Files = null;

        DirectoryInfo dirRegs = null;
        DirectoryInfo dirMetadata = null;
        DirectoryInfo dirSubscriptions = null;
        DirectoryInfo dirSDMXML = null;

        try
        {
            UploadedHeaderFileWPath = UploadedHeaderFolderPath + "/" + DataBaseNId + "/" + "sdmx" + "/" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName;
            dirRegs = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Registrations");
            dirMetadata = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Metadata");
            dirSDMXML = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "SDMX-ML");
            dirSubscriptions = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Subscriptions");
            MappingFolderPath = UploadedHeaderFolderPath + "/" + DbNId + "/" + "sdmx" + "/" + "Mappings";
            UploadedHeaderXml.Load(UploadedHeaderFileWPath);
            SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
            SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();
            SDMXObjectModel.Message.BasicHeaderType BHeader = new SDMXObjectModel.Message.BasicHeaderType();

            UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
            Header = UploadedDSDStructure.Header;
            //  BHeader = (SDMXObjectModel.Message.BasicHeaderType)UploadedDSDStructure.Header;
            foreach (DirectoryInfo dirReg in dirRegs.GetDirectories())
            {
                Files = dirReg.GetFiles();
                foreach (FileInfo regfile in Files)
                {
                    Registrations = new SDMXObjectModel.Message.RegistryInterfaceType();

                    Registrations = (SDMXObjectModel.Message.RegistryInterfaceType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Registrations" + "\\" + dirReg.Name + "\\" + regfile.ToString());

                    Registrations.Header.ID = Header.ID.ToString();
                    Registrations.Header.Prepared = Header.Prepared.ToString();
                    foreach (PartyType receiver in Header.Receiver)
                    {
                        Registrations.Header.Receiver.Contact = receiver.Contact;
                        Registrations.Header.Receiver.id = receiver.id;
                        Registrations.Header.Receiver.Name = receiver.Name;
                    }
                    Registrations.Header.Sender = (SDMXObjectModel.Message.SenderType)Header.Sender;
                    Registrations.Header.Test = Header.Test;

                    Registrations.Footer = null;
                    SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), Registrations, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Registrations" + "\\" + dirReg.Name + "\\" + regfile.ToString());
                }
            }

            foreach (DirectoryInfo dirMeta in dirMetadata.GetDirectories())
            {
                Files = null;
                Files = dirMeta.GetFiles();
                foreach (FileInfo metafile in Files)
                {
                    MetadataFiles = new SDMXObjectModel.Message.GenericMetadataType();

                    MetadataFiles = (SDMXObjectModel.Message.GenericMetadataType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.GenericMetadataType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Metadata" + "\\" + dirMeta.Name + "\\" + metafile.ToString());

                    MetadataFiles.Header.ID = Header.ID.ToString();
                    MetadataFiles.Header.Prepared = Header.Prepared.ToString();
                    MetadataFiles.Header.Receiver = Header.Receiver;
                    MetadataFiles.Header.Sender = (SDMXObjectModel.Message.SenderType)Header.Sender;
                    MetadataFiles.Header.Test = Header.Test;

                    MetadataFiles.Footer = null;
                    SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.GenericMetadataType), MetadataFiles, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Metadata" + "\\" + dirMeta.Name + "\\" + metafile.ToString());
                }
            }

            foreach (DirectoryInfo dirSDMX in dirSDMXML.GetDirectories())
            {
                Files = null;
                Files = dirSDMX.GetFiles();
                foreach (FileInfo sdmxMlFile in Files)
                {
                    DataFiles = new SDMXObjectModel.Message.StructureSpecificTimeSeriesDataType();

                    DataFiles = (SDMXObjectModel.Message.StructureSpecificTimeSeriesDataType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureSpecificTimeSeriesDataType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "SDMX-ML" + "\\" + dirSDMX.Name + "\\" + sdmxMlFile.ToString());

                    DataFiles.Header.ID = Header.ID.ToString();
                    DataFiles.Header.Prepared = Header.Prepared.ToString();
                    DataFiles.Header.Receiver = Header.Receiver;
                    DataFiles.Header.Sender = (SDMXObjectModel.Message.SenderType)Header.Sender;
                    DataFiles.Header.Test = Header.Test;

                    DataFiles.Footer = null;
                    SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureSpecificTimeSeriesDataType), DataFiles, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "SDMX-ML" + "\\" + dirSDMX.Name + "\\" + sdmxMlFile.ToString());
                }
            }

            foreach (DirectoryInfo dirSubs in dirSubscriptions.GetDirectories())
            {
                Files = null;
                Files = dirSubs.GetFiles();
                foreach (FileInfo subsFile in Files)
                {
                    Subscriptions = new SDMXObjectModel.Message.RegistryInterfaceType();

                    Subscriptions = (SDMXObjectModel.Message.RegistryInterfaceType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Subscriptions" + "\\" + dirSubs.Name + "\\" + subsFile.ToString());

                    Subscriptions.Header.ID = Header.ID.ToString();
                    Subscriptions.Header.Prepared = Header.Prepared.ToString();
                    foreach (PartyType receiver in Header.Receiver)
                    {
                        Subscriptions.Header.Receiver.Contact = receiver.Contact;
                        Subscriptions.Header.Receiver.id = receiver.id;
                        Subscriptions.Header.Receiver.Name = receiver.Name;
                    }
                    Subscriptions.Header.Sender = (SDMXObjectModel.Message.SenderType)Header.Sender;
                    Subscriptions.Header.Test = Header.Test;

                    Subscriptions.Footer = null;
                    SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), Subscriptions, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Subscriptions" + "\\" + dirSubs.Name + "\\" + subsFile.ToString());
                }
            }

        }
        catch (Exception ex)
        {
            RetVal = false;
            Global.CreateExceptionString(ex, null);
            //Global.WriteErrorsInLog("Creating CategoryScheme For Uploaded DSD From Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
        }
        finally
        {

        }

        return RetVal;
    }
Ejemplo n.º 25
0
 public GenericTimeSeriesDataQueryType()
 {
     this.queryField = new SDMXObjectModel.Query.GenericTimeSeriesDataQueryType();
     this.headerField = new BasicHeaderType();
 }