Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export link to this process the first time you export #3680

Merged
merged 7 commits into from
Jun 9, 2020

Conversation

matthias-ronge
Copy link
Collaborator

Fixes #3623, fixes #3625, fixes #3633

startExport(process.getParent());
}
} else {
process.setExported(exported);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A save to DB is missing here (and above in ExportDms).
Please adjust ExportMetsIT to test reload from DB.

@matthias-ronge
Copy link
Collaborator Author

Exporting the METS file to the home directory shouldn't set the flag at all, should it?

@matthias-ronge
Copy link
Collaborator Author

Exporting the METS file to the home directory shouldn't set the flag at all, should it?
@Kathrin-Huber ?

@@ -100,7 +100,6 @@ public void exportMetsTest() throws Exception {
fileService.createDirectory(ConfigCore.getUriParameter(ParameterCore.DIR_USERS), userDirectory);
}

Assert.assertFalse("exportedFlag of process should be false", process.isExported());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are just removing Asserts here?
Are they not working? Or should they be negated?
Both Asserts seems to be valid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't work anymore because I changed it, and I think it should be like this: The exported flag should only be set when exported to DMS, but not if an export to the home directory is carried out. The flag should not be set when exporting to the home directory, isn’t it? That's why I removed the tests for it, too.

}
ServiceManager.getProcessService().save(process);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to save the process, when the process flagis not changed again? I think this save is only neccessary when export failed and exportflag changed back. It is indeed only neccessary if the flag ACTUALLY changed. This also counts for first save. So if the process is already exported, no save is needed at all

@@ -69,14 +70,19 @@ public ExportDms(boolean exportImages) {
* Process object
*/
@Override
public void startExport(Process process) throws IOException, DAOException {
public void startExport(Process process) throws DAOException, DataException, IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DAOException and IOExceotion are never thrown in this method. So if you are already changing the signatur, remove not needed exceptions.

@Kathrin-Huber
Copy link
Contributor

Code does not compile :-(

@Kathrin-Huber Kathrin-Huber merged commit 9e50101 into kitodo:master Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants