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

load url syntax #15

Closed
fslee62 opened this issue Jun 27, 2017 · 11 comments
Closed

load url syntax #15

fslee62 opened this issue Jun 27, 2017 · 11 comments
Labels

Comments

@fslee62
Copy link

fslee62 commented Jun 27, 2017

hello, i was able to quickly display the icn3d viewer on my own web server. however, i have not been able to load a "local" pdb file into the viewer using either the command prompt OR coding the path into the html page that initializes the viewer. yes i was able to load the pdb file using the popup menu. i believe the file type info was missing the very first time. so what should be the [???] below?

(1) use command prompt: > load url [???] // manual list only the path inside [???] no type info
(2) within a generated html: var cfg = {..., url: [???], ...};

PS: i learned that once i used the popup menu one time, the file type was "remembered". so from then on i could simply type > load url [local server path to pdb file] and it would work and type not needed. thanks much.

@lewisg-ncbi
Copy link
Contributor

Hi fslee62,
Is there any chance you could point me to a page demonstrating the issue? The developer is currently on vacation, but maybe I help figure the issue out.
Lewis

@fslee62
Copy link
Author

fslee62 commented Jun 27, 2017

hi lewis, thanks for the ultra-fast response. maybe the way to reproduce it on your end is to use your own LOCAL web server and try to load a LOCAL pdb file based on local path (not from RCSB based on PDBid). so here i am initiating the viewer locally on my own web server and i want to load a local pdb based a local path and filename.

after the icn3d initialized, i typed the following at the command prompt:

load url /data/pdb/test.pdb
this did NOT work. the slash is the DocumentRoot (of my web server)

HOWEVER, if i used the menu popup choosing type=pdb and url=/data/pdb/test.pdb. the molecule loaded into the viewer.

ALSO, from then on, the viewer seemed to "remember" the file type so that NOW

load url /data/pdb/junk.pdb
would work and replaced test.pdb with junk.pdb in the viewer.

i hope my description was explicit enough.
fred

@dzhang-ncbi
Copy link

Hi fslee62

When you load a local file from the command line, you need to use file path

load pdb file C:{path}\xxxx.pdb

If you load a url file from the command line, you need to give file type:

load url https://files.rcsb.org/view/4NCD.pdb | pdb

For JS code within the page, you also need to give the url file type:
cfg.url = "https://files.rcsb.org/view/4NCD.pdb | pdb";

hope my explanations can help you solve the problem.

Dachuan

@fslee62
Copy link
Author

fslee62 commented Jun 27, 2017

hi dachuan,
thanks very much for taking the time to look into my issues. while you have given me the syntax for (1) load pdb and (2) load url. both did not work in my case.

for (1), my web server is an INTRAnet virtual web server running off of a linux box (not windows). i don't quite understand how a windows drive letter (e.g., C:) would work under a linux filesystem. i tried:

load pdb file c:\data\pdb\test.pdb (no model loaded into viewer no error messages)

for (2), notice your url is an extranet address/path. i tried:

load url http://twww/data/pdb/test.pdb | pdb (no model loaded)
load url https://files/rcsb.org/view/4NCD.pdb|pdb (no model loaded)
notice my intranet web server is called "twww". i CAN load local pdb files using the MENU (File->Open File->Url). i selected PDB as the file type and enter literally "/data/pdb/test.pdb" in the textbox and it loaded the test.pdb model into the viewer (slash / is the DocumentRoot). please have a look at my response to lewis above that highlighted a subtle issue.

maybe i should take a step back. can iCN3D be used as an intranet web viewer loading only internal/local files? i am trying to replace the Jmol viewer (which works well for me in the past) on my intranet web server with iCN3D because current web browsers do not support java anymore.
fred

@dzhang-ncbi
Copy link

hi fred,

I don't think we tested iCn3D on a virtual web server. We will look into the problems.

Thanks,

Dachuan

@fslee62
Copy link
Author

fslee62 commented Jun 27, 2017

hi dachuan,
thanks very much for your attention. i just wanted to reiterate a couple of comments/observations:

(1) the Jmol applet had worked under the same situation (intranet web-based viewer serving intranet files). i think a lot of people would love to use iCN3D to replace Jmol on their intranet and/or extranet web servers.

(2) iCN3D hosted by my web server (twww) showed up on my browser (chrome) NO problem. i can load local file using the Menu and it WORKED. so iCN3D can be hosted locally and read local files. just that there may be something sticky with the command prompt way and with the cfg way.
fred
PS i used the term virtual in a sense that the same physical linux box is being used to host multiple web servers. each virtual server should work the same way as any physical web server.

@jiywang3
Copy link
Contributor

jiywang3 commented Jun 28, 2017 via email

@jiywang3
Copy link
Contributor

jiywang3 commented Jun 28, 2017 via email

@fslee62
Copy link
Author

fslee62 commented Jun 29, 2017

hi jiyao,
thank you so much for answering my questions even when you are on vacation. i poked around a bit more. turned out:

var cfg={...,url: 'pdb| /path relative to documentroot/test.pdb'} worked (for me) [type before url]
var cfg={...,url:'/path relative to documentroot/test.pdb|pdb'} did NOT work [url before type]

yes the code was iCn3DUI.prototype.downloadUrl = function (url, type)

this observation is reproducible. however, i didn't look into the code/matter further. am happy enough already.
cheers,
fred

@fslee62 fslee62 closed this as completed Jun 29, 2017
@jiywang3
Copy link
Contributor

jiywang3 commented Jun 29, 2017 via email

@fslee62
Copy link
Author

fslee62 commented Jun 29, 2017

hi jiyao,
(1) i did try with or without space(s) before and after the | pipe before. that did not make a difference. seemed like the order was the sticky point.
(2) i also tried with and without the type definition. for the very first time, my observations were that the type definition was required. after the first time and if the type was the same, then i could drop the type definition and the model will load into the viewer.

i am very new to iCN3D. i am certain i will have other questions and issues if i stick with using icn3d instead of other web-based viewers. thanks for all the ultra-fast support.
fred

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

No branches or pull requests

4 participants