在上文中," DDC主题" 下的项目显示' ::' ,如 - > " DEWEY DECIMAL CLASSIFICATION :: GENERALITIES :: Bibliography(1)" ,我想将其显示为 - > "参考书目(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>
&#13;
但是现在它在重启Tomcat之后也没有反映任何东西。
答案 0 :(得分: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
。
另一个选择是在您的discovery.xml中添加<property name="skipFirstNodeLevel" value="true"/>
例:
<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
。希望这有帮助。