Thx for the fast reply El 24/10/12 17:42, thron7 escribió: > Daniel, > > I understand you have to map the deployed application to the web2py > file layout. I would think you could copy everything under build/* to > the static/ folder, as of your description:
This is more a question of organization of the static files (css/js/images). The main application that we are developing is like a hub of applications. And the web-desktop that we are making with qooxdoo is one of the "sub-applications" that can go inside of the main app, so i need put those files into a structure like "static/desktop/build/" > > > On 10/24/2012 02:26 PM, Daniel Gonzalez Zaballos wrote: >> Web2py applications have a strict structure for serving the pages: >> >> web2py_location/applications/ >> <application_name>/ >> controllers/ >> models/ >> modules/ >> .... >> static/ -> static files like images/css/js (here is >> where qooxdoo goes) >> views/ -> html template files >> > > What I don't get is your "real structure": I'll try to explain this a little more, the structure above is the main web2py folder organization, but we needed to add the scripts folder because of our app nature. > >> >> My real structure now is: >> >> my_app_name/ >> ... >> - scripts/ >> - qooxdoo-desktop/ >> - config.json >> - generate.py >> - static/ >> - desktop/ >> - source/ >> - build/ >> - qooxdoo/ -> symbolic link to the qooxdoo-sdk >> - Manifest.json >> > How did you come up with this layout? Why did you rip the skeleton > structure apart, placing config.json and generate.py in one folder, > but Manifest.json and the source/ tree in another?! Does this > structure already belong to the web2py realm? Because I see a > "statics" folder there (but "scripts" didn't show up above)?! This structure is partly need and on the other hand due to my little experience with qooxdoo. As several people are working on the project, I wanted to include the files "config.json" and "generate.py" within a common directory on the application (but not in the directory "static" to not be accessible outside the application ) to upload everything to SVN. Thus, I would do it easier to start with the development to other developers. They only have to add the SDK directory with a symbolic link give the specific folder. I tried to move the directory where it is generated "build" and "source" modifying "ROOT" in "let". And the file "generate.py" file did not found "Manifest.json" so I had to move it to "static/desktop/Manifest.json" > > Is this your goal? Do you want to have the generator place the build > version directly into the web2py file structure? Then simply set the > BUILD_PATH macro in your config.json and you're all set. > The goal is to develop the qooxdoo application inside the main application having the source and build folders, and when it is stable, remove the qooxdoo-sdk symbolic link to distribute the source. And in a production environment remove the source/ folder >> Well, the first problem is the source version, that it doesn't find >> correctly the qooxdoo-sdk via URL (there is no problem with the >> generate.py) >> >> It trys to reach: >> - http://192.168.160.5:8000/static/desktop/qooxdoo/framework/ >> <http://192.168.160.5:8000/static/desktop/qooxdoo/framework/source/class/qx/ui/mobile/form/ToggleButton.js> >> when it has to reach: >> - http://192.168.160.5:8000/*my_app_name*/static/desktop/qooxdoo/framework/ >> <http://192.168.160.5:8000/static/desktop/qooxdoo/framework/source/class/qx/ui/mobile/form/ToggleButton.js> > > So "doesn't find" in your description means doesn't find at run-time, > not build-time, right?! It's a bit tricky to run a source version > through a web server (recommendation is to load it from file:// > directly), as you have to make sure that your app source tree and the > qooxdoo SDK root folder are within the scope of the web servers file > export, and that relative paths continue to work. See this entry: > > http://qooxdoo.org/docs/general/snippets#running_a_source_version_from_a_web_server > Yes, I tried to follow that entry, and the qooxdoo-sdk is accesible by the web2py built-in webserver, but the only thing i need is to prepend the application name to the "static/desktop/qooxdoo/...." path >> I've tried to set the "jobs" > "build-script" > "compile-options" > >> "uris" > "resource" to "desktop/resource" to avoid the second problem >> but it doesn't recognice the "/" char. >> > > What do you mean? Does it try something like "desktopresource"?! I can > hardly believe that. No, maybe i had don't explained myself, the generate.py script said something like: Unrecognized char: line 63 column 7. But I have tried again and now it works... maybe i had wrote something wrong and i didn't see it before. So this issue is solved :) So one question, the "build-script" is only for the "build" version? or it works too for the "source" version. Because if I can solve the first problem i'm gonna have the same issue in source. I have created a "source-script" and "source-all-script" entry with the same configuration in case i can solved the first problem. > > But you found the right place, just think of the correct path from the > index.html. 'desktop/resource' doesn't look right to me if index.html > is in view/. It should be more something like > '../static/desktop/resource'. > The html file has to be in views/ due to web2py template system: For example: to acess to this url: http://host/my_application/my_controller/index You need to have the follow: my_application/ - controllers/ my_controller.py function index - views/ - my_controller/ - index.html In my case: my_app_name/ - controllers/ - desktop.py function index - views/ - desktop/ - index.html -> i have a internal variable where i point to static/desktop/source or static/desktop/build if i am on development or produccion environment respectively And I use "my_app_name" as name of the application, because anybody can set a different name, so I need to add in runtime the app name inside the index.html for the js files. Thanks again. ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
