How to add a searchable resource type to Primo
- Product: Primo
- Relevant for Installation Type: Dedicated-Direct; Direct; Local;
Question
How do I add a searchable resource type to Primo?
Answer
Below are step-by-step instructions on adding a new resource type to Primo.
All changes should be made at the Primo institution level, NOT the server installation level, unless the customer uses a centralized installation level pipe for the whole environment.
Example resource type: ebook
1. Normalization Rule changes:
- Display/Type field - add normalization rule(s) to assign new value to applicable records. Use a singular code format, all lower case and no spaces, for example "ebook", not "ebooks". This is the code you will see in the record's PNX in the display/type field.
- Facets/rsrctype - no need to change anything in the normalization rule itself.
The rule takes the value from display/type field and compares it to the format_mean mapping table. This means that the new display/type code(s) will need to be added to the table:
The Source Code* column will contain the code that will be in the display/type field.
The Target Code column will contain the code that will be populated into the facets/rsrctype field, the plural version of the display/type code.
Example: If the source code is "ebook", the target code will be "ebooks”.
- Facets/prefilter - no need to change anything in the rule itself either; all changes should be made in the pre_filter mapping table.
The table will need to be populated similarly to the format_mean mapping table:
The Source Code* column will contain the code that will be in the display/type field.
The Target Code column will contain the code that will be populated into the facets/prefilter field, the plural version of the display/type code.
Example: If the source code is "ebook", the target code will be "ebooks”.
2. Mapping and Code Tables Changes:
- Icon Codes code table - this is the code table where we define the Labels that appear under the records' icons. The table uses the code in the display/type field.
If the code in the display/type field is "ebook", this is what should be populated in the Code column: default.mediatype.ebook; the Description field will contain the label, "eBooks". We'll use the "en_US" code in the Language column, for labels in English. If the label will need to be translated into different languages, an additional line will need to be added for each language, using the same code in the Code column, the applicable label, and the applicable language code.
- facet_rtype_values mapping table - this mapping table uses the code in the record's facets/rsrctype field. It will map the codes in the records' PNX to the labels in the Resource Type facet on the Front End.
The code from the facets/rsrctype field will need to be entered in the Values* column, and the label in the Value Name column.
Example: If the facets/rsrctype field value is "ebooks", this is the code that will go in the Values* column. The label in the Value Name column will be "eBooks".
After adding the values to this table, save, and then click on the Sync button. This will propagate the changes that were made to the applicable code tables.
Check the Code Table in any case, to verify all changes went through well.
Wait until the browser stops looking like it's working after clicking the sync button.
- Facet Resource Type code table - this code table is used to define labels for the Resource Type facet. It should be populated by the facet_rtype_values mapping table.
If a line for "ebooks" was created in the mapping table, the code in the Code column should look like this: default.facets.facet.facet_rtype.ebooks; the label will be in the Description column, and will be identical to the value in the Value Name column in the mapping table, "eBooks".
The language column also plays part here, so if the mapping table contains multiple language lines, they will need to be checked under their applicable languages.
- facet_pfilter_values mapping table - this mapping table uses the code in the records' facets/prefilter field. It will map the codes in the records' PNX to the value in the Resource Type prefilter drop down in the simple and advanced searches.
The code from the facets/prefilter field will need to be entered in the Values* column, and the label in the Value Name column.
Example: If the facets/prefilter field value is "ebooks", this is the code that will go in the Values* column. The label in the Value Name column will be "eBooks".
After adding the values to this table, save, and then click on the Sync button. This will propagate the changes that were made to the applicable code tables.
Check the Code Table in any case, to verify all changes went through well.
Wait until the browser stops looking like it's working after clicking the sync button.
- facet_pfilter_values_codes code table - this code table is populated by the facet_pfilter_values mapping table.
If a line for "ebooks" was created in the mapping table, the code in the Code column should look like this: default.facets.facet.facet_pfilter.ebooks; the label will be in the Description column, and will be identical to the value in the Value Name column in the mapping table, "eBooks".
After adding the values to this table, save, and then click on the Sync button, and wait until the browser stops looking like it's working.
- Advanced Media Type code table - this code table is used to define labels for the Resource Type drop down in the Advanced Search. It should be populated by the facet_pfilter_values mapping table, but in case the codes need to be entered manually, below you will find the code's structure.
Example: If the mapping table contains a line for "ebooks", the code in the Code column should look like so: default.search-advanced.mediaType.option.ebooks; the label will be in the Description column, and will be identical to the value in the Value Name column in the mapping table, "eBooks".
Here too each language will need to be checked separately.
- Basic Media Type code table - this code table is used to define labels for the Resource Type drop down in the Simple Search. Below you will find the code's structure.
Example: If the mapping table contains a line for "ebooks", the code in the Code column should look like so: default.search-simple.mediaType.option.ebooks; the label will be in the Description column, and will be identical to the value in the Value Name column in the mapping table, "eBooks".
Here too each language will need to be checked separately.
*** For multi-tenant customers with sharing environment, that configuration should be done on installation level.
3. Add/Replace Resource Type Icon in Classic UI/ New UI:
Classic UI:
a. Go to Primo Home > Primo Utilities > File Uploader.
b. Select the relevant view.
c. Upload new resource type icon(s); e.g. ebook.jpg.
d. Download localized css and add the following line(s) for each new resource type (e.g. ebook): .EXLResultMediaTYPEebook .multipleCoverImageContainer {background-image: url(../<VIEW_CODE>/ebooks.jpg)}
e. Upload the changed css file.
f. Refresh the browser (and clear the cache) before testing.
.EXLResultMediaTYPEebook has "ebook" and the VIEW_CODE refers to the customer's Primo view code.
These variables will need to be unique for each resource type icon added.
New UI:
a. Go to Primo Home > Primo Utilities > UI customization Package Manager.
b. Select the relevant view.
c. Download relevant package.
d. Save the icon as follows under img folder: icon_<resource_type>.png . For example: icon_ebook.png.
e. Upload back the updated package to the UI customization Package Manager.
f. deploy.
g. Refresh the browser (and clear the cache) before testing.
* For more information go to: New UI Customization - Best Practices
Additional Information
If there is no facet/prefilter field present in the PNX, the advanced/basic search resource type search will not work as it uses the pre-filter facet.
Facets, however, work with facet/rsrctype.
<facets> <prefilter>ebooks</prefilter> <rsrctype>ebooks</rsrctype> </facets>
Relevant information in the Back Office Guide:
- Article last edited: 17-Mar-2015