Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is anticipated that the customisation features described in the JSPUI Configuration and Customization and XMLUI Configuration and Customization sections will be sufficient to satisfy the needs of the majority of users. However, some users may want to customise DSpace further, or just have a greater understanding of If you are looking for ways to override specific classes or resources in DSpace (specifically in the backend), this page provides a guide for how to do so.

Table of Contents
minLevel2
outlinetrue
stylenone

Additions module

Location: [dspace-source]/dspace/modules/additions/

This module may This module was added in DSpace 3.0 and should be used to store dspace-api changes, custom plugins, ..etc. Classes placed in in [dspace-source]/dspace/modules/additions will override those located in the [dspace-source]/dspace-api.

This module will may be used for to override classes across all the webapps located in the [dspace-source]/dspace/modules directory and / directory, as well as in the command line interface. It is recommended to place all dspace-api changes in this module so the changes made are contained in a single module, making it easier to get an overview of changes made.

Maven WAR Overlays

  Therefore, this modules is for global overrides only. If you have overrides specific to a single webapp, use the "Maven WAR Overlays" option below.

Server Webapp Overlay

Location: [dspace-source]/dspace/modules/server/

This module overlay directory allows you to override any classes, resources or files available (by default) in the Server Webapp.  This includes overriding files of any of the following source directories:

  • [dspace-source]/dspace-oai/  (Bundled into the Server Webapp as a JAR)
  • [dspace-source]/dspace-rdf/  (Bundled into the Server Webapp as a JAR)
  • [dspace-source]/dspace-server-webapp/ (The Server Webapp itself)
  • [dspace-source]/dspace-sword/ (Bundled into the Server Webapp as a JAR)
  • [dspace-source]/dspace-swordv2/ (Bundled into the Server Webapp as a JAR)

Java classes place Much of the customisation described in the JSPUI and XMLUI customisation sections is based on Maven WAR Overlays. In short, any classes or files placed in [dspace-source]/dspace/modules/* will be overlayed onto the selected WAR. This includes both new and amended files.For more details on Maven WAR Overlays and how they relate to DSpace, see this presentation from Fall 2009: Making DSpace XMLUI Your Own
(Please note that this presentation was made for DSpace 1.5.x and 1.6.x, but much of it still applies to current versions of DSpace.)server/ will override classes (of the same path/name) in any of the above modules.

You can also override resources (i.e. any files under a /src/main/resources/ directory) which are embedded in one of the JARs by putting them under [dspace-source]/dspace/modules/server/src/main/resources/.  For example, to override the "[dspace-source]/dspace-oai/src/main/resources/templates/index.twig.html" file embedded in the dspace-oai.jar, you'd place your own version at [dspace-source]/dspace/modules/server/src/main/resources/templates/index.twig.html. This results in the resource/file being copied over into the WEB-INF/classes/ subdirectory of the "server" webapp, and in that location it will override any file of the same name embedded in a JAR (per Servlet Spec 3.0).

Rest (Deprecated) Webapp Overlay

Location: [dspace-source]/dspace/modules/rest

If you have chosen to install the deprecated REST API v6 webapp, you can similar override any classes/files of that separate webapp by just placing those files in the [dspace-source]/dspace/modules/rest/ directory

DSpace Source Release

If you have downloaded the 'dspace-src-release' (or checked out the latest DSpace Code via GitHub), there are two main build options that are available to you:

...