jet.api
Class MultipliedCatalogAPI

java.lang.Object
  extended by jet.api.API
      extended by jet.api.CatalogAPI
          extended by jet.api.MultipliedCatalogAPI

public class MultipliedCatalogAPI
extends CatalogAPI

The CatalogAPI class allows an application to create and manipulate JReport catalog objects. By building a CatalogAPI instance in a Java program, users can edit a catalog by methods provided by API.

JReport catalog and its objects are stored in a tree structure. An instance of CatalogAPI can retrieve each object in the catalog by its handle. The handle of the catalog object is named by its qualified and unique instance name. Besides the handle, some catalog objects also have resource names, such as query, table, table column, and formula. And the resource name of table, field(formula,parameter) also be called mapping name. The mapping name maps the real name of a database object to JReport catalog's name.

The following are the objects that a JReport catalog can hold:

A CatalogAPI instance can be generated by a Designer instance. Below is an example of the use of the CatalogAPI.

 
  MultipliedDesigner dr = null;
  try
  {
        String path = %install root%/JReport/demo/reports/SampleReports/;
        String catName = "SampleReports.cat";
        DesignerUserInfo userInfo=new DesignerUserInfo("UID", "license key");
        dr = new  MultipliedDesigner(path, catName,Designer.CAT,userInfo);
        MultipliedCatalogAPI cat = dr.getCatalogAPI();
  }
  catch(Exception e)
  {
        ;
  }
  finally
  {
        dr.exit();
  }
 


Field Summary
 
Fields inherited from class jet.api.CatalogAPI
ALIAS, AVERAGE, BINARY, BOOLEAN, BUSINESSLOGIC, BUSINESSLOGIC_CATEGORY, BUSINESSLOGIC_DETAILINFO, BUSINESSLOGIC_DIMENSION, BUSINESSLOGIC_HIERARCHY, BUSINESSLOGIC_HIERARCHYCONTAINER, BUSINESSLOGIC_MEASURE, BUSINESSVIEW, BUSINESSVIEW_AGGREGATION, BUSINESSVIEW_DETAIL, BUSINESSVIEW_GROUP, CATALOG, COLUMN, CONNECTION, COUNT, CURRENCY, DATABASE, DATE, DATETIME, DECIMAL, DISTINCTCOUNT, ENCODINGAUTO, ENCODINGNO, ENCODINGYES, EXTRA_NAME_JDBC, EXTRA_NAME_USERDEFINED, FILESQL, FORMULA, HDS, INTEGER, JDBC, JDBC_ODBC_BRIDGE, MAXIMUM, MINIMUM, NUMBER, ONDEMAND_QUERY, PARAMETER, PARAMETERS, PATTERN_1PART_NAME, PATTERN_2PART_NAME, PATTERN_3PART_NAME, POPULATIONSTDDEV, POPULATIONVARIANCE, PROCEDURE, QUERY, READ_ONLY_DEFAULT, READ_ONLY_FALSE, READ_ONLY_TRUE, RUNNING_AVERAGE, RUNNING_COUNT, RUNNING_DISTINCTCOUNT, RUNNING_MAXIMUM, RUNNING_MINIMUM, RUNNING_SUM, STDDEV, STRING, SUM, SUMMARY, SYNONYM, TABLE, TIME, TRANSACTION_DEFAULT, TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE, UDS, UNIFIEDBUSINESSVIEW, VARIANCE, VIEW, WHEREPORTION, WSDLTYPE_LOCALEFILE, WSDLTYPE_URI, XML_CONNECTION, XML_MDCONTAINER
 
Fields inherited from class jet.api.API
CAT, CENTIMETER, COLOR, DOUBLE, ENUM, FLOAT, INCH, LONG, PIXEL, REFERENCE, RPT, SELFRPT, TEXTRPT, UNKNOWN, XMLCAT, XMLRPT
 
Constructor Summary
MultipliedCatalogAPI(java.lang.String path, java.lang.String name, java.lang.String suffix)
          Constructor.
 
Method Summary
 java.lang.String getBLNodeQualifyDisplayName(java.lang.String handle)
          Gets BusinessLogic node's qualified display name.
 java.lang.String getHandle(java.lang.String resourceName, int type)
          Gets the handle of an object according to the object's resource name and object type, which can identify the object in the catalog.
 java.lang.String getHandle(java.lang.String dataSourceName, java.lang.String resourceName, int type)
          Gets the handle of an object according to the object's resource name and object type in the specified data source in JReport catalog, which can identify the object in the catalog.
 ObjectInfo getObjectInfo(java.lang.String handle)
          Gets resource entity's information of an object in the catalog.
 ObjectInfo getObjectInfo(java.lang.String resourceName, int type)
          Gets resource entity's information of an object in catalog.
 ObjectInfo getObjectInfo(java.lang.String dataSourceName, java.lang.String resourceName, int type)
          Gets resource entity's information of an object in the catalog.
 void rename(java.lang.String resourceName, java.lang.String newName, int type)
          Renames the specified object.
 void rename(java.lang.String dataSourceName, java.lang.String resourceName, java.lang.String newName, int type)
          Renames the resource name of the specified object.
 boolean save()
          Saves an open catalog.
 boolean saveAs(java.lang.String path, java.lang.String name)
          Saves an open catalog as a new catalog file.
 
Methods inherited from class jet.api.CatalogAPI
checkParam, create, delete, delete, delete, delete, delete, delete, delete, delete, delete, delete, deleteCompCol, deleteCompCol, deleteCondition, deleteQBE, deleteQuery, deleteQuery, deleteQueryField, deleteQueryTable, deleteUnionQuery, getAndConditions, getAndConditions, getAndInfos, getAndInfos, getBLCategoryHandles, getBLDetailHandles, getBLDimensionHandles, getBLFilterInfo, getBLFilterInfos, getBLHierarchyHandles, getBLMeasureHandles, getBLNodeQualifyName, getBLViewHandles, getBLViewHandles, getBLViewNames, getBLViewNames, getBusinessNodeNames, getBusinessViewAggregationHandles, getBusinessViewDetailHandles, getBusinessViewGroupHandles, getBusinessViewHandles, getBusinessViewHandles, getBusinessViewNames, getBusinessViewNames, getBusinesViewCategoryHandles, getChartFunctions, getChartFunctions, getColumnMappingnames, getColumnMappingnames, getColumns, getColumns, getColumnsCanBeGroupedBy, getColumnsCanBeGroupedBy, getCompColumnHandles, getCompColumns, getCompColumns, getConnectionInfo, getConnectionInfo, getConnectionInfo, getDataSources, getDBFields, getDBFields, getDefaultConnectionName, getDefaultDataSourceName, getForeignKeys, getForeignKeys, getForeignKeys, getFormulae, getFormulae, getFormulaeCanBeGroupedBy, getFormulaeCanBeGroupedBy, getFormulaeCanBeGroupedBy, getFormulaeForQuery, getFormulaeForQuery, getFormulaInfo, getFormulasCanBeGroupedBy, getFunctions, getFunctions, getFunctions, getHDSs, getHDSs, getJoinInfos, getJoinInfos, getJoins, getJoins, getMapColumns, getMapColumns, getMappingname, getMappingnames, getMappingnames, getNewFormulaName, getNewFormulaName, getNewQueryName, getNewQueryName, getNewReportName, getParameter, getParameter, getParameterCanBeGroupedBy, getParameterCanBeGroupedBy, getParameterInfo, getPredifinedFilterHandles, getPrimaryKeys, getPrimaryKeys, getPrimaryKeys, getProcColumns, getProcColumns, getProcColumnsMap, getProcColumnsMap, getProcedureNames, getProcedureNames, getQBEInfo, getQBEInfo, getQBEInfos, getQBEInfos, getQueries, getQueries, getQuoteChar, getQuoteChar, getQuoteChar, getSPFields, getSPFieldsMap, getSQLColumns, getSQLColumns, getSQLColumnsMap, getSQLColumnsMap, getSQLs, getSQLs, getSQLString, getSQLString, getSQLType, getSQLType, getSubQueries, getSubQueries, getSummaries, getSummaries, getSummariesForQuery, getSummariesForQuery, getSummaryCanBeSortedBy, getSummaryCanBeSortedBy, getSummaryInfo, getTableColumns, getTableColumns, getTableColumns, getTableColumns, getTableColumnsMap, getTableColumnsMap, getTableColumnsMap, getTableColumnsMap, getTables, getTables, getTables, getTables, getTables, getUDSColumns, getUDSColumns, getUDSColumnsMap, getUDSColumnsMap, getUDSs, getUDSs, getUnionableQueries, getUnionableQueries, getUnionInfos, getUnionInfos, getUnionQueries, getUnionQueries, getUnionQueries, getUnionQueries, getUserID, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insertBLCategory, insertBLDetail, insertBLDimension, insertBLHierarchy, insertBLMeasure, insertBusinessView, insertBusinessView, insertBusinessViewAggregation, insertBusinessViewCategory, insertBusinessViewCategory, insertBusinessViewDetail, insertBusinessViewGroup, insertClassHDS, insertCompCol, insertCompCol, insertPredefinedBLFilterInfo, insertSql, insertSql, insertStoredProcedure, insertTable, insertWSDLConnection, insertXMLHDS, isDistinctQuery, isModified, isNameExist, isNameExist, mapFunction, parseFormula, parseFormula, parseFormulae, parseFormulae, refreshReference, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setCompCol, setCompCol, setCondition, setDefaultConnection, setDefaultDataSource, setDistinctQuery, setJoin, setModified, setQBE, setQueryField, setQueryTable, setQueryTable, setQueryTable, updateSQLFile, updateSQLFile, updateUDS, updateUDS
 
Methods inherited from class jet.api.API
clearError, clearMsg, clearWarning, closeLog, containPropName, getBool, getChildren, getClassType, getColor, getDouble, getError, getFloat, getHandles, getHandles, getHandles, getHandles, getInstanceName, getInt, getLong, getParent, getPropNames, getPropType, getQualifyName, getString, getStringArray, getUnit, getWarning, set, set, set, set, set, set, set, setLog, setLog, setLog, setReference, setUnit, writeLog, writeLog
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipliedCatalogAPI

public MultipliedCatalogAPI(java.lang.String path,
                            java.lang.String name,
                            java.lang.String suffix)
                     throws jet.jetc.ReadFailureException,
                            jet.universe.exception.UniverseFileException
Constructor. Creates a MultipliedCatalogAPI object.

Parameters:
path - The catalog file's path. It is the full path of the file.
name - The catalog file's name.
suffix - The suffix of the catalog file's name.
Throws:
jet.jetc.ReadFailureException
jet.universe.exception.UniverseFileException
Method Detail

save

public boolean save()
             throws jet.jetc.WriteFailureException,
                    jet.universe.exception.FMLFileException
Saves an open catalog. All modifications of the catalog's object will be saved.

Overrides:
save in class CatalogAPI
Returns:
true if the catalog object is saved successfully; false otherwise.
Throws:
jet.jetc.WriteFailureException - if the catalog fails to save the catalog file.
jet.universe.exception.FMLFileException - if the catalog fails to compile the java class of the formula in the catalog.

saveAs

public boolean saveAs(java.lang.String path,
                      java.lang.String name)
Saves an open catalog as a new catalog file. All modifications of the catalog's object will be saved.

Overrides:
saveAs in class CatalogAPI
Parameters:
path - The file path of the new catalog file. It is the full path of the file.
name - The file name of the new catalog file.
Returns:
true if the catalog file is saved successfully; false otherwise.

getHandle

public java.lang.String getHandle(java.lang.String resourceName,
                                  int type)
Gets the handle of an object according to the object's resource name and object type, which can identify the object in the catalog. resource name is not the unique name of the object in the catalog.

Overrides:
getHandle in class CatalogAPI
Parameters:
resourceName - Indicates the resource name of the object in the catalog.
type - indicates the type of the object by constant object type value. The CatalogAPI class provides a number of convenient constants that you can use to specify catalog objects. For example,
 
  • CatalogAPI.CONNECTION
  • CatalogAPI.TABLE
  • CatalogAPI.VIEW
  • CatalogAPI.QUERY
  • CatalogAPI.PROCEDURE
  • CatalogAPI.FILESQL
  • CatalogAPI.UDS
  • CatalogAPI.FORMULA
  • CatalogAPI.SUMMARY
  • CatalogAPI.PARAMETER
  • CatalogAPI.WHEREPORTION
  • CatalogAPI.UNIFIEDBUSINESSVIEW
  • CatalogAPI.BUSINESSLOGIC_CATEGORY
  • CatalogAPI.BUSINESSLOGIC_DIMENSION
  • CatalogAPI.BUSINESSLOGIC_MEASURE
  • CatalogAPI.BUSINESSLOGIC_FILTER
  • CatalogAPI.BUSINESSLOGIC_DETAILINFO
  • CatalogAPI.BUSINESSLOGIC_HIERARCHY
  • CatalogAPI.BUSINESSLOGIC_HIERARCHYCONTAINER
  • #ONDEMAND_QUER
  • #XML_CONNECTION
  • {@link #BUSINESSVIEW_GROUP}
  • {@link #BUSINESSVIEW_AGGREGATION}
  • {@link #BUSINESSVIEW_DETAIL}
  • Returns:
    a String specifying the handle of the object.
    See Also:
    getHandle(String, String, int)

    getHandle

    public java.lang.String getHandle(java.lang.String dataSourceName,
                                      java.lang.String resourceName,
                                      int type)
    Gets the handle of an object according to the object's resource name and object type in the specified data source in JReport catalog, which can identify the object in the catalog. resource name is not the unique name of the object in the catalog.

    Overrides:
    getHandle in class CatalogAPI
    Parameters:
    dataSourceName - Indicates the resource name of the data source to get the object's handle. If it is null or "", it means it is the default data source in the catalog.
    resourceName - Indicates the resource name of the object in the specified data source.
    type - Indicates the type of the object by constant object type value. The CatalogAPI class provides a number of convenient constants that you can use to specify catalog objects. For example,
     
  • CatalogAPI.CONNECTION
  • CatalogAPI.TABLE
  • CatalogAPI.VIEW
  • CatalogAPI.QUERY
  • CatalogAPI.PROCEDURE
  • CatalogAPI.FILESQL
  • CatalogAPI.UDS
  • CatalogAPI.FORMULA
  • CatalogAPI.SUMMARY
  • CatalogAPI.PARAMETER
  • CatalogAPI.WHEREPORTION
  • CatalogAPI.BUSINESSLOGIC - The businesslogic of JReport also named Business/Report Cube.
  • CatalogAPI.BUSINESSLOGIC_CATEGORY
  • CatalogAPI.BUSINESSLOGIC_DIMENSION
  • CatalogAPI.BUSINESSLOGIC_MEASURE
  • CatalogAPI.BUSINESSLOGIC_FILTER
  • CatalogAPI.BUSINESSLOGIC_DETAILINFO
  • CatalogAPI.BUSINESSLOGIC_HIERARCHY
  • CatalogAPI.BUSINESSLOGIC_HIERARCHYCONTAINER
  • #ONDEMAND_QUER
  • #XML_CONNECTION
  • {@link #BUSINESSVIEW_GROUP}
  • {@link #BUSINESSVIEW_AGGREGATION}
  • {@link #BUSINESSVIEW_DETAIL}
  • Returns:
    null if there is no matching object, otherwise returns a String specifying the handle of the object.

    rename

    public void rename(java.lang.String resourceName,
                       java.lang.String newName,
                       int type)
    Renames the specified object.

    Overrides:
    rename in class CatalogAPI
    Parameters:
    resourceName - Resource name(mapping name) of the object.
    newName - New resource name of the object.
    type - Indicates the type of the object by constant object type value. The CatalogAPI class provides a number of convenient constants that you can use to specify catalog objects. For example,
     
  • CatalogAPI.CONNECTION
  • CatalogAPI.TABLE
  • CatalogAPI.VIEW
  • CatalogAPI.QUERY
  • CatalogAPI.PROCEDURE
  • CatalogAPI.FILESQL
  • CatalogAPI.UDS
  • CatalogAPI.FORMULA
  • CatalogAPI.SUMMARY
  • CatalogAPI.PARAMETER
  • CatalogAPI.WHEREPORTION
  • #ONDEMAND_QUER
  • {@link #XML_CONNECTION

  • rename

    public void rename(java.lang.String dataSourceName,
                       java.lang.String resourceName,
                       java.lang.String newName,
                       int type)
    Renames the resource name of the specified object.

    Overrides:
    rename in class CatalogAPI
    Parameters:
    dataSourceName - Indicates the resource name of the data source in the catalog.
    resourceName - Resource name(mapping name) of the object.
    newName - New resource name of the object.
    type - Indicates the type of the object by constant object type value. The CatalogAPI class provides a number of convenient constants that you can use to specify catalog objects. For example,
     
  • CatalogAPI.CONNECTION
  • CatalogAPI.TABLE
  • CatalogAPI.VIEW
  • CatalogAPI.QUERY
  • CatalogAPI.PROCEDURE
  • CatalogAPI.FILESQL
  • CatalogAPI.UDS
  • CatalogAPI.FORMULA
  • CatalogAPI.SUMMARY
  • CatalogAPI.PARAMETER
  • CatalogAPI.WHEREPORTION
  • #ONDEMAND_QUER
  • {@link #XML_CONNECTION

  • getObjectInfo

    public ObjectInfo getObjectInfo(java.lang.String resourceName,
                                    int type)
    Gets resource entity's information of an object in catalog. The ObjectInfo defines the object's pairs of properties and values.

    Overrides:
    getObjectInfo in class CatalogAPI
    Parameters:
    resourceName - resource name of the entity.
    type - Indicates the type of the object by constant object type value. The CatalogAPI class provides a number of convenient constants that you can use to specify catalog objects. For example,
     
  • CatalogAPI.CONNECTION
  • CatalogAPI.TABLE
  • CatalogAPI.VIEW
  • CatalogAPI.QUERY
  • CatalogAPI.PROCEDURE
  • CatalogAPI.FILESQL
  • CatalogAPI.UDS
  • CatalogAPI.FORMULA
  • CatalogAPI.SUMMARY
  • CatalogAPI.PARAMETER
  • CatalogAPI.WHEREPORTION
  • CatalogAPI.BUSINESSLOGIC - The businesslogic of JReport also named Business/Report Cube.
  • #ONDEMAND_QUER
  • {@link #XML_CONNECTION
  • Returns:
    ObjectInfo object which contains property names and values of the entity.

    getObjectInfo

    public ObjectInfo getObjectInfo(java.lang.String dataSourceName,
                                    java.lang.String resourceName,
                                    int type)
    Gets resource entity's information of an object in the catalog. The ObjectInfo defines the object's pairs of properties and values.

    Overrides:
    getObjectInfo in class CatalogAPI
    Parameters:
    dataSourceName - Indicates the resource name of the data source in the catalog.
    resourceName - resource name of the entity.
    type - Indicates the type of the object by constant object type value. The CatalogAPI class provides a number of convenient constants that you can use to specify catalog objects. For example,
     
  • CatalogAPI.CONNECTION
  • CatalogAPI.TABLE
  • CatalogAPI.VIEW
  • CatalogAPI.QUERY
  • CatalogAPI.PROCEDURE
  • CatalogAPI.FILESQL
  • CatalogAPI.UDS
  • CatalogAPI.FORMULA
  • CatalogAPI.SUMMARY
  • CatalogAPI.PARAMETER
  • CatalogAPI.WHEREPORTION
  • CatalogAPI.BUSINESSLOGIC - The businesslogic of JReport also named Business/Report Cube.
  • CatalogAPI.BUSINESSLOGIC_CATEGORY
  • CatalogAPI.BUSINESSLOGIC_DIMENSION
  • CatalogAPI.BUSINESSLOGIC_MEASURE
  • CatalogAPI.BUSINESSLOGIC_FILTER
  • CatalogAPI.BUSINESSLOGIC_DETAILINFO
  • CatalogAPI.BUSINESSLOGIC_HIERARCHY
  • CatalogAPI.BUSINESSLOGIC_HIERARCHYCONTAINER
  • #ONDEMAND_QUER
  • #XML_CONNECTION
  • {@link #BUSINESSVIEW_GROUP}
  • {@link #BUSINESSVIEW_AGGREGATION}
  • {@link #BUSINESSVIEW_DETAIL}
  • Returns:
    ObjectInfo object which contains property names and values of the entity.

    getObjectInfo

    public ObjectInfo getObjectInfo(java.lang.String handle)
    Gets resource entity's information of an object in the catalog. The ObjectInfo defines the object's pairs of properties and values.

    Overrides:
    getObjectInfo in class CatalogAPI
    Parameters:
    handle - The handle of the resource entity.
    Returns:
    ObjectInfo object which contains property names and values of the entity.

    getBLNodeQualifyDisplayName

    public java.lang.String getBLNodeQualifyDisplayName(java.lang.String handle)
    Gets BusinessLogic node's qualified display name. The qualified display name is an unique ID for every JReport BusinessLogic object in BusinessLogic container. The qualified display name is usually used to be refer in the catalog and report

    Parameters:
    handle - The handle of the Business Logic object.
    Returns:
    BusinessLogic node's qualified display name.
    Since:
    JReport version 13.5.