Permalink
Browse files

Added UI setting for strictness of content-type checking on media search

  • Loading branch information...
luccioman committed Dec 29, 2017
1 parent cedb53b commit 36a45b39059d25b2f397a6d21ee08c633b9874fc
Showing with 30 additions and 2 deletions.
  1. +13 −0 htroot/ConfigPortal_p.html
  2. +17 −2 htroot/ConfigPortal_p.java
@@ -52,6 +52,19 @@ <h2>Integration of a Search Portal</h2>
<input type="radio" name="search.options" value="false" #(search.options)#checked="checked"::#(/search.options)# />do not show Advanced Search
</dd>
<dt>Media Search</dt>
<dd>
<label>
<input type="radio" name="search.strictContentDom" value="false" #(search.strictContentDom)#checked="checked"::#(/search.strictContentDom)# />Extended
</label>
<label>
<input type="radio" name="search.strictContentDom" value="true" #(search.strictContentDom)#::checked="checked"#(/search.strictContentDom)# />Strict
</label>
<p>Control whether media search results are strictly limited to indexed documents matching exactly the desired content domain (images, videos or applications specific),
or extended to pages including such medias (provide generally more results, but eventually less relevant).
</p>
</dd>
<dt>Remote results resorting</dt>
<dd>
<label title="Remote results resorting can be triggered once the 'Refresh sorting' button (near the 'Search' button) becomes available.">
@@ -94,9 +94,15 @@ public static serverObjects respond(final RequestHeader header, final serverObje
final boolean oldJsResort = sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT);
final boolean newJsResort = post.getBoolean(SwitchboardConstants.SEARCH_JS_RESORT);
/* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
cleanSearchCache = oldJsResort != newJsResort;
cleanSearchCache = cleanSearchCache || oldJsResort != newJsResort;
sb.setConfig(SwitchboardConstants.SEARCH_JS_RESORT, newJsResort);
final boolean oldStrictContentDom = sb.getConfigBool(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT);
final boolean newStrictContentDom = post.getBoolean(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM);
/* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
cleanSearchCache = cleanSearchCache || oldStrictContentDom != newStrictContentDom;
sb.setConfig(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, newStrictContentDom);
sb.setConfig(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
post.getBoolean(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED));
@@ -163,9 +169,15 @@ public static serverObjects respond(final RequestHeader header, final serverObje
final boolean oldJsResort = sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT);
final boolean newJsResort = Boolean.parseBoolean(config.getProperty(SwitchboardConstants.SEARCH_JS_RESORT, String.valueOf(SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT)));
/* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
cleanSearchCache = oldJsResort != newJsResort;
cleanSearchCache = cleanSearchCache || oldJsResort != newJsResort;
sb.setConfig(SwitchboardConstants.SEARCH_JS_RESORT, newJsResort);
final boolean oldStrictContentDom = sb.getConfigBool(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT);
final boolean newStrictContentDom = Boolean.parseBoolean(config.getProperty(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, String.valueOf(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT)));
/* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
cleanSearchCache = cleanSearchCache || oldStrictContentDom != newStrictContentDom;
sb.setConfig(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, newStrictContentDom);
sb.setConfig(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
Boolean.parseBoolean(config.getProperty(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
String.valueOf(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED_DEFAULT))));
@@ -199,6 +211,9 @@ public static serverObjects respond(final RequestHeader header, final serverObje
prop.put(SwitchboardConstants.PUBLIC_SEARCHPAGE, sb.getConfigBool(SwitchboardConstants.PUBLIC_SEARCHPAGE, false) ? 1 : 0);
prop.put("search.options", sb.getConfigBool("search.options", false) ? 1 : 0);
prop.put(SwitchboardConstants.SEARCH_JS_RESORT, sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT) ? 1 : 0);
prop.put(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM,
sb.getConfigBool(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM,
SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT) ? 1 : 0);
prop.put(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
sb.getConfigBool(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,

0 comments on commit 36a45b3

Please sign in to comment.