public IDataQuerySelection AddDimensionToQuery(QueryComponent queryComponent, IComponent component) { ISet<string> valuern = new HashSet<string>(); foreach (ICode c in queryComponent.RetrieveCodes()) { if (!string.IsNullOrEmpty(c.Id)) { valuern.Add((c.Id)); } } IDataQuerySelection selection = new DataQueryDimensionSelectionImpl(component.Id, valuern); return selection; }
public IDataQuerySelection AddDimensionToQuery(QueryComponent queryComponent, IComponent component) { ISet <string> valuern = new HashSet <string>(); foreach (ICode c in queryComponent.RetrieveCodes()) { if (!string.IsNullOrEmpty(c.Id)) { valuern.Add((c.Id)); } } IDataQuerySelection selection = new DataQueryDimensionSelectionImpl(component.Id, valuern); return(selection); }
/// <summary> /// Saves a component which has an associated artefact (all of them should have). /// </summary> /// <param name="dimension"> /// the dimemnsion /// </param> /// <param name="codes"> /// the codes /// </param> public void SaveComponent(IDimension dimension, List<ICode> codes) { IConceptObject concept = this.GetCachedConcept(dimension); this.RemoveComponent(dimension); var qc = new QueryComponent(dimension, concept, codes); this._codeTreeMap[dimension].CheckCodes(codes); this.UpdateComponentIndex(dimension, qc); }
/// <summary> /// Saves a component which does not have an associated artefact. /// </summary> /// <param name="conceptRef"> /// the concept which identifies the component /// </param> /// <param name="value"> /// the value /// </param> public void SaveComponent(string conceptRef, string value) { IDimension dimension = Utils.GetComponentByName(this._keyFamily, conceptRef); IConceptObject concept = this.GetCachedConcept(dimension); this.RemoveComponent(dimension); var qc = new QueryComponent(dimension, concept, value); this.UpdateComponentIndex(dimension, qc); }
/// <summary> /// Update the <see cref="_queryComponentIndex"/> for the specified component with the specified <c>QueryComponent</c> /// </summary> /// <param name="component"> /// The ComponentBean /// </param> /// <param name="queryComponent"> /// The QueryComponent, can be null /// </param> public void UpdateComponentIndex(IComponent component, QueryComponent queryComponent) { int pos = this._componentIndex[component]; this._queryComponentIndex[pos] = queryComponent; }
/// <summary> /// Setter for the time dimension /// </summary> /// <param name="startYear"> /// The start year /// </param> /// <param name="endYear"> /// The end year /// </param> /// <param name="startDate"> /// The start date /// </param> /// <param name="endDate"> /// The end date /// </param> public void SetTimeComponent(string startDate, string endDate) { IDimension dimension = this.KeyFamily.TimeDimension; IConceptObject concept = this.GetCachedConcept(dimension); if (dimension == null) { //DA FARE FABIO //throw new NsiClientException(Resources.ExceptionNoTimeDimension); } this.RemoveComponent(dimension); if (!string.IsNullOrEmpty(startDate)) { var qc = new QueryComponent(dimension, concept, startDate, endDate); this.UpdateComponentIndex(dimension, qc); } }