Requests for material in external systems
The draft Genebank Request protocol describes how Genesys can create a request for material in a genebank's own system.
In this ticket are upgrading our request system so that for the requested accessions that are known to be in other external systems, the user is redirected to those external sites where they can complete the request. This is a mirror/reverse of #742 (closed).
The problem
Some genebanks operate public-facing websites where users can request their material. Note that these are not Embedded Genesys
The solution
To help Genesys users, we inform the external system of the requested material (see Draft Request protocol) so that the user does not need to search for the material again -- they only need to finalize the request in this other system.
Implementation
Genesys needs to know which accessions are in which external system: in general, one INSTCODE belongs to only one external system, and a system can cover more than one INSTCODE. We can extend both Partner and FaoInstitute with a pointer to the external system. Example: USDA runs https://npgsweb.ars-grin.gov/gringlobal/ that covers all accessions under the USDA Partner in Genesys, and Genesys should redirect the user to the USDA site where they can complete the request.
Genesys also needs to authenticate against the external system. API Token and Basic authentication are the easiest to implement.
The first part of the request process remains unchanged:
- User finds and selects material in Genesys
- User clicks "Request material" button and follows the steps until the end -- until they receive the validation email
When the user validates the request (key sent by email) we have some new logic:
- Genesys groups the requested accessions by the URL of the remote site and makes a
SubRequestfor each site. Genesys calls the remote API, gets the request key and stores it, sends an email to the user with the link. - Accessions with no remote site are grouped into
SubRequests byINSTCODE(current logic). IfFaoInstitute.allowMaterialRequests == truethen send the email notification. - User continues the request process on Genesys website: subrequests are displayed and instructions displayed.
- If a request has a remote site, displays a link to the remote site that opens in a new tab where the user can finish the request.
- If a request is one with
FaoInstitute.allowMaterialRequeststhen the email notification was already sent. Nothing to do. - If a request is for an institute that does not enable requests in Genesys, then we display a message how to find the contact persons (WIEWS, Google, etc.) and give them the email template (I think we tested something like this before).
Steps
- Add
String requestApiandString requestApiAuthorizationto institute and partner entities.requestApiAuthorizationwill contain the value of theAuthorizationheader (e.g.Token xxxxorBasic ....) - Serialize
requestApiAuthorizationin DTO so that it contains the authorization type ++ 3 characters +.... Use a separate endpoint to set the auth header. - Update the request splitting logic as described above
- UI updates: clicking "Validate" on validation page needs to trigger the split, and render the sub-requests.
Because we have no remote sites at this moment, requesting material basically looks the same, except that the UI renders the sub-requests.