The KnowledgeBase is under development and has been made viewable to the user communities to allow for content contributions and feedback. Please post your content in the appropriate section and/or feedback in the comments section located at the bottom of each page.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Current »

Change the fields listed in your DSpace Browse By options

In this section you will learn you to add or remove options listed in the Browse By menu. You will need to edit the files dspace.cfg and message.xml then reindex and restart DSpace

 

Add/Remove Browse fields in dspace.cfg

Open dspace.cfg and find the heading "###### Browse Configuration ######"  Scrolling down you will see uncommented lines that read " webui.browse.index…" this is where you will edit and add lines. 

The browse functions are written as "webui.browse.index.# = [name]:metadata:[schema].[element].[qualifier]:[field type]"

  • The name is what you want to call the browse field you are creating
  • After the name some fields have the word "item" these fields special and do not conform to the same syntax as others, for the field you are adding use "metadata" after the name.
  • Set the schema, element and qualifier to the field you want to browse by.  Qualifiers can be replaced with "" and all occurrences of that element will be listed regardless of qualifiers, for example "dc.subject." lists both dc.subject and dc.subject.lcsh.
  • For field type select "text" for most fields.  The other options are "date" for date fields and "title" for fields that have unique entries only allowing the browse items to link to a single item.
  • The order these items are listed in is the order they will appear in the browse navigation pane.

Remove any browse fields you do not want and add lines for additional browse fields.  In this example I I have added the field dc.subject.classification with the name "department" and field type text as well as date created with the name "datecreated" and the field type date.

Add Headings to message.xml

Open message.xml and find the heading <!- org.dspace.app.xmlui.artifactbrowser.ConfigureableBrowse.java ->.  You need to add four lines for each new browse category in this section. If you look through the section you will see the same lines for the preexisting browse categories scattered through the text.

First add "<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.[name].column_heading">[Browse Name]</message>" Where [name] is the name you assigned in dspace.cfg and [Browse Name] is the title you want to appear in browse menu in DSpace.  These fields are the text displayed at the top of a browse list.

Then add the lines

<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.[name]">Browsing {0} by [Browse Field] {1}</message>
<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.[name]">Browsing {0} by [Browse Field] </message>

Where [name] is the name you assigned in dspace.cfg and [Browse Field] is the field you are browsing by.  These fields create the different browse page headings.


You will also need to add a line to artifactbrowser.Navigation.java section.  Find the heading <!- org.dspace.app.xmlui.artifactbrowser.Navigation.java -> and you will see fields for the existing browse options.

Add the line

<message key="xmlui.ArtifactBrowser.Navigation.browser_[name]"></message>

Where [name] is the name you assigned in dspace.cfg and [Browse Field] is the field you are browsing by. These lines are the text displayed in the browse navigation bar.

Re-index and Restart DSpace

Before existing items can be searched or browsed you need to re-index you instance. 

Navigate to cd [dspace]/bin then type"./dspace index-init".  After have finished indexing restart DSpace.

This section was contributed by Catalina Oyler from the Five Colleges of Ohio

  • No labels