Issue 86528 - Extensions in StartModule, Chart, Bibliography
Summary: Extensions in StartModule, Chart, Bibliography
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: OOO300m9
Hardware: All Windows XP
: P3 Trivial (vote)
Target Milestone: 4.2.0
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-27 20:10 UTC by bmarcelly
Modified: 2017-05-20 10:35 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Small extension changing StartModule, Chart, Bibliography (10.15 KB, application/vnd.openofficeorg.extension)
2008-02-27 20:12 UTC, bmarcelly
no flags Details
Extension updated to Apache OpenOffice 4.x (10.63 KB, application/octet-stream)
2014-02-01 10:12 UTC, bmarcelly
no flags Details
Patch to change the way to match Context value with module identifer (17.29 KB, patch)
2014-02-02 07:14 UTC, hanya
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2008-02-27 20:10:53 UTC
I create a simple extension which adds an AddonMenu and a toolbar in the following 
applications: StartModule, Chart, Bibliography, (and Writer and Calc).

In Chart : no AddonMenu, no Toolbar. This should be possible, according to Dev'Guide 
Add-Ons chapter, descriptions of Context.

In Bibliography : toolbar appears, but no AddonMenu. This should be possible, 
according to Dev'Guide.

In StartModule : toolbar appears, but no AddonMenu. This is not explicitly described 
in the Dev'Guide, but it should be expected working.

Next attachment is the test extension used.
Comment 1 bmarcelly 2008-02-27 20:12:05 UTC
Created attachment 51764 [details]
Small extension changing StartModule, Chart, Bibliography
Comment 2 bmarcelly 2008-10-20 12:44:29 UTC
Correction : in Chart the AddonMenu appears. But not the toolbar.

Updated also because the same defects still appear on OOo 3.0.0
Comment 3 Olaf Felka 2009-05-08 07:32:29 UTC
@ jl: Please have a look.
Comment 4 joachim.lingner 2009-06-23 15:10:13 UTC
The Addons.xcu seems to be properly installed in
<UserInstallation>/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/registry/data/org/openoffice
I can see the toolbar in a writer and calc document and in the start window.
There is no menu item in the start window. 
Using a chart in a spreadsheet I have a menu but no toolbar. 

@CD: Please investigate. See also issue 50885. It deals with the limited path
length on Windows. This issue could be related to it.

Comment 5 Edwin Sharp 2014-01-31 13:42:24 UTC
Please specify steps to reproduce.
Comment 6 bmarcelly 2014-02-01 10:12:48 UTC
Created attachment 82461 [details]
Extension updated to Apache OpenOffice 4.x

Tested on Apache OpenOffice 4.0.1 on Windows 7

Install the attached extension. Restart OpenOffice.

When StartModule is displayed : the extension toolbar appears, but no AddonMenu. 

Open a new Writer window. The toolbar appears and the AddonMenu also, as specified in the AddonUI.xcu.
Open menu Tools > Bibliography. The extension toolbar appears, but no AddonMenu.

Open a Calc document. The toolbar appears and the AddonMenu also, as specified in the AddonUI.xcu.
Create a chart in the Calc document. When the chart is selected, toolbars change.
The extension toolbar does not appear, there is no AddonMenu.
Comment 7 hanya 2014-02-02 05:10:40 UTC
In the case of addons toolbar, Context value of the toolbar item is compared by 
the module identifier taken from com.sun.star.frame.ModuleManager service.
But addons menu mergeing uses com.sun.star.lang.XServiceManager::supportsService 
method to check the service is supported one of Context value.

StartModule and Bibliography do not have document model, so always failed about 
merging addons menu.
In the case of Chart, addons menu is shown on my environment. Because 
"com.sun.star.chart2.ChartDocument" is supported by the chart model.
But the module identifier is not match to "com.sun.star.chart.ChartDocument" 
and addons toolbar is not shown.

ModuleManager::identify method tries to get service name of the document and 
recent service name for the chart document is "com.sun.star.chart2.ChartDocument".
Comment 8 hanya 2014-02-02 07:14:58 UTC
Created attachment 82467 [details]
Patch to change the way to match Context value with module identifer

Using the same way that used in framework::AddonsToolBoxFactory class in 
addons menubar mergins in framework::AddonMenuManager.

The patch does noting about module name for the Chart document but: 
Module name for Chart document should be "com.sun.star.chart2.ChartDocument" in Context property of /org.openoffice.Office.Addons children.
Comment 9 Edwin Sharp 2014-02-02 07:33:34 UTC
Thank you
Comment 10 bmarcelly 2014-02-02 08:39:19 UTC
Thanks, Hanya!

I have verified that using com.sun.star.chart2.ChartDocument resolves the problem for chart context.
Service c.s.s.chart2.ChartDocument was introduced in OOo 2.3.

I have corrected the Developer's Guide Addon pages
https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/AddOns/Menus 
https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/AddOns/Toolbars
https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/AddOns/Help_Integration 

and added reference to service c.s.s.chart2.ChartDocument in
https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Component/Models

https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Models
Comment 11 SVN Robot 2014-05-16 12:48:54 UTC
"hanya" committed SVN revision 1595181 into trunk:
#i86528# use the module manager to identify the context for addons menu merging
Comment 12 hanya 2014-05-16 13:13:03 UTC
Fixed on trunk.
To verify, see comment 6.