Exemplo n.º 1
0
        public override List<ArtefactInfo> Generate_Artefact()
        {
            List<ArtefactInfo> RetVal;
            ArtefactInfo Artefact;
            SDMXObjectModel.Registry.NotifyRegistryEventType NotifyRegistryEvent;

            RetVal = null;

            try
            {
                NotifyRegistryEvent = new SDMXObjectModel.Registry.NotifyRegistryEventType();

                NotifyRegistryEvent.EventTime = this._eventTime;
                NotifyRegistryEvent.SubscriptionURN = this._subscriptionURN;
                NotifyRegistryEvent.EventAction = this._action;

                if (this._registrationNotificationFlag == true)
                {
                    NotifyRegistryEvent.Item = this._registrationId;
                    NotifyRegistryEvent.ItemElementName = NotifyRegistryEventChoiceType.RegistrationID;

                    NotifyRegistryEvent.Item1 = new RegistrationEventType();
                    ((RegistrationEventType)NotifyRegistryEvent.Item1).Registration = this._registration;
                }
                else
                {
                    NotifyRegistryEvent.Item = string.Empty;
                    NotifyRegistryEvent.ItemElementName = NotifyRegistryEventChoiceType.ObjectURN;

                    NotifyRegistryEvent.Item1 = new StructuralEventType();
                    ((StructuralEventType)NotifyRegistryEvent.Item1).Item = new StructuresType();

                    foreach (ArtefactRef ArtefactRef in this._artefacts)
                    {
                        if (ArtefactRef.ArtefactType == ArtefactTypes.DSD)
                        {
                            if (((StructuralEventType)NotifyRegistryEvent.Item1).Item.DataStructures == null)
                            {
                                ((StructuralEventType)NotifyRegistryEvent.Item1).Item.DataStructures = new List<SDMXObjectModel.Structure.DataStructureType>();
                            }

                            ((StructuralEventType)NotifyRegistryEvent.Item1).Item.DataStructures.Add(new SDMXObjectModel.Structure.DataStructureType(ArtefactRef.Id, ArtefactRef.AgencyId, ArtefactRef.Version, ArtefactRef.Name, ArtefactRef.Description, ArtefactRef.Language, null));
                        }

                        if (ArtefactRef.ArtefactType == ArtefactTypes.MSD)
                        {
                            if (((StructuralEventType)NotifyRegistryEvent.Item1).Item.MetadataStructures == null)
                            {
                                ((StructuralEventType)NotifyRegistryEvent.Item1).Item.MetadataStructures = new List<SDMXObjectModel.Structure.MetadataStructureType>();
                            }

                            ((StructuralEventType)NotifyRegistryEvent.Item1).Item.MetadataStructures.Add(new SDMXObjectModel.Structure.MetadataStructureType(ArtefactRef.Id, ArtefactRef.AgencyId, ArtefactRef.Version, ArtefactRef.Name, ArtefactRef.Description, ArtefactRef.Language, null));
                        }
                    }
                }

                // Preparing Artefact and saving
                Artefact = this.Prepare_ArtefactInfo_From_NotifyRegistryEvent(NotifyRegistryEvent);
                this.Add_ArtefactInfo_To_List(ref RetVal, Artefact);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }
 public NotifyRegistryEventType()
 {
     this.notifyRegistryEventField = new SDMXObjectModel.Registry.NotifyRegistryEventType();
     this.headerField = new BasicHeaderType();
 }