API:EPrints/Apache/REST

From EPrints Documentation
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Apache::REST - Representational state transfer

User Comments


DESCRIPTION

REST API for EPrints

User Comments


METHODS

User Comments


handler

$rc = EPrints::Apache::REST::handler( $r )

Handler for EPrints' REST API

User Comments


redir_add_slash

$rc = EPrints::Apache::REST::redir_add_slash( $repository )

Redirect to the current request for the $repository with an added slash '/' at the end of the path.

User Comments


serve_top_level

$rc = EPrints::Apache::Login::serve_top_level( $repository, @path )

Serve top level list of datasets (i.e. eprint, user and subject) or pass onto EPrints::Apache::Login::serve_datasets. dependent of @path.

User Comments


serve_dataset

$rc = EPrints::Apache::REST::serve_dataset( $repository, $dataset, @path )

Serve listing of data objects for a particular dataset, pass onto EPrints::Apache::Login::serve_dataobj, EPrints::Apache::Login::get_dataobj_xml or EPrints::Apache::Login::put_dataobj_xml,or return an appropriate HTTP error code.

User Comments


serve_dataobj

$rc = EPrints::Apache::REST::serve_dataobj( $repository, $object, $rights_object, @path )

Servee HTML, XML or text version of data object from GET or PUT request, pass onto EPrints::Apache::REST::serve_field or otherwise return an appropriate HTTP error code.

User Comments


serve_field

$rc = EPrints::Apache::REST::serve_field( $repository, $object, $rights_object, $field, $value, @path )

Servee HTML, XML or text version of data object from GET requests passsingel field requests onto EPrints::Apache::REST::serve_field_single or otherwise return an appropriate HTTP error code.

User Comments


serve_field_single

$rc = EPrints::Apache::REST::serve_field_single( $repository, $object, $rights_object, $field, $value, @path )

Servee single field representation by passing onto EPrints::Apache::REST::serve_subobject, EPrints::Apache::REST::serve_compound or EPrints::Apache::REST::serve_name base on type of field.

User Comments


serve_suboject

$rc = EPrints::Apache::REST::serve_suboject( $repository, $object, $rights_object, $field, $value, @path )

Serves sub-object by passing onto EPrints::Apache::REST::serve_dataobj.

User Comments


serve_compound

$rc = EPrints::Apache::REST::serve_compound( $repository, $object, $rights_object, $field, $value, @path )

Serves compound field by iterating over sub-field, calling EPrints::Apache::REST::serve_field_single where appropriate.

User Comments


serve_compound

$rc = EPrints::Apache::REST::serve_compound( $repository, $object, $rights_object, $field, $value, @path )

Serves name field.

User Comments


render_html

$rc = EPrints::Apache::REST::render_html( $html, $title )

Renders HTML for REST request.

User Comments


send_html

$rc = EPrints::Apache::REST::send_html( $repository, $html, $title )

Sends HTML response for REST request.

User Comments


send_html

$rc = EPrints::Apache::REST::send_html( $repository, $xmldata )

Sends XML response for REST request.

User Comments


send_html

$rc = EPrints::Apache::REST::send_html( $repository, $content )

Sends plaintext response for REST request.

User Comments


allowed_methods

$allowed = EPrints::Apache::REST::allowed_methods( $repository, @methods )

Checks if method for eequest is contained with the @methods array of allowed methods. Setting and sending HTTP response headers and code as appropriate.

Returns boolean depending on whether the request method is allowed.

User Comments


allowed_methods

$allowed = EPrints::Apache::REST::allowed_methods( $priv $repository, $rights_object )

Checks is privilege $priv is permitted for the current user and sets HTTP response code as appropriate.

Returns boolean depending on whether current user has permitted privilege.

User Comments


get_dataobj_xml

$rc = EPrints::Apache::REST::get_dataobj_xml( $repository, $object, $rights_object )

Returns XML ot REST request to get a data object.

User Comments


put_dataobj_xml

$rc = EPrints::Apache::REST::put_dataobj_xml( $repository, $object, $rights_object )

Returns XML to REST request to (non-implemented) put data object.

User Comments


get_field_text

$rc = EPrints::Apache::REST::get_field_text( $repository, $object, $rights_object, $field )

Returns text to to REST request to get field.

User Comments


get_field_xml

$rc = EPrints::Apache::REST::get_field_xml( $repository, $object, $rights_object, $field )

Returns XML for REST request for a field.

User Comments


put_field_xml

$rc = EPrints::Apache::REST::put_field_xml( $repository, $object, $rights_object, $field )

Returns XML for REST request to put a field.

User Comments


put_field_txt

$rc = EPrints::Apache::REST::put_field_txt( $repository, $object, $rights_object, $field )

Returns text for REST request to put a field.

User Comments


COPYRIGHT

© Copyright 2022 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

This file is part of EPrints 3.4 http://www.eprints.org/.

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.

User Comments