On 3/22/10 7:45 PM, Mathias Bauer wrote:
Frank Schoenheit, Sun Microsystems Germany wrote:

Hi Paolo,

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

because you would need to know, at time of creation of your extension,
the "sJYsUf_" part of the path, which is impossible. Okay, with the
brand-new XDeploymentHook interface, you could probably add a hook which
is executed when the extension is deployed, and updates the
configuration with the proper URL. Possible, but still pretty ugly, and
a workaround, not a solution.

Sure? IIRC there was a way to have "%origin%" as a placeholder in
entries of xcu files that will be expanded at deployment time or can be
resolved at runtime to give you that path. I used that technique in
several extensions, without being forced to any such hacks as deployment
hooks.

A quick search showed me that this technique is still used, e.g. in the
presentation minimizer extension. The code in this extension using the
images referencing "%origin%" should show you whether the expansion
happens at runtime or already at deployment time (IIRC it was the latter).

yes, that still works with the drawback that %origin% expands to the path of the xcu file, means often somewhere in the hierarchy of the extension (e.g. <ext_root>/registry/data/org/openoffice/Office). If your images are located for example in <ext_root>/images/myimage.png you have to use something like %ORIGIN%/../../../../../images/myimage.png in a Addons.xcu that is stored in ...openoffice/Office.

Would should think about a further macro that expands to the extension root directory.

Juergen




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to