Add ISBN to SIP CH field user/jeff/untested_poc_sip_item_isbn
authorJeff Godin <jgodin@tadl.org>
Thu, 19 Jun 2014 16:27:38 +0000 (12:27 -0400)
committerJeff Godin <jgodin@tadl.org>
Thu, 19 Jun 2014 16:27:38 +0000 (12:27 -0400)
Untested proof of concept sparked by a conversation on IRC.

I don't know if the ISBN even belongs in CH or if it should be
placed elsewhere.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/src/perlmods/lib/OpenILS/SIP/Item.pm

index a2523e1..2ca27fd 100644 (file)
@@ -320,6 +320,15 @@ sub title_id {
     return OpenILS::SIP::clean_text($t);
 }
 
+# XXX: Untested proof of concept
+# I make no claims as to if CH / FID_ITEM_PROPS is the proper place to include an ISBN
+# Using tagging logic from the draft SIP3 standard's ID field here
+sub sip_item_properties {
+    my $self = shift;
+    my $isbn = ($self->{mods}) ? $self->{mods}->isbn : $self->{copy}->dummy_isbn;
+    return OpenILS::SIP::clean_text('ISBN:' . $isbn);
+}
+
 sub permanent_location {
     my $self = shift;
     return OpenILS::SIP::clean_text($self->{copy}->circ_lib->shortname);