Inserting a business cube, report cube or business view
The following methods are used to insert a business cube or report cube into a catalog and to return the handle of the newly inserted object if it is inserted successfully, otherwise null if there is a failure:
- insertBusinessView(String dataSourceName, String queriableName, String businessViewName)
- insertBusinessView(String dataSourceName, String queriableName, String businessViewName, boolean isLogicView=true)
To insert a business view, you can only use the following method:
- insertBusinessView(String dataSourceName, String queriableName, String businessViewName, boolean isLogicView=false)
Parameters
- dataSourceName - The mapping name of the data source in the catalog to which you want to insert the object.
- queriableName - The queriable object's mapping name. The queriable object in JReport catalog could be a query, UDS, stored procedure or imported SQL. If queriableName is a valid name of an existing queriable object, a report cube or business view will be created; if it is null or does not exist, a business cube will be created.
- businessViewName - The name of the business cube, report cube or business view.
- isLogicView - Indicates whether to insert a business cube/report cube or a business view. If it is true, a business cube/report cube will be created, otherwise, a business view will be created.
Adding elements to business cube/report cube
When you have a business cube or report cube created successfully, you can add elements into it. A business cube/report cube can contain the following elements: categories, dimension objects, measure objects, and detail information objects.
The following methods are used to insert a cube element into a business cube or report cube and to return the handle of the newly inserted object if it is inserted successfully, otherwise null if there is a failure:
- insertBLCategory(String parentHandle, BLCategoryInfo info)
- insertBLDimension(String parentHandle, BLDimensionInfo info)
- insertBLMeasure(String parentHandle, BLMeasureInfo info)
- insertBLDetail(String parentHandle, BLDetailInfo info)
Parameters
- parentHandle - The handle of the parent object. It can be a business cube/report cube or a category.
- info - The definition class of the cube element. It can contain its children's definition.
Adding elements to business view
Similarly, you can add elements into a business view using the following methods, which include categories, group objects, aggregation objects and detail objects:
- insertBusinessViewCategory(String parentHandle, BusinessViewCategoryInfo info)
- insertBusinessViewGroup(String parentHandle, BVGroupInfo info)
- insertBusinessViewAggregation(String parentHandle, BVAggregationInfo info)
- insertBusinessViewDetail(String parentHandle, BVDetailInfo info)
Parameters
- parentHandle - The handle of the parent object. It can be a business view or a category.
- info - The definition class of the view element. It can contain its children's definition.
See an example: The sample TestCatalogBC.java in <install_root>\help\samples\APICatalog
shows how to create a report cube using the Catalog API.