CenterForDigitalHumanities / TPEN-Newberry-Italian

T-PEN Newberry Italian paleography project
0 stars 0 forks source link

Wrong lines in text preview #76

Open thehabes opened 7 years ago

thehabes commented 7 years ago

When the JSONLDExporter builds the otherContent.resources on a particular canvas, it looks to

SELECT * FROM transcription WHERE projectID = ? AND folio = ? ORDER BY x, y

Instead of looking to the annotation store.

The front end makes calls to the annotation store at certain times and overwrites the cached lines with the correct lines, so often you do not see this mistake in the UI. However, createPreviewPages() pulls this out and populates the wrong lines.

It is a simple fix in the exporter, and I may be able to pull more GETs out of the client side code which will help speed things up.

thehabes commented 7 years ago

This unveiled some serious flaws in the back end. The fix for this involved fixing the back end a bit.

GetProjectTPENSerlvet.java was altered so that it built the manifest inside a 'manifest' property. This eliminated the need for a second call to /project/projectID to get the manifest object on the client side. It also improved local data caching which helped to eliminate extraneous calls in other locations.

JSONLDExporter.java was altered to gather the correct annotation lists for a particular canvas and to put the images inside an 'images' field instead of the the canvas.resources. This eliminated numerous extraneous calls to get these lists on the client side.

Canvas.java was altered to include a method that would search the annotation store for the annotationLists and include them in otherContent[] with the canvases in the JSONLDExporter.

ProjectServlet.java was altered to support CORS and ignore the user check so the manifests are public.

ImageResize.java was altered to ignore the user check, which helped with dereferencing canvases. The application is not responsible for restricting images like our TPEN is.

newberry.js was altered to handle the new GetProjectTPENServlet return schema.

Thorough testing has shown this was successful. It fixed the issues the change was intended for without causing new ones and the application seems to be running more efficiently.