Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

B.2. Configuring Initial Content

The configuration necessary for a repository to make use of the initial content is the following:
{
    "name" : "Repository with initial content",
    "storage" : {
        "transactionManagerLookup" : "org.infinispan.transaction.lookup.DummyTransactionManagerLookup"
    },
    "workspaces" : {
        "predefined" : ["ws1", "ws2"],
        "default" : "default",
        "allowCreation" : true,
        "initialContent" : {
            "ws1" : "xmlImport/docWithMixins.xml",
            "ws2" : "xmlImport/docWithCustomType.xml",
            "default" : "xmlImport/docWithoutNamespaces.xml",
            "ws4" : "",
            "ws5" : "xmlImport/docWithCustomType.xml",
            "*" : "xmlImport/docWithMixins.xml"
        }
    }
}
One needs to define an initialContent object inside the workspaces object, with the following content:
  • each attribute name inside the initialContent object, with the exception of the * string, will be treated as the name of a workspace and will have precedence over anything else. This includes the empty string, which can be used to explicitly configure workspace without any initial content, when a default is defined (see below)
  • the * character is interpreted as "default content" which means that any predefined or newly created workspaces, that are not configured explicitly, will make use of this content
  • the value of each attribute must be a simple string (including the empty string) which represents the URL of an XML file located in the runtime classpath