Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Omeka-S-module-OaiPmhRepository
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CORDEL Yannick
Omeka-S-module-OaiPmhRepository
Commits
bef70a78
Commit
bef70a78
authored
7 years ago
by
Daniel Berthereau
Browse files
Options
Downloads
Patches
Plain Diff
Returned bad resumption token when needed.
parent
cc6f5f2d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Api/Adapter/OaiPmhRepositoryTokenAdapter.php
+6
-0
6 additions, 0 deletions
src/Api/Adapter/OaiPmhRepositoryTokenAdapter.php
src/OaiPmh/ResponseGenerator.php
+12
-8
12 additions, 8 deletions
src/OaiPmh/ResponseGenerator.php
with
18 additions
and
8 deletions
src/Api/Adapter/OaiPmhRepositoryTokenAdapter.php
+
6
−
0
View file @
bef70a78
...
@@ -75,6 +75,12 @@ class OaiPmhRepositoryTokenAdapter extends AbstractEntityAdapter
...
@@ -75,6 +75,12 @@ class OaiPmhRepositoryTokenAdapter extends AbstractEntityAdapter
public
function
buildQuery
(
QueryBuilder
$qb
,
array
$query
)
public
function
buildQuery
(
QueryBuilder
$qb
,
array
$query
)
{
{
if
(
isset
(
$query
[
'id'
]))
{
$qb
->
andWhere
(
$qb
->
expr
()
->
eq
(
$this
->
getEntityClass
()
.
'.id'
,
$this
->
createNamedParameter
(
$qb
,
$query
[
'id'
]))
);
}
if
(
isset
(
$query
[
'verb'
]))
{
if
(
isset
(
$query
[
'verb'
]))
{
$qb
->
andWhere
(
$qb
->
expr
()
->
eq
(
$qb
->
andWhere
(
$qb
->
expr
()
->
eq
(
$this
->
getEntityClass
()
.
'.verb'
,
$this
->
getEntityClass
()
.
'.verb'
,
...
...
This diff is collapsed.
Click to expand it.
src/OaiPmh/ResponseGenerator.php
+
12
−
8
View file @
bef70a78
...
@@ -571,7 +571,7 @@ class ResponseGenerator extends AbstractXmlGenerator
...
@@ -571,7 +571,7 @@ class ResponseGenerator extends AbstractXmlGenerator
*/
*/
private
function
resumeListResponse
(
$token
)
private
function
resumeListResponse
(
$token
)
{
{
$api
=
$this
->
serviceLocator
->
get
(
'
Omeka\ApiManager
'
);
$api
=
$this
->
serviceLocator
->
get
(
'
ControllerPluginManager'
)
->
get
(
'api
'
);
$expiredTokens
=
$api
->
search
(
'oaipmh_repository_tokens'
,
[
$expiredTokens
=
$api
->
search
(
'oaipmh_repository_tokens'
,
[
'expired'
=>
true
,
'expired'
=>
true
,
])
->
getContent
();
])
->
getContent
();
...
@@ -579,17 +579,21 @@ class ResponseGenerator extends AbstractXmlGenerator
...
@@ -579,17 +579,21 @@ class ResponseGenerator extends AbstractXmlGenerator
$api
->
delete
(
'oaipmh_repository_tokens'
,
$expiredToken
->
id
());
$api
->
delete
(
'oaipmh_repository_tokens'
,
$expiredToken
->
id
());
}
}
$tokenObject
=
$api
->
read
(
'oaipmh_repository_tokens'
,
$token
)
->
getContent
();
// TODO Purge tokens.
$tokenObject
=
$api
->
searchOne
(
'oaipmh_repository_tokens'
,
[
'id'
=>
$token
])
->
getContent
();
if
(
!
$tokenObject
||
(
$tokenObject
->
verb
()
!=
$this
->
query
[
'verb'
]))
{
if
(
!
$tokenObject
||
(
$tokenObject
->
verb
()
!=
$this
->
query
[
'verb'
]))
{
$this
->
throwError
(
self
::
OAI_ERR_BAD_RESUMPTION_TOKEN
);
$this
->
throwError
(
self
::
OAI_ERR_BAD_RESUMPTION_TOKEN
);
}
else
{
}
else
{
$this
->
listResponse
(
$tokenObject
->
verb
(),
$this
->
listResponse
(
$tokenObject
->
metadataPrefix
(),
$tokenObject
->
verb
(),
$tokenObject
->
cursor
(),
$tokenObject
->
metadataPrefix
(),
$tokenObject
->
set
(),
$tokenObject
->
cursor
(),
$tokenObject
->
from
(),
$tokenObject
->
set
(),
$tokenObject
->
until
());
$tokenObject
->
from
(),
$tokenObject
->
until
()
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment