• 検索結果がありません。

テーマを管理する

ドキュメント内 JasperReports Server CP User Guide JP (ページ 122-127)

テーマは CSS ファイルと画像ファイルの集合であり、リポジトリの root にある Themes フォルダに格納されています。リポ ジトリブラウザでは、Themesフォルダと個々のテーマフォルダを管理するために、管理者は特別なアクションを起こすことが できます。CSSファイルと画像ファイルの検索にリポジトリを使うこともできます。

Themes are sets of CSS and image files stored in the Themes folder at the root of the repository. In the repository browser, the Themes folder and individual theme folders have special actions for administrators to manage them. You can also use the repository search to find CSS and image files.

テーマを管理するためのフォルダやアクションは、管理者にしか⾒えません。Themes フォルダは ROLE_USER に対して「実

⾏のみ」権限を持っているので、すべてのスーザがテーマファイルを読み込み、そのユーザインターフェースを使うことができ ますが、リポジトリ内のフォルダやファイルにアクセスすることはできません。

The folders and actions for managing themes are visible only to administrators. The Themes folder has execute-only permission for ROLE_USER so that all users can load the theme files and see the user interface, but not access the folders and files in the repository.

本節では、既存のテーマを管理するための基本的な⼿順と、新しいテーマフォルダの作成や修正の⽅法について説明します。テー マの中で CSS がどのように働くかについては、「5.4 CSS ファイルを使う」(p.127)を参照してください。

This section gives the basic procedures for administering existing themes, and for creating and modifying new theme folders. For information about how to work with CSS in themes, see section 5.4, “Working With CSS Files,” on page 98.

5.3.1 アクティブテーマを設定する

1. 管理者(jasperadmin)として JasperReports Server にログインします。

Log into JasperReports Server as administrator (jasperadmin).

2. 必要なら [表示] > [リポジトリ] をクリックし、Themes フォルダを展開します。

Click View > Repository if necessary and expand the Themes folder.

3. 新しいテーマフォルダを右クリックし、コンテクストメニューから [アクティブ テーマに設定] を選択します。

例えば、サンプルデータに含まれている⼆番目のテーマである「pods_summer」をアクティブに設定してみます。

Right-click the new theme folder and select Set as Active Theme.

For example, the sample data includes a second theme called pods_summer that you can set as active.

図 5-2 コンテクストメニューからアクティブテーマを設定する

画⾯が再描画されて、新しいテーマを⾒ることができます。pods_summer テーマは、overrides_custom.css ファイルと 画像ファイルだけを使い、ユーザインターフェースの⾊とロゴをどのように変更しているかに注目してください。

As soon as the screen is refreshed, you see the effect of the new theme. Notice how the pods_summer theme changes the colors and the logo in the user interface with just the overrides_custom.css file and images.

図 5-3 サンプルテーマ「pods_summer」

同じ⽅法で管理者がテーマを変えることで、すべてのユーザのテーマが変更されます。また、ここで使⽤しているテーマは ログインページも提供しています。以下の図を参照してください。

All users see the theme in the same way that the administrator does. Also, the theme set here applies to the login page, as shown in the following figure.

図 5-4 新しいアクティブテーマで⾒るログインページ

5.3.2 テーマフォルダとファイルを作る

テーマ用のフォルダとファイルを作成するには二通りの方法があります。

There are two ways to create the folders and files that make up a theme:

それらをリソースとしてリポジトリ内に直接作る。

ZIP(アーカイブ)ファイルとしてテーマをダウンロードまたはアップロードする。

Create them directly as resources in the repository.

Download and upload themes as ZIP (archive) files.

本節では、CSS ファイルをリポジトリに格納する方法についてのみ説明します。CSS ファイルコンテンツを作る方法について は、「5.4 CSS ファイルを使う」(p.127)を参照してください。

This section explains only how to store CSS files in the repository. For information about creating CSS file contents, see section 5.4, “Working With CSS Files,” on page 98.

5.3.2.1 テーマフォルダとファイルリソースを作る

テーマはリポジトリ内のシンプルな1つのフォルダであり、中に、CSS ファイルや画像ファイル、追加のサブフォルダを含んで います。管理者は、リポジトリメニューを使って、テーマフォルダとそのファイルリソースを作成することができます。

A theme is simply a folder in the repository that contains CSS and image files, with optional sub-folders.

Administrators can use the repository menus to create theme folders and their file resources.

テーマフォルダとファイルリソースを作成するには:

1. 管理者(jasperadmin)として JasperReports Server にログインします。

Log into JasperReports Server as administrator (jasperadmin).

2. 必要なら [表示] > [リポジトリ] をクリックして、Themes フォルダを展開します。

Click View > Repositoryif necessary and expand the Themes folder.

3. Themes フォルダを右クリックし、コンテクストメニューから [フォルダの追加] を選択します。フォルダの名前と、必 要なら説明を記入します。フォルダの名前は、テーマの名前として使用されます。

Right-click the Themes folder and select Add Folder. Give your folder a name and optional description as you would when creating any folder. The folder name is used as the name of the theme.

テーマフォルダとファイルは、リポジトリの任意の場所で作成し、コピーし、移動することができますが、そ れをアクティブにしたり、アップロードしたり、ダウンロードしたりすることは、Themes フォルダの中でし

か⾏えません。

Theme folders and files can be created, copied or moved anywhere in the repository, but they can only be made active, uploaded, or downloaded when properly placed in a Themes folder.

4. 新しく作成したフォルダを右クリックし、コンテクストメニューから [リソースの追加] > [ファイル] > [CSS] を選択 します。すると、個々の CSS ファイルをアップロードするためのダイアログが表示されます。そのファイルがテーマの一 部として使われるためには、そのファイルの名前は、「5.2.1 テーマファイル」(p.120)に挙げられたファイル名のいずれ かでなければなりません。

Right-click your new folder and select Add Resource > File > CSS, and use the dialog to upload an individual CSS file. In order to be used as part of a theme, it must be one of the file names listed in section 5.2.1, “Theme Files,” on page 93.

5. テーマに画像を追加するには、任意の画像フォルダを作成し、画像ファイルを [リソースの追加] > [ファイル] > [画像]

でアップロードします。

To add images to your theme, create any image folders and upload image files with Add Resource > File > Image.

6. 手順 4 と 5 を繰り返し、必要となるすべてのファイルと画像を作成します。もし複数のテーマで同じファイルまたは画像 を使用する場合には、ファイルリソースまたは画像フォルダ全体を、あるテーマから別のテーマへコピー&貼り付けをする ことができます。

Repeat step 4 and step 5 to create all the files and images you need. If several themes use the same files or images, you can copy-paste the file resources or entire image folders from one theme to another.

7. CSS ファイルや画像ファイルの内容を変更する必要がある場合は、それを右クリックし、コンテクストメニューから [編 集] を選択して、他のファイルを指定し、それをアップロードして現在のファイルと置き換えることができます。

If you need to change the contents of a CSS or image file, you can right-click it and select Edit to specify another file to upload and replace the current file.

アクティブテーマに対して CSS ファイルや画像ファイルをアップロードした場合は、ページを再読込するまで 変更が反映されません。

If you upload CSS and image files into the active theme, the changes are visible after reloading the page in your browser.

リポジトリを通じてテーマフォルダやファイルを使ってみることは、テーマを作るための便利で素直な⽅法です。しかしながら、

この方法ではある制限に悩むことになります。他のリポジトリリソースと同様に、ファイルや画像をダウンロードして編集する ことができません。これを⾏うには、リポジトリがテーマフォルダに対して提供している特別なダウンロード・アップロードア クションを使用します。

Interacting with theme folders and files through the repository is a convenient and flexible way to create a theme.

However, this method suffers from the limitation that, like other repository resources, you cannot download the files or images to edit them. For this purpose, the repository provides special download and upload actions on theme folders.

5.3.2.2 テーマの ZIP ファイルをダウンロード・アップロードする

テーマを作る過程は大抵、既存のテーマの CSS ファイルや画像をローカルのコンピュータ上で編集することから始まります。

この手順をサポートするために、すべてのテーマフォルダには、テーマをダウンロード・アップロードするための特別なコマン ドが用意されています。

The process of creating a theme often starts with the files of an existing theme that you modify with CSS and image editors on your computer. To support this workflow, every Themes folder has special commands for downloading and uploading themes.

テーマは任意の数のファイルとフォルダから構成されるので、JasperReports Server は、テーマを単一のファイルに格納する ために、ZIP アーカイブフォーマットを使用します。

Because a theme is composed of any number of files and folders, JasperReports Server uses the ZIP archive format to store a theme in a single file.

テーマのZIP ファイルをダウンロードするには:

1. 管理者(jasperadmin)として JasperReports Server にログインします。

Log into JasperReports Server as administrator (jasperadmin).

2. 必要あれば [表示] > [リポジトリ] をクリックし、Themes フォルダを展開します。

Click View > Repository if necessary and expand the Themes folder.

3. ダウンロードしたいテーマフォルダを右クリックし、コンテクストメニューから [テーマのダウンロード] を選択します。

このメニューは、テーマフォルダが Themes フォルダの中にある場合にのみ現れ、選択することができます。

Right-click the theme folder you want to download and select Download the Theme. This menu selection appears only on theme folders inside the Themes folder.

4. サーバは、ファイルを <テーマ名>.zip というファイル名で保存するよう促します。それをローカルコンピュータのどこ かに保存します。

The server prompts you to save the file named <theme-name>.zip. Save it anywhere on your computer.

5. ZIP ファイルを解凍するツールを使い、解凍されたファイルをローカルコンピュータ上に保存します。

Use an archiving or compression utility to extract the files from the ZIP file and save them on your computer.

ローカルコンピュータ上にテーマファイルを展開すると、そのテーマを構成している個々の CSS ファイルや画像ファイルを閲 覧することができます。例えば、オリジナルのテーマを作るために、規定のテーマを root/Themes フォルダからダウンロード することから始めることができます。解凍されたファイルをローカルコンピュータに保存し、規定のテーマの CSS ファイルや 画像ファイルを別のフォルダへコピーし、編集します。テーマの作り方に関しては、「5.2.3 CSS の優先スキームとカスタムオー バーライド」(p.121)を参照してください。

Once you have the theme files extracted on your computer, you can view the individual CSS and image files that make up the theme. For example, to create your own theme, start by downloading the default theme from the root/Themes folder. Save the extracted files on your computer and create your custom theme in another folder by copying and editing the CSS files and images of the default theme. See section 5.2.3, “CSS Priority Scheme and Custom Overrides,” on page 94 for an explanation of how to create a theme.

オリジナルテーマに必要なすべてのファイルの作成を終えたら、それを以下の手順でアップロードします。

When you have created all the files you will need in your theme, upload it with the following procedure.

テーマをZIP ファイルとしてアップロードするには:

1. テーマを構成する CSS ファイルやフォルダ、画像ファイルを、ローカルコンピュータのフォルダの中に配置します。

Place the CSS files, optional folders, and image files that constitute your theme in a folder on your computer.

2. そのテーマフォルダの内容を、圧縮ツールなどを用いてアーカイブし、標準 ZIP ファイルを作成します。

Use an archiving or compression utility to create a standard ZIP file of the contents of your theme folder.

ZIP ファイルは、テーマフォルダ自体は含まず、テーマの中身だけを含むように作成するべきです。

The ZIP file should include only the contents of your theme, not the theme folder itself.

3. 管理者(jasperadmin)として JasperReports Server にログインします。

Log into JasperReports Server as administrator (jasperadmin).

4. 必要あれば [表示] > [リポジトリ] をクリックし、Temes フォルダを展開します。

Click View > Repository if necessary and expand the Themes folder.

5. Themes フォルダを右クリックし、コンテクストメニューから [テーマのアップロード] を選択します。

Right-click the Themes folder and select Upload a Theme.

ドキュメント内 JasperReports Server CP User Guide JP (ページ 122-127)