branch develop updated (63a6644 -> a074606)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository bow. See http://git.chorem.org/bow.git from 63a6644 fixes #1261: Can use prefix that start with another existing prefix new a074606 fixes #1203: Pouvoir masquer les resultats filtres ayant un certain tag The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit a074606846d28a82190cd323f8c34d0f39b15ec9 Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Thu Jul 16 00:55:30 2015 +0200 fixes #1203: Pouvoir masquer les resultats filtres ayant un certain tag Summary of changes: .../src/main/java/org/chorem/bow/BookmarkUtils.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository bow. See http://git.chorem.org/bow.git commit a074606846d28a82190cd323f8c34d0f39b15ec9 Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Thu Jul 16 00:55:30 2015 +0200 fixes #1203: Pouvoir masquer les resultats filtres ayant un certain tag --- .../src/main/java/org/chorem/bow/BookmarkUtils.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java b/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java index 4e460e8..e615c74 100644 --- a/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java +++ b/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java @@ -30,6 +30,7 @@ import org.nuiton.util.StringUtil; import java.util.Date; import java.util.Set; +import java.util.HashSet; import org.apache.commons.io.IOUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; @@ -81,7 +82,24 @@ public class BookmarkUtils { if (StringUtils.isNotBlank(tagLine)) { Set<String> tags = BowUtils.getWords(tagLine); - search.containsAll(BowBookmark.FQ_FIELD_WIKITTYLABEL_LABELS, tags); + // on separe les tags commencant par '-' des autres + Set<String> tagsInclude = new HashSet<String>(); + Set<String> tagsExclude = new HashSet<String>(); + for (String tag : tags) { + if (StringUtils.startsWith(tag, "-")) { + tagsExclude.add(StringUtils.removeStart(tag, "-")); + } else { + // \ peut-etre utilise pour echappe le caractere - et + // ainsi permettre les tags commencant par - + tagsInclude.add(StringUtils.removeStart(tag, "\\")); + } + } + if (!tagsInclude.isEmpty()) { + search.containsAll(BowBookmark.FQ_FIELD_WIKITTYLABEL_LABELS, tagsInclude); + } + if (!tagsExclude.isEmpty()) { + search.not().containsAll(BowBookmark.FQ_FIELD_WIKITTYLABEL_LABELS, tagsExclude).close(); + } } WikittyQuery criteria = search.end(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm