Skip to content

Project.xqm

KWunsch edited this page Nov 9, 2023 · 14 revisions

General

project.xqm is the central file controlling how a project is displayed. By implementing the functions described below, you can load special JavaScript and CSS files (useful if your needs can't be met by simple project.css/project.js), adapt how the title is displayed (in the HTML header), or adjust the project's start page (as displayed by start.html). To help maintaining a clean structure and a common page layout, project.xqm is cascading: if none is present in a project's collection, the search continues upwards. If all of your projects share the settings available here, you might be able to just have one project.xqm in your data collection. In general, using html-fragments and templating is more efficient than using the XQuery-functions. For more iformation, refer to the Project-specifics

Functions in project.xqm

While none of these functions has to be implemented, at least wdbPF:getHeader should be present to display a meaningful head. See also project specific layout and functions.

wdbPF:getProjectFiles($model)

return html:link and html:script elements to be included in the html:head.

wdbPF:getHeader($model)

return the content for html:header: e.g. 0-1 html:h1, 0-1 html:h2 and 0+ html:span[@class="dispOpts"] for links used all over the project. When present, this will override the generic header; it takes precedence over the more specific header functions (see below). Using project-specific html-fragments is more efficient. For information on how to do that, refer to the Project-specifics.

wdbPF:getHeaderLeft($model), wdbPF:getHeaderCentre($model), wdbPF:getHeaderRight($model)

return the content for 1–3 html:div within html:header (with classes headerSide for left and right and headerCentre for the middle piece, respectively). These can be used independently of each other – generic values will be used if one is not set – but they are superseded by wdbPF:getHeadre($model) (see above).

wdbPF:getImages($id, $page)

return the full path for the image of $page in document $id – used in the creation of an IIIF manifest.

wdbPF:getStart($model)

return a sequence of nodes that will be the right hand side of start.html.

wdbPF:getNavXSLT()

return an xs:anyURI pointing to the XSLT that should be used to transform the response of nav.xql for displaying the navigation. This is only necessary if there is no vav.xsl present in the project collection and you don't want to use the global stylesheet ad wdb:edocBaseDB/resources/nav.xsl.

wdbPF:getRestView

wdbPF:getProjectFooter

wdbPF:getProjectRightFooter

wdbPF:getSearchXSL()

return an xs:anyURI pointing to the XSLT that should be used to transform a search result or entity list.

Clone this wiki locally