### Lesson 2: Publishing resources

JReport Server is only able to run reports and use library components that have been published to it. As you saw in the previous lesson, some reports are automatically published to JReport Server, in the Public Reports folder. In this lesson, we publish the reports and library components in the JinfonetGourmetJava.cat catalog.

A report or library component must initially be published along with its catalog. Updates to the resource can be published independently, as long as the catalog associated with the resource remains published. This allows you to quickly and easily install a change to a resource in the runtime environment.

In this lesson, you can publish the catalog, reports and library components that you developed in previous tracks. If you haven't complete those tracks or do not want to use your own, you can use the version of the JinfonetGourmetJava catalog offered by JReport Server, which is located at `<install_root>\help\samples\JinfonetGourmetJava`.

This lesson contains the following tasks:

- Task 1: Publish reports
- Task 2: Publish library components

#### Task 1: Publish reports

1. On the JReport Console > Resources page, open the Public Reports folder.
2. Click Publish > To Local Server on the task bar of the Resources page.

   The Publish to Local Server page is displayed:

3. From the Resource Type drop-down list, select Folder with Contents if it is not already selected.

   The Resource Type list allows you to specify the resource, the catalog, report, or folder with these objects, to be published to the My Reports or Public Reports folder of JReport Server.

4. Click the Browse button next to the From Folder field, and then browse to select the `<install_root>\help\samples\JinfonetGourmetJava` directory.
5. In the Resource Node Name field enter JinfonetGourmetJava.
6. In the Resource Description field enter Jinfonet Gourmet Java catalog and reports.
7. Click OK to publish the resources.

   After the resources have been successfully published, the JinfonetGourmetJava folder is displayed in the resource tree.

8. Click the folder name JinfonetGourmetJava and the reports in the folder are listed:

#### Task 2: Publish library components

1. On the JReport Console > Resources page, open the My Components folder.
2. Click Publish > To Local Server on the task bar of the Resources page. The Publish to Local Server dialog will be displayed.

   From the Resource Type drop-down list, select Folder with Contents if it is not already selected. This type allows for a folder with library components, a catalog, and sub folders containing these objects to be published.

3. Click the Browse button next to the From Folder field, and then browse to select the `<install_root>\help\samples\JinfonetGourmetJava` directory.
4. In the Resource Node Name field enter JinfonetGourmetJava.
5. In the Resource Description field enter Jinfonet Gourmet Java catalog and library components.
6. Click OK to publish the resources.

   After the resources have been successfully published, the JinfonetGourmetJava folder is displayed in the resource tree.

7. Click the folder name JinfonetGourmetJava and the library components in the folder will be listed.