Skip to content
Marco Filetti edited this page Sep 2, 2015 · 24 revisions

Before physio (basic DiMe Syncing)

PeyeDF passes a ReadingEvent to DiMe each time the user stays on a page for a fixed amount of time (5 seconds). The start time refers to the first time the user scrolled to this page, while the end time is when the user navigates away from the page, switches windows or 10 minutes from the start, whichever comes first (actual constants defined in PeyeConstants).

The event generation loop can then be defined as follows:

  1. When first opening a file, we send an information element to dime within a desktop event. This contains the details of the file (title, path, plaintext, etc.)
  2. We submit a reading event every time a "status" expires

The "status expiration" loop can then be defined as follows:

  1. There is an entry event, such as we landed on a specific page, maybe immediately after opening a page, maybe not. HistoryManager keeps a reference of the window in which we landed. An entry event could even be that we started scrolling a window which is not in focus. An entry event is always preceded by an exit event (step 3).
  2. After a minimum amount of time (e.g. 5 seconds) we assume the user started reading and save this status in the HistoryManager. This starts another timer (e.g. 10 minutes) after which we assume the user went away from keyboard. This is called an exit event.
  3. An exit event is when the user switches focus, scrolls / moves a window. An exit event is also when the timer started in step 2 above terminates. After receiving an exit event, the HistoryManager sends the status (which was saved in step 2 above) to DiMe. If no status was saved (e.g. because we switched focus after less than 5 seconds), nothing happens.

The main actors in the DiMe event submission loop are:

  • DocumentWindowController: keeps a reference to the MyPdf instance and tracks events such as scrolling, focus change, etc. Answers to requests from history manager (this can be done using a HistoryResponder protocol). Many DocumentWindowControllers can be active at once (when the user has many documents open).
  • HistoryManager: there is only one history manager. It keeps a reference to the currently running timer(s) and the the current HistoryResponder is "active" (the last which generated an "entry event"). This history responder is currently always a DocumentWindowController. HistoryManager is also responsible for DiMe api calls and asks ReadingEvent data from the HistoryResponder.
  • ReadingEvent: data representation (see below)

ReadingEvent

It contains:

  • multiPage: boolean, yes if > 1 page is currently being displayed
  • visiblePageNumbers: vector of pages specifying the pages currently being displayed, starting from 0 (length should be > 1 if multiPage == true)
  • visiblePageLabels: vector of pages labels (metadata) extracted from the pages being displayed.
  • pageRects: A list of rectangles representing where the viewport is placed for each page. All the rects should fit within the page. Rect dimensions refer to points in a 72 dpi space where the bottom left is the origin, as in Apple's PDFKit. A page in US Letter format (often used for papers) translates to approx 594 x 792 points. Rectangles have a readingClass field which identifies what kind of rectangle this is (viewport rectangle, actually read rectangle defined by eye tracking, etc - constants defined in dime/.../data/Rect.java).
  • proportion: The proportion of the document currently being displayed on screen. For example, [0.25, 0.50] means that we are seeing from the first quarter until half the document (if a document has 4 pages then it means we are seeing page 2) although numbers wouldn't generally be so nicely rounded.
  • plainTextContent: Plain text content of text currently displayed on screen.

After physio

Paragraph identification

Paragraphs are currently identified by the Rectangles passed to reading events. These are later translated to annotations by PeyeDF.

Collaboration

These outputted json files could be saved and sent to other PeyeDF users

Clone this wiki locally