Author: bbrossaud Date: 2010-07-23 18:18:38 +0200 (Fri, 23 Jul 2010) New Revision: 99 Url: http://chorem.org/repositories/revision/bow/99 Log: removed bug with fulltext Modified: trunk/src/main/java/org/chorem/bow/BookmarkActions.java trunk/src/main/java/org/chorem/bow/ControllerServlet.java Modified: trunk/src/main/java/org/chorem/bow/BookmarkActions.java =================================================================== --- trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-07-22 09:34:23 UTC (rev 98) +++ trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-07-23 16:18:38 UTC (rev 99) @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Date; -import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.regex.Matcher; @@ -264,34 +263,7 @@ } return ""; } - - public void fullText(String line) { - fullTextLine = line; - String[] fullText = line.split("\\s+"); - List<Bookmark> save = new ArrayList<Bookmark>(bookmarks); - for (Bookmark bookmark : save) { - boolean delete = true; - Set<String> tags = bookmark.getTags(); - String name = bookmark.getDescription(); - for (String word : fullText) { - if (tags != null) { - for (String tag : tags) { - if (tag.contains(word)) { - delete = false; - break; - } - } - } - if (name.contains(word)) { - delete = false; - } - } - if (delete == true) { - bookmarks.remove(bookmark); - } - } - } - + public void createTagCloud(List<FacetTopic> cpy) { setTagCloud(cpy); deleteTagBySearch(); @@ -314,27 +286,6 @@ } } - public void deleteBookmarkBySearch() { - List<Bookmark> bookmarksList = new ArrayList<Bookmark>(bookmarks); - for (Bookmark bookmark : bookmarksList) { - Iterator it = tagsSearch.iterator(); - boolean remove = false; - while (it.hasNext() && remove == false) { - String tag = (String) it.next(); - Set<String> tagList = bookmark.getTags(); - if (tagList != null && !tagList.isEmpty()) { - if (!tagList.contains(tag)) { - bookmarks.remove(bookmark); // Delete bookmark which doesn't contain the tags from the search field - remove = true; - } - } else { - bookmarks.remove(bookmark); // Delete bookmark which doesn't contain the tags from the search field - remove = true; - } - } - } - } - protected void defineTValues() { tmax = -1; // correspond to the most tag frequency in the tag cloud tmin = -1; // correspond to the less tag frequency in the tag cloud @@ -351,12 +302,6 @@ } } - public void addTag(String tag) { - if (!tagsSearch.contains(tag)) { - tagsSearch.add(tag); - } - } - public void addTags(String str) { if (str != null) { if (!str.isEmpty()) { @@ -389,6 +334,14 @@ tmin = -1; } + public void setFullTextLine(String line) { + if (line == null) { + fullTextLine = ""; + } else { + fullTextLine = line; + } + } + public void setBookmarks(List<Bookmark> bookmarksList) { List<Bookmark> newList = new ArrayList(bookmarksList); bookmarks = newList; Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java =================================================================== --- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-07-22 09:34:23 UTC (rev 98) +++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-07-23 16:18:38 UTC (rev 99) @@ -667,6 +667,7 @@ protected BookmarkActions createBookmarkActions(HttpServletRequest request, PagedResult result, String searchLine) { String fullText = request.getParameter("fullTextLine"); BookmarkActions bookmarkActions = new BookmarkActions(); + bookmarkActions.setFullTextLine(fullText); List<Bookmark> bookList = result.getAll(); if (bookList != null) { bookmarkActions.setBookmarks(bookList);
participants (1)
-
bbrossaudï¼ users.chorem.org