- 'from' and 'until' paramter in ReuqestController.php for OAI requests
- composer updates - configure solr host with protocol
This commit is contained in:
parent
f62f812a0d
commit
3125df767b
|
@ -350,6 +350,12 @@ class RequestController extends Controller
|
||||||
$this->proc->setParameter('', 'oai_error_message', 'The verb provided in the request is illegal.');
|
$this->proc->setParameter('', 'oai_error_message', 'The verb provided in the request is illegal.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function checkmydate($date)
|
||||||
|
{
|
||||||
|
$tempDate = explode('-', $date);
|
||||||
|
return checkdate($tempDate[1], $tempDate[2], $tempDate[0]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method for handling lists.
|
* Helper method for handling lists.
|
||||||
*
|
*
|
||||||
|
@ -424,6 +430,43 @@ class RequestController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (array_key_exists('from', $oaiRequest) && array_key_exists('until', $oaiRequest)) {
|
||||||
|
// $from = $oaiRequest['from'];
|
||||||
|
// $fromDate = \Illuminate\Support\Carbon::parse($from);
|
||||||
|
// $until = $oaiRequest['until'];
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (array_key_exists('until', $oaiRequest)) {
|
||||||
|
$until = $oaiRequest['until'];
|
||||||
|
if ($this->checkmydate($until) == true) {
|
||||||
|
$earliestPublicationDate = Dataset::earliestPublicationDate()->server_date_published;//->format('Y-m-d\TH:i:s\Z');
|
||||||
|
$untilDate = \Illuminate\Support\Carbon::parse($until);
|
||||||
|
if ($earliestPublicationDate->gt($untilDate)) {
|
||||||
|
throw new OaiModelException(
|
||||||
|
"Given until date is greater than 'earliestDatestamp'. The given values results in an empty list.",
|
||||||
|
OaiModelError::NORECORDSMATCH
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$finder->whereDate('server_date_published', '<=', date($until));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (array_key_exists('from', $oaiRequest)) {
|
||||||
|
$from = $oaiRequest['from'];
|
||||||
|
if ($this->checkmydate($from) == true) {
|
||||||
|
$now = new Carbon();
|
||||||
|
$fromDate = \Illuminate\Support\Carbon::parse($from);
|
||||||
|
if ($fromDate->gt($now)) {
|
||||||
|
throw new OaiModelException(
|
||||||
|
"Given from date is grater than now. The given values results in an empty list.",
|
||||||
|
OaiModelError::NORECORDSMATCH
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$finder->whereDate('server_date_published', '>=', date($from));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$totalIds = $finder->count();
|
$totalIds = $finder->count();
|
||||||
$reldocIds = $finder->orderBy('publish_id')->pluck('publish_id')->toArray();
|
$reldocIds = $finder->orderBy('publish_id')->pluck('publish_id')->toArray();
|
||||||
|
|
494
composer.lock
generated
494
composer.lock
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -18,7 +18,8 @@ export default {
|
||||||
// solr endpoint
|
// solr endpoint
|
||||||
// const host = 'http://voyagerdemo.com/';
|
// const host = 'http://voyagerdemo.com/';
|
||||||
//const host = 'https://www.tethys.at/';
|
//const host = 'https://www.tethys.at/';
|
||||||
const host = 'https://' + solrHost;
|
//const host = 'https://' + solrHost;
|
||||||
|
const host = solrHost;
|
||||||
const path = '/solr/' + solrCore + '/select?';
|
const path = '/solr/' + solrCore + '/select?';
|
||||||
var base = host + path;
|
var base = host + path;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user