[open-ils-commits] r16090 - in trunk/Open-ILS/src/perlmods/OpenILS/Application: . Search (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 1 15:09:36 EDT 2010
Author: erickson
Date: 2010-04-01 15:09:32 -0400 (Thu, 01 Apr 2010)
New Revision: 16090
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Log:
Patch from Joe Atzberger: More method reg docs in Biblio.pm and Actor
Signed-off-by: Joe Atzberger <atz at esilibrary.com>
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2010-04-01 18:48:06 UTC (rev 16089)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2010-04-01 19:09:32 UTC (rev 16090)
@@ -1485,17 +1485,22 @@
}
-
-
__PACKAGE__->register_method(
- method => "user_fines_summary",
- api_name => "open-ils.actor.user.fines.summary",
+ method => "user_fines_summary",
+ api_name => "open-ils.actor.user.fines.summary",
authoritative => 1,
- notes => <<" NOTES");
- Returns a short summary of the users total open fines, excluding voided fines
- Params are login_session, user_id
- Returns a 'mous' object.
- NOTES
+ signature => {
+ desc => 'Returns a short summary of the users total open fines, ' .
+ 'excluding voided fines Params are login_session, user_id' ,
+ params => [
+ {desc => 'Authentication token', type => 'string'},
+ {desc => 'User ID', type => 'string'} # number?
+ ],
+ return => {
+ desc => "a 'mous' object, event on error",
+ }
+ }
+);
sub user_fines_summary {
my( $self, $client, $auth, $user_id ) = @_;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-04-01 18:48:06 UTC (rev 16089)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-04-01 19:09:32 UTC (rev 16090)
@@ -209,8 +209,19 @@
__PACKAGE__->register_method(
method => "biblio_search_tcn",
api_name => "open-ils.search.biblio.tcn",
- argc => 3,
- note => "Retrieve a record by TCN",
+ argc => 1,
+ signature => {
+ desc => "Retrieve related record ID(s) given a TCN",
+ params => [
+ { desc => 'TCN', type => 'string' },
+ { desc => 'Flag indicating to include deleted records', type => 'string' }
+ ],
+ return => {
+ desc => 'Results object like: { "count": $i, "ids": [...] }',
+ type => 'object'
+ }
+ }
+
);
sub biblio_search_tcn {
@@ -320,14 +331,24 @@
__PACKAGE__->register_method(
- method => "copy_retrieve",
- api_name => "open-ils.search.asset.copy.retrieve",
+ method => "copy_retrieve",
+ api_name => "open-ils.search.asset.copy.retrieve",
+ argc => 1,
+ signature => {
+ desc => 'Retrieve a copy object based on the Copy ID',
+ params => [
+ { desc => 'Copy ID', type => 'number'}
+ ],
+ return => {
+ desc => 'Copy object, event on error'
+ }
+ }
);
+
sub copy_retrieve {
my( $self, $client, $cid ) = @_;
my( $copy, $evt ) = $U->fetch_copy($cid);
- return $evt if $evt;
- return $copy;
+ return $evt || $copy;
}
__PACKAGE__->register_method(
@@ -367,8 +388,7 @@
sub fleshed_copy_retrieve {
my( $self, $client, $id ) = @_;
my( $c, $e) = $U->fetch_fleshed_copy($id);
- return $e if $e;
- return $c;
+ return $e || $c;
}
@@ -750,11 +770,11 @@
$$searchhash{searches}{subject}{term} = $$args{search}{subject} if $$args{search}{subject};
$$searchhash{searches}{keyword}{term} = $$args{search}{keyword} if $$args{search}{keyword};
- $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{tcn} if $$args{search}{tcn};
- $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{isbn} if $$args{search}{isbn};
- $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{issn} if $$args{search}{issn};
+ $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{tcn} if $$args{search}{tcn};
+ $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{isbn} if $$args{search}{isbn};
+ $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{issn} if $$args{search}{issn};
$$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{publisher} if $$args{search}{publisher};
- $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{pubdate} if $$args{search}{pubdate};
+ $$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{pubdate} if $$args{search}{pubdate};
$$searchhash{searches}{keyword}{term} .= join ' ', $$searchhash{searches}{keyword}{term}, $$args{search}{item_type} if $$args{search}{item_type};
my $list = the_quest_for_knowledge( $self, $client, $searchhash );
@@ -1686,19 +1706,18 @@
}
+foreach (qw/open-ils.search.biblio.marc
+ open-ils.search.biblio.marc.staff/)
+{
__PACKAGE__->register_method(
- method => "marc_search",
- api_name => "open-ils.search.biblio.marc.staff",
-);
-
-__PACKAGE__->register_method(
- method => "marc_search",
- api_name => "open-ils.search.biblio.marc",
+ method => "marc_search",
+ api_name => $_,
signature => {
- desc => 'Fetch biblio IDs based on MARC record criteria',
+ desc => 'Fetch biblio IDs based on MARC record criteria. '
+ . 'As usual, the .staff version of the search includes otherwise hidden records',
params => [
{
- desc => 'Search hash with possible elements: searches, limit, offset, sort, sort_dir. (required). ' .
+ desc => 'Search hash (required) with possible elements: searches, limit, offset, sort, sort_dir. ' .
'See perldoc ' . __PACKAGE__ . ' for more detail.',
type => 'object'
},
@@ -1711,6 +1730,7 @@
}
}
);
+}
=head3 open-ils.search.biblio.marc (arghash, limit, offset)
@@ -1875,8 +1895,18 @@
__PACKAGE__->register_method(
- method => "fetch_mods_by_copy",
- api_name => "open-ils.search.biblio.mods_from_copy",
+ method => "fetch_mods_by_copy",
+ api_name => "open-ils.search.biblio.mods_from_copy",
+ argc => 1,
+ signature => {
+ desc => 'Retrieve MODS record given an attached copy ID',
+ params => [
+ { desc => 'Copy ID', type => 'number' }
+ ],
+ returns => {
+ desc => 'MODS record, event on error or uncataloged item'
+ }
+ }
);
sub fetch_mods_by_copy {
@@ -1888,7 +1918,6 @@
}
-
# -------------------------------------------------------------------------------------
__PACKAGE__->register_method(
More information about the open-ils-commits
mailing list