As Confluence evolves, so do the default layouts that drive the rendering of every page. As new functionality is added or current functionally is changed, the default layouts are modified to support these changes.

If you are using custom layouts based on defaults from a previous Confluence version, you run the risk of breaking functionality, or worse, missing out on great new features!

Confluence の新しいリリースではそれぞれ、新しい既定テンプレートに対して行った変更を再適用してください。

カスタム レイアウトを最適用するために必要なものは、次のとおりです。

  1. Confluence の現在のバージョンからカスタム レイアウトを取得します。
  2. Reapply your customisations to the new default layouts.
 

(warning) The information on this page does not apply to Confluence OnDemand.

Step 1. Obtaining your Custom Layouts

Ideally, you should keep a record of each customisation you have applied to each of your Confluence site or space layouts.

If not, you should be able to find your customisations using the following method. This method extracts all site- and space-level layouts from your Confluence site as a single output. From this output, you should be able to identify your customisations.

この方法は、次のような場合に便利です。

  • Many spaces with space layout customisations, or
  • Do not have an independent record of your site or space layout customisations.

Before Confluence 2.3, custom layouts are stored in the velocity directory within your Confluence home directory tree. You can open these files in any text editor.

In Confluence 2.3 and later, custom layouts are stored in the DECORATOR table within your Confluence database. You can SELECT for the source of the layout using SQL like this:

mysql> select SPACEKEY,DECORATORNAME,BODY from DECORATOR;
+----------+---------------------+------+
| SPACEKEY | DECORATORNAME       | BODY |
+----------+---------------------+------+
| NULL     | decorators/main.vmd| ...  |
+----------+---------------------+------+
1 row in set (0.03 sec)

この例は、MySQL でテストされましたが、すべての SQL データベースに適用可能です。

Step 2. Reapplying your Customisations

When you upgrade Confluence to another major release of Confluence, you will need to manually re-apply any customisations you made to any site-wide or space-specific layouts. Unless otherwise stated, you should not need to re-apply customisations after conducting a minor release upgrade of Confluence.

What are 'major' and 'minor' release upgrades?


Major release upgrades are ones where the 1st digit of Confluence's version number or the 1st digit after the 1st decimal place differ after the upgrade, for example, when upgrading from Confluence 3.0 to 3.1, or 2.8 to 3.0. Minor release upgrades are ones where the 1st digit of Confluence's version number and the 1st digit after the 1st decimal place remain the same after the upgrade, for example, when upgrading Confluence 3.0 to 3.0.1.

If you have made Confluence site-wide layout customisations:

  1. Go to the Confluence 'Administration Console':

    • Choose Browse > Confluence Admin. The 'Administrator Access' login screen will be displayed.
    • Enter your password and click Confirm. You will be temporarily logged into a secure session to access the 'Administration Console'.
  2. Select 'Layouts' under 'Look and Feel' in the left-hand navigation panel. The decorators are grouped under Site, Content and Export layouts.
  3. Ensure you have all your customisations available (preferably in a form which can be copied and pasted).
  4. Click 'Reset Default' next to the layout whose customisations need to be reapplied.
  5. Click 'Create Custom' next to the same layout and reapply your customisations (by copying and pasting them) into the appropriate locations within the new default layout.
  6. 保存」ボタンをクリックします。
  7. Repeat this procedure from step 4 for each layout whose customisations need to be reapplied.

If you have made space-specific layout customisations:

  1. Visit any page in the relevant space.
  2. Choose Browse > Space Admin.
    (info) Space Admin is displayed only if you are a space administrator for that space or you are a Confluence system administrator.

  3. Select 'Layout' under 'Look and Feel' in the left-hand navigation panel. The decorators are grouped under Site, Content and Export layouts.
  4. Ensure you have all your customisations available (preferably in a form which can be copied and pasted).
  5. Click 'Reset Default' next to the layout whose customisations need to be reapplied.
  6. Click 'Create Custom' next to the same layout and reapply your customisations (by copying and pasting them) into the appropriate locations within the new default layout.
  7. 保存」ボタンをクリックします。
  8. Repeat this procedure from step 5 for each layout whose customisations need to be reapplied.

Turning off caching

Velocity はテンプレートをメモリにキャッシュするように設定されています。Confluence 内からページを編集する場合、そのページをディスクからリロードします。ディスク上のページを編集する場合、WEB-INF/classes/velocity.properties で Velocity のキャッシングを一時的にオフにするか、変更を可視化するためにサーバを再起動する必要があります。

For Confluence 2.6, the velocity.properties file is available in the confluence-2.6.0.jar file. The jar file is located in the WEB-INF/lib directory. If you wish to make modification to the files in the jar, we recommend the following steps:

  1. Confluence を停止します。
  2. Make a backup copy of the jar file.
  3. ファイルを解凍します。
  4. 変更したい適切なファイルを見つけて編集します。
  5. Re-jar the confluence-2.6.0.jar file.
  6. Relocate the jar file to the appropriate directory.
  7. Confluence を再起動します。

Test your modifications carefully

変更は、Confluence の今後のバーションで予測できない相互作用を与える場合があります。アップグレードする場合、稼働中のサイトに展開する前に、常にカスタム変更をテストする必要があります。これらの変更のテストとデプロイは、アトラシアン サポートの範囲外です。