Use list template for all other option lists. Fixed some template expressions.

pull/1/head
bhoerdzn 11 years ago
parent 8e74098cd4
commit 405878182f

@ -25,8 +25,8 @@
}
// Load Filters
if (cId !== "deleteoldon" && cId !== "deleteoldoff" &&
cId !== "deleteoldage") {
if (cId === "rangeDomain" || cId === "rangeSubpath" ||
cId === "rangeWide") {
if ($('#rangeDomain').prop("checked") ||
$('#rangeSubpath').prop("checked")) {
// restrict to sub-path / domain
@ -110,7 +110,7 @@
(function($) {
$.fn.check = function() {
return this.each(function() {
$(this).attr("checked", "checked");
$(this).attr("checked", "checked").prop("checked", true);
});
};
})(jQuery);
@ -118,7 +118,7 @@
(function($) {
$.fn.uncheck = function() {
return this.each(function() {
$(this).removeAttr("checked");
$(this).removeAttr("checked").prop("checked", false);
});
};
})(jQuery);
@ -316,28 +316,15 @@
<dt>Delete only old</dt>
<dd><input type="radio" name="deleteold" id="deleteoldage" value="age" #(deleteold_age)#::checked="checked"#(/deleteold_age)#/>Treat documents that are loaded
<select name="deleteIfOlderNumber" id="deleteIfOlderNumber">
<option value="1" #(deleteIfOlderNumber_1)#::selected="selected"#(/deleteIfOlderNumber_1)#>1</option>
<option value="2" #(deleteIfOlderNumber_2)#::selected="selected"#(/deleteIfOlderNumber_2)#>2</option>
<option value="3" #(deleteIfOlderNumber_3)#::selected="selected"#(/deleteIfOlderNumber_3)#>3</option>
<option value="4" #(deleteIfOlderNumber_4)#::selected="selected"#(/deleteIfOlderNumber_4)#>4</option>
<option value="5" #(deleteIfOlderNumber_5)#::selected="selected"#(/deleteIfOlderNumber_5)#>5</option>
<option value="6" #(deleteIfOlderNumber_6)#::selected="selected"#(/deleteIfOlderNumber_6)#>6</option>
<option value="7" #(deleteIfOlderNumber_7)#::selected="selected"#(/deleteIfOlderNumber_7)#>7</option>
<option value="8" #(deleteIfOlderNumber_8)#::selected="selected"#(/deleteIfOlderNumber_8)#>8</option>
<option value="9" #(deleteIfOlderNumber_9)#::selected="selected"#(/deleteIfOlderNumber_9)#>9</option>
<option value="10" #(deleteIfOlderNumber_10)#::selected="selected"#(/deleteIfOlderNumber_10)#>10</option>
<option value="12" #(deleteIfOlderNumber_12)#::selected="selected"#(/deleteIfOlderNumber_12)#>12</option>
<option value="14" #(deleteIfOlderNumber_14)#::selected="selected"#(/deleteIfOlderNumber_14)#>14</option>
<option value="21" #(deleteIfOlderNumber_21)#::selected="selected"#(/deleteIfOlderNumber_21)#>21</option>
<option value="28" #(deleteIfOlderNumber_28)#::selected="selected"#(/deleteIfOlderNumber_28)#>28</option>
<option value="30" #(deleteIfOlderNumber_30)#::selected="selected"#(/deleteIfOlderNumber_30)#>30</option>
</select>
<select name="deleteIfOlderUnit" id="deleteIfOlderUnit">
<option value="year" #(deleteIfOlderUnit_year)#::selected="selected"#(/deleteIfOlderUnit_year)#>years</option>
<option value="month" #(deleteIfOlderUnit_month)#::selected="selected"#(/deleteIfOlderUnit_month)#>months</option>
<option value="day" #(deleteIfOlderUnit_day)#::selected="selected"#(/deleteIfOlderUnit_day)#>days</option>
<option value="hour" #(deleteIfOlderUnit_hour)#::selected="selected"#(/deleteIfOlderUnit_hour)#>hours</option>
</select> ago as stale and delete them before the crawl is started.
#(deleteIfOlderSelect)#::
#{list}#<option value="#[name]#" #(default)#::selected="selected"#(/default)#>#[name]#</option>#{/list}#
#(/deleteIfOlderSelect)#
</select>
<select name="deleteIfOlderUnit" id="deleteIfOlderUnit">
#(deleteIfOlderUnitSelect)#::
#{list}#<option value="#[value]#" #(default)#::selected="selected"#(/default)#>#[name]#</option>#{/list}#
#(/deleteIfOlderUnitSelect)#
</select> ago as stale and delete them before the crawl is started.
</dd>
</dl>
</fieldset>
@ -349,20 +336,19 @@
A web crawl performs a double-check on all links found in the internet against the internal database. If the same url is found again,
then the url is treated as double when you check the 'no doubles' option. A url may be loaded again when it has reached a specific age,
to use that check the 're-load' option.
</span></span><input type="radio" name="recrawl" id="reloadoldoff" value="nodoubles" #(recrawl_nodoubles)#checked="checked"#(/recrawl_nodoubles)#/>Never load any page that is already known. Only the start-url may be loaded again.</dd>
</span></span><input type="radio" name="recrawl" id="reloadoldoff" value="nodoubles" #(recrawl_nodoubles)#::checked="checked"#(/recrawl_nodoubles)#/>Never load any page that is already known. Only the start-url may be loaded again.</dd>
<dt>Re-load</dt>
<dd><input type="radio" name="recrawl" id="reloadoldage" value="reload" #(recrawl_reload)#checked="checked"#(/recrawl_reload)#/>Treat documents that are loaded
<dd><input type="radio" name="recrawl" id="reloadoldage" value="reload" #(recrawl_reload)#::checked="checked"#(/recrawl_reload)#/>Treat documents that are loaded
<select name="reloadIfOlderNumber" id="reloadIfOlderNumber">
#(reloadIfOlderSelect)#::
#{list}#<option value="#[name]#" #[default]#>#[name]#</option>#{/list}#
#{list}#<option value="#[name]#" #(default)#::selected="selected"#(/default)#>#[name]#</option>#{/list}#
#(/reloadIfOlderSelect)#
</select>
<select name="reloadIfOlderUnit" id="reloadIfOlderUnit">
<option value="year" #(reloadIfOlderUnit_year)#::selected="selected"#(/reloadIfOlderUnit_year)#>years</option>
<option value="month" #(reloadIfOlderUnit_month)#::selected="selected"#(/reloadIfOlderUnit_month)#>months</option>
<option value="day" #(reloadIfOlderUnit_day)#::selected="selected"#(/reloadIfOlderUnit_day)#>days</option>
<option value="hour" #(reloadIfOlderUnit_hour)#::selected="selected"#(/reloadIfOlderUnit_hour)#>hours</option>
</select> ago as stale and load them again. If they are younger, they are ignored.
<select name="reloadIfOlderUnit" id="reloadIfOlderUnit">
#(reloadIfOlderUnitSelect)#::
#{list}#<option value="#[value]#" #(default)#::selected="selected"#(/default)#>#[name]#</option>#{/list}#
#(/reloadIfOlderUnitSelect)#
</select> ago as stale and load them again. If they are younger, they are ignored.
</dd>
</dl>
</fieldset>
@ -380,20 +366,7 @@
<dd>
<span class="info" style="float:right"><img src="/env/grafics/i16.gif" width="16" height="16" alt="info"/><span style="right:0px;">
The caching policy states when to use the cache during crawling:
<b>no&nbsp;cache</b>: never use the cache, all content from
</dl>
</fieldset>
<fieldset>
<legend><label>Document Cache</label></legend>
<dl><dt><label for="storeHTCache">Store to Web Cache</label></dt>
<dd>
<span class="info" style="float:right"><img src="/env/grafics/i16.gif" width="16" height="16" alt="info"/><span style="right:0px;">
This option is used by default for proxy prefetch, but is not needed for explicit crawling.
</span></span>
<input type="checkbox" name="storeHTCache" id="storeHTCache" #(storeHTCacheChecked)#::checked="checked"#(/storeHTCacheChecked)# />
</dd>
<dt><label for="mustmatch">Policy for usage of Web Cache</labfresh internet source;
<b>no&nbsp;cache</b>: never use the cache, all content from fresh internet source;
<b>if&nbsp;fresh</b>: use the cache if the cache exists and is fresh using the proxy-fresh rules;
<b>if&nbsp;exist</b>: use the cache if the cache exist. Do no check freshness. Otherwise use online source;
<b>cache&nbsp;only</b>: never go online, use all content from cache. If no cache exist, treat content as unavailable

@ -295,37 +295,66 @@ public class CrawlStartExpert_p {
// ---------- Clean-Up before Crawl Start
// delete if older settings: number value
prop.put("deleteIfOlderSelect", "1");
for (int i=0; i<13; i++) {
prop.put("deleteIfOlderSelect_list_"+i+"_name", Integer.toString(i));
}
prop.put("deleteIfOlderSelect_list_13_name", "14");
prop.put("deleteIfOlderSelect_list_14_name", "21");
prop.put("deleteIfOlderSelect_list_15_name", "28");
prop.put("deleteIfOlderSelect_list_16_name", "30");
prop.put("deleteIfOlderSelect_list", 17);
if (post != null && post.containsKey("deleteIfOlderNumber")) {
final Integer olderNumber = post.getInt("deleteIfOlderNumber", -1);
if (olderNumber >0 && olderNumber <=12) {
prop.put("deleteIfOlderNumber_" + olderNumber, "1");
if (olderNumber >0 && olderNumber <= 12) {
prop.put("deleteIfOlderSelect_list_" + olderNumber +
"_default", "1");
} else {
switch (olderNumber) {
case 14: prop.put("deleteIfOlderNumber_14", "1"); break;
case 21: prop.put("deleteIfOlderNumber_21", "1"); break;
case 28: prop.put("deleteIfOlderNumber_28", "1"); break;
case 30: prop.put("deleteIfOlderNumber_30", "1"); break;
default: prop.put("deleteIfOlderNumber_14", "1"); break;
case 21:
prop.put("deleteIfOlderSelect_list_14_default", "1");
break;
case 28:
prop.put("deleteIfOlderSelect_list_15_default", "1");
break;
case 30:
prop.put("deleteIfOlderSelect_list_16_default", "1");
break;
default:
prop.put("deleteIfOlderSelect_list_13_default", "1");
break;
}
}
} else {
prop.put("deleteIfOlderNumber_14", "1");
prop.put("deleteIfOlderSelect_list_13_default", "1");
}
// delete if older settings: number unit
prop.put("deleteIfOlderUnitSelect", "1");
prop.put("deleteIfOlderUnitSelect_list_0_name", "years");
prop.put("deleteIfOlderUnitSelect_list_0_value", "year");
prop.put("deleteIfOlderUnitSelect_list_1_name", "months");
prop.put("deleteIfOlderUnitSelect_list_1_value", "month");
prop.put("deleteIfOlderUnitSelect_list_2_name", "days");
prop.put("deleteIfOlderUnitSelect_list_2_value", "day");
prop.put("deleteIfOlderUnitSelect_list_3_name", "hours");
prop.put("deleteIfOlderUnitSelect_list_3_value", "hour");
prop.put("deleteIfOlderUnitSelect_list", 4);
if (post != null && post.containsKey("deleteIfOlderUnit")) {
final String olderUnit = post.get("deleteIfOlderUnit", "");
if (olderUnit.equalsIgnoreCase("year")) {
prop.put("deleteIfOlderUnit_year", "1");
prop.put("deleteIfOlderUnitSelect_list_0_default", "1");
} else if (olderUnit.equalsIgnoreCase("month")) {
prop.put("deleteIfOlderUnit_month", "1");
prop.put("deleteIfOlderUnitSelect_list_1_default", "1");
} else if (olderUnit.equalsIgnoreCase("hour")) {
prop.put("deleteIfOlderUnit_hour", "1");
prop.put("deleteIfOlderUnitSelect_list_3_default", "1");
} else {
prop.put("deleteIfOlderUnit_day", "1");
prop.put("deleteIfOlderUnitSelect_list_2_default", "1");
}
} else {
prop.put("deleteIfOlderUnit_day", "1");
prop.put("deleteIfOlderUnitSelect_list_2_default", "1");
}
// delete any document before the crawl is started?
@ -353,40 +382,58 @@ public class CrawlStartExpert_p {
prop.put("reloadIfOlderSelect_list_14_name", "21");
prop.put("reloadIfOlderSelect_list_15_name", "28");
prop.put("reloadIfOlderSelect_list_16_name", "30");
prop.put("reloadIfOlderSelect_list", 16);
prop.put("reloadIfOlderSelect_list", 17);
if (post != null && post.containsKey("reloadIfOlderNumber")) {
Integer olderNumber = post.getInt("reloadIfOlderNumber", -1);
if (olderNumber <=0 || olderNumber >12) {
final Integer olderNumber = post.getInt("reloadIfOlderNumber", -1);
if (olderNumber >0 && olderNumber <= 12) {
prop.put("reloadIfOlderSelect_list_" + olderNumber +
"_default", "1");
} else {
switch (olderNumber) {
case 14:
case 21:
case 28:
case 30: break;
default: olderNumber = 14; break;
case 21:
prop.put("reloadIfOlderSelect_list_14_default", "1");
break;
case 28:
prop.put("reloadIfOlderSelect_list_15_default", "1");
break;
case 30:
prop.put("reloadIfOlderSelect_list_16_default", "1");
break;
default:
prop.put("reloadIfOlderSelect_list_13_default", "1");
break;
}
}
prop.put("reloadIfOlderSelect_list_"+olderNumber+"_default",
"selected=\"selected\"");
} else {
prop.put("reloadIfOlderSelect_list_14_default",
"selected=\"selected\"");
prop.put("reloadIfOlderSelect_list_13_default", "1");
}
// reload settings: number unit
prop.put("reloadIfOlderUnitSelect", "1");
prop.put("reloadIfOlderUnitSelect_list_0_name", "years");
prop.put("reloadIfOlderUnitSelect_list_0_value", "year");
prop.put("reloadIfOlderUnitSelect_list_1_name", "months");
prop.put("reloadIfOlderUnitSelect_list_1_value", "month");
prop.put("reloadIfOlderUnitSelect_list_2_name", "days");
prop.put("reloadIfOlderUnitSelect_list_2_value", "day");
prop.put("reloadIfOlderUnitSelect_list_3_name", "hours");
prop.put("reloadIfOlderUnitSelect_list_3_value", "hour");
prop.put("reloadIfOlderUnitSelect_list", 4);
if (post != null && post.containsKey("reloadIfOlderUnit")) {
final String olderUnit = post.get("reloadIfOlderUnit", "");
if (olderUnit.equalsIgnoreCase("year")) {
prop.put("reloadIfOlderUnit_year", "1");
prop.put("reloadIfOlderUnitSelect_list_0_default", "1");
} else if (olderUnit.equalsIgnoreCase("month")) {
prop.put("reloadIfOlderUnit_month", "1");
prop.put("reloadIfOlderUnitSelect_list_1_default", "1");
} else if (olderUnit.equalsIgnoreCase("hour")) {
prop.put("reloadIfOlderUnit_hour", "1");
prop.put("reloadIfOlderUnitSelect_list_3_default", "1");
} else {
prop.put("reloadIfOlderUnit_day", "1");
prop.put("reloadIfOlderUnitSelect_list_2_default", "1");
}
} else {
prop.put("reloadIfOlderUnit_day", "1");
prop.put("reloadIfOlderUnitSelect_list_2_default", "1");
}
if (post != null && post.containsKey("recrawl")) {

Loading…
Cancel
Save