Problem with dataRoot property in mixed environments (tomcat/apache)
-
Victor Poten
The problem is about Cross-site HTTP requests and dojo xhrGet method
-
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) -
Victor Poten
I have noticed that the LazyArray.js class is fixed in 1.2 version, the bug comes from 1.1
-
JBrowse
- State changed from new to resolved
(from [8d138074a8c5553ee8031ae25ad511e67b68d045]) Merge branch 'one_based_UI', fixes #74 Problem with dataRoot property in mixed environments (tomcat/apache).
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.