0

dspace 4.x XMLUI 的侧边栏

在上面,“DDC 主题”下的项目显示为'::' like -> "DEWEY DECIMAL CLASSIFICATION::GENERALITIES::Bibliography (1)",我想显示为 -> "Bibliography (1)"。为此,我在文件[dspace-install]/webapps/xmlui/static/js/discovery/search-control.js ->中编写了以下脚本

function cutText(){
	
	  var headvalue =  $('div#aspect_discovery_Navigation_list_discovery ul li h2').innerHTML;

	  if(headvalue.match('DDC Subject')){
		var displaytext = $('#aspect_discovery_Navigation_list_discovery ul li ul li a').innerHTML;
		var y = displaytext.split("::");
		if(y.len>1)
			var display = y[y.len-1];

		alert(display);
		$('#aspect_discovery_Navigation_list_discovery ul li ul li a').innerHTML = display;

	}
     }

但它不起作用。任何人都可以帮忙吗?

接受@euler建议现在我已经完成了以下操作-> 我已经使用以下内容修改了 dspace.cfg文件->

choices.plugin.dc.subject.ddc = ddcE
choices.presentation.dc.subject.ddc = lookup
vocabulary.plugin.ddcE.hierarchy.store = false
vocabulary.plugin.ddcE.hierarchy.suggest = false
vocabulary.plugin.ddcE.delimiter = "::"

并且“ ddcE ”在我的input-forms.xml文件中定义,例如 ->

    <field>
         <dc-schema>dc</dc-schema>
         <dc-element>subject</dc-element>
         <dc-qualifier>ddc</dc-qualifier>
         <!-- An input-type of twobox MUST be marked as repeatable -->
         <repeatable>true</repeatable>
         <label>Subject (From DDC)</label>
         <input-type>twobox</input-type>
         <hint>Enter appropriate subject Division/Sub-division from DDC 23rd Edition(upto 3rd Summary)</hint>
         <required>You must enter at least one Division/Sub-division from DDC 23rd Edition(upto 3rd Summary)</required>
         <vocabulary>ddcE</vocabulary>
    </field>

但现在它在重新启动 Tomcat 后也没有反映任何内容。

4

1 回答 1

0

首先,您应该尝试编辑您的dspace.cfg,查找行vocabulary.plugin._plugin_.hierarchy.store_plugin_是您启用的DSpaceControlledVocabulary的名称,例如 srsc)。默认值为 true,取消注释并将值更改为 false。

编辑

例如,如果您使用默认的 srsc 控制词汇表:

## demo: subject code autocomplete, using srsc as authority
## (DSpaceControlledVocabulary plugin must be enabled)
## Warning: when enabling this feature any controlled vocabulary configuration in the input-forms.xml for the metadata field will be overridden.
choices.plugin.dc.subject = srsc
choices.presentation.dc.subject = lookup
vocabulary.plugin.srsc.hierarchy.store = false
vocabulary.plugin.srsc.hierarchy.suggest = false
vocabulary.plugin.srsc.delimiter = "::"

更新

添加authority.controlled.dc.subject = true到上面的配置中。所以在你的情况下,你应该添加authority.controlled.dc.subject.ddc = true.


另一种选择是添加<property name="skipFirstNodeLevel" value="true"/>您的 discovery.xml

前任。:

<bean id="searchFilterSubject" class="org.dspace.discovery.configuration.HierarchicalSidebarFacetConfiguration">
<property name="indexFieldName" value="subject"/>
<property name="metadataFields">
    <list>
        <value>dc.subject</value>
    </list>
</property>
<property name="sortOrder" value="COUNT"/>
<property name="splitter" value="::"/>
<property name="skipFirstNodeLevel" value="true"/>

我从来没有尝试过后一种选择,所以请尝试修改你的dspace.cfg第一个选项。希望这有帮助。

于 2015-03-03T01:37:55.403 回答