dspace 4.x XMLUI バージョンを使用しています。「教材の種類」「教育レベル」などの新しいフィルタータイプを追加したいです。ディスカバリー検索フィルター リスト (サイドバー ファセットではありません)。どうすればいいですか?
1 に答える
[dspace-install-dir]/config/spring/api/discovery.xml で、カスタム検索フィルターを追加できます。たとえば、dc.type の検索フィルターを追加する場合は、次を追加する必要があります。
<bean id="searchFilterType" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="type"/>
<property name="metadataFields">
<list>
<value>dc.type</value>
</list>
</property>
<property name="type" value="text"/>
<property name="sortOrder" value="VALUE"/>
</bean>
次に追加します。
<ref bean="searchFilterType" />
既存の searchFilters に、例えば:
<list>
<ref bean="searchFilterTitle" />
<ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterType" />
</list>
これを必ず追加してください
<bean id="homepageConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype">
このエントリがあれば
<entry key="site" value-ref="homepageConfiguration" />
あなたの
<bean id="org.dspace.discovery.configuration.DiscoveryConfigurationService" class="org.dspace.discovery.configuration.DiscoveryConfigurationService">
sidebarFacets と searchFilters を変更した後、[dspace]/bin/dspace index-discovery -b を実行して既存のアイテムのインデックスを再作成することを忘れないでください。そうしないと、変更が反映されません。
詳細については、ドキュメントの検索フィルターとサイドバー ファセットのカスタマイズをお読みください。
アップデート
searchFilters に独自のラベルを適用するには、[dspace-install-dir]/webapps/xmlui/i18n/messages.xml
. 例:
<message key="xmlui.ArtifactBrowser.SimpleSearch.filter.type">Type</message>
次回の再構築時にカスタム メッセージが上書きされないようにするには、src ツリーに保存して管理する必要があることに注意し
[dspace-source]/dspace/modules/xmlui/src/main/webapp/i18n/
てください。