Change resumption token from attribute to value

This commit is contained in:
Erik Sommer 2018-08-22 09:57:43 +02:00
parent 62ab13d81b
commit 60842bb48c
No known key found for this signature in database
GPG Key ID: 1DD11979C0692133
1 changed files with 7 additions and 2 deletions

View File

@ -1097,7 +1097,6 @@ class tx_dlf_oai extends tx_dlf_plugin {
* @return DOMElement
*/
private function generateResumptionTokenForDocumentListSet($documentListSet) {
$resumptionToken = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'resumptionToken');
if ($documentListSet->count() != 0) {
@ -1114,10 +1113,16 @@ class tx_dlf_oai extends tx_dlf_plugin {
);
if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
$resumptionToken->setAttribute('resumptionToken', htmlspecialchars($token, ENT_NOQUOTES, 'UTF-8'));
$resumptionToken = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'resumptionToken', htmlspecialchars($token, ENT_NOQUOTES, 'UTF-8'));
} else {
$this->devLog('[tx_dlf_oai->verb'.$this->piVars['verb'].'()] Could not create resumption token', SYSLOG_SEVERITY_ERROR);
}
} else {
// Result set complete. We don't need a token.
$resumptionToken = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'resumptionToken');
}
$resumptionToken->setAttribute('cursor', intval($documentListSet->metadata['completeListSize']) - count($documentListSet));