Title (Goal) | Amherst - Template rendering service |
---|---|
Primary Actor | Unknown User (acoburn)Developer |
Scope | Component |
Level | |
Author | Unknown User (acoburn) |
Story (A paragraph or two describing what happens) | If fedora objects are stored as JSON in an external system (see the JSON-LD compaction service), we will need a way to render those objects as HTML. Using a simple camel route to apply a mustache template seems ideal here. |
A sample OSGi implementation is available here: https://github.com/acoburn/repository-extension-services, see particularly the acrepo-template-mustache
module.
Web Resource interaction
This service would expose an HTTP endpoint that would accept GET requests. The endpoint would exist separate from the fedora repository, probably running on a separate machine. Requests would retrieve resources from an external cache or, if a resource didn't exist in the cache, would retrieve the resource from Fedora's HTTP API.
For example: a request for http://localhost:5555/template/foo/bar/baz
would map to a fedora resource at, e.g. http://localhost:8080/fcrepo/rest/foo/bar/baz
Deployment or Implementation notes
This service would be deployed separately from fedora, probably on a separate machine. The current draft implementation runs as a combination OSGi service and camel route that can be deployed in any OSGi container. The implementation is currently written in Java and Blueprint XML. The implementation requires access only to Fedora's HTTP API.
API-X Value Proposition
The value of API-X here would be in allowing the service to be discoverable.