If you know this prefix at compile time you can use the
library/uri
config key for the involved libraries for the source version of your
app, and
compile-options/uris/source,resource
for the build version of your app, to fix uri prefixes.
T.
On 02/23/2011 01:50 AM, aditya siram wrote:
> Hi all,
> I solved this issue by creating my own loader.tmpl.js file that took
> the libinfo array and prefixed all "sourceUri" and "resourceUri" keys
> with the server root string that my web application makes accessible
> at "window.serverRoot" before creating qx.$$libraries. Now all my
> resources are loaded correctly both in "source" mode and "build" mode
> even if the url of the page is dynamically generated.
>
> -deech
>
> On Tue, Feb 22, 2011 at 2:36 PM, aditya siram<[email protected]> wrote:
>> Hi all,
>> Stanislav pointed out that using the build version of the app allowed
>> the application logic to load, but the server cannot find any of icons
>> and pngs in the theme. The reason is that the URI's of these resources
>> still use relative paths and point to<current-url>/resources/... .
>> But<current-url>/resource does not point to the right directory, so
>> the images fail to load.
>>
>> I found that "compile-options" in "config.json" takes a "code" block
>> that has a "decode-uri-plug" parameter which allows me to post-process
>> each uri which allows me to change its path prefix to an absolute path
>> in the web application instead of a relative one. But unfortunately
>> the default template does not run this code if the application is
>> inline. Is there any reason why? Am I going about this all wrong?
>>
>> Thanks ...
>> -deech
>>
>> On Tue, Feb 22, 2011 at 1:07 PM, aditya siram<[email protected]> wrote:
>>> Thanks for you quick response, but unfortunately that doesn't seem to
>>> solve my problem.
>>>
>>> I don't think I described the problem correctly in my original post.
>>> What it comes down to is that in generated javascript file , the
>>> qx.$$libraries points to the wrong thing.
>>>
>>> For example, here is the first few lines of my app.js
>>> (function(){
>>> ...
>>> var libinfo =
>>> {"__out__":{"sourceUri":"../../scripts/qooxdoo/prearchiveui/source/script"},"prearchiveui":{"resourceUri":"../../scripts/qooxdoo/prearchiveui/source/resource","sourceUri":"../../scripts/qooxdoo/prearchiveui/source/class","version":"trunk"},"qx":{"resourceUri":"../../scripts/qooxdoo/framework/source/resource","sourceUri":"../../scripts/qooxdoo/framework/source/class","version":"1.2"},
>>> ...
>>>
>>> Here the path prefix "../../scripts" is incorrect and I need it to be
>>> determined dynamically client-side because the path prefix can change,
>>> in one case it might be "/app/scripts", in another
>>> "localhost:8080/app/scripts/". I have Javascript function that can
>>> generate the prefix but that does me no good unless I can override
>>> whats in qx.$$libraries on the client side.
>>>
>>> Hope this makes things clearer. Thanks again for the support.
>>> -deech
>>>
>>> On Tue, Feb 22, 2011 at 12:17 PM, Stanislav Sinyagin
>>> <[email protected]> wrote:
>>>> you can pass on parameters through qxsettings array, as is done here:
>>>> https://github.com/ssinyagin/gerty-reports/blob/master/frontend/source/index.html.in
>>>>
>>>>
>>>> "generate.py" will then copy your index.html into the build directory
>>>> as-is.
>>>>
>>>> Also in the example above, the parameter comes from ./configure options.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ----- Original Message ----
>>>>> From: aditya siram<[email protected]>
>>>>> To: qooxdoo Development<[email protected]>
>>>>> Sent: Tue, February 22, 2011 7:10:20 PM
>>>>> Subject: [qooxdoo-devel] Set App Root according to Installation
>>>>>
>>>>> Hi all,
>>>>> I am using Qooxdoo as part of a web application where the application
>>>>> root is determined by the specific installation. In some cases it
>>>>> could be http://localhost:8080/app/ or http://app/ or any number of
>>>>> other variations.
>>>>>
>>>>> Also my Qooxdoo javascript code is accessed through an HTML templating
>>>>> system (Velocity) which means that it might be loaded from a number of
>>>>> different (sometimes dynamically generated) HTML files and so I don't
>>>>> have a way of setting a reliable relative path to my javascript file.
>>>>>
>>>>> I have a non-Qooxdoo javascript function that outputs the application
>>>>> root. How can I use that in my config.json for my app-root setting?
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Free Software Download: Index, Search& Analyze Logs and other IT data in
>>>> Real-Time with Splunk. Collect, index and harness all the fast moving IT
>>>> data
>>>> generated by your applications, servers and devices whether physical,
>>>> virtual
>>>> or in the cloud. Deliver compliance at lower cost and gain new business
>>>> insights. http://p.sf.net/sfu/splunk-dev2dev
>>>> _______________________________________________
>>>> qooxdoo-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>
>>>
>>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search& Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel