wiki:SEARCH_COMMONS_R0

Version 2 (modified by mitex, 16 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=SEARCH_COMMONS_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

spec_entry("Search Palette")
desc("includes the palette")
desc("since there are many searches, we may have something like a drop-down ")
desc("to select the search scope")
desc("This task deals with invoking searches, displaying the results, and common search design/infrastructure ")

Provide text search functionality in Sophie 2.

Task requirements

The Tools tab has a Search palette. It lets the user search a Sophie document.

A text field is available at the top of the palette where a user can enter a word or phrase he wants to find in current book.

The searching palette in the Tools tab provides a list of results with context (some words before and after the match; also the page number).

Text is typed in the field at the top of the palette and Enter is hit. A list of all occurrences in text are provided in the palette; to go to one of them, it is clicked in the list. Clicking on a result displays the page of the book with the match. The caret is positioned at the beginning of the match. The match is highlighted.

Below the text field there should be a combo box for selecting search scope:

  • Current Book
  • All Books in Workspace
  • Server Search (SERVER_SEARCH_R0?, search into the current server connection)

Provide common search design. It should be used by:

Search palette can be invoked by pressing Ctrl+F.

When the book that is being searched has embedded books, the embedded books are added to the search itinerary after all flows in the parent book have been searched. After all flows in all of the embedded books have been searched, the search loops back to the original flow that was being searched. If the embedded books have embedded books in them, the process is iterated. All books in the document are searched.

When searching from within a book that is embedded in a parent book, first the embedded book is searched, then the parent book is searched, and finally other embedded books in the parent book are searched.

If there are reader annotations, reader annotations are also searched. These are searched after all the embedded books have been searched; they are searched in the order in which they appear in the document.

Task result

Source code.

Implementation idea

Searching should be done in a new thread; otherwise, the GUI will hang when searching in large books.

(Add links to related tasks that could be useful or helpful.)

How to demo

  • Run Sophie 2
  • Create a new book
  • Insert a text frame and write something like "dfjkfds abc jfkdjfslk-abc-fdjfslkdfs"
  • Press Ctrl+F
  • Search for "abc"

Design

(Describe your design here.)

Implementation

(Describe and link the implementation results here (from the wiki or the repository).)

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)