Daisy documentation
 PreviousHomeNext 
5 Daisy WikiBook Index5.1.3 Creating a new site using daisy-wiki-add-site

5.1.2 Defining sites

Sites are defined by creating a directory for the site and putting a siteconf.xml file in it. This directory should be created in the "sites" directory. By default, this sites directory is located at:

<wikidata directory>/sites

The location of this directory can be changed in the cocoon.xconf.

The content of the siteconf.xml file should strictly adhere to a certain schema (thus no extra elements/attributes are allowed), otherwise the site will be ignored (in that case, an error will be logged in Cocoon's log files).

5.1.2.1 siteconf.xml syntax

An example siteconf.xml is displayed below.

<siteconf xmlns="http://outerx.org/daisy/1.0#siteconf">
  <title>foobar</title>
  <description>The "foobar" site</description>
  <skin>default</skin>
  <navigationDocId>1-DSY</navigationDocId>
  <homepageDocId>2-DSY</homepageDocId>
  <!-- homepage>....</homepage -->
  <collectionId>1</collectionId>
  <!-- collectionName>myCollection</collectionName -->
  <contextualizedTree>false</contextualizedTree>
  <!-- navigationDepth>4</navigationDepth -->
  <branch>main</branch>
  <language>default</language>
  <!-- defaultReferenceLanguage>default</defaultReferenceLanguage -->
  <defaultDocumentType>SimpleDocument</defaultDocumentType>
  <publisherRequestSet>default</publisherRequestSet>
  <siteSwitching mode="all"/>
  <newVersionStateDefault>publish</newVersionStateDefault>
  <locking>
    <automatic lockType='pessimistic' defaultTime='15' autoExtend='true'/>
  </locking>
  <!--
  <documentTypeFilter>
    <include name="foo*"/>
    <exclude name="bar*"/>
  </documentTypeFilter>
  -->
</siteconf>

Element

Required

Description

title

yes

a (typically short) title for the site

description

yes

a description for the site, shown on the sites overview page

skin

yes

the skin to use for this site

navigationDocId

yes

the ID of the navigation document

homepageDocId

one of these

the ID of the homepage

homepage

a path to the homepage, used instead of the homepageDocId. Usually this is a path to a Wiki extension (ext/something)

collectionId

one of these

the ID of the default collection for the site

collectionName

the name of the default collection of the site. Will only be used when collectionId is not set.

contextualizedTree

yes

true or false. Indicates whether the navigation tree should be shown in full (= when false), or if the navigation tree should only have open branches leading to the selected node (= when true)

navigationDepth

always displays the first n levels of the navigation tree. When using this with contextualizedTree=true then the first n levels will always be shown no matter what and more may be shown as you progress through the navigation.  When using contrextualizedTree=false then only the first n levels will be shown no matter at what place the current document happens to be in the navigation.

branch

no, default main

default branch for the site (specify either the branch ID or name)

language

no, default "default"

default language for the site (specify either the language ID or name)

defaultReferenceLanguage

no

default language for new documents (specify either the language ID or name)

defaultDocumentType

no

the default document type for this site. The document type can be specified either by ID or by name.

publisherRequestSet

no

which publisher request set to be used for the p:preparedDocuments publisher request for pages rendered in this site.

siteSwitching

no

defines if the browser should be redirected to another site if a document is better suited for display in another site. Valid values for the mode attribute are: stay (never switch to another site), all (consider all available sites as sites to switch to), selected (consider only selected sites, listed in <site> child elements inside the <siteSwitching> element). For more information see URL space management.

newVersionStateDefault

yes

publish or draft. This indicates the default state of the "Publish changes immediately" flag on the edit screen.

locking

the locking strategy to use. To use no locking at all, remove the <automatic> element (but leave the empty <locking> element). To use warn-locking, i.e. only warning that someone else is editing the page but still allowing concurrent edits, change the lockType attribute to "warn".

documentTypeFilter

no

allows to specify a filter for the document types that should be visible when creating a new document within this site. Zero or more include and/or exclude patterns can be specified, the order of the patterns is of no importance. Document types will be shown if they match at least one include pattern and no exclude pattern. If there are only exclude patterns, an implicit <include name="*"/> is assumed.

The patterns can be literal strings, or can contain the wildcards * and ?. The wildcard * matches zero or more characters. The wildcard ? matches exactly one character. To match one or more characters, you can use ?*. While document type names can't contain these characters, for completes we mention that the wildcards can be escaped using \* and \?, and backslash when used in this context can be escaped using \\ (thus \\* and \\?).

Note that this feature is not an access control, it forbids nothing, it just filters the document type list when shown.

5.1.2.2 Creating a site

Again, all you need to do to define a new site is creating a new subdirectory in the sites directory and putting a valid siteconf.xml in it.

5.1.2.3 Removing a site

To make a site unavailable, you can:

5.1.2.4 Runtime detection of new/updated/deleted siteconf's

Changes to the sites configurations are automatically picked up, it is not needed to restart the Daisy Wiki. It can take up to 10 seconds before Daisy notices your changes (this interval is configurable in the cocoon.xconf). If you don't see a site appearing, check the cocoon log files for errors.

5.1.2.5 Site filtering

The list of sites displayed to the user is filtered based on whether the user has access to the homepage document of the site. In case a custom homepage path is used (<homepage> instead of <homepageDocId>), you can still specify the homepageDocId to cause filtering. If this is not done, the site will always be displayed in the list.

 PreviousHomeNext 
5 Daisy Wiki5.1.3 Creating a new site using daisy-wiki-add-site