Exemple #1
0
        /// <summary>
        /// Parse request from <paramref name="input"/>
        /// </summary>
        /// <param name="input">
        /// The reader for the SDMX-ML or REST request
        /// </param>
        /// <returns>
        /// The <see cref="IStreamController{TWriter}"/>.
        /// </returns>
        public IStreamController <TWriter> ParseRequest(IRestDataQuery input)
        {
            if (input == null)
            {
                throw new SdmxSemmanticException(Resources.ErrorOperationNotAccepted);
            }

            IDataQuery dataQuery = new DataQueryImpl(input, this._sdmxRetrievalManager);

            this._log.DebugFormat("Converted REST data query '{0}' to IDataQuery {1}", input, dataQuery);
            return(this.ParseRequest(dataQuery));
        }
Exemple #2
0
        /// <summary>
        /// Parse a Query SDMX REST and create SelectionGroups
        /// </summary>
        /// <param name="SdmxRetrievalManager"></param>
        public void BuildRestQuery(Org.Sdmxsource.Sdmx.Api.Manager.Retrieval.ISdmxObjectRetrievalManager SdmxRetrievalManager)
        {
            try
            {
                this.SelectionGroups = new List <IDataWhereStatmentSelectionGroup>();

                IDataQuery dataQuery = new DataQueryImpl(this.Query, SdmxRetrievalManager);
                if (dataQuery == null)
                {
                    throw new SdmxException(this, FlyExceptionObject.FlyExceptionTypeEnum.RetrivalParsingError);
                }

                foreach (var item in dataQuery.SelectionGroups)
                {
                    this.SelectionGroups.Add(new DataWhereStatmentSelectionGroup(item));
                }
            }
            catch (SdmxException) { throw; }
            catch (Exception ex)
            {
                throw new SdmxException(this, FlyExceptionObject.FlyExceptionTypeEnum.ParsingQueryError, ex);
            }
        }