概要
Apache XML プロジェクトが開発している、XMLによるPublishシステム。
比較的利用しやすい。
Krysalis Centipedeを元にして、かなり便利になっている。
Schema定義はRelaxNGを利用しDTDを生成している。
URL
http://xml.apache.org/forrest/
インストールと設定
Forrestサイトよりアーカイブをダウンロードしてきます。
とりあえず説明ではバイナリパッケージapache-forrest-0.4-bin.tar.gz(もしくはapache-forrest-0.4-bin.zip)を利用して解説します。
展開します。
.bashrcなどに以下の設定を追加
FORREST_HOME=/path/to/apache-forrest PATH=${FORREST_HOME}/bin:$PATH
Terminalより
forrest -projecthelp
で利用方法のヘルプが表示されれば設定は完了です。
利用方法
任意のディレクトリに移動して
forrest seed
すると、テンプレートが作成されます。テンプレートファイル群を整理する事で構成を理解してください。
XMLを編集したら
forrest validate
しチェックをかけてください。XMLがまちがているとサイトが構築されません。
妥当性が確認できたら
forrest もしくは forrest site
する事でサイト構築します。構築のたびに全ファイルを構築しなおします。巨大ファイル群になると構築に時間がかかるのが欠点でしょう。。
マニュアル的には
http://xml.apache.org/forrest/your-project.html
あたりを参照するとたいがい問題はなさそうです。
Tips
Emacsの設定
psgml-modeとxslideがインストールされていれば十分です。
psgml-modeの設定としてDTDを定義します。
DTDは
$FORREST_HOME/context/resources/schema/dtd
以下にあります。
CATALOGへの追加
-- OASIS TR 9401 Catalog for Forrest -- OVERRIDE YES -- Document Type Definitions -- PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "forrest/document-v11.dtd" PUBLIC "-//APACHE//DTD Specification V1.1//EN" "forrest/specification-v11.dtd" PUBLIC "-//APACHE//DTD FAQ V1.1//EN" "forrest/faq-v11.dtd" PUBLIC "-//APACHE//DTD Changes V1.1//EN" "forrest/changes-v11.dtd" PUBLIC "-//APACHE//DTD Todo V1.1//EN" "forrest/todo-v11.dtd" PUBLIC "-//APACHE//DTD Cocoon Documentation Book V1.0//EN" "forrest/book-cocoon-v10.dtd" PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.0//EN" "forrest/tab-cocoon-v10.dtd" PUBLIC "-//APACHE//DTD How-to V1.0//EN" "forrest/howto-v10.dtd" PUBLIC "-//APACHE//DTD Gump Descriptor V1.0//EN" "forrest/xgump-draft.dtd" PUBLIC "-//APACHE//DTD JavaDoc V1.0//EN" "forrest/javadoc-v04draft.dtd" PUBLIC "-//APACHE//DTD Contributors V1.0//EN" "forrest/contributors-v10.dtd" PUBLIC "-//Outerthought//DTD Libre Configuration V0.1//EN" "forrest/libre-v01.dtd" PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "forrest/catalog-v10.dtd" -- Reusable modules -- PUBLIC "-//APACHE//ENTITIES Documentation V1.1//EN" "forrest/document-v11.mod" PUBLIC "-//APACHE//ENTITIES FAQ V1.1//EN" "forrest/faq-v11.mod" PUBLIC "-//APACHE//ENTITIES Todo V1.1//EN" "forrest/todo-v11.mod" PUBLIC "-//APACHE//ENTITIES Common Elements V1.0//EN" "forrest/common-elems-v10.mod" PUBLIC "-//APACHE//ENTITIES Common Character Entity Sets V1.0//EN" "forrest/common-charents-v10.mod" -- ISO public identifiers for sets of character entities -- PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//XML" "entity/ISOlat1.pen" PUBLIC "ISO 9573-15:1993//ENTITIES Greek Letters//EN//XML" "entity/ISOgrk1.pen" PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN//XML" "entity/ISOpub.pen" PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN//XML" "entity/ISOtech.pen" PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML" "entity/ISOnum.pen" PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML" "entity/ISOdia.pen" PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML" "entity/ISOlat1.pen"
ECATへの追加
-- Document Type Definitions -- PUBLIC "-//APACHE//DTD Documentation V1.1//EN" cdtd/document-v11.dtd PUBLIC "-//APACHE//DTD Specification V1.1//EN" cdtd/specification-v11.dtd PUBLIC "-//APACHE//DTD FAQ V1.1//EN" cdtd/faq-v11.dtd PUBLIC "-//APACHE//DTD Changes V1.1//EN" cdtd/changes-v11.dtd PUBLIC "-//APACHE//DTD Todo V1.1//EN" cdtd/todo-v11.dtd PUBLIC "-//APACHE//DTD Cocoon Documentation Book V1.0//EN" cdtd/book-cocoon-v10.dtd PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.0//EN" cdtd/tab-cocoon-v10.dtd PUBLIC "-//APACHE//DTD How-to V1.0//EN" cdtd/howto-v10.dtd PUBLIC "-//APACHE//DTD Gump Descriptor V1.0//EN" cdtd/xgump-draft.dtd PUBLIC "-//APACHE//DTD JavaDoc V1.0//EN" cdtd/javadoc-v04draft.dtd PUBLIC "-//APACHE//DTD Contributors V1.0//EN" cdtd/contributors-v10.dtd PUBLIC "-//Outerthought//DTD Libre Configuration V0.1//EN" cdtd/libre-v01.dtd PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" cdtd/catalog-v10.dtd -- Reusable modules -- PUBLIC "-//APACHE//ENTITIES Documentation V1.1//EN" cdtd/document-v11.mod PUBLIC "-//APACHE//ENTITIES FAQ V1.1//EN" cdtd/faq-v11.mod PUBLIC "-//APACHE//ENTITIES Todo V1.1//EN" cdtd/todo-v11.mod PUBLIC "-//APACHE//ENTITIES Common Elements V1.0//EN" cdtd/common-elems-v10.mod PUBLIC "-//APACHE//ENTITIES Common Character Entity Sets V1.0//EN" cdtd/common-charents-v10.mod -- ISO public identifiers for sets of character entities -- PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//XML" cdtd/ISOlat1.pen PUBLIC "ISO 9573-15:1993//ENTITIES Greek Letters//EN//XML" cdtd/ISOgrk1.pen PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN//XML" cdtd/ISOpub.pen PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN//XML" cdtd/ISOtech.pen PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML" cdtd/ISOnum.pen PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML" cdtd/ISOdia.pen PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML" cdtd/ISOlat1.pen
.emacsの定義例は以下のようになります。
(setq sgml-custom-dtd '( ("Forrest_document-v11" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Documentation V1.1//EN\" \"file:////Users/sakito/etc/psgml/forrest/document-v11.dtd\"/>\n") ("Forrest_specification-v11" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Specification V1.1//EN\" \"file:////Users/sakito/etc/psgml/forrest/specification-v11.dtd\"/>\n") ("Forrest_faq-v11" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD FAQ V1.1//EN\" \"file:////Users/sakito/etc/psgml/forrest/faq-v11.dtd\"/>\n") ("Forrest_changes-v11" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Changes V1.1//EN\" \"file:////Users/sakito/etc/psgml/forrest/changes-v11.dtd\"/>\n") ("Forrest_todo-v11" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Todo V1.1//EN\" \"file:////Users/sakito/etc/psgml/forrest/todo-v11.dtd\"/>\n") ("Forrest_book-cocoon-v10" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Cocoon Documentation Book V1.0//EN\" \"file:////Users/sakito/etc/psgml/forrest/book-cocoon-v10.dtd\"/>\n") ("Forrest_tab-cocoon-v10" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Cocoon Documentation Tab V1.0//EN\" \"file:////Users/sakito/etc/psgml/forrest/tab-cocoon-v10.dtd\"/>\n") ("Forrest_howto-v10" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD How-to V1.0//EN\" \"file:////Users/sakito/etc/psgml/forrest/howto-v10.dtd\"/>\n") ("Forrest_xgump-draft" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Gump Descriptor V1.0//EN\" \"file:////Users/sakito/etc/psgml/forrest/xgump-draft.dtd\"/>\n") ("Forrest_javadoc-v04draft" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD JavaDoc V1.0//EN\" \"file:////Users/sakito/etc/psgml/forrest/javadoc-v04draft.dtd\"/>\n") ("Forrest_contributors-v10" "<!DOCTYPE document PUBLIC \"-//APACHE//DTD Contributors V1.0//EN\" \"file:////Users/sakito/etc/psgml/forrest/contributors-v10.dtd\"/>\n") ("Forrest_libre-v01.dtd" "<!DOCTYPE document PUBLIC \"-//Outerthought//DTD Libre Configuration V0.1//EN\" \"file:////Users/sakito/etc/psgml/forrest/libre-v01.dtd\"/>\n") ))
日本語対応関係
基本的には日本語に対応しているがデフォルトではファイルの出力エンコーディングがISO-8859-1になっている。
これを変更する方法は複数あるがもっとも根本的に修正する場合
$FORREST_HOME/context/sitemap.xmap の map:serializers
部分を変更してしまえばよい。
参考サイト
http://members.jcom.home.ne.jp/super-creek/forrest/ja/