Apache OpenOffice (AOO) Bugzilla – Issue 102542
Non-Basic Scripts should run both at user and share level
Last modified: 2017-05-20 10:55:57 UTC
The current URI specification for running a non-Basic script (JavaScript, BeanShell, Java, Python) is : vnd.sun.star.script:MACROREF?language=Language&location=[user|share|document] The consequence is that an extension containing a non-Basic script will contain URI's where the running level is fixed : either <user> or <shell>. These URI's are hard- written for example in the AddonUI.xcu file, or in the event tab of a dialog control. So if the extension designer wants its extension to be installed in user or shared levels, he/she must provide and maintain two variants of the same extension. Minimal request: Add another location, e.g. <office>, which means : search the script in the <user> layer, and if not found search in the <share> layer. Desirable request: If the URI contains <user>, search the script in the <user> layer, and if not found search in the <share> layer. This variant has the advantage of enhancing the usage of existing extensions. Then there is no need for a new location like <office>. If the URI contains <share> we could suppose that the intention of the designer is to restrict to <share> only.
I understand your problem but currently I don't have any capacity to deal with it. Maybe there's anyone who can have a look at the implementation and send a patch? STARTED
Can you provide such an extension (please attach) so that one can have a look on the problem right away?
I will attach two variants of the same simple extension. Both contain Basic, JavaScript, BeanShell, Python scripts. They all write a little text on the current Writer document. demoShare-1.0.oxt works OK if installed for "single user". demoShare-2.0.oxt works OK if installed for "all users". Install demoShare-1.0.oxt for ALL users, open a new Writer document. Run the scripts from Tools > Add-ons > Demo scripts for share/user > ... Only Basic works. Other scripts display an error "Cannot resolve script location for script = xxxx" Uninstall demoShare-1.0.oxt Install demoShare-2.0.oxt for a SINGLE user, open a new Writer document. Run the scripts from Tools > Add-ons > Demo scripts for share/user > ... Only Basic works. Other scripts display an error "Cannot resolve script location for script = xxxx" The reason is the URI in the file AddonUI.xcu. The same problem would appear from an extension toolbar button. For example for BeanShell we have: <value>vnd.sun.star.script:bshTest1.HeyWriter.bsh? language=BeanShell&location=user:uno_packages/demoShare-1.0.oxt</value> For all users, the term user must be replaced by "share" <value>vnd.sun.star.script:bshTest1.HeyWriter.bsh? language=BeanShell&location=share:uno_packages/demoShare-1.0.oxt</value> Conclusion : Because of the current URI syntax you need to provide separate extensions, one for user, one for share. Related bug : see Issue 105169
Created attachment 64836 [details] This variant is desgned to work for a single user
Created attachment 64837 [details] This variant is designed to work for all users
.
Reset assigne to the default "issues@openoffice.apache.org".