NAME

DAIA::Availability - Abstract base class of availability information

DESCRIPTION

Availability in DAIA is modeled as a combination of service and status. The availability status is a boolean value - either something is available or it is not. The service must be one of presentation, loan, interloan, and openaccess or a custom URI. Additionally you can specify some details about the availability.

In general availability is encoded as an object of either DAIA::Available (status true) or DAIA::Unavailable (status false). There are several equivalent ways to define a given service as available:

available( $service );
available( service => $service ),
DAIA::Available->new( $service );
DAIA::Available->new( service => $service );

availability( service => $service, status => 1 );
availability( { service => $service, status => 1 } );
availability( 1, service => $service );
availability( $service => 1 );

Likewise there are several equivalent ways to define a service as unavailable:

unavailable( $service );
unavailable( service => $service ),
DAIA::Unavailable->new( $service );
DAIA::Unavailable->new( service => $service );

availability( service => $service, status => 0 );
availability( { service => $service, status => 0 } );
availability( 0, service => $service );
availability( $service => 0 );

PROPERTIES

status

Either true DAIA::Available or false DAIA::Unavailable. Modifying the status changes the object type:

$a->status    # returns 0 or 1
$a->status(0) # make $a a DAIA::Unavailable object
$a->status(1) # make $a a DAIA::Available object
service

One of presentation, loan, interloan, and openaccess (highly recommended) or a custom URI (use with care). The predefined URLs http://purl.org/NET/DAIA/services/presentation, http://purl.org/NET/DAIA/services/loan, http://purl.org/NET/DAIA/services/interloan, and http://purl.org/NET/DAIA/services/openaccess are converted to their short form equivalent.

href

a link to perform, register or reserve the service

limitation

an array reference with limitations (DAIA::Limitation objects) of the availability

message

an array reference with DAIA::Messages about the specific availability

Depending on whether the availability's status is true (DAIA::Available) or false (DAIA::Unavailable), the properties delay, queue, and expected are also possible.

CONSTRUCTOR

A new availability can be created with the constructors of DAIA::Availability, DAIA::Available, and DAIA::Unavailable or with the shortcut functions available, unavailable, and availability which are exported in DAIA. You can also create a new availability object with the methods addAvailable, addUnavailable, and addAvailability of DAIA::Item.

METHODS

DAIA::Item provides the default methods of DAIA::Object, accessor methods for all of its properties and the following methods

addMessage ( $message | ... )

Add a specified or a new DAIA::Message.

addLimitation ( $limitation | ... )

Add a specified or a new DAIA::Limitation.

status ( [ 0 | 1 ] )

Get or set the availability status (true for DAIA::Available and false for DAIA::Unavailable). This method may change the type of the object:

$avail = available( 'loan' ); # now $avail isa DAIA::Available
$avail->status(0);            # now $avail isa DAIA::Unavailable

AUTHOR

Jakob Voss <jakob.voss@gbv.de>

LICENSE

Copyright (C) 2009 by Verbundzentrale Goettingen (VZG) and Jakob Voss

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.