...
The indexes proposed for the advanced search are instead derived by the discovery configuration associated with the entity type alias (publications, researcherprofiles, etc.)
...
Defining a list layout
The Global search and the previous defined processor (TopObjects, etc.) used in the section explore and in the home page refer to a "viewConfiguration" that is usually defined in the config/spring/api/global-list-layout.xml file
The file contains one or more bean definitions for the class org.dspace.discovery.configuration.DiscoveryViewConfiguration
Code Block | ||
---|---|---|
| ||
<bean id="dspaceitemsLayoutView"
class="org.dspace.discovery.configuration.DiscoveryViewConfiguration">
<property name="metadataHeadingFields">
<list>
<bean
class="org.dspace.discovery.configuration.DiscoveryViewFieldConfiguration">
<property name="mandatory" value="true" />
<property name="preHtml" value="<b>" />
<property name="postHtml" value="</b>" />
<property name="field" value="dc.title" />
<property name="decorator" value="title" />
</bean>
<bean
class="org.dspace.discovery.configuration.DiscoveryViewFieldConfiguration">
<property name="mandatory" value="true" />
<property name="preHtml" value="<span class='text-muted'>" />
<property name="postHtml" value="</span><br/>" />
<property name="field" value="dc.contributor.author" />
<property name="decorator" value="itemcrisref" />
</bean>
<bean
class="org.dspace.discovery.configuration.DiscoveryViewFieldConfiguration">
<property name="mandatory" value="true" />
<property name="postHtml" value="<br/>" />
<property name="field" value="dc.identifier.citation" />
</bean>
<bean
class="org.dspace.discovery.configuration.DiscoveryViewFieldConfiguration">
<property name="mandatory" value="true" />
<property name="preHtml" value="<small>" />
<property name="postHtml" value="</small>" />
<property name="field" value="dc.type" />
</bean>
</list>
</property>
<property name="metadataDescriptionFields">
<list>
<bean
class="org.dspace.discovery.configuration.DiscoveryViewFieldConfiguration">
<property name="field" value="dc.subject" />
<property name="postHtml" value="<br />" />
</bean>
<bean
class="org.dspace.discovery.configuration.DiscoveryViewFieldConfiguration">
<property name="field" value="dc.description.abstract" />
<property name="postHtml" value="<br />" />
</bean>
</list>
</property>
</bean> |
The bean has two properties
- metadataHeadingFields: defines which metadata are included as heading of each result
- metadataDescriptionFields: defines which metadata are listed in a key - value layout under each result
both properties accept a list of DiscoveryViewFieldConfiguration beans with the following properties
- mandatory: default false, if true the information will be always displayed. Otherwise it is only displayed if the field match the user query, in such case a snippet of the content is presented
- preHtml and postHtml: any additional html code to include before and after the value. Please note that empty values will be always skipped
- field: the metadata to use
- decorator: an optional reference to a org.dspace.app.webui.util.IDisplayMetadataValueStrategy plugin defined in the dspace.cfg (the plugin name must be used, i.e. itemcrisref, doi, etc.)