This will be stored in a database that is not set up yet, but you can assume a database controller abstraction with db.getByID() and db.find({property: match}) at a minimum, the return of which will be a JSON that contains the minimum unique Project information.
This endpoint should also provide alternate returns for certain parameters:
?text=blob a complete blob of text of all lines concatenated
?text=layers an Array with each discrete layer as an entry { "name" : \Layer.name, Page.name`, "id" : "#AnnotationPageId", "textContent" : "concatenated blob" }`
?text=lines an Array of Layers with "textContent" above as `"lines" : [ { "id" : "#AnnotationId", "textualBody" : "single annotation content" }
?image=full the URL of the default resolution of a full page (found on the Canvas)
?image=lines an Array of the image fragments similar to text=lines above
?lookup=project (canvas, manifest, layers[], annotations[], metadata[], group) find the related document or Array of documents and return that instead, the version allowed without authentication
?view=json is the default, no querystring request and is redundant
?view=xml is a chance to get the document as an XML file
?view=html is a readonly viewer HTML Document presenting the project data
?embed=true instructs methods that would have returned a URI to expand that and dereference the full document in its place
These parameters are all mutually exclusive except embed and passing multiple or a nonsense combo ("?view=html&embed=true") is an error.
Improve the GET /page/{id} endpoint to return the type of thing expected. Actual connections to the database can be mocked for now.
See #19 for expectations as well as #49 for docs about possible parameters in the request to handle.
Write the failing tests first, then build to suit.
For now, a Page will look like this:
This will be stored in a database that is not set up yet, but you can assume a database controller abstraction with
db.getByID()
anddb.find({property: match})
at a minimum, the return of which will be a JSON that contains the minimum unique Project information.This endpoint should also provide alternate returns for certain parameters:
?text=blob
a complete blob of text of all lines concatenated?text=layers
an Array with each discrete layer as an entry{ "name" : \
Layer.name, Page.name`, "id" : "#AnnotationPageId", "textContent" : "concatenated blob" }`?text=lines
an Array of Layers with "textContent" above as `"lines" : [ { "id" : "#AnnotationId", "textualBody" : "single annotation content" }?image=full
the URL of the default resolution of a full page (found on the Canvas)?image=lines
an Array of the image fragments similar to text=lines above?lookup=project
(canvas, manifest, layers[], annotations[], metadata[], group) find the related document or Array of documents and return that instead, the version allowed without authentication?view=json
is the default, no querystring request and is redundant?view=xml
is a chance to get the document as an XML file?view=html
is a readonly viewer HTML Document presenting the project data?embed=true
instructs methods that would have returned a URI to expand that and dereference the full document in its placeThese parameters are all mutually exclusive except
embed
and passing multiple or a nonsense combo ("?view=html&embed=true") is an error.