export const HOLDINGS_XPATH =
'/holdings:holdings/holdings:counts/holdings:count';
+interface EResourceUrl {
+ href: string;
+ note: string;
+ label: string;
+}
export class BibRecordSummary {
id: number; // == record.id() for convenience
bibCallNumber: string;
net: NetService;
displayHighlights: {[name: string]: string | string[]} = {};
+ eResourceUrls: EResourceUrl[] = [];
constructor(record: IdlObject, orgId: number, orgDepth?: number) {
this.id = Number(record.id());
summary.attributes = bibSummary.attributes;
summary.holdCount = bibSummary.hold_count;
summary.holdingsSummary = bibSummary.copy_counts;
+ summary.eResourceUrls = bibSummary.urls;
return summary;
}));
}
</div>
</li>
</ng-container>
+ <ng-container *ngIf="expand && summary.eResourceUrls.length">
+ <li class="list-group-item" *ngFor="let url of summary.eResourceUrls">
+ <div class="d-flex">
+ <div class="flex-1 font-weight-bold" i18n>
+ Electronic Resource:
+ </div>
+ <div class="flex-5">
+ <a href="{{url.href}}">{{url.label}}</a>
+ </div>
+ <div class="flex-4">{{url.note}}</div>
+ </div>
+ </li>
+ </ng-container>
</ul>
</div>
</div><!-- col -->
package OpenILS::Application::AppUtils;
use strict; use warnings;
+use MARC::Record;
+use MARC::File::XML (BinaryEncoding => 'utf8', RecordFormat => 'USMARC');
use OpenILS::Application;
use base qw/OpenILS::Application/;
use OpenSRF::Utils::Cache;
# Pile of utilty methods used accross applications.
# ---------------------------------------------------------------------------
my $cache_client = "OpenSRF::Utils::Cache";
-
+my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
# ---------------------------------------------------------------------------
# on sucess, returns the created session, on failure throws ERROR exception
}
+# generate a MARC XML document from a MARC XML string
+sub marc_xml_to_doc {
+ my ($class, $xml) = @_;
+ my $marc_doc = XML::LibXML->new->parse_string($xml);
+ $marc_doc->documentElement->setNamespace($MARC_NAMESPACE, 'marc', 1);
+ $marc_doc->documentElement->setNamespace($MARC_NAMESPACE);
+ return $marc_doc;
+}
+
+
+
1;
use OpenILS::Const qw/:const/;
use OpenILS::Event;
my $U = 'OpenILS::Application::AppUtils';
-my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
-
# generate a MARC XML document from a MARC XML string
sub marc_xml_to_doc {
my $xml = shift;
- my $marc_doc = XML::LibXML->new->parse_string($xml);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE, 'marc', 1);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE);
- return $marc_doc;
+ return $U->marc_xml_to_doc($xml);
}
-
__PACKAGE__->register_method(
method => 'import_authority_record',
api_name => 'open-ils.cat.authority.record.import',
my $marc_doc = $U->marc_xml_to_doc($bib->marc);
+ # Logic copied from TPAC misc_utils.tts
+ my @urls;
+
for my $node ($marc_doc->findnodes(
'//*[@tag="856" and @ind1="4" and (@ind2="0" or @ind2="1")]')) {