Jump to content
Changes to the Jaspersoft community edition download ×
  • This documentation is an older version of JasperReports Server REST API Reference. View the latest documentation.

    This chapter provides a reference by example for every type of resource descriptor that exists in the repository. Use the resources service to get and set resources with these descriptors. For further information, see:

    Working With Resources for general guidelines about using descriptors.
    The resources Service for methods to operate on resources in the repository.

    This chapter does not cover descriptors for objects that are not stored in the repository. Descriptors that represent jobs, calendars, organizations, roles, users, and attributes are described with the service that operates on them.

    This chapter includes the following sections:

    Common Attributes
    Folder
    JNDI Data Source
    JDBC Data Source
    AWS Data Source
    Virtual Data Source
    Custom Data Source
    Bean Data Source
    Datatypes
    List of Values
    Query
    Input Control
    File
    Report Unit (JRXML Report)
    Report Options
    Domain (semanticLayerDataSource)
    Domain Topic
    XML/A Connection
    Mondrian Connection
    Secure Mondrian Connection
    OLAP Unit
    Mondrian XML/A Definition
    Other Types

    Common Attributes

    All resource types contain the following attributes. Of these common attributes, only the label and description fields are writable.

    In general, writable fields are ones that can be set by the client when sending a descriptor for a write or update operation (PUT or POST). The other fields are read-only fields that the server sets automatically.

    application/repository.{resourceType}+json

    application/repository.{resourceType}+xml

    {    "uri" :"/sample/resource/uri",     "label":"Sample Label",     "description":"Sample Description",     "permissionMask":"0",    "creationDate": "2013-07-04T12:18:47",    "updateDate": "2013-07-04T12:18:47",     "version":"0"    ... }[/code]                    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><{resourceType}>    /sample/resource/uri    Sample Label    Sample Description            0    2013-07-04T12:18:47            2013-07-04T12:18:47            0    ...{resourceType}>[/code]                    

    Throughout the rest of the resource type sections, the common attributes are included in every descriptor as {commonAttributes}.

    Folder

    Folder types do not contain any additional fields beyond the common attributes shown above.

    application/repository.folder+json

    application/repository.folder+xml

    {    "uri" :"{resourceUri}",     "label":"Sample Label",     "description":"Sample Description",     "permissionMask":"0",    "creationDate": "2013-07-04T12:18:47",    "updateDate": "2013-07-04T12:18:47",     "version":"0" }[/code]                    
        /sample/resource/uri    Sample Label    Sample Description          0    2013-07-04T12:18:47          2013-07-04T12:18:47           0[/code]                    

    Only the label and description fields are writable.

    JNDI Data Source

    application/repository.jndiJdbcDataSource+json

    application/repository.jndiJdbcDataSource+xml

    {    {commonAttributes},     "jndiName":"{jndiName}",    "timezone":"{timezone}"}[/code]                    
        {commonAttributes}    {jndiName}    {timezone}[/code]                    

    JDBC Data Source

    application/repository.jdbcDataSource+json

    application/repository.jdbcDataSource+xml

    {    {commonAttributes},     "driverClass":"{driverClass}",     "password":"{password}",     "username":"{username}",     "connectionUrl":"{connectionUrl}",    "timezone":"{timezone}"}[/code]                    
        {commonAttributes}    {driverClass}    {password}    {username}             {connectionUrl}        {timezone}[/code]                    

    AWS Data Source

    application/repository.awsDataSource+json

    application/repository.awsDataSource+xml

    {    {commonAttributes},     "driverClass":"{driverClass}",     "password":"{password}",     "username":"{username}",     "connectionUrl":"{connectionUrl}",    "timezone":"{timezone}",    "accessKey":"{accessKey}",     "secretKey":"{secretKey}",     "roleArn":"{roleArn}",     "region":"{region}",     "dbName":"{dbName}",     "dbInstanceIdentifier":"{dbInstanceIdentifier}",     "dbService":"{dbService}"}[/code]                    
        {commonAttributes}    {driverClass}    {password}    {username}             {connectionUrl}        {timezone}    {accessKey}     {secretKey}     {roleArn}     {region}     {dbName}              {dbInstanceIdentifier}         {dbService}[/code]                    

    The {region} values are specified in the file .../WEB-INF/application-context.xml, with their corresponding display labels defined in .../WEB-INF/bundles/jasperserver_messages.properties. By default, the following regions are defined:

    Values of AWS {region} in
    .../WEB-INF/application-context.xml

    Labels for AWS regions in
    .../WEB-INF/bundles/jasperserver_messages.properties

    Virtual Data Source

    The id of each subDataSource must be unique. The server does not prevent duplicates, and the last one to be defined silently overwrites the previous definition.

    application/repository.virtualDataSource+json

    application/repository.virtualDataSource+xml

    {    {commonAttributes},     "subDataSources":[         {             "id":"{subDataSourceId}",             "uri":"{subDataSourceUri}"         },         ...    ] }[/code]                    
        {commonAttributes}                        {subDataSourceId}            {subDataSourceUri}                ...    [/code]                    

    Custom Data Source

    The value of the serviceClass attribute is read-only and depends on the specific type of the custom data source, as defined in the server's applicationContext configuration files.

    application/repository.customDataSource+json

    application/repository.customDataSource+xml

    {    {commonAttributes},     "serviceClass":"{serviceClass}",       "dataSourceName":"{dataSourceName}",     "properties":[         {            "key":"{key}",            "value":"{value}"        },         ...    ] }[/code]                    
        {commonAttributes}            {serviceClass}                {dataSourceName}                            {key}            {value}                ...    [/code]                    

    Bean Data Source

    application/repository.beanDataSource+json

    application/repository.beanDataSource+xml

    {    {commonAttributes},     "beanName":"{beanName}",     "beanMethod":"{beanMethod}"}[/code]                    
        {commonAttributes}    {beanName}    {beanMethod}[/code]                    

    Datatypes

    application/repository.dataType+json

    application/repository.dataType+xml

    {    {commonAttributes},     "type":"text|number|date|dateTime|time",     "pattern":"{pattern}",     "maxValue":"{maxValue}",     "strictMax":"true|false",     "minValue":"{minValue}",     "strictMin":"true|false"       "maxLength":"{maxLengthInteger}"}[/code]                    
        {commonAttributes}    text|number|date|dateTime|time    {pattern}    {maxValue}    true|false    {minValue}    true|false    {maxLengthInteger}[/code]                    

    List of Values

    application/repository.listOfValues+json

    application/repository.listOfValues+xml

    {    {commonAttributes},     "items":[        {            "label":"{label}",            "value":"{value}"        },        ...    ]}[/code]                    
        {commonAttributes}                        {label}            {value}                ...    [/code]                    

    Query

    The dataSource field of the query may be null. Set an empty dataSource field when you want to remove a local data source, either a reference or a local definition. When the data source of a query is not defined, the query uses the data source of its parent, for example its JRXML report (reportUnit).

    application/repository.query+json

    application/repository.query+xml

    {    {commonAttributes},     "value":"{query}",     "language":"{language}",    "dataSource":{        "dataSourceReference": {            "uri":"{dataSourceUri}"        }    } }[/code]                    
        {commonAttributes}    {query}     {language}            {dataSourceUri}    [/code]                    

    Input Control

    Input controls come in several types that require different fields. The following table shows all possible fields, not all of which are mutually compatible.

    application/repository.inputControl+json

    application/repository.inputControl+xml

    {    {commonAttributes},     "mandatory":"{true|false}",      "readOnly":"{true|false}",      "visible":"{true|false}",      "type":"{inputControlTypeByteValue}",    "usedFields":"{field1;field2;...}",    "dataType": {        "dataTypeReference": {            "uri": "{dataTypeResourceUri}"        }    },      "listOfValues": {        "listOfValuesReference": {            "uri": "listOfValuesResourceUri"        }    }      "visibleColumns":["column1", "colum2", ...],      "valueColumn":"{valueColumn}",      "query": {        "queryReference": {            "uri": "{queryResourceUri}"        }    }}[/code]                    
        {commonAttributes}    true|false    true|false    true|false    {inputControlTypeByteValue}    {field1;field2;...}            {dataTypeResourceUri}                {listOfValuesResourceUri}                {queryResourceUri}                {column1}        {column2}        ...        {valueColumn}[/code]                    

    The following list shows the numerical code and meaning for {inputControlTypeByteValue}. The input control type determines the other fields that are required. The list of required fields may appear in a field named usedFields, separated by semi-colons (;).

    Type

    Type of Input Control

    Other Fields Required (usedFields)

    1

    Boolean

    None

    2

    Single value

    dataType

    3

    Single-select list of values

    listOfValues

    4

    Single-select query

    query; queryValueColumn

    5

    Not used

    6

    Multi-select list of values

    listOfValues

    7

    Multi-select query

    query; queryValueColumn

    8

    Single-select list of values radio buttons

    listOfValues

    9

    Single-select query radio buttons

    query; queryValueColumn

    10

    Multi-select list of values check boxes

    listOfValues

    11

    Multi-select query check boxes

    query; queryValueColumn

    File

    The repository.file+<format> descriptor is used to identify the file type. The content field is used only when uploading a file resource as base-64 encoded content. For other ways to upload file contents, see Uploading File Resources. The content field is absent when requesting a file resource descriptor. To download file contents, see Downloading File Resources.

    application/repository.file+json

    application/repository.file+xml

    {    {commonAttributes},     "type":"pdf|html|xls|rtf|csv|odt|txt            |docx|ods|xlsx|img|font|jrxml            |jar|prop|jrtx|xml|css            |olapMondrianSchema            |accessGrantSchema            |unspecified}",    // content is write-only;    // it is not included in a response    "content":"{base64EncodedContent}"}[/code]                    
        {commonAttributes}    pdf|html|xls|rtf|csv|odt|txt        |docx|ods|xlsx|img|font|jrxml        |jar|prop|jrtx|xml|css        |olapMondrianSchema        |accessGrantSchema|unspecified}        {base64EncodedContent}[/code]                    

    Report Unit (JRXML Report)

    A report unit contains mostly references to the files that make up a report within the server. A report unit is a composite resource that may contain other local resources. In this case, the URIs that it references include a URI in the following format:

    <reportUnitURI>_files/<localResourceID>

    For example, the main JRXML of a sample report is referenced as follows:

    /reports/samples/Cascading_multi_select_report_files/Cascading_multi_select_report

    For more information, see Nested Resources.

    application/repository.reportUnit+json

    application/repository.reportUnit+xml

    {    {commonAttributes},     "alwaysPromptControls":        "{true|false}",    // default is "popupScreen"    "controlsLayout":        "{popupScreen|separatePage          |topOfPage|inPage}",    "inputControlRenderingView":        "{inputControlRenderingView}",        "reportRenderingView":        "{reportRenderingView}",    "dataSource":{        "dataSourceReference": {            "uri":"{dataSourceUri}"        }    },    // "query" is nullable    "query:" {        "queryReference": {            uri: "{queryResourceUri}"        }    },      "jrxml": {        "jrxmlFileReference": {            "uri": "{jrxmlFileResourceUri}"        } or        "jrxmlFile": {            "label": "Main jrxml",            "type": "jrxml"        }    }    "inputControls": [        {            "inputControlReference": {                "uri": "{inputControlUri}"            }        },        ...    ],    "resources": [        "resource": {            "name": "{resourceName}",            "file": {contents} <*>            }        },        ...    ]}[/code]
    <*> or "fileReference": {          "uri": "{fileResourceUri}"       }[/code]                    
        {commonAttributes}    true|false                        popupScreen|separatePage        |topOfPage|inPage                {inputControlRenderingView}                {reportRenderingView}                            {dataSourceUri}                                    {queryResourceUri}                                      {jrxmlFileResourceUri}                                    {inputControlUri}                ...                            {resourceName}            contents {*}                ...        [/code]
     [/code]
    {*} or <fileReference>          <uri>{fileResourceUri}</uri>       </fileReference>[/code]                    

    Report Options

    application/repository.reportOptions+json

    application/repository.reportOptions+xml

    {    {commonAttributes},     "reportUri":"{reportUri}",       "reportParameters":[          {             "name":"{parameterName}",             "value":[                 "value_1",                 "value_2",                 ...            ]         },          ...        ]  }[/code]                    
        {commonAttributes}    {reportUri}                        {parameterName}            value_1            value_2            ...                ...    [/code]                    

    Domain (semanticLayerDataSource)

    For more information about accessing the schema of a Domain, see Working With Domains.

    application/repository.semanticLayerDataSource+json

    application/repository.semanticLayerDataSource+xml

    {    {commonAttributes},     "dataSource":{        "dataSourceReference": {            "uri":"{dataSourceUri}"        }    },     "schema": {        "schemaFileReference": {            "uri": "{schemaFileResourceUri}"        }    },     "bundles": [        {            // empty localeString indicates default bundle            "locale": "{localeString}",            "file": {                "fileReference": {                    "uri": "{propertiesFileResourceUri}"                }            }        },         ...    ],     "securityFile": {        "securityFileReference": {            "uri": "{securityFileResourceUri}"        }    }}[/code]                    
        {commonAttributes}            {dataSourceUri}                {schemaFileResourceUri}                                        {localeString}                            {propertiesFileResourceUri}                             ...                 {securityFileResourceUri}    [/code]                    

    Domain Topic

    A Domain Topic is a Topic created by selecting database fields from a Domain. It is structurally equivalent to a JRXML report, and thus it has the same type attributes (see Report Unit (JRXML Report)). The only difference is that the data source field will reference a Domain (semanticLayerDataSource).

    application/repository.domainTopic+json

    application/repository.domainTopic+xml

    Same attributes as
    application/repository.reportUnit+json

    Same attributes as
    application/repository.reportUnit+xml

    XML/A Connection

    application/repository.xmlaConnection+json

    application/repository.xmlaConnection+xml

    {    {commonAttributes},     "url":"{xmlaServiceUrl}",     "xmlaDataSource":"{xmlaDataSource}",     "catalog":"{catalog}",     "username":"{username}",     "password":"{password}"}[/code]                    
        {commonAttributes}    {xmlaServiceUrl}            {xmlaDataSource}        {catalog}    {username}    {password}[/code]                    

    Mondrian Connection

    Mondrian connections without the access grant schemas are used in the Community edition of JasperReports Server.

    application/repository.mondrianConnection+json

    application/repository.mondrianConnection+xml

    {    {commonAttributes},     "dataSource":{        "dataSourceReference": {            "uri":"{dataSourceUri}"        }    },    "schema": {        "schemaReference": {            "uri": "{schemaFileResourceUri}"        }    }}[/code]                    
        {commonAttributes}            {dataSourceUri}                {schemaFileResourceUri}    [/code]                    

    Secure Mondrian Connection

    Secure Mondrian connections are available only in commercial releases of JasperReports Server.

    application/repository.secureMondrianConnection+json

    application/repository.secureMondrianConnection+xml

    {    {commonAttributes},     "dataSource":{        "dataSourceReference": {            "uri":"{dataSourceUri}"        }    },     "schema": {        "schemaReference": {            "uri": "{schemaFileResourceUri}"        }    },     "accessGrantSchemas": [        {            "accessGrantSchemaReference": {                "uri": "{accessGrantSchemaFileResourceUri}"            }        },        ...    ]}[/code]                    
        {commonAttributes}            {dataSourceUri}                {schemaFileResourceUri}                            {accessGrantSchemaFileResourceUri}            [/code]                    

    OLAP Unit

    application/repository.olapUnit+json

    application/repository.olapUnit+xml

    {    {commonAttributes},     "mdxQuery":"{mdxQuery}",     "olapConnection": {         "olapConnectionReference": {                     "uri": "{olapConnectionReferenceUri}"              }      } }[/code]                    
        {commonAttributes}    {mdxQuery}            {olapConnectionReferenceUri}     [/code]                    

    Mondrian XML/A Definition

    application/repository.mondrianXmlaDefinition+json

    application/repository.mondrianXmlaDefinition+xml

    {    {commonAttributes},     "catalog":"{catalog}",     "mondrianConnection": {        "mondrianConnectionReference": {            "uri": "{mondrianConnectionResourceUri}"        }    } }[/code]                    
        {commonAttributes}    {catalog}            {mondrianConnectionResourceUri}    [/code]                    

    Other Types

    The following types are defined in commercial editions of the server and appear in the repository. However, they are meant only to describe the corresponding resources as read-only objects in the repository. The REST API does not support services for clients to create or modify these types.

    The types in the following table contain only the common attributes described in Common Attributes.

    Type String

    Description

    application/repository.dashboard+json
    application/repository.dashboard+xml

    The dashboard resource descriptors are deprecated and subject to change.

    application/repository.adhocDataView+json
    application/repository.adhocDataView+xml

    The Ad Hoc view type is not fully defined yet and subject to change. Ad Hoc views may be referenced as data sources in other repository types, in which case they are called advDataSource.

    Open topic with navigation


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...