-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODLD-516: Update API to support IllustrativeContent of the Work (#85)
* MODLD-516: Update API to support IllustrativeContent of the Work * MODLD-516: Review fixes * MODLD-516: Change mapper package
- Loading branch information
1 parent
2b1fdbe
commit 11df62d
Showing
8 changed files
with
149 additions
and
8 deletions.
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
...ain/java/org/folio/linked/data/mapper/dto/monograph/work/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.work.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.WorkResponse; | ||
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 WorkResponse work) { | ||
work.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