Skip to content

Commit

Permalink
Issue 612 (#38)
Browse files Browse the repository at this point in the history
* Adding OPTIONS request for integrating Hypercube with Api-X

* Returing content-type on OPTIONS request and README update

* OPTIONS for Houdini

* Better testing annotations, README update.

* MOAR README

* README typos

* Basing services for binaries off of ldp:NonRDFSource instead of fedora:Binary
  • Loading branch information
dannylamb authored and DiegoPino committed Aug 15, 2017
1 parent ad6d957 commit 05b651e
Show file tree
Hide file tree
Showing 13 changed files with 557 additions and 426 deletions.
19 changes: 15 additions & 4 deletions Houdini/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@ Houdini sets up two endpoints:
- /identify/
- /convert/

Houdini only accepts `GET` requests containing the path an image in Fedora at both of these endpoints.
Houdini is meant for use with API-X, and accepts `GET` and `OPTIONS` requests to those endpoints. The `OPTIONS` requests are for use with the API-X service loading mechanism, and return RDF describing the
service for API-X. The `GET` requests are used to execute the services, and must contain the URI to an image in Fedora in the `ApixLdpResource` header.

### Identify

This runs the imagemagick identify command on the specified resource and returns the results as JSON with the mimetype application/json.

For example, suppose if you have a TIFF in Fedora at `http://localhost:8080/fcrepo/rest/foo/bar`. If running the PHP built-in server command described in the Installation section:
```
$ curl -H "Authorization: Bearer blabhlahblah" "localhost:8888/identify/foo/bar"
$ curl -H "Authorization: Bearer blabhlahblah" -H "ApixLdpResource: http://localhost:8080/fcrepo/rest/foo/bar" "localhost:8888/identify"
```

But you're probably going to use Houdini through API-X, which exposes this service as `svc:identify`. Assuming your API-X proxy is on port 8081, you can access the service with
```
$ curl -H "Authorization: Bearer blabhlahblah" "http://localhost:8081/services/foo/bar/svc:identify"
```

### Convert
Expand All @@ -47,14 +53,19 @@ This runs the imagemagick convert command on the specified resource. The output

For example, suppose if you have an image in Fedora at `http://localhost:8080/fcrepo/rest/foo/bar`. If running the PHP built-in server command described in the Installation section:
```
$ curl -H "Authorization: Bearer blabhlahblah" -H "Accept: image/png" "localhost:8888/convert/foo/bar"
$ curl -H "Authorization: Bearer blabhlahblah" -H "ApixLdpResource: http://localhost:8080/fcrepo/rest/foo/bar" -H "Accept: image/png" "localhost:8888/convert/foo/bar"
```

This will return the TIFF converted into a PNG file.

Additional arguments can be specified using the X-Islandora-Args header. For example to resize to 10% the size use:
```
$ curl -H "Authorization: Bearer blabhlahblah" -H "X-Islandora-Args: -resize 10%" "localhost:8888/convert/foo/bar"
$ curl -H "Authorization: Bearer blabhlahblah" -H "ApixLdpResource: http://localhost:8080/fcrepo/rest/foo/bar" -H "X-Islandora-Args: -resize 10%" "localhost:8888/convert/foo/bar"
```

But you're probably going to use Houdini through API-X, which exposes this service as `svc:convert`. Assuming your API-X proxy is on port 8081, you can access the service with
```
$ curl -H "Authorization: Bearer blabhlahblah" "http://localhost:8081/services/foo/bar/svc:convert"
```

## Maintainers
Expand Down
Loading

0 comments on commit 05b651e

Please sign in to comment.