There are a number of ways in which DSpace can be configured and/or customized:
[dspace]/config
Of these methods, only the last is likely to cause any headaches; if you update the DSpace source code directly, it may make applying future updates difficult. However, DSpace is open source, of course, and if you make any modifications that might be helpful to other institutions or organizations, feel free to send them to the DSpace team at MIT.
dspace.cfg
Configuration Properties FileThe primary way of configuring DSpace is to edit the dspace.cfg
. You'll definitely have to do this before you can operate DSpace properly. dspace.cfg
contains basic information about a DSpace installation, including system path information, network host information, and other things like site name.
The default dspace.cfg
is a good source of information, and contains comments for all properties. It's a basic Java properties file, where lines are either comments, starting with a '#
', blank lines, or property/value pairs of the form:
property.name = property value
Due to time constraints, this document does not contain an exhaustive list of properties; they are all listed in the supplied dspace.cfg
. Below are some particularly relevant properties with notes for their use:
Property | Example Values | Notes |
---|---|---|
dspace.dir |
/dspace |
Root directory of DSpace installation. Omit the trailing '/'. Note that if you change this, there are several other parameters you will probably want to change to match, e.g. assetstore.dir . |
dspace.url |
http://dspace.myu.edu http://dspacetest.myu.edu:8080 |
Main URL at which DSpace Web UI webapp is deployed. Include any port number, but do not include a trailing '/' |
dspace.hostname |
dspace.myu.edu |
Fully qualified hostname; do not include port number |
dspace.name |
DSpace at My University |
Short and sweet site name, used throughout Web UI, e-mails and elsewhere (such as OAI protocol) |
config.template.foo |
/opt/othertool/cfg/foo |
When install-configs is run, the file [dspace]/config/templates/foo file will be filled out with values from dspace.cfg and copied to the value of this property, in this example /opt/othertool/cfg/foo . See here for more information. |
webui.site.authenticator |
edu.myu.MyAuthenticator |
The Java class name of a class implementing the org.dspace.app.webui.SiteAuthenticator interface. |
handle.prefix |
1721.1234 |
The Handle prefix for your site, see the Handle section |
assetstore.dir |
/bigdisk/store |
The location in the file system for asset (bitstream) store number zero. This should be a directory for the sole use of DSpace. |
assetstore.dir.n |
/anotherdisk/store1 |
The location in the file system of asset (bitstream) store number n . When adding additional stores, start with 1 (assetstore.dir.1 and count upwards. Always leave asset store zero (assetstore.dir ). For more details, see the Bitstream Storage section. |
assetstore.incoming |
1 |
The asset store number to use for storing new bitstreams. For example, if assetstore.dir.1 is /anotherdisk/store1 , and assetstore.incoming is 1 , new bitstreams will be stored under /anotherdisk/store1 . A value of 0 (zero) corresponds to assetstore.dir . For more details, see the Bitstream Storage section. |
srb.xxx srb.xxx.n |
/zone/home/user.domain |
The sets of SRB access parameters (see dspace.cfg) if one or more SRB accounts are used. The srb.xxx set would correspond to asset (bitstream) store number zero. The srb.xxx.n set would correspond to asset (bitstream) store number n. For more details, see the Bitstream Storage section. |
webui.submit.enable-cc |
true |
Enable the Creative Commons license step in the submission process. Submitters are given an opportunity to select a Creative Commons license to accompany the Item. Creative Commons licenses govern the use of the content. For more details, see the Creative Commons website. |
Whenever you edit dspace.cfg
, you should then run [dspace]/bin/install-configs
so that any changes you may have made are reflected in the configuration files of other applications, for example Apache. You may then need to restart those applications, depending on what you changed.
Sometimes DSpace automatically sends e-mail messages to users, for example to inform them of a new workflow task, or as a subscription e-mail alert. The wording of emails can be changed by editing the relevant file in [dspace]/config/emails
. Each file is commented. Be careful to keep the right number 'placeholders' (e.g.{2}
).
There are several places in DSpace in which the user will be shown contact information for the local DSpace Administrator: for instance, when an error occurs, or in the on-line help when the user is looking for more information. The contact information is displayed by [dspace-source]/jsp/components/contact-info.jsp.
This JSP retrieves the help e-mail in dspace.cfg, but the phone number in the JSP is a dummy phone number that needs to be edited directly in the JSP. You should be sure to edit this file (adding any additional information you feel might be useful) so that users know who to contact for further information.
The [dspace]/config/registries
directory contains two XML files. These are used to load the initial contents of the Dublin Core type registry and Bitstream Format registry. After the initial loading (performed by ant fresh_install
above), the registries reside in the database; the XML files are not updated.
Currently, the system requires that every item have a Dublin Core record. The exact Dublin Core elements and qualifiers that are used can be configured by editing the Dublin Core registry. This can either be done at install-time, by editing [dspace]/config/registries/dublin-core-types.xml
, or at run-time using the administration Web UI. However, note that some elements and qualifiers must be present for DSpace to function correctly since they are used for various purposes by the code. Details are in the relevant .xml
file.
Also note that altering the Dublin Core registry does not, at the current time, cause corresponding changes in the Web UI (e.g. the submission interface or search indices).
The bitstream formats recognized by the system and levels of support are similarly stored in the bitstream format registry. This can also be edited at install-time via [dspace]/config/registries/bitstream-formats.xml
or by the administation Web UI. The contents of the bitstream format registry are entirely up to you, though the system requires that the following two formats are present:
Unknown
License
To ease the hassle of keeping configuration files for other applications involved in running a DSpace site, for example Apache, in sync, the DSpace system can automatically update them for you when the main DSpace configuration is changed. This feature of the DSpace system is entirely optional, but we found it useful.
The way this is done is by placing the configuration files for those applications in [dspace]/config/templates
, and inserting special values in the configuration file that will be filled out with appropriate DSpace configuration properties. Then, tell DSpace where to put filled-out, 'live' version of the configuration by adding an appropriate property to dspace.cfg
, and run [dspace]/bin/install-configs
.
Take the apache13.conf
file as an example. This contains plenty of Apache-specific stuff, but where it uses a value that should be kept in sync across DSpace and associated applications, a 'placeholder' value is written. For example, the host name:
ServerName @@dspace.hostname@@
The text @@dspace.hostname@@
will be filled out with the value of the dspace.hostname
property in dspace.cfg
. Then we decide where we want the 'live' version, that is, the version actually read in by Apache when it starts up, will go.
Let's say we want the live version to be located at /opt/apache/conf/dspace-httpd.conf
. To do this, we add the following property to dspace.cfg
so DSpace knows where to put it:
config.template.apache13.conf = /opt/apache/conf/dspace-httpd.conf
Now, we run [dspace]/bin/install-configs
. This reads in [dspace]/config/templates/apache13.conf
, and places a copy at /opt/apache/conf/dspace-httpd.conf
with the placeholders filled out.
So, in /opt/apache/conf/dspace-httpd.conf
, there will be a line like:
ServerName dspace.myu.edu
The advantage of this approach is that if a property like the hostname changes, you can just change it in dspace.cfg
and run install-configs
, and all of your tools' configuration files will be updated.
However, take care to make all your edits to the versions in [dspace]/config/templates
! It's a wise idea to put a big reminder at the top of each file, since someone might unwittingly edit a 'live' configuration file which would later be overwritten.
The Web UI is implemented using Java Servlets which handle the business logic, and JavaServer Pages (JSPs) which produce the HTML pages sent to an end-user. Since the JSPs are much closer to HTML than Java code, altering the look and feel of DSpace is relatively easy.
To make it even easier, DSpace allows you to 'override' the JSPs included in the source distribution with modified versions, that are stored in a separate place, so when it comes to updating your site with a new DSpace release, your modified versions will not be overwritten.
You can also easily edit the text that appears on each JSP page by editing the dictionary file. However, note that unless you change the entry in all of the different language message files, users of other languages will still see the default text for their language. See internationalization.
Note that the data (attributes) passed from an underlying Servlet to the JSP may change between versions, so you may have to modify your customized JSP to deal with the new data.
Thus, if possible, it is recommeded you limit your changes to the 'layout' JSPs and the stylesheet.
The JSPs are stored in [dspace-source]/jsp
. Place your edited version of a JSP in the [dspace-source]/jsp/local
directory, with the same path as the original. If they exist, these will be used in preference to the distributed versions in [dspace-source]/jsp
. For example:
DSpace default | Locally-modified version |
---|---|
[dspace-source]/jsp/community-list.jsp |
[dspace-source]/jsp/local/community-list.jsp |
[dspace-source]/jsp/mydspace/main.jsp |
[dspace-source]/jsp/local/mydspace/main.jsp |
Heavy use is made of a style sheet, in [dspace-source]/jsp/styles.css.jsp
. If you make edits, call the local version [dspace-source]/jsp/local/styles.css.jsp
, and it will be used automatically in preference to the default, as described above.
Fonts and colors can be easily changed using the stylesheet. The stylesheet is a JSP so that the user's browser version can be detected and the stylesheet tweaked accordingly.
The 'layout' of each page, that is, the top and bottom banners and the navigation bar, are determined by the JSPs [dspace-source]/jsp/layout/header-*.jsp
and [dspace-source]/jsp/layout/footer-*.jsp
. You can provide modified versions of these (in [dspace-source]/jsp/local/layout
, or define more styles and apply them to pages by using the "style" attribute of the dspace:layout
tag.
After you've customized your JSPs, you must rebuild the DSpace Web application. If you haven't already built and installed it, follow the install directions. Otherwise, follow the steps below:
Rebuild the dspace.war
file by running the following command from your [dspace-source]
directory:
ant -Dconfig=[dspace]/config/dspace.cfg build_wars
Shut down Tomcat, and delete the existing [tomcat]/webapps/dspace directory.
Copy the new .war file to the Tomcat webapps directory:
cp [dspace-source]/build/dspace.war [tomcat]/webapps
When you restart the web server you should see your customized JSPs.
In dspace.cfg
create a webui.itemdisplay.default
item specifying a comma-separated list of metadata fields to display. For example,
webui.itemdisplay.default = dc.title, date.issued(date), identifier.uri(link), description.*
webui.itemdisplay.default
is present, the default defers to a preset list hard-coded in DSpace. If an item has no value for a particular field, it won't be displayed.
Add entries to the Messages.properties
file as required. The name of the field for display will be drawn from the current UI dictionary, using the key metadata.<metadata field>
. For example metadata.dc.title = Title
The metadata in dspace.cfg
can be specified in the form <schema prefix>.<element>[.<qualifier>|.*][(date)|(link)], ...
. For example,
Create dspace.cfg
entries for each of the "styles" of item display in the same way the default layout is configured. For example,
webui.itemdisplay.thesis-style = contributor.*, identifier.uri, description.abstract
dspace.cfg
item. For example,
webui.itemdisplay.thesis-style.collections = 123456789/1, 123456789/56
Messages.properties
file. In the above example, the Messages.properties
file would need to contain something like:
metadata.dc.contributor.* = Authors
metadata.dc.identifier.uri = Citation
metadata.dc.description.abstract = Abstract
Since many institutions and organizations have exisiting authentication systems, DSpace has been designed to allow these to be easily integrated. To do this, you can provide a custom class implementing the Java interface org.dspace.app.webui.SiteAuthenticator
. These methods are invoked when various authentication-related events occur in the Web user interface.
The basic authentication procedure in the DSpace Web UI is this:
startAuthentication
method is invoked on the currently configured SiteAuthenticator
implementationstartAuthentication
might instantly authenticate the user somehow, or forward the request to some sort of log-in page--the parameters of the original request are safely stored and will be accessible after the log-in process has completedPlease see the SiteAuthenticator.java
source file for information about each of the methods. The default implementation, org.dspace.app.webui.SimpleAuthenticator
, is a simple implementation that implements these policies:
Use of inbuilt e-mail address/password-based log-in. This is achieved by forwarding a request that is attempting an action requiring authorization to the password log-in servlet, /password-login
. The password log-in servlet (org.dspace.app.webui.servlet.PasswordServlet
contains code that will resume the original request if authentication is successful, as per step 3. described above.
Users can register themselves (i.e. add themselves as e-people without needing approval from the administrators), and can set their own passwords when they do this
Users are not members of any special (dynamic) e-person groups
As of version 1.3, the SimpleAuthenticator
also supports LDAP authentication.
Included in the source is the implementation of SiteAuthenticator
used at MIT, edu.mit.dspace.MITAuthenticator
. This implements a slightly more complex authentication mechanism:
If an authentication user in an MIT user, they must log in using an X509 Web certificate. The certificate-login
servlet, similar to the password-login
servlet, authenticates users via these certificates, and if successful, resumes the original request just as the password log-in servlet would.
MIT users are also automatically added to the special (dynamic) group called 'MIT Users' (which must be present in the system!). This allows us to create authorization policies for MIT users without having to manually maintain membership of the MIT users group.
Anyone can register themselves, but MIT users doing this cannot set a password; they must use their X509 Web certificate to log in.
The X509 certificate login servlet has an extra feature: If the webui.cert.autoregister
configuration property is true
, it will automatically register the user with the system.
You could create a customized version of the password login servlet to perform a similar action. For example, if your organization uses Windows NT domain authentication, you could implement a version of PasswordServlet.java that validates against Windows NT authentication, and automatically adds an e-person record for new users. It is strongly recommended that you do not edit PasswordServlet but create a new servlet for this, so that future updates of the DSpace code do not overwrite your changes. You would also have to implement a customized SiteAuthenticator
in which the startAuthentication
method would forward requests to your new servlet.
If LDAP is enabled in the dspace.cfg file, then new users will be able to register by entering their username and password without being sent the registration token. If users do not have a username and password, then they can still register and login with just their email address the same way they do now.
If you want to give any special privileges to LDAP users, you will still need to extend the SiteAuthenticator class to automatically put people who have a netid into a special group. You might also want to give certain email addresses special privileges. Refer to the Custom Authentication Code section above for more information about how to do this.
Here is an explanation of what each of the different configuration parameters are for:
(Available in DSpace 1.2.1+)
Search Indexes can be configured via the dspace.cfg
file. This allows institutions to choose which DSpace metadata fields are indexed by Lucene.
For example, the following entries appear in a default DSpace installation:
search.index.1 = author:contributor.* search.index.2 = author:creator.* search.index.3 = title:title.* search.index.4 = keyword:subject.* search.index.5 = abstract:description.abstract search.index.6 = author:description.statementofresponsibility search.index.7 = series:relation.ispartofseries search.index.8 = abstract:description.tableofcontents search.index.9 = mime:format.mimetype search.index.10 = sponsor:description.sponsorship search.index.11 = id:identifier.*
The form of each entry is search.index.<id> = <search field>:<metadata field>
where:
<id>
is an incremental number to distinguish each search index entry<search field>
is an identifier for the search field this index will correspond to<metadata field>
is the DSpace metadata field to be indexedSo in the example above, search.indexes1, 2 and 6 are configured as the author
search field. The author
index is created by Lucene indexing all contributor
, creator
and description.statementofresponsibility
medatata fields.
After changing the configuration, run index-all
to recreate the indexes.
NOTE: While the indexes are created, this only affects the search results and has no effect on the search components of the user interface. To add new search capability (e.g. to add a new search category to the Advanced Search) requires local customisation to the user interface.
Statistics for the system can be made available at http://www.mydspaceinstance.edu/statistics
. To use the system statistics you will have to initialise them as per the installation documentation, but before you do so you need to perform the customisations discussed here in order to ensure that the reports are generated correctly.
Configuration for the statistics system are in [dspace]/config/dstat.cfg
and the file should guide you to correctly filling in the details required. For the most part you will not need to change this file.
To customise the supplied perl scripts to do monthly and general report generation it is necessary to modify the scripts themselves sightly. This is because these scripts were developed to speed up the process of using DStat at Edinburgh University Library and were not particularly intended for external use. They appear here for the convenience of others and in order to bridge the gap between the report generation and the inclusion of those reports into the DSpace UI, which is currently a clunky process.
In order to get these scripts to work for you, open each of the following in turn:
dstat-general dstat-initial dstat-monthly dstat-report-general dstat-report-initial dstat-report-monthly
scripts eding with -general
do the work for building reports spanning the entire history of the archive; scripts ending -initial
are to initialise the reports by doing monthly reports from some start date up to the present; scripts ending -monthly
generate a single monthly report for the current month. These scripts are just designed to make life easier, and are not particularly clever or elegant.
In each file you will find a section:
# Details used ################################################ ... some perl ... ################################################
the perl between the lines of hashes defines the variables which will be used to do all of the processing in the report. The following explains what the variables mean and what they should be set to for each of the scripts
dstat-initial:
$out_prefix
: prefix to place in front of each output file.
$out_suffix
: suffix for output file. A date will be inserted between the prefix and suffix
$start_year
: year to start back-analysing monthly logs from
$start_month
: month to start back-analysing monthly logs from
$dsrun
: path to your dsrun script, usually [dspace]/bin/dsrun
$out_directory
: directory into which to place analysis files, for example [dspace]/bin/log/
dstat-monthly:
$out_prefix
: prefix to place in front of each output file.
$out_suffix
: suffix for output file. A date will be inserted between the prefix and suffix
$dsrun
: path to your dsrun script, usually [dspace]/bin/dsrun
$out_directory
: directory into which to place analysis files, for example [dspace]/bin/log/
dstat-general:
$out_prefix
: prefix to place in front of each output file.
$out_suffix
: suffix for output file. Today's date will be inserted between the prefix and suffix
$dsrun
: path to your dsrun script, usually [dspace]/bin/dsrun
$out_directory
: directory into which to place analysis files, for example [dspace]/bin/log/
dstat-report-initial:
$in_prefix
: the prefix of the files generated by dstat-initial
$in_suffix
: the suffix of the files generated by dstat-initial
$out_prefix
: the report file prefix. Should be "report-
" in order to work with DSpace UI
$out_suffix
: the report file suffix. Should be ".html
" in order to work with DSpace UI
$start_year
: the start year used in dstat-initial
$start_month
: the start month used in dstat-initial
$dsrun
: path to your dsrun script, usually [dspace]/bin/dsrun
$in_directory
: directory where analysis files were placed in dstat-initial
$out_directory
: the live reports directory: [dspace]/reports/
dstat-report-monthly:
$in_prefix
: the prefix of the files generated by dstat-monthly
$in_suffix
: the suffix of the files generated by dstat-monthly
$out_prefix
: the report file prefix. Should be "report-
" in order to work with DSpace UI
$out_suffix
: the report file suffix. Should be ".html
" in order to work with DSpace UI
$dsrun
: path to your dsrun script, usually [dspace]/bin/dsrun
$in_directory
: directory where analysis files were placed in dstat-monthly
$out_directory
: the live reports directory: [dspace]/reports/
dstat-report-general:
$in_prefix
: the prefix of the files generated by dstat-general
$in_suffix
: the suffix of the files generated by dstat-general
$out_prefix
: the report file prefix. Should be "report-general-
" in order to work with DSpace UI
$out_suffix
: the report file suffix. Should be ".html
" in order to work with DSpace UI
$dsrun
: path to your dsrun script, usually [dspace]/bin/dsrun
$in_directory
: directory where analysis files were placed in dstat-general
$out_directory
: the live reports directory: [dspace]/reports/
If you want additional customisations, you will need to modify the lines which build the command to be executed and change the parameters passed to the java processes which actually carry out the analysis. For more information on these processes either build the javadocs or run:
[dspace]/bin/dsrun ac.ed.dspace.stats.LogAnalyser -help [dspace]/bin/dsrun ac.ed.dspace.stats.ReportGenerator -help
Image thumbnails can be enabled on the Browse and Search Results pages by setting the appropriate configuration values. To enable the display of thumbnails the following items must be set in the dspace.cfg
file:
webui.browse.thumbnail.show = true
If set to false
or this configuration item is missing then thumbnails will not be shown.
The size of the browse/search thumbnails can also be configured to a smaller size than that generated by the mediafilter. To do this set the following configuration items:
webui.browse.thumbnail.maxheight = <maxheight in pixels>
webui.browse.thumbnail.maxwidth = <maxwidth in pixels>
If these configuration items are not set, thumbnail.maxheight
and thumbnail.maxwidth
are used. Setting these values greater than or equal to the size of the thumbnail generated by the mediafilter (i.e. thumbnail.maxheight
and thumbnail.maxwidth
) will have no effect.
Note:
The target of a thumbnail in the Browse and Search Results Page can be configured by setting the following configuration item:
webui.browse.thumbnail.linkbehaviour = <target page type>
Currently the values item
and bitstream
are allowed. If this configuration item is not set, or set incorrectly, the default is item
.
Thumbnails may also be enabled or disabled on the Item Display page by setting the following configuration item in dspace.cfg
:
webui.item.thumbnail.show = true
If set to false
or this configuration item is missing then thumbnails will not be shown.
To show the item count against communities and collections set the webui.strengths.show
configuration item in the dspace.cfg
file as follows:
webui.strengths.show = true
If this config item is missing or is set to any value other than true
the item counts will not be shown.
Because the file format support policy is determined by each individual institution, the on-line help on this subject is intentionally left blank. The help file will, however, retrieve a list of formats and the support levels associated with them in your database and display this information to the user. We highly recommend that you edit the "Format Support Policy" section of the file [dspace-source]/jsp/help/formats.jsp
.
Setting webui.licence_bundle = true
in dspace.cfg
will result in a hyperlink being rendered on the Item View page that points to the item's licence.