Exemplo n.º 1
0
    private void Retrieve_Id_AgencyId_Version(ref string Id, ref string AgencyId, ref string Version, MaintainableWhereType ArtefactWhere)
    {
        if (ArtefactWhere != null)
        {
            if (ArtefactWhere.ID != null)
            {
                Id = ArtefactWhere.ID.Value;
            }

            if (ArtefactWhere.AgencyID != null)
            {
                AgencyId = ArtefactWhere.AgencyID.Value;
            }

            Version = ArtefactWhere.Version;
        }
    }
        /**
         * builds a complex structure reference from XML beans values.
         * @param maintainableWhere
         * @param childRef if items in the where clauses (for ItemSchemes) otherwise null
         * @return
         */
        private IComplexStructureReferenceObject BuildMaintainableWhere(MaintainableWhereType maintainableWhere, IComplexIdentifiableReferenceObject childRef)
        {
            QueryNestedIDType agencyIDType = maintainableWhere.AgencyID;
            IComplexTextReference agencyId = null;
            if (agencyIDType != null)
            {
                agencyId = BuildTextReference(null, [email protected](), agencyIDType.TypedValue);
            }

            QueryIDType queryIDType = maintainableWhere.ID;
            IComplexTextReference id = null;
            if (queryIDType != null)
            {
                id = BuildTextReference(null, [email protected](), queryIDType.TypedValue.ToString());
            }

            IComplexVersionReference versionRef = BuildVersionReference(maintainableWhere.Version != null ? maintainableWhere.Version.ToString() : null, maintainableWhere.VersionFrom, maintainableWhere.VersionTo);

            SdmxStructureType structureType;
            if (maintainableWhere.type.Equals("OrganisationScheme"))
            { // hack. This checked are done since it is not identifiable no element name in enum and cannot use parseClass()
                structureType = SdmxStructureType.GetFromEnum(SdmxStructureEnumType.OrganisationScheme);
            }
            else if (maintainableWhere.type.Equals("Constraint"))
            {
                structureType = SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ContentConstraint);
            }
            else if (maintainableWhere.type.Equals("Any"))
            {
                structureType = SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Any);
            }
            else
            {
                structureType = SdmxStructureType.ParseClass(maintainableWhere.type);
            }

            IComplexAnnotationReference annotationRef = BuildAnnotationReference(maintainableWhere.Annotation);

            QueryTextType nameType = maintainableWhere.Name;
            IComplexTextReference nameRef = null;
            if (nameType != null)
            {
                nameRef = BuildTextReference(nameType.lang, [email protected](), nameType.TypedValue.ToString());
            }


            QueryTextType descriptionType = maintainableWhere.Description;
            IComplexTextReference descriptionRef = null;
            if (descriptionType != null)
            {
                descriptionRef = BuildTextReference(descriptionType.lang, [email protected](), descriptionType.TypedValue.ToString());
            }


            return new ComplexStructureReferenceCore(agencyId, id, versionRef, structureType, annotationRef, nameRef, descriptionRef, childRef);
        }