Difference between revisions of "Extensions Packager"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (A simple extension)
(BasicAddonBuilder 0.5.2)
 
(21 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
= BasicAddonBuilder =
 
= BasicAddonBuilder =
  
BasicAddonBuilder is an OpenOffice.org extension that allow you to
+
BasicAddonBuilder is an {{AOo}} extension that allow you to
export a StarBasic library in the OpenOffice.org extension format,  
+
export a StarBasic library in the {{AOo}} extension format,  
 
ready for deployment.
 
ready for deployment.
 
BasicAddonBuilder does not require special skills or a deep knowledge  
 
BasicAddonBuilder does not require special skills or a deep knowledge  
Line 10: Line 10:
 
A wizard-style dialog will guide you through the process, allowing
 
A wizard-style dialog will guide you through the process, allowing
 
you to define in a graphical way all menu and toolbars that will be  
 
you to define in a graphical way all menu and toolbars that will be  
added to the OpenOffice.org user interface in order to launch macros  
+
added to the {{AOo}} user interface in order to launch macros  
 
from your StarBasic library.
 
from your StarBasic library.
  
Line 17: Line 17:
 
The exported extension (AKA UNO package) will be ready to install in
 
The exported extension (AKA UNO package) will be ready to install in
 
any PC running OpenOffice.org 2.0 or above, using the Package manager.
 
any PC running OpenOffice.org 2.0 or above, using the Package manager.
(Menu Tools->Package manager...)
+
({{menu|Tools|Extension manager…}})
  
 
== Requirements ==
 
== Requirements ==
In order to use BasicAddonBuilder, you must have OpenOffice.org 2.2 or above
+
In order to use BasicAddonBuilder, you must have OpenOffice.org 2.2 or above installed.  
installed.  
+
 
BasicAddonBuilder will not work with OpenOffice.org 1.x  
 
BasicAddonBuilder will not work with OpenOffice.org 1.x  
  
 
== Install ==
 
== Install ==
BasicAddonBuilder is [http://www.paolo-mantovani.org/downloads/BasicAddonBuilder/ downloadable at this location] and can be installed with the Extension manager.
+
BasicAddonBuilder is [https://extensions.openoffice.org/en/project/basicaddonbuilder-extensions-packager downloadable at this location] and can be installed with the Extension manager.
* Menu Tools->Extension manager...
+
* Menu {{menu|Tools|Extension manager…}}
Further information in the OpenOffice.org Help
+
Further information in the {{AOo}} Help
  
 
== Known issues ==
 
== Known issues ==
 
* Missing documentation
 
* Missing documentation
 
The following features are not yet supported:
 
The following features are not yet supported:
* Dependances management of the generated extension
+
* Dependencies management of the generated extension
 
* Import/export of BasicAddonBuilder projects
 
* Import/export of BasicAddonBuilder projects
  
 
== Homepage ==
 
== Homepage ==
Current versions of BasicAddonBuilder for OpenOffice.org are always available [http://www.paolo-mantovani.org/downloads/BasicAddonBuilder/ here:]
+
Current versions of BasicAddonBuilder for {{AOo}} are always available [https://extensions.openoffice.org/en/project/basicaddonbuilder-extensions-packager here:]
  
 
== Contacting author ==
 
== Contacting author ==
Line 45: Line 44:
  
 
From AOO 4.0 has the configuration file addons.xcu a modified structure for toolbars, see:
 
From AOO 4.0 has the configuration file addons.xcu a modified structure for toolbars, see:
http://wiki.openoffice.org/wiki/Extensions/Extensions_and_Apache_OpenOffice_4.0#addons.xcu_changes
+
https://wiki.openoffice.org/wiki/Extensions/Extensions_and_Apache_OpenOffice_4.0#addons.xcu_changes
  
 
Therefore an update for BasicAddonBuilder is necessary because:
 
Therefore an update for BasicAddonBuilder is necessary because:
Line 67: Line 66:
 
In order to use BasicAddonBuilder 0.5.1, you must have OpenOffice.org (2.2 or above) or LibreOffice installed.
 
In order to use BasicAddonBuilder 0.5.1, you must have OpenOffice.org (2.2 or above) or LibreOffice installed.
 
Please note that for AOO up to version 3.4.1 and LO another installation file must be used, as for AOO 4.x.<br />
 
Please note that for AOO up to version 3.4.1 and LO another installation file must be used, as for AOO 4.x.<br />
BasicAddonBuilder can be installed with the Extension manager (Menu Tools->Extension manager...). <br /><br />
+
BasicAddonBuilder can be installed with the Extension manager ({{menu|Tools|Extension manager…}}). <br /><br />
  
'''Questions and bug reports'''<br />
 
 
Please send an email to [mailto:joesch@calc-info.de Jörg Schmidt]
 
 
<br /><br />
 
  
 
The following figures show the additional functions of BasicAddonBuilder 0.5.1
 
The following figures show the additional functions of BasicAddonBuilder 0.5.1
Line 84: Line 78:
  
 
<br />
 
<br />
 +
 +
== BasicAddonBuilder 0.5.2 ==
 +
 +
I got by Derby Russell, a new corrected version. Thank you. [Jörg Schmidt]
 +
 +
<br />
 +
 +
The new version Basic Addon Builder 0.5.2 is available for download here:
 +
 +
http://calc-info.de/files/BasicAddonBuilder-0.5.2.oxt
 +
 +
{{Note|This version is for Apache OpenOffice version 4.0 and higher}}
 +
 +
<br />
 +
 +
'''Additional Information (09/01/2016):'''
 +
 +
I got the message that the foregoing version ("Basic Addon Builder 0.5.2.oxt") does not install any toolbar in the use under LibreOffice, therefore additionally here a 0.5.2-version for use with LibreOffice:
 +
 +
http://calc-info.de/files/BasicAddonBuilder_LibreOffice_0.5.2.oxt
 +
 +
 +
The corrections are as follows:
 +
(Changes made by Derby Russell for 0.5.2)
 +
In the PkgExporter module:
 +
 +
* the line 74 was changed from: sTempDirUrl = GetTempFile() & "/" to sTempDirUrl = GetTempFile()
 +
* line 75 was added: sTempDirUrl = EnsureFolderNameIsLongType(sTempDirUrl)
 +
* line 76 was added: sTempDirUrl = sTempDirUrl & "/"
 +
* at line 597 a new function: pmxInStrRev was added
 +
* at line 639 a new function: SplitFolderPath was added
 +
* at line 652 a new function: SplitFolderName was added
 +
* at line 664 a new function: SplitFolderNamePath was added
 +
* at line 690 a new function: EnsureFolderNameIsLongType was added
  
 
= Extension Compiler =
 
= Extension Compiler =
  
There are many kinds of extensions : they may use languages other than Basic, or even set a configuration without any executable code. Usually an extension provides menus and toolbars for one or more applications (Writer, Calc...).
+
There are many kinds of extensions: they may use languages other than Basic, or even set a configuration without any executable code. Usually an extension provides menus and toolbars for one or more applications (Writer, Calc...).
  
 
For a professional look you will have to add copyright statements, create your own help pages, provide automatic update. All displayable texts will probably have to be translated in several languages. This means editing lots of files, testing and editing each time you have found a bug, or added a feature, or added a new language.
 
For a professional look you will have to add copyright statements, create your own help pages, provide automatic update. All displayable texts will probably have to be translated in several languages. This means editing lots of files, testing and editing each time you have found a bug, or added a feature, or added a new language.
  
 
The Extension Compiler can handle all kinds of extensions and reduce your work load. Its documentation guides you through most of the process.
 
The Extension Compiler can handle all kinds of extensions and reduce your work load. Its documentation guides you through most of the process.
You don't need to know all the implementation details, you don't need a complex environment. You will edit a Writer document to write the tooltip text, license text, help pages for your extension.
+
You don't need to know all the implementation details, you don't need a complex environment. You will edit a Writer document to write the extension description, the license text, the help pages for your extension, in various languages if needed.
  
You will then write a linear succession of simple Basic instructions to describe your extension.
+
The help pages for your extension may be specific to each application (Calc, Writer, Draw...). They are called by a help button in your dialogs, or by contextual help in the dialogs or menus, or from the help window. These help pages will be seamlessly integrated into the OpenOffice help system.
Run this Basic program: the Extension Compiler will create the files description.xml, addon.xml, manifest.xml, xxxWindowState.xml, and the license, tooltip, display name, help pages for different languages. All files will be encoded in UTF-8 to support national characters, stored in sub-folders. After a few seconds your oxt package is ready to be installed!
+
  
If you made an error, or if you are not satisfied with your extension, change some instructions and run again. For complex extensions, incremental design is easy: start simple, test, add a feature, test it, add another feature, etc.
+
You will then write a linear succession of simple Basic instructions to describe your extension.
 +
At a click on a button in the document, the Extension Compiler will create the files description.xml, addon.xml, manifest.xml, xxxWindowState.xml, and the license, extension description, display name, help pages for different languages. All files will be encoded in UTF-8 to support national characters, and stored in sub-folders. After a few seconds your oxt package is ready to be installed!
  
The help pages for your extension may be specific to each application (Calc, Writer, Draw...). They are called by a help button in your dialogs, or by contextual help in the dialogs or menus, or from the help window. These help pages will be seamlessly integrated into OpenOffice.org help system. If you have created your help in several languages OpenOffice.org will choose the language which fits the best with the User Interface language.
+
If you made an error, or if you are not satisfied with your extension, change some instructions and run again. For complex extensions (e.g. many menus or buttons), incremental design is easy: start simple, test, add a feature, test it, add another feature, etc.
  
 
== Requirements ==
 
== Requirements ==
You must have OpenOffice.org 2.4 or more recent (Apache OpenOffice, LibreOffice) installed.
+
The extensions are installable on OpenOffice.org 2.4 or more recent (Apache OpenOffice, LibreOffice).
  
 
== Install ==
 
== Install ==
  
Extension Compiler is a Writer template document. Store it in a folder where macros are allowed. Create a new Writer document by double-click or key Enter. You will be prompted to save it under the name of your extension in a dedicated folder where macro execution is allowed.
+
Extension Compiler is a Writer template document. Store it in a folder where macros are allowed.  
  
You will store in this dedicated folder all the libraries, files, images, needed for your extension. You may use sub-folders.
+
From this template, create a new Writer document by double-click or key {{button|Enter}}. You will be prompted to save it under the name of your extension in a dedicated folder where macro execution is allowed.
  
Write in this document the text of the tooltip, license and help pages of your extension, in as many languages as you like (or can).
+
Store all the libraries, files, images, needed for your extension, in this dedicated folder. You may use sub-folders.
  
Open the Basic IDE to the Standard library of this document. Open the module Module1 in this library. It contains a prepared macro : myExtension.
+
== Latest changes ==
Add your instructions where indicated. The instruction set is described in chapter 3 of the document, read it carefully. You will find typical examples in the modules named Template1 etc.
+
  
Run the macro. If you get an error message, correct your script and run again. Otherwise, your extension file is ready.
+
=== Version 2.1.2 ===
 +
Localized help : resolved inactive hyperlink due to API incompatibility introduced by Apache OpenOffice 4.1 (and LibreOffice 4.0).
  
== Latest changes ==
+
=== Version 2.1.1 ===
 +
Minor corrections, no impact for existing extensions.
 +
 
 +
=== Version 2.1 ===
 +
Extension Compiler can now compile extensions having more than one toolbar in an application context, for example an extension that adds 2 toolbars in Calc.
  
 
=== Version 2.0 ===
 
=== Version 2.0 ===
Line 124: Line 156:
 
== Related Issues ==
 
== Related Issues ==
  
As of OpenOffice.org version 3.1.0 there are currently some limitations or bugs in the extension mechanism itself, [http://qa.openoffice.org/issues/buglist.cgi?quicksearch=86437%2C86528%2C86534%2C86536%2C87230%2C87412%2C88470%2C91752%2C95086%2C99858 see these Issues].
+
There are currently some limitations or bugs in the extension mechanism itself, [http://qa.openoffice.org/issues/buglist.cgi?quicksearch=86437%2C86528%2C86534%2C87230%2C87412%2C91752%2C95086 see these Issues].
  
 
== Download ==
 
== Download ==
  
The latest version of Extension Compiler is [http://bernard.marcelly.perso.sfr.fr/Files_en/ExtensionCompiler.ott downloadable at this location].
+
The latest version of Extension Compiler is [http://berma.pagesperso-orange.fr/Files_en/ExtensionCompiler.ott downloadable at this location].
  
A french translation of the manual is [http://bernard.marcelly.perso.sfr.fr/Files_fr/ExtensionCompiler-Fr.odt downloadable at this location].
+
A French translation of the manual is [http://berma.pagesperso-orange.fr/Files_fr/ExtensionCompiler-Fr.odt downloadable at this location].
  
To help understand how it works, here are two examples of extension projects :
+
To help understand how it works, here are two examples of extension projects:
  
 
==== A simple extension ====
 
==== A simple extension ====
  
The archive [http://bernard.marcelly.perso.sfr.fr/Files_en/SimpleDemo.zip SimpleDemo.zip] contains the files necessary to compile the extension [http://extensions.services.openoffice.org/project/ImagesEmbedder Images Embedder] version 1.0.0. This extension installs a Basic program, without dialogs, and a menu item in Tools > Add-Ons. This menu item displays in several languages.
+
The archive [http://berma.pagesperso-orange.fr/Files_en/SimpleDemo.zip SimpleDemo.zip] contains the files necessary to compile the extension [http://extensions.openoffice.org/fr/project/images-embedder Images Embedder] version 1.0.0. This extension installs a Basic program, without dialogs, and a menu item in Tools Add-Ons. This menu item displays in several languages.
  
 
The archive unzips into a directory named ImagesEmbedder/.
 
The archive unzips into a directory named ImagesEmbedder/.
Line 144: Line 176:
 
==== A sophisticated extension ====
 
==== A sophisticated extension ====
  
The file [http://bernard.marcelly.perso.sfr.fr/Files_en/ExtensionDemo.zip ExtensionDemo.zip] shows more interesting features. The extension will require at least OpenOffice.org version 3.3.0.
+
The file [http://berma.pagesperso-orange.fr/Files_en/ExtensionDemo.zip ExtensionDemo.zip] shows more interesting features. The extension will require at least OpenOffice.org version 3.3.0.
  
 
This archive unzips into a directory named Demo/.  
 
This archive unzips into a directory named Demo/.  
Line 150: Line 182:
  
 
ExtExample adds a toolbar and some commands in the menu Tools > Add-Ons of Writer and Calc.
 
ExtExample adds a toolbar and some commands in the menu Tools > Add-Ons of Writer and Calc.
In Writer, Tools > Add-Ons sub-menu can start sample scripts in Basic, Python BeanShell, JavaScript, Java macro.
+
In Writer, Tools Add-Ons sub-menu can start sample scripts in Basic, Python BeanShell, JavaScript, Java macro.
  
Since there is a Toolbar, this extension is compiled to :
+
Since there is a Toolbar, this extension is compiled to:
 
* OpenOffice.org compatible (including LibreOffice)
 
* OpenOffice.org compatible (including LibreOffice)
 
* Apache OpenOffice 4.0  
 
* Apache OpenOffice 4.0  
  
Since it uses non-Basic scripts, this extension is also compiled :
+
Since it uses non-Basic scripts, this extension is also compiled for the current user only and for all users.
* For the current user only
+
* For all users
+
 
+
The Extension Compiler has produced the four variants from a unique extension.
+
 
+
  
{{Documentation/Caution|Java-like scripts won't be recognized at first ({{bug|99858}}).
+
The Extension Compiler creates the four variants from a unique extension.
Work-around : after installing the extension, click button Disable. When finished, click button Enable.}}
+
  
 
== Contacting author ==
 
== Contacting author ==
Line 170: Line 196:
 
Extension Compiler is written by Bernard Marcelly.
 
Extension Compiler is written by Bernard Marcelly.
 
Please send your suggestions and bug reports at the address indicated in the document.
 
Please send your suggestions and bug reports at the address indicated in the document.
Feedbacks are welcome.
+
Feedback are welcome.
  
  
 
[[Category:Extensions]]
 
[[Category:Extensions]]

Latest revision as of 12:25, 28 August 2022


BasicAddonBuilder

BasicAddonBuilder is an Apache OpenOffice extension that allow you to export a StarBasic library in the Apache OpenOffice extension format, ready for deployment. BasicAddonBuilder does not require special skills or a deep knowledge of extensions specifications. A wizard-style dialog will guide you through the process, allowing you to define in a graphical way all menu and toolbars that will be added to the Apache OpenOffice user interface in order to launch macros from your StarBasic library.

BasicAddonBuilder

The exported extension (AKA UNO package) will be ready to install in any PC running OpenOffice.org 2.0 or above, using the Package manager. (Tools → Extension manager…)

Requirements

In order to use BasicAddonBuilder, you must have OpenOffice.org 2.2 or above installed. BasicAddonBuilder will not work with OpenOffice.org 1.x

Install

BasicAddonBuilder is downloadable at this location and can be installed with the Extension manager.

  • Menu Tools → Extension manager…

Further information in the Apache OpenOffice Help

Known issues

  • Missing documentation

The following features are not yet supported:

  • Dependencies management of the generated extension
  • Import/export of BasicAddonBuilder projects

Homepage

Current versions of BasicAddonBuilder for Apache OpenOffice are always available here:

Contacting author

Please send your suggestions and bug reports to: Paolo Mantovani Any feedback is welcome!

BasicAddonBuilder and AOO 4.x

From AOO 4.0 has the configuration file addons.xcu a modified structure for toolbars, see: https://wiki.openoffice.org/wiki/Extensions/Extensions_and_Apache_OpenOffice_4.0#addons.xcu_changes

Therefore an update for BasicAddonBuilder is necessary because:

  • own toolbar of the BasicAddonBuilder 0.5.0 (and earlier releases) is not displayed in AOO 4.0 (and later versions)
  • BasicAddonBuilder 0.5.0 (and earlier releases) can not create extensions, which include toolbars that can be displayed in AOO 4.0 (and later versions)

I wrote Paolo Mantovani, and Paolo replied me that he currently does not have time to create a new version of BasicAddonBuilder. Therefore, I (Jörg Schmidt) have now created a new Version (0.5.1).

BasicAddonBuilder 0.5.1 (Beta)

At the moment there are (initially for testing purposes) two different versions of BasicAddonBuilder 0.5.1

http://calc-info.de/files/BasicAddonBuilder-0.5.1.oxt (compatible with AOO 4.x)
http://calc-info.de/files/BasicAddonBuilder-oo3x-0.5.1.oxt (compatible up to AOO 3.4.1 and LibreOffice(*))

Both versions can produce compatible extensions for all versions of OOo, AOO and LO(*).

(*) not specifically tested

Requirements / Install
In order to use BasicAddonBuilder 0.5.1, you must have OpenOffice.org (2.2 or above) or LibreOffice installed. Please note that for AOO up to version 3.4.1 and LO another installation file must be used, as for AOO 4.x.
BasicAddonBuilder can be installed with the Extension manager (Tools → Extension manager…).


The following figures show the additional functions of BasicAddonBuilder 0.5.1

  • adjustable compatibility for toolbars in the created extension
  • embed the publisher in the created extension (in the file description.xml)

General Options

Licence and Version


BasicAddonBuilder 0.5.2

I got by Derby Russell, a new corrected version. Thank you. [Jörg Schmidt]


The new version Basic Addon Builder 0.5.2 is available for download here:

http://calc-info.de/files/BasicAddonBuilder-0.5.2.oxt

Documentation note.png This version is for Apache OpenOffice version 4.0 and higher


Additional Information (09/01/2016):

I got the message that the foregoing version ("Basic Addon Builder 0.5.2.oxt") does not install any toolbar in the use under LibreOffice, therefore additionally here a 0.5.2-version for use with LibreOffice:

http://calc-info.de/files/BasicAddonBuilder_LibreOffice_0.5.2.oxt


The corrections are as follows: (Changes made by Derby Russell for 0.5.2) In the PkgExporter module:

  • the line 74 was changed from: sTempDirUrl = GetTempFile() & "/" to sTempDirUrl = GetTempFile()
  • line 75 was added: sTempDirUrl = EnsureFolderNameIsLongType(sTempDirUrl)
  • line 76 was added: sTempDirUrl = sTempDirUrl & "/"
  • at line 597 a new function: pmxInStrRev was added
  • at line 639 a new function: SplitFolderPath was added
  • at line 652 a new function: SplitFolderName was added
  • at line 664 a new function: SplitFolderNamePath was added
  • at line 690 a new function: EnsureFolderNameIsLongType was added

Extension Compiler

There are many kinds of extensions: they may use languages other than Basic, or even set a configuration without any executable code. Usually an extension provides menus and toolbars for one or more applications (Writer, Calc...).

For a professional look you will have to add copyright statements, create your own help pages, provide automatic update. All displayable texts will probably have to be translated in several languages. This means editing lots of files, testing and editing each time you have found a bug, or added a feature, or added a new language.

The Extension Compiler can handle all kinds of extensions and reduce your work load. Its documentation guides you through most of the process. You don't need to know all the implementation details, you don't need a complex environment. You will edit a Writer document to write the extension description, the license text, the help pages for your extension, in various languages if needed.

The help pages for your extension may be specific to each application (Calc, Writer, Draw...). They are called by a help button in your dialogs, or by contextual help in the dialogs or menus, or from the help window. These help pages will be seamlessly integrated into the OpenOffice help system.

You will then write a linear succession of simple Basic instructions to describe your extension. At a click on a button in the document, the Extension Compiler will create the files description.xml, addon.xml, manifest.xml, xxxWindowState.xml, and the license, extension description, display name, help pages for different languages. All files will be encoded in UTF-8 to support national characters, and stored in sub-folders. After a few seconds your oxt package is ready to be installed!

If you made an error, or if you are not satisfied with your extension, change some instructions and run again. For complex extensions (e.g. many menus or buttons), incremental design is easy: start simple, test, add a feature, test it, add another feature, etc.

Requirements

The extensions are installable on OpenOffice.org 2.4 or more recent (Apache OpenOffice, LibreOffice).

Install

Extension Compiler is a Writer template document. Store it in a folder where macros are allowed.

From this template, create a new Writer document by double-click or key  Enter . You will be prompted to save it under the name of your extension in a dedicated folder where macro execution is allowed.

Store all the libraries, files, images, needed for your extension, in this dedicated folder. You may use sub-folders.

Latest changes

Version 2.1.2

Localized help : resolved inactive hyperlink due to API incompatibility introduced by Apache OpenOffice 4.1 (and LibreOffice 4.0).

Version 2.1.1

Minor corrections, no impact for existing extensions.

Version 2.1

Extension Compiler can now compile extensions having more than one toolbar in an application context, for example an extension that adds 2 toolbars in Calc.

Version 2.0

Extension Compiler can now compile the same extension to different variants, if needed : OpenOffice.org or compatible, Apache OpenOffice 4.0 or more recent, LibreOffice 3.5 or more recent.

Related Issues

There are currently some limitations or bugs in the extension mechanism itself, see these Issues.

Download

The latest version of Extension Compiler is downloadable at this location.

A French translation of the manual is downloadable at this location.

To help understand how it works, here are two examples of extension projects:

A simple extension

The archive SimpleDemo.zip contains the files necessary to compile the extension Images Embedder version 1.0.0. This extension installs a Basic program, without dialogs, and a menu item in Tools → Add-Ons. This menu item displays in several languages.

The archive unzips into a directory named ImagesEmbedder/.

Open the document ImagesEmbedder.odt, then at chapter 2.3.1 click the button Compile to OpenOffice.org or compatible. The oxt file will be created in the same folder.

A sophisticated extension

The file ExtensionDemo.zip shows more interesting features. The extension will require at least OpenOffice.org version 3.3.0.

This archive unzips into a directory named Demo/. It contains all the data to create the extension ExtExample. The compiled extension package is also in the folder.

ExtExample adds a toolbar and some commands in the menu Tools > Add-Ons of Writer and Calc. In Writer, Tools → Add-Ons sub-menu can start sample scripts in Basic, Python BeanShell, JavaScript, Java macro.

Since there is a Toolbar, this extension is compiled to:

  • OpenOffice.org compatible (including LibreOffice)
  • Apache OpenOffice 4.0

Since it uses non-Basic scripts, this extension is also compiled for the current user only and for all users.

The Extension Compiler creates the four variants from a unique extension.

Contacting author

Extension Compiler is written by Bernard Marcelly. Please send your suggestions and bug reports at the address indicated in the document. Feedback are welcome.

Personal tools