<<

NAME

Koha::SharedContent - Set of methods for querying Mana KB server

DESCRIPTION

Package for accessing shared content via Mana KB. Methods here are intended to build and process queries for requesting from Mana KB server.

process_request

Koha::SharedContent::process_request($request);

Send a request to Mana KB server. URL is defined in koha-conf.xml in mana_config tag. $request parameter must be a HTTP::Request object. See build_request method.

increment_entity_value

Koha::SharedContent::increment_entity_value($entity_type, $mana_entity_id, $field);

Increment by 1 the field $field of a Mana entity. I.e, this is used to count the number of Koha instances using a specific entity.

send_entity

my $result = Koha::SharedContent::send_entity($language, $borrowernumber, $mana_entity_id, $entity_type);

Share a Koha entity (i.e subscription or report) to Mana KB.

comment_entity

my $result = Koha::SharedContent::comment_entity($resource_id, $resource_type, $comment);

Send a comment about a Mana entity.

prepare_entity_data

$data = prepare_entity_data($language, $borrowernumber, $mana_entity_id, $entity_type);

Prepare Koha entity data to be sent to Mana KB.

get_entity_by_id

my $entity = Koha::SharedContent::get_entity_by_id($entity_type, $mana_entity_id, [{usecomments => 1}]);

Retrieve a Mana entity to be imported into Koha. Add {usecomments => 1} to tell Mana to embed all user reviews.

search_entities

my $result = Koha::SharedContent::search_entities( $entity_type, $search_params ); my $entities = $result->{data};

Search entities on ManaKB.

build_request

$request = build_request($mana_method, [$param1, $param2, ...]);

Create a HTTP::Request object to be passed to process_request.

get_sharing_url

my $mana_url = get_sharing_url();

Get the Mana KB server URL set in koha config file.

<<