Skip to content

Changes in pathway-commons module (pc) and where it's used.#948

Merged
IgorRodchenkov merged 8 commits intodevelopmentfrom
igor_pc
Aug 2, 2018
Merged

Changes in pathway-commons module (pc) and where it's used.#948
IgorRodchenkov merged 8 commits intodevelopmentfrom
igor_pc

Conversation

@IgorRodchenkov
Copy link
Copy Markdown
Member

Refs #916, #938.

PC_URL now must point to the root PC URL (domain or ip:port), such as 'http://www.pathwaycommons.org/' or 'http://beta.pathwaycommons.org/' (tailing slash is required).

This allows app-ui code to query PC using "commands" (request paths) like 'pc2/search' instead 'search', and - now - 'sifgraph/v1/neighborhood', etc. (other/future PC services).

@IgorRodchenkov IgorRodchenkov changed the base branch from master to development July 31, 2018 16:39

//Pathway Commons HTTP GET request; options.cmd = 'get', 'search', 'traverse', 'graph', etc.
//Pathway Commons HTTP GET request; options.cmd = 'pc2/get', 'pc2/search', 'pc2/traverse', 'pc2/graph', etc.
const query = async (queryObj) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to remove any mention of 'pc2' especially in the client (e.g. ServerAPI.pcQuery('pc2/get',) in favour of appending the 'pc2' here? This would require a change to router for '/pc2/:path' to use query

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

router.get('/:path', function (req, res) {
res.redirect(config.PC_URL + req.params.path + '?' + qs.stringify(req.query));
router.get('/pc2/:path', function (req, res) {
res.redirect(config.PC_URL + 'pc2/' + req.params.path + '?' + qs.stringify(req.query));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be looking for the 'pc2' stripping it, then adding back?. Also could this just point to pc.query method?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially, router.get('/:path', function (req, res) - was to match/route ALL other possible direct requests to PC2 - mainly (or only) for the GSEA/SIF/SBGN/.. download links in the view's right-side panel.
I just had to made this change after changes in pc (server/pathway-commons) module, which redefined what 'cmd' (command) means - now it means full context path, such as pc2/search or sifgraph/v1/pathsbetween

@IgorRodchenkov
Copy link
Copy Markdown
Member Author

IgorRodchenkov commented Jul 31, 2018 via email

@jvwong
Copy link
Copy Markdown
Member

jvwong commented Jul 31, 2018

I believe the interaction graph call to pc.query in /src/server/graph-generation/interaction/index.js needs the 'pc2' added .

@IgorRodchenkov
Copy link
Copy Markdown
Member Author

Yes, let me add that (but I think that index.js will be soon refactored via the other pool request - switching to Sifgraph - right?)

@jvwong
Copy link
Copy Markdown
Member

jvwong commented Jul 31, 2018

Yeah when this goes in then @q4wen can add his from #938

@IgorRodchenkov IgorRodchenkov merged commit 0987e30 into development Aug 2, 2018
@IgorRodchenkov
Copy link
Copy Markdown
Member Author

Merged. Let me keep igor_pc branch (please don't delete) for future work.

@d2fong d2fong deleted the igor_pc branch August 2, 2018 19:41
@IgorRodchenkov IgorRodchenkov restored the igor_pc branch August 7, 2018 03:16
@IgorRodchenkov IgorRodchenkov deleted the igor_pc branch August 7, 2018 03:25
@IgorRodchenkov
Copy link
Copy Markdown
Member Author

Alright, I can live without igor_pc branch :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants