Hi everyone,
During Metadata Mapping Spring, as @raff announced here, we extended functionality of Metadata Mapping module, making it possible to get rid of most global properties in favour of metadata mappings. As proof of concept we choose to migrate emrapi module.
We tried to make implementing migration as easy as possible, and provide necessary backwards compatibility. Metadata Mapping module api provides convenient converter from global property:
new GlobalPropertyToMappingConverter<Location>(emrapiMetadataSource) {
public Location getMetadataByUuid(String s) {
return Context.getLocationService().getLocationByUuid(s);
}
}.convert(EmrApiConstants.GP_UNKNOWN_LOCATION);
Example of saving new metadata term mapping:
MetadataTermMapping termMapping = metadataMappingService.getMetadataTermMapping(sourceName, Mappingcode);
termMapping.setMappedObject(metadataObject);
metadataMappingService.saveMetadataTermMapping(termMapping);
Migration from global properties is major change, and require adjustments in Reference Application modules. There are PRs in emrapi-module, referencemetadata-module and referenceapplication-module.
We are aware that emrapi is widely used module, we would be very thankful for your thoughts about this design.
cheers, PaweĆ