Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
do not remove the index deletion option from the IndexControlURLs_p.html servlet after a deletion happend, instead show but disable the option when the index is empty.
orbitercbb5f06630c2
diff --git a/htroot/IndexControlURLs_p.html b/htroot/IndexControlURLs_p.htmlindex 74dd8d4b2..148c5009a 100644--- a/htroot/IndexControlURLs_p.html+++ b/htroot/IndexControlURLs_p.html@@ -93,17 +93,16 @@ function updatepage(str) {</fieldset></form>- #(cleanup)#::<form action="IndexControlURLs_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">- <fieldset><legend>Cleanup</legend>+ <fieldset#(cleanup)# disabled="disabled"::#(/cleanup)#><legend>Cleanup</legend><dl><dt class="TableCellDark">Index Deletion</dt><dd><input type="checkbox" name="deleteIndex" id="deleteIndex"onclick="x=document.getElementById('deleteIndex').checked;#(rwi)#::document.getElementById('deleteRWI').checked=x;#(/rwi)#document.getElementById('deleteRobots').checked=x;document.getElementById('deleteRobots').checked=x;document.getElementById('deleteCrawlQueues').checked=x;c='disabled';document.getElementById('deleteSearchFl').checked=x;if(x){c='';};document.getElementById('deletecomplete').disabled=c;document.getElementById('deleteCache').disabled=c;document.getElementById('deleteRobots').disabled=c;document.getElementById('deleteCrawlQueues').disabled=c;document.getElementById('deleteSearchFl').disabled=c;"/> Delete local search index (embedded Solr and old Metadata)<br/>- #(solr)#::<input type="checkbox" name="deleteRemoteSolr" id="deleteRemoteSolr" onclick="x=document.getElementById('deleteRemoteSolr').checked;c='disabled';if(x){c='';};document.getElementById('deletecomplete').disabled=c;" /> Delete remote solr index<br/>#(/solr)#- #(rwi)#::<input type="checkbox" name="deleteRWI" id="deleteRWI" onclick="x=document.getElementById('deleteRWI').checked;c='disabled';if(x){c='';};document.getElementById('deletecomplete').disabled=c;" /> Delete RWI Index (DHT transmission words)<br/>#(/rwi)#- #(citation)#::<input type="checkbox" name="deleteCitation" id="deleteCitation" onclick="x=document.getElementById('deleteCitation').checked;c='disabled';if(x){c='';};document.getElementById('deletecomplete').disabled=c;" /> Delete Citation Index (linking between URLs)<br/>#(/citation)#+ #(cleanupsolr)#::<input type="checkbox" name="deleteRemoteSolr" id="deleteRemoteSolr" onclick="x=document.getElementById('deleteRemoteSolr').checked;c='disabled';if(x){c='';};document.getElementById('deletecomplete').disabled=c;" /> Delete remote solr index<br/>#(/cleanupsolr)#+ #(cleanuprwi)#::<input type="checkbox" name="deleteRWI" id="deleteRWI" onclick="x=document.getElementById('deleteRWI').checked;c='disabled';if(x){c='';};document.getElementById('deletecomplete').disabled=c;" /> Delete RWI Index (DHT transmission words)<br/>#(/cleanuprwi)#+ #(cleanupcitation)#::<input type="checkbox" name="deleteCitation" id="deleteCitation" onclick="x=document.getElementById('deleteCitation').checked;c='disabled';if(x){c='';};document.getElementById('deletecomplete').disabled=c;" /> Delete Citation Index (linking between URLs)<br/>#(/cleanupcitation)#<input type="checkbox" name="deleteCache" id="deleteCache" disabled="disabled" /> Delete HTTP & FTP Cache<br/><input type="checkbox" name="deleteCrawlQueues" id="deleteCrawlQueues" disabled="disabled" /> Stop Crawler and delete Crawl Queues<br/><input type="checkbox" name="deleteRobots" id="deleteRobots" disabled="disabled" /> Delete robots.txt Cache<br/>@@ -113,7 +112,6 @@ function updatepage(str) {</dl></fieldset></form>- #(/cleanup)##(statistics)#::<form action="IndexControlURLs_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">diff --git a/htroot/IndexControlURLs_p.java b/htroot/IndexControlURLs_p.javaindex dcae6e585..345d35bed 100644--- a/htroot/IndexControlURLs_p.java+++ b/htroot/IndexControlURLs_p.java@@ -65,7 +65,8 @@ public class IndexControlURLs_p {final serverObjects prop = new serverObjects();Segment segment = sb.index;-+ long ucount = segment.fulltext().collectionSize();+// set default valuesprop.put("urlstring", "");prop.put("urlhash", "");@@ -83,10 +84,10 @@ public class IndexControlURLs_p {List<File> dumpFiles = segment.fulltext().dumpFiles();prop.put("dumprestore_dumpfile", dumpFiles.size() == 0 ? "" : dumpFiles.get(dumpFiles.size() - 1).getAbsolutePath());prop.put("dumprestore_optimizemax", 10);- prop.put("cleanup", post == null || post.size() == 0 ? 1 : 0);- prop.put("cleanup_solr", segment.fulltext().connectedRemoteSolr() ? 1 : 0);- prop.put("cleanup_rwi", segment.termIndex() != null && !segment.termIndex().isEmpty() ? 1 : 0);- prop.put("cleanup_citation", segment.connectedCitation() && !segment.urlCitation().isEmpty() ? 1 : 0);+ prop.put("cleanup", ucount == 0 ? 0 : 1);+ prop.put("cleanupsolr", segment.fulltext().connectedRemoteSolr() ? 1 : 0);+ prop.put("cleanuprwi", segment.termIndex() != null && !segment.termIndex().isEmpty() ? 1 : 0);+ prop.put("cleanupcitation", segment.connectedCitation() && !segment.urlCitation().isEmpty() ? 1 : 0);// show export messagesfinal Fulltext.Export export = segment.fulltext().export();@@ -121,7 +122,7 @@ public class IndexControlURLs_p {}if (post == null || env == null) {- prop.putNum("ucount", segment.fulltext().collectionSize());+ prop.putNum("ucount", ucount);return prop; // nothing to do}@@ -337,7 +338,7 @@ public class IndexControlURLs_p {}// insert constants- prop.putNum("ucount", segment.fulltext().collectionSize());+ prop.putNum("ucount", ucount);// return rewrite propertiesreturn prop;}