|
Lines 44-57
my $usage = << 'ENDUSAGE';
Link Here
|
| 44 |
|
44 |
|
| 45 |
This script starts an OAI Harvest |
45 |
This script starts an OAI Harvest |
| 46 |
|
46 |
|
| 47 |
This script has the following parameters : |
47 |
This script has the following parameters: |
| 48 |
-h --help: this message |
48 |
-h --help: this message |
| 49 |
-v --verbose |
49 |
-v --verbose |
| 50 |
-r --repository: id of the OAI repository |
50 |
-r --repository: id of the OAI repository |
| 51 |
-d --days: number of days to harvest from (optional) |
51 |
-d --days: number of days to harvest from (optional) |
| 52 |
-l --list: list the OAI repositories |
52 |
-l --list: list the OAI repositories |
| 53 |
-f --force: force harvesting (ignore records datestamps) |
53 |
-f --force: force harvesting (ignore records datestamps) |
| 54 |
|
|
|
| 55 |
ENDUSAGE |
54 |
ENDUSAGE |
| 56 |
|
55 |
|
| 57 |
if ($help) { |
56 |
if ($help) { |
|
Lines 60-69
if ($help) {
Link Here
|
| 60 |
} |
59 |
} |
| 61 |
|
60 |
|
| 62 |
if ($list) { |
61 |
if ($list) { |
| 63 |
my $servers = Koha::OAIServers->search( {}, { order_by => { -asc => 'id' } } )->unblessed; |
62 |
my $servers = Koha::OAIServers->search( {}, { order_by => { -asc => 'oai_server_id' } } )->unblessed; |
| 64 |
print "The following repositories are available: \n\n"; |
63 |
print "The following repositories are available: \n\n"; |
| 65 |
foreach my $server (@$servers) { |
64 |
foreach my $server (@$servers) { |
| 66 |
print $server->{'id'} . ": " |
65 |
print $server->{'oai_server_id'} . ": " |
| 67 |
. $server->{'servername'} |
66 |
. $server->{'servername'} |
| 68 |
. ", endpoint: " |
67 |
. ", endpoint: " |
| 69 |
. $server->{'endpoint'} |
68 |
. $server->{'endpoint'} |
|
Lines 79-84
if ($list) {
Link Here
|
| 79 |
if ( !$id ) { |
78 |
if ( !$id ) { |
| 80 |
print "The repository parameter is mandatory.\n"; |
79 |
print "The repository parameter is mandatory.\n"; |
| 81 |
print $usage . "\n"; |
80 |
print $usage . "\n"; |
|
|
81 |
exit; |
| 82 |
} |
82 |
} |
| 83 |
|
83 |
|
| 84 |
my $server = Koha::OAIServers->find($id); |
84 |
my $server = Koha::OAIServers->find($id); |
| 85 |
- |
|
|