MisterTJB / Colenso-Project

A web application providing access to documents forming the Colenso Project – a repository of New Zealand letters encoded with TEI
0 stars 0 forks source link

Implement batch tagging #9

Closed MisterTJB closed 8 years ago

MisterTJB commented 8 years ago

After substantial work Student Siobhan has done a search that has provided all the (or exclusively) references to a single object, place, person or time. She now wants to generate XML (TEI) markup from her search that will be added to all the relevant documents so that other people can use the results of her work. E.g. she identified all the places where a search for 'Nelson' refers to the person Nelson (as opposed to say the place) and now wants to mark all those as such.

MisterTJB commented 8 years ago

Suggest creating a tag (possibly requiring a schema amendment) <search_group name="..." description="..."/> that contains a tag name (used as an id) and a description for display.

Creating a tag

  1. User refines their search
  2. User clicks "Tag this search"
  3. A modal window appears prompting the user for a name/description
  4. Cancel and save dismiss the modal view; save updates all of the documents in the resultset
    • Client POSTs name and description, and URIs for currently visible results
    • Server parses POST and extracts name, description and URIs
    • Server updates all documents with a matching URI, adding a <search_group name="..." description="..." /> tag as a child of teiHeader

Using a tag

  1. Server all <search_group> tags in the database (e.g. db//search_group)
  2. Server returns a JSON list of [{name: "..." description: "..."}, ...] records
  3. Client parses JSON and creates elements with href pointing to /results?q=[XQuery for <search_group> with given name]&type="advanced"
MisterTJB commented 8 years ago

Unexpanded FLOWR expression:

for $letter in fn:collection("Colenso") where $letter/TEI[@xml:id = "%DOCUMENT_ID%"] return insert node <search_group name="%NAME%" description="%DESCRIPTION%"/> into $letter/TEI/teiHeader

MisterTJB commented 8 years ago

Can create <search_group .../> tags as of 182f8bf

MisterTJB commented 8 years ago

Suggest that using a tag should be invoked from the History tab – a drop down should give an option to take a user to a saved searches page that lists the saved searches and their descriptions in a table.

MisterTJB commented 8 years ago

Completed in 46ec687