First, initialization of DS and Conn at system startup
1, query out the current system has datasources and connections into memory 2, than the DS in the Saiku-datasources whether there is new, if any, create a new DS
Second, the landing authorization to obtain all the connections after successful
1, querying the OLAP data connection (cubesconnectionlist) List http://Localhost:8080/saiku/rest/saiku/a1/discoverOlapdiscoverresource-getconnections ()2, according to a single connection parse out the catalog schema cube "Sessionworkspace.js"var connection = This.connections[i];var Catalog = Connection.catalogs[j];var schema = Catalog.schemas[k];var cube = schema.cubes[l ];3, pieced together into interactive id-key according to this ID to goNewCube ({key:key}) "Sessionworkspace.js"var key = Connection.Name + "/" + Catalog.name + "/" + ((schema.name = = = "" | | Schema.name = = = null)? "NULL": Schema.name) + "/" + encodeURIComponent (cube.name); This completes the operation to get connections
Third, get Repositorylist (warehouse list)
http//Localhost:8080/saiku/rest/saiku/api/repository?type=saiku,sdbBasicRepositoryResource2-Getrepository ()
The returned repositorylist are as follows:
ID NAME TYPE ACL #/datasources datasources FOLDER [READ, WRITE]#/etc FOLDER [READ, WRITE]#/etc/legacyreports legacyreports FOLDER [READ, WRITE]#/etc/theme theme FOLDER [READ, WRITE]#/etc/theme/legacyreports legacyreports FOLDER [READ, WRITE]#/homes Homes FOLDER [READ]#/HOMES/HOME:A1 home:a1 FOLDER [READ, WRITE, GRANT]
Iv. acquisition of license
http://localhost:8080/saiku/rest/saiku/api/license
Five, Query cube
Inquiry IDEA Analysis:
New+ "/discover/" + Args.key + "/metadata"- getmetadata () backend Rest interface Required Parameters: @Path ("/saiku/ {username}/discover ") + @Path ("/{connection}/{catalog}/{schema}/{cube}/metadata ") + Key parameters returned after successful model:saikucubemetadata |-dimensions |-measures |-properties
Background processing code: @GET @produces ({"Application/json"}) @Path ("/{connection}/{catalog}/{schema}/{cube}/metadata") Publicsaikucubemetadata GetMetaData (@PathParam ("Connection") String connectionname, @PathParam ("Catalog") String catalogname, @PathParam ("Schema") String SchemaName, @PathParam ("Cube") String cubename) {if("null". Equals (SchemaName)) {SchemaName= ""; } //Get CubeSaikucube cube =NewSaikucube (ConnectionName, Cubename,cubename,cubename, CatalogName, schemaName); Try { //get dimensions/measures/properties based on Cubelist<saikudimension> dimensions =Olapdiscoverservice. getalldimensions (cube); List<SaikuMember> measures =Olapdiscoverservice. Getmeasures (cube); Map<string, object> properties =Olapdiscoverservice. getProperties (cube); return NewSaikucubemetadata (dimensions, measures, properties); } Catch(Exception e) {log.error ( This. GetClass (). GetName (), E); } return NewSaikucubemetadata (NULL,NULL,NULL);}
The following parameters are obtained for all cubes in the demo: {Connectionname}{catalogname}{schemaname}{cubename} (1) Earthquakes/Earthquakes/global%20Earthquakes/global%20Earthquakes/earthquakeshttp://localhost:8080/saiku/rest/saiku/a1/discover/earthquakes/global%20earthquakes/global%20earthquakes/ Earthquakes/metadata?key=earthquakes%2fglobal+earthquakes%2fglobal+earthquakes%2fearthquakes(2) HR/FoodMart/FoodMart/FoodMart/hrhttp://Localhost:8080/saiku/rest/saiku/a1/discover/foodmart/foodmart/foodmart/hr/metadata?key=foodmart%2ffoodmart %2FFOODMART%2FHR(3) Sales/FoodMart/FoodMart/FoodMart/saleshttp://localhost:8080/saiku/rest/saiku/a1/discover/foodmart/foodmart/foodmart/sales/metadata?key=foodmart% 2ffoodmart%2ffoodmart%2fsales(4) sales%202/FoodMart/FoodMart/FoodMart/sales%202http://localhost:8080/saiku/rest/saiku/a1/discover/foodmart/foodmart/foodmart/sales%202/metadata?key=foodmart% 2ffoodmart%2ffoodmart%2fsales%25202(5) sales%202/FoodMart/FoodMart/FoodMart/storehttp://localhost:8080/saiku/rest/saiku/a1/discover/foodmart/foodmart/foodmart/store/metadata?key=foodmart% 2ffoodmart%2ffoodmart%2fstore(6) Warehouse/FoodMart/FoodMart/FoodMart/warehousehttp://localhost:8080/saiku/rest/saiku/a1/discover/foodmart/foodmart/foodmart/warehouse/metadata?key=foodmart% 2ffoodmart%2ffoodmart%2fwarehouse(7) warehouse%20and%20Sales/FoodMart/FoodMart/FoodMart/warehouse%20and%20Saleshttp://Localhost:8080/saiku/rest/saiku/a1/discover/foodmart/foodmart/foodmart/warehouse%20and%20sales/metadata? Key=foodmart%2ffoodmart%2ffoodmart%2fwarehouse%2520and%2520sales
Saiku-Query cubes after successful system login