DSpace Customization
Sanjay Burde
Principal Scientist
CSIR-NISCAIR
Why to Customize
• Your own institutional need
• User interface enhancements
• Address quality and accessibility
2
Ways to Customize
User Interface
– Home page, Layout, quick links
– Logo, Header, Footer, Navigation Bar
– Texts
Metadata
– New element
– Updating/Deleting existing one
3
Ways to Customize
Submission/Input Form
Item Display
Browse Fields
Browse Layout
Discover
Language
4
Skill Required for DSpace Customization
Understanding of HTML
Understanding of CSS
– layout, colors, and fonts
5
DSpace Directories
Source Directories ([/home/dspace/dspace-5.0-src-
release/])
All customization generally takes place here
jsp/ - DSpace JSPs
src/ - DSpace Servlets & Classes
Installed Directories ([/dspace/])
Home to all "live" configuration files, properties, Java libraries (including
dspace.jar)
config/ - DSpace configurations
Usually home to log files, reports, search indices, and "bitstreams"
themselves!
Web Deployment Directory (Webapplication Directory
([/dspace/webapps/])
Home to all compiled servlets and JSPs
Basic customizations can also take place here after installation
6
Header / Navigation Bar
Messages Properties /
Navigation Bar
Location Bar
Top News
Side Bar News
Footer
7
Basic Customization: Top &
Sidebar News
•To change the Top/Sidebar News:
Administer->General Settings->Edit News
Tips: Top news/Sidebar page can be designed using web designing,
imaging & animation software & then pasting its HTML code in Top 8
news/Sidebar editor.
Customization: Header/ Footer/
Navbar
Files Located in:
/dspace/webapps/jspui/layout
Change the HTML in header-default.jsp, footer-default.jsp,
navbar-default.jsp, location-bar.jsp, …
N.B. If you don’t want something to be appeared in the site, just
comment it using <%-- and --%>
Example:
<%-- <form method="get" action="<%=
request.getContextPath() %>/simple-search"> --%>
Remember: After making the necessary changes, just refresh
the page to get effects
9
Customization: Header/ Footer/
Navbar
Changing Header background & logo in NavBar
File: header-default.jsp
<header class="navbar navbar-inverse navbar-fixed-top">
Change to:
<header style="background-color:orange;" class="navbar-fixed-top">
Changing Logo
Copy logo image file to /dspace/webapps/jspui/image
Change logo image file name “dspace-logo-only.png” in navbar-default.jsp
Remember: After making the necessary changes, just refresh
the page to get effects
10
Customization: Header/ Footer/
Navbar
Changing Title & BIG Logo (below NavBar)
Changing Title, Description & 'Learn more' link:
Texts defined in Messages.Properties file (steps covered under Customization:
Texts)
jsp.layout.header-default.brand.heading = Dspace JSPUI
jsp.layout.header-default.brand.description = DSpace preserves and enables ...
Changing BIG logo:
Copy logo image file to /dspace/webapps/jspui/image
Change logo image file name “logo.gif” in header-default.jsp
Tips: You can create title graphics & use in place of separate Heading & logo
Remember: After making the necessary changes, just refresh
the page to get effects 11
Customization: Header/ Footer/
Navbar
Adding menu items in NavBar
File: navbar-default.jsp
Find the word “Help” in above file & add the new menu item
<li class="<%= ( currentPage.endsWith( "/help" ) ? "active" : "" )
%>"><dspace:popup page="<%=
LocaleSupport.getLocalizedMessage(pageContext, \"help.index\")
%>"><fmt:message key="jsp.layout.navbar-
default.help"/></dspace:popup></li>
<li> <a href="http://www.niscair.res.in">NISCAIR</li>
Remember: After making the necessary changes, just refresh
the page to get effects
12
Customization: Location Bar
Changing name:
Files Located in:
/dspace/config/dspace.cfg
Change name of the site in
dspace.name = “DSpace Short-Term Course”
Restart Tomcat to reflect changes.
Run “sh start_dspace” in /home/dspace
13
Customization: Location Bar
Changing background colour:
Files Located in:
/dspace/webapps/jspui/layout/location-bar.jsp
Change line:
<ol class="breadcrumb btn-success">
to:
<header style="background-color:red;">
To remove bullet, delete <li> tags
Remember: After making the necessary changes, just refresh
the page to get effects 14
Customization: Text
• “Messages.properties” contains almost all
the text of DSpace
• Located in:
/home/dspace/dspace-5.0-src-release/dspace-api/src/main/resources
Copy to
/dspace/webapps/jspui/WEB-INF/classes
Do changes ONLY in the folder /dspace/webapps/jspui/WEB-INF/classes
Format of “Messages.properties”
jsp.layout.navbar-default.authors = Authors
(Navigation bar text “Authors” shared by pages in /jsp/layout/navbar-
default.jsp)
15
To reflect changes, restart tomcat.
Customization: Text
• Keys in Messages.properties referenced in JSP
with:
<fmt:message key=“jsp.layout.navbar-
default.authors”/>
(/jspui/layout/navbar-default.jsp)
• The text corresponds to a property "key" named
after the JSP or Tag in which it appears.
• Example:
jsp.community-home.heading1 is a heading within
/jsp/community-home.jsp
jsp.general.search.button is the text that appears on ALL search
buttons in DSpace
16
Customization: Text
Before
Change “Subject” to “Keyword”
17
Customization: Text
After
Change “Subject” to “Keyword”
To reflect changes, restart tomcat. 18
Customization: Text
Change “Subject” to “Keyword”
• browse.type.metadata.subject = Subject
• browse.menu.subject = Subject
• jsp.browse.items-by-subject.heading1 = Items
for Subject
• jsp.browse.items-by-subject.return = Return to
Browse by Subject
• jsp.browse.items-by-subject.title = Items for
Subject
• jsp.browse.subject.show = Showing subjects {0}-
{1} of {2}.
• jsp.browse.subject.title = Browse by Subject
19
Customization: Add Metadata
•Login as Administrator
Administer->General Settings->Metadata Registry
20
Customization: Metadata
Customization: Submit/ Input Form
Submission form is located in: /dspace/config/input-forms.xml
22
Customization: Submit/ Input Form
General format of input-forms.xml (in /dspace/config)
<page number="1">
<field>
<dc-element>refno</dc-element>
<dc-qualifier></dc-qualifier>
<repeatable></repeatable>
<label>Reference No.</label>
<input-type>onebox</input-type>
<hint>Enter Reference number of document</hint>
<required></required>
</field>
</page>
……………….
Remember: After making any changes in the input form, re-start the Tomcat server
23
Customization: Item Display (in
Abstract view metadata)
To modify the metadata displayed in item screen, modify dspace.cfg and
Messages.properties
24
Customization: Item Display
In dspace.cfg, add the new field to be displayed/ or change the order to
display
webui.itemdisplay.default = dc.title, dc.title.alternative, dc.contributor.*, \
dc.subject, dc.date.issued(date), dc.publisher, \
dc.identifier.citation, dc.relation.ispartofseries, \
dc.description.abstract, dc.description, \
dc.identifier.govdoc, dc.identifier.uri(link), \
dc.identifier.isbn, dc.identifier.issn, \
dc.identifier.ismn, dc.identifier, \
dc.refno
In Messages.properties, name the field to be displayed
metadata.dc.title = Title
metadata.dc.title.alternative = Other Titles
metadata.dc.contributor.* = Authors
metadata.dc.refno = Reference No.
To reflect chnages, restart Tomcat
25
Customization: Browse Fields in Navigation
Bar
26
Customization: Browse Fields in Navigation
Bar
Community page
27
Customization: Browse Fields in Navigation
Bar
Collection page
28
Customization: Browse Fields in Navigation
Bar
To modify the browse fields in navigation bar, modify dspace.cfg
located in /dspace/config
In dspace.cfg, uncomment the following lines to specify the metadata
fields for browsing in DSpace:- “Browse by Date”, “Browse Authors”,
“Browse Titles” and “Browse Subjects”:-
#webui.browse.index.1 = dateissued:item:dateissued
#webui.browse.index.3 = title:item:title
webui.browse.index.5 = refno:metadata:dc.refno:text
After modification in any of the browse indices in dspace.cfg, one must
Re-index for changes to take place.
In Messages.Properties
browse.menu.refno = Reference No.
Browse.type.metadata.refno = Reference No.
Remember: To reflect changes,restart Tomcat & re-index everything (go to
/dspace/bin and execute the command, sh dspace index-discovery -b
29
Customization: Change Browse Layout
(Date | Title | Authors...)
30
Customization: Change Browse Layout
(Date | Title | Authors...)
In dspace.cfg, change metadata fields which are displayed for each
item in browse or serach result.
Make the required changes in the following single line in dspace.cfg
and uncomment it:
webui.itemlist.columns = dc.date.issued(date), dc.title,
dc.contributor.*, dc.refno
In Messages.properties
itemlist.dc.refno = Reference No.
Remember: To reflect changes,restart Tomcat & re-index everything (go to
/dspace/bin and execute the command, sh dspace index-discovery -b
31
Customization: Discovery
•The Discovery enables faceted searching & browsing your repository
•Discovery is new in Dspace 5.0, but familiar for other platforms like Aquabrowser
or Amazon, where facets help to select the right product according to facets like
price and brand
More Details: https://wiki.duraspace.org/display/DSDOC4x/Discovery
Customization: Discovery
Sidebar Facet
•From the user perspective, faceted search (also called faceted navigation, guided
navigation, or parametric search) breaks up search results into multiple categories,
typically showing counts for each, and allows the user to "drill down" or further
restrict their search results based on those facets
Custom Discovery Setting
Customization: Discovery
Search Filter
• In a standard search operation, a user specifies
complete query
• If the results are not satisfactory, the user starts
over again with a (slightly) altered query
Customization: Discovery
Search Filter
Sorting Search
Items
Sidebar Facet
Customization: Discovery
Custom (metdata) Discovery Settings
Adding metadata dc.refno (Reference No.) to Discovery
Refer word document “DiscoverySettings.docx” for discovery.xml (located at
/dspace/config/spring/api/discovery.xml)
Steps for customizing discovery :
• First create bean id
•This bean ID set in the property of
• SearchFilter
• FacetSidebar
• SearchFilter and FacetSidebar place at two place
• defaultConfiguration
• homepageConfiguration
Note: After every changing need to re-index discovery and restart Apache-Tomcat
Customization: Discovery
Custom Discovery Settings ...
Bean ID
<bean id="searchFilterRefNo" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="refno"/>
<property name="metadataFields">
<list>
<value>dc.refno</value>
</list>
</property>
<property name="facetLimit" value="10"/>
<property name="sortOrder" value="COUNT"/>
</bean>
Customization: Discovery
Custom Discovery Settings ...
SidebarFacets
<property name="sidebarFacets">
<list>
<ref bean="searchFilterAuthor"/>
<ref bean="searchFilterSubject"/>
<ref bean="searchFilterIssued"/>
<ref bean="searchFilterRefNo"/>
</list>
</property>
SearchFilter
<property name="searchFilters">
<list>
<ref bean="searchFilterTitle"/>
<ref bean="searchFilterAuthor"/>
<ref bean="searchFilterSubject"/>
<ref bean="searchFilterIssued"/>
<ref bean="searchFilterRefNo"/>
</list>
</property>
Customization: Discovery
Custom Discovery Settings ...
defaultConfiguration
<bean id="defaultConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="p
rototype">
<!-- Which sidebar facets are to be displayed -->
<property name="sidebarFacets">
<list>
.
homepageConfiguration
<bean id="homepageConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scop
e="prototype">
<!--
Which sidebar facets are to be displayed (same as defaultConfiguration above)
-->
<property name="sidebarFacets">
<list>
.
.
.
Customization: Discovery
Custom Discovery Settings ...
For Setting of sort Items order by
Create bean for Sorting
<bean id="sortRefNo" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
<property name="metadataField" value="dc.refno"/>
</bean>
</beans>
Set bean in
<property name="searchSortConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
<!--
.
<ref bean="sortRefNo"/>
At two places: defaultConfiguration and homepageConfiguration
<bean id="defaultConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="pr
ototype">
AND
<bean id="homepageConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope
="prototype">
Customization: Discovery
Add key in Messages.property file
1.For Home, community page & search side facet: jsp.search.facet.refine.refno = Reference No.
1.For Search Filter: jsp.search.filter.refno = Reference No.
1.For Sort item by: search.sort-by.dc.refno_sort = Reference No.
Thank you
42