Exemplo n.º 1
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            if (DTO.Format.FrmDirection != FormatDirection.DOWNLOAD.ToString())
            {
                return(false);
            }

            ////See if this request has cached data
            MemCachedD_Value cache = MemCacheD.Get_BSO <dynamic>("PxStat.Data", "Cube_API", "ReadPreMetadata", DTO);

            if (cache.hasData)
            {
                Response.data = cache.data;
                return(true);
            }

            var item   = new Matrix_ADO(Ado).Read(DTO.release, DTO.language, SamAccountName);
            var result = Release_ADO.GetReleaseDTO(item);

            if (result == null)
            {
                Response.data = null;
                return(true);
            }

            DTO.language = item.LngIsoCode;
            return(Cube_BSO_ReadMetadata.ExecuteReadMetadata(Ado, DTO, result, Response, false));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            if (DTO.Format.FrmDirection != FormatDirection.DOWNLOAD.ToString())
            {
                return(false);
            }

            var item   = new Matrix_ADO(Ado).Read(DTO.release, DTO.language, SamAccountName);
            var result = Release_ADO.GetReleaseDTO(item);

            if (result == null)
            {
                Response.data = null;
                return(true);
            }

            DTO.language = item.LngIsoCode;
            return(Cube_BSO_ReadMetadata.ExecuteReadMetadata(Ado, DTO, result, Response));
        }
Exemplo n.º 3
0
        /// <summary>
        ///  Reads the metadata for a live dataset based on specific criteria. RESTful version
        /// </summary>
        /// <param name="restfulRequest"></param>
        /// <returns></returns>
        public static dynamic ReadMetadata(RESTful_API restfulRequest)
        {
            //A pre-validation. If a validation problem is found then an output containing the error will be created and returned immediately
            var vldOutput = ValidateRest <Cube_VLD_REST_ReadMetadata>(restfulRequest, new Cube_VLD_REST_ReadMetadata());

            if (vldOutput != null)
            {
                return(vldOutput);
            }

            //Map the RESTful request to an equivalent Json Rpc request
            JSONRPC_API jsonRpcRequest = Map.RESTful2JSONRPC_API(restfulRequest);

            //Map the parameters - this is specific to the function
            Cube_MAP map = new Cube_MAP();

            jsonRpcRequest.parameters = map.ReadMetadata_MapParameters(jsonRpcRequest.parameters);

            //Run the request as a Json Rpc call
            JSONRPC_Output rsp = new Cube_BSO_ReadMetadata(jsonRpcRequest).Read().Response;

            //Convert the JsonRpc output to RESTful output
            return(Map.JSONRPC2RESTful_Output(rsp, map.MimeType, HttpStatusCode.NotFound, HttpStatusCode.InternalServerError));
        }