Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Improved blacklist XML/JSON API.
Marc Nause4723329e2915
diff --git a/htroot/api/blacklists/get_list_p.java b/htroot/api/blacklists/get_list_p.javaindex e8b498c17..3cfcb6fa8 100644--- a/htroot/api/blacklists/get_list_p.java+++ b/htroot/api/blacklists/get_list_p.java@@ -30,8 +30,6 @@ public class get_list_p {private static final String BLACK_LISTS_SHARED = "BlackLists.Shared";private static final int lastTypeIndex = BLACKLIST_TYPE_VALUES.length - 1;- private static final String EMPTY_STRING = "";- private static final String COMMA_STRING = ",";public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, @SuppressWarnings("unused") final serverSwitch env) {@@ -55,11 +53,7 @@ public class get_list_p {prop.put(PREFIX_TYPES + j + POSTFIX_VALUE,ListManager.listSetContains(type + TYPES_EXT, element));- if (j < lastTypeIndex) {- prop.put(PREFIX_TYPES + j + POSTFIX_COMMA, COMMA_STRING);- } else {- prop.put(PREFIX_TYPES + j + POSTFIX_COMMA, EMPTY_STRING);- }+ prop.put(PREFIX_TYPES + j + POSTFIX_COMMA, j < lastTypeIndex);j++;}@@ -77,11 +71,7 @@ public class get_list_p {prop.putXML(PREFIX_ITEMS + count + POSTFIX_ITEM, entry);- if (count < lastItemCount) {- prop.put(PREFIX_ITEMS + count + POSTFIX_COMMA, COMMA_STRING);- } else {- prop.put(PREFIX_ITEMS + count + POSTFIX_COMMA, EMPTY_STRING);- }+ prop.put(PREFIX_ITEMS + count + POSTFIX_COMMA, count < lastItemCount);count++;}diff --git a/htroot/api/blacklists/get_list_p.json b/htroot/api/blacklists/get_list_p.jsonindex 63bfcebab..8b4109266 100644--- a/htroot/api/blacklists/get_list_p.json+++ b/htroot/api/blacklists/get_list_p.json@@ -1,9 +1,13 @@{- "name": "#[name]#",- "shared": "#[shared]#",- "types": [#{types}#{"#[name]#": "#[value]#"}#[comma]# #{/types}#]+ "name":"#[name]#",+ "shared":#(shared)#false::true#(/shared)#,+ "types": {+ #{types}#+ "#[name]#":#(value)#false::true#(/value)##(comma)#::,#(/comma)#+ #{/types}#+ },"items":[- #{items}#"#[item]#"#[comma]#+ #{items}#"#[item]#"#(comma)#::,#(/comma)##{/items}#]}\ No newline at end of filediff --git a/htroot/api/blacklists/get_list_p.xml b/htroot/api/blacklists/get_list_p.xmlindex 716b68aa3..2bbe52fd1 100644--- a/htroot/api/blacklists/get_list_p.xml+++ b/htroot/api/blacklists/get_list_p.xml@@ -1,6 +1,6 @@<?xml version="1.0"?>-<list name="#[name]#" shared="#[shared]#" #{types}#- #[name]#="#[value]#"#{/types}#>+<list name="#[name]#" shared="#(shared)#false::true#(/shared)#" #{types}#+ #[name]#="#(value)#false::true#(/value)#"#{/types}#><items>#{items}#<item>#[item]#</item>diff --git a/htroot/api/blacklists/get_metadata_p.java b/htroot/api/blacklists/get_metadata_p.javaindex fcc27481c..a238de5ae 100644--- a/htroot/api/blacklists/get_metadata_p.java+++ b/htroot/api/blacklists/get_metadata_p.java@@ -26,8 +26,6 @@ public class get_metadata_p {private static final String BLACK_LISTS_SHARED = "BlackLists.Shared";private static final int lastTypeIndex = BLACKLIST_TYPE_VALUES.length - 1;- private static final String EMPTY_STRING = "";- private static final String COMMA_STRING = ",";public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, @SuppressWarnings("unused") final serverObjects post, @SuppressWarnings("unused") final serverSwitch env) {@@ -49,22 +47,14 @@ public class get_metadata_p {prop.put(PREFIX_LISTS + blacklistCount + INFIX_TYPES + j + POSTFIX_VALUE,ListManager.listSetContains(type + TYPES_EXT, element));- if (j < lastTypeIndex) {- prop.put(PREFIX_LISTS + blacklistCount + INFIX_TYPES + j + POSTFIX_COMMA, COMMA_STRING);- } else {- prop.put(PREFIX_LISTS + blacklistCount + INFIX_TYPES + j + POSTFIX_COMMA, EMPTY_STRING);- }+ prop.put(PREFIX_LISTS + blacklistCount + INFIX_TYPES + j + POSTFIX_COMMA, j < lastTypeIndex);j++;}prop.put(PREFIX_LISTS + blacklistCount + POSTFIX_TYPES, BLACKLIST_TYPE_VALUES.length);- if (blacklistCount < lastBlacklistCount) {- prop.put(PREFIX_LISTS + blacklistCount + POSTFIX_COMMA, COMMA_STRING);- } else {- prop.put(PREFIX_LISTS + blacklistCount + POSTFIX_COMMA, EMPTY_STRING);- }-+ prop.put(PREFIX_LISTS + blacklistCount + POSTFIX_COMMA, blacklistCount < lastBlacklistCount);+blacklistCount++;}}diff --git a/htroot/api/blacklists/get_metadata_p.json b/htroot/api/blacklists/get_metadata_p.jsonindex 76a0291b6..c666b530c 100644--- a/htroot/api/blacklists/get_metadata_p.json+++ b/htroot/api/blacklists/get_metadata_p.json@@ -1,8 +1,12 @@[#{lists}#{- "name": "#[name]#",- "shared": "#[shared]#",- "types": [#{types}#{"#[name]#": "#[value]#"}#[comma]# #{/types}#]- }#[comma]#+ "name":"#[name]#",+ "shared":#(shared)#false::true#(/shared)#,+ "types": {+ #{types}#+ "#[name]#":#(value)#false::true#(/value)##(comma)#::,#(/comma)#+ #{/types}#+}+ }#(comma)#::,#(/comma)##{/lists}#]\ No newline at end of filediff --git a/htroot/api/blacklists/get_metadata_p.xml b/htroot/api/blacklists/get_metadata_p.xmlindex 2ff680ad2..93e614978 100644--- a/htroot/api/blacklists/get_metadata_p.xml+++ b/htroot/api/blacklists/get_metadata_p.xml@@ -1,6 +1,6 @@<?xml version='1.0' encoding="UTF-8" standalone='yes'?><blacklists>-#{lists}#<list name="#[name]#" shared="#[shared]#" #{types}#- #[name]#="#[value]#"#{/types}# />+#{lists}#<list name="#[name]#" shared="#(shared)#false::true#(/shared)#" #{types}#+ #[name]#="#(value)#false::true#(/value)#"#{/types}# />#{/lists}#</blacklists>\ No newline at end of file