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.

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.browse_[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

8 Comments

  1. How do I add curly brackets around numbers to the text without making the wiki freak out?  The lines for the browse headings should read "<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.[name]">Browsing

    Unknown macro: {0}

    by [Browse Field]

    Unknown macro: {1}

    </message>" and "<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.[name]">Browsing

    by [Browse Field] </message>"

    But if I don't change the curl brackets my formatting goes crazy and some of the text disappears.

    1. Just like it did in the comment

      1. Hi Catalina - You need to let Confluence know that what you are writing is not a macro -- as the fancy brackets are used for all macro commands. You should use this syntax in the "Wiki Markup" tab when you are in edit mode:

        {code:none}
        
        {type you want in fancy brackets here}
        

        I figure out how to show you the closing syntax -- because Confluence interprets the macro -- but at the end of your content you will want to close the command -- fancy bracket opencodefancy bracket close. I'll email you the syntax so it will be clear. 

  2. When I re-index,  existing items can not be searched or browsed. I got only one item which was updated to test this index. I need to update last_modified data for all items then re-index in order to be indexed.

    UPDATE public.item SET last_modified = current_timestamp;

    1. Hi Yusuf - This part of the wiki is a resource guide and is not intended to be a q&a forum. As you may know, the DSpace user community supports the software and the best place to ask for help is on the community mailing lists: http://dspace.org/Mailing-Lists.  

      1. I am not able to delete it.

        Actually I did not aim to ask for help. I just want to share a workaround to a problem related with this topic. Beside this All links within the page you suggested are broken.

  3. Hi Valorie,

    I work on the XMLUI of DSpace 4.2 and I followed the steps you described, but obviously it has no effect.

    I added the following line to "dspace.cfg"

    webui.browse.index.5 = identifier:metadata:dc.identifier.*:text

     

    and the following 4 lines to "messages.xml"

     

    <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.identifier.column_heading">Identifier</message>

     

    <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.identifier">Browsing {0} by Identifier {1}</message>

     

    <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.identifier">Browsing {0} by Identifier</message>

     

    <message key="xmlui.ArtifactBrowser.Navigation.browse_identifier">Identifier</message>

     

    Then I have reeindexed DSpace with

    dspace index-discovery

    and restarted it . But nothing happened.

     

    I'm grateful for your help !

     

     

     

  4. Hi Yakup - This part of the wiki is a resource guide and is not intended to be a q&a forum. As you may know, the DSpace user community supports the software and the best place to ask for help is on the community mailing lists: http://dspace.org/Mailing-Lists. Best of luck!