GithubHelp home page GithubHelp logo

load url syntax about icn3d HOT 11 CLOSED

ncbi avatar ncbi commented on July 18, 2024
load url syntax

from icn3d.

Comments (11)

lewisg-ncbi avatar lewisg-ncbi commented on July 18, 2024

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

from icn3d.

fslee62 avatar fslee62 commented on July 18, 2024

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

from icn3d.

dzhang-ncbi avatar dzhang-ncbi commented on July 18, 2024

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

from icn3d.

fslee62 avatar fslee62 commented on July 18, 2024

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

from icn3d.

dzhang-ncbi avatar dzhang-ncbi commented on July 18, 2024

hi fred,

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

Thanks,

Dachuan

from icn3d.

fslee62 avatar fslee62 commented on July 18, 2024

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.

from icn3d.

jiywang3 avatar jiywang3 commented on July 18, 2024

from icn3d.

jiywang3 avatar jiywang3 commented on July 18, 2024

from icn3d.

fslee62 avatar fslee62 commented on July 18, 2024

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

from icn3d.

jiywang3 avatar jiywang3 commented on July 18, 2024

from icn3d.

fslee62 avatar fslee62 commented on July 18, 2024

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

from icn3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.