From 643967af9fd8390c56c46b633cdb2e57e029db30 Mon Sep 17 00:00:00 2001 From: luccioman Date: Wed, 27 Sep 2017 17:51:11 +0200 Subject: [PATCH 1/5] Added French translation for ConfigSearchPage_p.html --- locales/fr.lng | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/locales/fr.lng b/locales/fr.lng index f11da5774..46c4040a5 100644 --- a/locales/fr.lng +++ b/locales/fr.lng @@ -545,6 +545,41 @@ For explanation please look into defaults/yacy.init==Pour des explications, rega "Save"=="Sauvegarder" #----------------------------- +#File: ConfigSearchPage_p.html +#--------------------------- +Search Page<==Page de recherche< +>Search Result Page Layout Configuration<==>Agencement de la page de résultats de recherche< +Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed.==Ci-dessous se trouve un modèle générique de page de résultats de recherche. Cocher les cases des éléments que vous souhaitez voir s'afficher. +To change colors and styles use the ==Pour modifier les couleurs et le style, utilisez le menu +>Appearance<==>Apparence graphique< + menu for different skins.== pour avoir accès à différentes présélections de styles. +Other portal settings can be adjusted in==Les autres éléments de configuration du portail peuvent être définis dans +>Page Template<==>Modèle de page< +>Text<==>Texte< +>Video<==>Vidéo< +>more options<==>plus d'options< +>Topics<==>Sujets< +>Cloud<==>Nuage< +>Protocol<==>Protocole< +>Filetype<==>Type de fichier< +>Wiki Name Space<==>Espace de nommage Wiki< +>Language<==>Langue< +>Author<==>Auteur< +>Vocabulary<==>Ontologie< +>Provider<==>Hôte< +>Title of Result<==>Titre du résultat< +Description and text snippet of the search result==Description et extrait de texte du résultat de recherche +42 kbyte<==42 ko< +>Metadata<==>Méta-données< +>Parser<==>Analyseur d'URL< +>Citation<==>Citations< +>Pictures<==>Images< +For this option URL proxy must be enabled.==Pour cette option le proxy doit être activé. +max. items==nb. max. d'éléments +"Save Settings"=="Enregistrer" +"Set Default Values"=="Valeurs par défaut" +#----------------------------- + #File: ConfigSkins_p.html #--------------------------- Skin Selection==Choix de thème @@ -2637,8 +2672,9 @@ Parser Configuration==Configuration de l'analyseur syntaxique #File: env/templates/submenuDesign.template #----------------------------- ->Appearance==>Apparence ->Language==>Langue +>Appearance<==>Apparence graphique< +>Language<==>Langue< +Search Page Layout==Agencement de la page de résultats #----------------------------- #File: env/templates/submenuIndexControl.template From dd82f85953479aa7d25b2552f6b076a856747ff7 Mon Sep 17 00:00:00 2001 From: reger Date: Thu, 28 Sep 2017 00:46:49 +0200 Subject: [PATCH 2/5] Add links to the optional keyword tags of search result If swichted on link (click) to the tag adds the keyword to the search query. If a keyword navigator is active the selected keyword adds or replaces a query keyword: modifier (currently replace was choosen as multiple keywords are not fully supported yet) --- htroot/yacysearchitem.html | 2 +- htroot/yacysearchitem.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html index 668e23c18..1b5107df3 100644 --- a/htroot/yacysearchitem.html +++ b/htroot/yacysearchitem.html @@ -25,7 +25,7 @@

#[description]#

#[urlname]#

- #(showKeywords)#::

Tags: #{keywords}##[tagword]# #{/keywords}#

#(/showKeywords)# + #(showKeywords)#::

Tags: #{keywords}##[tagword]# #{/keywords}#

#(/showKeywords)#

#(showDate)#::#[date]##(/showDate)# #(showEvent)#::on #[date]##(/showEvent)# diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index bdbd9fc51..722169944 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -62,6 +62,7 @@ import net.yacy.peers.graphics.ProfilingGraph; import net.yacy.search.EventTracker; import net.yacy.search.Switchboard; import net.yacy.search.SwitchboardConstants; +import net.yacy.search.navigator.Navigator; import net.yacy.search.query.HeuristicResult; import net.yacy.search.query.QueryParams; import net.yacy.search.query.SearchEvent; @@ -242,10 +243,19 @@ public class yacysearchitem { if (showEvent) prop.put("content_showEvent_date", GenericFormatter.RFC1123_SHORT_FORMATTER.format(events[0])); if (showKeywords) { // tokenize keywords StringTokenizer stoc = new StringTokenizer(result.dc_subject()," "); + String rawNavQueryModifier; + Navigator navi = theSearch.navigatorPlugins.get("keywords"); + boolean naviAvail = navi != null; int i = 0; while (stoc.hasMoreTokens()) { String word = stoc.nextToken(); prop.putHTML("content_showKeywords_keywords_" + i + "_tagword", word); + if (naviAvail) { // use query modifier if navigator available + rawNavQueryModifier = navi.getQueryModifier(word); + } else { // otherwise just use the keyword as additional query word + rawNavQueryModifier = word; + } + prop.put("content_showKeywords_keywords_" + i + "_tagurl", QueryParams.navurl(fileType, 0, theSearch.query, rawNavQueryModifier, naviAvail).toString()); i++; } prop.put("content_showKeywords_keywords", i); From ff87b1c5e2c9589fc49da3e0ceaf9abc5753d882 Mon Sep 17 00:00:00 2001 From: luccioman Date: Thu, 28 Sep 2017 09:55:23 +0200 Subject: [PATCH 3/5] Updated master translation file for ConfigSearchPage_p.html --- locales/de.lng | 5 ++-- locales/fr.lng | 21 +++++++++++++- locales/ja.lng | 1 + locales/master.lng.xlf | 65 +++++++++++++++++++++++++++++++++++++----- locales/ru.lng | 4 +-- 5 files changed, 83 insertions(+), 13 deletions(-) diff --git a/locales/de.lng b/locales/de.lng index b6c0bc8f2..d00a7f06b 100644 --- a/locales/de.lng +++ b/locales/de.lng @@ -840,15 +840,14 @@ Replace the word "MySearch" with your own message==Ersetzen Sie das Wort "Meine #File: ConfigSearchPage_p.html #--------------------------- +== Search Page<==Suchseite< >Search Result Page Layout Configuration<==>Konfiguration des Seitenlayouts der Seite für Suchergebnisse< Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed.==Im Folgenden wird ein generisches Template einer Suchergebnisseite. Markieren Sie die Checkboxen für alle Features die angezeigt werden sollen. To change colors and styles use the ==Um die Farben und Stile zu ändern, verwenden Sie das >Appearance<==>Erscheinungsbild< menu for different skins.== Menü für verschiedene Skins. -Other portal settings can be adjusted in==Andere Einstellungen für das Portal können im ->Generic Search Portal<==>Generisches Suchportal< -menu.==Menü geändert werden. +Other portal settings can be adjusted in Generic Search Portal menu.==Andere Einstellungen für das Portal können im Generisches Suchportal Menü geändert werden. >Page Template<==>Seiten Template< #>Administration<==>Administration< >Web Search<==>Websuche< diff --git a/locales/fr.lng b/locales/fr.lng index 46c4040a5..f6c5b5b47 100644 --- a/locales/fr.lng +++ b/locales/fr.lng @@ -547,13 +547,14 @@ For explanation please look into defaults/yacy.init==Pour des explications, rega #File: ConfigSearchPage_p.html #--------------------------- +== Search Page<==Page de recherche< >Search Result Page Layout Configuration<==>Agencement de la page de résultats de recherche< Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed.==Ci-dessous se trouve un modèle générique de page de résultats de recherche. Cocher les cases des éléments que vous souhaitez voir s'afficher. To change colors and styles use the ==Pour modifier les couleurs et le style, utilisez le menu >Appearance<==>Apparence graphique< menu for different skins.== pour avoir accès à différentes présélections de styles. -Other portal settings can be adjusted in==Les autres éléments de configuration du portail peuvent être définis dans +Other portal settings can be adjusted in Generic Search Portal menu.==Les autres éléments de configuration du portail peuvent être définis dans le menu Generic Search Portal. >Page Template<==>Modèle de page< >Text<==>Texte< >Video<==>Vidéo< @@ -569,15 +570,33 @@ Other portal settings can be adjusted in==Les autres éléments de configuration >Provider<==>Hôte< >Title of Result<==>Titre du résultat< Description and text snippet of the search result==Description et extrait de texte du résultat de recherche +"Date"=="Date" 42 kbyte<==42 ko< +"Size"=="Taille" >Metadata<==>Méta-données< >Parser<==>Analyseur d'URL< >Citation<==>Citations< >Pictures<==>Images< +"Browse index"=="Parcourir l'index" For this option URL proxy must be enabled.==Pour cette option le proxy doit être activé. max. items==nb. max. d'éléments "Save Settings"=="Enregistrer" "Set Default Values"=="Valeurs par défaut" +"Top navigation bar"=="Barre de navigation d'en-tête" +>Location<==>Lieu< +show search results on map==Montrer les résultats sur la carte +Date Navigation==Statistiques par dates +Maximum range (in days)==Période maximale (en jours) +Maximum days number in the histogram. Beware that a large value may trigger high CPU loads both on the server and on the browser with large result sets.==Nombre maximum de jours de l'histogramme. Veuillez noter qu'une valeur élevée peut déclencher des charges CPU importantes tant sur le serveur que sur le navigateur lorsqu'il y a un grand nombre de résultats. +keyword subject keyword2 keyword3==mot-clé sujet mot-clé2 mot-clé3 +View via Proxy==Ouvrir via le proxy +>Snapshots<==>Captures< +"Raw ranking score value"=="Score de classement brut" +Ranking: 1.12195955E9==Score: 1.12195955E9 +"Delete navigator"=="Supprimer le groupe" +Add Navigators==Ajout de groupes de navigation +"Add navigator"=="Ajouter le groupe" +>append==>Ajouter #----------------------------- #File: ConfigSkins_p.html diff --git a/locales/ja.lng b/locales/ja.lng index c834e68a2..1e717f4a1 100644 --- a/locales/ja.lng +++ b/locales/ja.lng @@ -615,6 +615,7 @@ This would look like:==これは次の様に見えます: #File: ConfigSearchPage_p.html #--------------------------- +== Search Page<==検索ページ< >Search Result Page Layout Configuration<==>検索結果のページのレイアウトの構成< >Appearance<==>外観< diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf index 65e7adab7..d56331813 100644 --- a/locales/master.lng.xlf +++ b/locales/master.lng.xlf @@ -2043,10 +2043,7 @@ menu for different skins. - Other portal settings can be adjusted in - - - >Generic Search Portal< + Other portal settings can be adjusted in <a href="ConfigPortal_p.html">Generic Search Portal</a> menu. >Page Template< @@ -2126,9 +2123,21 @@ >Cache< + + <html lang="en"> + + + "Date" + + + "Size" + + + "Browse index" + For this option URL proxy must be enabled. - + max. items @@ -2138,8 +2147,50 @@ "Set Default Values" - - menu. + + "Top navigation bar" + + + >Location< + + + show search results on map + + + Date Navigation + + + Maximum range (in days) + + + Maximum days number in the histogram. Beware that a large value may trigger high CPU loads both on the server and on the browser with large result sets. + + + keyword subject keyword2 keyword3 + + + View via Proxy + + + >Snapshots< + + + "Raw ranking score value" + + + Ranking: 1.12195955E9 + + + "Delete navigator" + + + Add Navigators + + + "Add navigator" + + + >append http://url-of-the-search-result.net diff --git a/locales/ru.lng b/locales/ru.lng index b3dc22a6c..014b9cbc1 100644 --- a/locales/ru.lng +++ b/locales/ru.lng @@ -938,14 +938,14 @@ Replace the word "MySearch" with your own message==Заменить слово " #File: ConfigSearchPage_p.html #--------------------------- +== Search Page<==Страница поиска< >Search Result Page Layout Configuration<==>Конфигурация макета страницы результатов поиска< Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed.==Ниже приведён общий макет страницы результатов поиска. Отметьте компоненты, которые должны быть отображены. To change colors and styles use the ==Изменить цвета, стили и скины вы можете >Appearance<==>здесь< menu for different skins.==. -Other portal settings can be adjusted in==Другие настройки портала могут быть изменены на ->Generic Search Portal<==>странице интеграции поиска< +Other portal settings can be adjusted in Generic Search Portal menu.==Другие настройки портала могут быть изменены на Меню странице интеграции поиска. >Page Template<==>Макет страницы< >Administration<==>Администрирование< >Web Search<==>Вэб-поиск< From ba60f65040a744b4ed28879dae0e0286405be3d7 Mon Sep 17 00:00:00 2001 From: reger Date: Fri, 29 Sep 2017 00:26:30 +0200 Subject: [PATCH 4/5] Adjust filetype: query modifier parameter to lower case to prevent mismatch on user input with mixed case Internally file extension are always compared lowercase. --- source/net/yacy/search/query/QueryModifier.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/search/query/QueryModifier.java b/source/net/yacy/search/query/QueryModifier.java index a4b75f34d..5fa2f9e18 100644 --- a/source/net/yacy/search/query/QueryModifier.java +++ b/source/net/yacy/search/query/QueryModifier.java @@ -221,6 +221,7 @@ public class QueryModifier { /** * Parse query string for filetype (file extension) parameter + * and adjust parameter to lowercase * @param querystring * @param filetypePrefix "filetype:" * @return querystring with filetype parameter removed @@ -230,8 +231,9 @@ public class QueryModifier { if ( ftp >= 0 ) { int ftb = querystring.indexOf(' ', ftp); if ( ftb < 0 ) ftb = querystring.length(); - filetype = querystring.substring(ftp + filetypePrefix.length(), ftb); - querystring = querystring.replace(filetypePrefix + filetype, ""); + String tmpqueryparameter = querystring.substring(ftp + filetypePrefix.length(), ftb); + querystring = querystring.replace(filetypePrefix + tmpqueryparameter, ""); // replace prefix:Text as found + filetype = tmpqueryparameter.toLowerCase(); // file extension are always compared lowercase, can be converted here for further processing while ( !filetype.isEmpty() && filetype.charAt(0) == '.' ) { filetype = filetype.substring(1); } From 27ab733685930a8c967c3f28197fc34f98123010 Mon Sep 17 00:00:00 2001 From: luccioman Date: Fri, 29 Sep 2017 19:18:12 +0200 Subject: [PATCH 5/5] Ensure private search features are not lost on Digest auth timeout This is a fix for mantis 766 ( http://mantis.tokeek.de/view.php?id=766 ) Since the upgrade to Digest authentication, access to protected search features was indeed disabled once the Digest nonce timed out. After Digest auth timeout the browser no more sent authentication information and as the search results page is not private, protected features were simply be hidden without asking browser again for authentication. Adding a supplementary parameter when accessing the search results as authenticated fixes this. --- htroot/env/templates/header.template | 3 + htroot/index.html | 3 + htroot/yacysearch.html | 3 + htroot/yacysearch.java | 21 ++++-- htroot/yacysearchitem.html | 2 +- htroot/yacysearchitem.java | 42 +++++++++--- htroot/yacysearchlatestinfo.java | 16 ++++- htroot/yacysearchtrailer.java | 44 ++++++++++--- source/net/yacy/search/query/QueryParams.java | 65 ++++++++++++------- 9 files changed, 152 insertions(+), 47 deletions(-) diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index 32e70cc59..639e7ec2a 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -20,6 +20,9 @@ + #(authorized)#:: + + #(/authorized)#