Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add details about the list layouts

Table of Contents

Custom JSPs

To customize the presentation of the data of a CRIS entity other than rearranging the order of the data inside a box and deciding positioning, see “Group Metadata, aka boxes”, the system allow you to define your custom JSPs used instead of the out-of-box layout.

...

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
languagexml
<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.)