On 01/12/2011 11:41 AM, Stefan Andersson wrote:
> We had to split our resource map into respective part of the application
> to be independent each other. Which means that we get a problem with the
> uris at generation.
>
> root
> I------app
> I I-------source/resource/...
> I------app 1
> I I-------source/resource/...
> I------app 2
> I I-------source/resource/...
>
> Now when we try to generate app, which is :
>
> "include" :
> [
> {
> "path" : "${QOOXDOO_PATH}/tool/data/config/application.json"
> },
> {
> "path" : "module.json"
> }
> ]
>
> in "app" config.json. The module.json includes the "app 1" and "app 2".
>
> The problem is that the resource paths become wrong. When we run the
> "app" the local references in "app 1" and "app 2" to local resources can
> not be found at runtime. Of course!
This is generally not the case. All resources, from whatever library,
are referenced by their so called "resource id", which is a globally
unique identifier. Resource id's always start with the library's name
space, so you have to make sure that app 1's resources are stored under
"source/resource/app1/..." (or some other name space identifier). Then
you can refer to them from any library with e.g. "app1/icons/smile.png".
The other thing you might be stumbling over is qooxdoo's AliasManager,
which allows you to use aliases for resource id's, which allows to
shorten them and abstract away e.g. the theme in effect. So you will see
code like this:
new qx.ui.form.Button("My button", "icon/22/actions/edit-clear.png")
where the icon reference will get resolved by the AliasManager to e.g.
qx/icon/Tango/22/actions/edit-clear.png. The AliasManager has a few
pre-defined rewrite rules, but that doesn't mean they work for your
particular application. You can add new rules that suite you. If in
doubt, just use the full resource id in your code and you should be
fine. We have a lot of apps using resources from various libs, and it's
working smoothly so there is no general issue.
T.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel