Managing Folders and Resources

Administrators and users with the proper permissions can create, modify, move, and delete folders and resources in the repository. The specific roles and permissions of the user determine the actions that are available. For the definition of the permissions on folders and resources, see Permissions.

One responsibility of a JasperReports Server administrator is to set up an environment for users to create and save dashboards, Ad Hoc views, and reports. That usually means creating a folder structure where users have write permission. Users with write permission may also create their own sub-folders to store their reports and dashboards.

Another scenario that administrators can set up involves the resources for users to create JasperReports. When given write permission, users have the ability to upload JRXML files and define resources inside the JasperReport. But for security reasons, only the administrator can create shared data sources and other resources in the repository. If many users are uploading JRXML files as JasperReports, the administrator should create shared data sources and resources ahead of time in the repository. This also has the benefit of simplifying maintenance, for example updating one shared logo file instead of having many users edit their reports.

Resource IDs

All resources, including folders, have an ID, a name, and an optional description:

The ID is used internally to reference resources. As with files, the ID must be unique within its folder, but may exist in several folders.
The name is a label for the resource displayed in the repository UI.
The optional description appears in the repository and in tooltips. You can give longer descriptions to resources to help users understand their contents or purpose.

As in a file system, the IDs of nested folders containing a resource define the path to the object. For example, the path to a report might be: /reports/samples/Freight. The path of every resource is shown under its name in the repository listing or search results.

To view the name and resource ID of a resource, right-click the folder or the resource in the repository or search results and select Properties... from the context menu.

Resource Properties Dialog for a Writable Resource

If you have write or administer permission as shown in the figure, you can also edit the name and description of the resource. For some operations such as export, you need the resource’s path, also called repository URI, that you can copy from this dialog.

Creating Folders

Any user with write permission on a folder can create new sub-folders.

To create a folder:

1. Log on as a user who has write permission to the parent folder.
2. Select View > Repository and locate the parent folder in the left-hand Folders panel.
3. Right-click the parent folder and select Add Folder from the context menu.
4. The Add Folder dialog appears.

Add Folder Dialog

5. Enter a folder name and optional description, then click Add.

The folder is created in the repository. The name appears in the hierarchy of folders. The description is only visible when viewing the properties of the folder, as shown in “Resource Properties Dialog for a Writable Resource”.

New folders and their future contents inherit the permissions of their parent folders. Administrators can change the permissions on the new folder, as described in Setting Permissions. End users cannot change permissions in the repository unless they have been granted the Administer permission by an administrator.

Adding Resources

Each resource has different requirements, for example some are created from uploaded files, others are created by defining values in a wizard. Specific procedures for adding each type of resource are given as follows:

Interactive resources such as Ad Hoc views and dashboards are described in the JasperReports Server User Guide.
JasperReports are covered in the JasperReports Server User Guide.
Domains are covered in the JasperReports Server User Guide. Domains are only available in the Commercial Edition of JasperReports Server.
Mondrian and OLAP resources are covered in the Jaspersoft OLAP User Guide.
Data sources, queries, input controls, and file resources are explained in the chapter Other Resources in the Repository

Most resources are created through the Add Resource menu item on the context menu for folders in the repository. In the following figure, you can see the full menu and submenu with all the resources administrators can create:

Add Resource Context Menu Expanded

For every resource you create, you must specify a name and resource ID that can used to reference the resource in the repository. In addition, each dialog has one or more pages for specifying the values and controls specific to the resource you are adding.

New resources inherit the permissions of the folder in which they are created. Administrators can change the permissions on the new resource, as described in section Permissions.

Renaming Folders and Resources

Any user with write permission on a folder or resource can change its name and description.

You cannot change the name of an organization’s top-level folder in the way described here. The name of the top-level folder is copied from the name of the organization. Therefore, to change the name of the folder, you have to change the name of the organization, as described in section Editing an Organization.

To rename a folder or resource:

1. Log on as a user who has write permission for the folder or resource.
2. In the repository, browse or search for the resource. For renaming folders, select View > Repository and locate the folder.
3. Right-click the object and select Properties... from the context menu.

The Properties dialog appears.

Properties Dialog for a Report Resource

You can change the folder or resource’s name and description, but not the ID or the resource type; the ID is permanent once the resource is created, and the type is displayed here for information only.

4. Click Submit to save your changes.

Copying and Moving

The repository interface lets any user with the proper permission copy or move both resources and folders. Copying requires read permission on the source, moving requires delete permission on the source, and both require write permission on the destination folder.

You can drag-and-drop the objects, or you can copy-paste or cut-and-paste them from their context menus. Folders must be moved one at a time, but multiple resources from the same folder can be copied or moved together.

Copying and moving actions are not possible on the search interface, only on the repository interface showing the list of folders. Currently, it is not possible to create a copy of a resource in the same folder.

The moved objects inherit their permissions from the destination folder in which they are placed; they do not keep the permissions they had before the move. If you want the objects to have other permissions, you must set the permissions again after the move (see Permissions).

To copy or moving folders and resources:

1. Log on as a user who has the required permissions for the folder or resource.
2. Click View > Repository, and expand the folders to display the object to be copied or moved.
3. Right-click the object and select Copy or Cut. If the Cut command does not appear in the menu, you do not have delete permission required to move the object.

You can select multiple resources with Control-click or Shift-click, but you can select only a single folder at a time.

4. Right-click the destination folder and select Paste in the context menu. If the Paste command does not appear in the menu, you do not have write permission there.

Alternatively, you can drag the selected resource or folder to move it the destination folder. To perform a copy, you must press the Control key before clicking to drag. When dragging resources, the destination folder is highlighted in blue if you have permission to write there, and in gray otherwise. If you try to move a resource to a location where you don’t have permission, the server displays the contents of the target folder, but the resource is not moved.

Editing Resources

The various types of resources have different ways of being edited. For end users who work with interactive resources, editing mostly involves the Open in Designer action on the context menu for dashboards and Ad Hoc views. The procedures in the following table are further described in the JasperReports Server User Guide.

Resources That End Users Can Edit

Resource Type

How to Edit

Ad Hoc views

Professional edition only. Users select Open in Designer and modify the view interactively. After changing the content, users can overwrite the existing view or save as a new view.

Reports created from Ad Hoc views are saved in the same format as JasperReports, but the resources referenced in the report unit are generated by the Ad Hoc editor and should not be modified. There is one exception: administrators may create a JSP file and set it as a custom report view.

Dashboard

Professional edition only. Users select Open in Designer and modify the dashboard interactively. After changing the content, users can overwrite the existing dashboard or save it as a new dashboard.

Content Resource

Report output is a file stored in the repository. These files cannot be edited, only downloaded or deleted.

JasperReport

Users select Edit and change the data source, input controls, or file resources that are referenced in the JasperReport. Administrators may also edit JasperReports. For more information, see JasperReport Structure.

When users Run a report, it is displayed in the interactive report viewer. If data snapshots are enabled, the report is displayed with data that was previously returned by the data source. When data snapshots are not enabled, the server queries the data source and runs the report’s query. After interacting with the report’s columns and values, users may save the report, either by overwriting the original or as a new copy, depending on user’s permissions.

Report Version

Professional edition only. Users may select Edit to change the values stored as input parameters.

For the other resources in the following table, editing is accessible only to administrators. End users, even those with write permission on a resource, cannot edit these resources.

Resources That Only Administrators Can Edit

Resource Type

How to Edit

Data Source

Administrators select Edit from the context menu on these resources. Editing these resources uses the same dialog that was used to define the resource when it is first added to JasperReports Server. Administrators can view the current definition of a resource or change the values that define a resource. For example, you could view the datatype of an input control, change a query, or upload a new file in a file resource.

In the case of Domains, you also have access to the Domain Designer used when creating the Domain. You can add tables and fields, change filters, or change the display characteristics of items in the Domain. For more information about Domains, see the JasperReports Server User Guide.

For all other resource types, see the procedure for creating them in Other Resources in the Repository.

Datatype

Domain

File

Input Control

List of Values

Query

When editing a resource, there are several limitations:

You can modify the name or description of the resource, but not its ID. If you must remove an ID, you need to create a new, similar resource and delete the old one.
You cannot change the location of the resource. Some dialogs for editing a resource include the saved location, but the field is for information only. To change the location of the resource, see Copying and Moving.
For file resources, you cannot see the name of the file that was uploaded, nor in most cases download and view the contents of the file. Your only option is to upload a new file to replace the old one.

Deleting Folders and Resources

Users with delete permission on a folder or resource can delete those objects from the repository. In order to delete a folder, the user must also have delete permission on all the resources and folders that the deleted folder contains, because the entire contents of the deleted folder are deleted as well.

Folders must be deleted one at a time, but multiple resources can be deleted together.

There is no undo from a delete.

The repository keeps track of which resources are referenced by other resources. It does not allow you to delete resources if they are still referenced by other resources. For example, an input type that is used by a report or a properties file that is used by a Domain cannot be deleted as long as the report or Domain still references them.

To find the resources that reference the one you want to delete, you need to look at each report, view, Ad Hoc Topic, or Domain that you suspect of referencing it. When you edit the definition of a JasperReport or a Domain, you can see the resources it references. Then you can either remove the reference from the resource or delete the entire resource containing the reference.

To delete a folder or resource:

1. Log on as a user who has delete permission for the folder or resource.
2. In the repository, browse or search for the object to be deleted.
3. Right-click the object and click Delete in the context menu that appears.

In the repository view, you can select multiple resources and click Delete in the tool bar or in the context menu. In the list of folders, you can only delete single folders at a time, although all contents of the folders, including subfolders are deleted. In the search results, you can select multiple resources and right-click to select Delete in the context menu.

Version: 
Feedback
randomness