public Stream SearchTemplaterWithSpecificationQuery(string file, string domainObject, string specification, Stream body) { var type = Utility.CheckDomainObject(DomainModel, domainObject); var specType = Utility.CheckDomainObject(DomainModel, type, specification); if (specType.IsFailure || specType.Result == null) { return(specType.Error ?? Either <object> .BadRequest("Specification must be specified").Error); } var spec = Utility.ParseObject(Serialization, specType, body, false, Locator); return(SearchTemplater(file, domainObject, spec)); }
public Stream OlapCubeWithSpecificationQuery( string cube, string specification, string dimensions, string facts, string order, string limit, string offset, Stream body) { if (string.IsNullOrEmpty(specification)) { return(Either <object> .BadRequest("Specification must be specified").Error); } var cubeType = Utility.CheckDomainObject(DomainModel, cube); var specType = Utility.CheckDomainObject(DomainModel, cubeType, specification); return(OlapCube(cubeType, specType, dimensions, facts, order, limit, offset, body)); }
private Stream OlapCube( Either <Type> cubeType, Either <Type> specType, string templater, string dimensions, string facts, string order, string limit, string offset, Stream data) { var spec = Utility.ParseObject(Serialization, specType, data, true, Locator); if (cubeType.IsFailure || specType.IsFailure || spec.IsFailure) { return(cubeType.Error ?? specType.Error ?? spec.Error); } var dimArr = string.IsNullOrEmpty(dimensions) ? new string[0] : dimensions.Split(','); var factArr = string.IsNullOrEmpty(facts) ? new string[0] : facts.Split(','); if (dimArr.Length == 0 && factArr.Length == 0) { return(Either <object> .BadRequest("At least one dimension or fact must be specified").Error); } var ordDict = Utility.ParseOrder(order); int?intLimit, intOffset; Utility.ParseLimitOffset(limit, offset, out intLimit, out intOffset); return(Converter.PassThrough <OlapCubeReport, OlapCubeReport.Argument <object> >( new OlapCubeReport.Argument <object> { CubeName = cubeType.Result.FullName, TemplaterName = templater, SpecificationName = specType.Result != null ? specType.Result.FullName : null, Specification = spec.Result, Dimensions = dimArr, Facts = factArr, Order = ordDict, Limit = intLimit, Offset = intOffset })); }
private Stream OlapCube( Either <Type> cubeType, string dimensions, string facts, string order, Either <object> spec, string limit, string offset) { if (cubeType.IsFailure || spec.IsFailure) { return(cubeType.Error ?? spec.Error); } var dimArr = string.IsNullOrEmpty(dimensions) ? new string[0] : dimensions.Split(','); var factArr = string.IsNullOrEmpty(facts) ? new string[0] : facts.Split(','); if (dimArr.Length == 0 && factArr.Length == 0) { return(Either <object> .BadRequest("At least one dimension or fact must be specified").Error); } var ordDict = Utility.ParseOrder(order); int?intLimit, intOffset; Utility.ParseLimitOffset(limit, offset, out intLimit, out intOffset); return (Converter.PassThrough <AnalyzeOlapCube, AnalyzeOlapCube.Argument <object> >( new AnalyzeOlapCube.Argument <object> { CubeName = cubeType.Result.FullName, SpecificationName = null, Specification = spec.Result, Dimensions = dimArr, Facts = factArr, Order = ordDict, Limit = intLimit, Offset = intOffset })); }