-
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-308: Enhance GET, PUT and POST APIs to support Dewey Decimal Cl…
…… (#261)
- Loading branch information
1 parent
393457f
commit 3e9162d
Showing
8 changed files
with
202 additions
and
62 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...n/java/org/folio/linked/data/mapper/dto/monograph/work/sub/AssigningSourceMapperUnit.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,31 @@ | ||
package org.folio.linked.data.mapper.dto.monograph.work.sub; | ||
|
||
import static org.folio.ld.dictionary.PredicateDictionary.ASSIGNING_SOURCE; | ||
import static org.folio.ld.dictionary.ResourceTypeDictionary.ORGANIZATION; | ||
|
||
import java.util.Set; | ||
import org.folio.linked.data.domain.dto.Classification; | ||
import org.folio.linked.data.domain.dto.Reference; | ||
import org.folio.linked.data.mapper.dto.common.MapperUnit; | ||
import org.folio.linked.data.repo.ResourceRepository; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@MapperUnit(type = ORGANIZATION, predicate = ASSIGNING_SOURCE, dtoClass = Reference.class) | ||
public class AssigningSourceMapperUnit extends ReferenceMapperUnit { | ||
|
||
private static final Set<Class<?>> SUPPORTED_PARENTS = Set.of(Classification.class); | ||
|
||
public AssigningSourceMapperUnit(ResourceRepository resourceRepository) { | ||
super((assigningSource, destination) -> { | ||
if (destination instanceof Classification deweyDecimalClassification) { | ||
deweyDecimalClassification.addAssigningSourceReferenceItem(assigningSource); | ||
} | ||
}, resourceRepository); | ||
} | ||
|
||
@Override | ||
public Set<Class<?>> supportedParents() { | ||
return SUPPORTED_PARENTS; | ||
} | ||
} |
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
56 changes: 56 additions & 0 deletions
56
src/main/resources/swagger.api/schema/resource/Classification.json
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,56 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Dewey decimal classification object", | ||
"allOf": [ | ||
{ | ||
"$ref": "Topper.json" | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"code": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"x-json-property": "http://bibfra.me/vocab/marc/code" | ||
}, | ||
"source": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"x-json-property": "http://bibfra.me/vocab/marc/source" | ||
}, | ||
"itemNumber": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"x-json-property": "http://bibfra.me/vocab/marc/itemNumber" | ||
}, | ||
"editionNumber": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"x-json-property": "http://bibfra.me/vocab/marc/editionNumber" | ||
}, | ||
"edition": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"x-json-property": "http://bibfra.me/vocab/marc/edition" | ||
}, | ||
"_assigningSourceReference": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "Reference.json" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
28 changes: 0 additions & 28 deletions
28
src/main/resources/swagger.api/schema/resource/DeweyDecimalClassification.json
This file was deleted.
Oops, something went wrong.
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.