Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Documenting DS-2885: Making sort option for metadata browse indexes configurable

...

  • "item" indexes which have a format of webui.browse.index.<n> = <index-name> : item : <sort-type> : (asc | desc)
  • "metadata" indexes which have a format of webui.browse.index.<n> = <index-name> : metadata : <comma-separated-list-of-metadata-fields> : (date | text) : (asc | dec) : <sort-type>

 Please notice that the punctuation is paramount in typing this property key in the dspace.cfg file. The following table explains each element:

Element

Definition and Options (if available)

webui.browse.index.<n>

n is the index number. The index numbers must start from 1 and increment continuously by 1 thereafter. Deviation from this will cause an error during install or a configuration update. So anytime you add a new browse index, remember to increase the number. (Commented out index numbers may be used over again).

<index-name>

The name by which the index will be identified. In order for the DSpace UI to display human-friendly description for this index, you'll need to update either your Messages.properties (JSPUI) or messages.xml (XMLUI) with new message keys referencing this <index-name>.

JSPUI Example (Messages.properties):

  • browse.type.metadata.<index-name> = My New Field

XMLUI Example (messages.xml):

  • <message key="xmlui.ArtifactBrowser.Navigation.browse_<index-name>">My New Fields</message>
  • <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.<index-name>">Browsing {0} by My New Field {1}</message>
  • <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.<index-name>">Browsing {0} by My New Field</message>
  • <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.<index-name>.column_heading">My New Field</message>

(metadata|item)

Only two options are available: "metadata" or "item"

  • "metadata" indexes allow you to index all items based on one or more metadata fields. The list of fields should be provided as part of the "metadata" configuration. Only items which have values for these fields will appear in this index (e.g. if you have a "metadata" index for "dc.subject.*", an item will not appear in that browse/search if it doesn't have a "dc.subject.*" value). The browse index will have to parts: first it lists all values of the specified metadata fields. If the user select one of these values the index lists all items in which the specified metadata field is assigned with the selected value.
    • Note: If you set a <sort-type> to be used, this sort type is not used on the values of the metadata fields but on the order of the items when listing all items that have a specific value of the metadata
    • NOTE: "metadata" indexes should all have a "<sort-type>" of either "date" or "text".  This allows the index to appear properly sorted based on whether it refers to a textual field or a date-based field.
  • "item" indexes provide you with a browseable list of ALL items in the site, sorted by a particular metadata field. The field this index is sorted by is referenced by <sort-option-name> (which should refer to a corresponding "webui.itemlist.sort-option.<n>" setting... see Defining Sort Options below for more information)

<schema-prefix>

(Only for "metadata" indexes) The schema used for the field to be index. The default is dc (for Dublin Core).

<element>

(Only for "metadata" indexes) The schema element. In Dublin Core, for example, the author element is referred to as "Contributor". The user should consult the default Dublin Core Metadata Registry table in Appendix A.

<qualifier>

(Only for "metadata" indexes) This is the qualifier to the <element> component. The user has two choices: an asterisk "" or a proper qualifier of the element. The asterisk is a wildcard and causes DSpace to index all types of the schema element. For example, if you have the element "contributor" and the qualifier "" then you would index all contributor data regardless of the qualifier. Another example, you have the element "subject" and the qualifier "lcsh" would cause the indexing of only those fields that have the qualifier "lcsh". (This means you would only index Library of Congress Subject Headings and not all data elements that are subjects.

<sort-type>

(Optional, should be set for "item" indexes) This refers to the sort type / data type of the field:

  • date the index type will be treated as a date object and sorted as such
  • text the index type will be treated as plain text and sorted as such
  • (any other value refers to a custom <sort-type> which should be defined in a corresponding webui.itemlist.sort-option.<n> setting. See Defining Sort Options below for more information.)

<sort-order>

(Optional) The default sort order. Choose asc (ascending) or desc (descending).  Ascending is the default value, but descending may be useful for date-based indexes (e.g. to display most recent submissions first)

...

Sort options/types will be available when browsing a list of items (see also the either on "item" index type above or after selecting a specific value for "metadata" indexes). You can define an arbitrary number of fields to sort on. For example, the default entries that appear in the dspace.cfg as default installation:

...