The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

TM::IP::Documents::Controller::Root - Root Controller for TM::IP::Documents

DESCRIPTION

TMIP is a suite of RESTful protocols to communicate with Topic Maps (TM) based servers. This controller deals with the document subspace, i.e. a part of a topic map which can hold documents inside a repository.

Map Addressing

Like for all TMIP protocols, the topic map is addressed first using a URL structure like

  http://my.server/internet/web/

where / is the root map, internet one submap and web a submap under that. Underneath that mount point the document repository resides, by selected with .docs/:

  http://my.server/internet/web/.docs/

HTTP Methods

The operations offered by this subspace are pretty obvious:

GET ..../.docs/index

This returns a file listing of all documents in that repository. If the Accept header is set to application/json, then a hash (dictionary) is generate in JSON, containing the file name as key and as value a record with size, mime and modified information.

TODO: If the Accept header is text/html, then a HTML table is returned. @@@@@@@@@

All other Accept headers with result in an error.

TODO : POST ../index + document???, POST / + docuemtn @@@@@@

GET ...../.docs/some_file_name

This method does the obvious, it retrieves the named file from the document repository. Hereby all relevant headers should be set properly:

Content-Type: guess from the file content
Content-Length: size in bytes

TODO: Last mod

PUT ...../.docs/some_file_name

This method takes the message body and tries to store that as the contents inside the repository for the file named. If the file already exists, it will be overwritten.

TODO: size limit on request, size limit on repository

DELETE ...../.docs/some_file_name

This method tries to delete the named file in the document repository. If the file did not exist, then a NOT_FOUND otherwise a NO_CONTENT will be returned.

AUTHOR

Robert Barta, <rho at devc.at>

SEE ALSO

TM::IP

http://kill.devc.at/internet/semantic-web/topic-maps/tmip

COPYRIGHT & LICENSE

Copyright 200[9] Robert Barta, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.