-
Notifications
You must be signed in to change notification settings - Fork 13
BXC-5684 add new param for run enhancement requests #2161
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
Open
sharonluong
wants to merge
9
commits into
main
Choose a base branch
from
BXC-5684-regenerate-description
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
13cc34d
BXC-5684 add new param for run enhancement requests
sharonluong 05fab8e
BXC-5684 update tests
sharonluong 498dbea
BXC-5684 update enhancement router IT
sharonluong 6710175
BXC-5684 refine header setting
sharonluong 025d62f
BXC-5684 send in enhancements as a list
sharonluong a5cb73d
BXC-5684 update to fix tests and streamline constants
sharonluong ac12ba2
BXC-5684 fix tests
sharonluong ed79646
BXC-5684 update code
sharonluong d89fce1
BXC-5684 fix workflow
sharonluong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,10 @@ | |
|
|
||
| import static edu.unc.lib.boxc.model.api.xml.JDOMNamespaceUtil.CDR_MESSAGE_NS; | ||
| import static edu.unc.lib.boxc.operations.jms.JMSMessageUtil.CDRActions.RUN_ENHANCEMENTS; | ||
| import static edu.unc.lib.boxc.operations.jms.RunEnhancementsMessageHelpers.DEFAULT_ENHANCEMENTS_STRING; | ||
| import static edu.unc.lib.boxc.operations.jms.RunEnhancementsMessageHelpers.ENHANCEMENT_LIST; | ||
| import static edu.unc.lib.boxc.operations.jms.RunEnhancementsMessageHelpers.MACHINE_GEN_DESCRIPTION; | ||
| import static edu.unc.lib.boxc.services.camel.util.CdrFcrepoHeaders.CdrEnhancementSet; | ||
| import static org.fcrepo.camel.FcrepoHeaders.FCREPO_URI; | ||
|
|
||
| import org.apache.camel.Exchange; | ||
|
|
@@ -20,14 +24,15 @@ | |
| import edu.unc.lib.boxc.model.fcrepo.ids.PIDs; | ||
| import edu.unc.lib.boxc.services.camel.util.MessageUtil; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * Sets headers related to identifying binary objects to run enhancement operations on | ||
| * | ||
| * @author lfarrell | ||
| */ | ||
| public class BinaryEnhancementProcessor implements Processor { | ||
| private static final Logger log = LoggerFactory.getLogger(BinaryEnhancementProcessor.class); | ||
|
|
||
| private RepositoryObjectLoader repoObjLoader; | ||
|
|
||
| @Override | ||
|
|
@@ -61,6 +66,15 @@ public void process(final Exchange exchange) throws Exception { | |
| } else { | ||
| in.setHeader("force", "false"); | ||
| } | ||
|
|
||
| Element enhancementsList = enhancementsEl.getChild(ENHANCEMENT_LIST, CDR_MESSAGE_NS); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In order to allow us to catch empty enhancementLists, not just the absence of the XML element, we could directly use |
||
| if (enhancementsList == null) { | ||
| in.setHeader(CdrEnhancementSet, DEFAULT_ENHANCEMENTS_STRING); | ||
| } else { | ||
| var enhancements = enhancementsList.getTextTrim(); | ||
| in.setHeader(CdrEnhancementSet, enhancements); | ||
| } | ||
|
|
||
| } catch (ObjectTypeMismatchException e) { | ||
| log.warn("{} is not a repository object. No enhancement headers added", objPid.getRepositoryPath()); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like quilty is mad because there is no coverage of this method. I know there's no existing test, but since this is one of the central changes in this PR I'd suggest adding one, even if it just targets your modifications. It looks like it should be very testable