Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
ridolfin
Posts: 5
Joined: Thu Jun 21, 2012 6:14 pm
Location: France

Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by ridolfin »

Hello all, this is my first post for years on this Forum. So let me introducing myself : I am using OpenOffice at home for more than 20 years. I am coding in ooBasic and made different applications with it on calc, writer and draw. I am also using LibreOffice and try to keep compatibility between my macros for both distribution. I already made some extensions in order to install easily my programs on different computers and OO suites, with no major difficulties up to now.
Here is my issue :
I recently developed an application that I would like to run only from the StartModule of the AOO or LO suites. When installing the extension I am using the unique StarModule context inside the Addon.xcu file. However, it is working smoothly to install my new menu on LO but it doesn't show up on AOO. The macros are however installed correctly on both suites and I can use them withour errors.
During my investigations I made tests with no context for the extension menu, and in that case the menu is actually well displayed by AOO, but in all the modules naturally, and including also the StartModule (Desktop of AOO).
Questions :
1 - Is one of you aware of that difference of behaviour between LO and AOO ? It looks like AOO is just not interpreting at all the com.sun.star.frame.StartModule instruction but LO perfectly does.
2 - Do you know a remedial / fix for this as I don't want my menu for my application to appear in all contexts of AOO but on start Desktop ?
AddonUI.txt
This is the Addon.xcu file (change in .txt for attachment)
(4.98 KiB) Downloaded 23 times
Last edited by floris v on Fri Aug 30, 2024 11:33 am, edited 2 times in total.
Reason: Removed Solved icon as the topic isn't really solved, floris v
OpenOffice 4.1.15 on Windows 11 - LibreOffice 24.2.5.2 on Windows 11
User avatar
Lupp
Volunteer
Posts: 3586
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by Lupp »

https://api.libreoffice.org/docs/idl/re ... odule.html
The service was introduced for LibreOffice with version 4.1.
The split between LibO and OO.o/AOO was with version 3.3.
Most ehancements made by LibO since may not be available in AOO.

(I never used that service and lacking experience I can surely not suggest a remedy.)
On Windows 10: LibreOffice 24.2.4 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
ridolfin
Posts: 5
Joined: Thu Jun 21, 2012 6:14 pm
Location: France

Re: Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by ridolfin »

Thank you Lupp. This can clarify my issue as I didn't care to that point when checking the API.
Perhaps one other member bumped on this same issue and found a workaround.
I will keep searching on my own and post if I am progressing.
OpenOffice 4.1.15 on Windows 11 - LibreOffice 24.2.5.2 on Windows 11
User avatar
ridolfin
Posts: 5
Joined: Thu Jun 21, 2012 6:14 pm
Location: France

Re: Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by ridolfin »

Not fully solved but I found an acceptable workaround.
It works both on AOO and LO if we don't try to add a new menu (only on StartModule) for the extension but If we actually merge its menu inside an existing one of the Desktop menubar menus.
Not exactly answering the initial specification ; so I will keep this post open a few more days. See attached the new Addon.xcu in txt format.
Merging-AddonUI.txt
(7.02 KiB) Downloaded 18 times
Note : I am still thinking how to make it works as per the initial specification (having an extension proper menu entry at top level of the menubar, for the StartModule only, and both in AOO & LO). One idea to dig into : at first initializationthe extension run one patch that will add a specific .xcu to the user configuration in order to remove the extension menu entry in the menubars of all the modules for which we don't want that menu to appear. Quite a bulky approach but should work - at least the next time the user open AOO , however it will need of a bunch of new coding. I am unsure I want to work on this for now.
OpenOffice 4.1.15 on Windows 11 - LibreOffice 24.2.5.2 on Windows 11
JeJe
Volunteer
Posts: 2897
Joined: Wed Mar 09, 2016 2:40 pm

Re: Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by JeJe »

This sample shows modifying a menu at runtime:

https://wiki.openoffice.org/wiki/API/Sa ... rites-Menu
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
ridolfin
Posts: 5
Joined: Thu Jun 21, 2012 6:14 pm
Location: France

Re: Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by ridolfin »

Thank you Jeje. This could help me if I have to change my plan to rely on an AOO/LO registry implementation for the access to the extension.
The use the .xcu / .xcs files to build a decent registry could be questionned but we need to do with it for the best and the worst.
What I cannot figure out is why AOO is able to implement my merged menu in the StartModule context (and how it is actually created inside the registry consolidation in that case) AND why I can't twist the registry to make it work like I want ???
I guess I will have to launch myself in an xml/xcu/xcs exploration nightmare of AOO during upcoming nights ...
I will keep you posted in case I finally find the brilliant light of a solution. And I close this topic to avoid it stays as my frustration evidence.
OpenOffice 4.1.15 on Windows 11 - LibreOffice 24.2.5.2 on Windows 11
User avatar
floris v
Volunteer
Posts: 4464
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by floris v »

ridolfin wrote: Thu Aug 29, 2024 11:16 pm (...) And I close this topic to avoid it stays as my frustration evidence.
Please don't tag a topic as Solved when it isn't. It's very unlikely that anyone else will be working on the same thing as you, but you don't want to frustrate them by leading them to a topic suggesting a solution when it isn't a solution.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
ridolfin
Posts: 5
Joined: Thu Jun 21, 2012 6:14 pm
Location: France

Re: Creating Extension : StartModuLe context disregarded in AOO 4.1.15

Post by ridolfin »

Oh sorry for this Floris - I understand your point and will continue my investigations anyway. Hope one of the community can help or can be helped anyway about this topic.
OpenOffice 4.1.15 on Windows 11 - LibreOffice 24.2.5.2 on Windows 11
Post Reply