Difference between revisions of "Office modules since OpenOffice.org 2.3"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Example in OpenOffice.org Basic)
(Example in OpenOffice.org Basic)
Line 98: Line 98:
 
   Dim oModuleManager as Object
 
   Dim oModuleManager as Object
 
   oModuleManager = createUnoService("com.sun.star.frame.ModuleManager")
 
   oModuleManager = createUnoService("com.sun.star.frame.ModuleManager")
   MsgBox Join(oModuleManager.getElementNames(), chr(10)),64, "OpenOffice.org Modules"
+
 
 +
   Dim sMessage$, sModules$()
 +
  Dim i%
 +
  sModules = oModuleManager.getElementNames()
 +
  For i=0 To UBound(sModules)
 +
        sMessage = sMessage + "[" + CStr(i+1) + "]    " + sModules(i) + Chr(13)
 +
  Next
 +
 
 +
  MsgBox sMessage,64, "OpenOffice.org Modules"
 
End Sub
 
End Sub
 
</source>
 
</source>

Revision as of 19:28, 8 December 2009

Since OpenOffice.org 2.3 the context for UI configuration has grown up to 20 modules. This was mainly due to the new feature that allows OpenOffice.org Base to have separated UI configuration modules for database forms and database reports, so that the settings are not shared with text documents anymore.


List of available modules

The following is an up-to-date list of available modules with a short description:


Module name Description
com.sun.star.text.TextDocument OpenOffice.org Writer
com.sun.star.text.WebDocument OpenOffice.org Writer/Web
com.sun.star.text.GlobalDocument OpenOffice.org Writer/Master Document
com.sun.star.sheet.SpreadsheetDocument OpenOffice.org Calc
com.sun.star.presentation.PresentationDocument OpenOffice.org Impress
com.sun.star.drawing.DrawingDocument OpenOffice.org Draw
com.sun.star.formula.FormulaProperties OpenOffice.org Math
com.sun.star.chart2.ChartDocument OpenOffice.org Chart
com.sun.star.xforms.XMLFormDocument XML Forms (XForms)
com.sun.star.sdb.OfficeDatabaseDocument OpenOffice.org Base: This module represents OpenOffice.org Base main application; that is, the application main window when you open an ODB file
com.sun.star.sdb.TableDesign OpenOffice.org Base: Table Design module
com.sun.star.sdb.QueryDesign OpenOffice.org Base: This is the module where you design queries and views. The module is the same for Design View and SQL View.
com.sun.star.sdb.RelationDesign OpenOffice.org Base: Module to design database relations
com.sun.star.sdb.FormDesign OpenOffice.org Base: Module for creating/editing and viewing embedded forms
com.sun.star.report.ReportDefinition OpenOffice.org Base: new Sun Report Builder in design view. The executed report will be a com.sun.star.text.TextDocument or com.sun.star.sheet.SpreadsheetDocument
com.sun.star.sdb.TextReportDesign OpenOffice.org Base: Module for creating/editing and viewing reports created using the report wizzard
com.sun.star.sdb.DataSourceBrowser In OpenOfice.org Base: the component where you open tables/view/queries; in other modules: component to access every datasource registered in OpenOffice.org (pressing F4)
com.sun.star.script.BasicIDE OpenOffice.org Basic IDE
com.sun.star.frame.StartModule the start module is the last component that remains when you close every Office document with the X at the right corner of the menu bar, without termitating the Desktop
com.sun.star.frame.Bibliography Bibliographical database

How to get the module's names

You can get a list of modules by querying the service com.sun.star.frame.ModuleManager.

Example in Java:

    public static void main(String[] args) {
        try {
            com.sun.star.uno.XComponentContext xContext = 
                    com.sun.star.comp.helper.Bootstrap.bootstrap();
 
            com.sun.star.uno.XInterface xInterface = 
                    (com.sun.star.uno.XInterface) 
                        xContext.getServiceManager().createInstanceWithContext(
                            "com.sun.star.frame.ModuleManager", xContext);
 
            com.sun.star.container.XNameAccess xNameAccess = 
                    (com.sun.star.container.XNameAccess) 
                        com.sun.star.uno.UnoRuntime.queryInterface(
                            com.sun.star.container.XNameAccess.class, xInterface);
 
            String[] modules = xNameAccess.getElementNames();
            for (String module : modules) {
                System.out.println( module );
            }
 
        } catch (com.sun.star.comp.helper.BootstrapException e){
            e.printStackTrace();
        } catch (com.sun.star.uno.Exception e){
            e.printStackTrace();
        } catch (java.lang.Exception e){
            e.printStackTrace();
        } finally {
            System.exit( 0 );
        }
    }

Example in OpenOffice.org Basic

Sub OOoModules
   Dim oModuleManager as Object
   oModuleManager = createUnoService("com.sun.star.frame.ModuleManager")
 
   Dim sMessage$, sModules$()
   Dim i%
   sModules = oModuleManager.getElementNames()
   For i=0 To UBound(sModules)
         sMessage = sMessage + "[" + CStr(i+1) + "]    " + sModules(i) + Chr(13)
   Next
 
   MsgBox sMessage,64, "OpenOffice.org Modules"
End Sub
Personal tools