Problem to use local json file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem to use local json file

Frédéric
Hi!

I'm trying to load a local json file, through a store, for tests, but it
does not work.

As I'm in dev. phase, I access to my app through a local uri:

    file:///home/fma/Perso/develop/javascript/qooxdoo/pKNyXui/source/index.html

which is OK for qooxdoo: all its resources are loaded
(from /opt/qooxdoo/...).

I found that it is not possible to load a local file, without modifying
the browser config, what I want to avoid. So, I'm just using python to
server local files:

$ cd /home/fma/Perso/develop/javascript/qooxdoo/pKNyXui
$ python -m "SimpleHttpServer"

This way, I have a real web server, binded to port 8000, serving all files
from current location (/home/fma/Perso/develop/javascript/qooxdoo/pKNyXui).

But I get this error:

XMLHttpRequest cannot load
http://localhost:8000/source/resource/pknyxui/datapoints.json. No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'null' is therefore not allowed access.

Ok, so, I tried to use the server uri to access to my app :

    http://localhost:8000/source/index.html

It seems (I may have another problem, but one at a time!) now that qooxdoo
is unable to load its resources:


http://localhost:8000/opt/qooxdoo-4.0.1-sdk/framework/source/resource/qx/decoration/Modern/window-captionbar-buttons-combined.png
404 (File not found)
http://localhost:8000/opt/qooxdoo-4.0.1-sdk/framework/source/resource/qx/decoration/Modern/table-combined.png
404 (File not found)

So, what is the best practice for such situation?

--
    Frédéric

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem to use local json file

Frédéric
Le 18/12/2014, Frédéric a écrit :

> So, what is the best practice for such situation?

I found the answer in the documentation:

http://manual.qooxdoo.org/4.0.1/pages/desktop/develop_how_to.html#running-the-source-version-through-a-web-server

"""
Summary

All of the above really boils down to the following: Running the source
version from a web server requires having the web server root be higher in
the file system hierarchy than ALL the application source root and the
qooxdoo SDK root and any qooxdoo contribs you might be using, so that all
libraries are accessible from the application via relative paths at the
server. (It corresponds to file:// usage if the web server root is in fact
the file system root)
"""

I have to move my qooxdoo SDK near my app, to avoid huge links...

--
    Frédéric

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem to use local json file

fritz
On Thu, 18 Dec 2014, Frédéric wrote:

> I have to move my qooxdoo SDK near my app, to avoid huge links...

How about a symlink?

Cheers,
Fritz

--
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem to use local json file

Frédéric
Le 18/12/2014, Fritz a écrit :

> How about a symlink?

Yes, it works.

Note that I had to change the SDK path from the config.json file (not
related to symbolic link).

--
    Frédéric

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel