{ namespace_uri => 'http://www.loc.gov/MARC21/slim',
docs => 'http://www.loc.gov/marcxml/',
schema_location => 'http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd',
- }
+ },
+ marc21 => { docs => 'http://www.loc.gov/marc/' }
}
);
{ namespace_uri => 'http://www.loc.gov/MARC21/slim',
docs => 'http://www.loc.gov/marcxml/',
schema_location => 'http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd',
- }
- }
+ },
+ marc21 => { docs => 'http://www.loc.gov/marc/' }
+ },
);
for my $type ( keys %record_xslt ) {
$feed->link( unapi => $base) if ($flesh_feed);
print "Content-type: ". $feed->type ."; charset=utf-8\n\n";
- print $U->entityize($feed->toString) . "\n";
+ print $feed->toString . "\n";
return Apache2::Const::OK;
}
$feed->link( unapi => $base) if ($flesh_feed);
print "Content-type: ". $feed->type ."; charset=utf-8\n\n";
- print $U->entityize($feed->toString) . "\n";
+ print $feed->toString . "\n";
return Apache2::Const::OK;
}
print "Content-type: ". $feed->type ."; charset=utf-8\n\n";
- print $U->entityize($feed->toString) . "\n";
+ print $feed->toString . "\n";
return Apache2::Const::OK;
}
print "Content-type: ". $feed->type ."; charset=utf-8\n\n";
- print $U->entityize($feed->toString) . "\n";
+ print $feed->toString . "\n";
return Apache2::Const::OK;
}
template="$base/1.1/$lib/mods3/$class/?searchTerms={searchTerms}&startPage={startPage?}&startIndex={startIndex?}&count={count?}&searchLang={language?}"/>
<Url type="application/x-mods+xml"
template="$base/1.1/$lib/mods/$class/?searchTerms={searchTerms}&startPage={startPage?}&startIndex={startIndex?}&count={count?}&searchLang={language?}"/>
+ <Url type="application/octet-stream"
+ template="$base/1.1/$lib/marc21/$class/?searchTerms={searchTerms}&startPage={startPage?}&startIndex={startIndex?}&count={count?}&searchLang={language?}"/>
<Url type="application/x-marcxml+xml"
template="$base/1.1/$lib/marcxml/$class/?searchTerms={searchTerms}&startPage={startPage?}&startIndex={startIndex?}&count={count?}&searchLang={language?}"/>
<Url type="text/html"
$feed->unapi($unapi) if ($flesh);
$type = 'atom' if ($type eq 'html');
- $type = 'marcxml' if (($type eq 'htmlholdings') || ($type eq 'marctxt') || ($type eq 'ris'));
+ $type = 'marcxml' if
+ $type eq 'htmlholdings' or
+ $type eq 'marctxt' or
+ $type eq 'ris' or
+ $type eq 'marc21'; # kludgy since it isn't an XML format, but needed
#$records = $supercat->request( "open-ils.supercat.record.object.retrieve", $records )->gather(1);
package OpenILS::WWW::SuperCat::Feed::ris::item;
use base 'OpenILS::WWW::SuperCat::Feed::marcxml::item';
+package OpenILS::WWW::SuperCat::Feed::marc21;
+use base 'OpenILS::WWW::SuperCat::Feed::marcxml';
+use MARC::File::XML ( BinaryEncoding => 'utf8', RecordFormat => 'USMARC' );
+
+sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new;
+ $self->{type} = 'application/octet-stream';
+ return $self;
+}
+
+
+sub toString {
+ my $self = shift;
+
+ $self->{doc} = '';
+ for my $item ( $self->items ) {
+ my $r = MARC::Record->new_from_xml( $item->{doc}->toString(1) );
+ $self->{doc} .= $r->as_usmarc;
+ }
+
+ utf8::encode($self->{doc});
+ return $self->{doc};
+}
+
+package OpenILS::WWW::SuperCat::Feed::marc21::item;
+use base 'OpenILS::WWW::SuperCat::Feed::marcxml::item';
+
1;