Dspace_customization

39
DSpace Customization NISCAIR NISCAIR New Delhi New Delhi

Transcript of Dspace_customization

Page 1: Dspace_customization

DSpace Customization

NISCAIRNISCAIRNew DelhiNew Delhi

Page 2: Dspace_customization

2

Why to Customize

• Your own institutional need• User interface enhancements• Address quality and accessibility

Page 3: Dspace_customization

3

Ways to CustomizeWays to Customize

User InterfaceUser Interface MetadataMetadata Browse and SearchBrowse and Search LanguageLanguage

Page 4: Dspace_customization

4

Understanding of XHTMLUnderstanding of XHTML

Understanding of CSSUnderstanding of CSS– layout, colors, and fontslayout, colors, and fonts

Skill Required for DSpace CustomizationSkill Required for DSpace Customization

Page 5: Dspace_customization

5

DSpace DirectoriesSource Directories ([/home/dspace/dspace-1.6.0-src-release/])

All customization generally takes place here config/ - DSpace configurations jsp/ - DSpace JSPs src/ - DSpace Servlets & Classes

Installed Directories ([/dspace/]) Home to all "live" configuration files, properties, Java libraries (including

dspace.jar) Usually home to log files, reports, search indices, and "bitstreams"

themselves!

Web Deployment Directory (Webapplication Directory ([/home/dspace/apache-tomcat-5.5.28/webapps/])

Home to all compiled servlets and JSPs Basic customizations can also takes place here (if you decide to do after

installation)

Page 6: Dspace_customization

6

Location Bar

Header

Top News

Side Bar News

Footer

Page 7: Dspace_customization

7

Step 1Step 2

Step 3

Basic Customization: Top News

•To change the Sidebar News, follow the same steps as shown in the above for Top News, only instead of Top News, choose Sidebar News (of Step 2)

Page 8: Dspace_customization

8

Basic Customization: Top News & Sidebar News

Top News

Sidebar News

Page 9: Dspace_customization

9

Customization: Header/ Footer/ NavbarFiles Located in:• Before Compilation: /home/dspace/dspace-1.6.0-src-release/dsapce-jspui/dspace-

jspui-webapp/src/main/webapp/layout/*.jsp• After Compilation: /home/dspace/apache-tomcat-5.5.28/webapps/jspui/layout

Change the HTML in header-default.jsp, footer-default.jsp, location-bar.jsp, navbar.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

Page 10: Dspace_customization

10

Customization: Location Bar

Files Located in:Before Compilation: /home/dspace/dspace-1.6.0-src-release/

config/dspace.cfgAfter Compilation:

/dspace/config/dspace.cfg

Change name of the site in dspace.name = “DSpace Short-Term

Course”

Page 11: Dspace_customization

11

Customization: CSSCSS file Located in: • Before Compilation: /home/dspace/dspace-1.6.0-src-release/dspce-jspui/dspace-jspui-

webapp/src/main/webapp/styles.css.jspAfter Compilation: /home/dspace/apache-tomcat-5.5.28/webapps/jspui/styles.css.jsp

BODY { font-family: "verdana", Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #000000; background: #bbbbbb; margin: 0; padding: 0; margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px }Remember: After making the necessary changes, just refresh the page to get effects

Page 12: Dspace_customization

12

Customization: XHTML• In JSP pages, Java code is surrounded by <%java code%> or <

%=java variable%>. Any other thing outside of that is XHTML (except for JSP Tags).

<td> <a href="<%= request.getContextPath() %>/"><a

href="http://drtc.isibang.ac.in"><img src="<%= request.getContextPath() %>/image/isilogo.jpg" alt="<fmt:message key="jsp.layout.header-default.alt"/>" width="102" height="100" border="0"/></a></a>

</td> <td class="tagLine" width="99%"> <%-- Make as wide as possible. cellpadding

repeated for broken NS 4.x --%> <h1 align="center">DSpace Training at NISCAIR</h1></td>

Remember: After making the necessary changes, just refresh the page to get effects

Page 13: Dspace_customization

13

Customization: Text

• “Messages.properties” contains almost all the text of DSpace

• Located in:Before Complilation: /home/dspace/dspace-1.6.0-src-release/dspace-api/src/main/resourceAfter Compilation:/home/dspace/dspace-1.6.0-src-release/dspace-api/target/classes

Format of “Messages.properties”jsp.layout.navbar-default.authors = Authors(Navigation bar text “Authors” shared by pages in /jsp/layout/navbar-default.jsp)

Remember: If changes are made in the “Messages.properties” after compilation, then we need to “shut-down” and “re-start” the Tomcat

Page 14: Dspace_customization

14

Customization: Text

“Messages.properties”

To reflect changes, modify/home/dspace/dspace-1.6.0-src-release/dspace-api/src/main/resource

Rebuild MavenUpdate webappsDeploy new webappsRestart Tomcat

[ For above, run shell script file “change_message” in /home/dspace]

Page 15: Dspace_customization

15

• 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.jspjsp.general.search.button is the text that appears on ALL search buttons in DSpace

Customization: Text

Page 16: Dspace_customization

16

Customization: TextBefore After

Page 17: Dspace_customization

17

Customization: Add Metadata

Page 18: Dspace_customization

Customization: MetadataCustomization: MetadataAdd/ Update Metadata from DSpace Administrator Add/ Update Metadata from DSpace Administrator

interface (interface (http://192.168.1.129:8080/dspace/dspace-http://192.168.1.129:8080/dspace/dspace-adminadmin))

Page 19: Dspace_customization

19

Customization: Submit/ Input FormCustomization: Submit/ Input Form

Page 20: Dspace_customization

20

Customization: Submit/ Input FormCustomization: Submit/ Input Form

Submission form is located in:

Before Compilation: /dspace/dspace-1.4.2-source/config/input-forms.xml

After Compilation: /dspace/config/input-forms.xml

Page 21: Dspace_customization

21

Customization: Submit/ Input Form

General format of input-forms.xml (in /dspace/config)

<page number="1">

<field> <dc-element>govtdocrefno</dc-element> <dc-qualifier></dc-qualifier> <repeatable></repeatable> <label>Govt. Doc</label> <input-type>onebox</input-type> <hint>Enter Govt. Doc. No.</hint> <required></required> </field>

</page>

……………….

Remember: After making any changes in the input form, re-start the Tomcat server

Page 22: Dspace_customization

22

Customization: Search

Customize Advanced Search options: /dspace/config/dspace.cfg

Page 23: Dspace_customization

23

Customization: Search

•Edit the search index in: /dspace/config/dspace.cfg•This can change only your search result, not search display

………….search.index.11 = identifier:dc.identifier.*search.index.12 = language:dc.language.isosearch.index.13 = keyword:dc.description.DocRefNo.

…………..

The general format is:

search.index.[number] = [search field]:element.qualifier

Remember: After making changes, re-index everything (go to /dspace/bin and execute the command, ./index-init

Page 24: Dspace_customization

24

Customization: Search•To change the search display, edit advanced.jsp, dspace.cfg and Messages.properties

advanced.jsp located in:

/home/dspace/apache-tomcat-5.5.28/webapps/jspui/search/

Messages.properties located in:

/home/dspace/dspace-1.6.0-src-release/dspace-api/src/main/resources

/home/dspace/dspace-1.6.0-src-release/dspace-api/target/classes

Page 25: Dspace_customization

25

In advanced.jsp

<option value="govtdocrefno" <%= field1.equals("govtdocrefno") ? "selected=\"selected\"" : "" %>><fmt:message key="jsp.search.advanced.type.govtdocrefno"/></option>

at 3 places

In dspace.cfg

search.index.13 = govtdocrefno:dc.govtdocrefno.*

In Messages.properties

jsp.search.advanced.type.govtdocrefno = Govt Doc. No.

Customization: Search

Page 26: Dspace_customization

26

Customization: Search

Page 27: Dspace_customization

27

Customization: Item Display

To modify the metadata displayed in item screen, modify dspace.cfg and Messages.properties

Remember: After making changes, re-index everything (go to /dspace/bin and execute the command, ./index-init

Page 28: Dspace_customization

28

Customization: Item DisplayIn 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.description.DocRefNo

In Messages.properties, name the field to be displayedmetadata.dc.title = Titlemetadata.dc.title.alternative = Other Titlesmetadata.dc.contributor.* = Authorsmetadata.dc.contributor.author = Authors...metadata.dc.identifier.isbn = ISBNmetadata.dc.govtdocrefno.* = Govt Doc. Ref. No.

Page 29: Dspace_customization

29

Customization: Browse FieldsCustomization: Browse Fields

To modify the browse fields in navigation bar, modify To modify the browse fields in navigation bar, modify dspace.cfgdspace.cfg located located in in /dspace/config/dspace.cfg/dspace/config/dspace.cfg

..In dspace.cfg, uncomment the following lines to specify the metadata In dspace.cfg, uncomment the following lines to specify the metadata

fields are to be browsed in DSpace:- “Browse by Date”, “Browse fields are to be browsed in DSpace:- “Browse by Date”, “Browse Authors”, “Browse Titles” and “Browse Subjects”:-Authors”, “Browse Titles” and “Browse Subjects”:-

#webui.browse.index.1 = dateissued:item:dateissued#webui.browse.index.1 = dateissued:item:dateissued

#webui.browse.index.2 = author:metadata:dc.contributor.*,dc.creator:text#webui.browse.index.2 = author:metadata:dc.contributor.*,dc.creator:text

#webui.browse.index.3 = title:item:title#webui.browse.index.3 = title:item:title

#webui.browse.index.4 = subject:metadata:dc.subject.*:text#webui.browse.index.4 = subject:metadata:dc.subject.*:text

webui.browse.index.5 = DocRefNo:metadata:dc.description.DocRefNo:textwebui.browse.index.5 = DocRefNo:metadata:dc.description.DocRefNo:text

After modification in any of the browse indicies in dspace.cfg, one must After modification in any of the browse indicies in dspace.cfg, one must Re-index for changes to take place.Re-index for changes to take place.

In Messages.Properties In Messages.Properties browse.menu.DocRefNo = Doc Ref No.browse.menu.DocRefNo = Doc Ref No.

Page 30: Dspace_customization

30

Customization: Change Browse LayoutCustomization: Change Browse Layout

InIn dspace.cfg dspace.cfg, one can change the metadata fields which are , one can change the metadata fields which are displayed for each item in browse item listing.displayed for each item in browse item listing.

Make the required changes in the following single line in dspace.cfg Make the required changes in the following single line in dspace.cfg and uncomment it:and uncomment it:

#webui.itemlist.columns = dc.date.issued(date), dc.title, #webui.itemlist.columns = dc.date.issued(date), dc.title, dc.contributor.*dc.contributor.*

Stop and restart Tomcat for changes to take affect.Stop and restart Tomcat for changes to take affect.

Page 31: Dspace_customization

31

Customization: Change Browse LayoutCustomization: Change Browse Layout

Page 32: Dspace_customization

32

Customization: Full text indexingCustomization: Full text indexing

• Configure media filters in dspace.cfg underConfigure media filters in dspace.cfg under#### Media Filter plugins####### Media Filter plugins###Enable or disable specific media filter from the list:-Enable or disable specific media filter from the list:- plugin.sequence.org.dspace.app.mediafilter.Mediafilter = \plugin.sequence.org.dspace.app.mediafilter.Mediafilter = \

org.dspace.app.mediafilter.PDFFilter, \org.dspace.app.mediafilter.PDFFilter, \ org.dspace.app.mediafilter.HTMLFilter, \org.dspace.app.mediafilter.HTMLFilter, \ org.dspace.app.mediafilter.WordFilter, \org.dspace.app.mediafilter.WordFilter, \ org.dspace.app.mediafilter.JPEGFilter org.dspace.app.mediafilter.JPEGFilter

2. Schedule filter-media by cron entry2. Schedule filter-media by cron entry 0 2 * * * /dspace/bin/filter-media0 2 * * * /dspace/bin/filter-media3. Modify 3. Modify

search.maxfieldlength = 10000 search.maxfieldlength = 10000 Set it to -1 for indexing unlimited no. of wordsSet it to -1 for indexing unlimited no. of words

4. Re-index for the changes to take effect4. Re-index for the changes to take effect

Page 33: Dspace_customization

33

Customization: SummaryCustomization: Summary

Restart (Restart the webserver after configuration changes)Restart (Restart the webserver after configuration changes)• Stop TomcatStop Tomcat

[/dspace/[/dspace/apache-tomcat-5.5.25]/bin/shutdown.shbin/shutdown.sh• Start TomcatStart Tomcat

[/dspace/[/dspace/apache-tomcat-5.5.25]/bin/startup.sh]/bin/startup.sh

Re-index DSpaceRe-index DSpace• Log on to the machine running dspace.Log on to the machine running dspace.• Change directory to /dspace/binChange directory to /dspace/bin• Run the re-index commandRun the re-index command

./index-all./index-all• Stop and restart Tomcat.Stop and restart Tomcat.

Page 34: Dspace_customization

34

Customization: SummaryCustomization: Summary

CustomizeCustomize ChangesChanges Action Action

Top/Side Bar NewsTop/Side Bar News Edit News from Edit News from DSpace AdministratorDSpace Administrator

Refresh Refresh

Header /Footer/ Header /Footer/ Nav BarNav Bar

X/layout/*.jspX/layout/*.jsp RefreshRefresh

Overall layoutOverall layout X/styles.css.jspX/styles.css.jsp RefreshRefresh

Page TextPage Text X/WEB-INF/classes/X/WEB-INF/classes/Message.propertiesMessage.properties

Shut down & restart Shut down & restart TomcatTomcat

Add metadataAdd metadata Add/update metadata Add/update metadata from Metadata from Metadata Registry from DSpace Registry from DSpace AdministratorAdministrator

RefreshRefresh

Input FormInput Form /dspace/config/input-/dspace/config/input-form.xmlform.xml

Shut down & restart Shut down & restart TomcatTomcat

Page 35: Dspace_customization

35

Customization: Summary (Contd.)Customization: Summary (Contd.)

CustomizeCustomize ChangesChanges Action Action

Search (Advanced)Search (Advanced) Search index:Search index:/dspace/config/dspace.cfg/dspace/config/dspace.cfgSearch option:Search option:X/search/advanced.jspX/search/advanced.jspOption display:Option display:X/WEB-INF/classes/Message. X/WEB-INF/classes/Message. propertiesproperties

Re-index Re-index

Item displayItem display /dspace/config/dspace.cfg/dspace/config/dspace.cfgX/WEB-INF/classes/Message. X/WEB-INF/classes/Message. propertiesproperties

Re-index Re-index

Browse fieldBrowse field /dspace/config/dspace.cfg/dspace/config/dspace.cfg Re-index Re-index

Browse LayoutBrowse Layout /dspace/config/dspace.cfg/dspace/config/dspace.cfg Shut down & Shut down & restart restart TomcatTomcat

X = X = /dspace/apache-tomcat-5.5.25/webapps/dspace

Page 36: Dspace_customization

36

Thank youThank you

Page 37: Dspace_customization

37

Customization: XHTML

Page 38: Dspace_customization

38

Changes in dspace.cfgChanges in dspace.cfg $vi /dspace/dspace-1.4.2-source/config/dspace.cfg$vi /dspace/dspace-1.4.2-source/config/dspace.cfg                 dspace.url = [like http://192.168.3.203/dspace]dspace.url = [like http://192.168.3.203/dspace]                 dspace.hostname = [hotsname or IP address of dspace.hostname = [hotsname or IP address of

server]server] dspace.name =[ dspace name like name of your dspace.name =[ dspace name like name of your

Institution eg. NISCAIR Digital Library]Institution eg. NISCAIR Digital Library]                 db.password = [the password you entered in the db.password = [the password you entered in the

last step of postgesql installation]last step of postgesql installation]                 mail.server =[hostname or IP address of server ex. mail.server =[hostname or IP address of server ex.

mail.niscair.res.in]mail.niscair.res.in]                 mail.from.address = [email address]mail.from.address = [email address]                 feedback.recipient =[email address]feedback.recipient =[email address]                 mail.admin = [email address of admin]mail.admin = [email address of admin]                 alert.recipient =[email address (not essential but alert.recipient =[email address (not essential but

very useful!)]very useful!)] Save the file Save the file

Page 39: Dspace_customization

Cron jobsCron jobs To perform certain task periodically we may use cron jobs by To perform certain task periodically we may use cron jobs by

typing following command:typing following command:# # crontab -e crontab -e # Send out subscription e-mails at 01:00 every day# Send out subscription e-mails at 01:00 every day

0 1 * * * /dspace/bin/sub-daily0 1 * * * /dspace/bin/sub-daily# Run the media filter at 02:00 every day# Run the media filter at 02:00 every day

0 2 * * * /dspace/bin/filter-media0 2 * * * /dspace/bin/filter-media# Generate full-text index at 2.15 an # Generate full-text index at 2.15 an

15 2 * * * /dspace/bin/index-all15 2 * * * /dspace/bin/index-all# Clean up the database nightly at 2.40am# Clean up the database nightly at 2.40am

40 2 * * * vacuumdb --analyze dspace > /dev/null 2>&1" > 40 2 * * * vacuumdb --analyze dspace > /dev/null 2>&1" > /var/spool/cron/dspace/var/spool/cron/dspace

** ** ** ** **

Minute 0-59Minute 0-59 Hour 0-23 (0 Hour 0-23 (0 = midnight)= midnight)

Day 1-31Day 1-31 Month 1-12Month 1-12 Weekday 0-Weekday 0-6 (0 = 6 (0 = Sunday)Sunday)