Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 /// <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;
 }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
        /// <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)
            {
                throw new NsiClientException(Resources.ExceptionNoTimeDimension);
            }

                this.RemoveComponent(dimension);
                if (!string.IsNullOrEmpty(startDate))
                {
                    var qc = new QueryComponent(dimension, concept, startDate, endDate);
                    this.UpdateComponentIndex(dimension, qc);
                }
        }