/// <summary> /// Returns the mapping store assignment level for the specified <paramref name="component"/>. /// </summary> /// <param name="component"> /// The component. /// </param> /// <returns> /// The mapping store assignment level for the specified <paramref name="component"/>. /// </returns> /// <exception cref="ArgumentOutOfRangeException"> /// <paramref name="component"/> has an unsupported assignment level. /// </exception> public static string GetMappingStoreAssignmentLevel(this IAttributeObject component) { string returnValue; switch (component.AttachmentLevel) { case AttributeAttachmentLevel.DataSet: returnValue = AttachmentLevelConstants.DataSet; break; case AttributeAttachmentLevel.Group: returnValue = AttachmentLevelConstants.Group; break; case AttributeAttachmentLevel.DimensionGroup: returnValue = AttachmentLevelConstants.Series; break; case AttributeAttachmentLevel.Observation: returnValue = AttachmentLevelConstants.Observation; break; default: throw new ArgumentOutOfRangeException("component", component.AttachmentLevel, Resources.ExceptionUnsupportedAttachmentLevel_); } return(returnValue); }
public Attribute(IAttributeObject attr) { if (attr.HasCodedRepresentation()) { this._codelist = attr.Representation.Representation.MaintainableReference.MaintainableId; this._codelistAgency = attr.Representation.Representation.MaintainableReference.AgencyId; this._codelistVersion = attr.Representation.Representation.MaintainableReference.Version; this._isCodelist = true; } else { this._isCodelist = false; } this._id = attr.Id; this._conceptRef = attr.ConceptRef.FullId; this._conceptSchemeId = attr.ConceptRef.MaintainableReference.MaintainableId; this._conceptSchemeAgency = attr.ConceptRef.MaintainableReference.AgencyId; this._conceptSchemeVersion = attr.ConceptRef.MaintainableReference.Version; this._assignmentStatus = attr.AssignmentStatus; this._attachmentLevel = attr.AttachmentLevel.ToString(); if (this._attachmentLevel == Org.Sdmxsource.Sdmx.Api.Constants.AttributeAttachmentLevel.DimensionGroup.ToString()) { _dimensionReferences = new List<string>(); foreach (string str_dim in attr.DimensionReferences) this._dimensionReferences.Add(str_dim); } this._mandatory = attr.Mandatory; this._names = new List<TextTypeWrapper>(); this._descriptions = new List<TextTypeWrapper>(); this._codelistItems = new List<Code>(); }
/// <summary> /// The insert attribute. /// </summary> /// <param name="attribute"> /// The attribute. /// </param> /// <param name="attAssLevelParameter"> /// The Attribute attachment level parameter. /// </param> /// <param name="attStatusParameter"> /// The Attribute assignment status parameter. /// </param> /// <param name="attIsTimeFormatParameter"> /// The Attribute is time format parameter. /// </param> private static void SetAttributeParameters(IAttributeObject attribute, IDataParameter attAssLevelParameter, IDataParameter attStatusParameter, IDataParameter attIsTimeFormatParameter) { if (attribute != null) { attAssLevelParameter.Value = attribute.GetMappingStoreAssignmentLevel(); attStatusParameter.Value = attribute.AssignmentStatus; if (attribute.TimeFormat) { attIsTimeFormatParameter.Value = TrueValue; } } }
/// <summary> /// Get all concepts contains in dsd /// </summary> /// <returns>List of ConceptCore </returns> internal List <IConceptObjectImpl> GetAllConceptsImpl() { if (_dsd == null) { return(null); } foreach (IConceptObjectImpl con in _dsd._Concepts) { IAttributeObject ao = _dsd.Immutated.Attributes.Where(att => att.Id == con.ConceptObjectCode).FirstOrDefault(); if (ao != null) { ((AttributeConcept)con).AttributeAttachmentLevelType = ao.AttachmentLevel; } } return(this._dsd._Concepts); //List<IConceptObjectImpl> concepts = new List<IConceptObjectImpl>(); //foreach (IComponent comp in _dsd.Components) //{ // switch (comp.StructureType.EnumType) // { // case SdmxStructureEnumType.Dimension: // if (((DimensionCore)comp).FrequencyDimension || // (((DimensionCore)comp).ConceptRole != null // && ((DimensionCore)comp).ConceptRole.Count(cr => cr.IdentifiableIds != null && cr.IdentifiableIds.Contains("FREQUENCY")) > 0)) // concepts.Add(new DimensionConcept(comp.Id, new List<SdmxObjectNameDescription>() { new SdmxObjectNameDescription() { Lingua = "en", Name = comp.Id } }) { DimensionType = DimensionTypeEnum.Frequency }); // else // concepts.Add(new DimensionConcept(comp.Id, new List<SdmxObjectNameDescription>() { new SdmxObjectNameDescription() { Lingua = "en", Name = comp.Id } }) { DimensionType = DimensionTypeEnum.Dimension }); // break; // case SdmxStructureEnumType.TimeDimension: // concepts.Add(new DimensionConcept(comp.Id, new List<SdmxObjectNameDescription>() { new SdmxObjectNameDescription() { Lingua = "en", Name = comp.Id } }) { DimensionType = DimensionTypeEnum.Time }); // break; // case SdmxStructureEnumType.DataAttribute: // AttributeConcept _concept = new AttributeConcept(comp.Id, new List<SdmxObjectNameDescription>() { new SdmxObjectNameDescription() { Lingua = "en", Name = comp.Id } }); // _concept.AttributeAttachmentLevelType = ((AttributeObjectCore)comp).AttachmentLevel; // _concept.AssignmentStatusType = (AssignmentStatusTypeEnum)Enum.Parse(typeof(AssignmentStatusTypeEnum), ((AttributeObjectCore)comp).AssignmentStatus); // concepts.Add(_concept); // break; // case SdmxStructureEnumType.PrimaryMeasure: // concepts.Add(new AttributeConcept(comp.Id, new List<SdmxObjectNameDescription>() { new SdmxObjectNameDescription() { Lingua = "en", Name = comp.Id } }) { IsValueAttribute = true }); // break; // } //} //return concepts; }
/// <summary> /// Initializes a new instance of the <see cref="AttributeMutableCore"/> class. /// </summary> /// <param name="objTarget"> /// The agencySchemeMutable target. /// </param> public AttributeMutableCore(IAttributeObject objTarget) : base(objTarget) { this._dimensionReferences = new List<string>(); this._conceptRoles = new List<IStructureReference>(); this._attachmentLevel = objTarget.AttachmentLevel; this._assignmentStatus = objTarget.AssignmentStatus; this._attachmentGroup = objTarget.AttachmentGroup; this._dimensionReferences = objTarget.DimensionReferences; this._primaryMeasureReference = objTarget.PrimaryMeasureReference; if (objTarget.ConceptRoles != null) { foreach (ICrossReference currentConceptRole in objTarget.ConceptRoles) { this._conceptRoles.Add(currentConceptRole.CreateMutableInstance()); } } }
/// <summary> /// Get the cross sectional measures that the attribute is linked to, returns an empty list if there is no cross sectional measures /// defined by the attribute. /// </summary> /// <param name="attributeObject"> /// The attribute. /// </param> /// <returns> /// The <see cref="IList{T}"/> . /// </returns> public virtual IList<ICrossSectionalMeasure> GetAttachmentMeasures(IAttributeObject attributeObject) { if (this._attributeToMeasuresMap.ContainsKey(attributeObject.Id)) { return this._attributeToMeasuresMap[attributeObject.Id]; } return new List<ICrossSectionalMeasure>(); }