Feature-level design for data-export Mapping Profiles
Technical solution
- Retrieving list of field names. Create a specific endpoint in mod-data-export to retrieve a list of properties to display mapping profile transformations. JSON schemas of record types should be requested from mod-inventory-storage module to get a list of record fields through JSON schema API. Necessary schemes: holdingsrecords.json, instance.json, item.json. To retrieve fields that are represented by keys (settings fields) it's required to send separate requests. For example, all Identifiers values can be retrieved by GET /identifier-types request.
- Create a new set of entities for mapping profiles and appropriate CRUD endpoints.
- Verify mapping profile reference to existing job execution profile when delete or update the mapping profile. If reference exists then deletion or updating should not be performed.
- The mapping profile will be associated with the export job through the job profile. Each job profile can be associated with one mapping profile; each export job can be associated with one job profile. At the same time, one mapping profile can be associated with multiple job profiles.
- Users should be able to assign mapping profile to job profile before the start of the export flow.
- Retrieve specific records from mod-inventory module base on mapping profile record types (Instance, Holding Items).
- To initialize and execute MappingProcessor specific MappingProfileReader and MappingProfileRule should be implemented and prepared base on the list of MappingField from MappingProfile. MappingFiled.path field value should be used to read the field value of retrieved inventory records. MappingFiled.transformation should be parsed to set values of marc field tag, subfield and indicator.
- Specific Writer should initialized base on mapping profile output format to use it with MappingProcessor (JsonRecordWriter, MarcRecordWriter or XmlRecordWriter).
- If mapping profile is enabled during export flow then default JSON rules will not be used for the mapping process and mapping profile rules will override the default ones using separate MappingProfileReader. Otherwise, default JSON rules and default JPathSyntaxEntityReader will be used for mapping.
Q2 release functionality limitations
- Mapping profile transformation options are not supported for fields of Instance type
- In case if Instance fields are enabled for a certain mapping profile then only default rules form defaultRules.json file are used for generating MARC bib record with Instance fields.
- Mapping profile transformation options are supported only for fields of Holdings and Item fields
- List of supported Holdings fields:
- Permanent location
- Temporary location
- Electronic access
- Call number (with prefix and suffix)
- List of supported Item fields:
- Effective call number
- Effective location
- Electronic access
- Multiple subfield transformation values are not supported. For example, like this: 900 $a $b $c
- Editing of mapping profiles is not supported
Reusing of the functionality by other teams
Other teams will be able to reuse mapping profiles functionality partially. Mapping profiles endpoints of mod-data-export can be used to create and receive mapping profile instances by other modules. At the same time, the functionality of mapping (MDEXP-59) will be moved to a sharable jar file to use by other modules. The logic of creation MappingProfileReader and MappingProfileRule can be also added to this jar file. Detailed design how to use MARC records that are generated on the fly from inventory records will be created in the scope of - MDEXP-84Getting issue details... STATUS
DB Scheme
DB schema | |
Json schemas | |
Json example |
Mapping profile endpoints
Method | Path | Permission(s) | Response | Note(s) |
---|---|---|---|---|
GET | /mappingProfiles | data-export.mappingprofiles.collection.get | 200 OK(with collection) | |
GET | /mappingProfiles/{id} | data-export.mappingprofiles.item.get | 200 OK(with record) | {id} - UUID of the mapping profile |
POST | /mappingProfiles | data-export.mappingprofiles.item.post | 204 No Content | {id} - UUID of the mapping profile |
PUT | /mappingProfiles/{id} | data-export.mappingprofiles.item.put | 204 No Content | {id} - UUID of the mapping profile |
DELETE | /mappingProfiles/{id} | data-export.mappingprofiles.item.delete | 204 No Content | {id} - UUID of the mapping profile |