-
Notifications
You must be signed in to change notification settings - Fork 1
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
MODLD-516: Update API to support IllustrativeContent of the Work #85
Merged
Changes from 1 commit
Commits
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 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
48 changes: 48 additions & 0 deletions
48
...java/org/folio/linked/data/mapper/dto/monograph/instance/sub/IllustrationsMapperUnit.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.folio.linked.data.mapper.dto.monograph.instance.sub; | ||
|
||
import static org.folio.ld.dictionary.ResourceTypeDictionary.CATEGORY; | ||
|
||
import org.folio.ld.dictionary.PredicateDictionary; | ||
import org.folio.linked.data.domain.dto.Category; | ||
import org.folio.linked.data.domain.dto.CategoryResponse; | ||
import org.folio.linked.data.domain.dto.InstanceResponse; | ||
import org.folio.linked.data.mapper.dto.common.CoreMapper; | ||
import org.folio.linked.data.mapper.dto.common.MapperUnit; | ||
import org.folio.linked.data.mapper.dto.monograph.common.CategoryMapperUnit; | ||
import org.folio.linked.data.service.resource.hash.HashService; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@MapperUnit(type = CATEGORY, predicate = PredicateDictionary.ILLUSTRATIONS, requestDto = Category.class) | ||
public class IllustrationsMapperUnit extends CategoryMapperUnit { | ||
|
||
private static final String LABEL = "Illustrative Content"; | ||
private static final String LINK = "http://id.loc.gov/vocabulary/millus"; | ||
private static final String LINK_PREFIX = "http://id.loc.gov/vocabulary/millus/"; | ||
|
||
public IllustrationsMapperUnit(HashService hashService, CoreMapper coreMapper) { | ||
super(hashService, coreMapper); | ||
} | ||
|
||
@Override | ||
protected void addToParent(CategoryResponse category, Object parentDto) { | ||
if (parentDto instanceof InstanceResponse instance) { | ||
instance.addIllustrationsItem(category); | ||
} | ||
} | ||
|
||
@Override | ||
protected String getCategorySetLabel() { | ||
return LABEL; | ||
} | ||
|
||
@Override | ||
protected String getCategorySetLink() { | ||
return LINK; | ||
} | ||
|
||
@Override | ||
public String getLinkPrefix() { | ||
return LINK_PREFIX; | ||
} | ||
} |
This file contains 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 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 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 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 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 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.
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.
Illustrations is an outgoing edge of Work.
So, this change should be made in WorkMapperUnit.
Similarly, Changes made in "InstanceRequest.json" and "InstanceResponse.json" has to be moved to "WorkRequest.json" and "WorkResponse.json"
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.
Fixed.