Hi Frank,
Frank Schoenheit, Sun Microsystems Germany ha scritto:
Hi,
is there a way to deploy images in an extension, which can be loaded
without calling code in that extension? That is, ideally I would like
the extension to deploy a configuration entry containing a URL, where
the OOo can pass this URL to the graphic provider, which is able to load
the image without actually loading any code from the extension itself.
Say, something like
"private:graphic/extension/extension_name/path_to_image_file", handled
by the GraphicProvider implementation.
Why not the %origin% placeholder?
I just noticed that the graphic provider can handle demacrofyed urls
like this one:
vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/sJYsUf_/MyExtension.oxt/icons/lightbulb.jpg
To my best knowledge (and trusting the API documentation), the
GraphicProvider cannot do this currently, but are there other means to
achieve that?
Does our extension infrastructure allow for this?
I could probably mimic what would be the ideal GraphicProvider
implementation: The extension would need to add a configuration entry
specifying the programmatic extension name, plus a path within the
extension folder. The package API would allow to get the actual image
file then.
However, this is ugly (graphics should be referenced by URLs, not some
strange assembled config data), and of course a central implementation
would be preferred.
Hints/Opinions, anybody? If we don't have anything, yet, I'm probably
going to extend the GraphicProvider implementation.
I see two problems:
1) this approach does not solve the same problem for dialogs included in
documents.
2) How should it work at design time?
When I start with a new extension, I usually create dialogs and macros
directly in the StarBasic IDE without actually having an extension
containing images and other resources.
I suppose that almost starbasic peoples use the same way
when you click on a (let's say) image control in order to select an
image, the environment put automatically the filesystem URL of the image.
If you manually change the URL to a special one (let's say
"private:graphics/extension/..." the image will disappear from the control.
Not only: when you finally create the extension you must remember to put
your images in the right path and then make the package, install it and
only at this point the image will be visible in the control.
IMHO the "image problem" is just a side effect of not having any
environment that supports the creation of an extension project.
An alternative approach would be to extend the image control (and any
other image-aware control) with the possbility to store itself the image.
This would hide tecnical problems to the user and would work for dialogs
either in extension and/or documents
ciao
Paolo M
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org