/// <summary> /// The assemble scheme map. /// </summary> /// <param name="assembleInto"> /// The assemble into. /// </param> /// <param name="assembleFrom"> /// The assemble from. /// </param> public void AssembleSchemeMap(ItemSchemeMapType assembleInto, IItemSchemeMapObject assembleFrom) { // Populate it from inherited super this.AssembleMap(assembleInto, assembleFrom); //// Populate it using this class's specifics //// Child maps foreach (IItemMap eachMapBean in assembleFrom.Items) { // Defer child creation to subclass ItemAssociationType newMap = this.CreateNewMap(assembleInto); //// Annotations //// TODO RSG AWAITING MODEL CHANGES //// if(ObjectUtil.validCollection(eachMapBean.getAnnotations())) { //// newMap.setAnnotations(getAnnotationsType(eachMapBean)); //// } //// Common source and target id allocation LocalItemReferenceType sourceItemReference = this.CreateSourceItemReference(newMap); LocalItemReferenceType targetItemReference = this.CreateTargetItemReference(newMap); RefBaseType newSourceRef = this.CreateItemRef(sourceItemReference); newSourceRef.id = eachMapBean.SourceId; RefBaseType newTargetRef = this.CreateItemRef(targetItemReference); newTargetRef.id = eachMapBean.TargetId; SdmxStructureType stype = this.MapStructureType(); if (stype != null) { newSourceRef.@class = XmlobjectsEnumUtil.BuildV21(stype); newTargetRef.@class = XmlobjectsEnumUtil.BuildV21(stype); } } }
/// <summary> /// Initializes a new instance of the <see cref="ItemSchemeMapMutableCore"/> class. /// </summary> /// <param name="objTarget"> /// The obj target. /// </param> public ItemSchemeMapMutableCore(IItemSchemeMapObject objTarget) : base(objTarget) { this.items = new List<IItemMapMutableObject>(); if (objTarget.Items != null) { foreach (IItemMap item in objTarget.Items) { this.items.Add(new ItemMapMutableCore(item)); } } }
/// <summary> /// The process organisation scheme map. /// </summary> /// <param name="structureSetType"> /// The structure set type. /// </param> /// <param name="buildFrom"> /// The build from. /// </param> private void ProcessOrganisationSchemeMap(StructureSetType structureSetType, IItemSchemeMapObject buildFrom) { var orgSchemeMap = new OrganisationSchemeMapType(); structureSetType.OrganisationSchemeMap = orgSchemeMap; string str0 = buildFrom.Id; if (!string.IsNullOrWhiteSpace(str0)) { orgSchemeMap.id = buildFrom.Id; } IList<ITextTypeWrapper> names = buildFrom.Names; if (ObjectUtil.ValidCollection(names)) { orgSchemeMap.Name = this.GetTextType(names); } IList<ITextTypeWrapper> descriptions = buildFrom.Descriptions; if (ObjectUtil.ValidCollection(descriptions)) { orgSchemeMap.Description = this.GetTextType(descriptions); } if (buildFrom.SourceRef != null) { var refType = new OrganisationSchemeRefType(); orgSchemeMap.OrganisationSchemeRef = refType; SetOrganisationSchemeRefAttributes(refType, buildFrom.SourceRef); } if (buildFrom.TargetRef != null) { var refType0 = new OrganisationSchemeRefType(); orgSchemeMap.TargetOrganisationSchemeRef = refType0; SetOrganisationSchemeRefAttributes(refType0, buildFrom.TargetRef); } IList<IItemMap> itemMapBeans = buildFrom.Items; if (ObjectUtil.ValidCollection(itemMapBeans)) { /* foreach */ foreach (IItemMap itemMapBean in itemMapBeans) { var orgMaptype = new OrganisationMapType(); orgSchemeMap.OrganisationMap.Add(orgMaptype); string str1 = itemMapBean.SourceId; if (!string.IsNullOrWhiteSpace(str1)) { orgMaptype.OrganisationID = itemMapBean.SourceId; } string str2 = itemMapBean.TargetId; if (!string.IsNullOrWhiteSpace(str2)) { orgMaptype.TargetOrganisationID = itemMapBean.TargetId; } } } if (this.HasAnnotations(buildFrom)) { orgSchemeMap.Annotations = this.GetAnnotationsType(buildFrom); } }
/// <summary> /// The process codelist map. /// </summary> /// <param name="structureSetType"> /// The structure set type. /// </param> /// <param name="buildFrom"> /// The build from. /// </param> private void ProcessCodelistMap(StructureSetType structureSetType, IItemSchemeMapObject buildFrom) { var codelistMap = new CodelistMapType(); structureSetType.CodelistMap = codelistMap; string str0 = buildFrom.Id; if (!string.IsNullOrWhiteSpace(str0)) { codelistMap.id = buildFrom.Id; } IList<ITextTypeWrapper> names = buildFrom.Names; if (ObjectUtil.ValidCollection(names)) { codelistMap.Name = this.GetTextType(names); } IList<ITextTypeWrapper> descriptions = buildFrom.Descriptions; if (ObjectUtil.ValidCollection(descriptions)) { codelistMap.Description = this.GetTextType(descriptions); } if (buildFrom.SourceRef != null) { if (buildFrom.SourceRef.TargetReference.EnumType == SdmxStructureEnumType.CodeList) { var refType = new CodelistRefType(); codelistMap.CodelistRef = refType; SetCodelistRefAttributes(refType, buildFrom.SourceRef); } else if (buildFrom.SourceRef.TargetReference.EnumType == SdmxStructureEnumType.HierarchicalCodelist) { var refType0 = new HierarchicalCodelistRefType(); codelistMap.HierarchicalCodelistRef = refType0; SetHclRefAttributes(refType0, buildFrom.SourceRef); } } if (buildFrom.TargetRef != null) { if (buildFrom.TargetRef.TargetReference.EnumType == SdmxStructureEnumType.CodeList) { var refType1 = new CodelistRefType(); codelistMap.TargetCodelistRef = refType1; SetCodelistRefAttributes(refType1, buildFrom.TargetRef); } else if (buildFrom.TargetRef.TargetReference.EnumType == SdmxStructureEnumType.HierarchicalCodelist) { var refType2 = new HierarchicalCodelistRefType(); codelistMap.TargetHierarchicalCodelistRef = refType2; SetHclRefAttributes(refType2, buildFrom.TargetRef); } } IList<IItemMap> itemMapBeans = buildFrom.Items; if (ObjectUtil.ValidCollection(itemMapBeans)) { /* foreach */ foreach (IItemMap itemMapBean in itemMapBeans) { var codeMaptype = new CodeMapType(); codelistMap.CodeMap.Add(codeMaptype); string value1 = itemMapBean.SourceId; if (!string.IsNullOrWhiteSpace(value1)) { codeMaptype.MapCodeRef = itemMapBean.SourceId; } string value = itemMapBean.TargetId; if (!string.IsNullOrWhiteSpace(value)) { codeMaptype.MapTargetCodeRef = itemMapBean.TargetId; } } } if (this.HasAnnotations(buildFrom)) { codelistMap.Annotations = this.GetAnnotationsType(buildFrom); } }