Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new endpoint similar to the legacy portal.do #735

Closed
danielabutano opened this issue Jul 8, 2021 · 12 comments · Fixed by #778
Closed

Creating a new endpoint similar to the legacy portal.do #735

danielabutano opened this issue Jul 8, 2021 · 12 comments · Fixed by #778
Milestone

Comments

@danielabutano
Copy link
Member

danielabutano commented Jul 8, 2021

In BG we need a portal endpoint similar to that one provided by the legacy interface.
It's used by the im registry, when is acting as a splash page to import from Galaxy to InterMine.
Data are sent using the method POST.
Here a code section from the im-registry
function mineNavButton(mine, dataToTransfer) { return '<form action="' + mine.url + '/portal.do" name="list" method="post">' + '<input type="hidden" name="externalids" value="' + dataToTransfer.identifiers.join(",") + '" />' + '<input type="hidden" name="class" value="' + dataToTransfer.identifierType + '" />' + '<input type="submit" value="Send to ' + mine.name + '" />' + '</form>'; }
The endpoint should accept also the optional extraValue (organism).
The new endopoint after checking the identifiers posted, redirect to the page below
image

@heralden heralden added this to the Unreleased milestone Nov 11, 2021
@heralden heralden removed this from the Unreleased milestone Nov 22, 2021
@danielabutano
Copy link
Member Author

This might be used by pombase too to create list into pombemine

@danielabutano
Copy link
Member Author

@uosl do you need more clarifications?

@heralden
Copy link
Member

I have some questions. Can I drop the /query/*.do path or does it need to match the legacy API? I will only implement List of identifiers (https://intermine.readthedocs.io/en/latest/webapp/linking-in/#list-of-identifiers) right? (Same as in your issue description.)

I was thinking of using the same approach as #443 just adding an extra parameter (or path?) to identify the type of link, e.g. POST /link/region and POST /link/upload. I might have to include the mine name as well to handle BG covering multiple mines, so perhaps POST /pombemine link=upload. Otherwise I will use the same param names as before.

@danielabutano
Copy link
Member Author

Hi @uosl, I think that it would be better if it matched with the legacy API, so we do no have to update the existing applications which use it (e.g the registry , when it send identifiers from galaxy to the mine instances).

@danielabutano
Copy link
Member Author

danielabutano commented Jan 28, 2022

The new endpoint in BG should received the input as described in the ticket and then implement the same process implemented in the Upload page, wne the user clicks the "Continue" button which I think is:

  1. call the service/ids
  2. wait for the status SUCCESS
  3. calls service/ids/{idresolutionidentifier}/results
  4. display the result in the page below:
    image

@kimrutherford
Copy link

Hi. Is POST supported for this endpoint? Some of our list are quite long. I tried with curl from the command line and got:

This POST request to /pombemine is not handled by the BlueGenes server, which is deployed to /. 

Thanks.

@heralden
Copy link
Member

heralden commented Mar 1, 2022

Sorry about that, it was an oversight to not include POST. We'll add this for the next release (#792). Thanks for letting us know.

@heralden
Copy link
Member

@kimrutherford Turns out POST was supported, but HTTP response 302 was used instead of 303 (the latter ensures the request is redirected with GET instead of POST, although most clients always do that anyways for backwards compatibility). I've fixed this now in the coming v1.4.2 release so it should work correctly with more clients.

Just note that if you use -X POST with curl it will not work, as it overrides the 303 behaviour. You can use -d ... instead, or test with a regular html form:

<form action="http://localhost:5000/pombemine/portal.do" method="post">
  <input type="hidden" name="externalids" value="smd3,smd1,cwf12,cwf2,cwf3,cwf4,cwf5,smd2,cwf11,sap145">
  <input type="hidden" name="class" value="Gene">
  <input type="submit" value="Submit">
</form>

Let me know if you still have issues.

@kimrutherford
Copy link

Thanks! I'll give it a go.

@kimrutherford
Copy link

Hi @heralden. Sorry the delay in testing.

I've been trying this URL: http://pombemine.rahtiapp.fi/pombemine/portal.do?externalids=SPAC1556.06&class=Gene

It look like it's partly working. The lookup succeeds but the page doesn't render properly:

pombemine-portaldo-1

There are lots of errors in the console like:

Uncaught SyntaxError: Unexpected token '<' (at AjaxServices.js:1:1)

and

Uncaught ReferenceError: OtherMines is not defined
    at portal.do?externalids=SPAC1556.06&class=Gene:1030:9

I noticed that the FlyMine list example on this page has the same problem: http://intermine.org/im-docs/docs/4.0.0/webapp/linking-in/index/

http://www.flymine.org/query/portal.do?externalids=CG2262,CG3069,CG2859,CG5041,FBgn0036513&class=Gene

I tried a form with POST and got a blank page. Here's the form:

<form action="http://pombemine.rahtiapp.fi/pombemine/portal.do" method="post">
  <input type="hidden" name="externalids" value="smd3,smd1,cwf12,cwf2,cwf3,cwf4,cwf5,smd2,cwf11,sap145">
  <input type="hidden" name="class" value="Gene">
  <input type="submit" value="Submit">
</form>

The Chrome console has this error:

POST http://pombemine.rahtiapp.fi/pombemine/portal.do net::ERR_INCOMPLETE_CHUNKED_ENCODING 200

Do you have any advice?

Thanks.

@heralden
Copy link
Member

@kimrutherford It looks like this is happening due to how the reverse proxy is setup. For flymine.org, it will work if you change query to flymine like so: http://www.flymine.org/flymine/portal.do?externalids=CG2262,CG3069,CG2859,CG5041,FBgn0036513&class=Gene

The reverse proxy is setup to facilitate some features of the old webapp, which isn't working in this case and overriding Bluegenes. We'll need to have a think on how we'll change the reverse proxy configuration.

For Pombemine we can probably safely remove the reverse proxy rule for /portal.do. I'll look into doing this later this week and it should fix the problem.

@heralden
Copy link
Member

@kimrutherford I have updated the reverse proxy rules for pombemine and http://pombemine.rahtiapp.fi/pombemine/portal.do?externalids=SPAC1556.06&class=Gene is working now.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants