fix #42
This commit is contained in:
parent
38ba1e58b5
commit
54689d0cf0
3 changed files with 26 additions and 4 deletions
|
@ -49,6 +49,16 @@ public class FessFunctions {
|
|||
// nothing
|
||||
}
|
||||
|
||||
public static Boolean labelExists(final String value) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Map<String, String> labelValueMap = (Map<String, String>) RequestUtil
|
||||
.getRequest().getAttribute(Constants.LABEL_VALUE_MAP);
|
||||
if (labelValueMap != null) {
|
||||
return labelValueMap.get(value) != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String label(final String value) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Map<String, String> labelValueMap = (Map<String, String>) RequestUtil
|
||||
|
|
|
@ -11,6 +11,18 @@
|
|||
<short-name>fe</short-name>
|
||||
<uri>http://fess.codelibs.org/functions</uri>
|
||||
|
||||
<function>
|
||||
<description>
|
||||
Returns a label name.
|
||||
</description>
|
||||
<name>labelexists</name>
|
||||
<function-class>jp.sf.fess.taglib.FessFunctions</function-class>
|
||||
<function-signature>java.lang.Boolean labelExists(java.lang.String)</function-signature>
|
||||
<example>
|
||||
${fe:labelexists("value")}
|
||||
</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>
|
||||
Returns a label name.
|
||||
|
@ -22,7 +34,7 @@
|
|||
${fe:label("value")}
|
||||
</example>
|
||||
</function>
|
||||
|
||||
|
||||
<function>
|
||||
<description>
|
||||
Returns a list of hot search words.
|
||||
|
@ -34,7 +46,7 @@
|
|||
${fe:hsw("week", 5)}
|
||||
</example>
|
||||
</function>
|
||||
|
||||
|
||||
<function>
|
||||
<description>
|
||||
Returns a size of hot search words.
|
||||
|
|
|
@ -81,10 +81,10 @@
|
|||
<div class="well span3">
|
||||
<ul class="nav nav-list">
|
||||
<c:forEach var="fieldData" items="${facetResponse.fieldList}">
|
||||
<c:if test="${fieldData.name == 'label'}">
|
||||
<c:if test="${fieldData.name == 'label' && fieldData.valueCountMap.size() > 0}">
|
||||
<li class="nav-header"><bean:message key="label.facet_label_title" /></li>
|
||||
<c:forEach var="countEntry" items="${fieldData.valueCountMap}">
|
||||
<c:if test="${countEntry.value != 0}">
|
||||
<c:if test="${countEntry.value != 0 && fe:labelexists(countEntry.key)}">
|
||||
<li><s:link
|
||||
href="search?query=${f:u(query)}&additional=label:${f:u(countEntry.key)}${pagingQuery}${fe:facetQuery()}${fe:mltQuery()}${fe:geoQuery()}">
|
||||
${f:h(fe:label(countEntry.key))} (${f:h(countEntry.value)})</s:link></li>
|
||||
|
|
Loading…
Add table
Reference in a new issue