use XML::LibXML;
use XML::LibXSLT;
use Unicode::Normalize;
+use Data::Dumper;
# ... and this has some handy common methods
use OpenILS::Application::AppUtils;
push(@ref_tags, '5' . substr($tagname, 1, 2));
}
}
- # We'll remove dupe record IDs that turn up due to 4xx and 5xx matches,
- # so leave some room for expansion
- if ($self->api_name =~ /\.refs\./) {
- $after_limit *= 2;
- $before_limit *= 2;
- }
-
my @list = ();
if ($page < 0) {
push @list, map { $_->{record} } @$after;
}
+ # If we're not pulling in see/see also references, just return the raw list
+ if ($self->api_name !~ /\.refs\./) {
+ return \@list;
+ }
+
+ # Remove dupe record IDs that turn up due to 4xx and 5xx matches
my @retlist = ();
my %seen;
- if ($page < 0) {
- foreach my $record (reverse @list) {
- next if exists $seen{$record};
- unshift @retlist, $record;
- $seen{$record} = 1;
- last if scalar(@retlist) == $page_size;
- }
- } else {
- foreach my $record (@list) {
- next if exists $seen{$record};
- push @retlist, $record;
- $seen{$record} = 1;
- last if scalar(@retlist) == $page_size;
- }
+ foreach my $record (@list) {
+ next if exists $seen{$record};
+ push @retlist, int($record);
+ $seen{$record} = 1;
}
return \@retlist;
push(@ref_tags, '5' . substr($tagname, 1, 2));
}
}
- # We'll remove dupe record IDs that turn up due to 4xx and 5xx matches,
- # so leave some room for expansion
- if ($self->api_name =~ /\.refs\./) {
- $ref_limit *= 2;
- }
my @list = ();
push @list, map { $_->{record} } @$after;
}
+ # If we're not pulling in see/see also references, just return the raw list
+ if ($self->api_name !~ /\.refs\./) {
+ return \@list;
+ }
+
+ # Remove dupe record IDs that turn up due to 4xx and 5xx matches
my @retlist = ();
my %seen;
- if ($page < 1) {
- foreach my $record (reverse @list) {
- next if exists $seen{$record};
- unshift @retlist, $record;
- $seen{$record} = 1;
- last if scalar(@retlist) == $limit;
- }
- } else {
- foreach my $record (@list) {
- next if exists $seen{$record};
- push @retlist, $record;
- $seen{$record} = 1;
- last if scalar(@retlist) == $limit;
- }
+ foreach my $record (@list) {
+ next if exists $seen{$record};
+ push @retlist, int($record);
+ $seen{$record} = 1;
}
return \@retlist;