このコンテンツは選択した言語では利用できません。

Appendix B. Initial Content


To help setup a simple, out-of-the-box repository pre-populated with some content, the hierarchical database provides a way to configure such content using a simple xml format. This content can be imported either in a specific workspace, or imported by default in all predefined or new workspaces.

Note

Initial content is imported only the first time a repository starts up into the predefined workspaces or when a new workspace is created, if that workspace was configured as such.

Warning

The initial content feature is intended to allow the import of a simple structure and is not intended for large volumes of data or complex data structures. There are other, more powerful mechanisms like backup & restore or JCR XML import/export that may be better suited to those cases.

B.1. XML Format

Each initial content XML must define a single root node called jcr:root under the namespace http://www.jcp.org/jcr/1.0 . This represents the root node of a workspace and all content is imported below it.

Example B.1. Example

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0">
    <folder jcr:mixinTypes="mix:created, mix:lastModified" jcr:primaryType="nt:folder">
        <file1 jcr:primaryType="nt:file">
            <jcr:content/>
        </file1>
        <file2 jcr:primaryType="nt:file">
            <jcr:content/>
        </file2>
    </folder>
</jcr:root>
Each node has by default, the same name as the XML element which defines it and the properties the attributes of the XML element. Beside any number of custom properties, the JCR properties: jcr:name , jcr:primaryType and jcr:mixinTypes are supported, allowing for a node to have custom name, type and/or mixins. If not specified, the default node type of the created node will be nt:unstructured .
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0">
    <Cars>
        <Hybrid>
            <car jcr:name="Toyota Prius" maker="Toyota" model="Prius"/>
            <car jcr:name="Toyota Highlander" maker="Toyota" model="Highlander"/>
            <car jcr:name="Nissan Altima" maker="Nissan" model="Altima"/>
        </Hybrid>
        <Sports>
            <car jcr:name="Aston Martin DB9" maker="Aston Martin" model="DB9"/>
            <car jcr:name="Infiniti G37" maker="Infiniti" model="G37"/>
        </Sports>
    </Cars>
</jcr:root>
It is also possible to override the name of the nodes by defining the jcr:name attribute, which will then be used instead of the XML element's name.
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る