Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Problem with dataRoot property in mixed environments (tomcat/apache)

#74

Hi,

I'm integrating JBrowse inside a Grails application. I keep JBrowse .js,.css,images,... inside
the web-app and left the static JSON content in an apache server.

The Grails controller generates the trackInfo.json and refSeq.js files and the html page that
shows the browser object. To make it work together I have to use the dataRoot property and modify
the urls of the {seq}/{track}/trackData.json files, for instance:
urlTemplate in a trackData file: 'hg18//tracks/chr1/refGene//lazyfeatures-{chunk}.json' dataRoot: 'http://localhost/jbrowse_data/' * browserRoot: 'http://localhost:8080/myApp/jbrowse/'

with this settings the browsers doesn't shows the track contents (the track appears but not its content)

Could be the port an issue?
In any place of the program the urls are not builded concatenating dataRoot with the relative urls?

Reported by Victor Poten · February 16th, 2011 @ 08:15 AM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. Victor Poten
    Victor Poten

    The problem is about Cross-site HTTP requests and dojo xhrGet method

    February 17th, 2011 @ 09:22 AM

  2. Victor Poten
    Victor Poten

    I found out the solution:

    First: you must configure apache to accept some headers, for instance:

    • Header set Access-Control-Allow-Origin "another.domain"
    • Header set Access-Control-Allow-Headers "x-requested-with"
    • Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"

    Make sure that headers.load module is enabled.

    Second: jbrowse.js code must be fixed: At line 2067:

    LazyArray.prototype.range=function(_4,_5,_6,_7,_8){
    _4=Math.max(0,_4);
    _5=Math.min(_5,this.length-1);
    var _9=Math.floor(_4/this.chunkSize);
    var _a=Math.floor(_5/this.chunkSize);
    if(_7===undefined){
    _7=function(){
    };
    }
    var _b=new Finisher(_7);
    for(var _c=_9;_c<=_a;_c++){
    if(this.chunks[_c]){
    this._processChunk(_4,_5,_c,_6,_8);
    }else{
    var _d={start:_4,end:_5,callback:_6,param:_8,finish:_b};
    _b.inc();
    if(this.toProcess[_c]){
    this.toProcess[_c].push(_d);
    }else{
    this.toProcess[_c]=[_d];
    var _e=this.urlTemplate.replace(/\{chunk\}/g,_c);
    var _f=this;
    dojo.xhrGet({url:_e,handleAs:"json",load:this._makeLoadFun(_c),error:function(){
    _b.dec();
    }});
    }
    }
    }
    _b.finish();
    };
    

    This line must be fixed:

    dojo.xhrGet({url:e,handleAs:"json",load:this.makeLoadFun(c),error:function(){
    b.dec();
    }});
    

    the _e url string is not prefixed with the dataRoot, which must be passed to LazyArray class
    (for instance, at construction time)

    February 17th, 2011 @ 11:09 AM

  3. Victor Poten
    Victor Poten

    I have noticed that the LazyArray.js class is fixed in 1.2 version, the bug comes from 1.1

    February 17th, 2011 @ 11:23 AM

  4. JBrowse

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.