Searching the Repository

The v2/resources service, when used without specifying any repository URI, is used to search the repository. The various parameters listed in the following table let you refine the search and specify how you receive search results. For example, the search and results pagination parameters can be used to implement an interface to repository resources in a REST client application.

Method

URL

GET

http://<host>:<port>/jasperserver[-pro]/rest_v2/resources?<parameters>

Parameter

Type/Value

Description

q

String

Search for resources having the specified text in the name or description. Note that the search string does not match in the ID of resources.

folderUri

String

The path of the base folder for the search.

recursive

true|false

Indicates whether search should include all sub-folders recursively. When omitted, the default behavior is recursive (true).

type

String

Match only resources of the given type. Valid types are listed in V2 Resource Descriptor Types, for example: dataType, jdbcDataSource, reportUnit, or file. Multiple type parameters are allowed. Wrong values are ignored.

accessType

viewed
|modified

Filters the results by access events: viewed (by current user) or modified (by current user). By default, no access event filter is applied.

dependsOn /path/to/resource Searches for all resources depending on specified resource. Only data source and reportUnit resources may be specified. If this parameter is specified, then all the other parameters except pagination are ignored.

showHidden
Items

true|false

When set to true, results include nested local resources (in _files) as if they were in the repository. For more information, see Local Resources. By default, hidden items are not shown (false).

sortBy

optional
String

One of the following strings representing a field in the results to sort by: uri, label, description, type, creationDate, updateDate, accessTime, or popularity (based on access events). By default, results are sorted alphabetically by label.

limit
offset
forceFullPage
forceTotalCount

These parameters are described in Paginating Search Results

Options

accept: application/json (default)

accept: application/xml

Return Value on Success

Typical Return Values on Failure

200 OK – The body contains a list of resourceLookup descriptors representing the results of the search.

404 Not Found – The specified folder is not found in the repository.

204 No Content – All type values specified are invalid.

The response of a search is a set of shortened descriptors showing only the common attributes of each resource. One additional attribute specifies the type of the resource. This allows the client to quickly receive a list of resources for display or further processing.

application/json

application/xml

[
    {
        "uri" :"/sample/resource/uri", 
        "label":"Sample Label", 
        "description":
            "Sample Description",
        "type":"folder" 
        "permissionMask":"0",
        "creationDate":
            "2013-07-04T12:18:47",
        "updateDate":
            "2013-07-04T12:18:47", 
        "version":"0"
    },
    ...
]
<resources>
    <resourceLookup>
        <uri>/sample/resource/uri</uri>
        <label>Sample Label</label>
        <description>Sample Description
            </description>
        <type>folder</type>
        <permissionMask>0</permissionMask>
        <creationDate>2013-07-04T12:18:47
            </creationDate>
        <updateDate>2013-07-04T12:18:47
            </updateDate>
        <version>0</version>
    </resourceLookup>
    ...
</resources>
Feedback
randomness