Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
thirdPartyArchiving
Commits
8d8cc51e
Commit
8d8cc51e
authored
Oct 27, 2017
by
Cyril Vazquez
Browse files
Restitution batch processing
parent
f1f5a86e
Changes
2
Hide whitespace changes
Inline
Side-by-side
bundle/medona/Controller/ArchiveRestitutionRequest.php
View file @
8d8cc51e
...
...
@@ -322,6 +322,30 @@ class ArchiveRestitutionRequest extends abstractMessage
return
$replyMessage
;
}
/**
* Process the messages
*
* @return medona/message $message
*/
public
function
processBatch
()
{
$results
=
array
();
$messages
=
$this
->
sdoFactory
->
find
(
"medona/message"
,
"status='accepted' AND type='ArchiveRestitutionRequest' AND active=true"
);
foreach
(
$messages
as
$message
)
{
$this
->
changeStatus
(
$message
->
messageId
,
"processing"
);
$this
->
loadData
(
$message
);
try
{
$results
[(
string
)
$message
->
messageId
]
=
$this
->
process
(
$message
);
}
catch
(
\
Exception
$e
)
{
$results
[(
string
)
$message
->
messageId
]
=
$e
;
}
}
return
$results
;
}
/**
* Validate message against schema and rules
* @param medona/message $message
...
...
bundle/medona/archiveRestitutionInterface.php
View file @
8d8cc51e
...
...
@@ -151,6 +151,14 @@ interface archiveRestitutionInterface extends messageInterface
*/
public
function
updateProcess_message_
();
/**
* Processes messages
*
* @action medona/ArchiveRestitutionRequest/processBatch
*/
public
function
updateProcessBatch
();
/**
* Flag archives for restitution
* @param array $archiveIds Array of archive identifier
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment