NAME

anno_server - simple dotReader annotation server

USAGE

This is really only for testing, so to facilitate that it has a mode where it will start the server, run a system command, and then shutdown. In this mode, the pattern qr{\bADDR/} will be replaced with the server address (e.g. http://localhost:8088/.)

./util/anno_server curl ADDR/TEST.yml

Without arguments, it will just start the server.

new

my $server = dtRdr::anno_server->new();

handle_request

$server->handle_request($cgi);

dispatch

$self->dispatch($path, $cgi);

CGI abstraction/workaround

url_param

$self->url_param($cgi);

read_client_data

Deal with CGI's failed helpiness.

my ($fmt, $string) = $self->read_client_data($cgi);

REST API

GET_manifest

$self->GET_manifest(\@path_rem, $cgi);

GET_annotation

$self->GET_annotation($path, %args);

POST_annotation

Creates a new annotation. A POST against an existing path/id is an error.

POST $ADDR/annotation/

$server->POST_annotation($path, %args);

PUT_annotation

Updates an existing annotation. The create-this PUT is not supported.

PUT $ADDR/annotation/$id.$fmt?rev=$expected_rev

$server->PUT_annotation($path, %args);

DELETE_annotation

Deletes an existing annotation.

PUT $ADDR/annotation/$id.$fmt?rev=$expected_rev

$server->DELETE_annotation($path, %args);

Data Formats

formatter

$self->formatter($format);

unformatter

$self->unformatter($format);

Transform and Validation

Abstractions for local/wire representations. These might help if we go with a dtRdr::Annotation::IOBlob object or something. Otherwise, I think we're just normalizing data.

keys

id
title
start
end
context
selected
mod_time
create_time
revision
public
  owner
  rev - output only (if even)
content - notes only

_kmap

$data = $self->_kmap($data);

anno_in

$data = $self->anno_in($data);

anno_out

$data = $self->anno_out($data);

output

Overrides

$self->output(...);

Data Handling

manifest

my %items = $server->manifest(%select);

Authentication Customization

authenticate

Internalizes the authentication type.

$self->authenticate;

get_password

$self->get_password($user);

1 POD Error

The following errors were encountered while parsing the POD:

Around line 964:

=end notes doesn't match =begin NOTES. (Stack: =begin NOTES)