# This is the client class, used for connecting to open-ils.storage
use OpenSRF::AppSession;
-# This is an extention of Error.pm that supplies some error types to throw
+# This is an extension of Error.pm that supplies some error types to throw
use OpenSRF::EX qw(:try);
# This is a helper class for querying the OpenSRF Settings application ...
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target title', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target author', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target subject', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target topical subject', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target series', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
argc => 1,
signature =>
{ desc => <<" DESC",
-Returns a list of the requested org-scoped record ids held
+Returns a list of the requested org-scoped record IDs held
DESC
params =>
[
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target title', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target author', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target subject', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target topical subject', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_browse',
+ api_name => 'open-ils.supercat.authority.title.refs.browse',
+ tag => '130', subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target title', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_browse',
+ api_name => 'open-ils.supercat.authority.author.refs.browse',
+ tag => [qw/100 110 111/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target author', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_browse',
+ api_name => 'open-ils.supercat.authority.subject.refs.browse',
+ tag => [qw/148 150 151 155/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target subject', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_browse',
+ api_name => 'open-ils.supercat.authority.topic.refs.browse',
+ tag => '150', subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target topical subject', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
my $_storage = OpenSRF::AppSession->create( 'open-ils.cstore' );
+ # .refs variant includes 4xx and 5xx variants for see / see also
+ if ($self->api_name =~ /\.refs\./) {
+ my @ref_tags;
+ foreach my $tagname (@$tag) {
+ push(@ref_tags, '4' . substr($tagname, 1, 2));
+ push(@ref_tags, '5' . substr($tagname, 1, 2));
+ }
+ push(@$tag, @ref_tags);
+ }
+
my @list = ();
if ($page <= 0) {
argc => 1,
signature =>
{ desc => <<" DESC",
-Returns a list of the requested authority record ids held
+Returns a list of the requested authority record IDs held
DESC
params =>
[
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target title', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target author', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target subject', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target topical subject', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested org-scoped record ids held",
+ { desc => "Returns a list of the requested org-scoped record IDs held",
params =>
[ { name => 'value', desc => 'The target series', type => 'string' },
{ name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' },
{ name => 'statuses', desc => 'Array of statuses to filter copies by, optional and can be undef.', type => 'array' },
{ name => 'locations', desc => 'Array of copy locations to filter copies by, optional and can be undef.', type => 'array' }, ],
'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
argc => 1,
signature =>
{ desc => <<" DESC",
-Returns a list of the requested org-scoped record ids held
+Returns a list of the requested org-scoped record IDs held
DESC
params =>
[
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target title', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target author', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target subject', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
api_level => 1,
argc => 1,
signature =>
- { desc => "Returns a list of the requested authority record ids held",
+ { desc => "Returns a list of the requested authority record IDs held",
params =>
[ { name => 'value', desc => 'The target topical subject', type => 'string' },
{ name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
- { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_startwith',
+ api_name => 'open-ils.supercat.authority.title.refs.startwith',
+ tag => '130', subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target title', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_startwith',
+ api_name => 'open-ils.supercat.authority.author.refs.startwith',
+ tag => [qw/100 110 111/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target author', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_startwith',
+ api_name => 'open-ils.supercat.authority.subject.refs.startwith',
+ tag => [qw/148 150 151 155/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target subject', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_authority_startwith',
+ api_name => 'open-ils.supercat.authority.topic.refs.startwith',
+ tag => '150', subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested authority record IDs held, including see (4xx) and see also (5xx) references",
+ params =>
+ [ { name => 'value', desc => 'The target topical subject', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieved, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
'return' => { desc => 'Authority Record IDs that are near the target string', type => 'array' }
}
);
my $offset = $limit * abs($page);
my $_storage = OpenSRF::AppSession->create( 'open-ils.cstore' );
+ # .refs variant includes 4xx and 5xx variants for see / see also
+ if ($self->api_name =~ /\.refs\./) {
+ my @ref_tags;
+ foreach my $tagname (@$tag) {
+ push(@ref_tags, '4' . substr($tagname, 1, 2));
+ push(@ref_tags, '5' . substr($tagname, 1, 2));
+ }
+ push(@$tag, @ref_tags);
+ }
+
my @list = ();
if ($page < 0) {
argc => 1,
signature =>
{ desc => <<" DESC",
-Returns a list of the requested authority record ids held
+Returns a list of the requested authority record IDs held
DESC
params =>
[