usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

LPS: always display DynamicResourceSets #248

Closed RayPlante closed 2 years ago

RayPlante commented 2 years ago

The NERDm schemas allow any type of resource record to include one or more DynamicResourceSet components. Consequently, the dynamic search results should always be displayed--regardless of whether it is a ScienceTheme resource or not. When the resource is a ScienceTheme resource, however, the display may be a little different. Previously, the Landing Page Service code would only display dynamic search results for ScienceTheme records. This PR fixes this.

This PR also includes some changes to the NERDResource class. Previously (on my advice), we moved a selectAccessPages() function from the ResourceDataComponent class to the NERDResource class; however, on closer inspection, that function included some manipulations specific to the ResourceDataComponent. (More specifically, it annotated each selected component with some extra properties used for display.) This PR splits this implementation between the two classes. In addition, I've updated the NERDResource select functions to use its internal type matching functions to make it more robust.