Using the Catalog API
The Catalog API provides methods which enable you to create a connection, add and delete objects such as tables, queries, business views in a catalog, and so on. Before you can use the Catalog API to perform certain tasks, you will have to create a Designer object and then get a Catalog API instance.
To create a Designer object:
To create a Designer object, use the constructor Designer(String path, String name, DesignerUserInfo user) in the Design API. The constructor has three parameters: the catalog path, catalog name, and the user ID and license key provided by Jinfonet.
The path needs to be a valid path to an existiing directory. The catalog name can be the name of an existing catalog when you want to open a catalog, or the name of a new catalog when you want to create a catalog. If you want to create a new catalog, the path directory should not already contain a catalog file.
To create the DesignerUserInfo instance, use the following constructor providing the user ID and the Server Designer License Key or Designer License Key you received when you purchased Logi JReport.
DesignerUserInfo userInfo=new DesignerUserInfo(Uid, key);
To get a Catalog API instance
To get a Catalog API instance, use the method getCatalogAPI() in the Design API. You need to first get an instance from Designer as follows.
Designer desg = new Designer(catalogPath, catalogName, userInfo);
CatalogAPI catalog = desg.getCatalogAPI();
Then with the methods in Logi JReport Catalog API, you can do the following:
- Creating a Connection
- Inserting a Table/View/Synonym
- Inserting a Stored Procedure
- Importing an SQL File
- Inserting a UDS
- Inserting a Business View
- Inserting a Formula, Summary, Parameter or a WHERE Portion
- Creating and Modifying a Query
- Inserting and Deleting an Object
- Getting Objects in a Catalog
- Refreshing the Reference Table of a Catalog
- Saving a Catalog
- Catalog API Sample