Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

OpenOffice.org
Development digest
week 8 (2004)

by C.P. Hennessy

translation available thanks to .

Development snapshot m26 available

The latest development snapshot m26 has many improvements including : Allow creation of dialogs via a UNO service, Provide example scripts in all languages, Macro Security, Add Python Scripting Runtime to installset, Implement API functionality for creating new Charts from spreadsheets.

New cvs module scp2 instead of scp

Ingo Schmidt wrote to the dev@porting mailing list to tell them about the replacement of an old core module with a new module.
Beginning in src680m25 (post cws_src680_ooo20040225) [Ed:and hence in m26 above] the new cvs module scp2 replaces the old scp module. The old scp is no longer part of the build process. scp2 is the new module describing the OOo installation sets.

Why these changes?

The new scp structure allows the creation of difference scp files in which you can define and undefine scp defintions to describe the difference of two products.

Example: To undefine the defintion of gid_File_Abc you only need to add in the scp project the following code line: UnFile gid_File_Abc and the file defined with gid_File_Abc is no longer part of the product.

There is another big advantage. Because of the undefining mechanism it is no longer necessary to use product defines like #ifdef OSL_PRODUCT inside the scp files. Therefore every scp file will only be built once, leading to a dramatic decrease of build time for the scp2 project compared with the old scp project. The removal of product defines inside scp files also leads to more simplicity of this files.

A more detailed documentation of the new scp can be found here

N steps to adding a new menu entry

Duncan Foster (from the scripting project) recently was working on add a new menu entry for a scripting need. I asked him to summarize the steps necessary as it may be of interest to others. He kindly responded with :
First note that in the OOo 2.0 tree, some or all of this is going to change in the near future. I think the slots stuff will remain the same, just the way the menu entries are defined. Also note that the following is based on experience of working in the SRC680 branch. I think the menu entries have changed slightly from SRX645, with things being moved out of the offmgr project.

So, say for example I want to add an entry, "Script organizer", below the entry "macro..." in the Tools->Macro sub-menu.

The first step is define a new "slot" that links the menu entry to the code that it will execute. these are defined in sfx2/inc/sfxsids.hrc. I define a new slot SID_SCRIPTORGANIZER to be same value as the existing SID_SFX_free_START, and incremented the SID_SFX_free_START by one.

Next I define the link between the slot, and the code that handles it. For my slot, the application code should handle the execution so this is done in sfx2/sdi/appslots.sdi. See also other files in this directory, or similar sdi directories in other modules (eg basctl).

In the section that starts "shell SfxApplication" I add the lines:

SID_SCRIPTORGANIZER
[
        ExecMethod = OfaExec_Impl;
]
which means that my slot will be handled by the method
SfxApplication::OfaExec_Impl.
Then in sfx2/source/appl/appserv.cxx I add code to the method SfxApplication::OfaExec_Impl to handle the case for the new slot.

In sfx2/sdi/sfx.sdi, I duplicate the SID_BASICCHOOSER entry, and change "MacroDialog" to "ScriptOrganizer", and SID_BASICCHOOSER to SID_SCRIPTORGANIZER.
This is the slot definition file where attributes for a slot can be defined, like this is a user interface command which can be customized to tool bars, menus and accelerators. You can define if the slot is a state, a function or both. You can add parameters and define the type of a state slot. Don't ask me what the entries mean!!

In sfx2/sdi/sfxslots.src, added an SfxSlotInfo for the slot. These are the localized names for the slot.

Build & delivered in sfx2. We now have the back end, handling the execution.

The actual menu entries are defined in a number of places. For things that are duplicated across several apps, such as the Tools->Macros submenu, we find the definition in svx/inc/globlmn.hrc. Here I add a new menuItem for the new slot to the ITEM_TOOLS_MACROS (using the existing entries as a template). The identifier and helpid are the SID, the command is .uno:ScriptOrganizer. The command name is what we will see if we record a macro that uses this slot.

Run the built & deliver commands in svx. The globlnm.hrc is included in offmgr/inc/offmenu.hrc, so we must build & deliver this project too. And then rebuild each of the application projects (sw, sc...). This is necessary to deliver the slot.ilb files which are merged from lower libraries. And finally build in instsetoo and install the rebuild app with your new menu entry!!

Other development news

Oasis Open Office file format status

The Oasis Technical committee on Open Office XML Formats had a meeting on Feburary 16th and the meeting minutes are available. The specifictaion is at draft 6 at this stage, os it is getting very close to a final 1.0 release.

Interesting LinuxJournal feature articles

In the March 2004 issue of Linux Journal there are several features which may be of interest to OOo develoeprs including :
The OASIS Standard for Office Documents by Marco Fioretti
A common file format lets apps compete on features and ease of use.
and
Manipulating OOo Documents with Ruby by James Britt
XML and Ruby let your scripts and your office suite handle the same files.
There are also other articels in that issue which are of more interest to users.

Encouraging more developers

During a conversation on the discuss mailing list I asked what people thought would be of interest to prospective developers to help them understand and use OpenOffice.org APIs. Daniel Carrera replied with:
This is what I think we should do to attrack developers:
  1. Simplify the Python bindings. There seems to be a lot of unnecessary work that could be done behind the scenes.
  2. Create Ruby bindings (Ruby is a fantastic language, imagie taking the best bits of Perl and Python and then making it better).

    (steps 1 and 2 would make it easier to develop for OOo).

  3. Write tutorials that walk the reader through making simple extensions using Ruby or Python.
Alexandro Colorado (the Spanish translator of this digest) replied with his own comment and list :
The Developer's guide successfully goes through a remote script-generated OOo document. So does the PyUNO binding, however I would love to see more of these tutorials, independent from the developer guide. Something like: I love the way the kde-look developer used Tcl to skin OpenOffice.org, a tutorial to maybe do it in some other language (using native OOo bindings) could also be interesting. Of course this is a little harder.

This weeks Issuezilla summary

Many bugs have been worked on and resolved (as of Monday Feb 23 2004 ):

 No this week Change from last week
Total issues submitted in the week 2434
0
Issues submitted in the week resolved or closed 261
-42
Issues which have the status UNCONFIRMED 257
-22
Issues which have the status NEW 1080
34
Issues which have the status STARTED 1087
5
Issues which have the status FIXED 7994
88
(a more detailed set of statistics is available here)

Some of the more interesting CVS developments over the last week include:

week 8 (2004):

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.