#74 ✓resolved
Victor Poten

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

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

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?

Comments and changes to this ticket

  • Victor Poten

    Victor Poten February 17th, 2011 @ 09:22 AM

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

  • Victor Poten

    Victor Poten February 17th, 2011 @ 11:09 AM

    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)

  • Victor Poten

    Victor Poten February 17th, 2011 @ 11:23 AM

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

  • JBrowse

    JBrowse March 2nd, 2012 @ 11:34 AM

    • State changed from “new” to “resolved”

    (from [8d138074a8c5553ee8031ae25ad511e67b68d045]) Merge branch 'one_based_UI', fixes #74.

    All user-facing coordinates are now displayed as 1-based.
    https://github.com/GMOD/jbrowse/commit/8d138074a8c5553ee8031ae25ad5...

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

AJAX Genome Browser

People watching this ticket

Pages